Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon L <szaimen@e.mail.de>2022-04-11 22:10:04 +0300
committerGitHub <noreply@github.com>2022-04-11 22:10:04 +0300
commit25384196f1364b8731ba8c4e6785413bc0296710 (patch)
tree4936bc3f7209078862d78c41d6431cd37ec71377
parent209a2a6a4ba42d4cdf45b2e4467dd3054a9831fb (diff)
parent1202ef1a70af40cf717355f00b97b434022012fc (diff)
Merge pull request #31916 from nextcloud/enh/noid/template-picker-size
fix size of template picker
-rw-r--r--apps/files/src/views/TemplatePicker.vue3
-rw-r--r--dist/files-main.js4
-rw-r--r--dist/files-main.js.map2
3 files changed, 4 insertions, 5 deletions
diff --git a/apps/files/src/views/TemplatePicker.vue b/apps/files/src/views/TemplatePicker.vue
index 283841aa612..6ba98b39800 100644
--- a/apps/files/src/views/TemplatePicker.vue
+++ b/apps/files/src/views/TemplatePicker.vue
@@ -24,7 +24,7 @@
<Modal v-if="opened"
:clear-view-delay="-1"
class="templates-picker"
- size="large"
+ size="normal"
@close="close">
<form class="templates-picker__form"
:style="style"
@@ -286,7 +286,6 @@ export default {
// Make sure we're relative for the loading emptycontent on top
::v-deep .modal-container {
position: relative;
- height: fit-content;
}
&__loading {
diff --git a/dist/files-main.js b/dist/files-main.js
index 108c177df57..b2ff47334db 100644
--- a/dist/files-main.js
+++ b/dist/files-main.js
@@ -1,3 +1,3 @@
/*! For license information please see files-main.js.LICENSE.txt */
-!function(){"use strict";var e,n={23682:function(e,n,i){var r=i(20144);function a(e,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var o=function(){function e(){var n,t;!function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),t=void 0,(n="_settings")in this?Object.defineProperty(this,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):this[n]=t,this._settings=[],console.debug("OCA.Files.Settings initialized")}var n,t;return n=e,(t=[{key:"register",value:function(e){return this._settings.filter((function(n){return n.name===e.name})).length>0?(console.error("A setting with the same name is already registered"),!1):(this._settings.push(e),!0)}},{key:"settings",get:function(){return this._settings}}])&&a(n.prototype,t),Object.defineProperty(n,"prototype",{writable:!1}),e}(),l={name:"Setting",props:{el:{type:Function,required:!0}},mounted:function(){this.$el.appendChild(this.el())}},s=i(51900),c={name:"Settings",components:{Setting:(0,s.Z)(l,(function(){var e=this.$createElement;return(this._self._c||e)("div")}),[],!1,null,null,null).exports},data:function(){return{settings:OCA.Files.Settings.settings}}},u=(0,s.Z)(c,(function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("div",{attrs:{id:"files-app-extra-settings"}},[e._l(e.settings,(function(e){return[t("Setting",{key:e.name,attrs:{el:e.el}})]}))],2)}),[],!1,null,"31c9bb4b",null).exports;function d(e,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function p(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var f=function(){function e(n,t){var i=t.el,r=t.open,a=t.close;!function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),p(this,"_close",void 0),p(this,"_el",void 0),p(this,"_name",void 0),p(this,"_open",void 0),this._name=n,this._el=i,this._open=r,this._close=a,"function"!=typeof this._open&&(this._open=function(){}),"function"!=typeof this._close&&(this._close=function(){})}var n,t;return n=e,(t=[{key:"name",get:function(){return this._name}},{key:"el",get:function(){return this._el}},{key:"open",get:function(){return this._open}},{key:"close",get:function(){return this._close}}])&&d(n.prototype,t),Object.defineProperty(n,"prototype",{writable:!1}),e}();r.default.prototype.t=t,window.OCA.Files||(window.OCA.Files={}),Object.assign(window.OCA.Files,{Settings:new o}),Object.assign(window.OCA.Files.Settings,{Setting:f}),window.addEventListener("DOMContentLoaded",(function(){if(!window.TESTING){new r.default({el:"#files-app-settings",render:function(e){return e(u)}});var e=document.getElementById("app-settings-header");e&&e.addEventListener("click",(function(e){var n=e.currentTarget.children[0].classList.contains("opened");OCA.Files.Settings.settings.forEach((function(e){return n?e.close():e.open()}))}))}}));var m=i(17499),A=i(16453),v=i(9944),h=i(79753),g=i(22200),C=function(){var e,n,t,i,r=(null===(e=OCA)||void 0===e||null===(n=e.Files)||void 0===n||null===(t=n.App)||void 0===t||null===(i=t.currentFileList)||void 0===i?void 0:i.dirInfo)||{path:"/",name:""};return"".concat(r.path,"/").concat(r.name).replace(/\/\//gi,"/")},b=i(4820),w=i(62520),y=i(26932),_=i(97e3),k=i.n(_),x=i(47450),E=i.n(x);function P(e,n,t,i,r,a,o){try{var l=e[a](o),s=l.value}catch(e){return void t(e)}l.done?n(s):Promise.resolve(s).then(i,r)}function O(e){return function(){var n=this,t=arguments;return new Promise((function(i,r){var a=e.apply(n,t);function o(e){P(a,i,r,o,l,"next",e)}function l(e){P(a,i,r,o,l,"throw",e)}o(void 0)}))}}var T=function(){var e=O(regeneratorRuntime.mark((function e(){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,b.default.get((0,h.generateOcsUrl)("apps/files/api/v1/templates"));case 2:return n=e.sent,e.abrupt("return",n.data.ocs.data);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),F=function(){var e=O(regeneratorRuntime.mark((function e(n,t,i){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,b.default.post((0,h.generateOcsUrl)("apps/files/api/v1/templates/create"),{filePath:n,templatePath:t,templateType:i});case 2:return r=e.sent,e.abrupt("return",r.data.ocs.data);case 4:case"end":return e.stop()}}),e)})));return function(n,t,i){return e.apply(this,arguments)}}(),S=256,B={name:"TemplatePreview",inheritAttrs:!1,props:{basename:{type:String,required:!0},checked:{type:Boolean,default:!1},fileid:{type:[String,Number],required:!0},filename:{type:String,required:!0},previewUrl:{type:String,default:null},hasPreview:{type:Boolean,default:!0},mime:{type:String,required:!0},ratio:{type:Number,default:null}},data:function(){return{failedPreview:!1}},computed:{nameWithoutExt:function(){return this.basename.indexOf(".")>-1?this.basename.split(".").slice(0,-1).join("."):this.basename},id:function(){return"template-picker-".concat(this.fileid)},realPreviewUrl:function(){return this.failedPreview&&this.mimeIcon?this.mimeIcon:this.previewUrl?this.previewUrl:(0,g.getCurrentUser)()?(0,h.generateUrl)("/core/preview?fileId=".concat(this.fileid,"&x=").concat(S,"&y=").concat(S,"&a=1")):(0,h.generateUrl)("/apps/files_sharing/publicpreview/".concat(document.getElementById("sharingToken")&&document.getElementById("sharingToken").value,"?fileId=").concat(this.fileid,"&file=").concat(function(e){var n=(e.startsWith("/")?e:"/".concat(e)).split("/"),t="";return n.forEach((function(e){""!==e&&(t+="/"+encodeURIComponent(e))})),t}(this.filename),"&x=").concat(S,"&y=").concat(S,"&a=1"))},mimeIcon:function(){return OC.MimeType.getIconUrl(this.mime)}},methods:{onCheck:function(){this.$emit("check",this.fileid)},onFailure:function(){this.failedPreview=!0}}},j=B,I=i(93379),M=i.n(I),D=i(7795),U=i.n(D),R=i(90569),L=i.n(R),Z=i(3565),q=i.n(Z),W=i(19216),N=i.n(W),$=i(44589),z=i.n($),G=i(78299),Y={};Y.styleTagTransform=z(),Y.setAttributes=q(),Y.insert=L().bind(null,"head"),Y.domAPI=U(),Y.insertStyleElement=N(),M()(G.Z,Y),G.Z&&G.Z.locals&&G.Z.locals;var Q=(0,s.Z)(j,(function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("li",{staticClass:"template-picker__item"},[t("input",{staticClass:"radio",attrs:{id:e.id,type:"radio",name:"template-picker"},domProps:{checked:e.checked},on:{change:e.onCheck}}),e._v(" "),t("label",{staticClass:"template-picker__label",attrs:{for:e.id}},[t("div",{staticClass:"template-picker__preview",class:e.failedPreview?"template-picker__preview--failed":""},[t("img",{staticClass:"template-picker__image",attrs:{src:e.realPreviewUrl,alt:"",draggable:"false"},on:{error:e.onFailure}})]),e._v(" "),t("span",{staticClass:"template-picker__title"},[e._v("\n\t\t\t"+e._s(e.nameWithoutExt)+"\n\t\t")])])])}),[],!1,null,"440aea22",null).exports;function H(e,n,t,i,r,a,o){try{var l=e[a](o),s=l.value}catch(e){return void t(e)}l.done?n(s):Promise.resolve(s).then(i,r)}function K(e){return function(){var n=this,t=arguments;return new Promise((function(i,r){var a=e.apply(n,t);function o(e){H(a,i,r,o,l,"next",e)}function l(e){H(a,i,r,o,l,"throw",e)}o(void 0)}))}}var J={name:"TemplatePicker",components:{EmptyContent:k(),Modal:E(),TemplatePreview:Q},props:{logger:{type:Object,required:!0}},data:function(){return{checked:-1,loading:!1,name:null,opened:!1,provider:null}},computed:{nameWithoutExt:function(){return this.name.indexOf(".")>-1?this.name.split(".").slice(0,-1).join("."):this.name},emptyTemplate:function(){var e,n;return{basename:t("files","Blank"),fileid:-1,filename:this.t("files","Blank"),hasPreview:!1,mime:(null===(e=this.provider)||void 0===e?void 0:e.mimetypes[0])||(null===(n=this.provider)||void 0===n?void 0:n.mimetypes)}},selectedTemplate:function(){var e=this;return this.provider.templates.find((function(n){return n.fileid===e.checked}))},style:function(){return{"--margin":"8px","--width":"160px","--border":"2px","--fullwidth":"180px","--height":this.provider.ratio?Math.round(160/this.provider.ratio)+"px":null}}},methods:{open:function(e,n){var t=this;return K(regeneratorRuntime.mark((function i(){var r,a;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return t.checked=t.emptyTemplate.fileid,t.name=e,t.provider=n,i.next=5,T();case 5:if(r=i.sent,null!==(a=r.find((function(e){return e.app===n.app&&e.label===n.label})))){i.next=9;break}throw new Error("Failed to match provider in results");case 9:if(t.provider=a,0!==a.templates.length){i.next=13;break}return t.onSubmit(),i.abrupt("return");case 13:t.opened=!0;case 14:case"end":return i.stop()}}),i)})))()},close:function(){this.checked=this.emptyTemplate.fileid,this.loading=!1,this.name=null,this.opened=!1,this.provider=null},onCheck:function(e){this.checked=e},onSubmit:function(){var e=this;return K(regeneratorRuntime.mark((function n(){var t,i,r,a,o,l,s,c,u,d,p,f;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return e.loading=!0,a=C(),o=null===(t=OCA)||void 0===t||null===(i=t.Files)||void 0===i||null===(r=i.App)||void 0===r?void 0:r.currentFileList,e.nameWithoutExt===e.name&&(e.logger.debug("Fixed invalid filename",{name:e.name,extension:null===(l=e.provider)||void 0===l?void 0:l.extension}),e.name=e.name+(null===(s=e.provider)||void 0===s?void 0:s.extension)),n.prev=4,n.next=7,F((0,w.normalize)("".concat(a,"/").concat(e.name)),null===(c=e.selectedTemplate)||void 0===c?void 0:c.filename,null===(u=e.selectedTemplate)||void 0===u?void 0:u.templateType);case 7:return d=n.sent,e.logger.debug("Created new file",d),n.next=11,null==o?void 0:o.addAndFetchFileInfo(e.name).then((function(e,n){return n}));case 11:p=n.sent,f=new OCA.Files.FileInfoModel(p,{filesClient:null==o?void 0:o.filesClient}),OCA.Files.fileActions.getDefaultFileAction(d.mime,"file",OC.PERMISSION_ALL).action(d.basename,{$file:null==o?void 0:o.findFileEl(e.name),dir:a,fileList:o,fileActions:null==o?void 0:o.fileActions,fileInfoModel:f}),e.close(),n.next=23;break;case 18:n.prev=18,n.t0=n.catch(4),e.logger.error("Error while creating the new file from template"),console.error(n.t0),(0,y.x2)(e.t("files","Unable to create new file from template"));case 23:return n.prev=23,e.loading=!1,n.finish(23);case 26:case"end":return n.stop()}}),n,null,[[4,18,23,26]])})))()}}},V=J,X=i(16745),ee={};ee.styleTagTransform=z(),ee.setAttributes=q(),ee.insert=L().bind(null,"head"),ee.domAPI=U(),ee.insertStyleElement=N(),M()(X.Z,ee),X.Z&&X.Z.locals&&X.Z.locals;var ne=(0,s.Z)(V,(function(){var e=this,n=e.$createElement,t=e._self._c||n;return e.opened?t("Modal",{staticClass:"templates-picker",attrs:{"clear-view-delay":-1,size:"large"},on:{close:e.close}},[t("form",{staticClass:"templates-picker__form",style:e.style,on:{submit:function(n){return n.preventDefault(),n.stopPropagation(),e.onSubmit.apply(null,arguments)}}},[t("h2",[e._v(e._s(e.t("files","Pick a template for {name}",{name:e.nameWithoutExt})))]),e._v(" "),t("ul",{staticClass:"templates-picker__list"},[t("TemplatePreview",e._b({attrs:{checked:e.checked===e.emptyTemplate.fileid},on:{check:e.onCheck}},"TemplatePreview",e.emptyTemplate,!1)),e._v(" "),e._l(e.provider.templates,(function(n){return t("TemplatePreview",e._b({key:n.fileid,attrs:{checked:e.checked===n.fileid,ratio:e.provider.ratio},on:{check:e.onCheck}},"TemplatePreview",n,!1))}))],2),e._v(" "),t("div",{staticClass:"templates-picker__buttons"},[t("button",{on:{click:e.close}},[e._v("\n\t\t\t\t"+e._s(e.t("files","Cancel"))+"\n\t\t\t")]),e._v(" "),t("input",{staticClass:"primary",attrs:{type:"submit","aria-label":e.t("files","Create a new file with the selected template")},domProps:{value:e.t("files","Create")}})])]),e._v(" "),e.loading?t("EmptyContent",{staticClass:"templates-picker__loading",attrs:{icon:"icon-loading"}},[e._v("\n\t\t"+e._s(e.t("files","Creating file"))+"\n\t")]):e._e()],1):e._e()}),[],!1,null,"278f6b79",null),te=ne.exports;function ie(e,n,t,i,r,a,o){try{var l=e[a](o),s=l.value}catch(e){return void t(e)}l.done?n(s):Promise.resolve(s).then(i,r)}var re=(0,m.IY)().setApp("files").detectUser().build();r.default.mixin({methods:{t:v.translate,n:v.translatePlural}});var ae=document.createElement("div");ae.id="template-picker",document.body.appendChild(ae);var oe=(0,A.loadState)("files","templates",[]),le=(0,A.loadState)("files","templates_path",!1);re.debug("Templates providers",oe),re.debug("Templates folder",{templatesPath:le});var se=new(r.default.extend(te))({name:"TemplatePicker",propsData:{logger:re}});se.$mount("#template-picker"),window.addEventListener("DOMContentLoaded",(function(){if(!le){re.debug("Templates folder not initialized");var e={attach:function(e){e.addMenuEntry({id:"template-init",displayName:(0,v.translate)("files","Set up templates folder"),templateName:(0,v.translate)("files","Templates"),iconClass:"icon-template-add",fileType:"file",actionHandler:function(n){ue(n),e.removeMenuEntry("template-init")}})}};OC.Plugins.register("OCA.Files.NewFileMenu",e)}})),oe.forEach((function(e,n){var t={attach:function(t){var i=t.fileList;"files"!==i.id&&"files.public"!==i.id||t.addMenuEntry({id:"template-new-".concat(e.app,"-").concat(n),displayName:e.label,templateName:e.label+e.extension,iconClass:e.iconClass||"icon-file",fileType:"file",actionHandler:function(n){se.open(n,e)}})}};OC.Plugins.register("OCA.Files.NewFileMenu",t)}));var ce,ue=function(){var e,n=(e=regeneratorRuntime.mark((function e(n){var t,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=(C()+"/".concat(n)).replace("//","/"),e.prev=1,re.debug("Initializing the templates directory",{templatePath:t}),e.next=5,b.default.post((0,h.generateOcsUrl)("apps/files/api/v1/templates/path"),{templatePath:t,copySystemTemplates:!0});case 5:i=e.sent,OCA.Files.App.currentFileList.changeDirectory(t,!0,!0),oe=i.data.ocs.data.templates,le=i.data.ocs.data.template_path,e.next=15;break;case 11:e.prev=11,e.t0=e.catch(1),re.error("Unable to initialize the templates directory"),(0,y.x2)((0,v.translate)("files","Unable to initialize the templates directory"));case 15:case"end":return e.stop()}}),e,null,[[1,11]])})),function(){var n=this,t=arguments;return new Promise((function(i,r){var a=e.apply(n,t);function o(e){ie(a,i,r,o,l,"next",e)}function l(e){ie(a,i,r,o,l,"throw",e)}o(void 0)}))});return function(e){return n.apply(this,arguments)}}(),de=i(74854);ce={attach:function(e){var n=this;(0,de.subscribe)("nextcloud:unified-search.search",(function(n){var t=n.query;e.setFilter(t)})),(0,de.subscribe)("nextcloud:unified-search.reset",(function(){n.query=null,e.setFilter("")}))}},window.OC.Plugins.register("OCA.Files.FileList",ce)},78299:function(e,n,t){var i=t(87537),r=t.n(i),a=t(23645),o=t.n(a)()(r());o.push([e.id,".template-picker__item[data-v-440aea22]{display:flex}.template-picker__label[data-v-440aea22]{display:flex;align-items:center;flex:1 1;flex-direction:column}.template-picker__label[data-v-440aea22],.template-picker__label *[data-v-440aea22]{cursor:pointer;user-select:none}.template-picker__label[data-v-440aea22]::before{display:none !important}.template-picker__preview[data-v-440aea22]{display:block;overflow:hidden;flex:1 1;width:var(--width);min-height:var(--height);max-height:var(--height);padding:0;border:var(--border) solid var(--color-border);border-radius:var(--border-radius-large)}input:checked+label>.template-picker__preview[data-v-440aea22]{border-color:var(--color-primary)}.template-picker__preview--failed[data-v-440aea22]{display:flex}.template-picker__image[data-v-440aea22]{max-width:100%;background-color:var(--color-main-background);object-fit:cover}.template-picker__preview--failed .template-picker__image[data-v-440aea22]{width:calc(var(--margin)*8);margin:auto;background-color:rgba(0,0,0,0) !important;object-fit:initial}.template-picker__title[data-v-440aea22]{overflow:hidden;max-width:calc(var(--width) + 4px);padding:var(--margin);white-space:nowrap;text-overflow:ellipsis}","",{version:3,sources:["webpack://./apps/files/src/components/TemplatePreview.vue"],names:[],mappings:"AAsJC,wCACC,YAAA,CAGD,yCACC,YAAA,CAEA,kBAAA,CACA,QAAA,CACA,qBAAA,CAEA,oFACC,cAAA,CACA,gBAAA,CAGD,iDACC,uBAAA,CAIF,2CACC,aAAA,CACA,eAAA,CAEA,QAAA,CACA,kBAAA,CACA,wBAAA,CACA,wBAAA,CACA,SAAA,CACA,8CAAA,CACA,wCAAA,CAEA,+DACC,iCAAA,CAGD,mDAEC,YAAA,CAIF,yCACC,cAAA,CACA,6CAAA,CAEA,gBAAA,CAID,2EACC,2BAAA,CAEA,WAAA,CACA,yCAAA,CAEA,kBAAA,CAGD,yCACC,eAAA,CAEA,kCAAA,CACA,qBAAA,CACA,kBAAA,CACA,sBAAA",sourcesContent:["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n.template-picker {\n\t&__item {\n\t\tdisplay: flex;\n\t}\n\n\t&__label {\n\t\tdisplay: flex;\n\t\t// Align in the middle of the grid\n\t\talign-items: center;\n\t\tflex: 1 1;\n\t\tflex-direction: column;\n\n\t\t&, * {\n\t\t\tcursor: pointer;\n\t\t\tuser-select: none;\n\t\t}\n\n\t\t&::before {\n\t\t\tdisplay: none !important;\n\t\t}\n\t}\n\n\t&__preview {\n\t\tdisplay: block;\n\t\toverflow: hidden;\n\t\t// Stretch so all entries are the same width\n\t\tflex: 1 1;\n\t\twidth: var(--width);\n\t\tmin-height: var(--height);\n\t\tmax-height: var(--height);\n\t\tpadding: 0;\n\t\tborder: var(--border) solid var(--color-border);\n\t\tborder-radius: var(--border-radius-large);\n\n\t\tinput:checked + label > & {\n\t\t\tborder-color: var(--color-primary);\n\t\t}\n\n\t\t&--failed {\n\t\t\t// Make sure to properly center fallback icon\n\t\t\tdisplay: flex;\n\t\t}\n\t}\n\n\t&__image {\n\t\tmax-width: 100%;\n\t\tbackground-color: var(--color-main-background);\n\n\t\tobject-fit: cover;\n\t}\n\n\t// Failed preview, fallback to mime icon\n\t&__preview--failed &__image {\n\t\twidth: calc(var(--margin) * 8);\n\t\t// Center mime icon\n\t\tmargin: auto;\n\t\tbackground-color: transparent !important;\n\n\t\tobject-fit: initial;\n\t}\n\n\t&__title {\n\t\toverflow: hidden;\n\t\t// also count preview border\n\t\tmax-width: calc(var(--width) + 2*2px);\n\t\tpadding: var(--margin);\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t}\n}\n\n"],sourceRoot:""}]),n.Z=o},16745:function(e,n,t){var i=t(87537),r=t.n(i),a=t(23645),o=t.n(a)()(r());o.push([e.id,".templates-picker__form[data-v-278f6b79]{padding:calc(var(--margin)*2);padding-bottom:0}.templates-picker__form h2[data-v-278f6b79]{text-align:center;font-weight:bold;margin:var(--margin) 0 calc(var(--margin)*2)}.templates-picker__list[data-v-278f6b79]{display:grid;grid-gap:calc(var(--margin)*2);grid-auto-columns:1fr;max-width:calc(var(--fullwidth)*6);grid-template-columns:repeat(auto-fit, var(--fullwidth));grid-auto-rows:1fr;justify-content:center}.templates-picker__buttons[data-v-278f6b79]{display:flex;justify-content:space-between;padding:calc(var(--margin)*2) var(--margin);position:sticky;bottom:0;background-image:linear-gradient(0, var(--gradient-main-background))}.templates-picker__buttons button[data-v-278f6b79],.templates-picker__buttons input[type=submit][data-v-278f6b79]{height:44px}.templates-picker[data-v-278f6b79] .modal-container{position:relative;height:fit-content}.templates-picker__loading[data-v-278f6b79]{position:absolute;top:0;left:0;justify-content:center;width:100%;height:100%;margin:0;background-color:var(--color-main-background-translucent)}","",{version:3,sources:["webpack://./apps/files/src/views/TemplatePicker.vue"],names:[],mappings:"AAuPC,yCACC,6BAAA,CAEA,gBAAA,CAEA,4CACC,iBAAA,CACA,gBAAA,CACA,4CAAA,CAIF,yCACC,YAAA,CACA,8BAAA,CACA,qBAAA,CAEA,kCAAA,CACA,wDAAA,CAEA,kBAAA,CAEA,sBAAA,CAGD,4CACC,YAAA,CACA,6BAAA,CACA,2CAAA,CACA,eAAA,CACA,QAAA,CACA,oEAAA,CAEA,kHACC,WAAA,CAKF,qDACC,iBAAA,CACA,kBAAA,CAGD,4CACC,iBAAA,CACA,KAAA,CACA,MAAA,CACA,sBAAA,CACA,UAAA,CACA,WAAA,CACA,QAAA,CACA,yDAAA",sourcesContent:["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n.templates-picker {\n\t&__form {\n\t\tpadding: calc(var(--margin) * 2);\n\t\t// Will be handled by the buttons\n\t\tpadding-bottom: 0;\n\n\t\th2 {\n\t\t\ttext-align: center;\n\t\t\tfont-weight: bold;\n\t\t\tmargin: var(--margin) 0 calc(var(--margin) * 2);\n\t\t}\n\t}\n\n\t&__list {\n\t\tdisplay: grid;\n\t\tgrid-gap: calc(var(--margin) * 2);\n\t\tgrid-auto-columns: 1fr;\n\t\t// We want maximum 5 columns. Putting 6 as we don't count the grid gap. So it will always be lower than 6\n\t\tmax-width: calc(var(--fullwidth) * 6);\n\t\tgrid-template-columns: repeat(auto-fit, var(--fullwidth));\n\t\t// Make sure all rows are the same height\n\t\tgrid-auto-rows: 1fr;\n\t\t// Center the columns set\n\t\tjustify-content: center;\n\t}\n\n\t&__buttons {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t\tpadding: calc(var(--margin) * 2) var(--margin);\n\t\tposition: sticky;\n\t\tbottom: 0;\n\t\tbackground-image: linear-gradient(0, var(--gradient-main-background));\n\n\t\tbutton, input[type='submit'] {\n\t\t\theight: 44px;\n\t\t}\n\t}\n\n\t// Make sure we're relative for the loading emptycontent on top\n\t::v-deep .modal-container {\n\t\tposition: relative;\n\t\theight: fit-content;\n\t}\n\n\t&__loading {\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tjustify-content: center;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tmargin: 0;\n\t\tbackground-color: var(--color-main-background-translucent);\n\t}\n}\n\n"],sourceRoot:""}]),n.Z=o}},i={};function r(e){var t=i[e];if(void 0!==t)return t.exports;var a=i[e]={id:e,loaded:!1,exports:{}};return n[e].call(a.exports,a,a.exports,r),a.loaded=!0,a.exports}r.m=n,r.amdD=function(){throw new Error("define cannot be used indirect")},r.amdO={},e=[],r.O=function(n,t,i,a){if(!t){var o=1/0;for(u=0;u<e.length;u++){t=e[u][0],i=e[u][1],a=e[u][2];for(var l=!0,s=0;s<t.length;s++)(!1&a||o>=a)&&Object.keys(r.O).every((function(e){return r.O[e](t[s])}))?t.splice(s--,1):(l=!1,a<o&&(o=a));if(l){e.splice(u--,1);var c=i();void 0!==c&&(n=c)}}return n}a=a||0;for(var u=e.length;u>0&&e[u-1][2]>a;u--)e[u]=e[u-1];e[u]=[t,i,a]},r.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(n,{a:n}),n},r.d=function(e,n){for(var t in n)r.o(n,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},r.j=2181,function(){r.b=document.baseURI||self.location.href;var e={2181:0};r.O.j=function(n){return 0===e[n]};var n=function(n,t){var i,a,o=t[0],l=t[1],s=t[2],c=0;if(o.some((function(n){return 0!==e[n]}))){for(i in l)r.o(l,i)&&(r.m[i]=l[i]);if(s)var u=s(r)}for(n&&n(t);c<o.length;c++)a=o[c],r.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return r.O(u)},t=self.webpackChunknextcloud=self.webpackChunknextcloud||[];t.forEach(n.bind(null,0)),t.push=n.bind(null,t.push.bind(t))}();var a=r.O(void 0,[7874],(function(){return r(23682)}));a=r.O(a)}();
-//# sourceMappingURL=files-main.js.map?v=c50f191b5e27d29bae80 \ No newline at end of file
+!function(){"use strict";var e,n={58949:function(e,n,i){var r=i(20144);function a(e,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var o=function(){function e(){var n,t;!function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),t=void 0,(n="_settings")in this?Object.defineProperty(this,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):this[n]=t,this._settings=[],console.debug("OCA.Files.Settings initialized")}var n,t;return n=e,(t=[{key:"register",value:function(e){return this._settings.filter((function(n){return n.name===e.name})).length>0?(console.error("A setting with the same name is already registered"),!1):(this._settings.push(e),!0)}},{key:"settings",get:function(){return this._settings}}])&&a(n.prototype,t),Object.defineProperty(n,"prototype",{writable:!1}),e}(),l={name:"Setting",props:{el:{type:Function,required:!0}},mounted:function(){this.$el.appendChild(this.el())}},s=i(51900),c={name:"Settings",components:{Setting:(0,s.Z)(l,(function(){var e=this.$createElement;return(this._self._c||e)("div")}),[],!1,null,null,null).exports},data:function(){return{settings:OCA.Files.Settings.settings}}},u=(0,s.Z)(c,(function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("div",{attrs:{id:"files-app-extra-settings"}},[e._l(e.settings,(function(e){return[t("Setting",{key:e.name,attrs:{el:e.el}})]}))],2)}),[],!1,null,"31c9bb4b",null).exports;function d(e,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function p(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var m=function(){function e(n,t){var i=t.el,r=t.open,a=t.close;!function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),p(this,"_close",void 0),p(this,"_el",void 0),p(this,"_name",void 0),p(this,"_open",void 0),this._name=n,this._el=i,this._open=r,this._close=a,"function"!=typeof this._open&&(this._open=function(){}),"function"!=typeof this._close&&(this._close=function(){})}var n,t;return n=e,(t=[{key:"name",get:function(){return this._name}},{key:"el",get:function(){return this._el}},{key:"open",get:function(){return this._open}},{key:"close",get:function(){return this._close}}])&&d(n.prototype,t),Object.defineProperty(n,"prototype",{writable:!1}),e}();r.default.prototype.t=t,window.OCA.Files||(window.OCA.Files={}),Object.assign(window.OCA.Files,{Settings:new o}),Object.assign(window.OCA.Files.Settings,{Setting:m}),window.addEventListener("DOMContentLoaded",(function(){if(!window.TESTING){new r.default({el:"#files-app-settings",render:function(e){return e(u)}});var e=document.getElementById("app-settings-header");e&&e.addEventListener("click",(function(e){var n=e.currentTarget.children[0].classList.contains("opened");OCA.Files.Settings.settings.forEach((function(e){return n?e.close():e.open()}))}))}}));var f=i(17499),A=i(16453),v=i(9944),h=i(79753),g=i(22200),C=function(){var e,n,t,i,r=(null===(e=OCA)||void 0===e||null===(n=e.Files)||void 0===n||null===(t=n.App)||void 0===t||null===(i=t.currentFileList)||void 0===i?void 0:i.dirInfo)||{path:"/",name:""};return"".concat(r.path,"/").concat(r.name).replace(/\/\//gi,"/")},b=i(4820),w=i(62520),y=i(26932),_=i(97e3),k=i.n(_),x=i(47450),E=i.n(x);function P(e,n,t,i,r,a,o){try{var l=e[a](o),s=l.value}catch(e){return void t(e)}l.done?n(s):Promise.resolve(s).then(i,r)}function O(e){return function(){var n=this,t=arguments;return new Promise((function(i,r){var a=e.apply(n,t);function o(e){P(a,i,r,o,l,"next",e)}function l(e){P(a,i,r,o,l,"throw",e)}o(void 0)}))}}var T=function(){var e=O(regeneratorRuntime.mark((function e(){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,b.default.get((0,h.generateOcsUrl)("apps/files/api/v1/templates"));case 2:return n=e.sent,e.abrupt("return",n.data.ocs.data);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),F=function(){var e=O(regeneratorRuntime.mark((function e(n,t,i){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,b.default.post((0,h.generateOcsUrl)("apps/files/api/v1/templates/create"),{filePath:n,templatePath:t,templateType:i});case 2:return r=e.sent,e.abrupt("return",r.data.ocs.data);case 4:case"end":return e.stop()}}),e)})));return function(n,t,i){return e.apply(this,arguments)}}(),S=256,B={name:"TemplatePreview",inheritAttrs:!1,props:{basename:{type:String,required:!0},checked:{type:Boolean,default:!1},fileid:{type:[String,Number],required:!0},filename:{type:String,required:!0},previewUrl:{type:String,default:null},hasPreview:{type:Boolean,default:!0},mime:{type:String,required:!0},ratio:{type:Number,default:null}},data:function(){return{failedPreview:!1}},computed:{nameWithoutExt:function(){return this.basename.indexOf(".")>-1?this.basename.split(".").slice(0,-1).join("."):this.basename},id:function(){return"template-picker-".concat(this.fileid)},realPreviewUrl:function(){return this.failedPreview&&this.mimeIcon?this.mimeIcon:this.previewUrl?this.previewUrl:(0,g.getCurrentUser)()?(0,h.generateUrl)("/core/preview?fileId=".concat(this.fileid,"&x=").concat(S,"&y=").concat(S,"&a=1")):(0,h.generateUrl)("/apps/files_sharing/publicpreview/".concat(document.getElementById("sharingToken")&&document.getElementById("sharingToken").value,"?fileId=").concat(this.fileid,"&file=").concat(function(e){var n=(e.startsWith("/")?e:"/".concat(e)).split("/"),t="";return n.forEach((function(e){""!==e&&(t+="/"+encodeURIComponent(e))})),t}(this.filename),"&x=").concat(S,"&y=").concat(S,"&a=1"))},mimeIcon:function(){return OC.MimeType.getIconUrl(this.mime)}},methods:{onCheck:function(){this.$emit("check",this.fileid)},onFailure:function(){this.failedPreview=!0}}},j=B,I=i(93379),M=i.n(I),D=i(7795),U=i.n(D),R=i(90569),L=i.n(R),Z=i(3565),q=i.n(Z),W=i(19216),N=i.n(W),$=i(44589),z=i.n($),G=i(78299),Y={};Y.styleTagTransform=z(),Y.setAttributes=q(),Y.insert=L().bind(null,"head"),Y.domAPI=U(),Y.insertStyleElement=N(),M()(G.Z,Y),G.Z&&G.Z.locals&&G.Z.locals;var Q=(0,s.Z)(j,(function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("li",{staticClass:"template-picker__item"},[t("input",{staticClass:"radio",attrs:{id:e.id,type:"radio",name:"template-picker"},domProps:{checked:e.checked},on:{change:e.onCheck}}),e._v(" "),t("label",{staticClass:"template-picker__label",attrs:{for:e.id}},[t("div",{staticClass:"template-picker__preview",class:e.failedPreview?"template-picker__preview--failed":""},[t("img",{staticClass:"template-picker__image",attrs:{src:e.realPreviewUrl,alt:"",draggable:"false"},on:{error:e.onFailure}})]),e._v(" "),t("span",{staticClass:"template-picker__title"},[e._v("\n\t\t\t"+e._s(e.nameWithoutExt)+"\n\t\t")])])])}),[],!1,null,"440aea22",null).exports;function H(e,n,t,i,r,a,o){try{var l=e[a](o),s=l.value}catch(e){return void t(e)}l.done?n(s):Promise.resolve(s).then(i,r)}function K(e){return function(){var n=this,t=arguments;return new Promise((function(i,r){var a=e.apply(n,t);function o(e){H(a,i,r,o,l,"next",e)}function l(e){H(a,i,r,o,l,"throw",e)}o(void 0)}))}}var J={name:"TemplatePicker",components:{EmptyContent:k(),Modal:E(),TemplatePreview:Q},props:{logger:{type:Object,required:!0}},data:function(){return{checked:-1,loading:!1,name:null,opened:!1,provider:null}},computed:{nameWithoutExt:function(){return this.name.indexOf(".")>-1?this.name.split(".").slice(0,-1).join("."):this.name},emptyTemplate:function(){var e,n;return{basename:t("files","Blank"),fileid:-1,filename:this.t("files","Blank"),hasPreview:!1,mime:(null===(e=this.provider)||void 0===e?void 0:e.mimetypes[0])||(null===(n=this.provider)||void 0===n?void 0:n.mimetypes)}},selectedTemplate:function(){var e=this;return this.provider.templates.find((function(n){return n.fileid===e.checked}))},style:function(){return{"--margin":"8px","--width":"160px","--border":"2px","--fullwidth":"180px","--height":this.provider.ratio?Math.round(160/this.provider.ratio)+"px":null}}},methods:{open:function(e,n){var t=this;return K(regeneratorRuntime.mark((function i(){var r,a;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return t.checked=t.emptyTemplate.fileid,t.name=e,t.provider=n,i.next=5,T();case 5:if(r=i.sent,null!==(a=r.find((function(e){return e.app===n.app&&e.label===n.label})))){i.next=9;break}throw new Error("Failed to match provider in results");case 9:if(t.provider=a,0!==a.templates.length){i.next=13;break}return t.onSubmit(),i.abrupt("return");case 13:t.opened=!0;case 14:case"end":return i.stop()}}),i)})))()},close:function(){this.checked=this.emptyTemplate.fileid,this.loading=!1,this.name=null,this.opened=!1,this.provider=null},onCheck:function(e){this.checked=e},onSubmit:function(){var e=this;return K(regeneratorRuntime.mark((function n(){var t,i,r,a,o,l,s,c,u,d,p,m;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return e.loading=!0,a=C(),o=null===(t=OCA)||void 0===t||null===(i=t.Files)||void 0===i||null===(r=i.App)||void 0===r?void 0:r.currentFileList,e.nameWithoutExt===e.name&&(e.logger.debug("Fixed invalid filename",{name:e.name,extension:null===(l=e.provider)||void 0===l?void 0:l.extension}),e.name=e.name+(null===(s=e.provider)||void 0===s?void 0:s.extension)),n.prev=4,n.next=7,F((0,w.normalize)("".concat(a,"/").concat(e.name)),null===(c=e.selectedTemplate)||void 0===c?void 0:c.filename,null===(u=e.selectedTemplate)||void 0===u?void 0:u.templateType);case 7:return d=n.sent,e.logger.debug("Created new file",d),n.next=11,null==o?void 0:o.addAndFetchFileInfo(e.name).then((function(e,n){return n}));case 11:p=n.sent,m=new OCA.Files.FileInfoModel(p,{filesClient:null==o?void 0:o.filesClient}),OCA.Files.fileActions.getDefaultFileAction(d.mime,"file",OC.PERMISSION_ALL).action(d.basename,{$file:null==o?void 0:o.findFileEl(e.name),dir:a,fileList:o,fileActions:null==o?void 0:o.fileActions,fileInfoModel:m}),e.close(),n.next=23;break;case 18:n.prev=18,n.t0=n.catch(4),e.logger.error("Error while creating the new file from template"),console.error(n.t0),(0,y.x2)(e.t("files","Unable to create new file from template"));case 23:return n.prev=23,e.loading=!1,n.finish(23);case 26:case"end":return n.stop()}}),n,null,[[4,18,23,26]])})))()}}},V=J,X=i(79097),ee={};ee.styleTagTransform=z(),ee.setAttributes=q(),ee.insert=L().bind(null,"head"),ee.domAPI=U(),ee.insertStyleElement=N(),M()(X.Z,ee),X.Z&&X.Z.locals&&X.Z.locals;var ne=(0,s.Z)(V,(function(){var e=this,n=e.$createElement,t=e._self._c||n;return e.opened?t("Modal",{staticClass:"templates-picker",attrs:{"clear-view-delay":-1,size:"normal"},on:{close:e.close}},[t("form",{staticClass:"templates-picker__form",style:e.style,on:{submit:function(n){return n.preventDefault(),n.stopPropagation(),e.onSubmit.apply(null,arguments)}}},[t("h2",[e._v(e._s(e.t("files","Pick a template for {name}",{name:e.nameWithoutExt})))]),e._v(" "),t("ul",{staticClass:"templates-picker__list"},[t("TemplatePreview",e._b({attrs:{checked:e.checked===e.emptyTemplate.fileid},on:{check:e.onCheck}},"TemplatePreview",e.emptyTemplate,!1)),e._v(" "),e._l(e.provider.templates,(function(n){return t("TemplatePreview",e._b({key:n.fileid,attrs:{checked:e.checked===n.fileid,ratio:e.provider.ratio},on:{check:e.onCheck}},"TemplatePreview",n,!1))}))],2),e._v(" "),t("div",{staticClass:"templates-picker__buttons"},[t("button",{on:{click:e.close}},[e._v("\n\t\t\t\t"+e._s(e.t("files","Cancel"))+"\n\t\t\t")]),e._v(" "),t("input",{staticClass:"primary",attrs:{type:"submit","aria-label":e.t("files","Create a new file with the selected template")},domProps:{value:e.t("files","Create")}})])]),e._v(" "),e.loading?t("EmptyContent",{staticClass:"templates-picker__loading",attrs:{icon:"icon-loading"}},[e._v("\n\t\t"+e._s(e.t("files","Creating file"))+"\n\t")]):e._e()],1):e._e()}),[],!1,null,"6784795c",null),te=ne.exports;function ie(e,n,t,i,r,a,o){try{var l=e[a](o),s=l.value}catch(e){return void t(e)}l.done?n(s):Promise.resolve(s).then(i,r)}var re=(0,f.IY)().setApp("files").detectUser().build();r.default.mixin({methods:{t:v.translate,n:v.translatePlural}});var ae=document.createElement("div");ae.id="template-picker",document.body.appendChild(ae);var oe=(0,A.loadState)("files","templates",[]),le=(0,A.loadState)("files","templates_path",!1);re.debug("Templates providers",oe),re.debug("Templates folder",{templatesPath:le});var se=new(r.default.extend(te))({name:"TemplatePicker",propsData:{logger:re}});se.$mount("#template-picker"),window.addEventListener("DOMContentLoaded",(function(){if(!le){re.debug("Templates folder not initialized");var e={attach:function(e){e.addMenuEntry({id:"template-init",displayName:(0,v.translate)("files","Set up templates folder"),templateName:(0,v.translate)("files","Templates"),iconClass:"icon-template-add",fileType:"file",actionHandler:function(n){ue(n),e.removeMenuEntry("template-init")}})}};OC.Plugins.register("OCA.Files.NewFileMenu",e)}})),oe.forEach((function(e,n){var t={attach:function(t){var i=t.fileList;"files"!==i.id&&"files.public"!==i.id||t.addMenuEntry({id:"template-new-".concat(e.app,"-").concat(n),displayName:e.label,templateName:e.label+e.extension,iconClass:e.iconClass||"icon-file",fileType:"file",actionHandler:function(n){se.open(n,e)}})}};OC.Plugins.register("OCA.Files.NewFileMenu",t)}));var ce,ue=function(){var e,n=(e=regeneratorRuntime.mark((function e(n){var t,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=(C()+"/".concat(n)).replace("//","/"),e.prev=1,re.debug("Initializing the templates directory",{templatePath:t}),e.next=5,b.default.post((0,h.generateOcsUrl)("apps/files/api/v1/templates/path"),{templatePath:t,copySystemTemplates:!0});case 5:i=e.sent,OCA.Files.App.currentFileList.changeDirectory(t,!0,!0),oe=i.data.ocs.data.templates,le=i.data.ocs.data.template_path,e.next=15;break;case 11:e.prev=11,e.t0=e.catch(1),re.error("Unable to initialize the templates directory"),(0,y.x2)((0,v.translate)("files","Unable to initialize the templates directory"));case 15:case"end":return e.stop()}}),e,null,[[1,11]])})),function(){var n=this,t=arguments;return new Promise((function(i,r){var a=e.apply(n,t);function o(e){ie(a,i,r,o,l,"next",e)}function l(e){ie(a,i,r,o,l,"throw",e)}o(void 0)}))});return function(e){return n.apply(this,arguments)}}(),de=i(74854);ce={attach:function(e){var n=this;(0,de.subscribe)("nextcloud:unified-search.search",(function(n){var t=n.query;e.setFilter(t)})),(0,de.subscribe)("nextcloud:unified-search.reset",(function(){n.query=null,e.setFilter("")}))}},window.OC.Plugins.register("OCA.Files.FileList",ce)},78299:function(e,n,t){var i=t(87537),r=t.n(i),a=t(23645),o=t.n(a)()(r());o.push([e.id,".template-picker__item[data-v-440aea22]{display:flex}.template-picker__label[data-v-440aea22]{display:flex;align-items:center;flex:1 1;flex-direction:column}.template-picker__label[data-v-440aea22],.template-picker__label *[data-v-440aea22]{cursor:pointer;user-select:none}.template-picker__label[data-v-440aea22]::before{display:none !important}.template-picker__preview[data-v-440aea22]{display:block;overflow:hidden;flex:1 1;width:var(--width);min-height:var(--height);max-height:var(--height);padding:0;border:var(--border) solid var(--color-border);border-radius:var(--border-radius-large)}input:checked+label>.template-picker__preview[data-v-440aea22]{border-color:var(--color-primary)}.template-picker__preview--failed[data-v-440aea22]{display:flex}.template-picker__image[data-v-440aea22]{max-width:100%;background-color:var(--color-main-background);object-fit:cover}.template-picker__preview--failed .template-picker__image[data-v-440aea22]{width:calc(var(--margin)*8);margin:auto;background-color:rgba(0,0,0,0) !important;object-fit:initial}.template-picker__title[data-v-440aea22]{overflow:hidden;max-width:calc(var(--width) + 4px);padding:var(--margin);white-space:nowrap;text-overflow:ellipsis}","",{version:3,sources:["webpack://./apps/files/src/components/TemplatePreview.vue"],names:[],mappings:"AAsJC,wCACC,YAAA,CAGD,yCACC,YAAA,CAEA,kBAAA,CACA,QAAA,CACA,qBAAA,CAEA,oFACC,cAAA,CACA,gBAAA,CAGD,iDACC,uBAAA,CAIF,2CACC,aAAA,CACA,eAAA,CAEA,QAAA,CACA,kBAAA,CACA,wBAAA,CACA,wBAAA,CACA,SAAA,CACA,8CAAA,CACA,wCAAA,CAEA,+DACC,iCAAA,CAGD,mDAEC,YAAA,CAIF,yCACC,cAAA,CACA,6CAAA,CAEA,gBAAA,CAID,2EACC,2BAAA,CAEA,WAAA,CACA,yCAAA,CAEA,kBAAA,CAGD,yCACC,eAAA,CAEA,kCAAA,CACA,qBAAA,CACA,kBAAA,CACA,sBAAA",sourcesContent:["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n.template-picker {\n\t&__item {\n\t\tdisplay: flex;\n\t}\n\n\t&__label {\n\t\tdisplay: flex;\n\t\t// Align in the middle of the grid\n\t\talign-items: center;\n\t\tflex: 1 1;\n\t\tflex-direction: column;\n\n\t\t&, * {\n\t\t\tcursor: pointer;\n\t\t\tuser-select: none;\n\t\t}\n\n\t\t&::before {\n\t\t\tdisplay: none !important;\n\t\t}\n\t}\n\n\t&__preview {\n\t\tdisplay: block;\n\t\toverflow: hidden;\n\t\t// Stretch so all entries are the same width\n\t\tflex: 1 1;\n\t\twidth: var(--width);\n\t\tmin-height: var(--height);\n\t\tmax-height: var(--height);\n\t\tpadding: 0;\n\t\tborder: var(--border) solid var(--color-border);\n\t\tborder-radius: var(--border-radius-large);\n\n\t\tinput:checked + label > & {\n\t\t\tborder-color: var(--color-primary);\n\t\t}\n\n\t\t&--failed {\n\t\t\t// Make sure to properly center fallback icon\n\t\t\tdisplay: flex;\n\t\t}\n\t}\n\n\t&__image {\n\t\tmax-width: 100%;\n\t\tbackground-color: var(--color-main-background);\n\n\t\tobject-fit: cover;\n\t}\n\n\t// Failed preview, fallback to mime icon\n\t&__preview--failed &__image {\n\t\twidth: calc(var(--margin) * 8);\n\t\t// Center mime icon\n\t\tmargin: auto;\n\t\tbackground-color: transparent !important;\n\n\t\tobject-fit: initial;\n\t}\n\n\t&__title {\n\t\toverflow: hidden;\n\t\t// also count preview border\n\t\tmax-width: calc(var(--width) + 2*2px);\n\t\tpadding: var(--margin);\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t}\n}\n\n"],sourceRoot:""}]),n.Z=o},79097:function(e,n,t){var i=t(87537),r=t.n(i),a=t(23645),o=t.n(a)()(r());o.push([e.id,".templates-picker__form[data-v-6784795c]{padding:calc(var(--margin)*2);padding-bottom:0}.templates-picker__form h2[data-v-6784795c]{text-align:center;font-weight:bold;margin:var(--margin) 0 calc(var(--margin)*2)}.templates-picker__list[data-v-6784795c]{display:grid;grid-gap:calc(var(--margin)*2);grid-auto-columns:1fr;max-width:calc(var(--fullwidth)*6);grid-template-columns:repeat(auto-fit, var(--fullwidth));grid-auto-rows:1fr;justify-content:center}.templates-picker__buttons[data-v-6784795c]{display:flex;justify-content:space-between;padding:calc(var(--margin)*2) var(--margin);position:sticky;bottom:0;background-image:linear-gradient(0, var(--gradient-main-background))}.templates-picker__buttons button[data-v-6784795c],.templates-picker__buttons input[type=submit][data-v-6784795c]{height:44px}.templates-picker[data-v-6784795c] .modal-container{position:relative}.templates-picker__loading[data-v-6784795c]{position:absolute;top:0;left:0;justify-content:center;width:100%;height:100%;margin:0;background-color:var(--color-main-background-translucent)}","",{version:3,sources:["webpack://./apps/files/src/views/TemplatePicker.vue"],names:[],mappings:"AAuPC,yCACC,6BAAA,CAEA,gBAAA,CAEA,4CACC,iBAAA,CACA,gBAAA,CACA,4CAAA,CAIF,yCACC,YAAA,CACA,8BAAA,CACA,qBAAA,CAEA,kCAAA,CACA,wDAAA,CAEA,kBAAA,CAEA,sBAAA,CAGD,4CACC,YAAA,CACA,6BAAA,CACA,2CAAA,CACA,eAAA,CACA,QAAA,CACA,oEAAA,CAEA,kHACC,WAAA,CAKF,qDACC,iBAAA,CAGD,4CACC,iBAAA,CACA,KAAA,CACA,MAAA,CACA,sBAAA,CACA,UAAA,CACA,WAAA,CACA,QAAA,CACA,yDAAA",sourcesContent:["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n.templates-picker {\n\t&__form {\n\t\tpadding: calc(var(--margin) * 2);\n\t\t// Will be handled by the buttons\n\t\tpadding-bottom: 0;\n\n\t\th2 {\n\t\t\ttext-align: center;\n\t\t\tfont-weight: bold;\n\t\t\tmargin: var(--margin) 0 calc(var(--margin) * 2);\n\t\t}\n\t}\n\n\t&__list {\n\t\tdisplay: grid;\n\t\tgrid-gap: calc(var(--margin) * 2);\n\t\tgrid-auto-columns: 1fr;\n\t\t// We want maximum 5 columns. Putting 6 as we don't count the grid gap. So it will always be lower than 6\n\t\tmax-width: calc(var(--fullwidth) * 6);\n\t\tgrid-template-columns: repeat(auto-fit, var(--fullwidth));\n\t\t// Make sure all rows are the same height\n\t\tgrid-auto-rows: 1fr;\n\t\t// Center the columns set\n\t\tjustify-content: center;\n\t}\n\n\t&__buttons {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t\tpadding: calc(var(--margin) * 2) var(--margin);\n\t\tposition: sticky;\n\t\tbottom: 0;\n\t\tbackground-image: linear-gradient(0, var(--gradient-main-background));\n\n\t\tbutton, input[type='submit'] {\n\t\t\theight: 44px;\n\t\t}\n\t}\n\n\t// Make sure we're relative for the loading emptycontent on top\n\t::v-deep .modal-container {\n\t\tposition: relative;\n\t}\n\n\t&__loading {\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tjustify-content: center;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tmargin: 0;\n\t\tbackground-color: var(--color-main-background-translucent);\n\t}\n}\n\n"],sourceRoot:""}]),n.Z=o}},i={};function r(e){var t=i[e];if(void 0!==t)return t.exports;var a=i[e]={id:e,loaded:!1,exports:{}};return n[e].call(a.exports,a,a.exports,r),a.loaded=!0,a.exports}r.m=n,r.amdD=function(){throw new Error("define cannot be used indirect")},r.amdO={},e=[],r.O=function(n,t,i,a){if(!t){var o=1/0;for(u=0;u<e.length;u++){t=e[u][0],i=e[u][1],a=e[u][2];for(var l=!0,s=0;s<t.length;s++)(!1&a||o>=a)&&Object.keys(r.O).every((function(e){return r.O[e](t[s])}))?t.splice(s--,1):(l=!1,a<o&&(o=a));if(l){e.splice(u--,1);var c=i();void 0!==c&&(n=c)}}return n}a=a||0;for(var u=e.length;u>0&&e[u-1][2]>a;u--)e[u]=e[u-1];e[u]=[t,i,a]},r.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(n,{a:n}),n},r.d=function(e,n){for(var t in n)r.o(n,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},r.j=2181,function(){r.b=document.baseURI||self.location.href;var e={2181:0};r.O.j=function(n){return 0===e[n]};var n=function(n,t){var i,a,o=t[0],l=t[1],s=t[2],c=0;if(o.some((function(n){return 0!==e[n]}))){for(i in l)r.o(l,i)&&(r.m[i]=l[i]);if(s)var u=s(r)}for(n&&n(t);c<o.length;c++)a=o[c],r.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return r.O(u)},t=self.webpackChunknextcloud=self.webpackChunknextcloud||[];t.forEach(n.bind(null,0)),t.push=n.bind(null,t.push.bind(t))}();var a=r.O(void 0,[7874],(function(){return r(58949)}));a=r.O(a)}();
+//# sourceMappingURL=files-main.js.map?v=efe38dd3d30fcb0b616d \ No newline at end of file
diff --git a/dist/files-main.js.map b/dist/files-main.js.map
index f3c74362044..566e0fed0e1 100644
--- a/dist/files-main.js.map
+++ b/dist/files-main.js.map
@@ -1 +1 @@
-{"version":3,"file":"files-main.js?v=c50f191b5e27d29bae80","mappings":";6BAAIA,oNCsBiBC,EAAAA,WAIpB,kHAAc,qIACbC,KAAKC,UAAY,GACjBC,QAAQC,MAAM,+EAUf,SAASC,GACR,OAAIJ,KAAKC,UAAUI,QAAO,SAAAC,GAAC,OAAIA,EAAEC,OAASH,EAAKG,QAAMC,OAAS,GAC7DN,QAAQO,MAAM,uDACP,IAERT,KAAKC,UAAUS,KAAKN,IACb,yBAQR,WACC,OAAOJ,KAAKC,q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ud/webpack/runtime/chunk loaded","webpack:///nextcloud/apps/files/src/services/Settings.js","webpack:///nextcloud/apps/files/src/components/Setting.vue?vue&type=script&lang=js&","webpack:///nextcloud/apps/files/src/components/Setting.vue","webpack:///nextcloud/apps/files/src/views/Settings.vue?vue&type=script&lang=js&","webpack:///nextcloud/apps/files/src/views/Settings.vue","webpack://nextcloud/./apps/files/src/components/Setting.vue?98ea","webpack:///nextcloud/apps/files/src/components/Setting.vue?vue&type=template&id=47cd8aa6&","webpack://nextcloud/./apps/files/src/views/Settings.vue?b81b","webpack:///nextcloud/apps/files/src/views/Settings.vue?vue&type=template&id=31c9bb4b&scoped=true&","webpack:///nextcloud/apps/files/src/models/Setting.js","webpack:///nextcloud/apps/files/src/files-app-settings.js","webpack:///nextcloud/apps/files/src/utils/davUtils.js","webpack:///nextcloud/apps/files/src/services/Templates.js","webpack:///nextcloud/apps/files/src/components/TemplatePreview.vue","webpack:///nextcloud/apps/files/src/utils/fileUtils.js","webpack:///nextcloud/apps/files/src/components/TemplatePreview.vue?vue&type=script&lang=js&","webpack://nextcloud/./apps/files/src/components/TemplatePreview.vue?ab98","webpack://nextcloud/./apps/files/src/components/TemplatePreview.vue?81db","webpack:///nextcloud/apps/files/src/components/TemplatePreview.vue?vue&type=template&id=440aea22&scoped=true&","webpack:///nextcloud/apps/files/src/views/TemplatePicker.vue","webpack:///nextcloud/apps/files/src/views/TemplatePicker.vue?vue&type=script&lang=js&","webpack://nextcloud/./apps/files/src/views/TemplatePicker.vue?d2b0","webpack://nextcloud/./apps/files/src/views/TemplatePicker.vue?afd8","webpack:///nextcloud/apps/files/src/views/TemplatePicker.vue?vue&type=template&id=278f6b79&scoped=true&","webpack:///nextcloud/apps/files/src/templates.js","webpack:///nextcloud/apps/files/src/legacy/filelistSearch.js","webpack:///nextcloud/apps/files/src/components/TemplatePreview.vue?vue&type=style&index=0&id=440aea22&lang=scss&scoped=true&","webpack:///nextcloud/apps/files/src/views/TemplatePicker.vue?vue&type=style&index=0&id=278f6b79&lang=scss&scoped=true&","webpack:///nextcloud/webpack/bootstrap","webpack:///nextcloud/webpack/runtime/amd define","webpack:///nextcloud/webpack/runtime/amd options","webpack:///nextcloud/webpack/runtime/compat get default export","webpack:///nextcloud/webpack/runtime/define property getters","webpack:///nextcloud/webpack/runtime/global","webpack:///nextcloud/webpack/runtime/hasOwnProperty shorthand","webpack:///nextcloud/webpack/runtime/make namespace object","webpack:///nextcloud/webpack/runtime/node module decorator","webpack:///nextcloud/webpack/runtime/runtimeId","webpack:///nextcloud/webpack/runtime/jsonp chunk loading","webpack:///nextcloud/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = function(result, chunkIds, fn, priority) {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every(function(key) { return __webpack_require__.O[key](chunkIds[j]); })) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","/**\n * @copyright Copyright (c) 2019 Gary Kim <gary@garykim.dev>\n *\n * @author Gary Kim <gary@garykim.dev>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\nexport default class Settings {\n\n\t_settings\n\n\tconstructor() {\n\t\tthis._settings = []\n\t\tconsole.debug('OCA.Files.Settings initialized')\n\t}\n\n\t/**\n\t * Register a new setting\n\t *\n\t * @since 19.0.0\n\t * @param {OCA.Files.Settings.Setting} view element to add to settings\n\t * @return {boolean} whether registering was successful\n\t */\n\tregister(view) {\n\t\tif (this._settings.filter(e => e.name === view.name).length > 0) {\n\t\t\tconsole.error('A setting with the same name is already registered')\n\t\t\treturn false\n\t\t}\n\t\tthis._settings.push(view)\n\t\treturn true\n\t}\n\n\t/**\n\t * All settings elements\n\t *\n\t * @return {OCA.Files.Settings.Setting[]} All currently registered settings\n\t */\n\tget settings() {\n\t\treturn this._settings\n\t}\n\n}\n","import mod from \"-!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Setting.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Setting.vue?vue&type=script&lang=js&\"","<!--\n - @copyright Copyright (c) 2020 Gary Kim <gary@garykim.dev>\n -\n - @author Gary Kim <gary@garykim.dev>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n\n<template>\n\t<div />\n</template>\n<script>\nexport default {\n\tname: 'Setting',\n\tprops: {\n\t\tel: {\n\t\t\ttype: Function,\n\t\t\trequired: true,\n\t\t},\n\t},\n\tmounted() {\n\t\tthis.$el.appendChild(this.el())\n\t},\n}\n</script>\n<style>\n</style>\n","import mod from \"-!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Settings.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Settings.vue?vue&type=script&lang=js&\"","<!--\n - @copyright Copyright (c) 2019 Gary Kim <gary@garykim.dev>\n -\n - @author Gary Kim <gary@garykim.dev>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n<template>\n\t<div id=\"files-app-extra-settings\">\n\t\t<template v-for=\"setting in settings\">\n\t\t\t<Setting :key=\"setting.name\" :el=\"setting.el\" />\n\t\t</template>\n\t</div>\n</template>\n\n<script>\nimport Setting from '../components/Setting'\n\nexport default {\n\tname: 'Settings',\n\tcomponents: {\n\t\tSetting,\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tsettings: OCA.Files.Settings.settings,\n\t\t}\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n\n</style>\n","import { render, staticRenderFns } from \"./Setting.vue?vue&type=template&id=47cd8aa6&\"\nimport script from \"./Setting.vue?vue&type=script&lang=js&\"\nexport * from \"./Setting.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div')}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import { render, staticRenderFns } from \"./Settings.vue?vue&type=template&id=31c9bb4b&scoped=true&\"\nimport script from \"./Settings.vue?vue&type=script&lang=js&\"\nexport * from \"./Settings.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"31c9bb4b\",\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{\"id\":\"files-app-extra-settings\"}},[_vm._l((_vm.settings),function(setting){return [_c('Setting',{key:setting.name,attrs:{\"el\":setting.el}})]})],2)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","/**\n * @copyright Copyright (c) 2019 Gary Kim <gary@garykim.dev>\n * @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @author Gary Kim <gary@garykim.dev>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\nexport default class Setting {\n\n\t_close\n\t_el\n\t_name\n\t_open\n\n\t/**\n\t * Create a new files app setting\n\t *\n\t * @since 19.0.0\n\t * @param {string} name the name of this setting\n\t * @param {object} component the component\n\t * @param {Function} component.el function that returns an unmounted dom element to be added\n\t * @param {Function} [component.open] callback for when setting is added\n\t * @param {Function} [component.close] callback for when setting is closed\n\t */\n\tconstructor(name, { el, open, close }) {\n\t\tthis._name = name\n\t\tthis._el = el\n\t\tthis._open = open\n\t\tthis._close = close\n\n\t\tif (typeof this._open !== 'function') {\n\t\t\tthis._open = () => {}\n\t\t}\n\n\t\tif (typeof this._close !== 'function') {\n\t\t\tthis._close = () => {}\n\t\t}\n\t}\n\n\tget name() {\n\t\treturn this._name\n\t}\n\n\tget el() {\n\t\treturn this._el\n\t}\n\n\tget open() {\n\t\treturn this._open\n\t}\n\n\tget close() {\n\t\treturn this._close\n\t}\n\n}\n","/**\n * @copyright Copyright (c) 2019 Gary Kim <gary@garykim.dev>\n * @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @author Gary Kim <gary@garykim.dev>\n * @author John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\nimport Vue from 'vue'\nimport Settings from './services/Settings'\nimport SettingsView from './views/Settings'\nimport Setting from './models/Setting'\n\nVue.prototype.t = t\n\n// Init Files App Settings Service\nif (!window.OCA.Files) {\n\twindow.OCA.Files = {}\n}\nObject.assign(window.OCA.Files, { Settings: new Settings() })\nObject.assign(window.OCA.Files.Settings, { Setting })\n\nwindow.addEventListener('DOMContentLoaded', function() {\n\tif (window.TESTING) {\n\t\treturn\n\t}\n\t// Init Vue app\n\t// eslint-disable-next-line\n\tnew Vue({\n\t\tel: '#files-app-settings',\n\t\trender: h => h(SettingsView),\n\t})\n\n\tconst appSettingsHeader = document.getElementById('app-settings-header')\n\tif (appSettingsHeader) {\n\t\tappSettingsHeader.addEventListener('click', e => {\n\t\t\tconst opened = e.currentTarget.children[0].classList.contains('opened')\n\t\t\tOCA.Files.Settings.settings.forEach(e => opened ? e.close() : e.open())\n\t\t})\n\t}\n})\n","/**\n * @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @author John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\nimport { generateRemoteUrl } from '@nextcloud/router'\nimport { getCurrentUser } from '@nextcloud/auth'\n\nexport const getRootPath = function() {\n\tif (getCurrentUser()) {\n\t\treturn generateRemoteUrl(`dav/files/${getCurrentUser().uid}`)\n\t} else {\n\t\treturn generateRemoteUrl('webdav').replace('/remote.php', '/public.php')\n\t}\n}\n\nexport const isPublic = function() {\n\treturn !getCurrentUser()\n}\n\nexport const getToken = function() {\n\treturn document.getElementById('sharingToken') && document.getElementById('sharingToken').value\n}\n\n/**\n * Return the current directory, fallback to root\n *\n * @return {string}\n */\nexport const getCurrentDirectory = function() {\n\tconst currentDirInfo = OCA?.Files?.App?.currentFileList?.dirInfo\n\t\t|| { path: '/', name: '' }\n\n\t// Make sure we don't have double slashes\n\treturn `${currentDirInfo.path}/${currentDirInfo.name}`.replace(/\\/\\//gi, '/')\n}\n","/**\n * @copyright Copyright (c) 2021 John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @author John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\nimport { generateOcsUrl } from '@nextcloud/router'\nimport axios from '@nextcloud/axios'\n\nexport const getTemplates = async function() {\n\tconst response = await axios.get(generateOcsUrl('apps/files/api/v1/templates'))\n\treturn response.data.ocs.data\n}\n\n/**\n * Create a new file from a specified template\n *\n * @param {string} filePath The new file destination path\n * @param {string} templatePath The template source path\n * @param {string} templateType The template type e.g 'user'\n */\nexport const createFromTemplate = async function(filePath, templatePath, templateType) {\n\tconst response = await axios.post(generateOcsUrl('apps/files/api/v1/templates/create'), {\n\t\tfilePath,\n\t\ttemplatePath,\n\t\ttemplateType,\n\t})\n\treturn response.data.ocs.data\n}\n","<!--\n - @copyright Copyright (c) 2020 John Molakvoæ <skjnldsv@protonmail.com>\n -\n - @author John Molakvoæ <skjnldsv@protonmail.com>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n\n<template>\n\t<li class=\"template-picker__item\">\n\t\t<input :id=\"id\"\n\t\t\t:checked=\"checked\"\n\t\t\ttype=\"radio\"\n\t\t\tclass=\"radio\"\n\t\t\tname=\"template-picker\"\n\t\t\t@change=\"onCheck\">\n\n\t\t<label :for=\"id\" class=\"template-picker__label\">\n\t\t\t<div class=\"template-picker__preview\"\n\t\t\t\t:class=\"failedPreview ? 'template-picker__preview--failed' : ''\">\n\t\t\t\t<img class=\"template-picker__image\"\n\t\t\t\t\t:src=\"realPreviewUrl\"\n\t\t\t\t\talt=\"\"\n\t\t\t\t\tdraggable=\"false\"\n\t\t\t\t\t@error=\"onFailure\">\n\t\t\t</div>\n\n\t\t\t<span class=\"template-picker__title\">\n\t\t\t\t{{ nameWithoutExt }}\n\t\t\t</span>\n\t\t</label>\n\t</li>\n</template>\n\n<script>\nimport { generateUrl } from '@nextcloud/router'\nimport { encodeFilePath } from '../utils/fileUtils'\nimport { getToken, isPublic } from '../utils/davUtils'\n\n// preview width generation\nconst previewWidth = 256\n\nexport default {\n\tname: 'TemplatePreview',\n\tinheritAttrs: false,\n\n\tprops: {\n\t\tbasename: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\tchecked: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\tfileid: {\n\t\t\ttype: [String, Number],\n\t\t\trequired: true,\n\t\t},\n\t\tfilename: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\tpreviewUrl: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\t\thasPreview: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\t\tmime: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\tratio: {\n\t\t\ttype: Number,\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tfailedPreview: false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * Strip away extension from name\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\tnameWithoutExt() {\n\t\t\treturn this.basename.indexOf('.') > -1 ? this.basename.split('.').slice(0, -1).join('.') : this.basename\n\t\t},\n\n\t\tid() {\n\t\t\treturn `template-picker-${this.fileid}`\n\t\t},\n\n\t\trealPreviewUrl() {\n\t\t\t// If original preview failed, fallback to mime icon\n\t\t\tif (this.failedPreview && this.mimeIcon) {\n\t\t\t\treturn this.mimeIcon\n\t\t\t}\n\n\t\t\tif (this.previewUrl) {\n\t\t\t\treturn this.previewUrl\n\t\t\t}\n\t\t\t// TODO: find a nicer standard way of doing this?\n\t\t\tif (isPublic()) {\n\t\t\t\treturn generateUrl(`/apps/files_sharing/publicpreview/${getToken()}?fileId=${this.fileid}&file=${encodeFilePath(this.filename)}&x=${previewWidth}&y=${previewWidth}&a=1`)\n\t\t\t}\n\t\t\treturn generateUrl(`/core/preview?fileId=${this.fileid}&x=${previewWidth}&y=${previewWidth}&a=1`)\n\t\t},\n\n\t\tmimeIcon() {\n\t\t\treturn OC.MimeType.getIconUrl(this.mime)\n\t\t},\n\t},\n\n\tmethods: {\n\t\tonCheck() {\n\t\t\tthis.$emit('check', this.fileid)\n\t\t},\n\t\tonFailure() {\n\t\t\tthis.failedPreview = true\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n\n.template-picker {\n\t&__item {\n\t\tdisplay: flex;\n\t}\n\n\t&__label {\n\t\tdisplay: flex;\n\t\t// Align in the middle of the grid\n\t\talign-items: center;\n\t\tflex: 1 1;\n\t\tflex-direction: column;\n\n\t\t&, * {\n\t\t\tcursor: pointer;\n\t\t\tuser-select: none;\n\t\t}\n\n\t\t&::before {\n\t\t\tdisplay: none !important;\n\t\t}\n\t}\n\n\t&__preview {\n\t\tdisplay: block;\n\t\toverflow: hidden;\n\t\t// Stretch so all entries are the same width\n\t\tflex: 1 1;\n\t\twidth: var(--width);\n\t\tmin-height: var(--height);\n\t\tmax-height: var(--height);\n\t\tpadding: 0;\n\t\tborder: var(--border) solid var(--color-border);\n\t\tborder-radius: var(--border-radius-large);\n\n\t\tinput:checked + label > & {\n\t\t\tborder-color: var(--color-primary);\n\t\t}\n\n\t\t&--failed {\n\t\t\t// Make sure to properly center fallback icon\n\t\t\tdisplay: flex;\n\t\t}\n\t}\n\n\t&__image {\n\t\tmax-width: 100%;\n\t\tbackground-color: var(--color-main-background);\n\n\t\tobject-fit: cover;\n\t}\n\n\t// Failed preview, fallback to mime icon\n\t&__preview--failed &__image {\n\t\twidth: calc(var(--margin) * 8);\n\t\t// Center mime icon\n\t\tmargin: auto;\n\t\tbackground-color: transparent !important;\n\n\t\tobject-fit: initial;\n\t}\n\n\t&__title {\n\t\toverflow: hidden;\n\t\t// also count preview border\n\t\tmax-width: calc(var(--width) + 2*2px);\n\t\tpadding: var(--margin);\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t}\n}\n\n</style>\n","/**\n * @copyright Copyright (c) 2021 John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @author John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\nconst encodeFilePath = function(path) {\n\tconst pathSections = (path.startsWith('/') ? path : `/${path}`).split('/')\n\tlet relativePath = ''\n\tpathSections.forEach((section) => {\n\t\tif (section !== '') {\n\t\t\trelativePath += '/' + encodeURIComponent(section)\n\t\t}\n\t})\n\treturn relativePath\n}\n\n/**\n * Extract dir and name from file path\n *\n * @param {string} path the full path\n * @return {string[]} [dirPath, fileName]\n */\nconst extractFilePaths = function(path) {\n\tconst pathSections = path.split('/')\n\tconst fileName = pathSections[pathSections.length - 1]\n\tconst dirPath = pathSections.slice(0, pathSections.length - 1).join('/')\n\treturn [dirPath, fileName]\n}\n\nexport { encodeFilePath, extractFilePaths }\n","import mod from \"-!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./TemplatePreview.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./TemplatePreview.vue?vue&type=script&lang=js&\"","\n import API from \"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/sass-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./TemplatePreview.vue?vue&type=style&index=0&id=440aea22&lang=scss&scoped=true&\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/sass-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./TemplatePreview.vue?vue&type=style&index=0&id=440aea22&lang=scss&scoped=true&\";\n export default content && content.locals ? content.locals : undefined;\n","import { render, staticRenderFns } from \"./TemplatePreview.vue?vue&type=template&id=440aea22&scoped=true&\"\nimport script from \"./TemplatePreview.vue?vue&type=script&lang=js&\"\nexport * from \"./TemplatePreview.vue?vue&type=script&lang=js&\"\nimport style0 from \"./TemplatePreview.vue?vue&type=style&index=0&id=440aea22&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"440aea22\",\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('li',{staticClass:\"template-picker__item\"},[_c('input',{staticClass:\"radio\",attrs:{\"id\":_vm.id,\"type\":\"radio\",\"name\":\"template-picker\"},domProps:{\"checked\":_vm.checked},on:{\"change\":_vm.onCheck}}),_vm._v(\" \"),_c('label',{staticClass:\"template-picker__label\",attrs:{\"for\":_vm.id}},[_c('div',{staticClass:\"template-picker__preview\",class:_vm.failedPreview ? 'template-picker__preview--failed' : ''},[_c('img',{staticClass:\"template-picker__image\",attrs:{\"src\":_vm.realPreviewUrl,\"alt\":\"\",\"draggable\":\"false\"},on:{\"error\":_vm.onFailure}})]),_vm._v(\" \"),_c('span',{staticClass:\"template-picker__title\"},[_vm._v(\"\\n\\t\\t\\t\"+_vm._s(_vm.nameWithoutExt)+\"\\n\\t\\t\")])])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<!--\n - @copyright Copyright (c) 2020 John Molakvoæ <skjnldsv@protonmail.com>\n -\n - @author John Molakvoæ <skjnldsv@protonmail.com>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n\n<template>\n\t<Modal v-if=\"opened\"\n\t\t:clear-view-delay=\"-1\"\n\t\tclass=\"templates-picker\"\n\t\tsize=\"large\"\n\t\t@close=\"close\">\n\t\t<form class=\"templates-picker__form\"\n\t\t\t:style=\"style\"\n\t\t\t@submit.prevent.stop=\"onSubmit\">\n\t\t\t<h2>{{ t('files', 'Pick a template for {name}', { name: nameWithoutExt }) }}</h2>\n\n\t\t\t<!-- Templates list -->\n\t\t\t<ul class=\"templates-picker__list\">\n\t\t\t\t<TemplatePreview v-bind=\"emptyTemplate\"\n\t\t\t\t\t:checked=\"checked === emptyTemplate.fileid\"\n\t\t\t\t\t@check=\"onCheck\" />\n\n\t\t\t\t<TemplatePreview v-for=\"template in provider.templates\"\n\t\t\t\t\t:key=\"template.fileid\"\n\t\t\t\t\tv-bind=\"template\"\n\t\t\t\t\t:checked=\"checked === template.fileid\"\n\t\t\t\t\t:ratio=\"provider.ratio\"\n\t\t\t\t\t@check=\"onCheck\" />\n\t\t\t</ul>\n\n\t\t\t<!-- Cancel and submit -->\n\t\t\t<div class=\"templates-picker__buttons\">\n\t\t\t\t<button @click=\"close\">\n\t\t\t\t\t{{ t('files', 'Cancel') }}\n\t\t\t\t</button>\n\t\t\t\t<input type=\"submit\"\n\t\t\t\t\tclass=\"primary\"\n\t\t\t\t\t:value=\"t('files', 'Create')\"\n\t\t\t\t\t:aria-label=\"t('files', 'Create a new file with the selected template')\">\n\t\t\t</div>\n\t\t</form>\n\n\t\t<EmptyContent v-if=\"loading\" class=\"templates-picker__loading\" icon=\"icon-loading\">\n\t\t\t{{ t('files', 'Creating file') }}\n\t\t</EmptyContent>\n\t</Modal>\n</template>\n\n<script>\nimport { normalize } from 'path'\nimport { showError } from '@nextcloud/dialogs'\nimport EmptyContent from '@nextcloud/vue/dist/Components/EmptyContent'\nimport Modal from '@nextcloud/vue/dist/Components/Modal'\n\nimport { getCurrentDirectory } from '../utils/davUtils'\nimport { createFromTemplate, getTemplates } from '../services/Templates'\nimport TemplatePreview from '../components/TemplatePreview'\n\nconst border = 2\nconst margin = 8\nconst width = margin * 20\n\nexport default {\n\tname: 'TemplatePicker',\n\n\tcomponents: {\n\t\tEmptyContent,\n\t\tModal,\n\t\tTemplatePreview,\n\t},\n\n\tprops: {\n\t\tlogger: {\n\t\t\ttype: Object,\n\t\t\trequired: true,\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\t// Check empty template by default\n\t\t\tchecked: -1,\n\t\t\tloading: false,\n\t\t\tname: null,\n\t\t\topened: false,\n\t\t\tprovider: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * Strip away extension from name\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\tnameWithoutExt() {\n\t\t\treturn this.name.indexOf('.') > -1\n\t\t\t\t? this.name.split('.').slice(0, -1).join('.')\n\t\t\t\t: this.name\n\t\t},\n\n\t\temptyTemplate() {\n\t\t\treturn {\n\t\t\t\tbasename: t('files', 'Blank'),\n\t\t\t\tfileid: -1,\n\t\t\t\tfilename: this.t('files', 'Blank'),\n\t\t\t\thasPreview: false,\n\t\t\t\tmime: this.provider?.mimetypes[0] || this.provider?.mimetypes,\n\t\t\t}\n\t\t},\n\n\t\tselectedTemplate() {\n\t\t\treturn this.provider.templates.find(template => template.fileid === this.checked)\n\t\t},\n\n\t\t/**\n\t\t * Style css vars bin,d\n\t\t *\n\t\t * @return {object}\n\t\t */\n\t\tstyle() {\n\t\t\treturn {\n\t\t\t\t'--margin': margin + 'px',\n\t\t\t\t'--width': width + 'px',\n\t\t\t\t'--border': border + 'px',\n\t\t\t\t'--fullwidth': width + 2 * margin + 2 * border + 'px',\n\t\t\t\t'--height': this.provider.ratio ? Math.round(width / this.provider.ratio) + 'px' : null,\n\t\t\t}\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Open the picker\n\t\t *\n\t\t * @param {string} name the file name to create\n\t\t * @param {object} provider the template provider picked\n\t\t */\n\t\tasync open(name, provider) {\n\n\t\t\tthis.checked = this.emptyTemplate.fileid\n\t\t\tthis.name = name\n\t\t\tthis.provider = provider\n\n\t\t\tconst templates = await getTemplates()\n\t\t\tconst fetchedProvider = templates.find((fetchedProvider) => fetchedProvider.app === provider.app && fetchedProvider.label === provider.label)\n\t\t\tif (fetchedProvider === null) {\n\t\t\t\tthrow new Error('Failed to match provider in results')\n\t\t\t}\n\t\t\tthis.provider = fetchedProvider\n\n\t\t\t// If there is no templates available, just create an empty file\n\t\t\tif (fetchedProvider.templates.length === 0) {\n\t\t\t\tthis.onSubmit()\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Else, open the picker\n\t\t\tthis.opened = true\n\t\t},\n\n\t\t/**\n\t\t * Close the picker and reset variables\n\t\t */\n\t\tclose() {\n\t\t\tthis.checked = this.emptyTemplate.fileid\n\t\t\tthis.loading = false\n\t\t\tthis.name = null\n\t\t\tthis.opened = false\n\t\t\tthis.provider = null\n\t\t},\n\n\t\t/**\n\t\t * Manages the radio template picker change\n\t\t *\n\t\t * @param {number} fileid the selected template file id\n\t\t */\n\t\tonCheck(fileid) {\n\t\t\tthis.checked = fileid\n\t\t},\n\n\t\tasync onSubmit() {\n\t\t\tthis.loading = true\n\t\t\tconst currentDirectory = getCurrentDirectory()\n\t\t\tconst fileList = OCA?.Files?.App?.currentFileList\n\n\t\t\t// If the file doesn't have an extension, add the default one\n\t\t\tif (this.nameWithoutExt === this.name) {\n\t\t\t\tthis.logger.debug('Fixed invalid filename', { name: this.name, extension: this.provider?.extension })\n\t\t\t\tthis.name = this.name + this.provider?.extension\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tconst fileInfo = await createFromTemplate(\n\t\t\t\t\tnormalize(`${currentDirectory}/${this.name}`),\n\t\t\t\t\tthis.selectedTemplate?.filename,\n\t\t\t\t\tthis.selectedTemplate?.templateType,\n\t\t\t\t)\n\t\t\t\tthis.logger.debug('Created new file', fileInfo)\n\n\t\t\t\tconst data = await fileList?.addAndFetchFileInfo(this.name).then((status, data) => data)\n\n\t\t\t\tconst model = new OCA.Files.FileInfoModel(data, {\n\t\t\t\t\tfilesClient: fileList?.filesClient,\n\t\t\t\t})\n\t\t\t\t// Run default action\n\t\t\t\tconst fileAction = OCA.Files.fileActions.getDefaultFileAction(fileInfo.mime, 'file', OC.PERMISSION_ALL)\n\t\t\t\tfileAction.action(fileInfo.basename, {\n\t\t\t\t\t$file: fileList?.findFileEl(this.name),\n\t\t\t\t\tdir: currentDirectory,\n\t\t\t\t\tfileList,\n\t\t\t\t\tfileActions: fileList?.fileActions,\n\t\t\t\t\tfileInfoModel: model,\n\t\t\t\t})\n\n\t\t\t\tthis.close()\n\t\t\t} catch (error) {\n\t\t\t\tthis.logger.error('Error while creating the new file from template')\n\t\t\t\tconsole.error(error)\n\t\t\t\tshowError(this.t('files', 'Unable to create new file from template'))\n\t\t\t} finally {\n\t\t\t\tthis.loading = false\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.templates-picker {\n\t&__form {\n\t\tpadding: calc(var(--margin) * 2);\n\t\t// Will be handled by the buttons\n\t\tpadding-bottom: 0;\n\n\t\th2 {\n\t\t\ttext-align: center;\n\t\t\tfont-weight: bold;\n\t\t\tmargin: var(--margin) 0 calc(var(--margin) * 2);\n\t\t}\n\t}\n\n\t&__list {\n\t\tdisplay: grid;\n\t\tgrid-gap: calc(var(--margin) * 2);\n\t\tgrid-auto-columns: 1fr;\n\t\t// We want maximum 5 columns. Putting 6 as we don't count the grid gap. So it will always be lower than 6\n\t\tmax-width: calc(var(--fullwidth) * 6);\n\t\tgrid-template-columns: repeat(auto-fit, var(--fullwidth));\n\t\t// Make sure all rows are the same height\n\t\tgrid-auto-rows: 1fr;\n\t\t// Center the columns set\n\t\tjustify-content: center;\n\t}\n\n\t&__buttons {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t\tpadding: calc(var(--margin) * 2) var(--margin);\n\t\tposition: sticky;\n\t\tbottom: 0;\n\t\tbackground-image: linear-gradient(0, var(--gradient-main-background));\n\n\t\tbutton, input[type='submit'] {\n\t\t\theight: 44px;\n\t\t}\n\t}\n\n\t// Make sure we're relative for the loading emptycontent on top\n\t::v-deep .modal-container {\n\t\tposition: relative;\n\t\theight: fit-content;\n\t}\n\n\t&__loading {\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tjustify-content: center;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tmargin: 0;\n\t\tbackground-color: var(--color-main-background-translucent);\n\t}\n}\n\n</style>\n","import mod from \"-!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./TemplatePicker.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./TemplatePicker.vue?vue&type=script&lang=js&\"","\n import API from \"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/sass-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./TemplatePicker.vue?vue&type=style&index=0&id=278f6b79&lang=scss&scoped=true&\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/sass-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./TemplatePicker.vue?vue&type=style&index=0&id=278f6b79&lang=scss&scoped=true&\";\n export default content && content.locals ? content.locals : undefined;\n","import { render, staticRenderFns } from \"./TemplatePicker.vue?vue&type=template&id=278f6b79&scoped=true&\"\nimport script from \"./TemplatePicker.vue?vue&type=script&lang=js&\"\nexport * from \"./TemplatePicker.vue?vue&type=script&lang=js&\"\nimport style0 from \"./TemplatePicker.vue?vue&type=style&index=0&id=278f6b79&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"278f6b79\",\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.opened)?_c('Modal',{staticClass:\"templates-picker\",attrs:{\"clear-view-delay\":-1,\"size\":\"large\"},on:{\"close\":_vm.close}},[_c('form',{staticClass:\"templates-picker__form\",style:(_vm.style),on:{\"submit\":function($event){$event.preventDefault();$event.stopPropagation();return _vm.onSubmit.apply(null, arguments)}}},[_c('h2',[_vm._v(_vm._s(_vm.t('files', 'Pick a template for {name}', { name: _vm.nameWithoutExt })))]),_vm._v(\" \"),_c('ul',{staticClass:\"templates-picker__list\"},[_c('TemplatePreview',_vm._b({attrs:{\"checked\":_vm.checked === _vm.emptyTemplate.fileid},on:{\"check\":_vm.onCheck}},'TemplatePreview',_vm.emptyTemplate,false)),_vm._v(\" \"),_vm._l((_vm.provider.templates),function(template){return _c('TemplatePreview',_vm._b({key:template.fileid,attrs:{\"checked\":_vm.checked === template.fileid,\"ratio\":_vm.provider.ratio},on:{\"check\":_vm.onCheck}},'TemplatePreview',template,false))})],2),_vm._v(\" \"),_c('div',{staticClass:\"templates-picker__buttons\"},[_c('button',{on:{\"click\":_vm.close}},[_vm._v(\"\\n\\t\\t\\t\\t\"+_vm._s(_vm.t('files', 'Cancel'))+\"\\n\\t\\t\\t\")]),_vm._v(\" \"),_c('input',{staticClass:\"primary\",attrs:{\"type\":\"submit\",\"aria-label\":_vm.t('files', 'Create a new file with the selected template')},domProps:{\"value\":_vm.t('files', 'Create')}})])]),_vm._v(\" \"),(_vm.loading)?_c('EmptyContent',{staticClass:\"templates-picker__loading\",attrs:{\"icon\":\"icon-loading\"}},[_vm._v(\"\\n\\t\\t\"+_vm._s(_vm.t('files', 'Creating file'))+\"\\n\\t\")]):_vm._e()],1):_vm._e()}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","/**\n * @copyright Copyright (c) 2020 John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @author John Molakvoæ <skjnldsv@protonmail.com>\n * @author Julius Härtl <jus@bitgrid.net>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\nimport { getLoggerBuilder } from '@nextcloud/logger'\nimport { loadState } from '@nextcloud/initial-state'\nimport { translate as t, translatePlural as n } from '@nextcloud/l10n'\nimport { generateOcsUrl } from '@nextcloud/router'\nimport { getCurrentDirectory } from './utils/davUtils'\nimport axios from '@nextcloud/axios'\nimport Vue from 'vue'\n\nimport TemplatePickerView from './views/TemplatePicker'\nimport { showError } from '@nextcloud/dialogs'\n\n// Set up logger\nconst logger = getLoggerBuilder()\n\t.setApp('files')\n\t.detectUser()\n\t.build()\n\n// Add translates functions\nVue.mixin({\n\tmethods: {\n\t\tt,\n\t\tn,\n\t},\n})\n\n// Create document root\nconst TemplatePickerRoot = document.createElement('div')\nTemplatePickerRoot.id = 'template-picker'\ndocument.body.appendChild(TemplatePickerRoot)\n\n// Retrieve and init templates\nlet templates = loadState('files', 'templates', [])\nlet templatesPath = loadState('files', 'templates_path', false)\nlogger.debug('Templates providers', templates)\nlogger.debug('Templates folder', { templatesPath })\n\n// Init vue app\nconst View = Vue.extend(TemplatePickerView)\nconst TemplatePicker = new View({\n\tname: 'TemplatePicker',\n\tpropsData: {\n\t\tlogger,\n\t},\n})\nTemplatePicker.$mount('#template-picker')\n\n// Init template engine after load to make sure it's the last injected entry\nwindow.addEventListener('DOMContentLoaded', function() {\n\tif (!templatesPath) {\n\t\tlogger.debug('Templates folder not initialized')\n\t\tconst initTemplatesPlugin = {\n\t\t\tattach(menu) {\n\t\t\t\t// register the new menu entry\n\t\t\t\tmenu.addMenuEntry({\n\t\t\t\t\tid: 'template-init',\n\t\t\t\t\tdisplayName: t('files', 'Set up templates folder'),\n\t\t\t\t\ttemplateName: t('files', 'Templates'),\n\t\t\t\t\ticonClass: 'icon-template-add',\n\t\t\t\t\tfileType: 'file',\n\t\t\t\t\tactionHandler(name) {\n\t\t\t\t\t\tinitTemplatesFolder(name)\n\t\t\t\t\t\tmenu.removeMenuEntry('template-init')\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t},\n\t\t}\n\t\tOC.Plugins.register('OCA.Files.NewFileMenu', initTemplatesPlugin)\n\t}\n})\n\n// Init template files menu\ntemplates.forEach((provider, index) => {\n\tconst newTemplatePlugin = {\n\t\tattach(menu) {\n\t\t\tconst fileList = menu.fileList\n\n\t\t\t// only attach to main file list, public view is not supported yet\n\t\t\tif (fileList.id !== 'files' && fileList.id !== 'files.public') {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// register the new menu entry\n\t\t\tmenu.addMenuEntry({\n\t\t\t\tid: `template-new-${provider.app}-${index}`,\n\t\t\t\tdisplayName: provider.label,\n\t\t\t\ttemplateName: provider.label + provider.extension,\n\t\t\t\ticonClass: provider.iconClass || 'icon-file',\n\t\t\t\tfileType: 'file',\n\t\t\t\tactionHandler(name) {\n\t\t\t\t\tTemplatePicker.open(name, provider)\n\t\t\t\t},\n\t\t\t})\n\t\t},\n\t}\n\tOC.Plugins.register('OCA.Files.NewFileMenu', newTemplatePlugin)\n})\n\n/**\n * Init the template directory\n *\n * @param {string} name the templates folder name\n */\nconst initTemplatesFolder = async function(name) {\n\tconst templatePath = (getCurrentDirectory() + `/${name}`).replace('//', '/')\n\ttry {\n\t\tlogger.debug('Initializing the templates directory', { templatePath })\n\t\tconst response = await axios.post(generateOcsUrl('apps/files/api/v1/templates/path'), {\n\t\t\ttemplatePath,\n\t\t\tcopySystemTemplates: true,\n\t\t})\n\n\t\t// Go to template directory\n\t\tOCA.Files.App.currentFileList.changeDirectory(templatePath, true, true)\n\n\t\ttemplates = response.data.ocs.data.templates\n\t\ttemplatesPath = response.data.ocs.data.template_path\n\t} catch (error) {\n\t\tlogger.error('Unable to initialize the templates directory')\n\t\tshowError(t('files', 'Unable to initialize the templates directory'))\n\t}\n}\n","/*\n * @copyright Copyright (c) 2021 Julius Härtl <jus@bitgrid.net>\n *\n * @author Julius Härtl <jus@bitgrid.net>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\nimport { subscribe } from '@nextcloud/event-bus'\n\n(function() {\n\n\tconst FilesPlugin = {\n\t\tattach(fileList) {\n\t\t\tsubscribe('nextcloud:unified-search.search', ({ query }) => {\n\t\t\t\tfileList.setFilter(query)\n\t\t\t})\n\t\t\tsubscribe('nextcloud:unified-search.reset', () => {\n\t\t\t\tthis.query = null\n\t\t\t\tfileList.setFilter('')\n\t\t\t})\n\n\t\t},\n\t}\n\n\twindow.OC.Plugins.register('OCA.Files.FileList', FilesPlugin)\n\n})()\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".template-picker__item[data-v-440aea22]{display:flex}.template-picker__label[data-v-440aea22]{display:flex;align-items:center;flex:1 1;flex-direction:column}.template-picker__label[data-v-440aea22],.template-picker__label *[data-v-440aea22]{cursor:pointer;user-select:none}.template-picker__label[data-v-440aea22]::before{display:none !important}.template-picker__preview[data-v-440aea22]{display:block;overflow:hidden;flex:1 1;width:var(--width);min-height:var(--height);max-height:var(--height);padding:0;border:var(--border) solid var(--color-border);border-radius:var(--border-radius-large)}input:checked+label>.template-picker__preview[data-v-440aea22]{border-color:var(--color-primary)}.template-picker__preview--failed[data-v-440aea22]{display:flex}.template-picker__image[data-v-440aea22]{max-width:100%;background-color:var(--color-main-background);object-fit:cover}.template-picker__preview--failed .template-picker__image[data-v-440aea22]{width:calc(var(--margin)*8);margin:auto;background-color:rgba(0,0,0,0) !important;object-fit:initial}.template-picker__title[data-v-440aea22]{overflow:hidden;max-width:calc(var(--width) + 4px);padding:var(--margin);white-space:nowrap;text-overflow:ellipsis}\", \"\",{\"version\":3,\"sources\":[\"webpack://./apps/files/src/components/TemplatePreview.vue\"],\"names\":[],\"mappings\":\"AAsJC,wCACC,YAAA,CAGD,yCACC,YAAA,CAEA,kBAAA,CACA,QAAA,CACA,qBAAA,CAEA,oFACC,cAAA,CACA,gBAAA,CAGD,iDACC,uBAAA,CAIF,2CACC,aAAA,CACA,eAAA,CAEA,QAAA,CACA,kBAAA,CACA,wBAAA,CACA,wBAAA,CACA,SAAA,CACA,8CAAA,CACA,wCAAA,CAEA,+DACC,iCAAA,CAGD,mDAEC,YAAA,CAIF,yCACC,cAAA,CACA,6CAAA,CAEA,gBAAA,CAID,2EACC,2BAAA,CAEA,WAAA,CACA,yCAAA,CAEA,kBAAA,CAGD,yCACC,eAAA,CAEA,kCAAA,CACA,qBAAA,CACA,kBAAA,CACA,sBAAA\",\"sourcesContent\":[\"\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n.template-picker {\\n\\t&__item {\\n\\t\\tdisplay: flex;\\n\\t}\\n\\n\\t&__label {\\n\\t\\tdisplay: flex;\\n\\t\\t// Align in the middle of the grid\\n\\t\\talign-items: center;\\n\\t\\tflex: 1 1;\\n\\t\\tflex-direction: column;\\n\\n\\t\\t&, * {\\n\\t\\t\\tcursor: pointer;\\n\\t\\t\\tuser-select: none;\\n\\t\\t}\\n\\n\\t\\t&::before {\\n\\t\\t\\tdisplay: none !important;\\n\\t\\t}\\n\\t}\\n\\n\\t&__preview {\\n\\t\\tdisplay: block;\\n\\t\\toverflow: hidden;\\n\\t\\t// Stretch so all entries are the same width\\n\\t\\tflex: 1 1;\\n\\t\\twidth: var(--width);\\n\\t\\tmin-height: var(--height);\\n\\t\\tmax-height: var(--height);\\n\\t\\tpadding: 0;\\n\\t\\tborder: var(--border) solid var(--color-border);\\n\\t\\tborder-radius: var(--border-radius-large);\\n\\n\\t\\tinput:checked + label > & {\\n\\t\\t\\tborder-color: var(--color-primary);\\n\\t\\t}\\n\\n\\t\\t&--failed {\\n\\t\\t\\t// Make sure to properly center fallback icon\\n\\t\\t\\tdisplay: flex;\\n\\t\\t}\\n\\t}\\n\\n\\t&__image {\\n\\t\\tmax-width: 100%;\\n\\t\\tbackground-color: var(--color-main-background);\\n\\n\\t\\tobject-fit: cover;\\n\\t}\\n\\n\\t// Failed preview, fallback to mime icon\\n\\t&__preview--failed &__image {\\n\\t\\twidth: calc(var(--margin) * 8);\\n\\t\\t// Center mime icon\\n\\t\\tmargin: auto;\\n\\t\\tbackground-color: transparent !important;\\n\\n\\t\\tobject-fit: initial;\\n\\t}\\n\\n\\t&__title {\\n\\t\\toverflow: hidden;\\n\\t\\t// also count preview border\\n\\t\\tmax-width: calc(var(--width) + 2*2px);\\n\\t\\tpadding: var(--margin);\\n\\t\\twhite-space: nowrap;\\n\\t\\ttext-overflow: ellipsis;\\n\\t}\\n}\\n\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".templates-picker__form[data-v-278f6b79]{padding:calc(var(--margin)*2);padding-bottom:0}.templates-picker__form h2[data-v-278f6b79]{text-align:center;font-weight:bold;margin:var(--margin) 0 calc(var(--margin)*2)}.templates-picker__list[data-v-278f6b79]{display:grid;grid-gap:calc(var(--margin)*2);grid-auto-columns:1fr;max-width:calc(var(--fullwidth)*6);grid-template-columns:repeat(auto-fit, var(--fullwidth));grid-auto-rows:1fr;justify-content:center}.templates-picker__buttons[data-v-278f6b79]{display:flex;justify-content:space-between;padding:calc(var(--margin)*2) var(--margin);position:sticky;bottom:0;background-image:linear-gradient(0, var(--gradient-main-background))}.templates-picker__buttons button[data-v-278f6b79],.templates-picker__buttons input[type=submit][data-v-278f6b79]{height:44px}.templates-picker[data-v-278f6b79] .modal-container{position:relative;height:fit-content}.templates-picker__loading[data-v-278f6b79]{position:absolute;top:0;left:0;justify-content:center;width:100%;height:100%;margin:0;background-color:var(--color-main-background-translucent)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./apps/files/src/views/TemplatePicker.vue\"],\"names\":[],\"mappings\":\"AAuPC,yCACC,6BAAA,CAEA,gBAAA,CAEA,4CACC,iBAAA,CACA,gBAAA,CACA,4CAAA,CAIF,yCACC,YAAA,CACA,8BAAA,CACA,qBAAA,CAEA,kCAAA,CACA,wDAAA,CAEA,kBAAA,CAEA,sBAAA,CAGD,4CACC,YA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\n\\t\\t\\ttext-align: center;\\n\\t\\t\\tfont-weight: bold;\\n\\t\\t\\tmargin: var(--margin) 0 calc(var(--margin) * 2);\\n\\t\\t}\\n\\t}\\n\\n\\t&__list {\\n\\t\\tdisplay: grid;\\n\\t\\tgrid-gap: calc(var(--margin) * 2);\\n\\t\\tgrid-auto-columns: 1fr;\\n\\t\\t// We want maximum 5 columns. Putting 6 as we don't count the grid gap. So it will always be lower than 6\\n\\t\\tmax-width: calc(var(--fullwidth) * 6);\\n\\t\\tgrid-template-columns: repeat(auto-fit, var(--fullwidth));\\n\\t\\t// Make sure all rows are the same height\\n\\t\\tgrid-auto-rows: 1fr;\\n\\t\\t// Center the columns set\\n\\t\\tjustify-content: center;\\n\\t}\\n\\n\\t&__buttons {\\n\\t\\tdisplay: flex;\\n\\t\\tjustify-content: space-between;\\n\\t\\tpadding: calc(var(--margin) * 2) var(--margin);\\n\\t\\tposition: sticky;\\n\\t\\tbottom: 0;\\n\\t\\tbackground-image: linear-gradient(0, var(--gradient-main-background));\\n\\n\\t\\tbutton, input[type='submit'] {\\n\\t\\t\\theight: 44px;\\n\\t\\t}\\n\\t}\\n\\n\\t// Make sure we're relative for the loading emptycontent on top\\n\\t::v-deep .modal-container {\\n\\t\\tposition: relative;\\n\\t\\theight: fit-content;\\n\\t}\\n\\n\\t&__loading {\\n\\t\\tposition: absolute;\\n\\t\\ttop: 0;\\n\\t\\tleft: 0;\\n\\t\\tjustify-content: center;\\n\\t\\twidth: 100%;\\n\\t\\theight: 100%;\\n\\t\\tmargin: 0;\\n\\t\\tbackground-color: var(--color-main-background-translucent);\\n\\t}\\n}\\n\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","__webpack_require__.amdD = function () {\n\tthrow new Error('define cannot be used indirect');\n};","__webpack_require__.amdO = {};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = function(module) {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","__webpack_require__.j = 2181;","__webpack_require__.b = document.baseURI || self.location.href;\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t2181: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = function(chunkId) { return installedChunks[chunkId] === 0; };\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = function(parentChunkLoadingFunction, data) {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some(function(id) { return installedChunks[id] !== 0; })) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunknextcloud\"] = self[\"webpackChunknextcloud\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [7874], function() { return __webpack_require__(23682); })\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","Settings","this","_settings","console","debug","view","filter","e","name","length","error","push","_h","$createElement","_self","_c","_vm","attrs","_l","setting","key","el","Setting","open","close","_name","_el","_open","_close","Vue","t","window","OCA","Files","Object","assign","addEventListener","TESTING","render","h","SettingsView","appSettingsHeader","document","getElementById","opened","currentTarget","children","classList","contains","settings","forEach","getCurrentDirectory","currentDirInfo","App","currentFileList","dirInfo","path","replace","getTemplates","axios","generateOcsUrl","response","data","ocs","createFromTemplate","filePath","templatePath","templateType","getCurrentUser","value","pathSections","startsWith","split","relativePath","section","encodeURIComponent","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","staticClass","id","domProps","checked","on","onCheck","_v","class","failedPreview","realPreviewUrl","onFailure","_s","nameWithoutExt","style","$event","preventDefault","stopPropagation","onSubmit","apply","arguments","_b","emptyTemplate","fileid","provider","template","ratio","_e","logger","getLoggerBuilder","setApp","detectUser","build","methods","n","TemplatePickerRoot","createElement","body","appendChild","templates","loadState","templatesPath","TemplatePicker","TemplatePickerView","propsData","$mount","initTemplatesPlugin","attach","menu","addMenuEntry","displayName","templateName","iconClass","fileType","actionHandler","initTemplatesFolder","removeMenuEntry","OC","Plugins","register","index","newTemplatePlugin","fileList","app","label","extension","FilesPlugin","copySystemTemplates","changeDirectory","template_path","showError","subscribe","query","setFilter","___CSS_LOADER_EXPORT___","module","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","loaded","__webpack_modules__","call","m","amdD","Error","amdO","O","result","chunkIds","fn","priority","notFulfilled","Infinity","i","fulfilled","j","keys","every","splice","r","getter","__esModule","d","a","definition","o","defineProperty","enumerable","get","g","globalThis","Function","obj","prop","prototype","hasOwnProperty","Symbol","toStringTag","nmd","paths","b","baseURI","self","location","href","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","some","chunkLoadingGlobal","bind","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file
+{"version":3,"file":"files-main.js?v=efe38dd3d30fcb0b616d","mappings":";6BAAIA,oNCsBiBC,EAAAA,WAIpB,kHAAc,qIACbC,KAAKC,UAAY,GACjBC,QAAQC,MAAM,+EAUf,SAASC,GACR,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,KAAK,KAAMD,EAAmB7M,KAAK8M,KAAKD,OC/CvF,IAAIE,EAAsB5D,EAAoBY,OAAET,EAAW,CAAC,OAAO,WAAa,OAAOH,EAAoB,UAC3G4D,EAAsB5D,EAAoBY,EAAEgD","sources":["webpack:///nextcloud/webpack/runtime/chunk loaded","webpack:///nextcloud/apps/files/src/services/Settings.js","webpack:///nextcloud/apps/files/src/components/Setting.vue?vue&type=script&lang=js&","webpack:///nextcloud/apps/files/src/components/Setting.vue","webpack:///nextcloud/apps/files/src/views/Settings.vue?vue&type=script&lang=js&","webpack:///nextcloud/apps/files/src/views/Settings.vue","webpack://nextcloud/./apps/files/src/components/Setting.vue?98ea","webpack:///nextcloud/apps/files/src/components/Setting.vue?vue&type=template&id=47cd8aa6&","webpack://nextcloud/./apps/files/src/views/Settings.vue?b81b","webpack:///nextcloud/apps/files/src/views/Settings.vue?vue&type=template&id=31c9bb4b&scoped=true&","webpack:///nextcloud/apps/files/src/models/Setting.js","webpack:///nextcloud/apps/files/src/files-app-settings.js","webpack:///nextcloud/apps/files/src/utils/davUtils.js","webpack:///nextcloud/apps/files/src/services/Templates.js","webpack:///nextcloud/apps/files/src/components/TemplatePreview.vue","webpack:///nextcloud/apps/files/src/utils/fileUtils.js","webpack:///nextcloud/apps/files/src/components/TemplatePreview.vue?vue&type=script&lang=js&","webpack://nextcloud/./apps/files/src/components/TemplatePreview.vue?ab98","webpack://nextcloud/./apps/files/src/components/TemplatePreview.vue?81db","webpack:///nextcloud/apps/files/src/components/TemplatePreview.vue?vue&type=template&id=440aea22&scoped=true&","webpack:///nextcloud/apps/files/src/views/TemplatePicker.vue","webpack:///nextcloud/apps/files/src/views/TemplatePicker.vue?vue&type=script&lang=js&","webpack://nextcloud/./apps/files/src/views/TemplatePicker.vue?dc89","webpack://nextcloud/./apps/files/src/views/TemplatePicker.vue?afd8","webpack:///nextcloud/apps/files/src/views/TemplatePicker.vue?vue&type=template&id=6784795c&scoped=true&","webpack:///nextcloud/apps/files/src/templates.js","webpack:///nextcloud/apps/files/src/legacy/filelistSearch.js","webpack:///nextcloud/apps/files/src/components/TemplatePreview.vue?vue&type=style&index=0&id=440aea22&lang=scss&scoped=true&","webpack:///nextcloud/apps/files/src/views/TemplatePicker.vue?vue&type=style&index=0&id=6784795c&lang=scss&scoped=true&","webpack:///nextcloud/webpack/bootstrap","webpack:///nextcloud/webpack/runtime/amd define","webpack:///nextcloud/webpack/runtime/amd options","webpack:///nextcloud/webpack/runtime/compat get default export","webpack:///nextcloud/webpack/runtime/define property getters","webpack:///nextcloud/webpack/runtime/global","webpack:///nextcloud/webpack/runtime/hasOwnProperty shorthand","webpack:///nextcloud/webpack/runtime/make namespace object","webpack:///nextcloud/webpack/runtime/node module decorator","webpack:///nextcloud/webpack/runtime/runtimeId","webpack:///nextcloud/webpack/runtime/jsonp chunk loading","webpack:///nextcloud/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = function(result, chunkIds, fn, priority) {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every(function(key) { return __webpack_require__.O[key](chunkIds[j]); })) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","/**\n * @copyright Copyright (c) 2019 Gary Kim <gary@garykim.dev>\n *\n * @author Gary Kim <gary@garykim.dev>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\nexport default class Settings {\n\n\t_settings\n\n\tconstructor() {\n\t\tthis._settings = []\n\t\tconsole.debug('OCA.Files.Settings initialized')\n\t}\n\n\t/**\n\t * Register a new setting\n\t *\n\t * @since 19.0.0\n\t * @param {OCA.Files.Settings.Setting} view element to add to settings\n\t * @return {boolean} whether registering was successful\n\t */\n\tregister(view) {\n\t\tif (this._settings.filter(e => e.name === view.name).length > 0) {\n\t\t\tconsole.error('A setting with the same name is already registered')\n\t\t\treturn false\n\t\t}\n\t\tthis._settings.push(view)\n\t\treturn true\n\t}\n\n\t/**\n\t * All settings elements\n\t *\n\t * @return {OCA.Files.Settings.Setting[]} All currently registered settings\n\t */\n\tget settings() {\n\t\treturn this._settings\n\t}\n\n}\n","import mod from \"-!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Setting.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Setting.vue?vue&type=script&lang=js&\"","<!--\n - @copyright Copyright (c) 2020 Gary Kim <gary@garykim.dev>\n -\n - @author Gary Kim <gary@garykim.dev>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n\n<template>\n\t<div />\n</template>\n<script>\nexport default {\n\tname: 'Setting',\n\tprops: {\n\t\tel: {\n\t\t\ttype: Function,\n\t\t\trequired: true,\n\t\t},\n\t},\n\tmounted() {\n\t\tthis.$el.appendChild(this.el())\n\t},\n}\n</script>\n<style>\n</style>\n","import mod from \"-!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Settings.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Settings.vue?vue&type=script&lang=js&\"","<!--\n - @copyright Copyright (c) 2019 Gary Kim <gary@garykim.dev>\n -\n - @author Gary Kim <gary@garykim.dev>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n<template>\n\t<div id=\"files-app-extra-settings\">\n\t\t<template v-for=\"setting in settings\">\n\t\t\t<Setting :key=\"setting.name\" :el=\"setting.el\" />\n\t\t</template>\n\t</div>\n</template>\n\n<script>\nimport Setting from '../components/Setting'\n\nexport default {\n\tname: 'Settings',\n\tcomponents: {\n\t\tSetting,\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tsettings: OCA.Files.Settings.settings,\n\t\t}\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n\n</style>\n","import { render, staticRenderFns } from \"./Setting.vue?vue&type=template&id=47cd8aa6&\"\nimport script from \"./Setting.vue?vue&type=script&lang=js&\"\nexport * from \"./Setting.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div')}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import { render, staticRenderFns } from \"./Settings.vue?vue&type=template&id=31c9bb4b&scoped=true&\"\nimport script from \"./Settings.vue?vue&type=script&lang=js&\"\nexport * from \"./Settings.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"31c9bb4b\",\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{\"id\":\"files-app-extra-settings\"}},[_vm._l((_vm.settings),function(setting){return [_c('Setting',{key:setting.name,attrs:{\"el\":setting.el}})]})],2)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","/**\n * @copyright Copyright (c) 2019 Gary Kim <gary@garykim.dev>\n * @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @author Gary Kim <gary@garykim.dev>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\nexport default class Setting {\n\n\t_close\n\t_el\n\t_name\n\t_open\n\n\t/**\n\t * Create a new files app setting\n\t *\n\t * @since 19.0.0\n\t * @param {string} name the name of this setting\n\t * @param {object} component the component\n\t * @param {Function} component.el function that returns an unmounted dom element to be added\n\t * @param {Function} [component.open] callback for when setting is added\n\t * @param {Function} [component.close] callback for when setting is closed\n\t */\n\tconstructor(name, { el, open, close }) {\n\t\tthis._name = name\n\t\tthis._el = el\n\t\tthis._open = open\n\t\tthis._close = close\n\n\t\tif (typeof this._open !== 'function') {\n\t\t\tthis._open = () => {}\n\t\t}\n\n\t\tif (typeof this._close !== 'function') {\n\t\t\tthis._close = () => {}\n\t\t}\n\t}\n\n\tget name() {\n\t\treturn this._name\n\t}\n\n\tget el() {\n\t\treturn this._el\n\t}\n\n\tget open() {\n\t\treturn this._open\n\t}\n\n\tget close() {\n\t\treturn this._close\n\t}\n\n}\n","/**\n * @copyright Copyright (c) 2019 Gary Kim <gary@garykim.dev>\n * @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @author Gary Kim <gary@garykim.dev>\n * @author John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\nimport Vue from 'vue'\nimport Settings from './services/Settings'\nimport SettingsView from './views/Settings'\nimport Setting from './models/Setting'\n\nVue.prototype.t = t\n\n// Init Files App Settings Service\nif (!window.OCA.Files) {\n\twindow.OCA.Files = {}\n}\nObject.assign(window.OCA.Files, { Settings: new Settings() })\nObject.assign(window.OCA.Files.Settings, { Setting })\n\nwindow.addEventListener('DOMContentLoaded', function() {\n\tif (window.TESTING) {\n\t\treturn\n\t}\n\t// Init Vue app\n\t// eslint-disable-next-line\n\tnew Vue({\n\t\tel: '#files-app-settings',\n\t\trender: h => h(SettingsView),\n\t})\n\n\tconst appSettingsHeader = document.getElementById('app-settings-header')\n\tif (appSettingsHeader) {\n\t\tappSettingsHeader.addEventListener('click', e => {\n\t\t\tconst opened = e.currentTarget.children[0].classList.contains('opened')\n\t\t\tOCA.Files.Settings.settings.forEach(e => opened ? e.close() : e.open())\n\t\t})\n\t}\n})\n","/**\n * @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @author John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\nimport { generateRemoteUrl } from '@nextcloud/router'\nimport { getCurrentUser } from '@nextcloud/auth'\n\nexport const getRootPath = function() {\n\tif (getCurrentUser()) {\n\t\treturn generateRemoteUrl(`dav/files/${getCurrentUser().uid}`)\n\t} else {\n\t\treturn generateRemoteUrl('webdav').replace('/remote.php', '/public.php')\n\t}\n}\n\nexport const isPublic = function() {\n\treturn !getCurrentUser()\n}\n\nexport const getToken = function() {\n\treturn document.getElementById('sharingToken') && document.getElementById('sharingToken').value\n}\n\n/**\n * Return the current directory, fallback to root\n *\n * @return {string}\n */\nexport const getCurrentDirectory = function() {\n\tconst currentDirInfo = OCA?.Files?.App?.currentFileList?.dirInfo\n\t\t|| { path: '/', name: '' }\n\n\t// Make sure we don't have double slashes\n\treturn `${currentDirInfo.path}/${currentDirInfo.name}`.replace(/\\/\\//gi, '/')\n}\n","/**\n * @copyright Copyright (c) 2021 John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @author John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\nimport { generateOcsUrl } from '@nextcloud/router'\nimport axios from '@nextcloud/axios'\n\nexport const getTemplates = async function() {\n\tconst response = await axios.get(generateOcsUrl('apps/files/api/v1/templates'))\n\treturn response.data.ocs.data\n}\n\n/**\n * Create a new file from a specified template\n *\n * @param {string} filePath The new file destination path\n * @param {string} templatePath The template source path\n * @param {string} templateType The template type e.g 'user'\n */\nexport const createFromTemplate = async function(filePath, templatePath, templateType) {\n\tconst response = await axios.post(generateOcsUrl('apps/files/api/v1/templates/create'), {\n\t\tfilePath,\n\t\ttemplatePath,\n\t\ttemplateType,\n\t})\n\treturn response.data.ocs.data\n}\n","<!--\n - @copyright Copyright (c) 2020 John Molakvoæ <skjnldsv@protonmail.com>\n -\n - @author John Molakvoæ <skjnldsv@protonmail.com>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n\n<template>\n\t<li class=\"template-picker__item\">\n\t\t<input :id=\"id\"\n\t\t\t:checked=\"checked\"\n\t\t\ttype=\"radio\"\n\t\t\tclass=\"radio\"\n\t\t\tname=\"template-picker\"\n\t\t\t@change=\"onCheck\">\n\n\t\t<label :for=\"id\" class=\"template-picker__label\">\n\t\t\t<div class=\"template-picker__preview\"\n\t\t\t\t:class=\"failedPreview ? 'template-picker__preview--failed' : ''\">\n\t\t\t\t<img class=\"template-picker__image\"\n\t\t\t\t\t:src=\"realPreviewUrl\"\n\t\t\t\t\talt=\"\"\n\t\t\t\t\tdraggable=\"false\"\n\t\t\t\t\t@error=\"onFailure\">\n\t\t\t</div>\n\n\t\t\t<span class=\"template-picker__title\">\n\t\t\t\t{{ nameWithoutExt }}\n\t\t\t</span>\n\t\t</label>\n\t</li>\n</template>\n\n<script>\nimport { generateUrl } from '@nextcloud/router'\nimport { encodeFilePath } from '../utils/fileUtils'\nimport { getToken, isPublic } from '../utils/davUtils'\n\n// preview width generation\nconst previewWidth = 256\n\nexport default {\n\tname: 'TemplatePreview',\n\tinheritAttrs: false,\n\n\tprops: {\n\t\tbasename: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\tchecked: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\tfileid: {\n\t\t\ttype: [String, Number],\n\t\t\trequired: true,\n\t\t},\n\t\tfilename: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\tpreviewUrl: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\t\thasPreview: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\t\tmime: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\tratio: {\n\t\t\ttype: Number,\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tfailedPreview: false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * Strip away extension from name\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\tnameWithoutExt() {\n\t\t\treturn this.basename.indexOf('.') > -1 ? this.basename.split('.').slice(0, -1).join('.') : this.basename\n\t\t},\n\n\t\tid() {\n\t\t\treturn `template-picker-${this.fileid}`\n\t\t},\n\n\t\trealPreviewUrl() {\n\t\t\t// If original preview failed, fallback to mime icon\n\t\t\tif (this.failedPreview && this.mimeIcon) {\n\t\t\t\treturn this.mimeIcon\n\t\t\t}\n\n\t\t\tif (this.previewUrl) {\n\t\t\t\treturn this.previewUrl\n\t\t\t}\n\t\t\t// TODO: find a nicer standard way of doing this?\n\t\t\tif (isPublic()) {\n\t\t\t\treturn generateUrl(`/apps/files_sharing/publicpreview/${getToken()}?fileId=${this.fileid}&file=${encodeFilePath(this.filename)}&x=${previewWidth}&y=${previewWidth}&a=1`)\n\t\t\t}\n\t\t\treturn generateUrl(`/core/preview?fileId=${this.fileid}&x=${previewWidth}&y=${previewWidth}&a=1`)\n\t\t},\n\n\t\tmimeIcon() {\n\t\t\treturn OC.MimeType.getIconUrl(this.mime)\n\t\t},\n\t},\n\n\tmethods: {\n\t\tonCheck() {\n\t\t\tthis.$emit('check', this.fileid)\n\t\t},\n\t\tonFailure() {\n\t\t\tthis.failedPreview = true\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n\n.template-picker {\n\t&__item {\n\t\tdisplay: flex;\n\t}\n\n\t&__label {\n\t\tdisplay: flex;\n\t\t// Align in the middle of the grid\n\t\talign-items: center;\n\t\tflex: 1 1;\n\t\tflex-direction: column;\n\n\t\t&, * {\n\t\t\tcursor: pointer;\n\t\t\tuser-select: none;\n\t\t}\n\n\t\t&::before {\n\t\t\tdisplay: none !important;\n\t\t}\n\t}\n\n\t&__preview {\n\t\tdisplay: block;\n\t\toverflow: hidden;\n\t\t// Stretch so all entries are the same width\n\t\tflex: 1 1;\n\t\twidth: var(--width);\n\t\tmin-height: var(--height);\n\t\tmax-height: var(--height);\n\t\tpadding: 0;\n\t\tborder: var(--border) solid var(--color-border);\n\t\tborder-radius: var(--border-radius-large);\n\n\t\tinput:checked + label > & {\n\t\t\tborder-color: var(--color-primary);\n\t\t}\n\n\t\t&--failed {\n\t\t\t// Make sure to properly center fallback icon\n\t\t\tdisplay: flex;\n\t\t}\n\t}\n\n\t&__image {\n\t\tmax-width: 100%;\n\t\tbackground-color: var(--color-main-background);\n\n\t\tobject-fit: cover;\n\t}\n\n\t// Failed preview, fallback to mime icon\n\t&__preview--failed &__image {\n\t\twidth: calc(var(--margin) * 8);\n\t\t// Center mime icon\n\t\tmargin: auto;\n\t\tbackground-color: transparent !important;\n\n\t\tobject-fit: initial;\n\t}\n\n\t&__title {\n\t\toverflow: hidden;\n\t\t// also count preview border\n\t\tmax-width: calc(var(--width) + 2*2px);\n\t\tpadding: var(--margin);\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t}\n}\n\n</style>\n","/**\n * @copyright Copyright (c) 2021 John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @author John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\nconst encodeFilePath = function(path) {\n\tconst pathSections = (path.startsWith('/') ? path : `/${path}`).split('/')\n\tlet relativePath = ''\n\tpathSections.forEach((section) => {\n\t\tif (section !== '') {\n\t\t\trelativePath += '/' + encodeURIComponent(section)\n\t\t}\n\t})\n\treturn relativePath\n}\n\n/**\n * Extract dir and name from file path\n *\n * @param {string} path the full path\n * @return {string[]} [dirPath, fileName]\n */\nconst extractFilePaths = function(path) {\n\tconst pathSections = path.split('/')\n\tconst fileName = pathSections[pathSections.length - 1]\n\tconst dirPath = pathSections.slice(0, pathSections.length - 1).join('/')\n\treturn [dirPath, fileName]\n}\n\nexport { encodeFilePath, extractFilePaths }\n","import mod from \"-!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./TemplatePreview.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./TemplatePreview.vue?vue&type=script&lang=js&\"","\n import API from \"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/sass-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./TemplatePreview.vue?vue&type=style&index=0&id=440aea22&lang=scss&scoped=true&\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/sass-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./TemplatePreview.vue?vue&type=style&index=0&id=440aea22&lang=scss&scoped=true&\";\n export default content && content.locals ? content.locals : undefined;\n","import { render, staticRenderFns } from \"./TemplatePreview.vue?vue&type=template&id=440aea22&scoped=true&\"\nimport script from \"./TemplatePreview.vue?vue&type=script&lang=js&\"\nexport * from \"./TemplatePreview.vue?vue&type=script&lang=js&\"\nimport style0 from \"./TemplatePreview.vue?vue&type=style&index=0&id=440aea22&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"440aea22\",\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('li',{staticClass:\"template-picker__item\"},[_c('input',{staticClass:\"radio\",attrs:{\"id\":_vm.id,\"type\":\"radio\",\"name\":\"template-picker\"},domProps:{\"checked\":_vm.checked},on:{\"change\":_vm.onCheck}}),_vm._v(\" \"),_c('label',{staticClass:\"template-picker__label\",attrs:{\"for\":_vm.id}},[_c('div',{staticClass:\"template-picker__preview\",class:_vm.failedPreview ? 'template-picker__preview--failed' : ''},[_c('img',{staticClass:\"template-picker__image\",attrs:{\"src\":_vm.realPreviewUrl,\"alt\":\"\",\"draggable\":\"false\"},on:{\"error\":_vm.onFailure}})]),_vm._v(\" \"),_c('span',{staticClass:\"template-picker__title\"},[_vm._v(\"\\n\\t\\t\\t\"+_vm._s(_vm.nameWithoutExt)+\"\\n\\t\\t\")])])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<!--\n - @copyright Copyright (c) 2020 John Molakvoæ <skjnldsv@protonmail.com>\n -\n - @author John Molakvoæ <skjnldsv@protonmail.com>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n\n<template>\n\t<Modal v-if=\"opened\"\n\t\t:clear-view-delay=\"-1\"\n\t\tclass=\"templates-picker\"\n\t\tsize=\"normal\"\n\t\t@close=\"close\">\n\t\t<form class=\"templates-picker__form\"\n\t\t\t:style=\"style\"\n\t\t\t@submit.prevent.stop=\"onSubmit\">\n\t\t\t<h2>{{ t('files', 'Pick a template for {name}', { name: nameWithoutExt }) }}</h2>\n\n\t\t\t<!-- Templates list -->\n\t\t\t<ul class=\"templates-picker__list\">\n\t\t\t\t<TemplatePreview v-bind=\"emptyTemplate\"\n\t\t\t\t\t:checked=\"checked === emptyTemplate.fileid\"\n\t\t\t\t\t@check=\"onCheck\" />\n\n\t\t\t\t<TemplatePreview v-for=\"template in provider.templates\"\n\t\t\t\t\t:key=\"template.fileid\"\n\t\t\t\t\tv-bind=\"template\"\n\t\t\t\t\t:checked=\"checked === template.fileid\"\n\t\t\t\t\t:ratio=\"provider.ratio\"\n\t\t\t\t\t@check=\"onCheck\" />\n\t\t\t</ul>\n\n\t\t\t<!-- Cancel and submit -->\n\t\t\t<div class=\"templates-picker__buttons\">\n\t\t\t\t<button @click=\"close\">\n\t\t\t\t\t{{ t('files', 'Cancel') }}\n\t\t\t\t</button>\n\t\t\t\t<input type=\"submit\"\n\t\t\t\t\tclass=\"primary\"\n\t\t\t\t\t:value=\"t('files', 'Create')\"\n\t\t\t\t\t:aria-label=\"t('files', 'Create a new file with the selected template')\">\n\t\t\t</div>\n\t\t</form>\n\n\t\t<EmptyContent v-if=\"loading\" class=\"templates-picker__loading\" icon=\"icon-loading\">\n\t\t\t{{ t('files', 'Creating file') }}\n\t\t</EmptyContent>\n\t</Modal>\n</template>\n\n<script>\nimport { normalize } from 'path'\nimport { showError } from '@nextcloud/dialogs'\nimport EmptyContent from '@nextcloud/vue/dist/Components/EmptyContent'\nimport Modal from '@nextcloud/vue/dist/Components/Modal'\n\nimport { getCurrentDirectory } from '../utils/davUtils'\nimport { createFromTemplate, getTemplates } from '../services/Templates'\nimport TemplatePreview from '../components/TemplatePreview'\n\nconst border = 2\nconst margin = 8\nconst width = margin * 20\n\nexport default {\n\tname: 'TemplatePicker',\n\n\tcomponents: {\n\t\tEmptyContent,\n\t\tModal,\n\t\tTemplatePreview,\n\t},\n\n\tprops: {\n\t\tlogger: {\n\t\t\ttype: Object,\n\t\t\trequired: true,\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\t// Check empty template by default\n\t\t\tchecked: -1,\n\t\t\tloading: false,\n\t\t\tname: null,\n\t\t\topened: false,\n\t\t\tprovider: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * Strip away extension from name\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\tnameWithoutExt() {\n\t\t\treturn this.name.indexOf('.') > -1\n\t\t\t\t? this.name.split('.').slice(0, -1).join('.')\n\t\t\t\t: this.name\n\t\t},\n\n\t\temptyTemplate() {\n\t\t\treturn {\n\t\t\t\tbasename: t('files', 'Blank'),\n\t\t\t\tfileid: -1,\n\t\t\t\tfilename: this.t('files', 'Blank'),\n\t\t\t\thasPreview: false,\n\t\t\t\tmime: this.provider?.mimetypes[0] || this.provider?.mimetypes,\n\t\t\t}\n\t\t},\n\n\t\tselectedTemplate() {\n\t\t\treturn this.provider.templates.find(template => template.fileid === this.checked)\n\t\t},\n\n\t\t/**\n\t\t * Style css vars bin,d\n\t\t *\n\t\t * @return {object}\n\t\t */\n\t\tstyle() {\n\t\t\treturn {\n\t\t\t\t'--margin': margin + 'px',\n\t\t\t\t'--width': width + 'px',\n\t\t\t\t'--border': border + 'px',\n\t\t\t\t'--fullwidth': width + 2 * margin + 2 * border + 'px',\n\t\t\t\t'--height': this.provider.ratio ? Math.round(width / this.provider.ratio) + 'px' : null,\n\t\t\t}\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Open the picker\n\t\t *\n\t\t * @param {string} name the file name to create\n\t\t * @param {object} provider the template provider picked\n\t\t */\n\t\tasync open(name, provider) {\n\n\t\t\tthis.checked = this.emptyTemplate.fileid\n\t\t\tthis.name = name\n\t\t\tthis.provider = provider\n\n\t\t\tconst templates = await getTemplates()\n\t\t\tconst fetchedProvider = templates.find((fetchedProvider) => fetchedProvider.app === provider.app && fetchedProvider.label === provider.label)\n\t\t\tif (fetchedProvider === null) {\n\t\t\t\tthrow new Error('Failed to match provider in results')\n\t\t\t}\n\t\t\tthis.provider = fetchedProvider\n\n\t\t\t// If there is no templates available, just create an empty file\n\t\t\tif (fetchedProvider.templates.length === 0) {\n\t\t\t\tthis.onSubmit()\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Else, open the picker\n\t\t\tthis.opened = true\n\t\t},\n\n\t\t/**\n\t\t * Close the picker and reset variables\n\t\t */\n\t\tclose() {\n\t\t\tthis.checked = this.emptyTemplate.fileid\n\t\t\tthis.loading = false\n\t\t\tthis.name = null\n\t\t\tthis.opened = false\n\t\t\tthis.provider = null\n\t\t},\n\n\t\t/**\n\t\t * Manages the radio template picker change\n\t\t *\n\t\t * @param {number} fileid the selected template file id\n\t\t */\n\t\tonCheck(fileid) {\n\t\t\tthis.checked = fileid\n\t\t},\n\n\t\tasync onSubmit() {\n\t\t\tthis.loading = true\n\t\t\tconst currentDirectory = getCurrentDirectory()\n\t\t\tconst fileList = OCA?.Files?.App?.currentFileList\n\n\t\t\t// If the file doesn't have an extension, add the default one\n\t\t\tif (this.nameWithoutExt === this.name) {\n\t\t\t\tthis.logger.debug('Fixed invalid filename', { name: this.name, extension: this.provider?.extension })\n\t\t\t\tthis.name = this.name + this.provider?.extension\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tconst fileInfo = await createFromTemplate(\n\t\t\t\t\tnormalize(`${currentDirectory}/${this.name}`),\n\t\t\t\t\tthis.selectedTemplate?.filename,\n\t\t\t\t\tthis.selectedTemplate?.templateType,\n\t\t\t\t)\n\t\t\t\tthis.logger.debug('Created new file', fileInfo)\n\n\t\t\t\tconst data = await fileList?.addAndFetchFileInfo(this.name).then((status, data) => data)\n\n\t\t\t\tconst model = new OCA.Files.FileInfoModel(data, {\n\t\t\t\t\tfilesClient: fileList?.filesClient,\n\t\t\t\t})\n\t\t\t\t// Run default action\n\t\t\t\tconst fileAction = OCA.Files.fileActions.getDefaultFileAction(fileInfo.mime, 'file', OC.PERMISSION_ALL)\n\t\t\t\tfileAction.action(fileInfo.basename, {\n\t\t\t\t\t$file: fileList?.findFileEl(this.name),\n\t\t\t\t\tdir: currentDirectory,\n\t\t\t\t\tfileList,\n\t\t\t\t\tfileActions: fileList?.fileActions,\n\t\t\t\t\tfileInfoModel: model,\n\t\t\t\t})\n\n\t\t\t\tthis.close()\n\t\t\t} catch (error) {\n\t\t\t\tthis.logger.error('Error while creating the new file from template')\n\t\t\t\tconsole.error(error)\n\t\t\t\tshowError(this.t('files', 'Unable to create new file from template'))\n\t\t\t} finally {\n\t\t\t\tthis.loading = false\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.templates-picker {\n\t&__form {\n\t\tpadding: calc(var(--margin) * 2);\n\t\t// Will be handled by the buttons\n\t\tpadding-bottom: 0;\n\n\t\th2 {\n\t\t\ttext-align: center;\n\t\t\tfont-weight: bold;\n\t\t\tmargin: var(--margin) 0 calc(var(--margin) * 2);\n\t\t}\n\t}\n\n\t&__list {\n\t\tdisplay: grid;\n\t\tgrid-gap: calc(var(--margin) * 2);\n\t\tgrid-auto-columns: 1fr;\n\t\t// We want maximum 5 columns. Putting 6 as we don't count the grid gap. So it will always be lower than 6\n\t\tmax-width: calc(var(--fullwidth) * 6);\n\t\tgrid-template-columns: repeat(auto-fit, var(--fullwidth));\n\t\t// Make sure all rows are the same height\n\t\tgrid-auto-rows: 1fr;\n\t\t// Center the columns set\n\t\tjustify-content: center;\n\t}\n\n\t&__buttons {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t\tpadding: calc(var(--margin) * 2) var(--margin);\n\t\tposition: sticky;\n\t\tbottom: 0;\n\t\tbackground-image: linear-gradient(0, var(--gradient-main-background));\n\n\t\tbutton, input[type='submit'] {\n\t\t\theight: 44px;\n\t\t}\n\t}\n\n\t// Make sure we're relative for the loading emptycontent on top\n\t::v-deep .modal-container {\n\t\tposition: relative;\n\t}\n\n\t&__loading {\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tjustify-content: center;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tmargin: 0;\n\t\tbackground-color: var(--color-main-background-translucent);\n\t}\n}\n\n</style>\n","import mod from \"-!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./TemplatePicker.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./TemplatePicker.vue?vue&type=script&lang=js&\"","\n import API from \"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/sass-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./TemplatePicker.vue?vue&type=style&index=0&id=6784795c&lang=scss&scoped=true&\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/sass-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./TemplatePicker.vue?vue&type=style&index=0&id=6784795c&lang=scss&scoped=true&\";\n export default content && content.locals ? content.locals : undefined;\n","import { render, staticRenderFns } from \"./TemplatePicker.vue?vue&type=template&id=6784795c&scoped=true&\"\nimport script from \"./TemplatePicker.vue?vue&type=script&lang=js&\"\nexport * from \"./TemplatePicker.vue?vue&type=script&lang=js&\"\nimport style0 from \"./TemplatePicker.vue?vue&type=style&index=0&id=6784795c&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"6784795c\",\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.opened)?_c('Modal',{staticClass:\"templates-picker\",attrs:{\"clear-view-delay\":-1,\"size\":\"normal\"},on:{\"close\":_vm.close}},[_c('form',{staticClass:\"templates-picker__form\",style:(_vm.style),on:{\"submit\":function($event){$event.preventDefault();$event.stopPropagation();return _vm.onSubmit.apply(null, arguments)}}},[_c('h2',[_vm._v(_vm._s(_vm.t('files', 'Pick a template for {name}', { name: _vm.nameWithoutExt })))]),_vm._v(\" \"),_c('ul',{staticClass:\"templates-picker__list\"},[_c('TemplatePreview',_vm._b({attrs:{\"checked\":_vm.checked === _vm.emptyTemplate.fileid},on:{\"check\":_vm.onCheck}},'TemplatePreview',_vm.emptyTemplate,false)),_vm._v(\" \"),_vm._l((_vm.provider.templates),function(template){return _c('TemplatePreview',_vm._b({key:template.fileid,attrs:{\"checked\":_vm.checked === template.fileid,\"ratio\":_vm.provider.ratio},on:{\"check\":_vm.onCheck}},'TemplatePreview',template,false))})],2),_vm._v(\" \"),_c('div',{staticClass:\"templates-picker__buttons\"},[_c('button',{on:{\"click\":_vm.close}},[_vm._v(\"\\n\\t\\t\\t\\t\"+_vm._s(_vm.t('files', 'Cancel'))+\"\\n\\t\\t\\t\")]),_vm._v(\" \"),_c('input',{staticClass:\"primary\",attrs:{\"type\":\"submit\",\"aria-label\":_vm.t('files', 'Create a new file with the selected template')},domProps:{\"value\":_vm.t('files', 'Create')}})])]),_vm._v(\" \"),(_vm.loading)?_c('EmptyContent',{staticClass:\"templates-picker__loading\",attrs:{\"icon\":\"icon-loading\"}},[_vm._v(\"\\n\\t\\t\"+_vm._s(_vm.t('files', 'Creating file'))+\"\\n\\t\")]):_vm._e()],1):_vm._e()}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","/**\n * @copyright Copyright (c) 2020 John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @author John Molakvoæ <skjnldsv@protonmail.com>\n * @author Julius Härtl <jus@bitgrid.net>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\nimport { getLoggerBuilder } from '@nextcloud/logger'\nimport { loadState } from '@nextcloud/initial-state'\nimport { translate as t, translatePlural as n } from '@nextcloud/l10n'\nimport { generateOcsUrl } from '@nextcloud/router'\nimport { getCurrentDirectory } from './utils/davUtils'\nimport axios from '@nextcloud/axios'\nimport Vue from 'vue'\n\nimport TemplatePickerView from './views/TemplatePicker'\nimport { showError } from '@nextcloud/dialogs'\n\n// Set up logger\nconst logger = getLoggerBuilder()\n\t.setApp('files')\n\t.detectUser()\n\t.build()\n\n// Add translates functions\nVue.mixin({\n\tmethods: {\n\t\tt,\n\t\tn,\n\t},\n})\n\n// Create document root\nconst TemplatePickerRoot = document.createElement('div')\nTemplatePickerRoot.id = 'template-picker'\ndocument.body.appendChild(TemplatePickerRoot)\n\n// Retrieve and init templates\nlet templates = loadState('files', 'templates', [])\nlet templatesPath = loadState('files', 'templates_path', false)\nlogger.debug('Templates providers', templates)\nlogger.debug('Templates folder', { templatesPath })\n\n// Init vue app\nconst View = Vue.extend(TemplatePickerView)\nconst TemplatePicker = new View({\n\tname: 'TemplatePicker',\n\tpropsData: {\n\t\tlogger,\n\t},\n})\nTemplatePicker.$mount('#template-picker')\n\n// Init template engine after load to make sure it's the last injected entry\nwindow.addEventListener('DOMContentLoaded', function() {\n\tif (!templatesPath) {\n\t\tlogger.debug('Templates folder not initialized')\n\t\tconst initTemplatesPlugin = {\n\t\t\tattach(menu) {\n\t\t\t\t// register the new menu entry\n\t\t\t\tmenu.addMenuEntry({\n\t\t\t\t\tid: 'template-init',\n\t\t\t\t\tdisplayName: t('files', 'Set up templates folder'),\n\t\t\t\t\ttemplateName: t('files', 'Templates'),\n\t\t\t\t\ticonClass: 'icon-template-add',\n\t\t\t\t\tfileType: 'file',\n\t\t\t\t\tactionHandler(name) {\n\t\t\t\t\t\tinitTemplatesFolder(name)\n\t\t\t\t\t\tmenu.removeMenuEntry('template-init')\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t},\n\t\t}\n\t\tOC.Plugins.register('OCA.Files.NewFileMenu', initTemplatesPlugin)\n\t}\n})\n\n// Init template files menu\ntemplates.forEach((provider, index) => {\n\tconst newTemplatePlugin = {\n\t\tattach(menu) {\n\t\t\tconst fileList = menu.fileList\n\n\t\t\t// only attach to main file list, public view is not supported yet\n\t\t\tif (fileList.id !== 'files' && fileList.id !== 'files.public') {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// register the new menu entry\n\t\t\tmenu.addMenuEntry({\n\t\t\t\tid: `template-new-${provider.app}-${index}`,\n\t\t\t\tdisplayName: provider.label,\n\t\t\t\ttemplateName: provider.label + provider.extension,\n\t\t\t\ticonClass: provider.iconClass || 'icon-file',\n\t\t\t\tfileType: 'file',\n\t\t\t\tactionHandler(name) {\n\t\t\t\t\tTemplatePicker.open(name, provider)\n\t\t\t\t},\n\t\t\t})\n\t\t},\n\t}\n\tOC.Plugins.register('OCA.Files.NewFileMenu', newTemplatePlugin)\n})\n\n/**\n * Init the template directory\n *\n * @param {string} name the templates folder name\n */\nconst initTemplatesFolder = async function(name) {\n\tconst templatePath = (getCurrentDirectory() + `/${name}`).replace('//', '/')\n\ttry {\n\t\tlogger.debug('Initializing the templates directory', { templatePath })\n\t\tconst response = await axios.post(generateOcsUrl('apps/files/api/v1/templates/path'), {\n\t\t\ttemplatePath,\n\t\t\tcopySystemTemplates: true,\n\t\t})\n\n\t\t// Go to template directory\n\t\tOCA.Files.App.currentFileList.changeDirectory(templatePath, true, true)\n\n\t\ttemplates = response.data.ocs.data.templates\n\t\ttemplatesPath = response.data.ocs.data.template_path\n\t} catch (error) {\n\t\tlogger.error('Unable to initialize the templates directory')\n\t\tshowError(t('files', 'Unable to initialize the templates directory'))\n\t}\n}\n","/*\n * @copyright Copyright (c) 2021 Julius Härtl <jus@bitgrid.net>\n *\n * @author Julius Härtl <jus@bitgrid.net>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\nimport { subscribe } from '@nextcloud/event-bus'\n\n(function() {\n\n\tconst FilesPlugin = {\n\t\tattach(fileList) {\n\t\t\tsubscribe('nextcloud:unified-search.search', ({ query }) => {\n\t\t\t\tfileList.setFilter(query)\n\t\t\t})\n\t\t\tsubscribe('nextcloud:unified-search.reset', () => {\n\t\t\t\tthis.query = null\n\t\t\t\tfileList.setFilter('')\n\t\t\t})\n\n\t\t},\n\t}\n\n\twindow.OC.Plugins.register('OCA.Files.FileList', FilesPlugin)\n\n})()\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".template-picker__item[data-v-440aea22]{display:flex}.template-picker__label[data-v-440aea22]{display:flex;align-items:center;flex:1 1;flex-direction:column}.template-picker__label[data-v-440aea22],.template-picker__label *[data-v-440aea22]{cursor:pointer;user-select:none}.template-picker__label[data-v-440aea22]::before{display:none !important}.template-picker__preview[data-v-440aea22]{display:block;overflow:hidden;flex:1 1;width:var(--width);min-height:var(--height);max-height:var(--height);padding:0;border:var(--border) solid var(--color-border);border-radius:var(--border-radius-large)}input:checked+label>.template-picker__preview[data-v-440aea22]{border-color:var(--color-primary)}.template-picker__preview--failed[data-v-440aea22]{display:flex}.template-picker__image[data-v-440aea22]{max-width:100%;background-color:var(--color-main-background);object-fit:cover}.template-picker__preview--failed .template-picker__image[data-v-440aea22]{width:calc(var(--margin)*8);margin:auto;background-color:rgba(0,0,0,0) !important;object-fit:initial}.template-picker__title[data-v-440aea22]{overflow:hidden;max-width:calc(var(--width) + 4px);padding:var(--margin);white-space:nowrap;text-overflow:ellipsis}\", \"\",{\"version\":3,\"sources\":[\"webpack://./apps/files/src/components/TemplatePreview.vue\"],\"names\":[],\"mappings\":\"AAsJC,wCACC,YAAA,CAGD,yCACC,YAAA,CAEA,kBAAA,CACA,QAAA,CACA,qBAAA,CAEA,oFACC,cAAA,CACA,gBAAA,CAGD,iDACC,uBAAA,CAIF,2CACC,aAAA,CACA,eAAA,CAEA,QAAA,CACA,kBAAA,CACA,wBAAA,CACA,wBAAA,CACA,SAAA,CACA,8CAAA,CACA,wCAAA,CAEA,+DACC,iCAAA,CAGD,mDAEC,YAAA,CAIF,yCACC,cAAA,CACA,6CAAA,CAEA,gBAAA,CAID,2EACC,2BAAA,CAEA,WAAA,CACA,yCAAA,CAEA,kBAAA,CAGD,yCACC,eAAA,CAEA,kCAAA,CACA,qBAAA,CACA,kBAAA,CACA,sBAAA\",\"sourcesContent\":[\"\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n.template-picker {\\n\\t&__item {\\n\\t\\tdisplay: flex;\\n\\t}\\n\\n\\t&__label {\\n\\t\\tdisplay: flex;\\n\\t\\t// Align in the middle of the grid\\n\\t\\talign-items: center;\\n\\t\\tflex: 1 1;\\n\\t\\tflex-direction: column;\\n\\n\\t\\t&, * {\\n\\t\\t\\tcursor: pointer;\\n\\t\\t\\tuser-select: none;\\n\\t\\t}\\n\\n\\t\\t&::before {\\n\\t\\t\\tdisplay: none !important;\\n\\t\\t}\\n\\t}\\n\\n\\t&__preview {\\n\\t\\tdisplay: block;\\n\\t\\toverflow: hidden;\\n\\t\\t// Stretch so all entries are the same width\\n\\t\\tflex: 1 1;\\n\\t\\twidth: var(--width);\\n\\t\\tmin-height: var(--height);\\n\\t\\tmax-height: var(--height);\\n\\t\\tpadding: 0;\\n\\t\\tborder: var(--border) solid var(--color-border);\\n\\t\\tborder-radius: var(--border-radius-large);\\n\\n\\t\\tinput:checked + label > & {\\n\\t\\t\\tborder-color: var(--color-primary);\\n\\t\\t}\\n\\n\\t\\t&--failed {\\n\\t\\t\\t// Make sure to properly center fallback icon\\n\\t\\t\\tdisplay: flex;\\n\\t\\t}\\n\\t}\\n\\n\\t&__image {\\n\\t\\tmax-width: 100%;\\n\\t\\tbackground-color: var(--color-main-background);\\n\\n\\t\\tobject-fit: cover;\\n\\t}\\n\\n\\t// Failed preview, fallback to mime icon\\n\\t&__preview--failed &__image {\\n\\t\\twidth: calc(var(--margin) * 8);\\n\\t\\t// Center mime icon\\n\\t\\tmargin: auto;\\n\\t\\tbackground-color: transparent !important;\\n\\n\\t\\tobject-fit: initial;\\n\\t}\\n\\n\\t&__title {\\n\\t\\toverflow: hidden;\\n\\t\\t// also count preview border\\n\\t\\tmax-width: calc(var(--width) + 2*2px);\\n\\t\\tpadding: var(--margin);\\n\\t\\twhite-space: nowrap;\\n\\t\\ttext-overflow: ellipsis;\\n\\t}\\n}\\n\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".templates-picker__form[data-v-6784795c]{padding:calc(var(--margin)*2);padding-bottom:0}.templates-picker__form h2[data-v-6784795c]{text-align:center;font-weight:bold;margin:var(--margin) 0 calc(var(--margin)*2)}.templates-picker__list[data-v-6784795c]{display:grid;grid-gap:calc(var(--margin)*2);grid-auto-columns:1fr;max-width:calc(var(--fullwidth)*6);grid-template-columns:repeat(auto-fit, var(--fullwidth));grid-auto-rows:1fr;justify-content:center}.templates-picker__buttons[data-v-6784795c]{display:flex;justify-content:space-between;padding:calc(var(--margin)*2) var(--margin);position:sticky;bottom:0;background-image:linear-gradient(0, var(--gradient-main-background))}.templates-picker__buttons button[data-v-6784795c],.templates-picker__buttons input[type=submit][data-v-6784795c]{height:44px}.templates-picker[data-v-6784795c] .modal-container{position:relative}.templates-picker__loading[data-v-6784795c]{position:absolute;top:0;left:0;justify-content:center;width:100%;height:100%;margin:0;background-color:var(--color-main-background-translucent)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./apps/files/src/views/TemplatePicker.vue\"],\"names\":[],\"mappings\":\"AAuPC,yCACC,6BAAA,CAEA,gBAAA,CAEA,4CACC,iBAAA,CACA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ates-picker {\\n\\t&__form {\\n\\t\\tpadding: calc(var(--margin) * 2);\\n\\t\\t// Will be handled by the buttons\\n\\t\\tpadding-bottom: 0;\\n\\n\\t\\th2 {\\n\\t\\t\\ttext-align: center;\\n\\t\\t\\tfont-weight: bold;\\n\\t\\t\\tmargin: var(--margin) 0 calc(var(--margin) * 2);\\n\\t\\t}\\n\\t}\\n\\n\\t&__list {\\n\\t\\tdisplay: grid;\\n\\t\\tgrid-gap: calc(var(--margin) * 2);\\n\\t\\tgrid-auto-columns: 1fr;\\n\\t\\t// We want maximum 5 columns. Putting 6 as we don't count the grid gap. So it will always be lower than 6\\n\\t\\tmax-width: calc(var(--fullwidth) * 6);\\n\\t\\tgrid-template-columns: repeat(auto-fit, var(--fullwidth));\\n\\t\\t// Make sure all rows are the same height\\n\\t\\tgrid-auto-rows: 1fr;\\n\\t\\t// Center the columns set\\n\\t\\tjustify-content: center;\\n\\t}\\n\\n\\t&__buttons {\\n\\t\\tdisplay: flex;\\n\\t\\tjustify-content: space-between;\\n\\t\\tpadding: calc(var(--margin) * 2) var(--margin);\\n\\t\\tposition: sticky;\\n\\t\\tbottom: 0;\\n\\t\\tbackground-image: linear-gradient(0, var(--gradient-main-background));\\n\\n\\t\\tbutton, input[type='submit'] {\\n\\t\\t\\theight: 44px;\\n\\t\\t}\\n\\t}\\n\\n\\t// Make sure we're relative for the loading emptycontent on top\\n\\t::v-deep .modal-container {\\n\\t\\tposition: relative;\\n\\t}\\n\\n\\t&__loading {\\n\\t\\tposition: absolute;\\n\\t\\ttop: 0;\\n\\t\\tleft: 0;\\n\\t\\tjustify-content: center;\\n\\t\\twidth: 100%;\\n\\t\\theight: 100%;\\n\\t\\tmargin: 0;\\n\\t\\tbackground-color: var(--color-main-background-translucent);\\n\\t}\\n}\\n\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","__webpack_require__.amdD = function () {\n\tthrow new Error('define cannot be used indirect');\n};","__webpack_require__.amdO = {};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = function(module) {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","__webpack_require__.j = 2181;","__webpack_require__.b = document.baseURI || self.location.href;\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t2181: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = function(chunkId) { return installedChunks[chunkId] === 0; };\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = function(parentChunkLoadingFunction, data) {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some(function(id) { return installedChunks[id] !== 0; })) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunknextcloud\"] = self[\"webpackChunknextcloud\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [7874], function() { return __webpack_require__(58949); })\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","Settings","this","_settings","console","debug","view","filter","e","name","length","error","push","_h","$createElement","_self","_c","_vm","attrs","_l","setting","key","el","Setting","open","close","_name","_el","_open","_close","Vue","t","window","OCA","Files","Object","assign","addEventListener","TESTING","render","h","SettingsView","appSettingsHeader","document","getElementById","opened","currentTarget","children","classList","contains","settings","forEach","getCurrentDirectory","currentDirInfo","App","currentFileList","dirInfo","path","replace","getTemplates","axios","generateOcsUrl","response","data","ocs","createFromTemplate","filePath","templatePath","templateType","getCurrentUser","value","pathSections","startsWith","split","relativePath","section","encodeURIComponent","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","staticClass","id","domProps","checked","on","onCheck","_v","class","failedPreview","realPreviewUrl","onFailure","_s","nameWithoutExt","style","$event","preventDefault","stopPropagation","onSubmit","apply","arguments","_b","emptyTemplate","fileid","provider","template","ratio","_e","logger","getLoggerBuilder","setApp","detectUser","build","methods","n","TemplatePickerRoot","createElement","body","appendChild","templates","loadState","templatesPath","TemplatePicker","TemplatePickerView","propsData","$mount","initTemplatesPlugin","attach","menu","addMenuEntry","displayName","templateName","iconClass","fileType","actionHandler","initTemplatesFolder","removeMenuEntry","OC","Plugins","register","index","newTemplatePlugin","fileList","app","label","extension","FilesPlugin","copySystemTemplates","changeDirectory","template_path","showError","subscribe","query","setFilter","___CSS_LOADER_EXPORT___","module","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","loaded","__webpack_modules__","call","m","amdD","Error","amdO","O","result","chunkIds","fn","priority","notFulfilled","Infinity","i","fulfilled","j","keys","every","splice","r","getter","__esModule","d","a","definition","o","defineProperty","enumerable","get","g","globalThis","Function","obj","prop","prototype","hasOwnProperty","Symbol","toStringTag","nmd","paths","b","baseURI","self","location","href","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","some","chunkLoadingGlobal","bind","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file