"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[10878],{21475:function(e,n,t){t.r(n),t.d(n,{Component:function(){return k},action:function(){return w},loader:function(){return j}});var r=t(62540),a=t(38345),i=t(47891),l=t(92779),s=t(63703),o=t(96441),u=t(70140),c=t(67854),d=t(57836),f=t(89348),p=t(63696),h=t(87404),m=t(9055),b=t(44419),y=t(84849),v=t(65242),g=t(86191),C=t(5898),A=t(31297),x=function(){return x=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var a in n=arguments[t])Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a]);return e},x.apply(this,arguments)},S={CustomCss:"CustomCss",LoginDisclaimer:"LoginDisclaimer",SplashscreenEnabled:"SplashscreenEnabled"},w=function(e){return n=void 0,t=[e],i=function(e){var n,t,r,i,l,s,o,u=e.request;return function(e,n){var t,r,a,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return l.next=s(0),l.throw=s(1),l.return=s(2),"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function s(s){return function(o){return function(s){if(t)throw new TypeError("Generator is already executing.");for(;l&&(l=0,s[0]&&(i=0)),i;)try{if(t=1,r&&(a=2&s[0]?r.return:s[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;switch(r=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!((a=(a=i.trys).length>0&&a[a.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){i.label=s[1];break}if(6===s[0]&&i.label<a[1]){i.label=a[1],a=s;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(s);break}a[2]&&i.ops.pop(),i.trys.pop();continue}s=n.call(e,i)}catch(e){s=[6,e],r=0}finally{t=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}}(this,(function(e){switch(e.label){case 0:if(!(n=g.A.getCurrentApi()))throw new Error("No Api instance available");return[4,u.formData()];case 1:return t=e.sent(),r=Object.fromEntries(t),i={CustomCss:null===(l=r.CustomCss)||void 0===l?void 0:l.toString(),LoginDisclaimer:null===(s=r.LoginDisclaimer)||void 0===s?void 0:s.toString(),SplashscreenEnabled:"on"===(null===(o=r.SplashscreenEnabled)||void 0===o?void 0:o.toString())},[4,(0,a.T)(n).updateNamedConfiguration({key:"branding",body:JSON.stringify(i)})];case 2:return e.sent(),A.q.invalidateQueries({queryKey:[b.t5]}),[2,{isSaved:!0}]}}))},new((r=void 0)||(r=Promise))((function(e,a){function l(e){try{o(i.next(e))}catch(e){a(e)}}function s(e){try{o(i.throw(e))}catch(e){a(e)}}function o(n){var t;n.done?e(n.value):(t=n.value,t instanceof r?t:new r((function(e){e(t)}))).then(l,s)}o((i=i.apply(n,t||[])).next())}));var n,t,r,i},j=function(){return A.q.ensureQueryData((0,b.iz)(g.A.getCurrentApi()))},k=function(){var e=(0,h.cq)(),n=(0,h.mP)(),t="submitting"===e.state,a=(0,b.l9)(),g=a.data,A=a.isPending,w=function(e,n){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var r,a,i=t.call(e),l=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)l.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(a)throw a.error}}return l}((0,p.useState)(g||{}),2),j=w[0],k=w[1],L=(0,p.useCallback)((function(e,n){var t;k(x(x({},j),((t={})[S.SplashscreenEnabled]=n,t)))}),[j]),E=(0,p.useCallback)((function(e){var n;Object.keys(S).includes(e.target.name)&&k(x(x({},j),((n={})[e.target.name]=e.target.value,n)))}),[j]);return A?(0,r.jsx)(y.A,{}):(0,r.jsx)(v.A,{id:"brandingPage",title:C.Ay.translate("HeaderBranding"),className:"mainAnimatedPage type-interior",children:(0,r.jsx)(l.A,{className:"content-primary",children:(0,r.jsx)(m.lV,{method:"POST",children:(0,r.jsxs)(u.A,{spacing:3,children:[(0,r.jsx)(f.A,{variant:"h1",children:C.Ay.translate("HeaderBranding")}),!t&&(null==n?void 0:n.isSaved)&&(0,r.jsx)(i.A,{severity:"success",children:C.Ay.translate("SettingsSaved")}),(0,r.jsx)(o.A,{control:(0,r.jsx)(c.A,{name:S.SplashscreenEnabled,checked:null==j?void 0:j.SplashscreenEnabled,onChange:L}),label:C.Ay.translate("EnableSplashScreen")}),(0,r.jsx)(d.A,{fullWidth:!0,multiline:!0,minRows:5,maxRows:5,name:S.LoginDisclaimer,label:C.Ay.translate("LabelLoginDisclaimer"),helperText:C.Ay.translate("LabelLoginDisclaimerHelp"),value:null==j?void 0:j.LoginDisclaimer,onChange:E,slotProps:{input:{className:"textarea-mono"}}}),(0,r.jsx)(d.A,{fullWidth:!0,multiline:!0,minRows:5,maxRows:20,name:S.CustomCss,label:C.Ay.translate("LabelCustomCss"),helperText:C.Ay.translate("LabelCustomCssHelp"),value:null==j?void 0:j.CustomCss,onChange:E,slotProps:{input:{className:"textarea-mono"}}}),(0,r.jsx)(s.A,{type:"submit",size:"large",children:C.Ay.translate("Save")})]})})})})};k.displayName="BrandingPage"}}]);