aboutsummaryrefslogtreecommitdiffstats
path: root/dist/9279-9279.js.map
blob: 98b61450bf15978f3c6d09c80519841d481b76e4 (plain)
1
{"version":3,"file":"9279-9279.js?v=460048c8db22e016b900","mappings":"4OASA,MAAMA,GAAU,QAAW,UAAUC,QAC/BC,GAAY,QAAgB,CAChCC,KAAM,mBACNC,WAAY,CACVC,SAAQ,IACRC,WAAU,IACVC,YAAW,KAEbC,MAAO,CAKLC,SAAU,CACRC,KAAMC,OACNC,QAAS,IAKXC,MAAO,CACLH,KAAMC,OACNC,SAAS,IAAAE,GAAE,yBAObC,KAAM,CACJL,KAAMC,OACNC,QAAS,IAMXI,OAAQ,CACNN,KAAMC,OACNC,SAAS,IAAAE,GAAE,sCAMbG,YAAa,CACXP,KAAMC,OACNC,SAAS,IAAAE,GAAE,gBAMbI,YAAa,CACXR,KAAMS,QACNP,SAAS,IAGbQ,MAAK,KACI,CACLN,EAAC,MAGLO,MAAO,CAAC,SACRC,KAAI,KACK,CACLnB,KAAM,KAGVoB,SAAU,CACR,aAAAC,GACE,MAAMC,EAAe,CACnBC,OAAO,IAAAZ,GAAE,UACTa,QAAS,WACTC,SAAU,IAAMC,KAAKC,MAAM,UAEvBC,EAAe,CACnBL,MAAOG,KAAKZ,YACZP,KAAM,SACNiB,QAAS,WAEX,OAAIE,KAAKX,YACA,CAACO,EAAcM,GAEjB,CAACA,EACV,GAEFC,MAAO,CAELvB,SAAU,CACR,OAAAwB,GACEJ,KAAK1B,KAAO0B,KAAKpB,QACnB,EACAyB,WAAW,IAGfC,QAAS,CACP,QAAAC,GACE,MAAMC,EAAQR,KAAKS,MAAMD,MACnB5B,EAAWoB,KAAK1B,KAAKoC,OAC3B,GAAiB,KAAb9B,EAIF,OAHA4B,EAAMG,mBAAkB,IAAA1B,GAAE,qCAC1BuB,EAAMI,sBACNJ,EAAMK,QAGR,GAAIjC,EAASkC,OAAS,EAIpB,OAHAN,EAAMG,mBAAkB,IAAA1B,GAAE,oDAC1BuB,EAAMI,sBACNJ,EAAMK,QAGR,KACE,QAAiBjC,EACnB,CAAE,MAAOmC,GAIP,OAHA,SAAU,IAAA9B,GAAE,4BACZ+B,QAAQC,MAAM,yBAA0BF,QACxCP,EAAMK,OAER,CACA1C,EAAQ+C,QAAQ,2BAA4B,QAC5ClB,KAAKC,MAAM,QAASD,KAAK1B,KAC3B,KAGJ,IAAI6C,EAAc,WAChB,IAAIC,EAAMpB,KAAMqB,EAAKD,EAAIE,MAAMD,GAE/B,OADAD,EAAIE,MAAMC,YACHF,EAAG,WAAY,CAAEG,YAAa,qBAAsBC,MAAO,CAAE,QAAWL,EAAIzB,cAAe,oCAAqC,GAAI,UAAW,GAAI,WAAY,GAAI,KAAQyB,EAAIpC,OAAS0C,GAAI,CAAE,OAAUN,EAAIb,WAAc,CAACa,EAAIlC,KAAOmC,EAAG,IAAK,CAAEG,YAAa,4BAA8B,CAACJ,EAAIO,GAAG,IAAMP,EAAIQ,GAAGR,EAAIlC,MAAQ,OAASkC,EAAIS,KAAMR,EAAG,aAAc,CAAEG,YAAa,6BAA8BC,MAAO,CAAE,KAAQL,EAAIjC,OAAQ,KAAQ,UAAakC,EAAG,cAAe,CAAES,IAAK,QAASN,YAAa,4BAA6BC,MAAO,CAAE,yCAA0C,GAAI,MAASL,EAAInC,EAAE,QAAS,YAAemC,EAAInC,EAAE,mBAAoB,UAAamC,EAAI/B,YAAa,UAAa,IAAK,KAAQ,QAAU0C,MAAO,CAAEC,MAAOZ,EAAI9C,KAAMyB,SAAU,SAASkC,GACvvBb,EAAI9C,KAAO2D,CACb,EAAGC,WAAY,WAAc,EAC/B,EACIC,EAAuB,GAS3B,MAAMC,GAR8B,IAAAC,GAClChE,EACA8C,EACAgB,GACA,EACA,KACA,YAEqCG,O","sources":["webpack:///nextcloud/node_modules/@nextcloud/dialogs/dist/chunks/PublicAuthPrompt-D1BKEbm6.mjs"],"sourcesContent":["import { defineComponent } from \"vue\";\nimport { getBuilder } from \"@nextcloud/browser-storage\";\nimport { setGuestNickname } from \"@nextcloud/auth\";\nimport { showError } from \"@nextcloud/dialogs\";\nimport \"@nextcloud/vue/components/NcButton\";\nimport NcDialog from \"@nextcloud/vue/components/NcDialog\";\nimport NcNoteCard from \"@nextcloud/vue/components/NcNoteCard\";\nimport NcTextField from \"@nextcloud/vue/components/NcTextField\";\nimport { t, n as normalizeComponent } from \"./_plugin-vue2_normalizer-jrlE7CJU.mjs\";\nconst storage = getBuilder(\"public\").build();\nconst _sfc_main = defineComponent({\n  name: \"PublicAuthPrompt\",\n  components: {\n    NcDialog,\n    NcNoteCard,\n    NcTextField\n  },\n  props: {\n    /**\n     * Preselected nickname\n     * @default '' No name preselected by default\n     */\n    nickname: {\n      type: String,\n      default: \"\"\n    },\n    /**\n     * Dialog title\n     */\n    title: {\n      type: String,\n      default: t(\"Guest identification\")\n    },\n    /**\n     * Dialog text under the dialog title\n     * e.g 'Enter your name to access the file'\n     * @default '' Not shown by default\n     */\n    text: {\n      type: String,\n      default: \"\"\n    },\n    /**\n     * Dialog notice\n     * @default 'You are currently not identified.'\n     */\n    notice: {\n      type: String,\n      default: t(\"You are currently not identified.\")\n    },\n    /**\n     * Dialog submit button label\n     * @default 'Submit name'\n     */\n    submitLabel: {\n      type: String,\n      default: t(\"Submit name\")\n    },\n    /**\n     * Whether the dialog is cancellable\n     * @default false\n     */\n    cancellable: {\n      type: Boolean,\n      default: false\n    }\n  },\n  setup() {\n    return {\n      t\n    };\n  },\n  emits: [\"close\"],\n  data() {\n    return {\n      name: \"\"\n    };\n  },\n  computed: {\n    dialogButtons() {\n      const cancelButton = {\n        label: t(\"Cancel\"),\n        variant: \"tertiary\",\n        callback: () => this.$emit(\"close\")\n      };\n      const submitButton = {\n        label: this.submitLabel,\n        type: \"submit\",\n        variant: \"primary\"\n      };\n      if (this.cancellable) {\n        return [cancelButton, submitButton];\n      }\n      return [submitButton];\n    }\n  },\n  watch: {\n    /** Reset name to pre-selected nickname (e.g. Talk / Collabora ) */\n    nickname: {\n      handler() {\n        this.name = this.nickname;\n      },\n      immediate: true\n    }\n  },\n  methods: {\n    onSubmit() {\n      const input = this.$refs.input;\n      const nickname = this.name.trim();\n      if (nickname === \"\") {\n        input.setCustomValidity(t(\"You cannot leave the name empty.\"));\n        input.reportValidity();\n        input.focus();\n        return;\n      }\n      if (nickname.length < 2) {\n        input.setCustomValidity(t(\"Please enter a name with at least 2 characters.\"));\n        input.reportValidity();\n        input.focus();\n        return;\n      }\n      try {\n        setGuestNickname(nickname);\n      } catch (e) {\n        showError(t(\"Failed to set nickname.\"));\n        console.error(\"Failed to set nickname\", e);\n        input.focus();\n        return;\n      }\n      storage.setItem(\"public-auth-prompt-shown\", \"true\");\n      this.$emit(\"close\", this.name);\n    }\n  }\n});\nvar _sfc_render = function render() {\n  var _vm = this, _c = _vm._self._c;\n  _vm._self._setupProxy;\n  return _c(\"NcDialog\", { staticClass: \"public-auth-prompt\", attrs: { \"buttons\": _vm.dialogButtons, \"data-cy-public-auth-prompt-dialog\": \"\", \"is-form\": \"\", \"no-close\": \"\", \"name\": _vm.title }, on: { \"submit\": _vm.onSubmit } }, [_vm.text ? _c(\"p\", { staticClass: \"public-auth-prompt__text\" }, [_vm._v(\" \" + _vm._s(_vm.text) + \" \")]) : _vm._e(), _c(\"NcNoteCard\", { staticClass: \"public-auth-prompt__header\", attrs: { \"text\": _vm.notice, \"type\": \"info\" } }), _c(\"NcTextField\", { ref: \"input\", staticClass: \"public-auth-prompt__input\", attrs: { \"data-cy-public-auth-prompt-dialog-name\": \"\", \"label\": _vm.t(\"Name\"), \"placeholder\": _vm.t(\"Enter your name\"), \"required\": !_vm.cancellable, \"minlength\": \"2\", \"name\": \"name\" }, model: { value: _vm.name, callback: function($$v) {\n    _vm.name = $$v;\n  }, expression: \"name\" } })], 1);\n};\nvar _sfc_staticRenderFns = [];\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n  _sfc_main,\n  _sfc_render,\n  _sfc_staticRenderFns,\n  false,\n  null,\n  \"4158d556\"\n);\nconst PublicAuthPrompt = __component__.exports;\nexport {\n  PublicAuthPrompt as default\n};\n//# sourceMappingURL=PublicAuthPrompt-D1BKEbm6.mjs.map\n"],"names":["storage","build","_sfc_main","name","components","NcDialog","NcNoteCard","NcTextField","props","nickname","type","String","default","title","t","text","notice","submitLabel","cancellable","Boolean","setup","emits","data","computed","dialogButtons","cancelButton","label","variant","callback","this","$emit","submitButton","watch","handler","immediate","methods","onSubmit","input","$refs","trim","setCustomValidity","reportValidity","focus","length","e","console","error","setItem","_sfc_render","_vm","_c","_self","_setupProxy","staticClass","attrs","on","_v","_s","_e","ref","model","value","$$v","expression","_sfc_staticRenderFns","PublicAuthPrompt","n","exports"],"sourceRoot":""}