!function(t){function e(e){for(var n,o,i=e[0],a=e[1],c=0,f=[];c * * @author Julius Härtl * * @license GNU AGPL version 3 or any later version * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * */ var r=["text/markdown"],o=["text/plain","application/cmd","application/javascript","application/json","application/xml","application/x-empty","application/x-msdos-program","application/x-php","application/x-pearl","application/x-text","application/yaml"],i=[].concat(r,o)},function(t,e,n){var r=n(3);t.exports=!r((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(t,e,n){var r=n(5);t.exports=function(t){if(!r(t))throw TypeError(String(t)+" is not an object");return t}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){var r=n(17);t.exports=!r((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var r=n(0),o=n(114).f,i=n(9),a=n(22),c=n(60),u=n(235),f=n(120);t.exports=function(t,e){var n,s,l,h,p,d=t.target,g=t.global,v=t.stat;if(n=g?r:v?r[d]||c(d,{}):(r[d]||{}).prototype)for(s in e){if(h=e[s],l=t.noTargetGet?(p=o(n,s))&&p.value:n[s],!f(g?s:d+(v?".":"#")+s,t.forced)&&void 0!==l){if(typeof h==typeof l)continue;u(h,l)}(t.sham||l&&l.sham)&&i(h,"sham",!0),a(n,s,h,t)}}},function(t,e,n){var r=n(0),o=n(40),i=n(9),a=n(8),c=n(60),u=n(118),f=n(41),s=f.get,l=f.enforce,h=String(u).split("toString");o("inspectSource",(function(t){return u.call(t)})),(t.exports=function(t,e,n,o){var u=!!o&&!!o.unsafe,f=!!o&&!!o.enumerable,s=!!o&&!!o.noTargetGet;"function"==typeof n&&("string"!=typeof e||a(n,"name")||i(n,"name",e),l(n).source=h.join("string"==typeof e?e:"")),t!==r?(u?!s&&t[e]&&(f=!0):delete t[e],f?t[e]=n:i(t,e,n)):f?t[e]=n:c(e,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&s(this).source||u.call(this)}))},function(t,e){t.exports={}},function(t,e,n){var r=n(10);t.exports=!r((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var r=n(24),o=n(142),i=n(138);t.exports=r?function(t,e,n){return o.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(46);t.exports=function(t){if(!r(t))throw TypeError(String(t)+" is not an object");return t}},function(t,e,n){var r=n(6),o=n(47),i=n(26),a=n(25),c=n(73),u=n(143),f=n(277),s=f.get,l=f.enforce,h=String(u).split("toString");o("inspectSource",(function(t){return u.call(t)})),(t.exports=function(t,e,n,o){var u=!!o&&!!o.unsafe,f=!!o&&!!o.enumerable,s=!!o&&!!o.noTargetGet;"function"==typeof n&&("string"!=typeof e||a(n,"name")||i(n,"name",e),l(n).source=h.join("string"==typeof e?e:"")),t!==r?(u?!s&&t[e]&&(f=!0):delete t[e],f?t[e]=n:i(t,e,n)):f?t[e]=n:c(e,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&s(this).source||u.call(this)}))},function(t,e,n){"use strict";n(156),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,o=(r=n(179))&&r.__esModule?r:{default:r},i=n(196);var a=o.default.create({headers:{requesttoken:(0,i.getRequestToken)()}}),c=Object.assign(a,{CancelToken:o.default.CancelToken,isCancel:o.default.isCancel});(0,i.onRequestTokenUpdate)((function(t){return a.defaults.headers.requesttoken=t}));var u=c;e.default=u},function(t,e,n){"use strict";n(274),n(288),n(289),n(292),n(296),n(297),n(298),Object.defineProperty(e,"__esModule",{value:!0}),e.getRootUrl=e.generateFilePath=e.imagePath=e.generateUrl=e.generateOcsUrl=e.generateRemoteUrl=e.linkTo=void 0;e.linkTo=function(t,e){return r(t,"",e)};e.generateRemoteUrl=function(t){return window.location.protocol+"//"+window.location.host+function(t){return o()+"/remote.php/"+t}(t)};e.generateOcsUrl=function(t,e){return e=2!==e?1:2,window.location.protocol+"//"+window.location.host+o()+"/ocs/v"+e+".php/"+t+"/"};e.generateUrl=function(t,e,n){var r=Object.assign({escape:!0,noRewrite:!1},n||{}),i=function(t,e){return e=e||{},t.replace(/{([^{}]*)}/g,(function(t,n){var o=e[n];return r.escape?"string"==typeof o||"number"==typeof o?encodeURIComponent(o.toString()):encodeURIComponent(t):"string"==typeof o||"number"==typeof o?o.toString():t}))};return"/"!==t.charAt(0)&&(t="/"+t),!0!==OC.config.modRewriteWorking||r.noRewrite?o()+"/index.php"+i(t,e||{}):o()+i(t,e||{})};e.imagePath=function(t,e){return-1===e.indexOf(".")?r(t,"img",e+".svg"):r(t,"img",e)};var r=function(t,e,n){var r=-1!==OC.coreApps.indexOf(t),i=o();return"php"!==n.substring(n.length-3)||r?"php"===n.substring(n.length-3)||r?(i+="settings"!==t&&"core"!==t&&"search"!==t||"ajax"!==e?"/":"/index.php/",r||(i+="apps/"),""!==t&&(i+=t+="/"),e&&(i+=e+"/"),i+=n):(i=OC.appswebroots[t],e&&(i+="/"+e+"/"),"/"!==i.substring(i.length-1)&&(i+="/"),i+=n):(i+="/index.php/apps/"+t,"index.php"!==n&&(i+="/",e&&(i+=encodeURI(e+"/")),i+=n)),i};e.generateFilePath=r;var o=function(){return OC.webroot};e.getRootUrl=o},function(t,e,n){"use strict";function r(t,e,n,r,o,i,a,c){var u,f="function"==typeof t?t.options:t;if(e&&(f.render=e,f.staticRenderFns=n,f._compiled=!0),r&&(f.functional=!0),i&&(f._scopeId="data-v-"+i),a?(u=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},f._ssrRegister=u):o&&(u=c?function(){o.call(this,this.$root.$options.shadowRoot)}:o),u)if(f.functional){f._injectStyles=u;var s=f.render;f.render=function(t,e){return u.call(e),s(t,e)}}else{var l=f.beforeCreate;f.beforeCreate=l?[].concat(l,u):[u]}return{exports:t,options:f}}n.d(e,"a",(function(){return r}))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){var r=n(16),o=n(84),i=n(79);t.exports=r?function(t,e,n){return o.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(15);t.exports=!r((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(t,e,n){var r=n(35),o=n(107),i=n(101);t.exports=r?function(t,e,n){return o.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(4),o=n(55),i=n(203),a=r["__core-js_shared__"]||o("__core-js_shared__",{});(t.exports=function(t,e){return a[t]||(a[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.2.1",mode:i?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){var r=n(115),o=n(57);t.exports=function(t){return r(o(t))}},function(t,e,n){var r=n(59),o=n(233);(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.3.6",mode:r?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(t,e,n){var r,o,i,a=n(234),c=n(0),u=n(5),f=n(9),s=n(8),l=n(61),h=n(42),p=c.WeakMap;if(a){var d=new p,g=d.get,v=d.has,b=d.set;r=function(t,e){return b.call(d,t,e),e},o=function(t){return g.call(d,t)||{}},i=function(t){return v.call(d,t)}}else{var y=l("state");h[y]=!0,r=function(t,e){return f(t,y,e),e},o=function(t){return s(t,y)?t[y]:{}},i=function(t){return s(t,y)}}t.exports={set:r,get:o,has:i,enforce:function(t){return i(t)?o(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!u(e)||(n=o(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}}},function(t,e){t.exports={}},function(t,e,n){var r=n(237),o=n(0),i=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,e){return arguments.length<2?i(r[t])||i(o[t]):r[t]&&r[t][e]||o[t]&&o[t][e]}},function(t,e,n){var r=n(63),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){var r=n(6),o=n(73),i=n(276),a=r["__core-js_shared__"]||o("__core-js_shared__",{});(t.exports=function(t,e){return a[t]||(a[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.1.3",mode:i?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){var r=n(304);"string"==typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);(0,n(154).default)("9939401a",r,!0,{})},function(e,n,r){"use strict";var o=r(29),i=r.n(o),a=r(30),c=r(12);function u(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}var f,s,l=!!document.getElementById("isPublic"),h=Object(a.generateOcsUrl)("apps/text"+(l?"/public":""),2)+"workspace",p={name:"RichWorkspace",components:{EditorWrapper:function(){return Promise.all([r.e(0),r.e(188),r.e(197),r.e(186),r.e(189)]).then(r.bind(null,307))}},props:{path:{type:String,required:!0}},data:function(){return{file:null,loaded:!1,ready:!1,autofocus:!1}},computed:{shareToken:function(){return document.getElementById("sharingToken")?document.getElementById("sharingToken").value:null}},watch:{path:function(){this.getFileInfo()}},mounted:(f=regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.getFileInfo();case 1:case"end":return t.stop()}}),t,this)})),s=function(){var t=this,e=arguments;return new Promise((function(n,r){var o=f.apply(t,e);function i(t){u(o,n,r,i,a,"next",t)}function a(t){u(o,n,r,i,a,"throw",t)}i(void 0)}))},function(){return s.apply(this,arguments)}),methods:{getFileInfo:function(){var t=this;this.loaded=!1,this.autofocus=!1,this.ready=!1;var e={path:this.path};l&&(e.shareToken=this.shareToken),i.a.get(h,{params:e}).then((function(e){var n=e.data.ocs.data;t.file=n.file,t.editing=!0,t.loaded=!0})).catch((function(){t.file=null,t.loaded=!0,t.ready=!0}))},createNew:function(){var t=this;this.creating||(this.creating=!0,window.FileList.createFile("README.md",{scrollTo:!1,animate:!1}).then((function(e,n){t.getFileInfo(),t.autofocus=!0,t.creating=!1})))}}},d=(r(303),r(31)),g=Object(d.a)(p,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:{"icon-loading":!t.loaded||!t.ready},attrs:{id:"rich-workspace"}},[!t.file||t.autofocus&&!t.ready?n("div",{staticClass:"empty-workspace",on:{click:t.createNew}},[n("p",{staticClass:"placeholder"},[t._v("\n\t\t\t"+t._s(t.t("text","Add notes, lists or links …"))+"\n\t\t")])]):t._e(),t._v(" "),t.file?n("EditorWrapper",{directives:[{name:"show",rawName:"v-show",value:t.ready,expression:"ready"}],key:t.file.id,attrs:{"file-id":t.file.id,"relative-path":t.file.path,"share-token":t.shareToken,active:!0,autohide:!0,mime:t.file.mimetype,autofocus:t.autofocus},on:{ready:function(e){t.ready=!0}}}):t._e()],1)}),[],!1,null,"455cf303",null).exports;function v(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}r.d(n,"b",(function(){return b})),r.d(n,"c",(function(){return m})),r.d(n,"d",(function(){return y})),r.d(n,"a",(function(){return x})); /* * @copyright Copyright (c) 2019 Julius Härtl * * @author Julius Härtl * * @license GNU AGPL version 3 or any later version * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * */ var b=function(){var t=function(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){v(i,r,o,a,c,"next",t)}function c(t){v(i,r,o,a,c,"throw",t)}a(void 0)}))}}(regeneratorRuntime.mark((function t(e,n){var r,o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i()({method:"PROPFIND",url:Object(a.generateRemoteUrl)("dav/files/".concat(e).concat(n)),headers:{requesttoken:OC.requestToken,"content-Type":"text/xml"},data:'\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n'});case 2:return r=t.sent,o=OCA.Files.App.fileList.filesClient._client.parseMultiStatus(r.data),t.abrupt("return",o.map((function(t){var e=OCA.Files.App.fileList.filesClient._parseFileInfo(t);return e.href=t.href,e})));case 5:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),y=function(){var e={attach:function(e){var n=e.fileList;"files"!==n.id&&"files.public"!==n.id||e.addMenuEntry({id:"file",displayName:t("text","New text document"),templateName:t("text","New text document")+".md",iconClass:"icon-filetype-text",fileType:"file",actionHandler:function(t){n.createFile(t).then((function(t,e){var r=new OCA.Files.FileInfoModel(e);void 0!==OCA.Viewer?OCA.Files.fileActions.triggerAction("view",r,n):void 0===OCA.Viewer&&OCA.Files.fileActions.triggerAction("Edit with text app",r,n)}))}})}};OC.Plugins.register("OCA.Files.NewFileMenu",e)},m=function(){var e=document.getElementById("sharingToken")?document.getElementById("sharingToken").value:null,n=document.getElementById("dir").value;if(!e||""!==n){var o=document.createElement("div");o.id="text-viewer-fallback",document.body.appendChild(o);for(var i=function(n){return OCA.Files.fileActions.register(n,"Edit with text app",OC.PERMISSION_UPDATE|OC.PERMISSION_READ,OC.imagePath("core","actions/rename"),(function(t){var n=window.FileList.findFile(t);Promise.all([r.e(0).then(r.bind(null,306)),Promise.all([r.e(0),r.e(199),r.e(194)]).then(r.bind(null,634))]).then((function(r){var i=window.FileList.getCurrentDirectory()+"/"+t,a=r[0].default;a.prototype.t=window.t,a.prototype.n=window.n,a.prototype.OCA=window.OCA;var c=r[1].default;new a({render:function(t){return t(c,{props:{fileId:n?n.id:null,active:!0,shareToken:e,relativePath:i,mimeType:n.mimetype}})}}).$mount(o)}))}),t("text","Edit"))},a=0;a0?r:n)(t)}},function(t,e){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(t,e,n){var r=n(57);t.exports=function(t){return Object(r(t))}},function(t,e,n){var r=n(246);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}}},function(t,e,n){var r=n(14),o=n(250),i=n(64),a=n(42),c=n(252),u=n(117),f=n(61)("IE_PROTO"),s=function(){},l=function(){var t,e=u("iframe"),n=i.length;for(e.style.display="none",c.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write("