"use strict";(self.webpackChunknextcloud=self.webpackChunknextcloud||[]).push([[2142],{32142:(t,e,n)=>{n.r(e),n.d(e,{default:()=>k});var a=n(85471),i=n(32981),s=n(53334),o=n(97012),r=n(94219),l=n(40083),p=n(82182),u=n(35810);const c=(0,a.pM)({name:"PublicAuthPrompt",components:{NcButton:o.A,NcDialog:r.A,NcNoteCard:l.A,NcTextField:p.A},setup:()=>({t:s.t,owner:(0,i.C)("files_sharing","owner",""),ownerDisplayName:(0,i.C)("files_sharing","ownerDisplayName",""),label:(0,i.C)("files_sharing","label",""),note:(0,i.C)("files_sharing","note",""),filename:(0,i.C)("files_sharing","filename","")}),data:()=>({name:""}),computed:{dialogName(){return this.t("files_sharing","Upload files to {folder}",{folder:this.label||this.filename})}},watch:{name(){const t=this.name.trim?.()||"",e=this.$refs.input?.$el.querySelector("input");if(!e)return;const n=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(""===t.trim())return(0,s.t)("files","Filename must not be empty.");try{return(0,u.KT)(t),""}catch(t){if(!(t instanceof u.di))throw t;switch(t.reason){case u.nF.Character:return(0,s.t)("files",'"{char}" is not allowed inside a filename.',{char:t.segment},void 0,{escape:e});case u.nF.ReservedName:return(0,s.t)("files",'"{segment}" is a reserved name and not allowed for filenames.',{segment:t.segment},void 0,{escape:!1});case u.nF.Extension:return t.segment.match(/\.[a-z]/i)?(0,s.t)("files",'"{extension}" is not an allowed filetype.',{extension:t.segment},void 0,{escape:!1}):(0,s.t)("files",'Filenames must not end with "{extension}".',{extension:t.segment},void 0,{escape:!1});default:return(0,s.t)("files","Invalid filename.")}}}(t);e.setCustomValidity(n),e.reportValidity()}},beforeMount(){const t=localStorage.getItem("nick");t&&(this.name=t)},methods:{onSubmit(){const t=this.$refs.form;t.checkValidity()?""!==this.name.trim()&&(localStorage.setItem("nick",this.name),this.$emit("close")):t.reportValidity()}}});var m=n(85072),d=n.n(m),h=n(97825),f=n.n(h),g=n(77659),_=n.n(g),b=n(55056),A=n.n(b),y=n(10540),C=n.n(y),v=n(41113),x=n.n(v),w=n(49315),N={};N.styleTagTransform=x(),N.setAttributes=A(),N.insert=_().bind(null,"head"),N.domAPI=f(),N.insertStyleElement=C(),d()(w.A,N),w.A&&w.A.locals&&w.A.locals;const k=(0,n(14486).A)(c,(function(){var t=this,e=t._self._c;return t._self._setupProxy,e("NcDialog",{staticClass:"public-auth-prompt",attrs:{"data-cy-public-auth-prompt-dialog":"","dialog-classes":"public-auth-prompt__dialog","can-close":!1,name:t.dialogName},scopedSlots:t._u([{key:"actions",fn:function(){return[e("NcButton",{ref:"submit",attrs:{"data-cy-public-auth-prompt-dialog-submit":"",disabled:""===t.name.trim()},on:{click:t.onSubmit}},[t._v("\n\t\t\t"+t._s(t.t("files_sharing","Submit name"))+"\n\t\t")])]},proxy:!0}])},[t.owner?e("h3",{staticClass:"public-auth-prompt__subtitle"},[t._v("\n\t\t"+t._s(t.t("files_sharing","{ownerDisplayName} shared a folder with you.",{ownerDisplayName:t.ownerDisplayName}))+"\n\t")]):t._e(),t._v(" "),e("NcNoteCard",{staticClass:"public-auth-prompt__header",attrs:{type:"info"}},[e("p",{staticClass:"public-auth-prompt__description",attrs:{id:"public-auth-prompt-dialog-description"}},[t._v("\n\t\t\t"+t._s(t.t("files_sharing","To upload files, you need to provide your name first."))+"\n\t\t")])]),t._v(" "),e("form",{ref:"form",staticClass:"public-auth-prompt__form",attrs:{"aria-describedby":"public-auth-prompt-dialog-description"},on:{submit:function(t){t.preventDefault(),t.stopPropagation()}}},[e("NcTextField",{ref:"input",staticClass:"public-auth-prompt__input",attrs:{"data-cy-public-auth-prompt-dialog-name":"",label:t.t("files_sharing","Enter your name"),minlength:2,required:!0,value:t.name,name:"name"},on:{"update:value":function(e){t.name=e}}})],1)],1)}),[],!1,null,null,null).exports},49315:(t,e,n)=>{n.d(e,{A:()=>r});var a=n(71354),i=n.n(a),s=n(76314),o=n.n(s)()(i());o.push([t.id,".public-auth-prompt__subtitle{font-size:16px;margin-block:12px}.public-auth-prompt__header{margin-block:12px}.public-auth-prompt__form{margin-block:24px}","",{version:3,sources:["webpack://./apps/files_sharing/src/views/PublicAuthPrompt.vue"],names:[],mappings:"AAEC,8BAEC,cAAA,CACA,iBAAA,CAGD,4BAEC,iBAAA,CAGD,0BAEC,iBAAA",sourcesContent:["\n.public-auth-prompt {\n\t&__subtitle {\n\t\t// Smaller than dialog title\n\t\tfont-size: 16px;\n\t\tmargin-block: 12px;\n\t}\n\n\t&__header {\n\t\t// Fix extra margin generating an unwanted gap\n\t\tmargin-block: 12px;\n\t}\n\n\t&__form {\n\t\t// Double the margin of the header\n\t\tmargin-block: 24px;\n\t}\n}\n"],sourceRoot:""}]);const r=o}}]);
//# sourceMappingURL=2142-2142.js.map?v=1e08f231241a4dda941a