@clickview/library-editor 1.23.0 → 1.24.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.
- package/dist/bundles.json +2 -2
- package/dist/css/{library-editor-app-a25270bc2a.css → library-editor-app-04ed8f1811.css} +1 -1
- package/dist/scripts/1302-bdeb3e1979.chunk.js +1 -0
- package/dist/scripts/{1601-2cee26f841.chunk.js → 1601-9d11bc618b.chunk.js} +1 -1
- package/dist/scripts/2774-3c5ec8c666.chunk.js +1 -0
- package/dist/scripts/3969-1f0edc9598.chunk.js +1 -0
- package/dist/scripts/4523-9e588bb798.chunk.js +1 -0
- package/dist/scripts/4784-b09afd92cd.chunk.js +1 -0
- package/dist/scripts/6254-f26ecd5587.chunk.js +1 -0
- package/dist/scripts/{6277-5a2cf1ba53.chunk.js → 6277-2f4bc3d054.chunk.js} +1 -1
- package/dist/scripts/6963-ee25db0397.chunk.js +1 -0
- package/dist/scripts/6991-32da7c36e9.chunk.js +1 -0
- package/dist/scripts/{7634-cbb0ec2c46.chunk.js → 7634-8c2e7bcf7a.chunk.js} +1 -1
- package/dist/scripts/{8622-e65b370b94.chunk.js → 8622-4fded6aa28.chunk.js} +1 -1
- package/dist/scripts/bundle-2b6b554476.min.js +2 -0
- package/package.json +2 -2
- package/dist/scripts/2774-c34b53c0c6.chunk.js +0 -1
- package/dist/scripts/3969-d27d0571c4.chunk.js +0 -1
- package/dist/scripts/6254-ef1a408f43.chunk.js +0 -1
- package/dist/scripts/6963-fa53496a45.chunk.js +0 -1
- package/dist/scripts/8114-774b080bab.chunk.js +0 -1
- package/dist/scripts/9382-f96fe3c1c1.chunk.js +0 -1
- package/dist/scripts/9828-d6e448bb94.chunk.js +0 -1
- package/dist/scripts/bundle-5039f048a5.min.js +0 -2
- /package/dist/css/{8114-library-editor-a1247bffda.chunk.css → 4523-library-editor-a1247bffda.chunk.css} +0 -0
- /package/dist/scripts/{1086-2c0fc81cca.chunk.js → 1086-e0c35124d8.chunk.js} +0 -0
- /package/dist/scripts/{1269-1d418c93ff.chunk.js → 1269-81499213c1.chunk.js} +0 -0
- /package/dist/scripts/{1364-75f178ff7c.chunk.js → 1364-58bd64afe7.chunk.js} +0 -0
- /package/dist/scripts/{1409-d7aacfb491.chunk.js → 1409-9c325bfbf6.chunk.js} +0 -0
- /package/dist/scripts/{1492-34353e5803.chunk.js → 1492-e654b09987.chunk.js} +0 -0
- /package/dist/scripts/{1601-2cee26f841.chunk.js.LICENSE.txt → 1601-9d11bc618b.chunk.js.LICENSE.txt} +0 -0
- /package/dist/scripts/{1887-af4ffa7492.chunk.js → 1887-6c9b7d0d52.chunk.js} +0 -0
- /package/dist/scripts/{1911-e51ecfdbf1.chunk.js → 1911-5e683c9b57.chunk.js} +0 -0
- /package/dist/scripts/{2417-786ba4266e.chunk.js → 2417-4edd116408.chunk.js} +0 -0
- /package/dist/scripts/{243-4a83be1c4d.chunk.js → 243-e0bfb4d88b.chunk.js} +0 -0
- /package/dist/scripts/{2692-ca0cf823f2.chunk.js → 2692-8b9ce6d0c8.chunk.js} +0 -0
- /package/dist/scripts/{2888-1da6a4e04e.chunk.js → 2888-0f677d5125.chunk.js} +0 -0
- /package/dist/scripts/{299-fdf9a9b203.chunk.js → 299-13a1cb926c.chunk.js} +0 -0
- /package/dist/scripts/{3096-fe94617b1b.chunk.js → 3096-833a22293c.chunk.js} +0 -0
- /package/dist/scripts/{3763-c275baf776.chunk.js → 3763-cc802927a4.chunk.js} +0 -0
- /package/dist/scripts/{4177-876bddb70e.chunk.js → 4177-f92af9cdd8.chunk.js} +0 -0
- /package/dist/scripts/{4245-1b17d6cc40.chunk.js → 4245-49b849b0dc.chunk.js} +0 -0
- /package/dist/scripts/{4885-4300082a41.chunk.js → 4885-51a4e2d76a.chunk.js} +0 -0
- /package/dist/scripts/{514-1b68f47c63.chunk.js → 514-230489ab81.chunk.js} +0 -0
- /package/dist/scripts/{5412-f27d370c1d.chunk.js → 5412-692a3bbb8f.chunk.js} +0 -0
- /package/dist/scripts/{5418-9e2c2e8a28.chunk.js → 5418-d146408d5f.chunk.js} +0 -0
- /package/dist/scripts/{5424-7facb2affa.chunk.js → 5424-023fbdfbfb.chunk.js} +0 -0
- /package/dist/scripts/{5747-4ea0a28a50.chunk.js → 5747-fd9faedf91.chunk.js} +0 -0
- /package/dist/scripts/{6220-b72fd024a7.chunk.js → 6220-3b7c856833.chunk.js} +0 -0
- /package/dist/scripts/{6277-5a2cf1ba53.chunk.js.LICENSE.txt → 6277-2f4bc3d054.chunk.js.LICENSE.txt} +0 -0
- /package/dist/scripts/{6357-68401d5c12.chunk.js → 6357-5e6070a3bd.chunk.js} +0 -0
- /package/dist/scripts/{6505-9b5e1103de.chunk.js → 6505-d7aba5e2db.chunk.js} +0 -0
- /package/dist/scripts/{6732-e031dd6d48.chunk.js → 6732-6c0786ffcb.chunk.js} +0 -0
- /package/dist/scripts/{6756-5f0d4d077e.chunk.js → 6756-94bb6b5f39.chunk.js} +0 -0
- /package/dist/scripts/{6995-420094a353.chunk.js → 6995-fd92ff8e0e.chunk.js} +0 -0
- /package/dist/scripts/{6999-c978daeb75.chunk.js → 6999-c384cbbe94.chunk.js} +0 -0
- /package/dist/scripts/{7002-dce55c7cc0.chunk.js → 7002-de9a9a1326.chunk.js} +0 -0
- /package/dist/scripts/{7053-6209358742.chunk.js → 7053-29490a2986.chunk.js} +0 -0
- /package/dist/scripts/{708-7c37448edc.chunk.js → 708-27bc94c368.chunk.js} +0 -0
- /package/dist/scripts/{7190-b9aa94d8b0.chunk.js → 7190-2232eadecd.chunk.js} +0 -0
- /package/dist/scripts/{7376-94aa49d108.chunk.js → 7376-4fb1663f80.chunk.js} +0 -0
- /package/dist/scripts/{7433-b8397bc971.chunk.js → 7433-bb3409c1b1.chunk.js} +0 -0
- /package/dist/scripts/{8947-e09a418678.chunk.js → 8947-9234bf22e8.chunk.js} +0 -0
- /package/dist/scripts/{9357-c824654e93.chunk.js → 9357-2e40b56d53.chunk.js} +0 -0
- /package/dist/scripts/{9976-b1a68fb464.chunk.js → 9976-36d84746c0.chunk.js} +0 -0
- /package/dist/scripts/{bundle-5039f048a5.min.js.LICENSE.txt → bundle-2b6b554476.min.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_clickview_library_editor=self.webpackChunk_clickview_library_editor||[]).push([[6963],{54096:function(e,r,t){t.d(r,{G:function(){return o}});var n=t(1024),i=t(21679);function o(e){var r,t;return r=e,t=i.u.getInstance(r),n.useEffect((function(){return function(){i.u.releaseInstance(r)}})),t}},84657:function(e,r,t){t.d(r,{t:function(){return o},v:function(){return i}});var n=t(50028),i={BASE_VIDEO_COLLECTION:"thumbnail,tags,rating,series,season,owner",VIDEO_COLLECTION:"(videoCollection)",SERIES:"tallposter,rating,banner",FOLDER:"banner,thumbnail",CLASSIFICATION_COLLECTION:"banner,cover,tallPoster",CLASSIFICATION:function(e){return"banner,cover,tallPoster,thumbnail,followers{id:".concat(e,"},pinnedVideos[count()]{limit:0},playlists[count()]{limit:0},series[count()]{limit:0}")},VIDEO:"series,season,rating,producers,glance,distributors,owner,subjectPresentationAudiences,resources[thumbnail,pdf],tags,productionCompanies,directors,links,thumbnail,interactives[thumbnail,_canBeConsumed,_isClickViewContent,owner[avatar]],clips[_canBeConsumed,owner[avatar],_isClickViewContent],_canUpdate,_videoProgress,_canBeConsumed,categories[libraries],libraries,_canAddToLibrary,_restrictions",PLAYLIST:"cover,banner,owner,videos[count()]{limit:0,status:[".concat(n.X.Published,",").concat(n.X.Archive,"]},clips[count()]{limit:0},interactives[count()]{limit:0},followers[count()]{limit:0}"),PLAYLIST_COLLECTION:"videos[count()]{limit:0},interactives[count()]{limit:0},clips[count()]{limit:0},cover",CLIP:"(clip)",CLIP_COLLECTION:"(clipCollection)",INTERACTIVE:"(interactive)",LIBRARY_COLLECTION:"owner[logo]",LIBRARY:"owner[logo],categorytree"},o={CLASSIFICATION:"banner,cover,tallPoster,pinnedVideos[count()]{limit:0},playlists[count()]{limit:0},series[count()]{limit:0}",CLASSIFICATION_COLLECTION:"banner,cover,tallPoster",VIDEO:"series,season,rating,producers,glance,distributors,subjectPresentationAudiences,resources[thumbnail,pdf],tags,productionCompanies,directors,links,thumbnail,interactives[thumbnail,_canBeConsumed,_isClickViewContent],clips[_canBeConsumed,_isClickViewContent],_canBeConsumed,categories,libraries",VIDEO_COLLECTION:"thumbnail,rating,series,season,subjectPresentationAudiences,subtitles{limit:1},_canBeConsumed"}},34107:function(e,r,t){t.d(r,{D:function(){return s}});var n=t(68003),i=t(2248),o=t(40221),a=t(84657),s={domainLibraries:function(e,r,t,i){return{url:n._.urlBuilder("/api/domain/v2/me/libraries",{type:e,maxCategoryDepth:0}),key:"libraries:".concat(e.sort().join(":")),formatData:function(e){return e.map((function(e){return e.data}))},success:r,error:t,always:i}},libraryRequestLibraries:function(){return{url:"{gateway}/v1/library-requests/libraries",key:"libraries"}},librariesWithCategories:function(){return{url:n._.urlBuilder("/api/domain/v2/me/libraries",{type:["sharedLibrary","customLibrary","unpublishedCustomLibrary"],maxCategoryDepth:5}),key:"libraries:with:categories",normalize:!1}},librariesWithOwnerLogos:function(e,r,t,i){return e.sort(),{url:n._.urlBuilder("/api/domain/v2/objects",{query:a.v.LIBRARY_COLLECTION,id:e}),key:"libraries:owner:logo:".concat(e.join(",")),success:r,error:t,always:i}},library:function(e,r,t,i){return{url:n._.urlBuilder("{gateway}/v1/objects/".concat(e),{query:a.v.LIBRARY}),key:"library:".concat(e),success:r,error:t,always:i}},librarySubscribers:function(e,r){var t={};return r&&(t.cursor=r),{url:n._.urlBuilder("{gateway}/v1/library-requests/libraries/".concat(e,"/subscribers"),t),key:"library:subscribers:".concat(e,":").concat(r)}},libraryOwner:function(e){return{url:"{gateway}/v1/library-requests/libraries/".concat(e,"/subscribers?ownerOnly=true"),key:"library:owner:".concat(e),formatData:function(e){return o.m.first(e.data)}}},updateSubscriberPermissions:function(e,r,t,n,o){return{url:"{gateway}/v1/libraries/".concat(e,"/library-request-permissions"),key:"update:subscriber:permissions:".concat(e,":").concat(r),type:i.k.PUT,data:{customerId:r,granted:t},invalidationKeys:["library:owner:".concat(e),"library:subscribers:".concat(e)],success:n,error:o}},removeSubscriber:function(e,r,t,n){return{url:"{gateway}/v1/objects/".concat(e,"/subscribedcustomers?memberId=").concat(r),key:"revoke:subscription:".concat(e,":").concat(r),type:i.k.DELETE,invalidationKeys:["library:subscribers:".concat(e)],success:t,error:n}},folder:function(e,r,t,n){return{url:"{gateway}/v1/objects/".concat(e,"?query=banner,libraries"),key:"library:folder:".concat(e),success:r,error:t,always:n}},folderParentTree:function(e,r,t,n){return{url:"/api/domain/v2/categories/".concat(e,"/parent-tree?includeAll=false"),key:"folder:parent:tree".concat(e),success:r,error:t,always:n}},childFolders:function(e,r,t,n,i){var o="{gateway}/v1/objects/".concat(e,"/categories?query={limit:100}thumbnail"),a="child:folders:".concat(e);return r&&(o+="&cursor=".concat(r),a+=":".concat(r)),{url:o,key:a,formatData:function(e){var r=e.data.sort((function(e,r){return e.name.toLowerCase().localeCompare(r.name.toLowerCase())}));return Object.assign(Object.assign({},e),{data:r})},success:t,error:n,always:i}},addToLibrary:function(e){return{url:"{gateway}/v1/library-requests",key:"add:".concat(e.objectId,":to:").concat(e.destinationLibraryId,":").concat(e.metadata.destinationCategoryId),type:i.k.POST,data:e}}}},2491:function(e,r,t){t.d(r,{Z:function(){return a}});var n=t(54096),i=t(21186),o=t(92159);function a(){var e=(0,n.G)(o.P.ALERT);return{success:function(r){e.success(r)()},error:function(r){e.error(r)()},warning:function(r){e.createAlert({type:i.NK.Warning,heading:i.R6.Warning,message:r})}}}},82378:function(e,r,t){t.d(r,{i:function(){return o}});var n=t(1024),i=t(94223);function o(e,r){var t=e,o=r,a=(0,i.P)(e&&function(e){return t(e).key});return(0,n.useEffect)((function(){a&&a.shouldInitialFetch&&r&&o()}),[null==a?void 0:a.shouldInitialFetch,r]),(0,n.useEffect)((function(){a&&a.nextCursor&&!a.isFetching&&r&&o(a.nextCursor)}),[null==a?void 0:a.nextCursor,null==a?void 0:a.isFetching,r]),a}},94223:function(e,r,t){t.d(r,{P:function(){return c}});var n=t(1024),i=t(58566),o=t(86120),a=t(53808);function s(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function c(e,r,t){function c(e){if(e)return a.q.isFunction(r)?r(e):e.data}function u(e){var r,n;if(e)return t?t(e):null===(n=null===(r=e.pagination)||void 0===r?void 0:r.cursors)||void 0===n?void 0:n.next}return(0,i.useSelector)((0,n.useMemo)((function(){return function(r){if(a.q.isFunction(e)){for(var t=e,n=a.q.isFunction(e)&&t(),i=n&&o.a.getResponse(r,n),l=i&&i.isFetching,d=i&&i.statusCode,b=i&&i.hasCompleted,m=i&&i.shouldFetch,f=c(i&&i.data),y=u(i&&i.data),p=function(e){var r;if(e)return null===(r=e)||void 0===r?void 0:r.count}(i&&i.data);y&&(i=o.a.getResponse(r,t(y)),l=l||i.isFetching,d=i.statusCode,b=i.hasCompleted,!i.shouldFetch);){var v=c(i.data);v&&f.push.apply(f,function(e){if(Array.isArray(e))return s(e)}(g=v)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(g)||function(e,r){if(e){if("string"==typeof e)return s(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?s(e,r):void 0}}(g)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());var C=u(i.data);y=C===y?null:C}var h={shouldInitialFetch:m,items:f,nextCursor:y,isFetching:l,statusCode:d,hasCompleted:b};return"number"==typeof p&&(h.totalItems=p),h}var g}}),[e]))}t(35656).o.Ok},91021:function(e,r,t){t.r(r),t.d(r,{RemoveLibrarySubscriberView:function(){return v}});var n=t(1024),i=t.n(n),o=t(52076),a=t(86120),s=t(57857),c=t(71575),u=t(2491),l=t(34107),d=t(82378),b=t(85610),m=t(66703),f=t(70065);function y(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var p="libraryRequests.removeLibrarySubscriber";function v(e){var r,t,n,v=a.a.useGetFetch(),C=(t=i().useState(!1),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,i,o,a,s=[],c=!0,u=!1;try{if(o=(t=t.call(e)).next,0===r){if(Object(t)!==t)return;c=!1}else for(;!(c=(n=o.call(t)).done)&&(s.push(n.value),s.length!==r);c=!0);}catch(e){u=!0,i=e}finally{try{if(!c&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(t,n)||function(e,r){if(e){if("string"==typeof e)return y(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?y(e,r):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),h=C[0],g=C[1],I=a.a.useBasicFetch(l.D.library(e.libraryId));function w(r){return l.D.librarySubscribers(e.libraryId,r)}var L=(0,d.i)(w,(function(e){v(w(e))})),A=(0,u.Z)(),O=null===(r=null==L?void 0:L.items)||void 0===r?void 0:r.find((function(r){return r.customerId===e.customerId})),E=I.hasCompleted&&!!O;return i().createElement(c.G,{title:s.T.getPhrase(p,"removeAccess"),closePopup:e.closePopup,showLoadingSpinner:!E},!!E&&i().createElement(i().Fragment,null,i().createElement("div",{className:"alert alert-info",role:"alert"},i().createElement(m.x,{namespace:p,phrase:"alert"})),i().createElement("p",null,i().createElement(m.x,{namespace:p,phrase:"removeSubscriberInfo",options:{school:O.customerName,library:I.data.name}})),i().createElement(b.u,null,i().createElement(b.u.Cancel,{onClick:e.closePopup}),i().createElement(b.u.Submit,{onClick:function(){g(!0),v(l.D.removeSubscriber(e.libraryId,e.customerId,(function(){A.success(s.T.getPhrase(p,"revokeSubscriptionSuccess",{school:O.customerName,library:I.data.name})),o.k.logUserAction({id:e.libraryId,customerId:e.customerId},{actionType:f.UserAction.Dissociate,entity:f.EntityType.Library,descriptor:f.AssocDescriptor.Customer,location:f.LocationContext.Popup,workflowPhase:f.WorkflowPhase.Complete}),e.closePopup()}),(function(){g(!1),A.error(s.T.getPhrase(p,"revokeSubscriptionError",{school:O.customerName,library:I.data.name}))})))},text:s.T.getPhrase(p,"removeAccess"),variant:"danger",showSpinner:h}))))}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_clickview_library_editor=self.webpackChunk_clickview_library_editor||[]).push([[6991],{56784:function(t){"use strict";t.exports=function(t,e,r,n,o,i,a,s){if(!t){var c;if(void 0===e)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[r,n,o,i,a,s],l=0;(c=new Error(e.replace(/%s/g,(function(){return u[l++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}}},30582:function(t,e,r){"use strict";var n=r(1024),o=r.n(n),i=r(60216),a=r.n(i),s=r(82049),c=r.n(s),u=r(56784),l=r.n(u),f=r(55007),p=r.n(f);function d(){return d=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},d.apply(this,arguments)}function h(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,m(t,e)}function m(t,e){return m=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},m(t,e)}function y(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n<i.length;n++)e.indexOf(r=i[n])>=0||(o[r]=t[r]);return o}var g={BASE:"base",BODY:"body",HEAD:"head",HTML:"html",LINK:"link",META:"meta",NOSCRIPT:"noscript",SCRIPT:"script",STYLE:"style",TITLE:"title",FRAGMENT:"Symbol(react.fragment)"},T={rel:["amphtml","canonical","alternate"]},v={type:["application/ld+json"]},b={charset:"",name:["robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]},C=Object.keys(g).map((function(t){return g[t]})),A={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},O=Object.keys(A).reduce((function(t,e){return t[A[e]]=e,t}),{}),P=function(t,e){for(var r=t.length-1;r>=0;r-=1){var n=t[r];if(Object.prototype.hasOwnProperty.call(n,e))return n[e]}return null},w=function(t){var e=P(t,g.TITLE),r=P(t,"titleTemplate");if(Array.isArray(e)&&(e=e.join("")),r&&e)return r.replace(/%s/g,(function(){return e}));var n=P(t,"defaultTitle");return e||n||void 0},S=function(t){return P(t,"onChangeClientState")||function(){}},E=function(t,e){return e.filter((function(e){return void 0!==e[t]})).map((function(e){return e[t]})).reduce((function(t,e){return d({},t,e)}),{})},j=function(t,e){return e.filter((function(t){return void 0!==t[g.BASE]})).map((function(t){return t[g.BASE]})).reverse().reduce((function(e,r){if(!e.length)for(var n=Object.keys(r),o=0;o<n.length;o+=1){var i=n[o].toLowerCase();if(-1!==t.indexOf(i)&&r[i])return e.concat(r)}return e}),[])},I=function(t,e,r){var n={};return r.filter((function(e){return!!Array.isArray(e[t])||(void 0!==e[t]&&console&&"function"==typeof console.warn&&console.warn("Helmet: "+t+' should be of type "Array". Instead found type "'+typeof e[t]+'"'),!1)})).map((function(e){return e[t]})).reverse().reduce((function(t,r){var o={};r.filter((function(t){for(var r,i=Object.keys(t),a=0;a<i.length;a+=1){var s=i[a],c=s.toLowerCase();-1===e.indexOf(c)||"rel"===r&&"canonical"===t[r].toLowerCase()||"rel"===c&&"stylesheet"===t[c].toLowerCase()||(r=c),-1===e.indexOf(s)||"innerHTML"!==s&&"cssText"!==s&&"itemprop"!==s||(r=s)}if(!r||!t[r])return!1;var u=t[r].toLowerCase();return n[r]||(n[r]={}),o[r]||(o[r]={}),!n[r][u]&&(o[r][u]=!0,!0)})).reverse().forEach((function(e){return t.push(e)}));for(var i=Object.keys(o),a=0;a<i.length;a+=1){var s=i[a],c=d({},n[s],o[s]);n[s]=c}return t}),[]).reverse()},x=function(t,e){if(Array.isArray(t)&&t.length)for(var r=0;r<t.length;r+=1)if(t[r][e])return!0;return!1},N=function(t){return Array.isArray(t)?t.join(""):t},M=function(t,e){return Array.isArray(t)?t.reduce((function(t,r){return function(t,e){for(var r=Object.keys(t),n=0;n<r.length;n+=1)if(e[r[n]]&&e[r[n]].includes(t[r[n]]))return!0;return!1}(r,e)?t.priority.push(r):t.default.push(r),t}),{priority:[],default:[]}):{default:t}},k=function(t,e){var r;return d({},t,((r={})[e]=void 0,r))},L=[g.NOSCRIPT,g.SCRIPT,g.STYLE],D=function(t,e){return void 0===e&&(e=!0),!1===e?String(t):String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},H=function(t){return Object.keys(t).reduce((function(e,r){var n=void 0!==t[r]?r+'="'+t[r]+'"':""+r;return e?e+" "+n:n}),"")},_=function(t,e){return void 0===e&&(e={}),Object.keys(t).reduce((function(e,r){return e[A[r]||r]=t[r],e}),e)},R=function(t,e){return e.map((function(e,r){var n,i=((n={key:r})["data-rh"]=!0,n);return Object.keys(e).forEach((function(t){var r=A[t]||t;"innerHTML"===r||"cssText"===r?i.dangerouslySetInnerHTML={__html:e.innerHTML||e.cssText}:i[r]=e[t]})),o().createElement(t,i)}))},U=function(t,e,r){switch(t){case g.TITLE:return{toComponent:function(){return r=e.titleAttributes,(n={key:t=e.title})["data-rh"]=!0,i=_(r,n),[o().createElement(g.TITLE,i,t)];var t,r,n,i},toString:function(){return function(t,e,r,n){var o=H(r),i=N(e);return o?"<"+t+' data-rh="true" '+o+">"+D(i,n)+"</"+t+">":"<"+t+' data-rh="true">'+D(i,n)+"</"+t+">"}(t,e.title,e.titleAttributes,r)}};case"bodyAttributes":case"htmlAttributes":return{toComponent:function(){return _(e)},toString:function(){return H(e)}};default:return{toComponent:function(){return R(t,e)},toString:function(){return function(t,e,r){return e.reduce((function(e,n){var o=Object.keys(n).filter((function(t){return!("innerHTML"===t||"cssText"===t)})).reduce((function(t,e){var o=void 0===n[e]?e:e+'="'+D(n[e],r)+'"';return t?t+" "+o:o}),""),i=n.innerHTML||n.cssText||"",a=-1===L.indexOf(t);return e+"<"+t+' data-rh="true" '+o+(a?"/>":">"+i+"</"+t+">")}),"")}(t,e,r)}}}},B=function(t){var e=t.baseTag,r=t.bodyAttributes,n=t.encode,o=t.htmlAttributes,i=t.noscriptTags,a=t.styleTags,s=t.title,c=void 0===s?"":s,u=t.titleAttributes,l=t.linkTags,f=t.metaTags,p=t.scriptTags,d={toComponent:function(){},toString:function(){return""}};if(t.prioritizeSeoTags){var h=function(t){var e=t.linkTags,r=t.scriptTags,n=t.encode,o=M(t.metaTags,b),i=M(e,T),a=M(r,v);return{priorityMethods:{toComponent:function(){return[].concat(R(g.META,o.priority),R(g.LINK,i.priority),R(g.SCRIPT,a.priority))},toString:function(){return U(g.META,o.priority,n)+" "+U(g.LINK,i.priority,n)+" "+U(g.SCRIPT,a.priority,n)}},metaTags:o.default,linkTags:i.default,scriptTags:a.default}}(t);d=h.priorityMethods,l=h.linkTags,f=h.metaTags,p=h.scriptTags}return{priority:d,base:U(g.BASE,e,n),bodyAttributes:U("bodyAttributes",r,n),htmlAttributes:U("htmlAttributes",o,n),link:U(g.LINK,l,n),meta:U(g.META,f,n),noscript:U(g.NOSCRIPT,i,n),script:U(g.SCRIPT,p,n),style:U(g.STYLE,a,n),title:U(g.TITLE,{title:c,titleAttributes:u},n)}},q=[],z=function(t,e){var r=this;void 0===e&&(e="undefined"!=typeof document),this.instances=[],this.value={setHelmet:function(t){r.context.helmet=t},helmetInstances:{get:function(){return r.canUseDOM?q:r.instances},add:function(t){(r.canUseDOM?q:r.instances).push(t)},remove:function(t){var e=(r.canUseDOM?q:r.instances).indexOf(t);(r.canUseDOM?q:r.instances).splice(e,1)}}},this.context=t,this.canUseDOM=e,e||(t.helmet=B({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))},Y=o().createContext({}),K=a().shape({setHelmet:a().func,helmetInstances:a().shape({get:a().func,add:a().func,remove:a().func})}),$="undefined"!=typeof document,V=function(t){function e(r){var n;return(n=t.call(this,r)||this).helmetData=new z(n.props.context,e.canUseDOM),n}return h(e,t),e.prototype.render=function(){return o().createElement(Y.Provider,{value:this.helmetData.value},this.props.children)},e}(n.Component);V.canUseDOM=$,V.propTypes={context:a().shape({helmet:a().shape()}),children:a().node.isRequired},V.defaultProps={context:{}},V.displayName="HelmetProvider";var F=function(t,e){var r,n=document.head||document.querySelector(g.HEAD),o=n.querySelectorAll(t+"[data-rh]"),i=[].slice.call(o),a=[];return e&&e.length&&e.forEach((function(e){var n=document.createElement(t);for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&("innerHTML"===o?n.innerHTML=e.innerHTML:"cssText"===o?n.styleSheet?n.styleSheet.cssText=e.cssText:n.appendChild(document.createTextNode(e.cssText)):n.setAttribute(o,void 0===e[o]?"":e[o]));n.setAttribute("data-rh","true"),i.some((function(t,e){return r=e,n.isEqualNode(t)}))?i.splice(r,1):a.push(n)})),i.forEach((function(t){return t.parentNode.removeChild(t)})),a.forEach((function(t){return n.appendChild(t)})),{oldTags:i,newTags:a}},G=function(t,e){var r=document.getElementsByTagName(t)[0];if(r){for(var n=r.getAttribute("data-rh"),o=n?n.split(","):[],i=[].concat(o),a=Object.keys(e),s=0;s<a.length;s+=1){var c=a[s],u=e[c]||"";r.getAttribute(c)!==u&&r.setAttribute(c,u),-1===o.indexOf(c)&&o.push(c);var l=i.indexOf(c);-1!==l&&i.splice(l,1)}for(var f=i.length-1;f>=0;f-=1)r.removeAttribute(i[f]);o.length===i.length?r.removeAttribute("data-rh"):r.getAttribute("data-rh")!==a.join(",")&&r.setAttribute("data-rh",a.join(","))}},W=function(t,e){var r=t.baseTag,n=t.htmlAttributes,o=t.linkTags,i=t.metaTags,a=t.noscriptTags,s=t.onChangeClientState,c=t.scriptTags,u=t.styleTags,l=t.title,f=t.titleAttributes;G(g.BODY,t.bodyAttributes),G(g.HTML,n),function(t,e){void 0!==t&&document.title!==t&&(document.title=N(t)),G(g.TITLE,e)}(l,f);var p={baseTag:F(g.BASE,r),linkTags:F(g.LINK,o),metaTags:F(g.META,i),noscriptTags:F(g.NOSCRIPT,a),scriptTags:F(g.SCRIPT,c),styleTags:F(g.STYLE,u)},d={},h={};Object.keys(p).forEach((function(t){var e=p[t],r=e.newTags,n=e.oldTags;r.length&&(d[t]=r),n.length&&(h[t]=p[t].oldTags)})),e&&e(),s(t,d,h)},Z=null,J=function(t){function e(){for(var e,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return(e=t.call.apply(t,[this].concat(n))||this).rendered=!1,e}h(e,t);var r=e.prototype;return r.shouldComponentUpdate=function(t){return!p()(t,this.props)},r.componentDidUpdate=function(){this.emitChange()},r.componentWillUnmount=function(){this.props.context.helmetInstances.remove(this),this.emitChange()},r.emitChange=function(){var t,e,r=this.props.context,n=r.setHelmet,o=null,i=(t=r.helmetInstances.get().map((function(t){var e=d({},t.props);return delete e.context,e})),{baseTag:j(["href"],t),bodyAttributes:E("bodyAttributes",t),defer:P(t,"defer"),encode:P(t,"encodeSpecialCharacters"),htmlAttributes:E("htmlAttributes",t),linkTags:I(g.LINK,["rel","href"],t),metaTags:I(g.META,["name","charset","http-equiv","property","itemprop"],t),noscriptTags:I(g.NOSCRIPT,["innerHTML"],t),onChangeClientState:S(t),scriptTags:I(g.SCRIPT,["src","innerHTML"],t),styleTags:I(g.STYLE,["cssText"],t),title:w(t),titleAttributes:E("titleAttributes",t),prioritizeSeoTags:x(t,"prioritizeSeoTags")});V.canUseDOM?(e=i,Z&&cancelAnimationFrame(Z),e.defer?Z=requestAnimationFrame((function(){W(e,(function(){Z=null}))})):(W(e),Z=null)):B&&(o=B(i)),n(o)},r.init=function(){this.rendered||(this.rendered=!0,this.props.context.helmetInstances.add(this),this.emitChange())},r.render=function(){return this.init(),null},e}(n.Component);J.propTypes={context:K.isRequired},J.displayName="HelmetDispatcher";var Q=["children"],X=["children"],tt=function(t){function e(){return t.apply(this,arguments)||this}h(e,t);var r=e.prototype;return r.shouldComponentUpdate=function(t){return!c()(k(this.props,"helmetData"),k(t,"helmetData"))},r.mapNestedChildrenToProps=function(t,e){if(!e)return null;switch(t.type){case g.SCRIPT:case g.NOSCRIPT:return{innerHTML:e};case g.STYLE:return{cssText:e};default:throw new Error("<"+t.type+" /> elements are self-closing and can not contain children. Refer to our API for more information.")}},r.flattenArrayTypeChildren=function(t){var e,r=t.child,n=t.arrayTypeChildren;return d({},n,((e={})[r.type]=[].concat(n[r.type]||[],[d({},t.newChildProps,this.mapNestedChildrenToProps(r,t.nestedChildren))]),e))},r.mapObjectTypeChildren=function(t){var e,r,n=t.child,o=t.newProps,i=t.newChildProps,a=t.nestedChildren;switch(n.type){case g.TITLE:return d({},o,((e={})[n.type]=a,e.titleAttributes=d({},i),e));case g.BODY:return d({},o,{bodyAttributes:d({},i)});case g.HTML:return d({},o,{htmlAttributes:d({},i)});default:return d({},o,((r={})[n.type]=d({},i),r))}},r.mapArrayTypeChildrenToProps=function(t,e){var r=d({},e);return Object.keys(t).forEach((function(e){var n;r=d({},r,((n={})[e]=t[e],n))})),r},r.warnOnInvalidChildren=function(t,e){return l()(C.some((function(e){return t.type===e})),"function"==typeof t.type?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":"Only elements types "+C.join(", ")+" are allowed. Helmet does not support rendering <"+t.type+"> elements. Refer to our API for more information."),l()(!e||"string"==typeof e||Array.isArray(e)&&!e.some((function(t){return"string"!=typeof t})),"Helmet expects a string as a child of <"+t.type+">. Did you forget to wrap your children in braces? ( <"+t.type+">{``}</"+t.type+"> ) Refer to our API for more information."),!0},r.mapChildrenToProps=function(t,e){var r=this,n={};return o().Children.forEach(t,(function(t){if(t&&t.props){var o=t.props,i=o.children,a=y(o,Q),s=Object.keys(a).reduce((function(t,e){return t[O[e]||e]=a[e],t}),{}),c=t.type;switch("symbol"==typeof c?c=c.toString():r.warnOnInvalidChildren(t,i),c){case g.FRAGMENT:e=r.mapChildrenToProps(i,e);break;case g.LINK:case g.META:case g.NOSCRIPT:case g.SCRIPT:case g.STYLE:n=r.flattenArrayTypeChildren({child:t,arrayTypeChildren:n,newChildProps:s,nestedChildren:i});break;default:e=r.mapObjectTypeChildren({child:t,newProps:e,newChildProps:s,nestedChildren:i})}}})),this.mapArrayTypeChildrenToProps(n,e)},r.render=function(){var t=this.props,e=t.children,r=y(t,X),n=d({},r),i=r.helmetData;return e&&(n=this.mapChildrenToProps(e,n)),!i||i instanceof z||(i=new z(i.context,i.instances)),i?o().createElement(J,d({},n,{context:i.value,helmetData:void 0})):o().createElement(Y.Consumer,null,(function(t){return o().createElement(J,d({},n,{context:t}))}))},e}(n.Component);tt.propTypes={base:a().object,bodyAttributes:a().object,children:a().oneOfType([a().arrayOf(a().node),a().node]),defaultTitle:a().string,defer:a().bool,encodeSpecialCharacters:a().bool,htmlAttributes:a().object,link:a().arrayOf(a().object),meta:a().arrayOf(a().object),noscript:a().arrayOf(a().object),onChangeClientState:a().func,script:a().arrayOf(a().object),style:a().arrayOf(a().object),title:a().string,titleAttributes:a().object,titleTemplate:a().string,prioritizeSeoTags:a().bool,helmetData:a().object},tt.defaultProps={defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1},tt.displayName="Helmet"},82049:function(t){var e="undefined"!=typeof Element,r="function"==typeof Map,n="function"==typeof Set,o="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;function i(t,a){if(t===a)return!0;if(t&&a&&"object"==typeof t&&"object"==typeof a){if(t.constructor!==a.constructor)return!1;var s,c,u,l;if(Array.isArray(t)){if((s=t.length)!=a.length)return!1;for(c=s;0!=c--;)if(!i(t[c],a[c]))return!1;return!0}if(r&&t instanceof Map&&a instanceof Map){if(t.size!==a.size)return!1;for(l=t.entries();!(c=l.next()).done;)if(!a.has(c.value[0]))return!1;for(l=t.entries();!(c=l.next()).done;)if(!i(c.value[1],a.get(c.value[0])))return!1;return!0}if(n&&t instanceof Set&&a instanceof Set){if(t.size!==a.size)return!1;for(l=t.entries();!(c=l.next()).done;)if(!a.has(c.value[0]))return!1;return!0}if(o&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(a)){if((s=t.length)!=a.length)return!1;for(c=s;0!=c--;)if(t[c]!==a[c])return!1;return!0}if(t.constructor===RegExp)return t.source===a.source&&t.flags===a.flags;if(t.valueOf!==Object.prototype.valueOf&&"function"==typeof t.valueOf&&"function"==typeof a.valueOf)return t.valueOf()===a.valueOf();if(t.toString!==Object.prototype.toString&&"function"==typeof t.toString&&"function"==typeof a.toString)return t.toString()===a.toString();if((s=(u=Object.keys(t)).length)!==Object.keys(a).length)return!1;for(c=s;0!=c--;)if(!Object.prototype.hasOwnProperty.call(a,u[c]))return!1;if(e&&t instanceof Element)return!1;for(c=s;0!=c--;)if(("_owner"!==u[c]&&"__v"!==u[c]&&"__o"!==u[c]||!t.$$typeof)&&!i(t[u[c]],a[u[c]]))return!1;return!0}return t!=t&&a!=a}t.exports=function(t,e){try{return i(t,e)}catch(t){if((t.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw t}}},17082:function(t,e,r){"use strict";r.d(e,{Nq:function(){return l},oD:function(){return p},t0:function(){return f}});var n,o=r(1024),i=r(30314),a=(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},n(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),s="html",c="svg",u=function(t){var e,r,n,o={};if(t===s)n=document.createElement("div");else{if(t!==c)throw new Error('Invalid element type "'+t+'" for createPortalNode: must be "html" or "svg".');n=document.createElementNS("http://www.w3.org/2000/svg","g")}var i={element:n,elementType:t,setPortalProps:function(t){o=t},getInitialPortalProps:function(){return o},mount:function(n,o){if(o!==r){if(i.unmount(),n!==e&&!function(t,e){if(e===s)return t instanceof HTMLElement;if(e===c)return t instanceof SVGElement;throw new Error('Unrecognized element type "'+e+'" for validateElementType.')}(n,t))throw new Error('Invalid element type for portal: "'+t+'" portalNodes must be used with '+t+" elements, but OutPortal is within <"+n.tagName+">.");n.replaceChild(i.element,o),e=n,r=o}},unmount:function(t){t&&t!==r||e&&r&&(e.replaceChild(r,i.element),e=void 0,r=void 0)}};return i},l=function(t){function e(e){var r=t.call(this,e)||this;return r.addPropsChannel=function(){Object.assign(r.props.node,{setPortalProps:function(t){r.setState({nodeProps:t})}})},r.state={nodeProps:r.props.node.getInitialPortalProps()},r}return a(e,t),e.prototype.componentDidMount=function(){this.addPropsChannel()},e.prototype.componentDidUpdate=function(){this.addPropsChannel()},e.prototype.render=function(){var t=this,e=this.props,r=e.children,n=e.node;return i.createPortal(o.Children.map(r,(function(e){return o.isValidElement(e)?o.cloneElement(e,t.state.nodeProps):e})),n.element)},e}(o.PureComponent),f=function(t){function e(e){var r=t.call(this,e)||this;return r.placeholderNode=o.createRef(),r.passPropsThroughPortal(),r}return a(e,t),e.prototype.passPropsThroughPortal=function(){var t=Object.assign({},this.props,{node:void 0});this.props.node.setPortalProps(t)},e.prototype.componentDidMount=function(){var t=this.props.node;this.currentPortalNode=t;var e=this.placeholderNode.current,r=e.parentNode;t.mount(r,e),this.passPropsThroughPortal()},e.prototype.componentDidUpdate=function(){var t=this.props.node;this.currentPortalNode&&t!==this.currentPortalNode&&(this.currentPortalNode.unmount(this.placeholderNode.current),this.currentPortalNode=t);var e=this.placeholderNode.current,r=e.parentNode;t.mount(r,e),this.passPropsThroughPortal()},e.prototype.componentWillUnmount=function(){this.props.node.unmount(this.placeholderNode.current)},e.prototype.render=function(){return o.createElement("div",{ref:this.placeholderNode})},e}(o.PureComponent),p=u.bind(null,s);u.bind(null,c)},55007:function(t){t.exports=function(t,e,r,n){var o=r?r.call(n,t,e):void 0;if(void 0!==o)return!!o;if(t===e)return!0;if("object"!=typeof t||!t||"object"!=typeof e||!e)return!1;var i=Object.keys(t),a=Object.keys(e);if(i.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(e),c=0;c<i.length;c++){var u=i[c];if(!s(u))return!1;var l=t[u],f=e[u];if(!1===(o=r?r.call(n,l,f,u):void 0)||void 0===o&&l!==f)return!1}return!0}},82602:function(t,e,r){"use strict";r.d(e,{WU:function(){return u}});var n=["second","minute","hour","day","week","month","year"],o=["秒","分钟","小时","天","周","个月","年"],i={},a=function(t,e){i[t]=e},s=[60,60,24,7,365/7/12,12];function c(t){return t instanceof Date?t:!isNaN(t)||/^\d+$/.test(t)?new Date(parseInt(t)):(t=(t||"").trim().replace(/\.\d+/,"").replace(/-/,"/").replace(/-/,"/").replace(/(\d)T(\d)/,"$1 $2").replace(/Z/," UTC").replace(/([+-]\d\d):?(\d\d)/," $1$2"),new Date(t))}var u=function(t,e,r){var n=function(t,e){return(+(e?c(e):new Date)-+c(t))/1e3}(t,r&&r.relativeDate);return function(t,e){for(var r=t<0?1:0,n=t=Math.abs(t),o=0;t>=s[o]&&o<s.length;o++)t/=s[o];return(t=Math.floor(t))>(0==(o*=2)?9:1)&&(o+=1),e(t,o,n)[r].replace("%s",t.toString())}(n,function(t){return i[t]||i.en_US}(e))};a("en_US",(function(t,e){if(0===e)return["just now","right now"];var r=n[Math.floor(e/2)];return t>1&&(r+="s"),[t+" "+r+" ago","in "+t+" "+r]})),a("zh_CN",(function(t,e){if(0===e)return["刚刚","片刻后"];var r=o[~~(e/2)];return[t+" "+r+"前",t+" "+r+"后"]}))}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_clickview_library_editor=self.webpackChunk_clickview_library_editor||[]).push([[7634],{21053:function(e,t,n){"use strict";n.d(t,{W:function(){return y}});var o=n(48088),i=n(31647),r={svgContainer:"mtegw"},a=n(43791),s=n.n(a),l=n(48090),c=n(35630),u=n(57085),d=n(57857);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},f(e)}function h(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==f(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==f(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o.key),"symbol"===f(i)?i:String(i)),o)}var i}function p(e,t){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},p(e,t)}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}var y=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p(e,t)}(m,e);var t,n,i,a,y=(i=m,a=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}}(),function(){var e,t=v(i);if(a){var n=v(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(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)}(this,e)});function m(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,m),y.call(this,e)}return t=m,(n=[{key:"name",get:function(){return"EditVideoTabsComponent"}},{key:"className",get:function(){return"bg-white"}},{key:"regions",value:function(){return{tabs:{el:".tabs-region",replaceElement:!0},breadcrumbs:{el:".breadcrumbs-region",replaceElement:!0}}}},{key:"lang",get:function(){return"libraryEditor.editVideoTabs"}},{key:"template",get:function(){return s()}},{key:"viewOptions",value:function(){return{styles:r}}},{key:"onSave",value:function(){o.Radio.channel(l.OV.LIBRARY_EDITOR).trigger(l.eX.LibraryEditor.SAVE_VIDEO)}},{key:"getLocationBreadcrumb",value:function(){switch(this.options.context){case"edit":return{name:d.T.getPhrase(this.lang,"videoDetails")};case"chapters":return{name:d.T.getPhrase(this.lang,"chapters")};case"resources":return{name:d.T.getPhrase(this.lang,"resources")}}}},{key:"onRender",value:function(){this.showChildView("tabs",new c.n({tabs:this.options.tabs,activeTab:this.options.activeTab})),this.showChildView("breadcrumbs",new u.n({folder:this.options.folder,libraries:this.options.libraries,video:this.model,customBreadcrumbs:[this.getLocationBreadcrumb()],enableLastItemAppLink:!1}))}}])&&h(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),m}(i.Q.Component)},44391:function(e,t,n){"use strict";n.d(t,{K:function(){return g}});var o=n(31647),i=n(11306),r=n(48088),a=n(48090),s=n(26457),l=n(15564),c=n.n(l);function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function d(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==u(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==u(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o.key),"symbol"===u(i)?i:String(i)),o)}var i}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(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&&f(e,t)}(p,e);var t,n,o,i,l=(o=p,i=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}}(),function(){var e,t=h(o);if(i){var n=h(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===u(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)}(this,e)});function p(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,p),l.call(this,e)}return t=p,(n=[{key:"name",get:function(){return"TagItemComponent"}},{key:"tagName",get:function(){return this.options.behavior===s.Dm.Link?"a":"span"}},{key:"className",get:function(){var e="".concat(this.options.orientation===s.zM.Vertical?"":" d-inline-flex"),t="".concat(this.isSaving()?" saving":""),n="".concat(this.options.behavior===s.Dm.Disabled?" ".concat("dE3WC"):""),o="".concat(this.options.behavior===s.Dm.Filter?" cursor-pointer":"");return"badge-pill tag py-1 px-2 my-1 mr-1".concat(o).concat(e).concat(t).concat(n)}},{key:"template",get:function(){return c()}},{key:"elements",get:function(){return{close:".close"}}},{key:"appLinks",get:function(){return this.options.behavior!==s.Dm.Link?{}:{"[this]":{application:a.OV.SEARCH,action:a.eX.Search.HOME,params:{tag:this.model.get("name")}}}}},{key:"defaults",get:function(){return{behavior:s.Dm.Link,orientation:s.zM.Flex}}},{key:"events",value:function(){return this.options.removeEvent?{"click @ui.close":"onRemoveTag"}:{click:"onClickTag"}}},{key:"initialize",value:function(){this.options.behavior===s.Dm.Edit&&this.listenTo(this.model,"change",this.render)}},{key:"isSaving",value:function(){if(this.options.behavior!==s.Dm.Filter){var e=this.model.pick("id","name","remove"),t=e.id,n=e.name;return!!e.remove||!t||!n}}},{key:"onRemoveTag",value:function(e){if(e.stopPropagation(),!this.isSaving())return this.model.set("remove",!0),r.Radio.channel(this.options.channelName).trigger(this.options.removeEvent,this.model),!1}},{key:"onClickTag",value:function(){this.options.behavior!==s.Dm.Filter||this.options.removeEvent||r.Radio.channel(this.options.channelName).trigger(this.options.clickEvent,this.model)}},{key:"viewOptions",value:function(){return{removable:this.options.removeEvent}}},{key:"onRender",value:function(){this.resetClassName()}}])&&d(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),p}(o.Q.Component);function v(e){return v="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},v(e)}function y(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==v(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==v(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o.key),"symbol"===v(i)?i:String(i)),o)}var i}function m(e,t){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},m(e,t)}function b(e){return b=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},b(e)}var g=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&&m(e,t)}(c,e);var t,n,r,a,l=(r=c,a=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}}(),function(){var e,t=b(r);if(a){var n=b(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===v(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)}(this,e)});function c(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),l.call(this,e)}return t=c,(n=[{key:"initialize",value:function(){this.options.behavior!==s.Dm.Edit||this.options.removeEvent||o.Q.ErrorHelper.throw(new i.H("removeEvent is required to edit tags."))}},{key:"name",get:function(){return"TagComponentCollection"}},{key:"defaults",get:function(){return{orientation:s.zM.Flex}}},{key:"className",get:function(){var e="".concat(this.options.orientation===s.zM.Vertical?" d-flex align-items-start flex-column":"");return"tags".concat(e)}},{key:"childViewOptions",get:function(){return{channelName:this.options.channelName,behavior:this.options.behavior,orientation:this.options.orientation,removeEvent:this.options.removeEvent,clickEvent:this.options.clickEvent}}},{key:"childView",get:function(){return p}}])&&y(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),c}(o.Q.ComponentCollection)},29613:function(e,t,n){"use strict";n.r(t),n.d(t,{EditVideoView:function(){return $e}});var o=n(39479),i=n(48088),r=n(31647),a=n(11306),s=n(99249),l=n(57857),c=n(25417),u=n(21679),d=n(99748),f=n(48090),h=n(29625),p=n(19226),v=n(61843),y=n(71192),m=n(68619),b=n(13156),g=n(29457),w=n(70065),S=n(8371),k=n(52076),O=n(40622),E=n(57785),T=n(45837),C=n(72998),P=n(95168),j=n(24184),x=n(99844),R=n(72891),D=n.n(R);function M(e){return M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},M(e)}function N(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,(void 0,i=function(e,t){if("object"!==M(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==M(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o.key),"symbol"===M(i)?i:String(i)),o)}var i}function _(e,t){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_(e,t)}function V(e){return V=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},V(e)}var I=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,t)}(s,e);var t,n,o,r,a=(o=s,r=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}}(),function(){var e,t=V(o);if(r){var n=V(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===M(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)}(this,e)});function s(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),a.call(this,e)}return t=s,(n=[{key:"initialize",value:function(){var e=this;this.listenTo(this.model,"change",(function(){return e.options.viewModel.validate()}))}},{key:"template",get:function(){return D()}},{key:"name",get:function(){return"ExtraInfoItemComponent"}},{key:"regions",value:function(){return{textArea:{el:".text-area-region",replaceElement:!0}}}},{key:"bindings",get:function(){return{"[name=value]":{observe:"value",setOptions:{validate:!0}}}}},{key:"onRender",value:function(){this.showChildView("textArea",new x.F({name:"value",class:"form-control",placeholder:this.model.get("placeholder"),id:"admin-notes"})),this.stickit(),i.Validation.bind(this)}},{key:"onDestroy",value:function(){this.unstickit(),i.Validation.unbind(this)}}])&&N(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),s}(r.Q.Component),B=n(44106),L=n.n(B);function U(e){return U="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},U(e)}function A(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function F(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,(void 0,i=function(e,t){if("object"!==U(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==U(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o.key),"symbol"===U(i)?i:String(i)),o)}var i}function Q(e,t,n){return t&&F(e.prototype,t),n&&F(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function z(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&&J(e,t)}function J(e,t){return J=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},J(e,t)}function H(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=K(e);if(t){var i=K(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return function(e,t){if(t&&("object"===U(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)}(this,n)}}function K(e){return K=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},K(e)}var Z=function(e){z(n,e);var t=H(n);function n(e){return A(this,n),t.call(this,e)}return Q(n,[{key:"name",get:function(){return"ExtraInfoComponentCollection"}},{key:"childView",get:function(){return I}},{key:"childViewOptions",get:function(){return{viewModel:this.options.viewModel}}}]),n}(r.Q.ComponentCollection),G=function(e){z(n,e);var t=H(n);function n(e){return A(this,n),t.call(this,e)}return Q(n,[{key:"name",get:function(){return"ExtraInfoComponent"}},{key:"template",get:function(){return L()}},{key:"className",get:function(){return"border-top pt-3"}},{key:"regions",value:function(){return{fields:{el:".fields-region",replaceElement:!0}}}},{key:"onRender",value:function(){this.showChildView("fields",new Z({collection:this.model.fields,viewModel:this.model}))}}]),n}(r.Q.Component),W=n(17391),Y=n(3974),q=n(36022),X=n(44391),$=n(26457),ee=n(30992),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},ne(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,(void 0,i=function(e,t){if("object"!==ne(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==ne(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o.key),"symbol"===ne(i)?i:String(i)),o)}var i}function ie(e,t){return ie=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ie(e,t)}function re(e){return re=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},re(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&&ie(e,t)}(c,e);var t,n,o,i,s=(o=c,i=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}}(),function(){var e,t=re(o);if(i){var n=re(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(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)}(this,e)});function c(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),s.call(this,e)}return t=c,(n=[{key:"name",get:function(){return"TagsComponent"}},{key:"template",get:function(){return te()}},{key:"lang",get:function(){return"libraryEditor.tags"}},{key:"defaults",get:function(){return{headerText:l.T.getPhrase(this.lang,"heading"),orientation:$.zM.Flex}}},{key:"regions",value:function(){return{tagList:{el:".tag-list-region",replaceElement:!0},tagSelector:{el:".tag-selector-region",replaceElement:!0}}}},{key:"initialize",value:function(){this.options.behavior!==$.Dm.Edit||this.options.parentId||r.Q.ErrorHelper.throw(new a.H("parentId is required to edit tags."))}},{key:"getTypeaheadConfigs",value:function(){var e=Y.M.getTypeaheadConfig(),t=Y.M.getBloodhoundConfig(),n={newType:f.n8.TagsRaw},o={newType:f.n8.TagsRaw,footerTemplate:W.J.getConfirmSelectionTemplate()};return[{name:f.n8.TagsRaw,typeaheadConfig:e,bloodhoundConfig:t,options:{hideEmptyResults:!0}},{name:"add-new",typeaheadConfig:e,bloodhoundConfig:t,options:n},{name:"empty-suggestion",typeaheadConfig:e,bloodhoundConfig:t,options:o}]}},{key:"viewOptions",value:function(){var e;return this.showEmptyStateText()&&(e=this.options.emptyStateText),{headerText:this.options.headerText,editable:this.options.behavior===$.Dm.Edit,emptyStateText:e}}},{key:"showEmptyStateText",value:function(){return this.options.behavior!==$.Dm.Edit&&!this.collection.length&&!!this.options.emptyStateText}},{key:"renderTagSelector",value:function(){this.options.behavior===$.Dm.Edit&&this.showChildView("tagSelector",new q.M({model:this.model,parentChannelName:this.options.channelName,inputId:"tag-select",selectEvent:"add:tag",typeaheadConfigs:this.getTypeaheadConfigs(),placeholderText:l.T.getPhrase(this.lang,"placeholder"),callbacks:{onRender:W.J.selectFirstResult,onBlur:W.J.clearInputOnBlur},typeaheadOptions:{hint:!1},actionOptions:{clearOnSelect:!0},autofocus:this.options.autofocus}))}},{key:"renderTagList",value:function(){this.showEmptyStateText()||this.showChildView("tagList",new X.K({collection:this.collection,channelName:this.options.channelName,behavior:this.options.behavior,orientation:this.options.orientation,removeEvent:this.options.removeEvent}))}},{key:"onRender",value:function(){this.renderTagSelector(),this.renderTagList()}}])&&oe(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),c}(r.Q.Component),se=n(88172),le=n(99724),ce=n.n(le),ue={saveButton:"G_FDK",undo:"dcV70"};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},de(e)}function fe(e,t,n){return(t=pe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function he(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,pe(o.key),o)}}function pe(e){var t=function(e,t){if("object"!==de(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==de(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===de(t)?t:String(t)}function ve(e,t){return ve=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ve(e,t)}function ye(e){return ye=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ye(e)}var me=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&&ve(e,t)}(c,e);var t,n,o,a,s=(o=c,a=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}}(),function(){var e,t=ye(o);if(a){var n=ye(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(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)}(this,e)});function c(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),s.call(this,e)}return t=c,(n=[{key:"name",get:function(){return"SaveComponent"}},{key:"template",get:function(){return ce()}},{key:"className",get:function(){return"save-component ".concat(this.options.extraClasses)}},{key:"lang",get:function(){return"libraryEditor.save"}},{key:"getParentChannel",value:function(){return i.Radio.channel(this.options.channelName)}},{key:"getSaveChannelName",value:function(){return"".concat(this.name,":").concat(this.cid)}},{key:"regions",value:function(){return{save:{el:".save-region",replaceElement:!0}}}},{key:"events",value:function(){return{"click .undo":"onUndo"}}},{key:"initialize",value:function(){var e;this.model||(this.model=new r.Q.Model((fe(e={},se.ZV.ShowSpinner,this.options.showSpinner),fe(e,se.ZV.Disabled,this.options.isDisabled),e)));var t=this.options.channelName;this.listenTo(t,O.LibraryEditorActions.DisableSave,this.onDisableSave),this.listenTo(t,O.LibraryEditorActions.EnableSave,this.onEnableSave),this.listenTo(t,O.LibraryEditorActions.CancelSave,this.onCancelSave);var n=i.Radio.channel(this.getSaveChannelName());this.listenTo(n,O.LibraryEditorActions.Save,this.onSave),this.options.allowUndo&&(this.options.hasChanges&&this.model.set("showUndo",!0),this.listenTo(this.model,"change:showUndo",this.render))}},{key:"onCancelSave",value:function(){this.model.set(se.ZV.ShowSpinner,!1)}},{key:"onEnableSave",value:function(){this.model.set(se.ZV.Disabled,!1),this.options.allowUndo&&this.model.set("showUndo",!0)}},{key:"onDisableSave",value:function(){this.model.get(se.ZV.ShowSpinner)&&this.model.set(se.ZV.ShowSpinner,!1,{silent:!0}),this.model.set(se.ZV.Disabled,!0),this.options.allowUndo&&this.model.set("showUndo",!1)}},{key:"onUndo",value:function(e){e.stopPropagation(),this.getParentChannel().trigger(O.LibraryEditorActions.Undo)}},{key:"onSave",value:function(){this.model.set(se.ZV.ShowSpinner,!0),this.getParentChannel().trigger(O.LibraryEditorActions.Save)}},{key:"viewOptions",value:function(){return{allowUndo:this.options.allowUndo&&this.model.get("showUndo"),styles:ue}}},{key:"renderSaveButton",value:function(){var e=new se.Py({saveEvent:O.LibraryEditorActions.Save,channelName:this.getSaveChannelName(),model:this.model,buttonText:l.T.getPhrase(this.lang,"save"),extraButtonClass:"btn-dark ".concat(ue.saveButton),spinnerOptions:{size:v.Ey.Small,type:v.dR.Light,extraClasses:"mx-auto"}});this.showChildView("save",e)}},{key:"onRender",value:function(){this.renderSaveButton()}}])&&he(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),c}(r.Q.Component),be=n(2772),ge=n(88483),we=n(10101),Se=n(86272),ke=n.n(Se);function Oe(e){return Oe="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},Oe(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,(void 0,i=function(e,t){if("object"!==Oe(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==Oe(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o.key),"symbol"===Oe(i)?i:String(i)),o)}var i}function Te(e,t){return Te=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Te(e,t)}function Ce(e){return Ce=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ce(e)}var Pe=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&&Te(e,t)}(a,e);var t,n,o,i,r=(o=a,i=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}}(),function(){var e,t=Ce(o);if(i){var n=Ce(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Oe(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)}(this,e)});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(){this.viewModel=s.r.get("image:storage")}},{key:"name",get:function(){return"EditThumbnailComponent"}},{key:"lang",get:function(){return"libraryEditor.editThumbnail"}},{key:"template",get:function(){return ke()}},{key:"behaviors",get:function(){var e=this;return[{behaviorClass:we.YR,channelName:this.options.channelName,buttonSelector:".upload-thumbnail",imageType:g.__.Thumbnails,appLink:{application:f.OV.LIBRARY_EDITOR,action:f.eX.LibraryEditor.UPLOAD_THUMBNAIL,args:[this.options.model.id]},saveImage:function(t){return e.viewModel.set({dataUrl:t})}}]}},{key:"defaults",get:function(){return{editable:!0}}},{key:"regions",value:function(){return{thumbnail:{el:".thumbnail-region",replaceElement:!0}}}},{key:"viewOptions",value:function(){return{editable:this.options.editable,dimensions:f.nq[g.__.Thumbnails]}}},{key:"onRender",value:function(){this.showChildView("thumbnail",new be.Z({model:this.model,thumbnailOptions:{size:ge.h2.Medium}}))}}])&&Ee(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(r.Q.Component),je=n(58259),xe=n.n(je);function Re(e){return Re="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},Re(e)}function De(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==Re(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==Re(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o.key),"symbol"===Re(i)?i:String(i)),o)}var i}function Me(e,t){return Me=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Me(e,t)}function Ne(e){return Ne=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ne(e)}var _e=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&&Me(e,t)}(a,e);var t,n,o,i,r=(o=a,i=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}}(),function(){var e,t=Ne(o);if(i){var n=Ne(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Re(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)}(this,e)});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:"name",get:function(){return"CollapseButtonComponent"}},{key:"className",get:function(){return"d-inline-block cursor-pointer expand-details info-link mb-3"}},{key:"lang",get:function(){return"libraryEditor.collapseButton"}},{key:"template",get:function(){return xe()}},{key:"events",value:function(){return{click:"onClick"}}},{key:"onClick",value:function(){this.options.onClick()}},{key:"viewOptions",value:function(){return{showMorePhrase:this.options.collapse?"showMore":"showLess"}}}])&&De(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(r.Q.Component),Ve=n(23468),Ie=n.n(Ve),Be={suggestEdit:"AgfOM"};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},Le(e)}function Ue(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,(void 0,i=function(e,t){if("object"!==Le(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==Le(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o.key),"symbol"===Le(i)?i:String(i)),o)}var i}function Ae(e,t){return Ae=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ae(e,t)}function Fe(e){return Fe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Fe(e)}var Qe=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&&Ae(e,t)}(a,e);var t,n,o,i,r=(o=a,i=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}}(),function(){var e,t=Fe(o);if(i){var n=Fe(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(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)}(this,e)});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.listenTo(this.options.channelName,"update:tags",(function(){return e.renderCustomerTags(!0)})),this.initializeCollapse()}},{key:"name",get:function(){return"EditVideoDetailsComponent"}},{key:"className",get:function(){return"edit-video-detail py-3"}},{key:"lang",get:function(){return"libraryEditor.editVideoDetails"}},{key:"template",get:function(){return Ie()}},{key:"appLinks",get:function(){return{".suggest-edit":{application:f.OV.LIBRARY_EDITOR,action:f.eX.LibraryEditor.SUGGEST_AN_EDIT,args:[this.model.id]}}}},{key:"events",value:function(){return{"click .expand-details":"onClickExpandDetails"}}},{key:"elements",get:function(){return{expandable:".collapse-area"}}},{key:"regions",value:function(){return{topSave:{el:".top-save-region",replaceElement:!0},bottomSave:{el:".bottom-save-region",replaceElement:!0},thumbnail:{el:".thumbnail-region",replaceElement:!0},basicInfo:{el:".basic-info-region",replaceElement:!0},collapseButton:{el:".collapse-button-region",replaceElement:!0},additionalInfo:{el:".additional-details-region",replaceElement:!0},productionInfo:{el:".production-info-region",replaceElement:!0},fields:{el:".fields-region",replaceElement:!0},clickViewTags:{el:".cv-tags-region",replaceElement:!1},customerTags:{el:".customer-tags-region",replaceElement:!0}}}},{key:"initializeCollapse",value:function(){var e,t,n,o,i,r;this.collapse=!(this.model.get("broadcastDate")||(null===(e=this.model.channel)||void 0===e?void 0:e.get("id"))||this.model.get("productionYear")||(null===(t=this.model.productionCompanies)||void 0===t?void 0:t.any((function(e){return e.get("id")})))||(null===(n=this.model.distributors)||void 0===n?void 0:n.any((function(e){return e.get("id")})))||(null===(o=this.model.producers)||void 0===o?void 0:o.any((function(e){return e.get("id")})))||(null===(i=this.model.directors)||void 0===i?void 0:i.any((function(e){return e.get("id")})))||(null===(r=this.model.fields)||void 0===r?void 0:r.any((function(e){return e.get("id")>0}))))}},{key:"onClickCollapse",value:function(){this.collapse=!this.collapse,this.renderCollapseButton(),this.collapse?this.getUI("expandable").hide():this.getUI("expandable").show()}},{key:"renderSave",value:function(){this.options.editable&&this.showChildView("topSave",new me({channelName:this.options.channelName,allowUndo:!0,isDisabled:this.options.isSaveDisabled,hasChanges:this.options.hasChanges,extraClasses:"float-right"})),this.showChildView("bottomSave",new me({channelName:this.options.channelName,allowUndo:!0,isDisabled:this.options.isSaveDisabled,hasChanges:this.options.hasChanges,extraClasses:"float-right"}))}},{key:"renderBasicInfo",value:function(){this.showChildView("basicInfo",new C.J({model:this.model,ratings:this.options.ratings,channelName:this.options.channelName,editable:this.options.editable,showingSaveButton:this.options.editable}))}},{key:"renderThumbnail",value:function(){this.showChildView("thumbnail",new Pe({model:this.model,channelName:this.options.channelName,editable:this.options.editable}))}},{key:"renderCollapseButton",value:function(){this.showChildView("collapseButton",new _e({onClick:this.onClickCollapse.bind(this),collapse:this.collapse}))}},{key:"renderAdditionalInfo",value:function(){this.options.currentUser.get("instanceRegion")!==S.b.US&&this.showChildView("additionalInfo",new j.a({model:this.model,channelName:this.options.channelName,editable:this.options.editable}))}},{key:"renderProductionInfo",value:function(){this.showChildView("productionInfo",new P.O({model:this.model,channelName:this.options.channelName,editable:this.options.editable}))}},{key:"renderFields",value:function(){this.options.currentUser.get("instanceRegion")!==S.b.US&&this.showChildView("fields",new G({model:this.model,channelName:this.options.channelName}))}},{key:"renderClickViewTags",value:function(){if(!this.options.editable){var e=v.BK.filterObjectsByOwnerType(this.model.tags,T.N.ClickView,this.options.currentUser.get("customerId"));this.showChildView("clickViewTags",new ae({parentId:this.model.get("id"),collection:e,orientation:$.zM.Flex,behavior:$.Dm.Disabled,channelName:this.options.channelName,headerText:l.T.getPhrase(this.lang,"clickviewTags"),emptyStateText:l.T.getPhrase(this.lang,"clickviewTagsEmpty")}))}}},{key:"renderCustomerTags",value:function(e){var t=v.BK.filterObjectsByOwnerType(this.model.tags,T.N.Customer,this.options.currentUser.get("customerId"));this.showChildView("customerTags",new ae({parentId:this.model.get("id"),collection:t,channelName:this.options.channelName,behavior:$.Dm.Edit,headerText:this.options.editable?l.T.getPhrase(this.lang,"tags"):l.T.getPhrase(this.lang,"customerTags"),removeEvent:"remove:tag",autofocus:!!e}))}},{key:"renderTags",value:function(){this.renderClickViewTags(),this.renderCustomerTags()}},{key:"viewOptions",value:function(){return{styles:Be,editable:this.options.editable,suggestEditClasses:"info-link text-underline suggest-edit",isExchange:v.M2.isExchangeVideo(this.model),collapse:this.collapse}}},{key:"onRender",value:function(){this.renderSave(),this.renderBasicInfo(),this.renderThumbnail(),this.renderTags(),this.renderCollapseButton(),this.renderAdditionalInfo(),this.renderProductionInfo(),this.renderFields()}}])&&Ue(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(r.Q.Component),ze=n(21053),Je=n(53854),He=n(75535),Ke=n(95061),Ze=n(55230),Ge=n.n(Ze);function We(e){return We="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},We(e)}function Ye(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,(void 0,i=function(e,t){if("object"!==We(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==We(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o.key),"symbol"===We(i)?i:String(i)),o)}var i}function qe(e,t){return qe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},qe(e,t)}function Xe(e){return Xe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Xe(e)}var $e=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&&qe(e,t)}(j,e);var t,n,T,C,P=(T=j,C=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}}(),function(){var e,t=Xe(T);if(C){var n=Xe(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===We(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)}(this,e)});function j(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,j),(t=P.call(this,e)).editable=!1,t}return t=j,n=[{key:"name",get:function(){return"EditVideoView"}},{key:"title",get:function(){return this.model&&this.model.get("name")}},{key:"lang",get:function(){return"libraryEditor.editVideo"}},{key:"className",get:function(){return"bg-white p-3 rounded"}},{key:"channelName",get:function(){return"".concat(this.name,":").concat(this.cid)}},{key:"viewModelName",get:function(){return"".concat(this.name,":").concat(this.options.videoId)}},{key:"template",get:function(){return Ge()}},{key:"regions",value:function(){return{tabs:{el:".tab-region",replaceElement:!0,partialLoading:g.LP.EditVideoTabs},content:{el:".edit-content-region",replaceElement:!0,partialLoading:g.LP.EditVideoDetails}}}},{key:"initialize",value:function(){this.navLock=u.u.getInstance(f.K9.NavLock,this),this.initDataListeners(),v.Si.initBackButton(),this.initServices()}},{key:"initServices",value:function(){this.videoDataService=u.u.getInstance(f.Or.Video,this),this.tagDataService=u.u.getInstance(f.Or.Tags,this),this.seriesDataService=u.u.getInstance(f.Or.Series,this),this.ratingsDataService=u.u.getInstance(f.Or.Ratings,this),this.fieldsDataService=u.u.getInstance(f.Or.Fields,this),this.alertService=u.u.getInstance(f.K9.Alerts,this),this.personDataService=u.u.getInstance(f.Or.Person,this),this.companyDataService=u.u.getInstance(f.Or.Company,this)}},{key:"initDataListeners",value:function(){this.listenTo(c.G.SHELL,r.Q.EventNames.NAV_UNLOCKED_BY_USER,this.onNavigateAway),this.listenTo(f.Vk.VIDEO,"videos:".concat(this.options.videoId,":sync"),this.render),this.listenTo(f.Vk.VIDEO,"videos:".concat(this.options.videoId,":error"),this.onError),this.listenTo(f.Vk.RATINGS,"".concat(f.M_.RATINGS,":sync"),this.render),this.listenTo(f.Vk.VIDEO,"".concat(f.M_.UPDATE_VIDEO_THUMBNAIL,":").concat(this.options.videoId,":sync"),this.onThumbnailUpdated),this.listenTo(this.channelName,"select:rating",o.partial(this.onTypeaheadSelection,o,"rating")),this.listenTo(this.channelName,"select:channel",o.partial(this.onTypeaheadSelection,o,"channel")),this.listenTo(this.channelName,"select:series",this.onSelectSeries),this.listenTo(this.channelName,"add:season",this.onSelectSeason),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,"add:producers",this.onSelectProducer),this.listenTo(this.channelName,"add:tag",this.onAddTag),this.listenTo(this.channelName,"remove:distributors",this.onRemoveDistributor),this.listenTo(this.channelName,"remove:productionCompanies",this.onRemoveProductionCompany),this.listenTo(this.channelName,"remove:directors",this.onRemoveDirector),this.listenTo(this.channelName,"remove:producers",this.onRemoveProducer),this.listenTo(this.channelName,"remove:tag",this.onRemoveTag),this.listenTo(this.channelName,O.LibraryEditorActions.Save,this.onSave),this.listenTo(this.channelName,O.LibraryEditorActions.Undo,this.onUndo),this.listenTo(this.channelName,O.LibraryEditorActions.DetectInput,this.onTypeaheadInput),this.listenTo(this.channelName,"image:load",this.onBeforeThumbnailUpload)}},{key:"onError",value:function(e){switch(e.type){case d.h.NotFound:r.Q.ErrorHelper.throw(new He.l);break;case d.h.Forbidden:r.Q.ErrorHelper.throw(new Je.a)}}},{key:"onTypeaheadSelection",value:function(e,t,n){if(n){var i=this.viewModel.get(t),r=i.filter({name:e.name});o.each(r,(function(e){return i.remove(e)})),i.add(e)}else this.viewModel.set(t,e);this.onModelChange(e,{manualUpdate:!0})}},{key:"onTypeaheadInput",value:function(e,t,n){e.get("name")||(n&&n.isCollection?this.viewModel.get(t).remove(e.get("id"),{silent:!0}):this.viewModel.get(t).clear({silent:!0}),this.onModelChange(null,{manualUpdate:!0}),"series"===t&&(this.validateSeries(),i.Radio.channel(this.channelName).trigger("clear:series")))}},{key:"onSelectSeries",value:function(e){var t=this;e.id?this.seriesDataService.getSeries(e.id,(function(e){t.viewModel.unset("season"),t.viewModel.set("episodeNumber",null),t.onTypeaheadSelection(e.toJSON(),"series")})):e.name&&this.seriesDataService.createSeries(e.name,(function(e){t.viewModel.unset("season"),t.viewModel.set("episodeNumber",null),t.onTypeaheadSelection({id:e.id},"series")}))}},{key:"onSelectSeason",value:function(e){var t=this;if(o.isNull(e))return this.viewModel.get("season").clear({silent:!0}),this.viewModel.set("episodeNumber",null),v.yV.deselectAll(this.viewModel.get("series.seasons")),void this.onModelChange(null,{manualUpdate:!0});if(e.id)return this.viewModel.set("season",e),v.yV.setSelected(e.id,this.viewModel.get("series.seasons")),void this.onModelChange(e,{manualUpdate:!0});if(e.number){var n=this.viewModel.get("series.id");this.seriesDataService.createSeason(e,n,(function(e){t.viewModel.set("season",e.toJSON()),!t.viewModel.get("series.seasons")&&t.viewModel.get("series").set("seasons",new h.i),t.viewModel.get("series.seasons").add(e.toJSON()),v.yV.setSelected(e.id,t.viewModel.get("series.seasons")),t.onModelChange(e.toJSON(),{manualUpdate:!0}),t.render()}))}}},{key:"onSelectDistributor",value:function(e){var t=this;e.id?this.onTypeaheadSelection(e,"distributors",!0):e.name&&this.companyDataService.createCompany(e.name,(function(e){t.onTypeaheadSelection(e.toJSON(),"distributors",!0)}))}},{key:"onSelectProductionCompany",value:function(e){var t=this;e.id?this.onTypeaheadSelection(e,"productionCompanies",!0):e.name&&this.companyDataService.createCompany(e.name,(function(e){t.onTypeaheadSelection(e.toJSON(),"productionCompanies",!0)}))}},{key:"onSelectDirector",value:function(e){var t=this;e.id?this.onTypeaheadSelection(e,"directors",!0):e.name&&this.personDataService.createPerson(e.name,(function(e){t.onTypeaheadSelection(e.toJSON(),"directors",!0)}))}},{key:"onSelectProducer",value:function(e){var t=this;e.id?this.onTypeaheadSelection(e,"producers",!0):e.name&&this.personDataService.createPerson(e.name,(function(e){t.onTypeaheadSelection(e.toJSON(),"producers",!0)}))}},{key:"onRemoveDistributor",value:function(e){this.removeFromCollection(e,"distributors")}},{key:"onRemoveProductionCompany",value:function(e){this.removeFromCollection(e,"productionCompanies")}},{key:"onRemoveDirector",value:function(e){this.removeFromCollection(e,"directors")}},{key:"onRemoveProducer",value:function(e){this.removeFromCollection(e,"producers")}},{key:"removeFromCollection",value:function(e,t){e&&e.id&&t&&(this.viewModel.get(t).remove(e.id),this.onModelChange(null,{manualUpdate:!0}))}},{key:"onAddTag",value:function(e){var t=this;if(e&&e.name){var n=e.name.trim().toLowerCase();if(n&&!v.yV.findModelByName(n,this.viewModel.tags)){var o=new m.V({name:n});this.viewModel.tags.add(o),this.tagDataService.createTag(n,this.model.get("id"),(function(e){o.set(e.toJSON()),i.Radio.channel(t.channelName).trigger("update:tags")}))}}}},{key:"onRemoveTag",value:function(e){var t=this;e instanceof m.V&&e.id&&this.tagDataService.dissociateTag(e.id,this.model.get("id"),(function(){t.viewModel.tags.remove(e),i.Radio.channel(t.channelName).trigger("update:tags"),t.logDissocAction(t.model.get("id"),e,w.EntityType.Tag)}))}},{key:"saveFields",value:function(e,t){var n=this,i=0;e.updatedVideo=o.extend({},e.updatedVideo||{});var r=function(){++i===e.dataChanges.fields.length&&t(e)};o.each(e.dataChanges.fields,(function(e){if(e.id&&!e.value)return n.viewModel.fields.remove(n.viewModel.fields.findWhere({id:e.id})),void n.fieldsDataService.deleteField(e.id,r);!e.id||e.id>0?n.fieldsDataService.updateField(e,r):n.fieldsDataService.addField(n.options.videoId,e,(function(t){n.viewModel.fields.findWhere({id:e.id}).set("id",t.id),r()}))}))}},{key:"bulkDissoc",value:function(e,t){this.videoDataService.bulkDissoc(this.model.id,e.pendingDissocs,(function(){t(e)}))}},{key:"saveVideo",value:function(e,t){var n=this,i=o.omit(e.dataChanges,"fields");if(o.isEmpty(i))t(e);else{var r=o.omit(e.dataChanges,"fields");this.videoDataService.updateVideo(this.model.get("id"),this.folder.get("id"),r,(function(i){(e.dataChanges.series&&e.dataChanges.series.id||e.dataChanges.episodeNumber||e.dataChanges.season)&&n.videoDataService.clearVideoCache(),e.updatedVideo=o.extend({},e.updatedVideo||{},i),t(e)}))}}},{key:"afterSave",value:function(e){if(this.viewModel){e.updatedVideo&&this.updateState(e.updatedVideo),this.unlockNav(),this.updateSaveButton(O.LibraryEditorActions.DisableSave),this.logEditAction(e.dataChanges,w.WorkflowPhase.Save);var t=b.J.updatedVideoAlert(this.viewModel.get("name"));this.alertService.success(t||"Video was successfully updated")()}}},{key:"onSave",value:function(){if(this.viewModel.validate(),!1===this.viewModel.isValid())return this.updateSaveButton(O.LibraryEditorActions.CancelSave),!1;this.validateSeries();var e=E.xC.getChanges(this.model,this.viewModel),t=E.xC.getRemovedObjectIds(this.model,this.viewModel);if(!e&&!o.keys(t).length)return this.updateSaveButton(O.LibraryEditorActions.CancelSave),!1;var n=new r.Q.Middleware;return e&&e.fields&&n.use(o.bind(this.saveFields,this)),t&&o.keys(t).length&&n.use(o.bind(this.bulkDissoc,this)),this.editable&&n.use(o.bind(this.saveVideo,this)),n.use(o.bind(this.afterSave,this)),n.go({dataChanges:e,pendingDissocs:t},null),!1}},{key:"onUndo",value:function(){var e=this;new v.Mr({title:l.T.getPhrase(this.lang,"undoTitle"),text:l.T.getPhrase(this.lang,"undoBody",{videoName:this.model.get("name")}),buttons:[{text:l.T.getPhrase(this.lang,"undo"),className:"btn btn-danger",success:!0},{text:l.T.getPhrase(this.lang,"cancel"),className:"btn btn-link",close:!0}]}).render().done((function(){e.logEditAction({},w.WorkflowPhase.Discard),e.revertState({undo:!0}),e.render()}))}},{key:"updateState",value:function(e){this.stopListening(this.viewModel),E.xC.updateModelState(this.model,this.viewModel,e),s.r.clear(this.viewModelName),this.getViewModel(),this.renderContent(),this.renderTabs()}},{key:"onNavigateAway",value:function(){this.revertState()}},{key:"revertState",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).undo;this.stopListening(this.viewModel),s.r.clear(this.viewModelName),delete this.viewModel,this.unlockNav(),e&&this.getViewModel()}},{key:"lockNav",value:function(){this.navLock.lock({title:l.T.getPhrase(this.lang,"navLockHeading"),text:l.T.getPhrase(this.lang,"navLockBody")})}},{key:"unlockNav",value:function(){this.navLock.unlock()}},{key:"onBeforeThumbnailUpload",value:function(){this.navLock.isLocked()&&(this.navLock.unlock(),s.r.get("upload:thumbnail:options").set("lockNav",!0))}},{key:"onModelChange",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t.stickitChange||t.manualUpdate)if(this.viewModel.validate(),!1!==this.viewModel.isValid()){if(!E.xC.getChanges(this.model,this.viewModel)&&!o.keys(E.xC.getRemovedObjectIds(this.model,this.viewModel)).length)return this.unlockNav(),void this.updateSaveButton(O.LibraryEditorActions.DisableSave);this.lockNav(),this.updateSaveButton(O.LibraryEditorActions.EnableSave)}else this.updateSaveButton(O.LibraryEditorActions.DisableSave)}},{key:"updateSaveButton",value:function(e){var t=i.Radio.channel(this.channelName),n=O.LibraryEditorActions.EnableSave,o=O.LibraryEditorActions.DisableSave,s=O.LibraryEditorActions.CancelSave;switch(e){case n:return void t.trigger(n);case o:return void t.trigger(o);case s:return void t.trigger(s)}r.Q.ErrorHelper.throw(new a.H("Save action type is not valid."))}},{key:"onThumbnailUpdated",value:function(){var e=this;this.videoDataService.clearCacheAndGetVideo(this.options.videoId,(function(t){e.model=t,e.viewModel.set("thumbnail",e.model.thumbnail.toJSON())}))}},{key:"logEditAction",value:function(e,t){var n=Object.assign({id:this.model.get("id")},e);k.k.logUserAction(n,{actionType:w.UserAction.Edit,entity:w.EntityType.Video,location:w.LocationContext.EditVideoDetails,workflowPhase:t})}},{key:"logDissocAction",value:function(e,t,n){var o=Object.assign({videoId:e},t.pick("id","name"));k.k.logUserAction(o,{actionType:w.UserAction.Dissociate,entity:n,location:w.LocationContext.EditVideoDetails})}},{key:"onValidation",value:function(e){this.viewModel.set("disabled",!e)}},{key:"getViewModel",value:function(){this.model.fields&&this.model.fields.length||this.model.set("fields",(0,E.aj)()),this.viewModel=s.r.get(this.viewModelName,this.model.toJSON(),{ctor:y.n}),this.editable&&(this.viewModel.addValidation(E.rr),this.viewModel.addValidation(E.tD));var e=this.currentUser.get("instanceRegion")!==S.b.US;e&&this.viewModel.addValidation(E.oJ),this.listenTo(this.viewModel,"validated",this.onValidation),this.listenTo(this.viewModel,"change",this.onModelChange),this.listenTo(this.viewModel,"change:dateBroadcast",o.partial(this.onModelChange,o,{manualUpdate:!0})),this.viewModel.fields&&e&&(this.viewModel.fields&&this.viewModel.fields.each((function(e){return e.addValidation(E.Zg)})),this.listenTo(this.viewModel.fields,"change",this.onModelChange))}},{key:"validateSeries",value:function(){this.viewModel.get("series.id")||(this.viewModel.unset("season"),this.viewModel.set("episodeNumber",null))}},{key:"fetchData",value:function(){this.model=this.videoDataService.getVideo(this.options.videoId),this.ratings=this.ratingsDataService.getAllRatings(),this.model&&(this.editable=v.BK.canEditVideo(this.model),this.folder=this.model.categories.first(),this.ratings&&(this.viewModel instanceof y.n||this.getViewModel()))}},{key:"requiredResources",get:function(){return{currentUser:p.K.currentUser,libraries:Ke.T.libraries}}},{key:"onBeforeRender",value:function(){return this.fetchData(),!!this.model&&!!this.ratings&&!!this.viewModel}},{key:"renderContent",value:function(){var e=E.xC.getChanges(this.model,this.viewModel)||o.keys(E.xC.getRemovedObjectIds(this.model,this.viewModel)).length;this.showChildView("content",new Qe({model:this.viewModel,ratings:this.ratings,channelName:this.channelName,isSaveDisabled:!e,hasChanges:!!e,editable:this.editable,currentUser:this.currentUser}))}},{key:"renderTabs",value:function(){this.showChildView("tabs",new ze.W({model:this.viewModel,tabs:v.Si.getEditVideoTabs(this.options.videoId,this.editable),activeTab:".edit-video-applink",context:"edit",folder:this.folder,libraries:this.libraries}))}},{key:"onRender",value:function(){this.renderTabs(),this.renderContent()}}],n&&Ye(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),j}(r.Q.View)},86272:function(e,t,n){var o=n(32227);e.exports=(o.default||o).template({1:function(e,t,n,o,i){return e.propertyIsEnumerable,"<h5>"+e.escapeExpression((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"label",{name:"lang",hash:{},data:i}))+"</h5>\n"},3:function(e,t,n,o,i){return"my-2"},5:function(e,t,n,o,i){e.propertyIsEnumerable;var r,a=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,l=e.escapeExpression;return' <div class="text-muted mt-3 mb-1"><em>'+l((n.lang||t&&t.lang||s).call(a,"recommendedSize",{name:"lang",hash:{height:null!=(r=null!=(r=null!=t?t.options:t)?r.dimensions:r)?r.height:r,width:null!=(r=null!=(r=null!=t?t.options:t)?r.dimensions:r)?r.width:r},data:i}))+'</em></div>\n <button class="upload-thumbnail btn btn-outline-dark mb-3 w-100">'+l((n.lang||t&&t.lang||s).call(a,"upload",{name:"lang",hash:{},data:i}))+"</button>\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,i){e.propertyIsEnumerable;var r,a=null!=t?t:e.nullContext||{};return(null!=(r=n.if.call(a,null!=(r=null!=t?t.options:t)?r.editable:r,{name:"if",hash:{},fn:e.program(1,i,0),inverse:e.noop,data:i}))?r:"")+'<div class="thumbnail-region"></div>\n<div class="'+(null!=(r=n.unless.call(a,null!=(r=null!=t?t.options:t)?r.editable:r,{name:"unless",hash:{},fn:e.program(3,i,0),inverse:e.noop,data:i}))?r:"")+'">\n'+(null!=(r=n.if.call(a,null!=(r=null!=t?t.options:t)?r.editable:r,{name:"if",hash:{},fn:e.program(5,i,0),inverse:e.noop,data:i}))?r:"")+"</div>"},useData:!0})},43791:function(e,t,n){var o=n(32227);e.exports=(o.default||o).template({compiler:[8,">= 4.3.0"],main:function(e,t,n,o,i){var r;return e.propertyIsEnumerable,'<h1 class="h3">\n '+e.escapeExpression("function"==typeof(r=null!=(r=n.name||(null!=t?t.name:t))?r:e.hooks.helperMissing)?r.call(null!=t?t:e.nullContext||{},{name:"name",hash:{},data:i}):r)+'\n</h2>\n<div class="breadcrumbs-region"></div>\n<div class="tabs-region pl-2"></div>'},useData:!0})},23468:function(e,t,n){var o=n(32227);e.exports=(o.default||o).template({1:function(e,t,n,o,i){return"mb-4"},3:function(e,t,n,o,i){var r;return e.propertyIsEnumerable,' <p class="mb-2 py-1 px-2 alert alert-info '+e.escapeExpression(e.lambda(null!=(r=null!=(r=null!=t?t.options:t)?r.styles:r)?r.suggestEdit:r,t))+'">\n'+(null!=(r=n.if.call(null!=t?t:e.nullContext||{},null!=(r=null!=t?t.options:t)?r.isExchange:r,{name:"if",hash:{},fn:e.program(4,i,0),inverse:e.program(6,i,0),data:i}))?r:"")+" </p>\n"},4:function(e,t,n,o,i){var r;return e.propertyIsEnumerable," "+(null!=(r=(n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"suggestEditExchange",{name:"lang",hash:{classNames:null!=(r=null!=t?t.options:t)?r.suggestEditClasses:r},data:i}))?r:"")+"\n"},6:function(e,t,n,o,i){var r;return e.propertyIsEnumerable," "+(null!=(r=(n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"suggestEdit",{name:"lang",hash:{classNames:null!=(r=null!=t?t.options:t)?r.suggestEditClasses:r},data:i}))?r:"")+"\n"},8:function(e,t,n,o,i){return"none"},10:function(e,t,n,o,i){return"block"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,i){e.propertyIsEnumerable;var r,a=null!=t?t:e.nullContext||{};return'<div class="row">\n <div class="left-pane col-4">\n <div class="thumbnail-region"></div>\n <div class="cv-tags-region '+(null!=(r=n.unless.call(a,null!=(r=null!=t?t.options:t)?r.editable:r,{name:"unless",hash:{},fn:e.program(1,i,0),inverse:e.noop,data:i}))?r:"")+'"></div>\n <div class="customer-tags-region"></div>\n </div>\n <div class="right-pane col-8">\n'+(null!=(r=n.unless.call(a,null!=(r=null!=t?t.options:t)?r.editable:r,{name:"unless",hash:{},fn:e.program(3,i,0),inverse:e.noop,data:i}))?r:"")+' <div class="top-save-region"></div>\n <div class="basic-info-region mb-4"></div> \n <div class="collapse-button-region"></div>\n <div class="collapse-area" style="display: '+(null!=(r=n.if.call(a,null!=(r=null!=t?t.options:t)?r.collapse:r,{name:"if",hash:{},fn:e.program(8,i,0),inverse:e.program(10,i,0),data:i}))?r:"")+';">\n <div class="additional-details-region"></div> \n <div class="production-info-region mb-4"></div> \n <div class="fields-region mb-4"></div>\n </div>\n <div class="bottom-save-region"></div>\n </div>\n</div>'},useData:!0})},58259:function(e,t,n){var o=n(32227);e.exports=(o.default||o).template({compiler:[8,">= 4.3.0"],main:function(e,t,n,o,i){var r;return e.propertyIsEnumerable,e.escapeExpression((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},null!=(r=null!=t?t.options:t)?r.showMorePhrase:r,{name:"lang",hash:{},data:i}))},useData:!0})},99724:function(e,t,n){var o=n(32227);e.exports=(o.default||o).template({1:function(e,t,n,o,i){e.propertyIsEnumerable;var r,a=e.escapeExpression;return'<span class="text-muted mx-2 undo '+a(e.lambda(null!=(r=null!=(r=null!=t?t.options:t)?r.styles:r)?r.undo:r,t))+'">'+a((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"undo",{name:"lang",hash:{},data:i}))+"</span>\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,i){var r;return e.propertyIsEnumerable,(null!=(r=n.if.call(null!=t?t:e.nullContext||{},null!=(r=null!=t?t.options:t)?r.allowUndo:r,{name:"if",hash:{},fn:e.program(1,i,0),inverse:e.noop,data:i}))?r:"")+'<div class="save-region"></div>'},useData:!0})},15564:function(e,t,n){var o=n(32227);e.exports=(o.default||o).template({1:function(e,t,n,o,i){return'<span class="close cursor-pointer" aria-hidden="true">×</span>\n'},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,i){e.propertyIsEnumerable;var r,a,s=null!=t?t:e.nullContext||{},l=e.hooks.helperMissing,c="function",u=e.escapeExpression;return'<span class="clamp-1" title="'+u(typeof(a=null!=(a=n.name||(null!=t?t.name:t))?a:l)===c?a.call(s,{name:"name",hash:{},data:i}):a)+'">'+u(typeof(a=null!=(a=n.name||(null!=t?t.name:t))?a:l)===c?a.call(s,{name:"name",hash:{},data:i}):a)+"</span>\n"+(null!=(r=n.if.call(s,null!=(r=null!=t?t.options:t)?r.removable:r,{name:"if",hash:{},fn:e.program(1,i,0),inverse:e.noop,data:i}))?r:"")},useData:!0})},30992:function(e,t,n){var o=n(32227);e.exports=(o.default||o).template({1:function(e,t,n,o,i){var r;return e.propertyIsEnumerable,"<h5>"+e.escapeExpression(e.lambda(null!=(r=null!=t?t.options:t)?r.headerText:r,t))+"</h5>\n"},3:function(e,t,n,o,i){var r;return e.propertyIsEnumerable,"<p>"+e.escapeExpression(e.lambda(null!=(r=null!=t?t.options:t)?r.emptyStateText:r,t))+"</p>\n"},5:function(e,t,n,o,i){return'<div class="tag-selector-region"></div>\n'},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,i){e.propertyIsEnumerable;var r,a=null!=t?t:e.nullContext||{};return(null!=(r=n.if.call(a,null!=(r=null!=t?t.options:t)?r.headerText:r,{name:"if",hash:{},fn:e.program(1,i,0),inverse:e.noop,data:i}))?r:"")+(null!=(r=n.if.call(a,null!=(r=null!=t?t.options:t)?r.emptyStateText:r,{name:"if",hash:{},fn:e.program(3,i,0),inverse:e.noop,data:i}))?r:"")+(null!=(r=n.if.call(a,null!=(r=null!=t?t.options:t)?r.editable:r,{name:"if",hash:{},fn:e.program(5,i,0),inverse:e.noop,data:i}))?r:"")+'<div class="tag-list-region"></div>'},useData:!0})},55230:function(e,t,n){var o=n(32227);e.exports=(o.default||o).template({compiler:[8,">= 4.3.0"],main:function(e,t,n,o,i){return'<div class="tab-region"></div>\n<div class="edit-content-region"></div>\n<div class="dialog-region"></div>'},useData:!0})},44106:function(e,t,n){var o=n(32227);e.exports=(o.default||o).template({compiler:[8,">= 4.3.0"],main:function(e,t,n,o,i){return'<h5 class="mb-0">Extra Information</h5>\n<div class="text-muted mb-3">This information is only visible to administrators and will not be searchable</div>\n<div class="fields-region"></div>'},useData:!0})},72891:function(e,t,n){var o=n(32227);e.exports=(o.default||o).template({compiler:[8,">= 4.3.0"],main:function(e,t,n,o,i){var r;return e.propertyIsEnumerable,'<div class="form-group">\n <label for="edit-description">'+e.escapeExpression("function"==typeof(r=null!=(r=n.name||(null!=t?t.name:t))?r:e.hooks.helperMissing)?r.call(null!=t?t:e.nullContext||{},{name:"name",hash:{},data:i}):r)+'</label>\n <div class="text-area-region"></div>\n <div class="form-feedback"></div>\n</div>'},useData:!0})}}]);
|
|
1
|
+
(self.webpackChunk_clickview_library_editor=self.webpackChunk_clickview_library_editor||[]).push([[7634],{21053:function(e,t,n){"use strict";n.d(t,{W:function(){return y}});var o=n(48088),i=n(31647),r={svgContainer:"mtegw"},a=n(43791),s=n.n(a),l=n(48090),c=n(35630),u=n(57085),d=n(57857);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},f(e)}function h(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==f(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==f(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o.key),"symbol"===f(i)?i:String(i)),o)}var i}function p(e,t){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},p(e,t)}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}var y=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p(e,t)}(m,e);var t,n,i,a,y=(i=m,a=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}}(),function(){var e,t=v(i);if(a){var n=v(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(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)}(this,e)});function m(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,m),y.call(this,e)}return t=m,(n=[{key:"name",get:function(){return"EditVideoTabsComponent"}},{key:"className",get:function(){return"bg-white"}},{key:"regions",value:function(){return{tabs:{el:".tabs-region",replaceElement:!0},breadcrumbs:{el:".breadcrumbs-region",replaceElement:!0}}}},{key:"lang",get:function(){return"libraryEditor.editVideoTabs"}},{key:"template",get:function(){return s()}},{key:"viewOptions",value:function(){return{styles:r}}},{key:"onSave",value:function(){o.Radio.channel(l.OV.LIBRARY_EDITOR).trigger(l.eX.LibraryEditor.SAVE_VIDEO)}},{key:"getLocationBreadcrumb",value:function(){switch(this.options.context){case"edit":return{name:d.T.getPhrase(this.lang,"videoDetails")};case"chapters":return{name:d.T.getPhrase(this.lang,"chapters")};case"resources":return{name:d.T.getPhrase(this.lang,"resources")}}}},{key:"onRender",value:function(){this.showChildView("tabs",new c.n({tabs:this.options.tabs,activeTab:this.options.activeTab})),this.showChildView("breadcrumbs",new u.n({folder:this.options.folder,libraries:this.options.libraries,video:this.model,customBreadcrumbs:[this.getLocationBreadcrumb()],enableLastItemAppLink:!1}))}}])&&h(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),m}(i.Q.Component)},44391:function(e,t,n){"use strict";n.d(t,{K:function(){return g}});var o=n(31647),i=n(11306),r=n(48088),a=n(48090),s=n(26457),l=n(15564),c=n.n(l);function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function d(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==u(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==u(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o.key),"symbol"===u(i)?i:String(i)),o)}var i}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(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&&f(e,t)}(p,e);var t,n,o,i,l=(o=p,i=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}}(),function(){var e,t=h(o);if(i){var n=h(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===u(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)}(this,e)});function p(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,p),l.call(this,e)}return t=p,(n=[{key:"name",get:function(){return"TagItemComponent"}},{key:"tagName",get:function(){return this.options.behavior===s.Dm.Link?"a":"span"}},{key:"className",get:function(){var e="".concat(this.options.orientation===s.zM.Vertical?"":" d-inline-flex"),t="".concat(this.isSaving()?" saving":""),n="".concat(this.options.behavior===s.Dm.Disabled?" ".concat("dE3WC"):""),o="".concat(this.options.behavior===s.Dm.Filter?" cursor-pointer":"");return"badge-pill tag py-1 px-2 my-1 mr-1".concat(o).concat(e).concat(t).concat(n)}},{key:"template",get:function(){return c()}},{key:"elements",get:function(){return{close:".close"}}},{key:"appLinks",get:function(){return this.options.behavior!==s.Dm.Link?{}:{"[this]":{application:a.OV.SEARCH,action:a.eX.Search.HOME,params:{tag:this.model.get("name")}}}}},{key:"defaults",get:function(){return{behavior:s.Dm.Link,orientation:s.zM.Flex}}},{key:"events",value:function(){return this.options.removeEvent?{"click @ui.close":"onRemoveTag"}:{click:"onClickTag"}}},{key:"initialize",value:function(){this.options.behavior===s.Dm.Edit&&this.listenTo(this.model,"change",this.render)}},{key:"isSaving",value:function(){if(this.options.behavior!==s.Dm.Filter){var e=this.model.pick("id","name","remove"),t=e.id,n=e.name;return!!e.remove||!t||!n}}},{key:"onRemoveTag",value:function(e){if(e.stopPropagation(),!this.isSaving())return this.model.set("remove",!0),r.Radio.channel(this.options.channelName).trigger(this.options.removeEvent,this.model),!1}},{key:"onClickTag",value:function(){this.options.behavior!==s.Dm.Filter||this.options.removeEvent||r.Radio.channel(this.options.channelName).trigger(this.options.clickEvent,this.model)}},{key:"viewOptions",value:function(){return{removable:this.options.removeEvent}}},{key:"onRender",value:function(){this.resetClassName()}}])&&d(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),p}(o.Q.Component);function v(e){return v="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},v(e)}function y(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==v(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==v(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o.key),"symbol"===v(i)?i:String(i)),o)}var i}function m(e,t){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},m(e,t)}function b(e){return b=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},b(e)}var g=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&&m(e,t)}(c,e);var t,n,r,a,l=(r=c,a=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}}(),function(){var e,t=b(r);if(a){var n=b(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===v(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)}(this,e)});function c(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),l.call(this,e)}return t=c,(n=[{key:"initialize",value:function(){this.options.behavior!==s.Dm.Edit||this.options.removeEvent||o.Q.ErrorHelper.throw(new i.H("removeEvent is required to edit tags."))}},{key:"name",get:function(){return"TagComponentCollection"}},{key:"defaults",get:function(){return{orientation:s.zM.Flex}}},{key:"className",get:function(){var e="".concat(this.options.orientation===s.zM.Vertical?" d-flex align-items-start flex-column":"");return"tags".concat(e)}},{key:"childViewOptions",get:function(){return{channelName:this.options.channelName,behavior:this.options.behavior,orientation:this.options.orientation,removeEvent:this.options.removeEvent,clickEvent:this.options.clickEvent}}},{key:"childView",get:function(){return p}}])&&y(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),c}(o.Q.ComponentCollection)},29613:function(e,t,n){"use strict";n.r(t),n.d(t,{EditVideoView:function(){return $e}});var o=n(39479),i=n(48088),r=n(31647),a=n(11306),s=n(99249),l=n(57857),c=n(25417),u=n(21679),d=n(99748),f=n(48090),h=n(29625),p=n(19226),v=n(61843),y=n(71192),m=n(68619),b=n(13156),g=n(29457),w=n(70065),S=n(8371),k=n(52076),O=n(40622),E=n(57785),T=n(45837),C=n(72998),P=n(95168),j=n(24184),x=n(99844),R=n(72891),D=n.n(R);function M(e){return M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},M(e)}function N(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,(void 0,i=function(e,t){if("object"!==M(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==M(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o.key),"symbol"===M(i)?i:String(i)),o)}var i}function _(e,t){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_(e,t)}function V(e){return V=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},V(e)}var I=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,t)}(s,e);var t,n,o,r,a=(o=s,r=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}}(),function(){var e,t=V(o);if(r){var n=V(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===M(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)}(this,e)});function s(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),a.call(this,e)}return t=s,(n=[{key:"initialize",value:function(){var e=this;this.listenTo(this.model,"change",(function(){return e.options.viewModel.validate()}))}},{key:"template",get:function(){return D()}},{key:"name",get:function(){return"ExtraInfoItemComponent"}},{key:"regions",value:function(){return{textArea:{el:".text-area-region",replaceElement:!0}}}},{key:"bindings",get:function(){return{"[name=value]":{observe:"value",setOptions:{validate:!0}}}}},{key:"onRender",value:function(){this.showChildView("textArea",new x.F({name:"value",class:"form-control",placeholder:this.model.get("placeholder"),id:"admin-notes"})),this.stickit(),i.Validation.bind(this)}},{key:"onDestroy",value:function(){this.unstickit(),i.Validation.unbind(this)}}])&&N(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),s}(r.Q.Component),B=n(44106),L=n.n(B);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},A(e)}function U(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function F(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,(void 0,i=function(e,t){if("object"!==A(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==A(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o.key),"symbol"===A(i)?i:String(i)),o)}var i}function Q(e,t,n){return t&&F(e.prototype,t),n&&F(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function z(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&&J(e,t)}function J(e,t){return J=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},J(e,t)}function H(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=K(e);if(t){var i=K(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return function(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)}(this,n)}}function K(e){return K=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},K(e)}var Z=function(e){z(n,e);var t=H(n);function n(e){return U(this,n),t.call(this,e)}return Q(n,[{key:"name",get:function(){return"ExtraInfoComponentCollection"}},{key:"childView",get:function(){return I}},{key:"childViewOptions",get:function(){return{viewModel:this.options.viewModel}}}]),n}(r.Q.ComponentCollection),G=function(e){z(n,e);var t=H(n);function n(e){return U(this,n),t.call(this,e)}return Q(n,[{key:"name",get:function(){return"ExtraInfoComponent"}},{key:"template",get:function(){return L()}},{key:"className",get:function(){return"border-top pt-3"}},{key:"regions",value:function(){return{fields:{el:".fields-region",replaceElement:!0}}}},{key:"onRender",value:function(){this.showChildView("fields",new Z({collection:this.model.fields,viewModel:this.model}))}}]),n}(r.Q.Component),W=n(17391),Y=n(3974),q=n(36022),X=n(44391),$=n(26457),ee=n(30992),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},ne(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,(void 0,i=function(e,t){if("object"!==ne(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==ne(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o.key),"symbol"===ne(i)?i:String(i)),o)}var i}function ie(e,t){return ie=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ie(e,t)}function re(e){return re=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},re(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&&ie(e,t)}(c,e);var t,n,o,i,s=(o=c,i=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}}(),function(){var e,t=re(o);if(i){var n=re(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(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)}(this,e)});function c(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),s.call(this,e)}return t=c,(n=[{key:"name",get:function(){return"TagsComponent"}},{key:"template",get:function(){return te()}},{key:"lang",get:function(){return"libraryEditor.tags"}},{key:"defaults",get:function(){return{headerText:l.T.getPhrase(this.lang,"heading"),orientation:$.zM.Flex}}},{key:"regions",value:function(){return{tagList:{el:".tag-list-region",replaceElement:!0},tagSelector:{el:".tag-selector-region",replaceElement:!0}}}},{key:"initialize",value:function(){this.options.behavior!==$.Dm.Edit||this.options.parentId||r.Q.ErrorHelper.throw(new a.H("parentId is required to edit tags."))}},{key:"getTypeaheadConfigs",value:function(){var e=Y.M.getTypeaheadConfig(),t=Y.M.getBloodhoundConfig(),n={newType:f.n8.TagsRaw},o={newType:f.n8.TagsRaw,footerTemplate:W.J.getConfirmSelectionTemplate()};return[{name:f.n8.TagsRaw,typeaheadConfig:e,bloodhoundConfig:t,options:{hideEmptyResults:!0}},{name:"add-new",typeaheadConfig:e,bloodhoundConfig:t,options:n},{name:"empty-suggestion",typeaheadConfig:e,bloodhoundConfig:t,options:o}]}},{key:"viewOptions",value:function(){var e;return this.showEmptyStateText()&&(e=this.options.emptyStateText),{headerText:this.options.headerText,editable:this.options.behavior===$.Dm.Edit,emptyStateText:e}}},{key:"showEmptyStateText",value:function(){return this.options.behavior!==$.Dm.Edit&&!this.collection.length&&!!this.options.emptyStateText}},{key:"renderTagSelector",value:function(){this.options.behavior===$.Dm.Edit&&this.showChildView("tagSelector",new q.M({model:this.model,parentChannelName:this.options.channelName,inputId:"tag-select",selectEvent:"add:tag",typeaheadConfigs:this.getTypeaheadConfigs(),placeholderText:l.T.getPhrase(this.lang,"placeholder"),callbacks:{onRender:W.J.selectFirstResult,onBlur:W.J.clearInputOnBlur},typeaheadOptions:{hint:!1},actionOptions:{clearOnSelect:!0},autofocus:this.options.autofocus}))}},{key:"renderTagList",value:function(){this.showEmptyStateText()||this.showChildView("tagList",new X.K({collection:this.collection,channelName:this.options.channelName,behavior:this.options.behavior,orientation:this.options.orientation,removeEvent:this.options.removeEvent}))}},{key:"onRender",value:function(){this.renderTagSelector(),this.renderTagList()}}])&&oe(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),c}(r.Q.Component),se=n(88172),le=n(99724),ce=n.n(le),ue={saveButton:"G_FDK",undo:"dcV70"};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},de(e)}function fe(e,t,n){return(t=pe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function he(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,pe(o.key),o)}}function pe(e){var t=function(e,t){if("object"!==de(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==de(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===de(t)?t:String(t)}function ve(e,t){return ve=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ve(e,t)}function ye(e){return ye=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ye(e)}var me=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&&ve(e,t)}(c,e);var t,n,o,a,s=(o=c,a=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}}(),function(){var e,t=ye(o);if(a){var n=ye(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(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)}(this,e)});function c(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),s.call(this,e)}return t=c,(n=[{key:"name",get:function(){return"SaveComponent"}},{key:"template",get:function(){return ce()}},{key:"className",get:function(){return"save-component ".concat(this.options.extraClasses)}},{key:"lang",get:function(){return"libraryEditor.save"}},{key:"getParentChannel",value:function(){return i.Radio.channel(this.options.channelName)}},{key:"getSaveChannelName",value:function(){return"".concat(this.name,":").concat(this.cid)}},{key:"regions",value:function(){return{save:{el:".save-region",replaceElement:!0}}}},{key:"events",value:function(){return{"click .undo":"onUndo"}}},{key:"initialize",value:function(){var e;this.model||(this.model=new r.Q.Model((fe(e={},se.ZV.ShowSpinner,this.options.showSpinner),fe(e,se.ZV.Disabled,this.options.isDisabled),e)));var t=this.options.channelName;this.listenTo(t,O.LibraryEditorActions.DisableSave,this.onDisableSave),this.listenTo(t,O.LibraryEditorActions.EnableSave,this.onEnableSave),this.listenTo(t,O.LibraryEditorActions.CancelSave,this.onCancelSave);var n=i.Radio.channel(this.getSaveChannelName());this.listenTo(n,O.LibraryEditorActions.Save,this.onSave),this.options.allowUndo&&(this.options.hasChanges&&this.model.set("showUndo",!0),this.listenTo(this.model,"change:showUndo",this.render))}},{key:"onCancelSave",value:function(){this.model.set(se.ZV.ShowSpinner,!1)}},{key:"onEnableSave",value:function(){this.model.set(se.ZV.Disabled,!1),this.options.allowUndo&&this.model.set("showUndo",!0)}},{key:"onDisableSave",value:function(){this.model.get(se.ZV.ShowSpinner)&&this.model.set(se.ZV.ShowSpinner,!1,{silent:!0}),this.model.set(se.ZV.Disabled,!0),this.options.allowUndo&&this.model.set("showUndo",!1)}},{key:"onUndo",value:function(e){e.stopPropagation(),this.getParentChannel().trigger(O.LibraryEditorActions.Undo)}},{key:"onSave",value:function(){this.model.set(se.ZV.ShowSpinner,!0),this.getParentChannel().trigger(O.LibraryEditorActions.Save)}},{key:"viewOptions",value:function(){return{allowUndo:this.options.allowUndo&&this.model.get("showUndo"),styles:ue}}},{key:"renderSaveButton",value:function(){var e=new se.Py({saveEvent:O.LibraryEditorActions.Save,channelName:this.getSaveChannelName(),model:this.model,buttonText:l.T.getPhrase(this.lang,"save"),extraButtonClass:"btn-dark ".concat(ue.saveButton),spinnerOptions:{size:v.Ey.Small,type:v.dR.Light,extraClasses:"mx-auto"}});this.showChildView("save",e)}},{key:"onRender",value:function(){this.renderSaveButton()}}])&&he(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),c}(r.Q.Component),be=n(2772),ge=n(88483),we=n(10101),Se=n(86272),ke=n.n(Se);function Oe(e){return Oe="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},Oe(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,(void 0,i=function(e,t){if("object"!==Oe(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==Oe(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o.key),"symbol"===Oe(i)?i:String(i)),o)}var i}function Te(e,t){return Te=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Te(e,t)}function Ce(e){return Ce=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ce(e)}var Pe=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&&Te(e,t)}(a,e);var t,n,o,i,r=(o=a,i=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}}(),function(){var e,t=Ce(o);if(i){var n=Ce(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Oe(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)}(this,e)});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(){this.viewModel=s.r.get("image:storage")}},{key:"name",get:function(){return"EditThumbnailComponent"}},{key:"lang",get:function(){return"libraryEditor.editThumbnail"}},{key:"template",get:function(){return ke()}},{key:"behaviors",get:function(){var e=this;return[{behaviorClass:we.YR,channelName:this.options.channelName,buttonSelector:".upload-thumbnail",imageType:g.__.Thumbnails,appLink:{application:f.OV.LIBRARY_EDITOR,action:f.eX.LibraryEditor.UPLOAD_THUMBNAIL,args:[this.options.model.id]},saveImage:function(t){return e.viewModel.set({dataUrl:t})}}]}},{key:"defaults",get:function(){return{editable:!0}}},{key:"regions",value:function(){return{thumbnail:{el:".thumbnail-region",replaceElement:!0}}}},{key:"viewOptions",value:function(){return{editable:this.options.editable,dimensions:f.nq[g.__.Thumbnails]}}},{key:"onRender",value:function(){this.showChildView("thumbnail",new be.Z({model:this.model,thumbnailOptions:{size:ge.h2.Medium}}))}}])&&Ee(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(r.Q.Component),je=n(58259),xe=n.n(je);function Re(e){return Re="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},Re(e)}function De(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==Re(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==Re(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o.key),"symbol"===Re(i)?i:String(i)),o)}var i}function Me(e,t){return Me=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Me(e,t)}function Ne(e){return Ne=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ne(e)}var _e=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&&Me(e,t)}(a,e);var t,n,o,i,r=(o=a,i=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}}(),function(){var e,t=Ne(o);if(i){var n=Ne(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Re(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)}(this,e)});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:"name",get:function(){return"CollapseButtonComponent"}},{key:"className",get:function(){return"d-inline-block cursor-pointer expand-details info-link mb-3"}},{key:"lang",get:function(){return"libraryEditor.collapseButton"}},{key:"template",get:function(){return xe()}},{key:"events",value:function(){return{click:"onClick"}}},{key:"onClick",value:function(){this.options.onClick()}},{key:"viewOptions",value:function(){return{showMorePhrase:this.options.collapse?"showMore":"showLess"}}}])&&De(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(r.Q.Component),Ve=n(23468),Ie=n.n(Ve),Be={suggestEdit:"AgfOM"};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},Le(e)}function Ae(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,(void 0,i=function(e,t){if("object"!==Le(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==Le(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o.key),"symbol"===Le(i)?i:String(i)),o)}var i}function Ue(e,t){return Ue=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ue(e,t)}function Fe(e){return Fe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Fe(e)}var Qe=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&&Ue(e,t)}(a,e);var t,n,o,i,r=(o=a,i=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}}(),function(){var e,t=Fe(o);if(i){var n=Fe(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(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)}(this,e)});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.listenTo(this.options.channelName,"update:tags",(function(){return e.renderCustomerTags(!0)})),this.initializeCollapse()}},{key:"name",get:function(){return"EditVideoDetailsComponent"}},{key:"className",get:function(){return"edit-video-detail py-3"}},{key:"lang",get:function(){return"libraryEditor.editVideoDetails"}},{key:"template",get:function(){return Ie()}},{key:"appLinks",get:function(){return{".suggest-edit":{application:f.OV.LIBRARY_EDITOR,action:f.eX.LibraryEditor.SUGGEST_AN_EDIT,args:[this.model.id]}}}},{key:"events",value:function(){return{"click .expand-details":"onClickExpandDetails"}}},{key:"elements",get:function(){return{expandable:".collapse-area"}}},{key:"regions",value:function(){return{topSave:{el:".top-save-region",replaceElement:!0},bottomSave:{el:".bottom-save-region",replaceElement:!0},thumbnail:{el:".thumbnail-region",replaceElement:!0},basicInfo:{el:".basic-info-region",replaceElement:!0},collapseButton:{el:".collapse-button-region",replaceElement:!0},additionalInfo:{el:".additional-details-region",replaceElement:!0},productionInfo:{el:".production-info-region",replaceElement:!0},fields:{el:".fields-region",replaceElement:!0},clickViewTags:{el:".cv-tags-region",replaceElement:!1},customerTags:{el:".customer-tags-region",replaceElement:!0}}}},{key:"initializeCollapse",value:function(){var e,t,n,o,i,r;this.collapse=!(this.model.get("broadcastDate")||(null===(e=this.model.channel)||void 0===e?void 0:e.get("id"))||this.model.get("productionYear")||(null===(t=this.model.productionCompanies)||void 0===t?void 0:t.any((function(e){return e.get("id")})))||(null===(n=this.model.distributors)||void 0===n?void 0:n.any((function(e){return e.get("id")})))||(null===(o=this.model.producers)||void 0===o?void 0:o.any((function(e){return e.get("id")})))||(null===(i=this.model.directors)||void 0===i?void 0:i.any((function(e){return e.get("id")})))||(null===(r=this.model.fields)||void 0===r?void 0:r.any((function(e){return e.get("id")>0}))))}},{key:"onClickCollapse",value:function(){this.collapse=!this.collapse,this.renderCollapseButton(),this.collapse?this.getUI("expandable").hide():this.getUI("expandable").show()}},{key:"renderSave",value:function(){this.options.editable&&this.showChildView("topSave",new me({channelName:this.options.channelName,allowUndo:!0,isDisabled:this.options.isSaveDisabled,hasChanges:this.options.hasChanges,extraClasses:"float-right"})),this.showChildView("bottomSave",new me({channelName:this.options.channelName,allowUndo:!0,isDisabled:this.options.isSaveDisabled,hasChanges:this.options.hasChanges,extraClasses:"float-right"}))}},{key:"renderBasicInfo",value:function(){this.showChildView("basicInfo",new C.J({model:this.model,ratings:this.options.ratings,channelName:this.options.channelName,editable:this.options.editable,showingSaveButton:this.options.editable}))}},{key:"renderThumbnail",value:function(){this.showChildView("thumbnail",new Pe({model:this.model,channelName:this.options.channelName,editable:this.options.editable}))}},{key:"renderCollapseButton",value:function(){this.showChildView("collapseButton",new _e({onClick:this.onClickCollapse.bind(this),collapse:this.collapse}))}},{key:"renderAdditionalInfo",value:function(){this.options.currentUser.get("instanceRegion")!==S.b.US&&this.showChildView("additionalInfo",new j.a({model:this.model,channelName:this.options.channelName,editable:this.options.editable}))}},{key:"renderProductionInfo",value:function(){this.showChildView("productionInfo",new P.O({model:this.model,channelName:this.options.channelName,editable:this.options.editable}))}},{key:"renderFields",value:function(){this.options.currentUser.get("instanceRegion")!==S.b.US&&this.showChildView("fields",new G({model:this.model,channelName:this.options.channelName}))}},{key:"renderClickViewTags",value:function(){if(!this.options.editable){var e=v.BK.filterObjectsByOwnerType(this.model.tags,T.N.ClickView,this.options.currentUser.get("customerId"));this.showChildView("clickViewTags",new ae({parentId:this.model.get("id"),collection:e,orientation:$.zM.Flex,behavior:$.Dm.Disabled,channelName:this.options.channelName,headerText:l.T.getPhrase(this.lang,"clickviewTags"),emptyStateText:l.T.getPhrase(this.lang,"clickviewTagsEmpty")}))}}},{key:"renderCustomerTags",value:function(e){var t=v.BK.filterObjectsByOwnerType(this.model.tags,T.N.Customer,this.options.currentUser.get("customerId"));this.showChildView("customerTags",new ae({parentId:this.model.get("id"),collection:t,channelName:this.options.channelName,behavior:$.Dm.Edit,headerText:this.options.editable?l.T.getPhrase(this.lang,"tags"):l.T.getPhrase(this.lang,"customerTags"),removeEvent:"remove:tag",autofocus:!!e}))}},{key:"renderTags",value:function(){this.renderClickViewTags(),this.renderCustomerTags()}},{key:"viewOptions",value:function(){return{styles:Be,editable:this.options.editable,suggestEditClasses:"info-link text-underline suggest-edit",isExchange:v.M2.isExchangeVideo(this.model),collapse:this.collapse}}},{key:"onRender",value:function(){this.renderSave(),this.renderBasicInfo(),this.renderThumbnail(),this.renderTags(),this.renderCollapseButton(),this.renderAdditionalInfo(),this.renderProductionInfo(),this.renderFields()}}])&&Ae(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(r.Q.Component),ze=n(21053),Je=n(53854),He=n(75535),Ke=n(95061),Ze=n(55230),Ge=n.n(Ze);function We(e){return We="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},We(e)}function Ye(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,(void 0,i=function(e,t){if("object"!==We(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==We(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o.key),"symbol"===We(i)?i:String(i)),o)}var i}function qe(e,t){return qe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},qe(e,t)}function Xe(e){return Xe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Xe(e)}var $e=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&&qe(e,t)}(j,e);var t,n,T,C,P=(T=j,C=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}}(),function(){var e,t=Xe(T);if(C){var n=Xe(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===We(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)}(this,e)});function j(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,j),(t=P.call(this,e)).editable=!1,t}return t=j,n=[{key:"name",get:function(){return"EditVideoView"}},{key:"title",get:function(){return this.model&&this.model.get("name")}},{key:"lang",get:function(){return"libraryEditor.editVideo"}},{key:"className",get:function(){return"bg-white p-3 rounded"}},{key:"channelName",get:function(){return"".concat(this.name,":").concat(this.cid)}},{key:"viewModelName",get:function(){return"".concat(this.name,":").concat(this.options.videoId)}},{key:"template",get:function(){return Ge()}},{key:"regions",value:function(){return{tabs:{el:".tab-region",replaceElement:!0,partialLoading:g.LP.EditVideoTabs},content:{el:".edit-content-region",replaceElement:!0,partialLoading:g.LP.EditVideoDetails}}}},{key:"initialize",value:function(){this.navLock=u.u.getInstance(f.K9.NavLock,this),this.initDataListeners(),v.Si.initBackButton(),this.initServices()}},{key:"initServices",value:function(){this.videoDataService=u.u.getInstance(f.Or.Video,this),this.tagDataService=u.u.getInstance(f.Or.Tags,this),this.seriesDataService=u.u.getInstance(f.Or.Series,this),this.ratingsDataService=u.u.getInstance(f.Or.Ratings,this),this.fieldsDataService=u.u.getInstance(f.Or.Fields,this),this.alertService=u.u.getInstance(f.K9.Alerts,this),this.personDataService=u.u.getInstance(f.Or.Person,this),this.companyDataService=u.u.getInstance(f.Or.Company,this)}},{key:"initDataListeners",value:function(){this.listenTo(c.G.SHELL,r.Q.EventNames.NAV_UNLOCKED_BY_USER,this.onNavigateAway),this.listenTo(f.Vk.VIDEO,"videos:".concat(this.options.videoId,":sync"),this.render),this.listenTo(f.Vk.VIDEO,"videos:".concat(this.options.videoId,":error"),this.onError),this.listenTo(f.Vk.RATINGS,"".concat(f.M_.RATINGS,":sync"),this.render),this.listenTo(f.Vk.VIDEO,"".concat(f.M_.UPDATE_VIDEO_THUMBNAIL,":").concat(this.options.videoId,":sync"),this.onThumbnailUpdated),this.listenTo(this.channelName,"select:rating",o.partial(this.onTypeaheadSelection,o,"rating")),this.listenTo(this.channelName,"select:channel",o.partial(this.onTypeaheadSelection,o,"channel")),this.listenTo(this.channelName,"select:series",this.onSelectSeries),this.listenTo(this.channelName,"add:season",this.onSelectSeason),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,"add:producers",this.onSelectProducer),this.listenTo(this.channelName,"add:tag",this.onAddTag),this.listenTo(this.channelName,"remove:distributors",this.onRemoveDistributor),this.listenTo(this.channelName,"remove:productionCompanies",this.onRemoveProductionCompany),this.listenTo(this.channelName,"remove:directors",this.onRemoveDirector),this.listenTo(this.channelName,"remove:producers",this.onRemoveProducer),this.listenTo(this.channelName,"remove:tag",this.onRemoveTag),this.listenTo(this.channelName,O.LibraryEditorActions.Save,this.onSave),this.listenTo(this.channelName,O.LibraryEditorActions.Undo,this.onUndo),this.listenTo(this.channelName,O.LibraryEditorActions.DetectInput,this.onTypeaheadInput),this.listenTo(this.channelName,"image:load",this.onBeforeThumbnailUpload)}},{key:"onError",value:function(e){switch(e.type){case d.h.NotFound:r.Q.ErrorHelper.throw(new He.l);break;case d.h.Forbidden:r.Q.ErrorHelper.throw(new Je.a)}}},{key:"onTypeaheadSelection",value:function(e,t,n){if(n){var i=this.viewModel.get(t),r=i.filter({name:e.name});o.each(r,(function(e){return i.remove(e)})),i.add(e)}else this.viewModel.set(t,e);this.onModelChange(e,{manualUpdate:!0})}},{key:"onTypeaheadInput",value:function(e,t,n){e.get("name")||(n&&n.isCollection?this.viewModel.get(t).remove(e.get("id"),{silent:!0}):this.viewModel.get(t).clear({silent:!0}),this.onModelChange(null,{manualUpdate:!0}),"series"===t&&(this.validateSeries(),i.Radio.channel(this.channelName).trigger("clear:series")))}},{key:"onSelectSeries",value:function(e){var t=this;e.id?this.seriesDataService.getSeries(e.id,(function(e){t.viewModel.unset("season"),t.viewModel.set("episodeNumber",null),t.onTypeaheadSelection(e.toJSON(),"series")})):e.name&&this.seriesDataService.createSeries(e.name,(function(e){t.viewModel.unset("season"),t.viewModel.set("episodeNumber",null),t.onTypeaheadSelection({id:e.id},"series")}))}},{key:"onSelectSeason",value:function(e){var t=this;if(o.isNull(e))return this.viewModel.get("season").clear({silent:!0}),this.viewModel.set("episodeNumber",null),v.yV.deselectAll(this.viewModel.get("series.seasons")),void this.onModelChange(null,{manualUpdate:!0});if(e.id)return this.viewModel.set("season",e),v.yV.setSelected(e.id,this.viewModel.get("series.seasons")),void this.onModelChange(e,{manualUpdate:!0});if(e.number){var n=this.viewModel.get("series.id");this.seriesDataService.createSeason(e,n,(function(e){t.viewModel.set("season",e.toJSON()),!t.viewModel.get("series.seasons")&&t.viewModel.get("series").set("seasons",new h.i),t.viewModel.get("series.seasons").add(e.toJSON()),v.yV.setSelected(e.id,t.viewModel.get("series.seasons")),t.onModelChange(e.toJSON(),{manualUpdate:!0}),t.render()}))}}},{key:"onSelectDistributor",value:function(e){var t=this;e.id?this.onTypeaheadSelection(e,"distributors",!0):e.name&&this.companyDataService.createCompany(e.name,(function(e){t.onTypeaheadSelection(e.toJSON(),"distributors",!0)}))}},{key:"onSelectProductionCompany",value:function(e){var t=this;e.id?this.onTypeaheadSelection(e,"productionCompanies",!0):e.name&&this.companyDataService.createCompany(e.name,(function(e){t.onTypeaheadSelection(e.toJSON(),"productionCompanies",!0)}))}},{key:"onSelectDirector",value:function(e){var t=this;e.id?this.onTypeaheadSelection(e,"directors",!0):e.name&&this.personDataService.createPerson(e.name,(function(e){t.onTypeaheadSelection(e.toJSON(),"directors",!0)}))}},{key:"onSelectProducer",value:function(e){var t=this;e.id?this.onTypeaheadSelection(e,"producers",!0):e.name&&this.personDataService.createPerson(e.name,(function(e){t.onTypeaheadSelection(e.toJSON(),"producers",!0)}))}},{key:"onRemoveDistributor",value:function(e){this.removeFromCollection(e,"distributors")}},{key:"onRemoveProductionCompany",value:function(e){this.removeFromCollection(e,"productionCompanies")}},{key:"onRemoveDirector",value:function(e){this.removeFromCollection(e,"directors")}},{key:"onRemoveProducer",value:function(e){this.removeFromCollection(e,"producers")}},{key:"removeFromCollection",value:function(e,t){e&&e.id&&t&&(this.viewModel.get(t).remove(e.id),this.onModelChange(null,{manualUpdate:!0}))}},{key:"onAddTag",value:function(e){var t=this;if(e&&e.name){var n=e.name.trim().toLowerCase();if(n&&!v.yV.findModelByName(n,this.viewModel.tags)){var o=new m.V({name:n});this.viewModel.tags.add(o),this.tagDataService.createTag(n,this.model.get("id"),(function(e){o.set(e.toJSON()),i.Radio.channel(t.channelName).trigger("update:tags")}))}}}},{key:"onRemoveTag",value:function(e){var t=this;e instanceof m.V&&e.id&&this.tagDataService.dissociateTag(e.id,this.model.get("id"),(function(){t.viewModel.tags.remove(e),i.Radio.channel(t.channelName).trigger("update:tags"),t.logDissocAction(t.model.get("id"),e,w.EntityType.Tag)}))}},{key:"saveFields",value:function(e,t){var n=this,i=0;e.updatedVideo=o.extend({},e.updatedVideo||{});var r=function(){++i===e.dataChanges.fields.length&&t(e)};o.each(e.dataChanges.fields,(function(e){if(e.id&&!e.value)return n.viewModel.fields.remove(n.viewModel.fields.findWhere({id:e.id})),void n.fieldsDataService.deleteField(e.id,r);!e.id||e.id>0?n.fieldsDataService.updateField(e,r):n.fieldsDataService.addField(n.options.videoId,e,(function(t){n.viewModel.fields.findWhere({id:e.id}).set("id",t.id),r()}))}))}},{key:"bulkDissoc",value:function(e,t){this.videoDataService.bulkDissoc(this.model.id,e.pendingDissocs,(function(){t(e)}))}},{key:"saveVideo",value:function(e,t){var n=this,i=o.omit(e.dataChanges,"fields");if(o.isEmpty(i))t(e);else{var r=o.omit(e.dataChanges,"fields");this.videoDataService.updateVideo(this.model.get("id"),this.folder.get("id"),r,(function(i){(e.dataChanges.series&&e.dataChanges.series.id||e.dataChanges.episodeNumber||e.dataChanges.season)&&n.videoDataService.clearVideoCache(),e.updatedVideo=o.extend({},e.updatedVideo||{},i),t(e)}))}}},{key:"afterSave",value:function(e){if(this.viewModel){e.updatedVideo&&this.updateState(e.updatedVideo),this.unlockNav(),this.updateSaveButton(O.LibraryEditorActions.DisableSave),this.logEditAction(e.dataChanges,w.WorkflowPhase.Save);var t=b.J.updatedVideoAlert(this.viewModel.get("name"));this.alertService.success(t||"Video was successfully updated")()}}},{key:"onSave",value:function(){if(this.viewModel.validate(),!1===this.viewModel.isValid())return this.updateSaveButton(O.LibraryEditorActions.CancelSave),!1;this.validateSeries();var e=E.xC.getChanges(this.model,this.viewModel),t=E.xC.getRemovedObjectIds(this.model,this.viewModel);if(!e&&!o.keys(t).length)return this.updateSaveButton(O.LibraryEditorActions.CancelSave),!1;var n=new r.Q.Middleware;return e&&e.fields&&n.useAsync(o.bind(this.saveFields,this)),t&&o.keys(t).length&&n.useAsync(o.bind(this.bulkDissoc,this)),this.editable&&n.useAsync(o.bind(this.saveVideo,this)),n.useAsync(o.bind(this.afterSave,this)),n.goAsync({dataChanges:e,pendingDissocs:t},null),!1}},{key:"onUndo",value:function(){var e=this;new v.Mr({title:l.T.getPhrase(this.lang,"undoTitle"),text:l.T.getPhrase(this.lang,"undoBody",{videoName:this.model.get("name")}),buttons:[{text:l.T.getPhrase(this.lang,"undo"),className:"btn btn-danger",success:!0},{text:l.T.getPhrase(this.lang,"cancel"),className:"btn btn-link",close:!0}]}).render().done((function(){e.logEditAction({},w.WorkflowPhase.Discard),e.revertState({undo:!0}),e.render()}))}},{key:"updateState",value:function(e){this.stopListening(this.viewModel),E.xC.updateModelState(this.model,this.viewModel,e),s.r.clear(this.viewModelName),this.getViewModel(),this.renderContent(),this.renderTabs()}},{key:"onNavigateAway",value:function(){this.revertState()}},{key:"revertState",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).undo;this.stopListening(this.viewModel),s.r.clear(this.viewModelName),delete this.viewModel,this.unlockNav(),e&&this.getViewModel()}},{key:"lockNav",value:function(){this.navLock.lock({title:l.T.getPhrase(this.lang,"navLockHeading"),text:l.T.getPhrase(this.lang,"navLockBody")})}},{key:"unlockNav",value:function(){this.navLock.unlock()}},{key:"onBeforeThumbnailUpload",value:function(){this.navLock.isLocked()&&(this.navLock.unlock(),s.r.get("upload:thumbnail:options").set("lockNav",!0))}},{key:"onModelChange",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t.stickitChange||t.manualUpdate)if(this.viewModel.validate(),!1!==this.viewModel.isValid()){if(!E.xC.getChanges(this.model,this.viewModel)&&!o.keys(E.xC.getRemovedObjectIds(this.model,this.viewModel)).length)return this.unlockNav(),void this.updateSaveButton(O.LibraryEditorActions.DisableSave);this.lockNav(),this.updateSaveButton(O.LibraryEditorActions.EnableSave)}else this.updateSaveButton(O.LibraryEditorActions.DisableSave)}},{key:"updateSaveButton",value:function(e){var t=i.Radio.channel(this.channelName),n=O.LibraryEditorActions.EnableSave,o=O.LibraryEditorActions.DisableSave,s=O.LibraryEditorActions.CancelSave;switch(e){case n:return void t.trigger(n);case o:return void t.trigger(o);case s:return void t.trigger(s)}r.Q.ErrorHelper.throw(new a.H("Save action type is not valid."))}},{key:"onThumbnailUpdated",value:function(){var e=this;this.videoDataService.clearCacheAndGetVideo(this.options.videoId,(function(t){e.model=t,e.viewModel.set("thumbnail",e.model.thumbnail.toJSON())}))}},{key:"logEditAction",value:function(e,t){var n=Object.assign({id:this.model.get("id")},e);k.k.logUserAction(n,{actionType:w.UserAction.Edit,entity:w.EntityType.Video,location:w.LocationContext.EditVideoDetails,workflowPhase:t})}},{key:"logDissocAction",value:function(e,t,n){var o=Object.assign({videoId:e},t.pick("id","name"));k.k.logUserAction(o,{actionType:w.UserAction.Dissociate,entity:n,location:w.LocationContext.EditVideoDetails})}},{key:"onValidation",value:function(e){this.viewModel.set("disabled",!e)}},{key:"getViewModel",value:function(){this.model.fields&&this.model.fields.length||this.model.set("fields",(0,E.aj)()),this.viewModel=s.r.get(this.viewModelName,this.model.toJSON(),{ctor:y.n}),this.editable&&(this.viewModel.addValidation(E.rr),this.viewModel.addValidation(E.tD));var e=this.currentUser.get("instanceRegion")!==S.b.US;e&&this.viewModel.addValidation(E.oJ),this.listenTo(this.viewModel,"validated",this.onValidation),this.listenTo(this.viewModel,"change",this.onModelChange),this.listenTo(this.viewModel,"change:dateBroadcast",o.partial(this.onModelChange,o,{manualUpdate:!0})),this.viewModel.fields&&e&&(this.viewModel.fields&&this.viewModel.fields.each((function(e){return e.addValidation(E.Zg)})),this.listenTo(this.viewModel.fields,"change",this.onModelChange))}},{key:"validateSeries",value:function(){this.viewModel.get("series.id")||(this.viewModel.unset("season"),this.viewModel.set("episodeNumber",null))}},{key:"fetchData",value:function(){this.model=this.videoDataService.getVideo(this.options.videoId),this.ratings=this.ratingsDataService.getAllRatings(),this.model&&(this.editable=v.BK.canEditVideo(this.model),this.folder=this.model.categories.first(),this.ratings&&(this.viewModel instanceof y.n||this.getViewModel()))}},{key:"requiredResources",get:function(){return{currentUser:p.K.currentUser,libraries:Ke.T.libraries}}},{key:"onBeforeRender",value:function(){return this.fetchData(),!!this.model&&!!this.ratings&&!!this.viewModel}},{key:"renderContent",value:function(){var e=E.xC.getChanges(this.model,this.viewModel)||o.keys(E.xC.getRemovedObjectIds(this.model,this.viewModel)).length;this.showChildView("content",new Qe({model:this.viewModel,ratings:this.ratings,channelName:this.channelName,isSaveDisabled:!e,hasChanges:!!e,editable:this.editable,currentUser:this.currentUser}))}},{key:"renderTabs",value:function(){this.showChildView("tabs",new ze.W({model:this.viewModel,tabs:v.Si.getEditVideoTabs(this.options.videoId,this.editable),activeTab:".edit-video-applink",context:"edit",folder:this.folder,libraries:this.libraries}))}},{key:"onRender",value:function(){this.renderTabs(),this.renderContent()}}],n&&Ye(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),j}(r.Q.View)},86272:function(e,t,n){var o=n(32227);e.exports=(o.default||o).template({1:function(e,t,n,o,i){return e.propertyIsEnumerable,"<h5>"+e.escapeExpression((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"label",{name:"lang",hash:{},data:i}))+"</h5>\n"},3:function(e,t,n,o,i){return"my-2"},5:function(e,t,n,o,i){e.propertyIsEnumerable;var r,a=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,l=e.escapeExpression;return' <div class="text-muted mt-3 mb-1"><em>'+l((n.lang||t&&t.lang||s).call(a,"recommendedSize",{name:"lang",hash:{height:null!=(r=null!=(r=null!=t?t.options:t)?r.dimensions:r)?r.height:r,width:null!=(r=null!=(r=null!=t?t.options:t)?r.dimensions:r)?r.width:r},data:i}))+'</em></div>\n <button class="upload-thumbnail btn btn-outline-dark mb-3 w-100">'+l((n.lang||t&&t.lang||s).call(a,"upload",{name:"lang",hash:{},data:i}))+"</button>\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,i){e.propertyIsEnumerable;var r,a=null!=t?t:e.nullContext||{};return(null!=(r=n.if.call(a,null!=(r=null!=t?t.options:t)?r.editable:r,{name:"if",hash:{},fn:e.program(1,i,0),inverse:e.noop,data:i}))?r:"")+'<div class="thumbnail-region"></div>\n<div class="'+(null!=(r=n.unless.call(a,null!=(r=null!=t?t.options:t)?r.editable:r,{name:"unless",hash:{},fn:e.program(3,i,0),inverse:e.noop,data:i}))?r:"")+'">\n'+(null!=(r=n.if.call(a,null!=(r=null!=t?t.options:t)?r.editable:r,{name:"if",hash:{},fn:e.program(5,i,0),inverse:e.noop,data:i}))?r:"")+"</div>"},useData:!0})},43791:function(e,t,n){var o=n(32227);e.exports=(o.default||o).template({compiler:[8,">= 4.3.0"],main:function(e,t,n,o,i){var r;return e.propertyIsEnumerable,'<h1 class="h3">\n '+e.escapeExpression("function"==typeof(r=null!=(r=n.name||(null!=t?t.name:t))?r:e.hooks.helperMissing)?r.call(null!=t?t:e.nullContext||{},{name:"name",hash:{},data:i}):r)+'\n</h2>\n<div class="breadcrumbs-region"></div>\n<div class="tabs-region pl-2"></div>'},useData:!0})},23468:function(e,t,n){var o=n(32227);e.exports=(o.default||o).template({1:function(e,t,n,o,i){return"mb-4"},3:function(e,t,n,o,i){var r;return e.propertyIsEnumerable,' <p class="mb-2 py-1 px-2 alert alert-info '+e.escapeExpression(e.lambda(null!=(r=null!=(r=null!=t?t.options:t)?r.styles:r)?r.suggestEdit:r,t))+'">\n'+(null!=(r=n.if.call(null!=t?t:e.nullContext||{},null!=(r=null!=t?t.options:t)?r.isExchange:r,{name:"if",hash:{},fn:e.program(4,i,0),inverse:e.program(6,i,0),data:i}))?r:"")+" </p>\n"},4:function(e,t,n,o,i){var r;return e.propertyIsEnumerable," "+(null!=(r=(n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"suggestEditExchange",{name:"lang",hash:{classNames:null!=(r=null!=t?t.options:t)?r.suggestEditClasses:r},data:i}))?r:"")+"\n"},6:function(e,t,n,o,i){var r;return e.propertyIsEnumerable," "+(null!=(r=(n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"suggestEdit",{name:"lang",hash:{classNames:null!=(r=null!=t?t.options:t)?r.suggestEditClasses:r},data:i}))?r:"")+"\n"},8:function(e,t,n,o,i){return"none"},10:function(e,t,n,o,i){return"block"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,i){e.propertyIsEnumerable;var r,a=null!=t?t:e.nullContext||{};return'<div class="row">\n <div class="left-pane col-4">\n <div class="thumbnail-region"></div>\n <div class="cv-tags-region '+(null!=(r=n.unless.call(a,null!=(r=null!=t?t.options:t)?r.editable:r,{name:"unless",hash:{},fn:e.program(1,i,0),inverse:e.noop,data:i}))?r:"")+'"></div>\n <div class="customer-tags-region"></div>\n </div>\n <div class="right-pane col-8">\n'+(null!=(r=n.unless.call(a,null!=(r=null!=t?t.options:t)?r.editable:r,{name:"unless",hash:{},fn:e.program(3,i,0),inverse:e.noop,data:i}))?r:"")+' <div class="top-save-region"></div>\n <div class="basic-info-region mb-4"></div> \n <div class="collapse-button-region"></div>\n <div class="collapse-area" style="display: '+(null!=(r=n.if.call(a,null!=(r=null!=t?t.options:t)?r.collapse:r,{name:"if",hash:{},fn:e.program(8,i,0),inverse:e.program(10,i,0),data:i}))?r:"")+';">\n <div class="additional-details-region"></div> \n <div class="production-info-region mb-4"></div> \n <div class="fields-region mb-4"></div>\n </div>\n <div class="bottom-save-region"></div>\n </div>\n</div>'},useData:!0})},58259:function(e,t,n){var o=n(32227);e.exports=(o.default||o).template({compiler:[8,">= 4.3.0"],main:function(e,t,n,o,i){var r;return e.propertyIsEnumerable,e.escapeExpression((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},null!=(r=null!=t?t.options:t)?r.showMorePhrase:r,{name:"lang",hash:{},data:i}))},useData:!0})},99724:function(e,t,n){var o=n(32227);e.exports=(o.default||o).template({1:function(e,t,n,o,i){e.propertyIsEnumerable;var r,a=e.escapeExpression;return'<span class="text-muted mx-2 undo '+a(e.lambda(null!=(r=null!=(r=null!=t?t.options:t)?r.styles:r)?r.undo:r,t))+'">'+a((n.lang||t&&t.lang||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"undo",{name:"lang",hash:{},data:i}))+"</span>\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,i){var r;return e.propertyIsEnumerable,(null!=(r=n.if.call(null!=t?t:e.nullContext||{},null!=(r=null!=t?t.options:t)?r.allowUndo:r,{name:"if",hash:{},fn:e.program(1,i,0),inverse:e.noop,data:i}))?r:"")+'<div class="save-region"></div>'},useData:!0})},15564:function(e,t,n){var o=n(32227);e.exports=(o.default||o).template({1:function(e,t,n,o,i){return'<span class="close cursor-pointer" aria-hidden="true">×</span>\n'},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,i){e.propertyIsEnumerable;var r,a,s=null!=t?t:e.nullContext||{},l=e.hooks.helperMissing,c="function",u=e.escapeExpression;return'<span class="clamp-1" title="'+u(typeof(a=null!=(a=n.name||(null!=t?t.name:t))?a:l)===c?a.call(s,{name:"name",hash:{},data:i}):a)+'">'+u(typeof(a=null!=(a=n.name||(null!=t?t.name:t))?a:l)===c?a.call(s,{name:"name",hash:{},data:i}):a)+"</span>\n"+(null!=(r=n.if.call(s,null!=(r=null!=t?t.options:t)?r.removable:r,{name:"if",hash:{},fn:e.program(1,i,0),inverse:e.noop,data:i}))?r:"")},useData:!0})},30992:function(e,t,n){var o=n(32227);e.exports=(o.default||o).template({1:function(e,t,n,o,i){var r;return e.propertyIsEnumerable,"<h5>"+e.escapeExpression(e.lambda(null!=(r=null!=t?t.options:t)?r.headerText:r,t))+"</h5>\n"},3:function(e,t,n,o,i){var r;return e.propertyIsEnumerable,"<p>"+e.escapeExpression(e.lambda(null!=(r=null!=t?t.options:t)?r.emptyStateText:r,t))+"</p>\n"},5:function(e,t,n,o,i){return'<div class="tag-selector-region"></div>\n'},compiler:[8,">= 4.3.0"],main:function(e,t,n,o,i){e.propertyIsEnumerable;var r,a=null!=t?t:e.nullContext||{};return(null!=(r=n.if.call(a,null!=(r=null!=t?t.options:t)?r.headerText:r,{name:"if",hash:{},fn:e.program(1,i,0),inverse:e.noop,data:i}))?r:"")+(null!=(r=n.if.call(a,null!=(r=null!=t?t.options:t)?r.emptyStateText:r,{name:"if",hash:{},fn:e.program(3,i,0),inverse:e.noop,data:i}))?r:"")+(null!=(r=n.if.call(a,null!=(r=null!=t?t.options:t)?r.editable:r,{name:"if",hash:{},fn:e.program(5,i,0),inverse:e.noop,data:i}))?r:"")+'<div class="tag-list-region"></div>'},useData:!0})},55230:function(e,t,n){var o=n(32227);e.exports=(o.default||o).template({compiler:[8,">= 4.3.0"],main:function(e,t,n,o,i){return'<div class="tab-region"></div>\n<div class="edit-content-region"></div>\n<div class="dialog-region"></div>'},useData:!0})},44106:function(e,t,n){var o=n(32227);e.exports=(o.default||o).template({compiler:[8,">= 4.3.0"],main:function(e,t,n,o,i){return'<h5 class="mb-0">Extra Information</h5>\n<div class="text-muted mb-3">This information is only visible to administrators and will not be searchable</div>\n<div class="fields-region"></div>'},useData:!0})},72891:function(e,t,n){var o=n(32227);e.exports=(o.default||o).template({compiler:[8,">= 4.3.0"],main:function(e,t,n,o,i){var r;return e.propertyIsEnumerable,'<div class="form-group">\n <label for="edit-description">'+e.escapeExpression("function"==typeof(r=null!=(r=n.name||(null!=t?t.name:t))?r:e.hooks.helperMissing)?r.call(null!=t?t:e.nullContext||{},{name:"name",hash:{},data:i}):r)+'</label>\n <div class="text-area-region"></div>\n <div class="form-feedback"></div>\n</div>'},useData:!0})}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_clickview_library_editor=self.webpackChunk_clickview_library_editor||[]).push([[8622],{31709:function(e,t,a){a.d(t,{K:function(){return u}});var n=a(1024),r=a(99910),l=a(53808),i=a(52076),c=a(17439),o=a(63946),s=a(54753);function u(e){var t,a,u=e.showSpinner?n.createElement(r.Spinner,{as:"span",animation:"border",role:"status",size:"sm"}):e.children;if(e.tooltip&&e.svgName){var d=null!==(t=e.className)&&void 0!==t?t:"";return e.disabled&&!e.appLink&&(d+=" pointer-events-none"),n.createElement(o.u,{title:e.tooltip,spanHack:!0},n.createElement(c.h,{appLink:e.appLink,href:e.href,svgName:e.svgName,svgSize:e.svgSize,onClick:e.onClick,className:d,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions,openInNewTab:e.openInNewTab,disabled:e.disabled},u))}if(e.svgName)return n.createElement(c.h,{onClick:e.onClick,appLink:e.appLink,href:e.href,svgName:e.svgName,svgSize:e.svgSize,className:e.className,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions,openInNewTab:e.openInNewTab,disabled:e.disabled},u);if(e.tooltip&&e.appLink)return n.createElement(o.u,{title:e.tooltip,spanHack:!0},n.createElement(s.F,{onClick:e.onClick,appLink:e.appLink,className:e.className,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions,openInNewTab:e.openInNewTab,disabled:e.disabled},u));if(e.appLink)return n.createElement(s.F,{onClick:e.onClick,appLink:e.appLink,className:e.className,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions,openInNewTab:e.openInNewTab,disabled:e.disabled},u);function m(t){e.analyticsData&&e.analyticsOptions&&i.k.logUserAction(e.analyticsData,e.analyticsOptions),l.q.isFunction(e.onClick)&&e.onClick(t)}return e.tooltip?n.createElement(o.u,{title:e.tooltip,spanHack:!0},n.createElement("button",{onClick:m,className:"".concat(null!==(a=e.className)&&void 0!==a?a:"").concat(e.disabled?" pointer-events-none":""),disabled:e.disabled},u)):n.createElement("button",{onClick:m,className:e.className,disabled:e.disabled},u)}},86347:function(e,t,a){a.d(t,{b:function(){return u},n:function(){return s}});var n=a(1024),r=a(92802),l=a(53808),i=a(85887);function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=new Array(t);a<t;a++)n[a]=e[a];return n}var o=function(e,t){var a={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(a[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(a[n[r]]=e[n[r]])}return a};function s(e){var t=e.castInitialValues,a=e.castValuesOnSubmit,s=e.initialValues,u=e.onSubmit,d=o(e,["castInitialValues","castValuesOnSubmit","initialValues","onSubmit"]),m=t&&e.validationSchema?e.validationSchema.cast(function(e){if(!e)return{};var t=i.t.deepClone(e);return function e(a){Object.keys(t).forEach((function(n){t.hasOwnProperty(n)&&(i.t.isObject(a[n])?e(a[n]):null===t[n]&&delete t[n])}))}(t),t}(s)):s,p={allowInitialSubmit:e.allowInitialSubmit};return n.createElement(r.J9,Object.assign({enableReinitialize:!0},d,{initialValues:m,onSubmit:function(t,n){var r=n.setSubmitting,l=n.resetForm,i=n.setFieldError,o=a&&e.validationSchema?e.validationSchema.cast(t):t;u(o,(function(){var e,t,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(a.reset&&l(),a.errors)for(var n=0,o=Object.entries(a.errors);n<o.length;n++){var s=(e=o[n],t=2,function(e){if(Array.isArray(e))return e}(e)||function(e,t){var a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var n,r,l,i,c=[],o=!0,s=!1;try{if(l=(a=a.call(e)).next,0===t){if(Object(a)!==a)return;o=!1}else for(;!(o=(n=l.call(a)).done)&&(c.push(n.value),c.length!==t);o=!0);}catch(e){s=!0,r=e}finally{try{if(!o&&null!=a.return&&(i=a.return(),Object(i)!==i))return}finally{if(s)throw r}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?c(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),u=s[0],d=s[1];i(u,d)}r(!1)}))},initialStatus:p}),l.q.isFunction(e.children)?function(t){return e.children(t)}:n.Children.count(e.children)?e.children:null)}function u(){return(0,r.u6)()}s.defaultProps={castInitialValues:!0,castValuesOnSubmit:!0}},7378:function(e,t,a){a.r(t),a.d(t,{PendingRequestsView:function(){return ze}});var n=a(1024),r=a.n(n),l=a(86120),i=a(23689),c=a(57857),o=a(30317),s=a(25796),u=a(66703),d=a(90335),m=a(86242),p=a(2491),b=a(22430),f=a(50997),y=a(48404),v=a(19226),g=a(68893),E=a(17950),h=a(9416),N=a(35064),w=a(95061),k=a(86347),S=a(98495),R=a(92802),O=a(5173),L=a(31647),I=a(63151);function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=new Array(t);a<t;a++)n[a]=e[a];return n}var q={find:function(e,t){if(e&&e.children&&e.children.length)for(var a=function e(a){if(I.m.isEqual(a.id,t))return a;var n=a.children;if(n&&n.length)for(var r=0;r<n.length;r++){var l=e(n[r]);if(l)return l}},n=0;n<e.children.length;n++){var r=a(e.children[n]);if(r)return r}},getPath:function(e,t){for(var a=[t],n=function(e){return e.hasOwnProperty("parentIds")&&Array.isArray(e.parentIds)&&e.parentIds.length?e.parentIds[0]:e.hasOwnProperty("parentId")?e.parentId:null},r=n(t);r;){var l=q.find(e,r);l&&(a=[l].concat(function(e){if(Array.isArray(e))return C(e)}(i=a)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(i)||function(e,t){if(e){if("string"==typeof e)return C(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?C(e,t):void 0}}(i)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())),r=l?n(l):null}var i;return a},convertNestedObjectToTree:function(e){var t,a=Object.assign(Object.assign({},e.data),{children:e.children});return(null===(t=a.children)||void 0===t?void 0:t.length)&&(a.children=a.children.map(q.convertNestedObjectToTree)),a}},T=a(39396),A=a(63791),x=function(e){switch(e){case"up":return"JAT0R";case"down":return"ld41u";case"right":return"HHkPe";case"left":return"jZTRR"}};function j(e){return r().createElement(T.x,{svgName:A.vn.Caret,className:"".concat(x(e.direction)," svg-container d-inline-block ").concat(e.className)})}j.defaultProps={direction:"right"};var D=a(58424),F=a(53808),P=a(17439),V=a(63946),U=a(97874),_=a(52076),B=a(54753),H={dropdownToggle:"UCAnJ"};function M(e){var t="dropdown-item";return e&&(t+=" ".concat(e)),t}function Q(e){var t=F.q.isFunction(e.action.label)?e.action.label:function(){return n.createElement(n.Fragment,null,e.action.label)};if(e.action.appLink)return n.createElement(B.F,{appLink:e.action.appLink,onClick:e.action.onClick,className:M(e.action.className),analyticsData:e.action.analyticsData,analyticsOptions:e.action.analyticsOptions,openInNewTab:e.action.openInNewTab,disabled:e.action.disabled},t());function a(t){t.preventDefault(),e.action.analyticsData&&e.action.analyticsOptions&&_.k.logUserAction(e.action.analyticsData,e.action.analyticsOptions),F.q.isFunction(e.action.onClick)&&e.action.onClick(),e.action.href&&L.Q.LocationUtils.PageLoad(e.action.href,e.action.openInNewTab)}return e.action.href?n.createElement("a",{className:M(e.action.className),onClick:a,href:e.action.href},t()):n.createElement("span",{className:"cursor-pointer ".concat(M(e.action.className)),onClick:a,role:"button",tabIndex:0,onKeyDown:function(e){return"Enter"===e.key&&a(e)}},t())}function G(e){if(!e.actions||!e.actions.length)return n.createElement(n.Fragment,null);var t="dropdown";e.className&&(t+=" ".concat(e.className));var a="actions-dropdown-".concat(U.Y.getRandomInt()),r="dropdown-toggle px-0 ".concat(H.dropdownToggle);return e.dropdownToggleClassName&&(r+=" ".concat(e.dropdownToggleClassName)),n.createElement("div",{className:t},n.createElement("button",{className:r,type:"button",id:a,"data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"},n.createElement(T.x,{svgName:A.vn.More,size:T.S.Small})),n.createElement("div",{className:"dropdown-menu dropdown-menu-right","aria-labelledby":a},e.actions.map((function(e,t){return e.tooltip?n.createElement(V.u,{key:t,title:e.tooltip,spanHack:!0},n.createElement(Q,{action:e})):n.createElement(Q,{key:t,action:e})}))))}G.defaultProps={dropdownToggleClassName:"btn btn-light"};var Y=a(31709);function z(e){var t=n.useMemo((function(){return e.actions.sort((function(e,t){return e.order-t.order}))}),[e.actions]),a=[],r=[];t.forEach((function(e){e.button?a.push(e):r.push(e)}));var l="d-flex";return e.className&&(l+=" ".concat(e.className)),a.length||r.length?n.createElement("div",{className:l},n.createElement(n.Fragment,null,n.createElement("span",{className:"d-flex align-items-center"},a.length?a.map((function(e,t){return n.createElement(n.Fragment,{key:t},function(){if(e.label){var t=F.q.isFunction(e.label)?e.label:function(){return n.createElement(n.Fragment,null,e.label)};return n.createElement(Y.K,{appLink:e.appLink,href:e.href,onClick:e.onClick,svgName:e.svgName,className:e.className,tooltip:e.tooltip,showSpinner:e.showSpinner,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions,openInNewTab:e.openInNewTab,disabled:e.disabled},t())}var a=n.createElement(P.h,{appLink:e.appLink,href:e.href,onClick:e.onClick,svgName:e.svgName,className:e.className,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions,openInNewTab:e.openInNewTab,disabled:e.disabled});return e.tooltip?n.createElement(V.u,{title:e.tooltip,spanHack:!0},a):a}())})):n.createElement(n.Fragment,null),e.sortComponent&&e.sortComponent,r.length?n.createElement(G,{actions:r,dropdownToggleClassName:e.actionsDropdownClassName}):n.createElement(n.Fragment,null)))):n.createElement(n.Fragment,null)}var K={tree:"ZYvBT",text:"eVGWe",chevron:"v76mu",disabled:"wIrTq",root:"JDRq_",selected:"wT87N",actions:"fKJU4",node:"gOBrH",noActions:"fKmrr"};function J(e){function t(){var t="".concat(K.text," clamp-4");return e.className&&(t+=" ".concat(e.className)),t}return e.isDisabled?r().createElement(V.u,{title:e.disabledTooltip,spanHack:!0,spanHackClassName:"d-inline-block"},r().createElement("span",{className:"".concat(t()," text-muted ").concat(K.disabled)},e.text)):r().createElement("div",{className:t()},e.text)}function X(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=new Array(t);a<t;a++)n[a]=e[a];return n}var W="tree-actions";function Z(e){var t,a,r,l=e.tree,i=e.selectedIds,c=e.getAppLink,o=e.onSelect,s=e.isDisabled,u=e.actions,d=e.isDropdown,m=n.useRef(null),p=n.useMemo((function(){return null==i?void 0:i.some((function(e){return q.find(l,e)}))}),[l,i]),b=(a=n.useState(p),r=2,function(e){if(Array.isArray(e))return e}(a)||function(e,t){var a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var n,r,l,i,c=[],o=!0,s=!1;try{if(l=(a=a.call(e)).next,0===t){if(Object(a)!==a)return;o=!1}else for(;!(o=(n=l.call(a)).done)&&(c.push(n.value),c.length!==t);o=!0);}catch(e){s=!0,r=e}finally{try{if(!o&&null!=a.return&&(i=a.return(),Object(i)!==i))return}finally{if(s)throw r}}return c}}(a,r)||function(e,t){if(e){if("string"==typeof e)return X(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?X(e,t):void 0}}(a,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),f=b[0],y=b[1],v=null==i?void 0:i.some((function(e){return I.m.isEqual(l.id,e)})),g=!!l.children&&!!l.children.length;function E(){var t;e.multiSelect||y(!f),c?L.Q.AppLinkHelper.trigger(c(l)):(null===(t=e.isDisabled)||void 0===t?void 0:t.call(e,l))?o(null):null==o||o(l)}return n.useEffect((function(){if(m.current&&d){var e=function(e){e.stopPropagation(),E()};return m.current.addEventListener("click",e),function(){m.current&&m.current.removeEventListener("click",e)}}}),[m.current,o]),n.useEffect((function(){var t;e.multiSelect||f&&(p||v||!(null===(t=e.selectedIds)||void 0===t?void 0:t.length)&&(null==s?void 0:s(e.tree))||y(!1))}),[i]),n.createElement("li",{className:"position-relative ".concat(f?"":K.collapsed," ").concat(e.isRoot?K.root:"")},n.createElement("div",{className:"position-relative"},n.createElement(D.L,{className:(t="py-1 d-flex align-items-center w-100 position-relative ".concat(K.node),v&&(t+=" "+e.selectedLinkClassName),(null==u?void 0:u.length)||(t+=" "+K.noActions),p&&e.multiSelect&&(t+=" text-underline font-italic"),t),onClick:d?null:E,ref:m},g&&n.createElement("div",{className:K.chevron,onClick:function(t){t.stopPropagation(),e.multiSelect?y(!f):E()}},n.createElement(j,{direction:f?"down":"right"})),n.createElement(J,{text:l.name||l.description,isDisabled:null==s?void 0:s(l),disabledTooltip:e.disabledTooltip})),!!e.actions&&n.createElement(z,{className:K.actions,actions:null==u?void 0:u.map((function(e){return Object.assign(Object.assign({},e),{appLink:e.getAppLink(l)})})),actionsDropdownClassName:"btn btn-light ".concat(W," py-0")}),f&&n.createElement(ee,Object.assign({key:l.id},e,{isChild:!0}))))}Z.defaultProps={selectedLinkClassName:K.selected};var $=function(e,t){var a={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(a[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(a[n[r]]=e[n[r]])}return a};function ee(e){var t=e.tree,a=$(e,["tree"]);return t&&t.children?n.createElement("ul",{className:"m-0 p-0 list-unstyled ".concat(K.tree)},t.children.map((function(t,r){return n.createElement(Z,Object.assign({key:r,tree:t},a,{isRoot:!e.isChild}))}))):n.createElement(n.Fragment,null)}var te={selectButton:"Jh8Ep",createNew:"hnfdj"},ae=a(48088),ne=a(54096);function re(e){var t=(0,ne.G)(f.Or.Library);function a(a){t.getLibraries((function(t){return e(t.toJSON(),a.toJSON())}))}r().useEffect((function(){return ae.Radio.channel(f.Vk.LIBRARY).on("folder:created",a),function(){ae.Radio.channel(f.Vk.LIBRARY).off("folder:created",a)}}),[e])}var le=a(21974),ie=a(264),ce="libraryRequests.destinationForm",oe=(0,O.Ry)().shape({library:(0,O.Ry)().required(),folder:(0,O.Ry)().required()});function se(e){var t,a,n,l,i,c,o,s=(0,k.b)();re((function(e,t){var a=e.find((function(e){return e.id.toString()===s.values.library.id.toString()}));if(a){s.setFieldValue("library",a,!0);var n=q.find(a,t.id);n&&s.setFieldValue("folder",n,!0)}}));var d=e.libraryRequest.sender&&"".concat(e.libraryRequest.sender.name," ").concat(e.libraryRequest.sender.surname),m="";return(null===(t=e.libraryRequest.senderCustomer)||void 0===t?void 0:t.id.toString())!==e.currentUser.get("customerId").toString()&&(m=null===(a=e.libraryRequest.senderCustomer)||void 0===a?void 0:a.name),r().createElement("div",{className:"bg-white rounded p-3 mb-3"},r().createElement(R.l0,null,r().createElement("div",{className:"row"},r().createElement("div",{className:"col-9"},!!d&&r().createElement("div",{className:"row mb-3"},r().createElement("div",{className:"col-3"},r().createElement("label",null,r().createElement(u.x,{namespace:ce,phrase:"requestedBy"}))),r().createElement("div",{className:"col-9"},r().createElement(r().Fragment,null,d,!!m&&r().createElement(r().Fragment,null," (",m,")")))),r().createElement("div",{className:"row mb-3"},r().createElement("div",{className:"col-3"},r().createElement("label",null,r().createElement(u.x,{namespace:ce,phrase:"videoSource"}))),r().createElement("div",{className:"col-9"},!!e.libraryRequest.sourceLibrary&&r().createElement("span",{className:"badge p-1 mr-1 text-white ".concat(le.u.mapSourceToClass(e.libraryRequest.sourceLibrary.type))},le.u.mapSourceToDisplayName(e.libraryRequest.sourceLibrary,ie.g.hasLite)),!!e.libraryRequest.sourceCategory&&r().createElement("span",{className:"ml-2"},e.libraryRequest.sourceCategory.name))),r().createElement("div",{className:"row mb-3"},r().createElement("div",{className:"col-3"},r().createElement("label",null,r().createElement(u.x,{namespace:ce,phrase:"addTo"}))),r().createElement("div",{className:"col-9"},e.libraries.length>1&&r().createElement("div",{className:"dropdown mb-2"},r().createElement("button",{className:"dropdown-toggle btn-block form-control text-left position-relative ".concat(te.selectButton),type:"button",id:"select-library","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"},r().createElement("div",{className:"text-truncate"},null!==(l=null===(n=s.values.library)||void 0===n?void 0:n.name)&&void 0!==l?l:r().createElement(u.x,{namespace:ce,phrase:"selectALibrary"}))),r().createElement("div",{className:"dropdown-menu w-100","aria-labelledby":"select-library"},e.libraries.map((function(e,t){var a,n,l=e.id.toString()===(null===(n=null===(a=s.values.library)||void 0===a?void 0:a.id)||void 0===n?void 0:n.toString());return r().createElement("div",{className:"dropdown-item cursor-pointer ".concat(l?"active":""),key:t,onClick:function(){s.setFieldValue("library",e,!0),s.setFieldValue("folder",null,!0)}},e.name)})))),r().createElement("div",{className:"dropdown mb-2"},r().createElement("button",{className:"dropdown-toggle btn-block form-control text-left position-relative ".concat(te.selectButton),type:"button",id:"select-folder","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false",disabled:!s.values.library},r().createElement("div",{className:"text-truncate"},null!==(c=s.values.library&&(null===(i=s.values.folder)||void 0===i?void 0:i.name))&&void 0!==c?c:r().createElement(u.x,{namespace:ce,phrase:"selectAFolder"}))),r().createElement("div",{className:"dropdown-menu w-100","aria-labelledby":"select-folder"},r().createElement(S.ZP,{autoHeight:!0,autoHeightMax:300,hideTracksWhenNotNeeded:!0},r().createElement(ee,{tree:s.values.library,onSelect:function(e){return s.setFieldValue("folder",e,!0)},selectedIds:(null===(o=s.values.folder)||void 0===o?void 0:o.id)?[s.values.folder.id]:void 0,selectedLinkClassName:"bg-light font-weight-500",isDropdown:!0}),s.values.library&&r().createElement(B.F,{className:"btn font-weight-bold rounded-0 w-100 text-left ".concat(te.createNew),appLink:{application:f.OV.LIBRARY_REQUESTS,action:f.eX.Shared.NEW_FOLDER,args:[s.values.library.id]}},r().createElement(u.x,{namespace:ce,phrase:"createNew"})))))))),r().createElement("div",{className:"col-3"},r().createElement("div",{className:"d-flex justify-content-end"},r().createElement("button",{type:"button",className:"btn btn-link",onClick:e.onReject},r().createElement(u.x,{namespace:ce,phrase:"reject"})),r().createElement("button",{type:"submit",className:"btn btn-dark",disabled:!s.isValid},r().createElement(u.x,{namespace:ce,phrase:"approve"})))))))}var ue=a(70065);function de(e){function t(t,a){var n,r,l,i,c,o,s={location:ue.LocationContext.LibraryRequestDetails,actionType:t,entity:ue.EntityType.LibraryRequest,workflowPhase:ue.WorkflowPhase.Start},u={id:e.libraryRequest.id,videoId:null===(n=e.libraryRequest.object)||void 0===n?void 0:n.id,requestingUserId:null===(r=e.libraryRequest.sender)||void 0===r?void 0:r.id,sourceLibraryId:null===(l=e.libraryRequest.sourceLibrary)||void 0===l?void 0:l.id,sourceFolderId:null===(i=e.libraryRequest.sourceCategory)||void 0===i?void 0:i.id,destinationLibraryId:null===(c=null==a?void 0:a.library)||void 0===c?void 0:c.id,destinationFolderId:null===(o=null==a?void 0:a.folder)||void 0===o?void 0:o.id};_.k.logUserAction(u,s)}return r().createElement(k.n,{initialValues:{library:e.libraries.find((function(t){var a;return t.id.toString()===(null===(a=e.libraryRequest.destinationLibrary)||void 0===a?void 0:a.id.toString())})),folder:e.libraryRequest.destinationCategory},validationSchema:oe,onSubmit:function(a){t(ue.UserAction.Approve,a),L.Q.AppLinkHelper.trigger({application:f.OV.LIBRARY_REQUESTS,action:f.eX.LibraryRequests.APPROVE,args:[e.libraryRequest.id],params:{libraryId:a.library.id,folderId:a.folder.id,queryParams:e.queryParams}})},validateOnMount:!0,enableReinitialize:!1},r().createElement(se,{libraries:e.libraries,libraryRequest:e.libraryRequest,onReject:function(){t(ue.UserAction.Reject),L.Q.AppLinkHelper.trigger({application:f.OV.LIBRARY_REQUESTS,action:f.eX.LibraryRequests.REJECT,args:[e.libraryRequest.id],params:e.queryParams})},currentUser:e.currentUser}))}var me,pe,be={HIGH:.75,MODERATE:.5},fe={circleContainer:"p8Vgz",backgroundCircle:"asGGE",circleSuccess:"PXLNj",circleWarning:"ZckRN",circleDanger:"slBRg",lgCircleContainer:"N8KCI",pendingCircle:"DKrcq",centredPercentageText:"tpmLR"},ye=2,ve=5.8,ge=.2,Ee=.36;function he(e){var t=e===me.Large?ve:ye,a=e===me.Large?Ee:ge;return"".concat(t/2-2*a,"rem")}function Ne(e){return e>=be.HIGH?"text-success":e>=be.MODERATE?"text-warning":"text-danger"}function we(e,t){var a="d-inline-block ".concat(fe.circleContainer);return e===me.Large&&(a+=" ".concat(fe.lgCircleContainer)),ke(t)&&(a+=" ".concat(fe.pendingCircle)),a}function ke(e){return"number"!=typeof e}function Se(e){var t,a=r().useCallback((function(t){if(t){var a=t.r.baseVal.value,n=2*Math.PI*a,r=n-e.percentage*n;t.style.strokeDasharray="".concat(n," ").concat(n),t.style.strokeDashoffset=r.toString()}}),[]);return r().createElement("svg",null,r().createElement("circle",{r:he(e.size),className:fe.backgroundCircle}),!ke(e.percentage)&&r().createElement("circle",{ref:a,r:he(e.size),className:(t=e.percentage,t>=be.HIGH?fe.circleSuccess:t>=be.MODERATE?fe.circleWarning:fe.circleDanger)}))}function Re(e){var t,a,n=function(e){if(!ke(e))return+e.toFixed(2)}(e.percentage),l=e.layout===pe.LabelInside?me.Large:me.Small,i=e.customLabel||(ke(a=n)?"--%":"".concat(Math.round(100*a),"%"));return e.layout===pe.LabelOnly?r().createElement("span",{className:Ne(n)},i):r().createElement("div",{className:"d-flex align-items-center justify-content-between ".concat(null!==(t=e.className)&&void 0!==t?t:"")},e.layout===pe.LabelBefore&&r().createElement("span",{className:"mr-2"},i),r().createElement("div",{className:we(l,n)},r().createElement(Se,{percentage:n,size:l}),e.layout===pe.LabelInside&&r().createElement("span",{className:fe.centredPercentageText},i)))}!function(e){e.Small="small",e.Large="large"}(me||(me={})),function(e){e.CircleOnly="circle_only",e.LabelOnly="label_only",e.LabelBefore="label_before",e.LabelInside="label_inside"}(pe||(pe={})),Re.defaultProps={layout:pe.CircleOnly};var Oe="libraryRequests.count";function Le(e){return r().createElement("div",{className:"bg-white rounded px-3 py-2 mb-3 d-flex align-items-center"},r().createElement(Re,null),r().createElement("div",{className:"pl-2"},r().createElement(u.x,{namespace:Oe,phrase:"count",options:{smartCount:e.count.count}})))}var Ie=a(97896),Ce=a(50072),qe=a(30328),Te=a(7044),Ae=a(49824);function xe(){return r().createElement("div",{className:"bg-white rounded p-3 mb-3"},r().createElement("div",{className:"row"},r().createElement("div",{className:"col-3"},r().createElement("div",{className:"partial-loading-background",style:{height:"1.25rem",width:"6rem"}})),r().createElement("div",{className:"col-6"},r().createElement("div",{className:"partial-loading-background",style:{height:"1.25rem",width:"9rem"}})),r().createElement("div",{className:"col-3 d-flex justify-content-end align-items-center"},r().createElement("div",{className:"partial-loading-background rounded",style:{height:"1.25rem",width:"3rem"}}),r().createElement("div",{className:"partial-loading-background rounded ml-2",style:{height:"2.5rem",width:"5rem"}})),r().createElement("div",{className:"col-3"},r().createElement("div",{className:"partial-loading-background",style:{height:"1.25rem",width:"7rem"}})),r().createElement("div",{className:"col-6 mb-2"},r().createElement("div",{className:"partial-loading-background rounded mb-1",style:{height:"2.5rem"}}),r().createElement("div",{className:"partial-loading-background rounded",style:{height:"2.5rem"}}))))}var je=a(85739),De=a(59198),Fe=a(64429),Pe=a(41026),Ve=a(41777),Ue=a(56154),_e="libraryRequests.pendingRequestsEmptyState",Be=c.T.encloseNamespace(_e);function He(){return r().createElement("div",{className:"bg-white rounded p-3 py-5"},r().createElement(Ve.u,null,r().createElement(Ve.u.Image,{src:Ue.W.EmptyStates.PENDING_REQUESTS}),r().createElement(Ve.u.Info,{className:"mb-1"},r().createElement(u.x,{namespace:_e,phrase:"info"})),r().createElement(Ve.u.Cta,{text:Be("cta"),className:"btn btn-link text-info",appLink:{application:f.OV.LIBRARY_REQUESTS,action:f.eX.LibraryRequests.LIBRARY_REQUEST_SETTINGS_LIBRARIES}})))}function Me(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var n,r,l,i,c=[],o=!0,s=!1;try{if(l=(a=a.call(e)).next,0===t){if(Object(a)!==a)return;o=!1}else for(;!(o=(n=l.call(a)).done)&&(c.push(n.value),c.length!==t);o=!0);}catch(e){s=!0,r=e}finally{try{if(!o&&null!=a.return&&(i=a.return(),Object(i)!==i))return}finally{if(s)throw r}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Qe(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?Qe(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Qe(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=new Array(t);a<t;a++)n[a]=e[a];return n}var Ge="libraryRequests.pendingRequests",Ye=c.T.encloseNamespace(Ge);function ze(e){var t,a,n=l.a.useGetFetch(),c=(0,p.Z)(),k=(0,je.p)(e.queryParams.sort||d.D.Newest,[Ce.l.Pending]),S=l.a.useBasicFetch(e.id&&s.y.libraryRequest(e.id)),R=(0,De.s)(e.id),O=l.a.useBasicFetch(s.y.pendingRequestsCount()),L=Me(r().useState(null),2),I=L[0],C=L[1];(0,i.i)(w.T.getLibrariesFetchOptions((function(e){return C(e.toJSON())})),[]),re(C);var q=Me(r().useState(null),2),T=q[0],A=q[1];(0,i.i)(y.p.getConfigFetchOptions(A),[]);var x=Me(r().useState(null),2),j=x[0],D=x[1];(0,i.i)(v.K.getCurrentUserFetchOptions(D),[]),(0,o.v)(S),(0,qe.A)({id:e.id,requests:k.items,appLink:{application:f.OV.LIBRARY_REQUESTS,action:f.eX.LibraryRequests.PENDING_REQUESTS,params:e.queryParams}}),(0,Fe.m)(S.data,"pending",e.queryParams),(0,Pe.K)(S.data);var F=((null===(t=k.items)||void 0===t?void 0:t.length)||k.hasCompleted)&&I&&T&&j,P=S.data&&R.hasCompleted;return r().createElement("div",null,r().createElement("h1",{className:"h2"},r().createElement(u.x,{namespace:Ge,phrase:"title"})),r().createElement("div",{className:"mb-3"},r().createElement(m.Oo,{breadcrumbs:[{name:Ye("libraryEditor"),appLink:{application:f.OV.LIBRARY_EDITOR,action:f.eX.LibraryEditor.HOME}},{name:Ye("title"),active:!0}]})),r().createElement(h.A,{active:"pending"}),!F||(null===(a=k.items)||void 0===a?void 0:a.length)?r().createElement(r().Fragment,null,r().createElement("div",{className:"d-flex justify-content-end mb-3"},r().createElement(E.F,{appLink:{application:f.OV.LIBRARY_REQUESTS,action:f.eX.LibraryRequests.PENDING_REQUESTS,args:[e.id]},queryParams:e.queryParams})),r().createElement("div",{className:"row"},r().createElement("div",{className:"col-4"},F?r().createElement(r().Fragment,null,r().createElement(Le,{count:O.data}),r().createElement(N.q,{libraryRequests:k.items,selectedId:e.id,appLink:{application:f.OV.LIBRARY_REQUESTS,action:f.eX.LibraryRequests.PENDING_REQUESTS},queryParams:e.queryParams,fetchNext:k.fetchNext,isFetching:k.isFetching,nextCursor:k.nextCursor})):r().createElement(Te.p,null)),r().createElement("div",{className:"col-8"},F&&P?r().createElement(r().Fragment,null,r().createElement(de,{key:S.data.id,libraryRequest:S.data,libraries:I,queryParams:e.queryParams,currentUser:j}),r().createElement(Ie.x,{libraryRequest:S.data,config:T,currentUser:j,createViewKey:function(t,a){var r=s.y.createViewKey(e.id,(function(e){return a(new g.y(e))}),(function(e){return c.error(b.M.libraryApiError(e))}));n(r)},comments:R.items})):r().createElement(r().Fragment,null,r().createElement(xe,null),r().createElement(Ae.j,null))))):r().createElement(He,null))}}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_clickview_library_editor=self.webpackChunk_clickview_library_editor||[]).push([[8622],{31709:function(e,t,a){a.d(t,{K:function(){return u}});var n=a(1024),r=a(99910),l=a(53808),i=a(52076),c=a(17439),o=a(63946),s=a(54753);function u(e){var t,a,u=e.showSpinner?n.createElement(r.Spinner,{as:"span",animation:"border",role:"status",size:"sm"}):e.children;if(e.tooltip&&e.svgName){var d=null!==(t=e.className)&&void 0!==t?t:"";return e.disabled&&!e.appLink&&(d+=" pointer-events-none"),n.createElement(o.u,{title:e.tooltip,spanHack:!0},n.createElement(c.h,{appLink:e.appLink,href:e.href,svgName:e.svgName,svgSize:e.svgSize,onClick:e.onClick,className:d,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions,openInNewTab:e.openInNewTab,disabled:e.disabled},u))}if(e.svgName)return n.createElement(c.h,{onClick:e.onClick,appLink:e.appLink,href:e.href,svgName:e.svgName,svgSize:e.svgSize,className:e.className,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions,openInNewTab:e.openInNewTab,disabled:e.disabled},u);if(e.tooltip&&e.appLink)return n.createElement(o.u,{title:e.tooltip,spanHack:!0},n.createElement(s.F,{onClick:e.onClick,appLink:e.appLink,className:e.className,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions,openInNewTab:e.openInNewTab,disabled:e.disabled},u));if(e.appLink)return n.createElement(s.F,{onClick:e.onClick,appLink:e.appLink,className:e.className,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions,openInNewTab:e.openInNewTab,disabled:e.disabled},u);function m(t){e.analyticsData&&e.analyticsOptions&&i.k.logUserAction(e.analyticsData,e.analyticsOptions),l.q.isFunction(e.onClick)&&e.onClick(t)}return e.tooltip?n.createElement(o.u,{title:e.tooltip,spanHack:!0},n.createElement("button",{onClick:m,className:"".concat(null!==(a=e.className)&&void 0!==a?a:"").concat(e.disabled?" pointer-events-none":""),disabled:e.disabled},u)):n.createElement("button",{onClick:m,className:e.className,disabled:e.disabled},u)}},86347:function(e,t,a){a.d(t,{b:function(){return u},n:function(){return s}});var n=a(1024),r=a(92802),l=a(53808),i=a(85887);function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=new Array(t);a<t;a++)n[a]=e[a];return n}var o=function(e,t){var a={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(a[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(a[n[r]]=e[n[r]])}return a};function s(e){var t=e.castInitialValues,a=e.castValuesOnSubmit,s=e.initialValues,u=e.onSubmit,d=o(e,["castInitialValues","castValuesOnSubmit","initialValues","onSubmit"]),m=t&&e.validationSchema?e.validationSchema.cast(function(e){if(!e)return{};var t=i.t.deepClone(e);return function e(a){Object.keys(t).forEach((function(n){t.hasOwnProperty(n)&&(i.t.isObject(a[n])?e(a[n]):null===t[n]&&delete t[n])}))}(t),t}(s)):s,p={allowInitialSubmit:e.allowInitialSubmit};return n.createElement(r.J9,Object.assign({enableReinitialize:!0},d,{initialValues:m,onSubmit:function(t,n){var r=n.setSubmitting,l=n.resetForm,i=n.setFieldError,o=a&&e.validationSchema?e.validationSchema.cast(t):t;u(o,(function(){var e,t,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(a.reset&&l(),a.errors)for(var n=0,o=Object.entries(a.errors);n<o.length;n++){var s=(e=o[n],t=2,function(e){if(Array.isArray(e))return e}(e)||function(e,t){var a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var n,r,l,i,c=[],o=!0,s=!1;try{if(l=(a=a.call(e)).next,0===t){if(Object(a)!==a)return;o=!1}else for(;!(o=(n=l.call(a)).done)&&(c.push(n.value),c.length!==t);o=!0);}catch(e){s=!0,r=e}finally{try{if(!o&&null!=a.return&&(i=a.return(),Object(i)!==i))return}finally{if(s)throw r}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?c(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),u=s[0],d=s[1];i(u,d)}r(!1)}))},initialStatus:p}),l.q.isFunction(e.children)?function(t){return e.children(t)}:n.Children.count(e.children)?e.children:null)}function u(){return(0,r.u6)()}s.defaultProps={castInitialValues:!0,castValuesOnSubmit:!0}},7378:function(e,t,a){a.r(t),a.d(t,{PendingRequestsView:function(){return ze}});var n=a(1024),r=a.n(n),l=a(86120),i=a(23689),c=a(57857),o=a(30317),s=a(25796),u=a(66703),d=a(90335),m=a(86242),p=a(2491),b=a(22430),f=a(50997),y=a(48404),v=a(19226),g=a(68893),E=a(17950),h=a(9416),N=a(18844),w=a(95061),k=a(86347),S=a(98495),R=a(92802),O=a(5173),L=a(31647),I=a(63151);function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=new Array(t);a<t;a++)n[a]=e[a];return n}var q={find:function(e,t){if(e&&e.children&&e.children.length)for(var a=function e(a){if(I.m.isEqual(a.id,t))return a;var n=a.children;if(n&&n.length)for(var r=0;r<n.length;r++){var l=e(n[r]);if(l)return l}},n=0;n<e.children.length;n++){var r=a(e.children[n]);if(r)return r}},getPath:function(e,t){for(var a=[t],n=function(e){return e.hasOwnProperty("parentIds")&&Array.isArray(e.parentIds)&&e.parentIds.length?e.parentIds[0]:e.hasOwnProperty("parentId")?e.parentId:null},r=n(t);r;){var l=q.find(e,r);l&&(a=[l].concat(function(e){if(Array.isArray(e))return C(e)}(i=a)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(i)||function(e,t){if(e){if("string"==typeof e)return C(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?C(e,t):void 0}}(i)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())),r=l?n(l):null}var i;return a},convertNestedObjectToTree:function(e){var t,a=Object.assign(Object.assign({},e.data),{children:e.children});return(null===(t=a.children)||void 0===t?void 0:t.length)&&(a.children=a.children.map(q.convertNestedObjectToTree)),a}},T=a(39396),A=a(63791),x=function(e){switch(e){case"up":return"JAT0R";case"down":return"ld41u";case"right":return"HHkPe";case"left":return"jZTRR"}};function j(e){return r().createElement(T.x,{svgName:A.vn.Caret,className:"".concat(x(e.direction)," svg-container d-inline-block ").concat(e.className)})}j.defaultProps={direction:"right"};var D=a(58424),F=a(53808),P=a(17439),V=a(63946),U=a(97874),_=a(52076),B=a(54753),H={dropdownToggle:"UCAnJ"};function M(e){var t="dropdown-item";return e&&(t+=" ".concat(e)),t}function Q(e){var t=F.q.isFunction(e.action.label)?e.action.label:function(){return n.createElement(n.Fragment,null,e.action.label)};if(e.action.appLink)return n.createElement(B.F,{appLink:e.action.appLink,onClick:e.action.onClick,className:M(e.action.className),analyticsData:e.action.analyticsData,analyticsOptions:e.action.analyticsOptions,openInNewTab:e.action.openInNewTab,disabled:e.action.disabled},t());function a(t){t.preventDefault(),e.action.analyticsData&&e.action.analyticsOptions&&_.k.logUserAction(e.action.analyticsData,e.action.analyticsOptions),F.q.isFunction(e.action.onClick)&&e.action.onClick(),e.action.href&&L.Q.LocationUtils.PageLoad(e.action.href,e.action.openInNewTab)}return e.action.href?n.createElement("a",{className:M(e.action.className),onClick:a,href:e.action.href},t()):n.createElement("span",{className:"cursor-pointer ".concat(M(e.action.className)),onClick:a,role:"button",tabIndex:0,onKeyDown:function(e){return"Enter"===e.key&&a(e)}},t())}function G(e){if(!e.actions||!e.actions.length)return n.createElement(n.Fragment,null);var t="dropdown";e.className&&(t+=" ".concat(e.className));var a="actions-dropdown-".concat(U.Y.getRandomInt()),r="dropdown-toggle px-0 ".concat(H.dropdownToggle);return e.dropdownToggleClassName&&(r+=" ".concat(e.dropdownToggleClassName)),n.createElement("div",{className:t},n.createElement("button",{className:r,type:"button",id:a,"data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"},n.createElement(T.x,{svgName:A.vn.More,size:T.S.Small})),n.createElement("div",{className:"dropdown-menu dropdown-menu-right","aria-labelledby":a},e.actions.map((function(e,t){return e.tooltip?n.createElement(V.u,{key:t,title:e.tooltip,spanHack:!0},n.createElement(Q,{action:e})):n.createElement(Q,{key:t,action:e})}))))}G.defaultProps={dropdownToggleClassName:"btn btn-light"};var Y=a(31709);function z(e){var t=n.useMemo((function(){return e.actions.sort((function(e,t){return e.order-t.order}))}),[e.actions]),a=[],r=[];t.forEach((function(e){e.button?a.push(e):r.push(e)}));var l="d-flex";return e.className&&(l+=" ".concat(e.className)),a.length||r.length?n.createElement("div",{className:l},n.createElement(n.Fragment,null,n.createElement("span",{className:"d-flex align-items-center"},a.length?a.map((function(e,t){return n.createElement(n.Fragment,{key:t},function(){if(e.label){var t=F.q.isFunction(e.label)?e.label:function(){return n.createElement(n.Fragment,null,e.label)};return n.createElement(Y.K,{appLink:e.appLink,href:e.href,onClick:e.onClick,svgName:e.svgName,className:e.className,tooltip:e.tooltip,showSpinner:e.showSpinner,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions,openInNewTab:e.openInNewTab,disabled:e.disabled},t())}var a=n.createElement(P.h,{appLink:e.appLink,href:e.href,onClick:e.onClick,svgName:e.svgName,className:e.className,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions,openInNewTab:e.openInNewTab,disabled:e.disabled});return e.tooltip?n.createElement(V.u,{title:e.tooltip,spanHack:!0},a):a}())})):n.createElement(n.Fragment,null),e.sortComponent&&e.sortComponent,r.length?n.createElement(G,{actions:r,dropdownToggleClassName:e.actionsDropdownClassName}):n.createElement(n.Fragment,null)))):n.createElement(n.Fragment,null)}var K={tree:"ZYvBT",text:"eVGWe",chevron:"v76mu",disabled:"wIrTq",root:"JDRq_",selected:"wT87N",actions:"fKJU4",node:"gOBrH",noActions:"fKmrr"};function J(e){function t(){var t="".concat(K.text," clamp-4");return e.className&&(t+=" ".concat(e.className)),t}return e.isDisabled?r().createElement(V.u,{title:e.disabledTooltip,spanHack:!0,spanHackClassName:"d-inline-block"},r().createElement("span",{className:"".concat(t()," text-muted ").concat(K.disabled)},e.text)):r().createElement("div",{className:t()},e.text)}function X(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=new Array(t);a<t;a++)n[a]=e[a];return n}var W="tree-actions";function Z(e){var t,a,r,l=e.tree,i=e.selectedIds,c=e.getAppLink,o=e.onSelect,s=e.isDisabled,u=e.actions,d=e.isDropdown,m=n.useRef(null),p=n.useMemo((function(){return null==i?void 0:i.some((function(e){return q.find(l,e)}))}),[l,i]),b=(a=n.useState(p),r=2,function(e){if(Array.isArray(e))return e}(a)||function(e,t){var a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var n,r,l,i,c=[],o=!0,s=!1;try{if(l=(a=a.call(e)).next,0===t){if(Object(a)!==a)return;o=!1}else for(;!(o=(n=l.call(a)).done)&&(c.push(n.value),c.length!==t);o=!0);}catch(e){s=!0,r=e}finally{try{if(!o&&null!=a.return&&(i=a.return(),Object(i)!==i))return}finally{if(s)throw r}}return c}}(a,r)||function(e,t){if(e){if("string"==typeof e)return X(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?X(e,t):void 0}}(a,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),f=b[0],y=b[1],v=null==i?void 0:i.some((function(e){return I.m.isEqual(l.id,e)})),g=!!l.children&&!!l.children.length;function E(){var t;e.multiSelect||y(!f),c?L.Q.AppLinkHelper.trigger(c(l)):(null===(t=e.isDisabled)||void 0===t?void 0:t.call(e,l))?o(null):null==o||o(l)}return n.useEffect((function(){if(m.current&&d){var e=function(e){e.stopPropagation(),E()};return m.current.addEventListener("click",e),function(){m.current&&m.current.removeEventListener("click",e)}}}),[m.current,o]),n.useEffect((function(){var t;e.multiSelect||f&&(p||v||!(null===(t=e.selectedIds)||void 0===t?void 0:t.length)&&(null==s?void 0:s(e.tree))||y(!1))}),[i]),n.createElement("li",{className:"position-relative ".concat(f?"":K.collapsed," ").concat(e.isRoot?K.root:"")},n.createElement("div",{className:"position-relative"},n.createElement(D.L,{className:(t="py-1 d-flex align-items-center w-100 position-relative ".concat(K.node),v&&(t+=" "+e.selectedLinkClassName),(null==u?void 0:u.length)||(t+=" "+K.noActions),p&&e.multiSelect&&(t+=" text-underline font-italic"),t),onClick:d?null:E,ref:m},g&&n.createElement("div",{className:K.chevron,onClick:function(t){t.stopPropagation(),e.multiSelect?y(!f):E()}},n.createElement(j,{direction:f?"down":"right"})),n.createElement(J,{text:l.name||l.description,isDisabled:null==s?void 0:s(l),disabledTooltip:e.disabledTooltip})),!!e.actions&&n.createElement(z,{className:K.actions,actions:null==u?void 0:u.map((function(e){return Object.assign(Object.assign({},e),{appLink:e.getAppLink(l)})})),actionsDropdownClassName:"btn btn-light ".concat(W," py-0")}),f&&n.createElement(ee,Object.assign({key:l.id},e,{isChild:!0}))))}Z.defaultProps={selectedLinkClassName:K.selected};var $=function(e,t){var a={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(a[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(a[n[r]]=e[n[r]])}return a};function ee(e){var t=e.tree,a=$(e,["tree"]);return t&&t.children?n.createElement("ul",{className:"m-0 p-0 list-unstyled ".concat(K.tree)},t.children.map((function(t,r){return n.createElement(Z,Object.assign({key:r,tree:t},a,{isRoot:!e.isChild}))}))):n.createElement(n.Fragment,null)}var te={selectButton:"Jh8Ep",createNew:"hnfdj"},ae=a(48088),ne=a(54096);function re(e){var t=(0,ne.G)(f.Or.Library);function a(a){t.getLibraries((function(t){return e(t.toJSON(),a.toJSON())}))}r().useEffect((function(){return ae.Radio.channel(f.Vk.LIBRARY).on("folder:created",a),function(){ae.Radio.channel(f.Vk.LIBRARY).off("folder:created",a)}}),[e])}var le=a(21974),ie=a(264),ce="libraryRequests.destinationForm",oe=(0,O.Ry)().shape({library:(0,O.Ry)().required(),folder:(0,O.Ry)().required()});function se(e){var t,a,n,l,i,c,o,s=(0,k.b)();re((function(e,t){var a=e.find((function(e){return e.id.toString()===s.values.library.id.toString()}));if(a){s.setFieldValue("library",a,!0);var n=q.find(a,t.id);n&&s.setFieldValue("folder",n,!0)}}));var d=e.libraryRequest.sender&&"".concat(e.libraryRequest.sender.name," ").concat(e.libraryRequest.sender.surname),m="";return(null===(t=e.libraryRequest.senderCustomer)||void 0===t?void 0:t.id.toString())!==e.currentUser.get("customerId").toString()&&(m=null===(a=e.libraryRequest.senderCustomer)||void 0===a?void 0:a.name),r().createElement("div",{className:"bg-white rounded p-3 mb-3"},r().createElement(R.l0,null,r().createElement("div",{className:"row"},r().createElement("div",{className:"col-9"},!!d&&r().createElement("div",{className:"row mb-3"},r().createElement("div",{className:"col-3"},r().createElement("label",null,r().createElement(u.x,{namespace:ce,phrase:"requestedBy"}))),r().createElement("div",{className:"col-9"},r().createElement(r().Fragment,null,d,!!m&&r().createElement(r().Fragment,null," (",m,")")))),r().createElement("div",{className:"row mb-3"},r().createElement("div",{className:"col-3"},r().createElement("label",null,r().createElement(u.x,{namespace:ce,phrase:"videoSource"}))),r().createElement("div",{className:"col-9"},!!e.libraryRequest.sourceLibrary&&r().createElement("span",{className:"badge p-1 mr-1 text-white ".concat(le.u.mapSourceToClass(e.libraryRequest.sourceLibrary.type))},le.u.mapSourceToDisplayName(e.libraryRequest.sourceLibrary,ie.g.hasLite)),!!e.libraryRequest.sourceCategory&&r().createElement("span",{className:"ml-2"},e.libraryRequest.sourceCategory.name))),r().createElement("div",{className:"row mb-3"},r().createElement("div",{className:"col-3"},r().createElement("label",null,r().createElement(u.x,{namespace:ce,phrase:"addTo"}))),r().createElement("div",{className:"col-9"},e.libraries.length>1&&r().createElement("div",{className:"dropdown mb-2"},r().createElement("button",{className:"dropdown-toggle btn-block form-control text-left position-relative ".concat(te.selectButton),type:"button",id:"select-library","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"},r().createElement("div",{className:"text-truncate"},null!==(l=null===(n=s.values.library)||void 0===n?void 0:n.name)&&void 0!==l?l:r().createElement(u.x,{namespace:ce,phrase:"selectALibrary"}))),r().createElement("div",{className:"dropdown-menu w-100","aria-labelledby":"select-library"},e.libraries.map((function(e,t){var a,n,l=e.id.toString()===(null===(n=null===(a=s.values.library)||void 0===a?void 0:a.id)||void 0===n?void 0:n.toString());return r().createElement("div",{className:"dropdown-item cursor-pointer ".concat(l?"active":""),key:t,onClick:function(){s.setFieldValue("library",e,!0),s.setFieldValue("folder",null,!0)}},e.name)})))),r().createElement("div",{className:"dropdown mb-2"},r().createElement("button",{className:"dropdown-toggle btn-block form-control text-left position-relative ".concat(te.selectButton),type:"button",id:"select-folder","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false",disabled:!s.values.library},r().createElement("div",{className:"text-truncate"},null!==(c=s.values.library&&(null===(i=s.values.folder)||void 0===i?void 0:i.name))&&void 0!==c?c:r().createElement(u.x,{namespace:ce,phrase:"selectAFolder"}))),r().createElement("div",{className:"dropdown-menu w-100","aria-labelledby":"select-folder"},r().createElement(S.ZP,{autoHeight:!0,autoHeightMax:300,hideTracksWhenNotNeeded:!0},r().createElement(ee,{tree:s.values.library,onSelect:function(e){return s.setFieldValue("folder",e,!0)},selectedIds:(null===(o=s.values.folder)||void 0===o?void 0:o.id)?[s.values.folder.id]:void 0,selectedLinkClassName:"bg-light font-weight-500",isDropdown:!0}),s.values.library&&r().createElement(B.F,{className:"btn font-weight-bold rounded-0 w-100 text-left ".concat(te.createNew),appLink:{application:f.OV.LIBRARY_REQUESTS,action:f.eX.Shared.NEW_FOLDER,args:[s.values.library.id]}},r().createElement(u.x,{namespace:ce,phrase:"createNew"})))))))),r().createElement("div",{className:"col-3"},r().createElement("div",{className:"d-flex justify-content-end"},r().createElement("button",{type:"button",className:"btn btn-link",onClick:e.onReject},r().createElement(u.x,{namespace:ce,phrase:"reject"})),r().createElement("button",{type:"submit",className:"btn btn-dark",disabled:!s.isValid},r().createElement(u.x,{namespace:ce,phrase:"approve"})))))))}var ue=a(70065);function de(e){function t(t,a){var n,r,l,i,c,o,s={location:ue.LocationContext.LibraryRequestDetails,actionType:t,entity:ue.EntityType.LibraryRequest,workflowPhase:ue.WorkflowPhase.Start},u={id:e.libraryRequest.id,videoId:null===(n=e.libraryRequest.object)||void 0===n?void 0:n.id,requestingUserId:null===(r=e.libraryRequest.sender)||void 0===r?void 0:r.id,sourceLibraryId:null===(l=e.libraryRequest.sourceLibrary)||void 0===l?void 0:l.id,sourceFolderId:null===(i=e.libraryRequest.sourceCategory)||void 0===i?void 0:i.id,destinationLibraryId:null===(c=null==a?void 0:a.library)||void 0===c?void 0:c.id,destinationFolderId:null===(o=null==a?void 0:a.folder)||void 0===o?void 0:o.id};_.k.logUserAction(u,s)}return r().createElement(k.n,{initialValues:{library:e.libraries.find((function(t){var a;return t.id.toString()===(null===(a=e.libraryRequest.destinationLibrary)||void 0===a?void 0:a.id.toString())})),folder:e.libraryRequest.destinationCategory},validationSchema:oe,onSubmit:function(a){t(ue.UserAction.Approve,a),L.Q.AppLinkHelper.trigger({application:f.OV.LIBRARY_REQUESTS,action:f.eX.LibraryRequests.APPROVE,args:[e.libraryRequest.id],params:{libraryId:a.library.id,folderId:a.folder.id,queryParams:e.queryParams}})},validateOnMount:!0,enableReinitialize:!1},r().createElement(se,{libraries:e.libraries,libraryRequest:e.libraryRequest,onReject:function(){t(ue.UserAction.Reject),L.Q.AppLinkHelper.trigger({application:f.OV.LIBRARY_REQUESTS,action:f.eX.LibraryRequests.REJECT,args:[e.libraryRequest.id],params:e.queryParams})},currentUser:e.currentUser}))}var me,pe,be={HIGH:.75,MODERATE:.5},fe={circleContainer:"p8Vgz",backgroundCircle:"asGGE",circleSuccess:"PXLNj",circleWarning:"ZckRN",circleDanger:"slBRg",lgCircleContainer:"N8KCI",pendingCircle:"DKrcq",centredPercentageText:"tpmLR"},ye=2,ve=5.8,ge=.2,Ee=.36;function he(e){var t=e===me.Large?ve:ye,a=e===me.Large?Ee:ge;return"".concat(t/2-2*a,"rem")}function Ne(e){return e>=be.HIGH?"text-success":e>=be.MODERATE?"text-warning":"text-danger"}function we(e,t){var a="d-inline-block ".concat(fe.circleContainer);return e===me.Large&&(a+=" ".concat(fe.lgCircleContainer)),ke(t)&&(a+=" ".concat(fe.pendingCircle)),a}function ke(e){return"number"!=typeof e}function Se(e){var t,a=r().useCallback((function(t){if(t){var a=t.r.baseVal.value,n=2*Math.PI*a,r=n-e.percentage*n;t.style.strokeDasharray="".concat(n," ").concat(n),t.style.strokeDashoffset=r.toString()}}),[]);return r().createElement("svg",null,r().createElement("circle",{r:he(e.size),className:fe.backgroundCircle}),!ke(e.percentage)&&r().createElement("circle",{ref:a,r:he(e.size),className:(t=e.percentage,t>=be.HIGH?fe.circleSuccess:t>=be.MODERATE?fe.circleWarning:fe.circleDanger)}))}function Re(e){var t,a,n=function(e){if(!ke(e))return+e.toFixed(2)}(e.percentage),l=e.layout===pe.LabelInside?me.Large:me.Small,i=e.customLabel||(ke(a=n)?"--%":"".concat(Math.round(100*a),"%"));return e.layout===pe.LabelOnly?r().createElement("span",{className:Ne(n)},i):r().createElement("div",{className:"d-flex align-items-center justify-content-between ".concat(null!==(t=e.className)&&void 0!==t?t:"")},e.layout===pe.LabelBefore&&r().createElement("span",{className:"mr-2"},i),r().createElement("div",{className:we(l,n)},r().createElement(Se,{percentage:n,size:l}),e.layout===pe.LabelInside&&r().createElement("span",{className:fe.centredPercentageText},i)))}!function(e){e.Small="small",e.Large="large"}(me||(me={})),function(e){e.CircleOnly="circle_only",e.LabelOnly="label_only",e.LabelBefore="label_before",e.LabelInside="label_inside"}(pe||(pe={})),Re.defaultProps={layout:pe.CircleOnly};var Oe="libraryRequests.count";function Le(e){return r().createElement("div",{className:"bg-white rounded px-3 py-2 mb-3 d-flex align-items-center"},r().createElement(Re,null),r().createElement("div",{className:"pl-2"},r().createElement(u.x,{namespace:Oe,phrase:"count",options:{smartCount:e.count.count}})))}var Ie=a(61421),Ce=a(50072),qe=a(30328),Te=a(7044),Ae=a(49824);function xe(){return r().createElement("div",{className:"bg-white rounded p-3 mb-3"},r().createElement("div",{className:"row"},r().createElement("div",{className:"col-3"},r().createElement("div",{className:"partial-loading-background",style:{height:"1.25rem",width:"6rem"}})),r().createElement("div",{className:"col-6"},r().createElement("div",{className:"partial-loading-background",style:{height:"1.25rem",width:"9rem"}})),r().createElement("div",{className:"col-3 d-flex justify-content-end align-items-center"},r().createElement("div",{className:"partial-loading-background rounded",style:{height:"1.25rem",width:"3rem"}}),r().createElement("div",{className:"partial-loading-background rounded ml-2",style:{height:"2.5rem",width:"5rem"}})),r().createElement("div",{className:"col-3"},r().createElement("div",{className:"partial-loading-background",style:{height:"1.25rem",width:"7rem"}})),r().createElement("div",{className:"col-6 mb-2"},r().createElement("div",{className:"partial-loading-background rounded mb-1",style:{height:"2.5rem"}}),r().createElement("div",{className:"partial-loading-background rounded",style:{height:"2.5rem"}}))))}var je=a(85739),De=a(59198),Fe=a(64429),Pe=a(41026),Ve=a(41777),Ue=a(56154),_e="libraryRequests.pendingRequestsEmptyState",Be=c.T.encloseNamespace(_e);function He(){return r().createElement("div",{className:"bg-white rounded p-3 py-5"},r().createElement(Ve.u,null,r().createElement(Ve.u.Image,{src:Ue.W.EmptyStates.PENDING_REQUESTS}),r().createElement(Ve.u.Info,{className:"mb-1"},r().createElement(u.x,{namespace:_e,phrase:"info"})),r().createElement(Ve.u.Cta,{text:Be("cta"),className:"btn btn-link text-info",appLink:{application:f.OV.LIBRARY_REQUESTS,action:f.eX.LibraryRequests.LIBRARY_REQUEST_SETTINGS_LIBRARIES}})))}function Me(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var n,r,l,i,c=[],o=!0,s=!1;try{if(l=(a=a.call(e)).next,0===t){if(Object(a)!==a)return;o=!1}else for(;!(o=(n=l.call(a)).done)&&(c.push(n.value),c.length!==t);o=!0);}catch(e){s=!0,r=e}finally{try{if(!o&&null!=a.return&&(i=a.return(),Object(i)!==i))return}finally{if(s)throw r}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Qe(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?Qe(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Qe(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=new Array(t);a<t;a++)n[a]=e[a];return n}var Ge="libraryRequests.pendingRequests",Ye=c.T.encloseNamespace(Ge);function ze(e){var t,a,n=l.a.useGetFetch(),c=(0,p.Z)(),k=(0,je.p)(e.queryParams.sort||d.D.Newest,[Ce.l.Pending]),S=l.a.useBasicFetch(e.id&&s.y.libraryRequest(e.id)),R=(0,De.s)(e.id),O=l.a.useBasicFetch(s.y.pendingRequestsCount()),L=Me(r().useState(null),2),I=L[0],C=L[1];(0,i.i)(w.T.getLibrariesFetchOptions((function(e){return C(e.toJSON())})),[]),re(C);var q=Me(r().useState(null),2),T=q[0],A=q[1];(0,i.i)(y.p.getConfigFetchOptions(A),[]);var x=Me(r().useState(null),2),j=x[0],D=x[1];(0,i.i)(v.K.getCurrentUserFetchOptions(D),[]),(0,o.v)(S),(0,qe.A)({id:e.id,requests:k.items,appLink:{application:f.OV.LIBRARY_REQUESTS,action:f.eX.LibraryRequests.PENDING_REQUESTS,params:e.queryParams}}),(0,Fe.m)(S.data,"pending",e.queryParams),(0,Pe.K)(S.data);var F=((null===(t=k.items)||void 0===t?void 0:t.length)||k.hasCompleted)&&I&&T&&j,P=S.data&&R.hasCompleted;return r().createElement("div",null,r().createElement("h1",{className:"h2"},r().createElement(u.x,{namespace:Ge,phrase:"title"})),r().createElement("div",{className:"mb-3"},r().createElement(m.Oo,{breadcrumbs:[{name:Ye("libraryEditor"),appLink:{application:f.OV.LIBRARY_EDITOR,action:f.eX.LibraryEditor.HOME}},{name:Ye("title"),active:!0}]})),r().createElement(h.A,{active:"pending"}),!F||(null===(a=k.items)||void 0===a?void 0:a.length)?r().createElement(r().Fragment,null,r().createElement("div",{className:"d-flex justify-content-end mb-3"},r().createElement(E.F,{appLink:{application:f.OV.LIBRARY_REQUESTS,action:f.eX.LibraryRequests.PENDING_REQUESTS,args:[e.id]},queryParams:e.queryParams})),r().createElement("div",{className:"row"},r().createElement("div",{className:"col-4"},F?r().createElement(r().Fragment,null,r().createElement(Le,{count:O.data}),r().createElement(N.q,{libraryRequests:k.items,selectedId:e.id,appLink:{application:f.OV.LIBRARY_REQUESTS,action:f.eX.LibraryRequests.PENDING_REQUESTS},queryParams:e.queryParams,fetchNext:k.fetchNext,isFetching:k.isFetching,nextCursor:k.nextCursor})):r().createElement(Te.p,null)),r().createElement("div",{className:"col-8"},F&&P?r().createElement(r().Fragment,null,r().createElement(de,{key:S.data.id,libraryRequest:S.data,libraries:I,queryParams:e.queryParams,currentUser:j}),r().createElement(Ie.x,{libraryRequest:S.data,config:T,currentUser:j,createViewKey:function(t,a){var r=s.y.createViewKey(e.id,(function(e){return a(new g.y(e))}),(function(e){return c.error(b.M.libraryApiError(e))}));n(r)},comments:R.items})):r().createElement(r().Fragment,null,r().createElement(xe,null),r().createElement(Ae.j,null))))):r().createElement(He,null))}}}]);
|