1 line
10 KiB
JavaScript
1 line
10 KiB
JavaScript
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[8690],{26364:function(e,t,n){n.r(t),n.d(t,{Component:function(){return P},action:function(){return S}});var r=n(62540),a=n(94732),o=n(47891),u=n(92779),i=n(63703),l=n(85637),c=n(70140),s=n(57836),f=n(89348),p=n(99193),y=n(80401),h=n(69410),d=function(){var e=(0,h.gf)().api;return(0,y.I)({queryKey:["Countries"],queryFn:function(t){var n=t.signal;return function(e,t){return n=void 0,r=void 0,o=function(){return function(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return u.next=i(0),u.throw=i(1),u.return=i(2),"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function i(i){return function(l){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u&&(u=0,i[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&i[0]?r.return:i[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,i[1])).done)return a;switch(r=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,r=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){o.label=i[1];break}if(6===i[0]&&o.label<a[1]){o.label=a[1],a=i;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(i);break}a[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}catch(e){i=[6,e],r=0}finally{n=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,(function(n){switch(n.label){case 0:return[4,(0,p.S)(e).getCountries(t)];case 1:return[2,n.sent().data]}}))},new((a=void 0)||(a=Promise))((function(e,t){function u(e){try{l(o.next(e))}catch(e){t(e)}}function i(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof a?n:new a((function(e){e(n)}))).then(u,i)}l((o=o.apply(n,r||[])).next())}));var n,r,a,o}(e,{signal:n})},enabled:!!e})},b=function(){var e=(0,h.gf)().api;return(0,y.I)({queryKey:["Cultures"],queryFn:function(t){var n=t.signal;return function(e,t){return n=void 0,r=void 0,o=function(){return function(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return u.next=i(0),u.throw=i(1),u.return=i(2),"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function i(i){return function(l){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u&&(u=0,i[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&i[0]?r.return:i[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,i[1])).done)return a;switch(r=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,r=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){o.label=i[1];break}if(6===i[0]&&o.label<a[1]){o.label=a[1],a=i;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(i);break}a[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}catch(e){i=[6,e],r=0}finally{n=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,(function(n){switch(n.label){case 0:return[4,(0,p.S)(e).getCultures(t)];case 1:return[2,n.sent().data]}}))},new((a=void 0)||(a=Promise))((function(e,t){function u(e){try{l(o.next(e))}catch(e){t(e)}}function i(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof a?n:new a((function(e){e(n)}))).then(u,i)}l((o=o.apply(n,r||[])).next())}));var n,r,a,o}(e,{signal:n})},enabled:!!e})},m=n(28850),v=n(5898),g=n(84849),w=n(65242),x=n(36720),A=n(67430),C=(n(63696),n(87404)),j=n(9055),I=n(31297),S=function(e){return t=void 0,n=[e],o=function(e){var t,n,r,o,u=e.request;return function(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return u.next=i(0),u.throw=i(1),u.return=i(2),"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function i(i){return function(l){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u&&(u=0,i[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&i[0]?r.return:i[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,i[1])).done)return a;switch(r=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,r=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){o.label=i[1];break}if(6===i[0]&&o.label<a[1]){o.label=a[1],a=i;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(i);break}a[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}catch(e){i=[6,e],r=0}finally{n=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,(function(e){switch(e.label){case 0:if(!(t=A.tF.getCurrentApi()))throw new Error("No Api instance available");return[4,u.formData()];case 1:return n=e.sent(),r=Object.fromEntries(n),[4,(0,a.T)(t).getConfiguration()];case 2:return(o=e.sent().data).PreferredMetadataLanguage=r.Language.toString(),o.MetadataCountryCode=r.Country.toString(),o.DummyChapterDuration=parseInt(r.DummyChapterDuration.toString(),10),o.ChapterImageResolution=r.ChapterImageResolution.toString(),[4,(0,a.T)(t).updateConfiguration({serverConfiguration:o})];case 3:return e.sent(),I.q.invalidateQueries({queryKey:[x.t5]}),[2,{isSaved:!0}]}}))},new((r=void 0)||(r=Promise))((function(e,a){function u(e){try{l(o.next(e))}catch(e){a(e)}}function i(e){try{l(o.throw(e))}catch(e){a(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(u,i)}l((o=o.apply(t,n||[])).next())}));var t,n,r,o},P=function(){var e=(0,x._r)(),t=e.data,n=e.isPending,a=e.isError,p=b(),y=p.data,h=p.isPending,A=p.isError,I=d(),S=I.data,P=I.isPending,k=I.isError,L=(0,C.cq)(),D=(0,C.mP)(),O="submitting"===L.state,T=[{name:v.Ay.translate("ResolutionMatchSource"),value:m.m.MatchSource},{name:"2160p",value:m.m.P2160},{name:"1440p",value:m.m.P1440},{name:"1080p",value:m.m.P1080},{name:"720p",value:m.m.P720},{name:"480p",value:m.m.P480},{name:"360p",value:m.m.P360},{name:"240p",value:m.m.P240},{name:"144p",value:m.m.P144}];return n||h||P?(0,r.jsx)(g.A,{}):(0,r.jsx)(w.A,{id:"metadataImagesConfigurationPage",title:v.Ay.translate("LabelMetadata"),className:"type-interior mainAnimatedPage",children:(0,r.jsx)(u.A,{className:"content-primary",children:a||A||k?(0,r.jsx)(o.A,{severity:"error",children:v.Ay.translate("MetadataImagesLoadError")}):(0,r.jsx)(j.lV,{method:"POST",children:(0,r.jsxs)(c.A,{spacing:3,children:[!O&&(null==D?void 0:D.isSaved)&&(0,r.jsx)(o.A,{severity:"success",children:v.Ay.translate("SettingsSaved")}),(0,r.jsx)(f.A,{variant:"h2",children:v.Ay.translate("HeaderPreferredMetadataLanguage")}),(0,r.jsx)(f.A,{children:v.Ay.translate("DefaultMetadataLangaugeDescription")}),(0,r.jsx)(s.A,{name:"Language",label:v.Ay.translate("LabelLanguage"),defaultValue:t.PreferredMetadataLanguage,select:!0,children:y.map((function(e){return(0,r.jsx)(l.A,{value:e.TwoLetterISOLanguageName,children:e.DisplayName},e.TwoLetterISOLanguageName)}))}),(0,r.jsx)(s.A,{name:"Country",label:v.Ay.translate("LabelCountry"),defaultValue:t.MetadataCountryCode,select:!0,children:S.map((function(e){return(0,r.jsx)(l.A,{value:e.TwoLetterISORegionName||"",children:e.DisplayName},e.DisplayName)}))}),(0,r.jsx)(f.A,{variant:"h2",children:v.Ay.translate("HeaderDummyChapter")}),(0,r.jsx)(s.A,{name:"DummyChapterDuration",defaultValue:t.DummyChapterDuration,type:"number",label:v.Ay.translate("LabelDummyChapterDuration"),helperText:v.Ay.translate("LabelDummyChapterDurationHelp"),slotProps:{htmlInput:{min:0,required:!0}}}),(0,r.jsx)(s.A,{name:"ChapterImageResolution",select:!0,defaultValue:t.ChapterImageResolution,label:v.Ay.translate("LabelChapterImageResolution"),helperText:v.Ay.translate("LabelChapterImageResolutionHelp"),children:T.map((function(e){return(0,r.jsx)(l.A,{value:e.value,children:e.name},e.name)}))}),(0,r.jsx)(i.A,{type:"submit",size:"large",children:v.Ay.translate("Save")})]})})})})};P.displayName="MetadataImagesPage"},36720:function(e,t,n){n.d(t,{_r:function(){return i},t5:function(){return u}});var r=n(94732),a=n(80401),o=n(69410),u="Configuration",i=function(){var e=(0,o.gf)().api;return(0,a.I)({queryKey:[u],queryFn:function(t){var n=t.signal;return function(e,t){return n=void 0,a=void 0,u=function(){return function(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return u.next=i(0),u.throw=i(1),u.return=i(2),"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function i(i){return function(l){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u&&(u=0,i[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&i[0]?r.return:i[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,i[1])).done)return a;switch(r=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,r=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){o.label=i[1];break}if(6===i[0]&&o.label<a[1]){o.label=a[1],a=i;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(i);break}a[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}catch(e){i=[6,e],r=0}finally{n=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,(function(n){switch(n.label){case 0:return[4,(0,r.T)(e).getConfiguration(t)];case 1:return[2,n.sent().data]}}))},new((o=void 0)||(o=Promise))((function(e,t){function r(e){try{l(u.next(e))}catch(e){t(e)}}function i(e){try{l(u.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(r,i)}l((u=u.apply(n,a||[])).next())}));var n,a,o,u}(e,{signal:n})},enabled:!!e})}}}]); |