/*! For license information please see theming-personal-theming.js.LICENSE.txt */ !function(){"use strict";var n,e={30267:function(n,e,r){var a=r(20144),o=r(79753),i=r(16453),c=r(4820),s=r(20571),u=r.n(s),l=r(13299),d=r.n(l),g=function(n){return(0,o.generateFilePath)("theming","","img/background/")+n},h=function(n){var e,t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=(null===(e=window.OCA)||void 0===e||null===(t=e.Theming)||void 0===t?void 0:t.enabledThemes)||[],c=0===i.length||"default"===i[0]?window.matchMedia("(prefers-color-scheme: dark)").matches:-1!==i.join("").indexOf("dark");return"default"===n?a&&"backgroundColor"!==a?(0,o.generateUrl)("/apps/theming/image/background")+"?v="+window.OCA.Theming.cacheBuster:g(c?"eduardo-neves-pedra-azul.jpg":"kamil-porembinski-clouds.jpg"):"custom"===n?(0,o.generateUrl)("/apps/theming/background")+"?v="+r:g(n)},p=r(20296),m=r.n(p),f=r(69867),A=r.n(f),v=r(15168),b=r.n(v);function k(n,e,t,r,a,o,i){try{var c=n[o](i),s=c.value}catch(n){return void t(n)}c.done?e(s):Promise.resolve(s).then(r,a)}function C(n){return function(){var e=this,t=arguments;return new Promise((function(r,a){var o=n.apply(e,t);function i(n){k(o,r,a,i,c,"next",n)}function c(n){k(o,r,a,i,c,"throw",n)}i(void 0)}))}}function y(n,e){(null==e||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t.6},calculateLuma:function(n){var e,t,r=(e=this.hexToRGB(n),t=3,function(n){if(Array.isArray(n))return n}(e)||function(n,e){var t=null==n?null:"undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(null!=t){var r,a,o=[],i=!0,c=!1;try{for(t=t.call(n);!(i=(r=t.next()).done)&&(o.push(r.value),!e||o.length!==e);i=!0);}catch(n){c=!0,a=n}finally{try{i||null==t.return||t.return()}finally{if(c)throw a}}return o}}(e,t)||function(n,e){if(n){if("string"==typeof n)return y(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);return"Object"===t&&n.constructor&&(t=n.constructor.name),"Map"===t||"Set"===t?Array.from(n):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?y(n,e):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.")}());return(.2126*r[0]+.7152*r[1]+.0722*r[2])/255},hexToRGB:function(n){var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);return e?[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]:null},update:function(n){var e=this;return C(regeneratorRuntime.mark((function t(){var r,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r="custom"===n.type||"default"===n.type?n.type:n.value,e.backgroundImage=h(r,n.version,e.themingDefaultBackground),"color"!==n.type&&("default"!==n.type||"backgroundColor"!==e.themingDefaultBackground)){t.next=6;break}return e.$emit("update:background",n),e.loading=!1,t.abrupt("return");case 6:(a=new Image).onload=function(){e.$emit("update:background",n),e.loading=!1},a.src=e.backgroundImage;case 9:case"end":return t.stop()}}),t)})))()},setDefault:function(){var n=this;return C(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.loading="default",e.next=3,c.default.post((0,o.generateUrl)("/apps/theming/background/default"));case 3:t=e.sent,n.update(t.data);case 5:case"end":return e.stop()}}),e)})))()},setShipped:function(n){var e=this;return C(regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.loading=n,t.next=3,c.default.post((0,o.generateUrl)("/apps/theming/background/shipped"),{value:n});case 3:r=t.sent,e.update(r.data);case 5:case"end":return t.stop()}}),t)})))()},setFile:function(n){var e=this;return C(regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.loading="custom",t.next=3,c.default.post((0,o.generateUrl)("/apps/theming/background/custom"),{value:n});case 3:r=t.sent,e.update(r.data);case 5:case"end":return t.stop()}}),t)})))()},debouncePickColor:m()((function(){this.pickColor.apply(this,arguments)}),200),pickColor:function(n){var e=this;return C(regeneratorRuntime.mark((function t(){var r,a,i,s,u;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.loading="color",s=(null==n||null===(r=n.target)||void 0===r||null===(a=r.dataset)||void 0===a?void 0:a.color)||(null===(i=e.Theming)||void 0===i?void 0:i.color)||"#0082c9",t.next=4,c.default.post((0,o.generateUrl)("/apps/theming/background/color"),{value:s});case 4:u=t.sent,e.update(u.data);case 6:case"end":return t.stop()}}),t)})))()},pickFile:function(){var n=this;window.OC.dialogs.filepicker(t("theming","Insert from {productName}",{productName:OC.theme.name}),(function(e,t){t===OC.dialogs.FILEPICKER_TYPE_CHOOSE&&n.setFile(e)}),!1,["image/png","image/gif","image/jpeg","image/svg"],!0,OC.dialogs.FILEPICKER_TYPE_CHOOSE)}}},_=x,T=r(93379),S=r.n(T),B=r(7795),I=r.n(B),E=r(90569),D=r.n(E),O=r(3565),P=r.n(O),j=r(19216),R=r.n(j),U=r(44589),Z=r.n(U),q=r(95066),F={};F.styleTagTransform=Z(),F.setAttributes=P(),F.insert=D().bind(null,"head"),F.domAPI=I(),F.insertStyleElement=R(),S()(q.Z,F),q.Z&&q.Z.locals&&q.Z.locals;var L=r(51900),N=(0,L.Z)(_,(function(){var n=this,e=n.$createElement,t=n._self._c||e;return t("div",{staticClass:"background-selector"},[t("button",{staticClass:"background filepicker",class:{active:"custom"===n.background},attrs:{tabindex:"0"},on:{click:n.pickFile}},[n._v("\n\t\t"+n._s(n.t("theming","Pick from Files"))+"\n\t")]),n._v(" "),t("button",{staticClass:"background default",class:{"icon-loading":"default"===n.loading,active:"default"===n.background},attrs:{tabindex:"0"},on:{click:n.setDefault}},[n._v("\n\t\t"+n._s(n.t("theming","Default image"))+"\n\t")]),n._v(" "),t("NcColorPicker",{on:{input:n.debouncePickColor},model:{value:n.Theming.color,callback:function(e){n.$set(n.Theming,"color",e)},expression:"Theming.color"}},[t("button",{staticClass:"background color",class:{active:n.background===n.Theming.color},style:{backgroundColor:n.Theming.color,color:n.invertTextColor(n.Theming.color)?"#000000":"#ffffff"},attrs:{tabindex:"0","data-color":n.Theming.color,"data-color-bright":n.invertTextColor(n.Theming.color)}},[n._v("\n\t\t\t"+n._s(n.t("theming","Custom color"))+"\n\t\t")])]),n._v(" "),t("button",{staticClass:"background color",class:{active:n.background===n.Theming.defaultColor},style:{color:n.invertTextColor(n.Theming.defaultColor)?"#000000":"#ffffff"},attrs:{tabindex:"0","data-color":n.Theming.defaultColor,"data-color-bright":n.invertTextColor(n.Theming.defaultColor)},on:{click:n.debouncePickColor}},[n._v("\n\t\t"+n._s(n.t("theming","Plain background"))+"\n\t")]),n._v(" "),n._l(n.shippedBackgrounds,(function(e){return t("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.details.attribution,expression:"shippedBackground.details.attribution"}],key:e.name,staticClass:"background",class:{"icon-loading":n.loading===e.name,active:n.background===e.name},style:{"background-image":"url("+e.preview+")"},attrs:{tabindex:"0","data-color-bright":"dark"===e.details.theming},on:{click:function(t){return n.setShipped(e.name)}}})}))],2)}),[],!1,null,"57fc0570",null).exports,$={name:"ItemPreview",components:{NcCheckboxRadioSwitch:u()},props:{enforced:{type:Boolean,default:!1},selected:{type:Boolean,default:!1},theme:{type:Object,required:!0},type:{type:String,default:""},unique:{type:Boolean,default:!1}},computed:{switchType:function(){return this.unique?"switch":"radio"},name:function(){return this.unique?null:this.type},img:function(){return(0,o.generateFilePath)("theming","img",this.theme.id+".jpg")},checked:{get:function(){return this.selected},set:function(n){console.debug("Changed theme",this.theme.id,n),this.unique?this.$emit("change",{enabled:!0===n,id:this.theme.id}):this.$emit("change",{enabled:!0,id:this.theme.id})}}},methods:{onToggle:function(){"radio"!==this.switchType?this.checked=!this.checked:this.checked=!0}}},G=r(83005),K={};K.styleTagTransform=Z(),K.setAttributes=P(),K.insert=D().bind(null,"head"),K.domAPI=I(),K.insertStyleElement=R(),S()(G.Z,K),G.Z&&G.Z.locals&&G.Z.locals;var W=(0,L.Z)($,(function(){var n=this,e=n.$createElement,t=n._self._c||e;return t("div",{staticClass:"theming__preview",class:"theming__preview--"+n.theme.id},[t("div",{staticClass:"theming__preview-image",style:{backgroundImage:"url("+n.img+")"},on:{click:n.onToggle}}),n._v(" "),t("div",{staticClass:"theming__preview-description"},[t("h3",[n._v(n._s(n.theme.title))]),n._v(" "),t("p",[n._v(n._s(n.theme.description))]),n._v(" "),n.enforced?t("span",{staticClass:"theming__preview-warning",attrs:{role:"note"}},[n._v("\n\t\t\t"+n._s(n.t("theming","Theme selection is enforced"))+"\n\t\t")]):n._e(),n._v(" "),t("NcCheckboxRadioSwitch",{staticClass:"theming__preview-toggle",attrs:{checked:n.checked,disabled:n.enforced,name:n.name,type:n.switchType},on:{"update:checked":function(e){n.checked=e}}},[n._v("\n\t\t\t"+n._s(n.theme.enableLabel)+"\n\t\t")])],1)])}),[],!1,null,"37ca8ab2",null).exports;function M(n){return function(n){if(Array.isArray(n))return z(n)}(n)||function(n){if("undefined"!=typeof Symbol&&null!=n[Symbol.iterator]||null!=n["@@iterator"])return Array.from(n)}(n)||function(n,e){if(n){if("string"==typeof n)return z(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);return"Object"===t&&n.constructor&&(t=n.constructor.name),"Map"===t||"Set"===t?Array.from(n):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?z(n,e):void 0}}(n)||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.")}()}function z(n,e){(null==e||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t")},guidelinesLink:function(){return''},descriptionDetail:function(){return t("theming","If you find any issues, do not hesitate to report them on {issuetracker}our issue tracker{linkend}. And if you want to get involved, come join {designteam}our design team{linkend}!").replace("{issuetracker}",this.issuetrackerLink).replace("{designteam}",this.designteamLink).replace(/\{linkend\}/g,"")},issuetrackerLink:function(){return''},designteamLink:function(){return''}},watch:{shortcutsDisabled:function(n){this.changeShortcutsDisabled(n)}},methods:{updateBackground:function(n){this.background="custom"===n.type||"default"===n.type?n.type:n.value,this.$emit("update:background")},changeTheme:function(n){var e=n.enabled,t=n.id;this.themes.forEach((function(n){n.id===t&&e?n.enabled=!0:n.enabled=!1})),this.updateBodyAttributes(),this.selectItem(e,t)},changeFont:function(n){var e=n.enabled,t=n.id;this.fonts.forEach((function(n){n.id===t&&e?n.enabled=!0:n.enabled=!1})),this.updateBodyAttributes(),this.selectItem(e,t)},changeShortcutsDisabled:function(n){return H(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n){e.next=5;break}return e.next=3,(0,c.default)({url:(0,o.generateOcsUrl)("apps/provisioning_api/api/v1/config/users/{appId}/{configKey}",{appId:"theming",configKey:"shortcuts_disabled"}),data:{configValue:"yes"},method:"POST"});case 3:e.next=7;break;case 5:return e.next=7,(0,c.default)({url:(0,o.generateOcsUrl)("apps/provisioning_api/api/v1/config/users/{appId}/{configKey}",{appId:"theming",configKey:"shortcuts_disabled"}),method:"DELETE"});case 7:case"end":return e.stop()}}),e)})))()},updateBodyAttributes:function(){var n=this.themes.filter((function(n){return!0===n.enabled})).map((function(n){return n.id})),e=this.fonts.filter((function(n){return!0===n.enabled})).map((function(n){return n.id}));this.themes.forEach((function(n){document.body.toggleAttribute("data-theme-".concat(n.id),n.enabled)})),this.fonts.forEach((function(n){document.body.toggleAttribute("data-theme-".concat(n.id),n.enabled)})),document.body.setAttribute("data-themes",[].concat(M(n),M(e)).join(","))},selectItem:function(n,e){return H(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,!n){r.next=6;break}return r.next=4,(0,c.default)({url:(0,o.generateOcsUrl)("apps/theming/api/v1/theme/{themeId}/enable",{themeId:e}),method:"PUT"});case 4:r.next=8;break;case 6:return r.next=8,(0,c.default)({url:(0,o.generateOcsUrl)("apps/theming/api/v1/theme/{themeId}",{themeId:e}),method:"DELETE"});case 8:r.next=14;break;case 10:r.prev=10,r.t0=r.catch(0),console.error(r.t0,r.t0.response),OC.Notification.showTemporary(t("theming",r.t0.response.data.ocs.meta.message+". Unable to apply the setting."));case 14:case"end":return r.stop()}}),r,null,[[0,10]])})))()}}},rn=r(18867),an={};an.styleTagTransform=Z(),an.setAttributes=P(),an.insert=D().bind(null,"head"),an.domAPI=I(),an.insertStyleElement=R(),S()(rn.Z,an),rn.Z&&rn.Z.locals&&rn.Z.locals;var on=(0,L.Z)(tn,(function(){var n=this,e=n.$createElement,t=n._self._c||e;return t("section",[t("NcSettingsSection",{staticClass:"theming",attrs:{title:n.t("theming","Appearance and accessibility"),"limit-width":!1}},[t("p",{domProps:{innerHTML:n._s(n.description)}}),n._v(" "),t("p",{domProps:{innerHTML:n._s(n.descriptionDetail)}}),n._v(" "),t("div",{staticClass:"theming__preview-list"},n._l(n.themes,(function(e){return t("ItemPreview",{key:e.id,attrs:{enforced:e.id===n.enforceTheme,selected:n.selectedTheme.id===e.id,theme:e,unique:1===n.themes.length,type:"theme"},on:{change:n.changeTheme}})})),1),n._v(" "),t("div",{staticClass:"theming__preview-list"},n._l(n.fonts,(function(e){return t("ItemPreview",{key:e.id,attrs:{selected:e.enabled,theme:e,unique:1===n.fonts.length,type:"font"},on:{change:n.changeFont}})})),1)]),n._v(" "),t("NcSettingsSection",{attrs:{title:n.t("theming","Keyboard shortcuts")}},[t("p",[n._v(n._s(n.t("theming","In some cases keyboard shortcuts can interfere with accessibility tools. In order to allow focusing on your tool correctly you can disable all keyboard shortcuts here. This will also disable all available shortcuts in apps.")))]),n._v(" "),t("NcCheckboxRadioSwitch",{staticClass:"theming__preview-toggle",attrs:{checked:n.shortcutsDisabled,name:"shortcuts_disabled",type:"switch"},on:{"update:checked":function(e){n.shortcutsDisabled=e},change:n.changeShortcutsDisabled}},[n._v("\n\t\t\t"+n._s(n.t("theming","Disable all keyboard shortcuts"))+"\n\t\t")])],1),n._v(" "),t("NcSettingsSection",{staticClass:"background",attrs:{title:n.t("theming","Background")}},[n.isUserThemingDisabled?[t("p",[n._v(n._s(n.t("theming","Customization has been disabled by your administrator")))])]:[t("p",[n._v(n._s(n.t("theming","Set a custom background")))]),n._v(" "),t("BackgroundSettings",{staticClass:"background__grid",attrs:{background:n.background,"theming-default-background":n.themingDefaultBackground},on:{"update:background":n.updateBackground}})]],2)],1)}),[],!1,null,"b77e949c",null).exports;function cn(n,e){(null==e||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t=o)&&Object.keys(a.O).every((function(n){return a.O[n](t[s])}))?t.splice(s--,1):(c=!1,o0&&n[l-1][2]>o;l--)n[l]=n[l-1];n[l]=[t,r,o]},a.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return a.d(e,{a:e}),e},a.d=function(n,e){for(var t in e)a.o(e,t)&&!a.o(n,t)&&Object.defineProperty(n,t,{enumerable:!0,get:e[t]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(n){if("object"==typeof window)return window}}(),a.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},a.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},a.nmd=function(n){return n.paths=[],n.children||(n.children=[]),n},a.j=1474,function(){a.b=document.baseURI||self.location.href;var n={1474:0};a.O.j=function(e){return 0===n[e]};var e=function(e,t){var r,o,i=t[0],c=t[1],s=t[2],u=0;if(i.some((function(e){return 0!==n[e]}))){for(r in c)a.o(c,r)&&(a.m[r]=c[r]);if(s)var l=s(a)}for(e&&e(t);u