From e8e7f9f9f145f26a03741b39273a5736acd2c72e Mon Sep 17 00:00:00 2001 From: flarum-bot Date: Sun, 10 Nov 2024 10:41:58 +0000 Subject: [PATCH] Bundled output for commit 28cc29be53eb8f8278a5a68866320caf42eae941 Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci] --- js/dist/admin.js | 2 +- js/dist/admin.js.map | 2 +- js/dist/forum.js | 2 +- js/dist/forum.js.map | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/js/dist/admin.js b/js/dist/admin.js index d1a4e5c..a473fc7 100644 --- a/js/dist/admin.js +++ b/js/dist/admin.js @@ -1,3 +1,3 @@ /*! For license information please see admin.js.LICENSE.txt */ -(()=>{var t={24:(t,e,i)=>{var a=i(735).default;function n(){"use strict";t.exports=n=function(){return i},t.exports.__esModule=!0,t.exports.default=t.exports;var e,i={},o=Object.prototype,r=o.hasOwnProperty,s=Object.defineProperty||function(t,e,i){t[e]=i.value},l="function"==typeof Symbol?Symbol:{},u=l.iterator||"@@iterator",f=l.asyncIterator||"@@asyncIterator",d=l.toStringTag||"@@toStringTag";function c(t,e,i){return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(e){c=function(t,e,i){return t[e]=i}}function p(t,e,i,a){var n=e&&e.prototype instanceof w?e:w,o=Object.create(n.prototype),r=new U(a||[]);return s(o,"_invoke",{value:P(t,i,r)}),o}function m(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}i.wrap=p;var h="suspendedStart",v="suspendedYield",g="executing",b="completed",y={};function w(){}function x(){}function _(){}var S={};c(S,u,(function(){return this}));var k=Object.getPrototypeOf,F=k&&k(k(B([])));F&&F!==o&&r.call(F,u)&&(S=F);var T=_.prototype=w.prototype=Object.create(S);function N(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function M(t,e){function i(n,o,s,l){var u=m(t[n],t,o);if("throw"!==u.type){var f=u.arg,d=f.value;return d&&"object"==a(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){i("next",t,s,l)}),(function(t){i("throw",t,s,l)})):e.resolve(d).then((function(t){f.value=t,s(f)}),(function(t){return i("throw",t,s,l)}))}l(u.arg)}var n;s(this,"_invoke",{value:function(t,a){function o(){return new e((function(e,n){i(t,a,e,n)}))}return n=n?n.then(o,o):o()}})}function P(t,i,a){var n=h;return function(o,r){if(n===g)throw Error("Generator is already running");if(n===b){if("throw"===o)throw r;return{value:e,done:!0}}for(a.method=o,a.arg=r;;){var s=a.delegate;if(s){var l=L(s,a);if(l){if(l===y)continue;return l}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(n===h)throw n=b,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);n=g;var u=m(t,i,a);if("normal"===u.type){if(n=a.done?b:v,u.arg===y)continue;return{value:u.arg,done:a.done}}"throw"===u.type&&(n=b,a.method="throw",a.arg=u.arg)}}}function L(t,i){var a=i.method,n=t.iterator[a];if(n===e)return i.delegate=null,"throw"===a&&t.iterator.return&&(i.method="return",i.arg=e,L(t,i),"throw"===i.method)||"return"!==a&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+a+"' method")),y;var o=m(n,t.iterator,i.arg);if("throw"===o.type)return i.method="throw",i.arg=o.arg,i.delegate=null,y;var r=o.arg;return r?r.done?(i[t.resultName]=r.value,i.next=t.nextLoc,"return"!==i.method&&(i.method="next",i.arg=e),i.delegate=null,y):r:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,y)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function U(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function B(t){if(t||""===t){var i=t[u];if(i)return i.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function i(){for(;++n=0;--n){var o=this.tryEntries[n],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(l&&u){if(this.prev=0;--i){var a=this.tryEntries[i];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),C(i),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var a=i.completion;if("throw"===a.type){var n=a.arg;C(i)}return n}}throw Error("illegal catch attempt")},delegateYield:function(t,i,a){return this.delegate={iterator:B(t),resultName:i,nextLoc:a},"next"===this.method&&(this.arg=e),y}},i}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports},735:t=>{function e(i){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(i)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},183:(t,e,i)=>{var a=i(24)();t.exports=a;try{regeneratorRuntime=a}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=a:Function("r","regeneratorRuntime = r")(a)}}},e={};function i(a){var n=e[a];if(void 0!==n)return n.exports;var o=e[a]={exports:{}};return t[a](o,o.exports,i),o.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var a in e)i.o(e,a)&&!i.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:e[a]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var a={};(()=>{"use strict";i.r(a),i.d(a,{components:()=>ut,extend:()=>xt});const t=flarum.core.compat["admin/app"];var e=i.n(t);function n(t,e){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},n(t,e)}function o(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,n(t,e)}const r=flarum.core.compat["common/components/Button"];var s=i.n(r);const l=flarum.core.compat["admin/utils/saveSettings"];var u=i.n(l);const f=flarum.core.compat["common/components/Alert"];var d=i.n(f);const c=flarum.core.compat["common/components/Select"];var p=i.n(c);const h=flarum.core.compat["common/components/Switch"];var v=i.n(h);const g=flarum.core.compat["admin/components/UploadImageButton"];var b=function(t){function i(){return t.apply(this,arguments)||this}return o(i,t),i.prototype.resourceUrl=function(){return e().forum.attribute("apiUrl")+"/"+this.attrs.path},i}(i.n(g)());const y=flarum.core.compat["common/utils/withAttr"];var w=i.n(y);const x=flarum.core.compat["common/utils/Stream"];var _=i.n(x);const S=flarum.core.compat["admin/components/ExtensionPage"];var k=i.n(S);const F=flarum.core.compat["common/utils/ItemList"];var T=i.n(F);const N=flarum.core.compat["common/components/Modal"];var M=i.n(N);const P=flarum.core.compat["common/components/LoadingIndicator"];var L=i.n(P),O=function(t){function i(){return t.apply(this,arguments)||this}o(i,t);var a=i.prototype;return a.oninit=function(e){t.prototype.oninit.call(this,e),this.uploading=!1,this.inspection={}},a.className=function(){return"Modal--small fof-upload-inspect-mime-modal"},a.title=function(){return e().translator.trans("fof-upload.admin.inspect-mime.title")},a.content=function(){return m("div",{className:"Modal-body"},m("p",null,e().translator.trans("fof-upload.admin.inspect-mime.description",{a:m("a",{href:"https://github.com/SoftCreatR/php-mime-detector"})})),m("p",null,e().translator.trans("fof-upload.admin.inspect-mime.select")),m("div",null,m("input",{type:"file",onchange:this.onupload.bind(this),disabled:this.uploading}),this.uploading?L().component():null),m("dl",null,m("dt",null,e().translator.trans("fof-upload.admin.inspect-mime.laravel-validation")),m("dd",null,void 0===this.inspection.laravel_validation?m("em",null,e().translator.trans("fof-upload.admin.inspect-mime.no-file-selected")):this.inspection.laravel_validation?e().translator.trans("fof-upload.admin.inspect-mime.validation-passed"):e().translator.trans("fof-upload.admin.inspect-mime.validation-failed",{error:this.inspection.laravel_validation_error||"?"}))),m("dl",null,m("dt",null,e().translator.trans("fof-upload.admin.inspect-mime.mime-detector")),m("dd",null,this.inspection.mime_detector?m("code",null,this.inspection.mime_detector):m("em",null,e().translator.trans("fof-upload.admin.inspect-mime.not-available")))),m("dl",null,m("dt",null,e().translator.trans("fof-upload.admin.inspect-mime.mime-fileinfo")),m("dd",null,this.inspection.php_mime?m("code",null,this.inspection.php_mime):m("em",null,e().translator.trans("fof-upload.admin.inspect-mime.not-available")))),m("dl",null,m("dt",null,e().translator.trans("fof-upload.admin.inspect-mime.guessed-extension")),m("dd",null,this.inspection.guessed_extension?m("code",null,this.inspection.guessed_extension):m("em",null,e().translator.trans("fof-upload.admin.inspect-mime.not-available")))))},a.onupload=function(t){for(var i=this,a=new FormData,n=0;n=0&&"fof-file-selected"]),s=t.filesBeingHidden.includes(e.uuid());return m("li",{"aria-busy":s,key:e.uuid()},m(st,{file:e,fileSelectable:o,isSelected:t.attrs.selectedFiles&&t.attrs.selectedFiles.indexOf(null!=(a=e.id())?a:"")>=0,fileClassNames:r,isFileHiding:s,onHide:t.hideFile.bind(t),onFileClick:t.onFileClick.bind(t),user:t.attrs.user,onDelete:t.onDelete.bind(t)}))})),this.hasMoreResults()&&m("div",{className:"fof-load-more-files"},m(s(),{className:"Button Button--primary",disabled:this.isLoading(),loading:this.isLoading(),onclick:function(){return t.loadMore()}},J().translator.trans("fof-upload.lib.file_list.load_more_files_btn")))))},i.onDelete=function(t){this.attrs.onDelete&&this.attrs.onDelete(t)},i.onFileClick=function(t){this.attrs.onFileSelect?this.attrs.onFileSelect(t):this.attrs.downloadOnClick&&window.open(t.url())},i.isSelectable=function(t){var e=t.type();return Array.isArray(this.restrictFileType)?this.restrictFileType.indexOf(e)>=0:"image"===this.restrictFileType?e.includes("image/"):"audio"===this.restrictFileType?e.includes("audio/"):"video"===this.restrictFileType&&e.includes("video/")},i.hideFile=function(){var t=W(K().mark((function t(e){var i,a,n,o,r;return K().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=e.uuid(),!this.filesBeingHidden.includes(i)){t.next=3;break}return t.abrupt("return");case 3:if(this.filesBeingHidden.push(i),a=e.isShared()?"fof-upload.lib.file_list.hide_shared_file":"fof-upload.lib.file_list.hide_file",!confirm(rt()(J().translator.trans(e.hidden()?a+".show_confirmation":a+".hide_confirmation",{fileName:e.baseName()})))){t.next=24;break}return t.prev=7,t.next=10,J().request({method:"PATCH",url:J().forum.attribute("apiUrl")+"/fof/upload/hide",body:{uuid:i}});case 10:n=t.sent,J().store.pushPayload(n),m.redraw(),J().alerts.show(d(),{type:"success"},[U()(e.hidden()?"fas fa-eye-slash":"fas fa-eye")," ",J().translator.trans(null!=e&&e.hidden()?a+".hide_success":a+".show_success")]),this.fileState.user&&(o=this.fileState.files.findIndex((function(t){return i===t.uuid()})),this.fileState.files.splice(o,1)),t.next=20;break;case 17:t.prev=17,t.t0=t.catch(7),J().alerts.show(d(),{type:"error"},J().translator.trans(null!=e&&e.hidden()?a+".hide_fail":a+".show_fail",{fileName:e.baseName()}));case 20:return t.prev=20,r=this.filesBeingHidden.indexOf(i),this.filesBeingHidden.splice(r,1),t.finish(20);case 24:case"end":return t.stop()}}),t,this,[[7,17,20,24]])})));return function(e){return t.apply(this,arguments)}}(),e}($()),ut=H({},{UploadedFile:tt,UploadSharedFileModal:X,UserFileList:function(t){function e(){return t.apply(this,arguments)||this}o(e,t);var i=e.prototype;return i.loadFileList=function(){this.fileState.setUser(this.attrs.user||J().session.user),this.user=this.fileState.user},i.hasMoreResults=function(){return this.fileState.hasMoreResults()},i.loadMore=function(){this.fileState.loadMore()},i.isLoading=function(){return this.fileState.isLoading()},i.fileCollection=function(){return this.fileState.files},e}(lt)},{UploadPage:I});const ft=flarum.core.compat["common/extenders"];var dt=i.n(ft);const ct=flarum.core.compat["common/Model"];var pt=i.n(ct),mt=function(t){function e(){return t.apply(this,arguments)||this}o(e,t);var i=e.prototype;return i.baseName=function(){return pt().attribute("baseName").call(this)},i.path=function(){return pt().attribute("path").call(this)},i.url=function(){return pt().attribute("url").call(this)},i.size=function(){return pt().attribute("size").call(this)},i.type=function(){return pt().attribute("type").call(this)},i.humanSize=function(){return pt().attribute("humanSize").call(this)},i.createdAt=function(){return pt().attribute("createdAt",pt().transformDate).call(this)},i.uuid=function(){return pt().attribute("uuid").call(this)},i.tag=function(){return pt().attribute("tag").call(this)},i.hidden=function(){return pt().attribute("hidden").call(this)},i.bbcode=function(){return pt().attribute("bbcode").call(this)},i.isShared=function(){return pt().attribute("shared").call(this)},i.isPrivateShared=function(){return pt().attribute("isPrivateShared").call(this)},i.canViewInfo=function(){return pt().attribute("canViewInfo").call(this)},i.canHide=function(){return pt().attribute("canHide").call(this)},i.canDelete=function(){return pt().attribute("canDelete").call(this)},i.apiEndpoint=function(){return"/fof/uploads"+(this.exists?"/"+this.id():"")},e}(pt());const ht=[(new(dt().Store)).add("files",mt).add("shared-files",mt)],vt=flarum.core.compat["admin/components/AdminPage"];var gt=i.n(vt),bt=function(t){function e(){return t.apply(this,arguments)||this}o(e,t);var i=e.prototype;return i.loadFileList=function(){this.fileState.loadResults()},i.hasMoreResults=function(){return this.fileState.hasMoreResults()},i.loadMore=function(){this.fileState.loadMore()},i.isLoading=function(){return this.fileState.isLoading()},i.fileCollection=function(){return this.fileState.files},e}(lt),yt=function(){function t(t){void 0===t&&(t=!1),this.user=void 0,this.files=void 0,this.moreResults=void 0,this.loading=void 0,this.sharedFiles=void 0,this.user=null,this.files=[],this.moreResults=!1,this.loading=!1,this.sharedFiles=t}var e=t.prototype;return e.setUser=function(t){t!==this.user&&(this.user=t,this.files=[],this.loadResults())},e.refresh=function(){this.files=[],this.loadResults(),m.redraw()},e.loadResults=function(){var t=W(K().mark((function t(e){var i,a,n;return K().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0===e&&(e=0),this.sharedFiles||this.user){t.next=3;break}return t.abrupt("return",Promise.reject("User not set"));case 3:return this.loading=!0,i="fof/uploads",a={},!this.sharedFiles&&this.user?a={filter:{user:this.user.id()},page:{offset:e}}:(i="fof/upload/shared-files",a={page:{offset:e}}),t.next=9,J().store.find(i,a);case 9:return n=t.sent,t.abrupt("return",this.parseResults(n));case 11:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.loadMore=function(){var t=W(K().mark((function t(){return K().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading=!0,t.abrupt("return",this.loadResults(this.files.length));case 2:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),e.parseResults=function(t){var e;return this.files=t,this.loading=!1,this.moreResults=!(null==(e=t.payload)||null==(e=e.links)||!e.next),m.redraw(),t},e.addToList=function(t){var e;Array.isArray(t)?(e=this.files).unshift.apply(e,t):this.files.unshift(t),m.redraw()},e.removeFromList=function(t){Array.isArray(t)?this.files=this.files.filter((function(e){return!t.includes(e)})):this.files=this.files.filter((function(e){return e!==t})),m.redraw()},e.hasFiles=function(){return this.files.length>0},e.isLoading=function(){return this.loading},e.hasMoreResults=function(){return this.moreResults},e.empty=function(){return!this.hasFiles()&&!this.isLoading()},t}(),wt=function(t){function i(){for(var e,i=arguments.length,a=new Array(i),n=0;n{var t={24:(t,e,i)=>{var a=i(735).default;function n(){"use strict";t.exports=n=function(){return i},t.exports.__esModule=!0,t.exports.default=t.exports;var e,i={},o=Object.prototype,r=o.hasOwnProperty,s=Object.defineProperty||function(t,e,i){t[e]=i.value},l="function"==typeof Symbol?Symbol:{},u=l.iterator||"@@iterator",f=l.asyncIterator||"@@asyncIterator",d=l.toStringTag||"@@toStringTag";function c(t,e,i){return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(e){c=function(t,e,i){return t[e]=i}}function p(t,e,i,a){var n=e&&e.prototype instanceof w?e:w,o=Object.create(n.prototype),r=new U(a||[]);return s(o,"_invoke",{value:P(t,i,r)}),o}function m(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}i.wrap=p;var h="suspendedStart",v="suspendedYield",g="executing",b="completed",y={};function w(){}function x(){}function _(){}var S={};c(S,u,(function(){return this}));var k=Object.getPrototypeOf,F=k&&k(k(B([])));F&&F!==o&&r.call(F,u)&&(S=F);var T=_.prototype=w.prototype=Object.create(S);function N(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function M(t,e){function i(n,o,s,l){var u=m(t[n],t,o);if("throw"!==u.type){var f=u.arg,d=f.value;return d&&"object"==a(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){i("next",t,s,l)}),(function(t){i("throw",t,s,l)})):e.resolve(d).then((function(t){f.value=t,s(f)}),(function(t){return i("throw",t,s,l)}))}l(u.arg)}var n;s(this,"_invoke",{value:function(t,a){function o(){return new e((function(e,n){i(t,a,e,n)}))}return n=n?n.then(o,o):o()}})}function P(t,i,a){var n=h;return function(o,r){if(n===g)throw Error("Generator is already running");if(n===b){if("throw"===o)throw r;return{value:e,done:!0}}for(a.method=o,a.arg=r;;){var s=a.delegate;if(s){var l=L(s,a);if(l){if(l===y)continue;return l}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(n===h)throw n=b,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);n=g;var u=m(t,i,a);if("normal"===u.type){if(n=a.done?b:v,u.arg===y)continue;return{value:u.arg,done:a.done}}"throw"===u.type&&(n=b,a.method="throw",a.arg=u.arg)}}}function L(t,i){var a=i.method,n=t.iterator[a];if(n===e)return i.delegate=null,"throw"===a&&t.iterator.return&&(i.method="return",i.arg=e,L(t,i),"throw"===i.method)||"return"!==a&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+a+"' method")),y;var o=m(n,t.iterator,i.arg);if("throw"===o.type)return i.method="throw",i.arg=o.arg,i.delegate=null,y;var r=o.arg;return r?r.done?(i[t.resultName]=r.value,i.next=t.nextLoc,"return"!==i.method&&(i.method="next",i.arg=e),i.delegate=null,y):r:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,y)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function U(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function B(t){if(t||""===t){var i=t[u];if(i)return i.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function i(){for(;++n=0;--n){var o=this.tryEntries[n],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(l&&u){if(this.prev=0;--i){var a=this.tryEntries[i];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),C(i),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var a=i.completion;if("throw"===a.type){var n=a.arg;C(i)}return n}}throw Error("illegal catch attempt")},delegateYield:function(t,i,a){return this.delegate={iterator:B(t),resultName:i,nextLoc:a},"next"===this.method&&(this.arg=e),y}},i}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports},735:t=>{function e(i){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(i)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},183:(t,e,i)=>{var a=i(24)();t.exports=a;try{regeneratorRuntime=a}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=a:Function("r","regeneratorRuntime = r")(a)}}},e={};function i(a){var n=e[a];if(void 0!==n)return n.exports;var o=e[a]={exports:{}};return t[a](o,o.exports,i),o.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var a in e)i.o(e,a)&&!i.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:e[a]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var a={};(()=>{"use strict";i.r(a),i.d(a,{components:()=>ut,extend:()=>xt});const t=flarum.core.compat["admin/app"];var e=i.n(t);function n(t,e){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},n(t,e)}function o(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,n(t,e)}const r=flarum.core.compat["common/components/Button"];var s=i.n(r);const l=flarum.core.compat["admin/utils/saveSettings"];var u=i.n(l);const f=flarum.core.compat["common/components/Alert"];var d=i.n(f);const c=flarum.core.compat["common/components/Select"];var p=i.n(c);const h=flarum.core.compat["common/components/Switch"];var v=i.n(h);const g=flarum.core.compat["admin/components/UploadImageButton"];var b=function(t){function i(){return t.apply(this,arguments)||this}return o(i,t),i.prototype.resourceUrl=function(){return e().forum.attribute("apiUrl")+"/"+this.attrs.path},i}(i.n(g)());const y=flarum.core.compat["common/utils/withAttr"];var w=i.n(y);const x=flarum.core.compat["common/utils/Stream"];var _=i.n(x);const S=flarum.core.compat["admin/components/ExtensionPage"];var k=i.n(S);const F=flarum.core.compat["common/utils/ItemList"];var T=i.n(F);const N=flarum.core.compat["common/components/Modal"];var M=i.n(N);const P=flarum.core.compat["common/components/LoadingIndicator"];var L=i.n(P),O=function(t){function i(){return t.apply(this,arguments)||this}o(i,t);var a=i.prototype;return a.oninit=function(e){t.prototype.oninit.call(this,e),this.uploading=!1,this.inspection={}},a.className=function(){return"Modal--small fof-upload-inspect-mime-modal"},a.title=function(){return e().translator.trans("fof-upload.admin.inspect-mime.title")},a.content=function(){return m("div",{className:"Modal-body"},m("p",null,e().translator.trans("fof-upload.admin.inspect-mime.description",{a:m("a",{href:"https://github.com/SoftCreatR/php-mime-detector"})})),m("p",null,e().translator.trans("fof-upload.admin.inspect-mime.select")),m("div",null,m("input",{type:"file",onchange:this.onupload.bind(this),disabled:this.uploading}),this.uploading?L().component():null),m("dl",null,m("dt",null,e().translator.trans("fof-upload.admin.inspect-mime.laravel-validation")),m("dd",null,void 0===this.inspection.laravel_validation?m("em",null,e().translator.trans("fof-upload.admin.inspect-mime.no-file-selected")):this.inspection.laravel_validation?e().translator.trans("fof-upload.admin.inspect-mime.validation-passed"):e().translator.trans("fof-upload.admin.inspect-mime.validation-failed",{error:this.inspection.laravel_validation_error||"?"}))),m("dl",null,m("dt",null,e().translator.trans("fof-upload.admin.inspect-mime.mime-detector")),m("dd",null,this.inspection.mime_detector?m("code",null,this.inspection.mime_detector):m("em",null,e().translator.trans("fof-upload.admin.inspect-mime.not-available")))),m("dl",null,m("dt",null,e().translator.trans("fof-upload.admin.inspect-mime.mime-fileinfo")),m("dd",null,this.inspection.php_mime?m("code",null,this.inspection.php_mime):m("em",null,e().translator.trans("fof-upload.admin.inspect-mime.not-available")))),m("dl",null,m("dt",null,e().translator.trans("fof-upload.admin.inspect-mime.guessed-extension")),m("dd",null,this.inspection.guessed_extension?m("code",null,this.inspection.guessed_extension):m("em",null,e().translator.trans("fof-upload.admin.inspect-mime.not-available")))))},a.onupload=function(t){for(var i=this,a=new FormData,n=0;n=0&&"fof-file-selected"]),s=t.filesBeingHidden.includes(e.uuid());return m("li",{"aria-busy":s,key:e.uuid()},m(st,{file:e,fileSelectable:o,isSelected:t.attrs.selectedFiles&&t.attrs.selectedFiles.indexOf(null!=(a=e.id())?a:"")>=0,fileClassNames:r,isFileHiding:s,onHide:t.hideFile.bind(t),onFileClick:t.onFileClick.bind(t),user:t.attrs.user,onDelete:t.onDelete.bind(t)}))}))),this.hasMoreResults()&&m("div",{className:"fof-load-more-files"},m(s(),{className:"Button Button--primary",disabled:this.isLoading(),loading:this.isLoading(),onclick:function(){return t.loadMore()}},J().translator.trans("fof-upload.lib.file_list.load_more_files_btn"))))},i.onDelete=function(t){this.attrs.onDelete&&this.attrs.onDelete(t)},i.onFileClick=function(t){this.attrs.onFileSelect?this.attrs.onFileSelect(t):this.attrs.downloadOnClick&&window.open(t.url())},i.isSelectable=function(t){var e=t.type();return Array.isArray(this.restrictFileType)?this.restrictFileType.indexOf(e)>=0:"image"===this.restrictFileType?e.includes("image/"):"audio"===this.restrictFileType?e.includes("audio/"):"video"===this.restrictFileType&&e.includes("video/")},i.hideFile=function(){var t=W(K().mark((function t(e){var i,a,n,o,r;return K().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=e.uuid(),!this.filesBeingHidden.includes(i)){t.next=3;break}return t.abrupt("return");case 3:if(this.filesBeingHidden.push(i),a=e.isShared()?"fof-upload.lib.file_list.hide_shared_file":"fof-upload.lib.file_list.hide_file",!confirm(rt()(J().translator.trans(e.hidden()?a+".show_confirmation":a+".hide_confirmation",{fileName:e.baseName()})))){t.next=24;break}return t.prev=7,t.next=10,J().request({method:"PATCH",url:J().forum.attribute("apiUrl")+"/fof/upload/hide",body:{uuid:i}});case 10:n=t.sent,J().store.pushPayload(n),m.redraw(),J().alerts.show(d(),{type:"success"},[U()(e.hidden()?"fas fa-eye-slash":"fas fa-eye")," ",J().translator.trans(null!=e&&e.hidden()?a+".hide_success":a+".show_success")]),this.fileState.user&&(o=this.fileState.files.findIndex((function(t){return i===t.uuid()})),this.fileState.files.splice(o,1)),t.next=20;break;case 17:t.prev=17,t.t0=t.catch(7),J().alerts.show(d(),{type:"error"},J().translator.trans(null!=e&&e.hidden()?a+".hide_fail":a+".show_fail",{fileName:e.baseName()}));case 20:return t.prev=20,r=this.filesBeingHidden.indexOf(i),this.filesBeingHidden.splice(r,1),t.finish(20);case 24:case"end":return t.stop()}}),t,this,[[7,17,20,24]])})));return function(e){return t.apply(this,arguments)}}(),e}($()),ut=H({},{UploadedFile:tt,UploadSharedFileModal:X,UserFileList:function(t){function e(){return t.apply(this,arguments)||this}o(e,t);var i=e.prototype;return i.loadFileList=function(){this.fileState.setUser(this.attrs.user||J().session.user),this.user=this.fileState.user},i.hasMoreResults=function(){return this.fileState.hasMoreResults()},i.loadMore=function(){this.fileState.loadMore()},i.isLoading=function(){return this.fileState.isLoading()},i.fileCollection=function(){return this.fileState.files},e}(lt)},{UploadPage:I});const ft=flarum.core.compat["common/extenders"];var dt=i.n(ft);const ct=flarum.core.compat["common/Model"];var pt=i.n(ct),mt=function(t){function e(){return t.apply(this,arguments)||this}o(e,t);var i=e.prototype;return i.baseName=function(){return pt().attribute("baseName").call(this)},i.path=function(){return pt().attribute("path").call(this)},i.url=function(){return pt().attribute("url").call(this)},i.size=function(){return pt().attribute("size").call(this)},i.type=function(){return pt().attribute("type").call(this)},i.humanSize=function(){return pt().attribute("humanSize").call(this)},i.createdAt=function(){return pt().attribute("createdAt",pt().transformDate).call(this)},i.uuid=function(){return pt().attribute("uuid").call(this)},i.tag=function(){return pt().attribute("tag").call(this)},i.hidden=function(){return pt().attribute("hidden").call(this)},i.bbcode=function(){return pt().attribute("bbcode").call(this)},i.isShared=function(){return pt().attribute("shared").call(this)},i.isPrivateShared=function(){return pt().attribute("isPrivateShared").call(this)},i.canViewInfo=function(){return pt().attribute("canViewInfo").call(this)},i.canHide=function(){return pt().attribute("canHide").call(this)},i.canDelete=function(){return pt().attribute("canDelete").call(this)},i.apiEndpoint=function(){return"/fof/uploads"+(this.exists?"/"+this.id():"")},e}(pt());const ht=[(new(dt().Store)).add("files",mt).add("shared-files",mt)],vt=flarum.core.compat["admin/components/AdminPage"];var gt=i.n(vt),bt=function(t){function e(){return t.apply(this,arguments)||this}o(e,t);var i=e.prototype;return i.loadFileList=function(){this.fileState.loadResults()},i.hasMoreResults=function(){return this.fileState.hasMoreResults()},i.loadMore=function(){this.fileState.loadMore()},i.isLoading=function(){return this.fileState.isLoading()},i.fileCollection=function(){return this.fileState.files},e}(lt),yt=function(){function t(t){void 0===t&&(t=!1),this.user=void 0,this.files=void 0,this.moreResults=void 0,this.loading=void 0,this.sharedFiles=void 0,this.user=null,this.files=[],this.moreResults=!1,this.loading=!1,this.sharedFiles=t}var e=t.prototype;return e.setUser=function(t){t!==this.user&&(this.user=t,this.files=[],this.loadResults())},e.refresh=function(){this.files=[],this.loadResults(),m.redraw()},e.loadResults=function(){var t=W(K().mark((function t(e){var i,a,n;return K().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0===e&&(e=0),this.sharedFiles||this.user){t.next=3;break}return t.abrupt("return",Promise.reject("User not set"));case 3:return this.loading=!0,i="fof/uploads",a={},!this.sharedFiles&&this.user?a={filter:{user:this.user.id()},page:{offset:e}}:(i="fof/upload/shared-files",a={page:{offset:e}}),t.next=9,J().store.find(i,a);case 9:return n=t.sent,t.abrupt("return",this.parseResults(n));case 11:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.loadMore=function(){var t=W(K().mark((function t(){return K().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading=!0,t.abrupt("return",this.loadResults(this.files.length));case 2:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),e.parseResults=function(t){var e;return this.files=this.files.concat(t),this.loading=!1,this.moreResults=!(null==(e=t.payload)||null==(e=e.links)||!e.next),m.redraw(),t},e.addToList=function(t){var e;Array.isArray(t)?(e=this.files).unshift.apply(e,t):this.files.unshift(t),m.redraw()},e.removeFromList=function(t){Array.isArray(t)?this.files=this.files.filter((function(e){return!t.includes(e)})):this.files=this.files.filter((function(e){return e!==t})),m.redraw()},e.hasFiles=function(){return this.files.length>0},e.isLoading=function(){return this.loading},e.hasMoreResults=function(){return this.moreResults},e.empty=function(){return!this.hasFiles()&&!this.isLoading()},t}(),wt=function(t){function i(){for(var e,i=arguments.length,a=new Array(i),n=0;n= 0; --o) {\n var i = this.tryEntries[o],\n a = i.completion;\n if (\"root\" === i.tryLoc) return handle(\"end\");\n if (i.tryLoc <= this.prev) {\n var c = n.call(i, \"catchLoc\"),\n u = n.call(i, \"finallyLoc\");\n if (c && u) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n } else if (c) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n } else {\n if (!u) throw Error(\"try statement without catch or finally\");\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n }\n }\n }\n },\n abrupt: function abrupt(t, e) {\n for (var r = this.tryEntries.length - 1; r >= 0; --r) {\n var o = this.tryEntries[r];\n if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) {\n var i = o;\n break;\n }\n }\n i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);\n var a = i ? i.completion : {};\n return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a);\n },\n complete: function complete(t, e) {\n if (\"throw\" === t.type) throw t.arg;\n return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y;\n },\n finish: function finish(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;\n }\n },\n \"catch\": function _catch(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.tryLoc === t) {\n var n = r.completion;\n if (\"throw\" === n.type) {\n var o = n.arg;\n resetTryEntry(r);\n }\n return o;\n }\n }\n throw Error(\"illegal catch attempt\");\n },\n delegateYield: function delegateYield(e, r, n) {\n return this.delegate = {\n iterator: values(e),\n resultName: r,\n nextLoc: n\n }, \"next\" === this.method && (this.arg = t), y;\n }\n }, e;\n}\nmodule.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(o);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","// TODO(Babel 8): Remove this file.\n\nvar runtime = require(\"../helpers/regeneratorRuntime\")();\nmodule.exports = runtime;\n\n// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\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\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (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__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (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};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","function _setPrototypeOf(t, e) {\n return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {\n return t.__proto__ = e, t;\n }, _setPrototypeOf(t, e);\n}\nexport { _setPrototypeOf as default };","import setPrototypeOf from \"./setPrototypeOf.js\";\nfunction _inheritsLoose(t, o) {\n t.prototype = Object.create(o.prototype), t.prototype.constructor = t, setPrototypeOf(t, o);\n}\nexport { _inheritsLoose as default };","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/utils/saveSettings'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Alert'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Select'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Switch'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/UploadImageButton'];","import app from 'flarum/admin/app';\nimport FlarumUploadImageButton from 'flarum/admin/components/UploadImageButton';\n\nexport default class UploadImageButton extends FlarumUploadImageButton {\n resourceUrl() {\n return app.forum.attribute('apiUrl') + '/' + this.attrs.path;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/withAttr'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/ExtensionPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","import app from 'flarum/admin/app';\nimport Modal from 'flarum/common/components/Modal';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\n\nexport default class InspectMimeModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.uploading = false;\n this.inspection = {};\n }\n\n className() {\n return 'Modal--small fof-upload-inspect-mime-modal';\n }\n\n title() {\n return app.translator.trans('fof-upload.admin.inspect-mime.title');\n }\n\n content() {\n return (\n
\n

\n {app.translator.trans('fof-upload.admin.inspect-mime.description', {\n a: ,\n })}\n

\n

{app.translator.trans('fof-upload.admin.inspect-mime.select')}

\n
\n \n {this.uploading ? LoadingIndicator.component() : null}\n
\n
\n
{app.translator.trans('fof-upload.admin.inspect-mime.laravel-validation')}
\n
\n {typeof this.inspection.laravel_validation === 'undefined' ? (\n {app.translator.trans('fof-upload.admin.inspect-mime.no-file-selected')}\n ) : this.inspection.laravel_validation ? (\n app.translator.trans('fof-upload.admin.inspect-mime.validation-passed')\n ) : (\n app.translator.trans('fof-upload.admin.inspect-mime.validation-failed', {\n error: this.inspection.laravel_validation_error || '?',\n })\n )}\n
\n
\n
\n
{app.translator.trans('fof-upload.admin.inspect-mime.mime-detector')}
\n
\n {this.inspection.mime_detector ? (\n {this.inspection.mime_detector}\n ) : (\n {app.translator.trans('fof-upload.admin.inspect-mime.not-available')}\n )}\n
\n
\n
\n
{app.translator.trans('fof-upload.admin.inspect-mime.mime-fileinfo')}
\n
\n {this.inspection.php_mime ? (\n {this.inspection.php_mime}\n ) : (\n {app.translator.trans('fof-upload.admin.inspect-mime.not-available')}\n )}\n
\n
\n
\n
{app.translator.trans('fof-upload.admin.inspect-mime.guessed-extension')}
\n
\n {this.inspection.guessed_extension ? (\n {this.inspection.guessed_extension}\n ) : (\n {app.translator.trans('fof-upload.admin.inspect-mime.not-available')}\n )}\n
\n
\n
\n );\n }\n\n onupload(event) {\n const body = new FormData();\n\n for (let i = 0; i < event.target.files.length; i++) {\n body.append('files[]', event.target.files[i]);\n }\n\n this.uploading = true;\n\n return app\n .request({\n method: 'POST',\n url: app.forum.attribute('apiUrl') + '/fof/upload/inspect-mime',\n serialize: (raw) => raw,\n body,\n })\n .then((result) => {\n this.uploading = false;\n this.inspection = result;\n m.redraw();\n })\n .catch((error) => {\n this.uploading = false;\n this.inspection = {};\n m.redraw();\n\n throw error;\n });\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Link'];","import app from 'flarum/admin/app';\nimport Button from 'flarum/common/components/Button';\nimport saveSettings from 'flarum/admin/utils/saveSettings';\nimport Alert from 'flarum/common/components/Alert';\nimport Select from 'flarum/common/components/Select';\nimport Switch from 'flarum/common/components/Switch';\nimport UploadImageButton from './UploadImageButton';\nimport withAttr from 'flarum/common/utils/withAttr';\nimport Stream from 'flarum/common/utils/Stream';\nimport ExtensionPage from 'flarum/admin/components/ExtensionPage';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport InspectMimeModal from './InspectMimeModal';\nimport icon from 'flarum/common/helpers/icon';\nimport Link from 'flarum/common/components/Link';\n\n/* global m */\n\nexport default class UploadPage extends ExtensionPage {\n oninit(vnode) {\n super.oninit(vnode);\n // whether we are saving the settings or not right now\n this.loading = false;\n\n // the fields we need to watch and to save\n this.fields = [\n // image\n 'resizeMaxWidth',\n 'cdnUrl',\n 'maxFileSize',\n 'whitelistedClientExtensions',\n 'composerButtonVisiblity',\n // watermark\n 'watermark',\n 'watermarkPosition',\n // Imgur\n 'imgurClientId',\n // AWS\n 'awsS3Key',\n 'awsS3Secret',\n 'awsS3Bucket',\n 'awsS3Region',\n 'awsS3Endpoint',\n 'awsS3ACL',\n 'awsS3CustomUrl',\n // QIniu\n 'qiniuKey',\n 'qiniuSecret',\n 'qiniuBucket',\n ];\n\n // the checkboxes we need to watch and to save.\n this.checkboxes = ['mustResize', 'addsWatermarks', 'disableHotlinkProtection', 'disableDownloadLogging', 'awsS3UsePathStyleEndpoint'];\n\n // fields that are objects\n this.objects = ['mimeTypes'];\n\n // watermark positions\n this.watermarkPositions = {\n 'top-left': 'top-left',\n 'top-right': 'top-right',\n 'bottom-left': 'bottom-left',\n 'bottom-right': 'bottom-right',\n center: 'center',\n left: 'left',\n top: 'top',\n right: 'right',\n bottom: 'bottom',\n };\n\n // Composer button options\n this.composerButtonVisiblityOptions = {\n both: app.translator.trans('fof-upload.admin.labels.composer_buttons.options.both'),\n 'upload-btn': app.translator.trans('fof-upload.admin.labels.composer_buttons.options.upload-btn'),\n 'media-btn': app.translator.trans('fof-upload.admin.labels.composer_buttons.options.media-btn'),\n };\n\n // get the saved settings from the database\n const settings = app.data.settings;\n\n // our package prefix (to be added to every field and checkbox in the setting table)\n this.settingsPrefix = 'fof-upload';\n\n // Options for the Upload methods dropdown menu.\n this.uploadMethodOptions = settings[this.addPrefix('availableUploadMethods')] || {};\n // Options for the Template dropdown menu.\n this.templateOptions = settings[this.addPrefix('availableTemplates')] || {};\n // Contains current values.\n this.values = {};\n // bind the values of the fields and checkboxes to the getter/setter functions\n this.fields.forEach((key) => (this.values[key] = Stream(settings[this.addPrefix(key)])));\n this.checkboxes.forEach((key) => (this.values[key] = Stream(settings[this.addPrefix(key)] === '1')));\n this.objects.forEach((key) => (this.values[key] = settings[this.addPrefix(key)] ? Stream(JSON.parse(settings[this.addPrefix(key)])) : Stream()));\n\n // Set a sane default in case no mimeTypes have been configured yet.\n // Since 'local' (or others) can now be disabled, pick the last entry in the object for default\n this.defaultAdap = Object.keys(this.uploadMethodOptions)[Object.keys(this.uploadMethodOptions).length - 1];\n this.values.mimeTypes() ||\n (this.values.mimeTypes = Stream({\n '^image\\\\/.*': {\n adapter: this.defaultAdap,\n template: 'image-preview',\n },\n }));\n\n this.newMimeType = {\n regex: Stream(''),\n adapter: Stream(this.defaultAdap),\n template: Stream('file'),\n };\n }\n\n /**\n * Show the actual ImageUploadPage.\n *\n * @returns {*}\n */\n content() {\n const max_post = app.data.settings[this.addPrefix('php_ini.post_max_size')];\n const max_upload = app.data.settings[this.addPrefix('php_ini.upload_max_filesize')];\n return [\n m('.UploadPage', [\n m('.container', [\n m(\n 'form',\n {\n onsubmit: this.onsubmit.bind(this),\n },\n [\n m('fieldset', [\n m('legend', app.translator.trans('fof-upload.admin.labels.preferences.title')),\n m('label', app.translator.trans('fof-upload.admin.labels.preferences.max_file_size')),\n m('input.FormControl', {\n value: this.values.maxFileSize(),\n oninput: withAttr('value', this.values.maxFileSize),\n type: 'number',\n min: '0',\n }),\n m(\n '.helpText',\n app.translator.trans('fof-upload.admin.labels.preferences.php_ini_values', {\n post: max_post,\n upload: max_upload,\n })\n ),\n m('label', app.translator.trans('fof-upload.admin.labels.preferences.mime_types')),\n m(\n '.MimeTypes--Container',\n Object.keys(this.values.mimeTypes()).map((mime) => {\n let config = this.values.mimeTypes()[mime];\n // Compatibility for older versions.\n if (typeof config !== 'object') {\n config = {\n adapter: config,\n template: 'file',\n };\n }\n\n return m('div', [\n m('input.FormControl.MimeTypes', {\n value: mime,\n oninput: withAttr('value', this.updateMimeTypeKey.bind(this, mime)),\n }),\n Select.component({\n options: this.uploadMethodOptions,\n onchange: this.updateMimeTypeAdapter.bind(this, mime, config),\n value: config.adapter || 'local',\n }),\n Select.component({\n options: this.getTemplateOptionsForInput(),\n onchange: this.updateMimeTypeTemplate.bind(this, mime, config),\n value: config.template || 'local',\n }),\n Button.component(\n {\n type: 'button',\n className: 'Button Button--warning',\n onclick: this.deleteMimeType.bind(this, mime),\n },\n 'x'\n ),\n ]);\n }),\n m('br'),\n m('div', [\n m('input.FormControl.MimeTypes.add-MimeType-key', {\n value: this.newMimeType.regex(),\n oninput: withAttr('value', this.newMimeType.regex),\n }),\n Select.component({\n options: this.uploadMethodOptions,\n className: 'add-MimeType-value',\n oninput: withAttr('value', this.newMimeType.adapter),\n value: this.newMimeType.adapter(),\n }),\n Select.component({\n options: this.getTemplateOptionsForInput(),\n className: 'add-MimeType-value',\n oninput: withAttr('value', this.newMimeType.template),\n value: this.newMimeType.template(),\n }),\n Button.component(\n {\n type: 'button',\n className: 'Button Button--warning',\n onclick: this.addMimeType.bind(this),\n },\n '+'\n ),\n ])\n ),\n m('.helpText', app.translator.trans('fof-upload.admin.help_texts.mime_types')),\n Button.component(\n {\n className: 'Button',\n onclick() {\n app.modal.show(InspectMimeModal);\n },\n },\n app.translator.trans('fof-upload.admin.labels.inspect-mime')\n ),\n m('.helpText', app.translator.trans('fof-upload.admin.help_texts.download_templates')),\n this.templateOptionsDescriptions(),\n ]),\n m('fieldset.composerButtons', [\n m('legend', app.translator.trans('fof-upload.admin.labels.composer_buttons.title')),\n m('.helpText', app.translator.trans('fof-upload.admin.help_texts.composer_buttons')),\n m('div', [\n Select.component({\n options: this.composerButtonVisiblityOptions,\n onchange: this.values.composerButtonVisiblity,\n value: this.values.composerButtonVisiblity() || 'both',\n }),\n ]),\n ]),\n m('fieldset', [\n m('legend', app.translator.trans('fof-upload.admin.labels.resize.title')),\n m('.helpText', app.translator.trans('fof-upload.admin.help_texts.resize')),\n Switch.component(\n {\n state: this.values.mustResize() || false,\n onchange: this.values.mustResize,\n },\n app.translator.trans('fof-upload.admin.labels.resize.toggle')\n ),\n m('label', app.translator.trans('fof-upload.admin.labels.resize.max_width')),\n m('input', {\n className: 'FormControl',\n value: this.values.resizeMaxWidth() || 100,\n oninput: withAttr('value', this.values.resizeMaxWidth),\n disabled: !this.values.mustResize(),\n type: 'number',\n min: '0',\n }),\n ]),\n m('fieldset', [\n m('legend', app.translator.trans('fof-upload.admin.labels.client_extension.title')),\n m('.helpText', app.translator.trans('fof-upload.admin.help_texts.client_extension')),\n m('input', {\n className: 'FormControl',\n value: this.values.whitelistedClientExtensions() || '',\n oninput: withAttr('value', this.values.whitelistedClientExtensions),\n }),\n ]),\n m('fieldset', [\n m('legend', app.translator.trans('fof-upload.admin.labels.watermark.title')),\n m('.helpText', app.translator.trans('fof-upload.admin.help_texts.watermark')),\n Switch.component(\n {\n state: this.values.addsWatermarks() || false,\n onchange: this.values.addsWatermarks,\n },\n app.translator.trans('fof-upload.admin.labels.watermark.toggle')\n ),\n m('label', app.translator.trans('fof-upload.admin.labels.watermark.position')),\n m('div', [\n Select.component({\n options: this.watermarkPositions,\n onchange: this.values.watermarkPosition,\n value: this.values.watermarkPosition() || 'bottom-right',\n }),\n ]),\n m('label', {}, app.translator.trans('fof-upload.admin.labels.watermark.file')),\n UploadImageButton.component({\n name: 'fof-watermark',\n path: 'fof/watermark',\n }),\n ]),\n m('fieldset', [\n m('legend', app.translator.trans('fof-upload.admin.labels.disable-hotlink-protection.title')),\n m('.helpText', app.translator.trans('fof-upload.admin.help_texts.disable-hotlink-protection')),\n Switch.component(\n {\n state: this.values.disableHotlinkProtection() || false,\n onchange: this.values.disableHotlinkProtection,\n },\n app.translator.trans('fof-upload.admin.labels.disable-hotlink-protection.toggle')\n ),\n m('legend', app.translator.trans('fof-upload.admin.labels.disable-download-logging.title')),\n m('.helpText', app.translator.trans('fof-upload.admin.help_texts.disable-download-logging')),\n Switch.component(\n {\n state: this.values.disableDownloadLogging() || false,\n onchange: this.values.disableDownloadLogging,\n },\n app.translator.trans('fof-upload.admin.labels.disable-download-logging.toggle')\n ),\n ]),\n m('fieldset', [\n m('legend', app.translator.trans('fof-upload.admin.labels.local.title')),\n m('label', app.translator.trans('fof-upload.admin.labels.local.cdn_url')),\n m('input.FormControl', {\n value: this.values.cdnUrl() || '',\n oninput: withAttr('value', this.values.cdnUrl),\n }),\n ]),\n\n this.adaptorItems().toArray(),\n\n Button.component(\n {\n type: 'submit',\n className: 'Button Button--primary',\n loading: this.loading,\n disabled: !this.changed(),\n },\n app.translator.trans('core.admin.settings.submit_button')\n ),\n ]\n ),\n ]),\n ]),\n ];\n }\n\n adaptorItems() {\n const items = new ItemList();\n\n if (this.uploadMethodOptions['imgur'] !== undefined) {\n items.add(\n 'imgur',\n
\n
\n {app.translator.trans('fof-upload.admin.labels.imgur.title')}\n

\n {icon('fas fa-exclamation-circle')}{' '}\n {app.translator.trans('fof-upload.admin.labels.imgur.tos', {\n a: ,\n })}\n

\n \n \n
\n
,\n 100\n );\n }\n\n if (this.uploadMethodOptions['qiniu'] !== undefined) {\n items.add(\n 'qiniu',\n m('.qiniu', [\n m('fieldset', [\n m('legend', app.translator.trans('fof-upload.admin.labels.qiniu.title')),\n m('label', app.translator.trans('fof-upload.admin.labels.qiniu.key')),\n m('input.FormControl', {\n value: this.values.qiniuKey() || '',\n oninput: withAttr('value', this.values.qiniuKey),\n }),\n m('label', {}, app.translator.trans('fof-upload.admin.labels.qiniu.secret')),\n m('input.FormControl', {\n value: this.values.qiniuSecret() || '',\n oninput: withAttr('value', this.values.qiniuSecret),\n }),\n m('label', {}, app.translator.trans('fof-upload.admin.labels.qiniu.bucket')),\n m('input.FormControl', {\n value: this.values.qiniuBucket() || '',\n oninput: withAttr('value', this.values.qiniuBucket),\n }),\n ]),\n ]),\n 80\n );\n }\n\n if (this.uploadMethodOptions['aws-s3'] !== undefined) {\n items.add(\n 'aws-s3',\n m('.aws', [\n m('fieldset', [\n m('legend', app.translator.trans('fof-upload.admin.labels.aws-s3.title')),\n m('.helpText', app.translator.trans('fof-upload.admin.help_texts.s3_instance_profile')),\n m('label', app.translator.trans('fof-upload.admin.labels.aws-s3.key')),\n m('input.FormControl', {\n value: this.values.awsS3Key() || '',\n oninput: withAttr('value', this.values.awsS3Key),\n }),\n m('label', app.translator.trans('fof-upload.admin.labels.aws-s3.secret')),\n m('input.FormControl', {\n value: this.values.awsS3Secret() || '',\n oninput: withAttr('value', this.values.awsS3Secret),\n }),\n m('label', app.translator.trans('fof-upload.admin.labels.aws-s3.bucket')),\n m('input.FormControl', {\n value: this.values.awsS3Bucket() || '',\n oninput: withAttr('value', this.values.awsS3Bucket),\n }),\n m('label', app.translator.trans('fof-upload.admin.labels.aws-s3.region')),\n m('input.FormControl', {\n value: this.values.awsS3Region() || '',\n oninput: withAttr('value', this.values.awsS3Region),\n }),\n ]),\n m('fieldset', [\n m('legend', app.translator.trans('fof-upload.admin.labels.aws-s3.advanced_title')),\n m('.helpText', app.translator.trans('fof-upload.admin.help_texts.s3_compatible_storage')),\n m('label', app.translator.trans('fof-upload.admin.labels.aws-s3.endpoint')),\n m('input.FormControl', {\n value: this.values.awsS3Endpoint() || '',\n oninput: withAttr('value', this.values.awsS3Endpoint),\n }),\n Switch.component(\n {\n state: this.values.awsS3UsePathStyleEndpoint() || false,\n onchange: this.values.awsS3UsePathStyleEndpoint,\n },\n app.translator.trans('fof-upload.admin.labels.aws-s3.use_path_style_endpoint')\n ),\n m('label', app.translator.trans('fof-upload.admin.labels.aws-s3.acl')),\n m('input.FormControl', {\n value: this.values.awsS3ACL() || '',\n oninput: withAttr('value', this.values.awsS3ACL),\n }),\n m('.helpText', app.translator.trans('fof-upload.admin.help_texts.s3_acl')),\n m('label', app.translator.trans('fof-upload.admin.labels.aws-s3.custom_url')),\n m('input.FormControl', {\n value: this.values.awsS3CustomUrl() || '',\n oninput: withAttr('value', this.values.awsS3CustomUrl),\n }),\n m('.helpText', app.translator.trans('fof-upload.admin.help_texts.custom_s3_url')),\n ]),\n ]),\n 60\n );\n }\n\n return items;\n }\n\n getTemplateOptionsForInput() {\n const options = {};\n\n for (let option in this.templateOptions) {\n if (!this.templateOptions.hasOwnProperty(option)) {\n continue;\n }\n\n options[option] = this.templateOptions[option].name;\n }\n\n return options;\n }\n\n updateMimeTypeKey(mime, value) {\n this.values.mimeTypes()[value] = this.values.mimeTypes()[mime];\n\n this.deleteMimeType(mime);\n }\n\n updateMimeTypeAdapter(mime, config, value) {\n config.adapter = value;\n this.values.mimeTypes()[mime] = config;\n }\n\n updateMimeTypeTemplate(mime, config, value) {\n config.template = value;\n this.values.mimeTypes()[mime] = config;\n }\n\n deleteMimeType(mime) {\n delete this.values.mimeTypes()[mime];\n }\n\n templateOptionsDescriptions() {\n const children = [];\n\n for (let template in this.templateOptions) {\n if (!this.templateOptions.hasOwnProperty(template)) {\n continue;\n }\n\n children.push(\n
  • \n {this.templateOptions[template].name}: {m.trust(this.templateOptions[template].description)}\n
  • \n );\n }\n\n return m('ul', children);\n }\n\n addMimeType() {\n this.values.mimeTypes()[this.newMimeType.regex()] = {\n adapter: this.newMimeType.adapter(),\n template: this.newMimeType.template(),\n };\n\n this.newMimeType.regex('');\n this.newMimeType.adapter('local');\n this.newMimeType.template('file');\n }\n\n /**\n * Checks if the values of the fields and checkboxes are different from\n * the ones stored in the database\n *\n * @returns boolean\n */\n changed() {\n const fieldsCheck = this.fields.some((key) => this.values[key]() !== app.data.settings[this.addPrefix(key)]);\n const checkboxesCheck = this.checkboxes.some((key) => this.values[key]() !== (app.data.settings[this.addPrefix(key)] === '1'));\n const objectsCheck = this.objects.some((key) => JSON.stringify(this.values[key]()) !== app.data.settings[this.addPrefix(key)]);\n\n return fieldsCheck || checkboxesCheck || objectsCheck;\n }\n\n /**\n * Saves the settings to the database and redraw the page\n *\n * @param e\n */\n onsubmit(e) {\n // prevent the usual form submit behaviour\n e.preventDefault();\n\n // if the page is already saving, do nothing\n if (this.loading) return;\n\n // prevents multiple savings\n this.loading = true;\n\n // remove previous success popup\n app.alerts.dismiss(this.successAlert);\n\n const settings = {};\n\n // gets all the values from the form\n this.fields.forEach((key) => (settings[this.addPrefix(key)] = this.values[key]()));\n this.checkboxes.forEach((key) => (settings[this.addPrefix(key)] = this.values[key]()));\n this.objects.forEach((key) => (settings[this.addPrefix(key)] = JSON.stringify(this.values[key]())));\n\n // actually saves everything in the database\n saveSettings(settings)\n .then(() => {\n // on success, show popup\n this.successAlert = app.alerts.show(Alert, { type: 'success' }, app.translator.trans('core.admin.settings.saved_message'));\n })\n .catch(() => {})\n .then(() => {\n // return to the initial state and redraw the page\n this.loading = false;\n m.redraw();\n });\n }\n\n /**\n * Adds the prefix `this.settingsPrefix` at the beginning of `key`\n *\n * @returns string\n */\n addPrefix(key) {\n return this.settingsPrefix + '.' + key;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/AdminNav'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LinkButton'];","function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };","function asyncGeneratorStep(n, t, e, r, o, a, c) {\n try {\n var i = n[a](c),\n u = i.value;\n } catch (n) {\n return void e(n);\n }\n i.done ? t(u) : Promise.resolve(u).then(r, o);\n}\nfunction _asyncToGenerator(n) {\n return function () {\n var t = this,\n e = arguments;\n return new Promise(function (r, o) {\n var a = n.apply(t, e);\n function _next(n) {\n asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n);\n }\n function _throw(n) {\n asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n);\n }\n _next(void 0);\n });\n };\n}\nexport { _asyncToGenerator as default };","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/app'];","const mimeToIconMap = new Map([\n // Image formats\n ['image/png', 'far fa-file-image'],\n ['image/jpg', 'far fa-file-image'],\n ['image/jpeg', 'far fa-file-image'],\n ['image/svg+xml', 'far fa-file-image'],\n ['image/gif', 'far fa-file-image'],\n ['image/bmp', 'far fa-file-image'],\n ['image/webp', 'far fa-file-image'],\n\n // Compressed file formats\n ['application/zip', 'far fa-file-archive'],\n ['application/x-7z-compressed', 'far fa-file-archive'],\n ['application/gzip', 'far fa-file-archive'],\n ['application/vnd.rar', 'far fa-file-archive'],\n ['application/x-rar-compressed', 'far fa-file-archive'],\n ['application/x-tar', 'far fa-file-archive'],\n ['application/x-iso9660-image', 'far fa-file-archive'],\n\n // Text and code file formats\n ['text/plain', 'far fa-file-alt'],\n ['text/csv', 'far fa-file-csv'],\n ['text/xml', 'far fa-file-code'],\n ['text/html', 'far fa-file-code'],\n ['text/css', 'far fa-file-code'],\n ['text/javascript', 'far fa-file-code'],\n ['application/json', 'far fa-file-code'],\n ['application/ld+json', 'far fa-file-code'],\n ['application/x-httpd-php', 'far fa-file-code'],\n ['application/xml', 'far fa-file-code'],\n ['text/xml', 'far fa-file-code'],\n\n // Document formats\n ['application/x-abiword', 'far fa-file-word'],\n ['application/msword', 'far fa-file-word'],\n ['application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'far fa-file-word'],\n ['application/vnd.oasis.opendocument.text', 'far fa-file-word'],\n ['application/vnd.ms-excel', 'far fa-file-excel'],\n ['application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'far fa-file-excel'],\n ['application/vnd.oasis.opendocument.spreadsheet', 'far fa-file-excel'],\n ['application/vnd.ms-powerpoint', 'far fa-file-powerpoint'],\n ['application/vnd.openxmlformats-officedocument.presentationml.presentation', 'far fa-file-powerpoint'],\n ['application/vnd.oasis.opendocument.presentation', 'far fa-file-powerpoint'],\n ['application/pdf', 'far fa-file-pdf'],\n ['application/rtf', 'far fa-file-alt'],\n\n // eBook formats\n ['application/epub+zip', 'far fa-book'],\n ['application/x-mobipocket-ebook', 'far fa-book'],\n ['application/vnd.amazon.ebook', 'far fa-book'],\n\n // Audio formats\n ['audio/mpeg', 'far fa-file-audio'],\n ['audio/wav', 'far fa-file-audio'],\n ['audio/x-wav', 'far fa-file-audio'],\n ['audio/aac', 'far fa-file-audio'],\n ['audio/ogg', 'far fa-file-audio'],\n ['audio/flac', 'far fa-file-audio'],\n ['audio/aiff', 'far fa-file-audio'],\n ['audio/x-aiff', 'far fa-file-audio'],\n\n // Video formats\n ['video/x-msvideo', 'far fa-file-video'],\n ['video/mp4', 'far fa-file-video'],\n ['video/quicktime', 'far fa-file-video'],\n]);\n\nexport default function mimeToIcon(fileType: string): string {\n // Directly return the icon if the fileType is in the map\n return (\n mimeToIconMap.get(fileType) ||\n (function () {\n // Check for generic types\n if (fileType.startsWith('image/')) {\n return 'far fa-file-image';\n } else if (fileType.startsWith('video/')) {\n return 'far fa-file-video';\n } else if (fileType.startsWith('audio/')) {\n return 'far fa-file-audio';\n }\n\n // Default icon\n return 'far fa-file';\n })()\n );\n}\n","import app from 'flarum/common/app';\nimport Modal, { IInternalModalAttrs } from 'flarum/common/components/Modal';\nimport Switch from 'flarum/common/components/Switch';\nimport mimeToIcon from '../mimeToIcon';\nimport Button from 'flarum/common/components/Button';\nimport type Mithril from 'mithril';\nimport { ApiResponsePlural } from 'flarum/common/Store';\nimport File from '../models/File';\n\ninterface CustomAttrs extends IInternalModalAttrs {\n onUploadComplete: (files: File | File[]) => void;\n}\n\nexport default class UploadSharedFileModal extends Modal {\n files = [];\n fileInput = null;\n options = {\n shared: true,\n hidden: false,\n };\n loading: boolean = false;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n }\n\n className() {\n return 'UploadSharedFileModal Modal--medium';\n }\n\n title() {\n return app.translator.trans('fof-upload.lib.upload-shared-file-modal.title');\n }\n\n onFileChange(e) {\n this.addFiles(Array.from(e.target.files));\n }\n\n addFiles(newFiles: File[]) {\n (this.files as File[]).push(...newFiles);\n m.redraw();\n }\n\n onDragOver(e) {\n e.preventDefault();\n e.stopPropagation();\n }\n\n onDrop(e) {\n e.preventDefault();\n e.stopPropagation();\n if (e.dataTransfer && e.dataTransfer.files) {\n this.addFiles(Array.from(e.dataTransfer.files));\n }\n }\n\n onDropzoneClick() {\n if (this.fileInput) {\n this.fileInput.click();\n }\n }\n\n content() {\n return (\n
    \n this.onDropzoneClick()}\n ondragover={this.onDragOver.bind(this)}\n ondrop={this.onDrop.bind(this)}\n >\n {app.translator.trans('fof-upload.lib.upload-shared-file-modal.dropzone')}\n {\n this.fileInput = vnode.dom;\n }}\n />\n
    \n
    \n {this.files.map((file: File) => {\n const isImage = file.type.startsWith('image/');\n return (\n
    \n {isImage ? {file.name} : }\n
    {file.name}
    \n {/* Remove button */}\n {\n this.files = this.files.filter((f) => f !== file);\n }}\n />\n
    \n );\n })}\n
    \n
    \n (this.options.hidden = value)}>\n {app.translator.trans('fof-upload.lib.upload-shared-file-modal.hide-from-media-gallery')}\n \n
    \n
    \n \n {app.translator.trans('fof-upload.lib.upload-shared-file-modal.upload')}\n \n
    \n \n );\n }\n\n async upload() {\n this.loading = true;\n m.redraw();\n\n const formData = new FormData();\n\n // Append each file to the form data\n this.files.forEach((file) => {\n formData.append('files[]', file);\n });\n\n Object.keys(this.options).forEach((key) => {\n formData.append(`options[${key}]`, this.options[key]);\n });\n\n const results = await app.request>({\n method: 'POST',\n url: app.forum.attribute('apiUrl') + '/fof/upload',\n serialize: (raw: FormData) => raw, // Prevent mithril from trying to serialize FormData\n body: formData,\n });\n\n const uploadedFiles = app.store.pushPayload(results);\n\n this.attrs.onUploadComplete(uploadedFiles);\n this.files = [];\n this.hide();\n\n this.loading = false;\n m.redraw();\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","import Component, { ComponentAttrs } from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport type Mithril from 'mithril';\nimport mimeToIcon from '../mimeToIcon';\nimport File from '../models/File';\nimport icon from 'flarum/common/helpers/icon';\nimport app from 'flarum/common/app';\nimport classList from 'flarum/common/utils/classList';\n\ninterface CustomAttrs extends ComponentAttrs {\n file: File;\n selectable: boolean;\n fileClassNames: string;\n onDelete: (file: File) => void | undefined;\n onFileSelect: (file: File) => void | undefined;\n}\n\nexport default class UploadedFile extends Component {\n file!: File;\n callback!: () => void | undefined;\n imageLoaded: boolean = true;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.file = this.attrs.file;\n }\n\n view() {\n const isImage = this.file.type().startsWith('image/');\n const fileIcon = mimeToIcon(this.file.type());\n const errorIcon = 'fas fa-exclamation-triangle';\n const statusIcon = this.file.isPrivateShared() ? 'fas fa-lock' : 'fas fa-unlock';\n\n return (\n
    \n
    \n \n {icon(statusIcon)}\n {this.file.baseName()}\n \n
    \n
    this.onFileClick(this.file)}>\n {isImage ? (\n this.imageLoaded ? (\n \n ) : (\n icon(errorIcon, { className: 'icon-fallback' }) // Error icon for failed image load\n )\n ) : (\n icon(fileIcon, { className: 'icon-fallback' }) // Icon representing the file type\n )}\n
    \n
    {this.actionItems().toArray()}
    \n
    \n );\n }\n\n actionItems(): ItemList {\n const items = new ItemList();\n\n items.add(\n 'view-info',\n \n \n )}\n \n \n );\n }\n\n onDelete(file: File) {\n if (this.attrs.onDelete) {\n this.attrs.onDelete(file);\n }\n }\n\n // Common methods like onFileClick, isSelectable, hideFile...\n\n onFileClick(file: File) {\n // Custom functionality\n if (this.attrs.onFileSelect) {\n this.attrs.onFileSelect(file);\n return;\n }\n\n // Download on click\n if (this.attrs.downloadOnClick) {\n window.open(file.url());\n return;\n }\n }\n\n isSelectable(file: File) {\n const fileType = file.type();\n\n // Custom defined file types\n if (Array.isArray(this.restrictFileType)) {\n return this.restrictFileType.indexOf(fileType) >= 0;\n }\n\n // Image\n else if (this.restrictFileType === 'image') {\n return fileType.includes('image/');\n }\n\n // Audio\n else if (this.restrictFileType === 'audio') {\n return fileType.includes('audio/');\n }\n\n // Video\n else if (this.restrictFileType === 'video') {\n return fileType.includes('video/');\n }\n\n return false;\n }\n\n /**\n * Begins the hiding process for a file.\n *\n * - Shows a native confirmation dialog\n * - If confirmed, sends AJAX request to the hide file API\n */\n async hideFile(file: File) {\n const uuid = file.uuid();\n\n if (this.filesBeingHidden.includes(uuid)) return;\n\n this.filesBeingHidden.push(uuid);\n\n const transPrefix = file.isShared() ? 'fof-upload.lib.file_list.hide_shared_file' : 'fof-upload.lib.file_list.hide_file';\n\n const confirmToggleHide = confirm(\n extractText(\n app.translator.trans(file.hidden() ? `${transPrefix}.show_confirmation` : `${transPrefix}.hide_confirmation`, {\n fileName: file.baseName(),\n })\n )\n );\n\n if (confirmToggleHide) {\n try {\n const filePayload = await app.request({\n method: 'PATCH',\n url: `${app.forum.attribute('apiUrl')}/fof/upload/hide`,\n body: { uuid },\n });\n\n app.store.pushPayload(filePayload);\n m.redraw();\n\n app.alerts.show(Alert, { type: 'success' }, [\n icon(file.hidden() ? 'fas fa-eye-slash' : 'fas fa-eye'),\n ' ',\n app.translator.trans(file?.hidden() ? `${transPrefix}.hide_success` : `${transPrefix}.show_success`),\n ]);\n\n if (this.fileState.user) {\n const index = this.fileState.files.findIndex((file: File) => uuid === file.uuid());\n this.fileState.files.splice(index, 1);\n }\n } catch (error) {\n app.alerts.show(\n Alert,\n { type: 'error' },\n app.translator.trans(file?.hidden() ? `${transPrefix}.hide_fail` : `${transPrefix}.show_fail`, {\n fileName: file.baseName(),\n })\n );\n } finally {\n // Remove file from hiding list\n const i = this.filesBeingHidden.indexOf(uuid);\n this.filesBeingHidden.splice(i, 1);\n }\n }\n }\n}\n","import UploadPage from './UploadPage';\nimport { commonComponents } from '../../common/components';\n\nexport const components = {\n ...commonComponents,\n UploadPage,\n};\n","import UploadSharedFileModal from './UploadSharedFileModal';\nimport UploadedFile from './UploadedFile';\nimport UserFileList from './UserFileList';\n\nexport const commonComponents = {\n UploadedFile,\n UploadSharedFileModal,\n UserFileList,\n};\n","import app from 'flarum/common/app';\nimport File from '../models/File';\nimport AbstractFileList from './AbstractFIleList';\nimport FileListState from '../states/FileListState';\n\nexport default class UserFileList extends AbstractFileList {\n public loadFileList(): void {\n //app.fileListState.setUser(this.attrs.user || app.session.user);\n this.fileState.setUser(this.attrs.user || app.session.user);\n /**\n * The user who's media we are dealing with\n */\n this.user = this.fileState.user; //app.fileListState.user;\n }\n\n hasMoreResults(): boolean {\n return this.fileState.hasMoreResults();\n }\n\n loadMore(): void {\n this.fileState.loadMore();\n }\n\n isLoading(): boolean {\n return this.fileState.isLoading();\n }\n\n fileCollection(): File[] {\n return this.fileState.files;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extenders'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","import Model from 'flarum/common/Model';\n\nexport default class File extends Model {\n baseName() {\n return Model.attribute('baseName').call(this);\n }\n\n path() {\n return Model.attribute('path').call(this);\n }\n\n url() {\n return Model.attribute('url').call(this);\n }\n\n size() {\n return Model.attribute('size').call(this);\n }\n\n type() {\n return Model.attribute('type').call(this);\n }\n\n humanSize() {\n return Model.attribute('humanSize').call(this);\n }\n\n createdAt() {\n return Model.attribute('createdAt', Model.transformDate).call(this);\n }\n\n uuid() {\n return Model.attribute('uuid').call(this);\n }\n\n tag() {\n return Model.attribute('tag').call(this);\n }\n\n hidden() {\n return Model.attribute('hidden').call(this);\n }\n\n bbcode() {\n return Model.attribute('bbcode').call(this);\n }\n\n isShared() {\n return Model.attribute('shared').call(this);\n }\n\n isPrivateShared() {\n return Model.attribute('isPrivateShared').call(this);\n }\n\n canViewInfo() {\n return Model.attribute('canViewInfo').call(this);\n }\n\n canHide() {\n return Model.attribute('canHide').call(this);\n }\n\n canDelete() {\n return Model.attribute('canDelete').call(this);\n }\n\n apiEndpoint() {\n return '/fof/uploads' + (this.exists ? '/' + this.id() : '');\n }\n}\n","import Extend from 'flarum/common/extenders';\nimport File from './models/File';\n\nexport default [\n new Extend.Store() //\n .add('files', File)\n .add('shared-files', File),\n];\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/AdminPage'];","import app from 'flarum/common/app';\nimport File from '../models/File';\nimport AbstractFileList from './AbstractFIleList';\n\nexport default class SharedFileList extends AbstractFileList {\n public loadFileList(): void {\n this.fileState.loadResults();\n }\n\n hasMoreResults() {\n return this.fileState.hasMoreResults();\n }\n\n loadMore() {\n this.fileState.loadMore();\n }\n\n isLoading(): boolean {\n return this.fileState.isLoading();\n }\n\n fileCollection(): File[] {\n return this.fileState.files;\n }\n}\n","import app from 'flarum/common/app';\nimport User from 'flarum/common/models/User';\nimport File from '../models/File';\nimport { ApiQueryParamsPlural, ApiResponsePlural } from 'flarum/common/Store';\n\nexport default class FileListState {\n public user: User | null;\n public files: File[];\n private moreResults: boolean;\n private loading: boolean;\n private sharedFiles: boolean;\n\n constructor(sharedFiles: boolean = false) {\n this.user = null;\n this.files = [];\n this.moreResults = false;\n this.loading = false;\n this.sharedFiles = sharedFiles;\n }\n\n /**\n * Set the user and load their file list.\n * @param user The user whose files to load.\n */\n public setUser(user: User): void {\n if (user === this.user) return;\n\n this.user = user;\n this.files = [];\n this.loadResults();\n }\n\n public refresh(): void {\n this.files = [];\n this.loadResults();\n m.redraw();\n }\n\n /**\n * Load more files for the current user, starting from the given offset.\n * @param offset The starting index for loading more files.\n * @returns A promise resolving to the loaded files.\n */\n public async loadResults(offset: number = 0): Promise> {\n if (!this.sharedFiles && !this.user) return Promise.reject('User not set');\n\n this.loading = true;\n\n let route: string = 'fof/uploads';\n let params: ApiQueryParamsPlural = {};\n\n if (!this.sharedFiles && this.user) {\n params = {\n filter: { user: this.user.id() },\n page: { offset },\n } as ApiQueryParamsPlural;\n } else {\n route = 'fof/upload/shared-files';\n params = {\n page: { offset },\n } as ApiQueryParamsPlural;\n }\n\n const results = await app.store.find(route, params);\n\n return this.parseResults(results);\n }\n\n /**\n * Load the next set of results.\n */\n public async loadMore(): Promise> {\n this.loading = true;\n return this.loadResults(this.files.length);\n }\n\n private parseResults(results: ApiResponsePlural): ApiResponsePlural {\n this.files = results;\n this.loading = false;\n this.moreResults = !!results.payload?.links?.next;\n m.redraw();\n return results;\n }\n\n /**\n * Add files to the beginning of the list.\n * @param files The files to be added.\n */\n public addToList(files: File | File[]): void {\n if (Array.isArray(files)) {\n this.files.unshift(...files);\n } else {\n this.files.unshift(files);\n }\n m.redraw();\n }\n\n /**\n * Remove files from the list.\n * @param files The files to be removed.\n */\n public removeFromList(files: File | File[]): void {\n if (Array.isArray(files)) {\n this.files = this.files.filter((file) => !files.includes(file));\n } else {\n this.files = this.files.filter((file) => file !== files);\n }\n\n m.redraw();\n }\n\n /**\n * Check if there are files in the list.\n * @returns True if there are files, false otherwise.\n */\n public hasFiles(): boolean {\n return this.files.length > 0;\n }\n\n /**\n * Check if the file list is currently loading.\n * @returns True if loading, false otherwise.\n */\n public isLoading(): boolean {\n return this.loading;\n }\n\n /**\n * Check if there are more files to load.\n * @returns True if there are more files, false otherwise.\n */\n public hasMoreResults(): boolean {\n return this.moreResults;\n }\n\n /**\n * Check if the user has no files and the list is not loading.\n * @returns True if the list is empty and not loading, false otherwise.\n */\n public empty(): boolean {\n return !this.hasFiles() && !this.isLoading();\n }\n}\n","import app from 'flarum/admin/app';\nimport AdminPage, { AdminHeaderAttrs } from 'flarum/admin/components/AdminPage';\nimport Button from 'flarum/common/components/Button';\nimport { IPageAttrs } from 'flarum/common/components/Page';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport type Mithril from 'mithril';\nimport UploadSharedFileModal from '../../common/components/UploadSharedFileModal';\nimport File from 'src/common/models/File';\nimport SharedFileList from '../../common/components/SharedFileList';\nimport FileListState from '../../common/states/FileListState';\n\nexport default class SharedUploadPage extends AdminPage {\n sharedUploads: File[] = [];\n currentPage: number = 1;\n fileState!: FileListState;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.fileState = new FileListState(true);\n }\n\n headerInfo(): AdminHeaderAttrs {\n return {\n className: 'SharedUploadPage--header',\n icon: 'fas fa-file-upload',\n title: app.translator.trans('fof-upload.admin.shared-uploads.title'),\n description: app.translator.trans('fof-upload.admin.shared-uploads.description'),\n };\n }\n\n content(): Mithril.Children {\n return (\n
    \n

    {app.translator.trans('fof-upload.admin.shared-uploads.introduction')}

    \n
    \n
    {this.mainActionItems().toArray()}
    \n
    \n
    \n \n
    \n
    \n );\n }\n\n showUploadModal() {\n app.modal.show(UploadSharedFileModal, {\n onUploadComplete: (files: File | File[]) => {\n this.uploadComplete(files);\n },\n });\n }\n\n mainActionItems(): ItemList {\n const items = new ItemList();\n\n items.add('refresh', \n );\n\n return items;\n }\n\n fileActionItems(file: File): ItemList {\n const items = new ItemList();\n\n return items;\n }\n\n uploadComplete(files: File | File[]) {\n console.log('upload complete', files);\n this.fileState.addToList(files);\n }\n\n refresh() {\n this.fileState.refresh();\n }\n\n onDelete(file: File) {\n this.fileState.removeFromList(file);\n }\n}\n","import { default as extend } from '../common/extend';\nimport Extend from 'flarum/common/extenders';\nimport SharedUploadPage from './components/SharedUploadPage';\n\nexport default [\n ...extend,\n\n new Extend.Routes() //\n .add('adminUploads', '/uploads', SharedUploadPage),\n];\n","import app from 'flarum/admin/app';\nimport UploadPage from './components/UploadPage';\nimport extendAdminNav from './extendAdminNav';\nimport FileListState from '../common/states/FileListState';\n\nexport * from './components';\n\nexport { default as extend } from './extend';\n\napp.initializers.add('fof-upload', () => {\n app.extensionData\n .for('fof-upload')\n .registerPage(UploadPage)\n .registerPermission(\n {\n icon: 'far fa-file',\n label: app.translator.trans('fof-upload.admin.permissions.upload_label'),\n permission: 'fof-upload.upload',\n },\n 'start',\n 50\n )\n .registerPermission(\n {\n icon: 'fas fa-download',\n label: app.translator.trans('fof-upload.admin.permissions.download_label'),\n permission: 'fof-upload.download',\n allowGuest: true,\n },\n 'view',\n 50\n )\n .registerPermission(\n {\n icon: 'fas fa-eye',\n label: app.translator.trans('fof-upload.admin.permissions.view_user_uploads_label'),\n permission: 'fof-upload.viewUserUploads',\n },\n 'moderate',\n 50\n )\n .registerPermission(\n {\n icon: 'fas fa-trash',\n label: app.translator.trans('fof-upload.admin.permissions.delete_uploads_of_others_label'),\n permission: 'fof-upload.deleteUserUploads',\n },\n 'moderate',\n 50\n )\n .registerPermission(\n {\n icon: 'far fa-file-alt',\n label: app.translator.trans('fof-upload.admin.permissions.upload_shared_label'),\n permission: 'fof-upload.upload-shared-files',\n },\n 'start'\n )\n .registerPermission(\n {\n icon: 'far fa-file-alt',\n label: app.translator.trans('fof-upload.admin.permissions.access_shared_label'),\n permission: 'fof-upload.access-shared-files',\n },\n 'start'\n );\n\n extendAdminNav();\n\n //app.fileListState = new FileListState();\n});\n","import app from 'flarum/admin/app';\nimport { extend } from 'flarum/common/extend';\nimport AdminNav from 'flarum/admin/components/AdminNav';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport type Mithril from 'mithril';\n\nexport default function extendAdminNav() {\n extend(AdminNav.prototype, 'items', function (items: ItemList) {\n items.add(\n 'shared-uploads',\n \n {app.translator.trans('fof-upload.admin.nav.shared-uploads-button')}\n ,\n 49\n );\n });\n}\n"],"names":["_typeof","require","_regeneratorRuntime","module","exports","e","__esModule","t","r","Object","prototype","n","hasOwnProperty","o","defineProperty","value","i","Symbol","a","iterator","c","asyncIterator","u","toStringTag","define","enumerable","configurable","writable","wrap","Generator","create","Context","makeInvokeMethod","tryCatch","type","arg","call","h","l","f","s","y","GeneratorFunction","GeneratorFunctionPrototype","p","this","d","getPrototypeOf","v","values","g","defineIteratorMethods","forEach","_invoke","AsyncIterator","invoke","resolve","__await","then","callInvokeWithMethodAndArg","Error","done","method","delegate","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","TypeError","resultName","next","nextLoc","pushTryEntry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","isNaN","length","displayName","isGeneratorFunction","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","keys","reverse","pop","prev","charAt","slice","stop","rval","handle","complete","finish","delegateYield","runtime","regeneratorRuntime","accidentalStrictMode","globalThis","Function","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","getter","definition","key","get","obj","prop","flarum","core","compat","_setPrototypeOf","bind","_inheritsLoose","UploadImageButton","_FlarumUploadImageBut","apply","arguments","resourceUrl","app","attribute","attrs","path","FlarumUploadImageButton","InspectMimeModal","_Modal","_proto","oninit","vnode","uploading","inspection","className","title","trans","content","m","href","onchange","onupload","disabled","LoadingIndicator","laravel_validation","error","laravel_validation_error","mime_detector","php_mime","guessed_extension","event","_this","body","FormData","target","files","append","url","serialize","raw","result","redraw","Modal","UploadPage","_ExtensionPage","loading","fields","checkboxes","objects","watermarkPositions","center","left","top","right","bottom","composerButtonVisiblityOptions","both","settings","settingsPrefix","uploadMethodOptions","addPrefix","templateOptions","Stream","JSON","parse","defaultAdap","mimeTypes","adapter","template","newMimeType","regex","_this2","max_post","max_upload","onsubmit","maxFileSize","oninput","withAttr","min","post","upload","map","mime","config","updateMimeTypeKey","Select","options","updateMimeTypeAdapter","getTemplateOptionsForInput","updateMimeTypeTemplate","Button","onclick","deleteMimeType","addMimeType","show","templateOptionsDescriptions","composerButtonVisiblity","Switch","state","mustResize","resizeMaxWidth","whitelistedClientExtensions","addsWatermarks","watermarkPosition","component","disableHotlinkProtection","disableDownloadLogging","cdnUrl","adaptorItems","toArray","changed","items","ItemList","add","icon","Link","external","imgurClientId","qiniuKey","qiniuSecret","qiniuBucket","awsS3Key","awsS3Secret","awsS3Bucket","awsS3Region","awsS3Endpoint","awsS3UsePathStyleEndpoint","awsS3ACL","awsS3CustomUrl","option","children","trust","description","_this3","fieldsCheck","some","checkboxesCheck","objectsCheck","stringify","_this4","preventDefault","dismiss","successAlert","saveSettings","Alert","ExtensionPage","_extends","assign","asyncGeneratorStep","_asyncToGenerator","_next","_throw","mimeToIconMap","Map","mimeToIcon","fileType","startsWith","UploadSharedFileModal","_len","args","Array","_key","concat","fileInput","shared","hidden","onFileChange","addFiles","from","newFiles","_ref","onDragOver","stopPropagation","onDrop","dataTransfer","onDropzoneClick","click","ondragover","ondrop","multiple","style","opacity","position","oncreate","dom","file","isImage","src","URL","createObjectURL","alt","filter","_upload","_callee","formData","results","uploadedFiles","_context","pushPayload","onUploadComplete","hide","UploadedFile","_Component","callback","imageLoaded","handleImageError","handleImageLoad","view","fileIcon","statusIcon","isPrivateShared","uuid","baseName","onFileClick","fileClassNames","onerror","onload","actionItems","viewFileInfo","window","open","hideFileIcon","hideFile","confirmDelete","_confirmDelete","confirm","onDelete","console","log","onFileSelect","Component","DisplayFile","isFileHiding","isSelected","isSelectable","fileSelectable","onbeforeupdate","fileSelectedClass","draggable","displayIcon","Tooltip","text","class","role","display","alignItems","justifyContent","height","canViewInfo","transPrefix","isShared","hideTranslation","fileName","canHide","deleteTranslation","canDelete","onHide","extractText","_x","AbstractFileList","user","inModal","restrictFileType","downloadOnClick","filesBeingHidden","fileState","selectable","loadFileList","isLoading","fileCollection","_file$id","_file$id2","classList","selectedFiles","indexOf","id","includes","hasMoreResults","loadMore","isArray","_hideFile","filePayload","index","findIndex","splice","t0","components","UserFileList","_AbstractFileList","setUser","File","_Model","Model","size","humanSize","createdAt","tag","bbcode","apiEndpoint","exists","Extend","SharedFileList","loadResults","FileListState","sharedFiles","moreResults","refresh","_loadResults","offset","route","params","reject","page","find","parseResults","_loadMore","_callee2","_context2","_results$payload","payload","links","addToList","_this$files","unshift","removeFromList","hasFiles","empty","SharedUploadPage","_AdminPage","sharedUploads","currentPage","headerInfo","mainActionItems","showUploadModal","uploadComplete","fileActionItems","AdminPage","extend","registerPage","registerPermission","label","permission","allowGuest","AdminNav","LinkButton"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"admin.js","mappings":";0BAAA,IAAIA,EAAUC,EAAAA,KAAAA,QACd,SAASC,IACP,aACAC,EAAOC,QAAUF,EAAsB,WACrC,OAAOG,CACT,EAAGF,EAAOC,QAAQE,YAAa,EAAMH,EAAOC,QAAiB,QAAID,E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0CAChGd,IAAAA,WAAec,MAAM,+CAExB,GAEJ,GDsDF","sources":["webpack://@fof/upload/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js","webpack://@fof/upload/./node_modules/@babel/runtime/helpers/typeof.js","webpack://@fof/upload/./node_modules/@babel/runtime/regenerator/index.js","webpack://@fof/upload/webpack/bootstrap","webpack://@fof/upload/webpack/runtime/compat get default export","webpack://@fof/upload/webpack/runtime/define property getters","webpack://@fof/upload/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/upload/webpack/runtime/make namespace object","webpack://@fof/upload/external root \"flarum.core.compat['admin/app']\"","webpack://@fof/upload/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/upload/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/upload/external root \"flarum.core.compat['common/components/Button']\"","webpack://@fof/upload/external root \"flarum.core.compat['admin/utils/saveSettings']\"","webpack://@fof/upload/external root \"flarum.core.compat['common/components/Alert']\"","webpack://@fof/upload/external root \"flarum.core.compat['common/components/Select']\"","webpack://@fof/upload/external root \"flarum.core.compat['common/components/Switch']\"","webpack://@fof/upload/external root \"flarum.core.compat['admin/components/UploadImageButton']\"","webpack://@fof/upload/./src/admin/components/UploadImageButton.ts","webpack://@fof/upload/external root \"flarum.core.compat['common/utils/withAttr']\"","webpack://@fof/upload/external root \"flarum.core.compat['common/utils/Stream']\"","webpack://@fof/upload/external root \"flarum.core.compat['admin/components/ExtensionPage']\"","webpack://@fof/upload/external root \"flarum.core.compat['common/utils/ItemList']\"","webpack://@fof/upload/external root \"flarum.core.compat['common/components/Modal']\"","webpack://@fof/upload/external root \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@fof/upload/./src/admin/components/InspectMimeModal.js","webpack://@fof/upload/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://@fof/upload/external root \"flarum.core.compat['common/components/Link']\"","webpack://@fof/upload/./src/admin/components/UploadPage.js","webpack://@fof/upload/external root \"flarum.core.compat['common/extend']\"","webpack://@fof/upload/external root \"flarum.core.compat['admin/components/AdminNav']\"","webpack://@fof/upload/external root \"flarum.core.compat['common/components/LinkButton']\"","webpack://@fof/upload/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://@fof/upload/./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js","webpack://@fof/upload/external root \"flarum.core.compat['common/app']\"","webpack://@fof/upload/./src/common/mimeToIcon.ts","webpack://@fof/upload/./src/common/components/UploadSharedFileModal.tsx","webpack://@fof/upload/external root \"flarum.core.compat['common/Component']\"","webpack://@fof/upload/./src/common/components/UploadedFile.tsx","webpack://@fof/upload/external root \"flarum.core.compat['common/utils/classList']\"","webpack://@fof/upload/external root \"flarum.core.compat['common/components/Tooltip']\"","webpack://@fof/upload/external root \"flarum.core.compat['common/utils/extractText']\"","webpack://@fof/upload/./src/common/components/DisplayFile.tsx","webpack://@fof/upload/./src/common/components/AbstractFIleList.tsx","webpack://@fof/upload/./src/admin/components/index.ts","webpack://@fof/upload/./src/common/components/index.ts","webpack://@fof/upload/./src/common/components/UserFileList.tsx","webpack://@fof/upload/external root \"flarum.core.compat['common/extenders']\"","webpack://@fof/upload/external root \"flarum.core.compat['common/Model']\"","webpack://@fof/upload/./src/common/models/File.ts","webpack://@fof/upload/./src/common/extend.ts","webpack://@fof/upload/external root \"flarum.core.compat['admin/components/AdminPage']\"","webpack://@fof/upload/./src/common/components/SharedFileList.tsx","webpack://@fof/upload/./src/common/states/FileListState.ts","webpack://@fof/upload/./src/admin/components/SharedUploadPage.tsx","webpack://@fof/upload/./src/admin/extend.ts","webpack://@fof/upload/./src/admin/index.ts","webpack://@fof/upload/./src/admin/extendAdminNav.tsx"],"sourcesContent":["var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction _regeneratorRuntime() {\n \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */\n module.exports = _regeneratorRuntime = function _regeneratorRuntime() {\n return e;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n var t,\n e = {},\n r = Object.prototype,\n n = r.hasOwnProperty,\n o = Object.defineProperty || function (t, e, r) {\n t[e] = r.value;\n },\n i = \"function\" == typeof Symbol ? Symbol : {},\n a = i.iterator || \"@@iterator\",\n c = i.asyncIterator || \"@@asyncIterator\",\n u = i.toStringTag || \"@@toStringTag\";\n function define(t, e, r) {\n return Object.defineProperty(t, e, {\n value: r,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }), t[e];\n }\n try {\n define({}, \"\");\n } catch (t) {\n define = function define(t, e, r) {\n return t[e] = r;\n };\n }\n function wrap(t, e, r, n) {\n var i = e && e.prototype instanceof Generator ? e : Generator,\n a = Object.create(i.prototype),\n c = new Context(n || []);\n return o(a, \"_invoke\", {\n value: makeInvokeMethod(t, r, c)\n }), a;\n }\n function tryCatch(t, e, r) {\n try {\n return {\n type: \"normal\",\n arg: t.call(e, r)\n };\n } catch (t) {\n return {\n type: \"throw\",\n arg: t\n };\n }\n }\n e.wrap = wrap;\n var h = \"suspendedStart\",\n l = \"suspendedYield\",\n f = \"executing\",\n s = \"completed\",\n y = {};\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n var p = {};\n define(p, a, function () {\n return this;\n });\n var d = Object.getPrototypeOf,\n v = d && d(d(values([])));\n v && v !== r && n.call(v, a) && (p = v);\n var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);\n function defineIteratorMethods(t) {\n [\"next\", \"throw\", \"return\"].forEach(function (e) {\n define(t, e, function (t) {\n return this._invoke(e, t);\n });\n });\n }\n function AsyncIterator(t, e) {\n function invoke(r, o, i, a) {\n var c = tryCatch(t[r], t, o);\n if (\"throw\" !== c.type) {\n var u = c.arg,\n h = u.value;\n return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) {\n invoke(\"next\", t, i, a);\n }, function (t) {\n invoke(\"throw\", t, i, a);\n }) : e.resolve(h).then(function (t) {\n u.value = t, i(u);\n }, function (t) {\n return invoke(\"throw\", t, i, a);\n });\n }\n a(c.arg);\n }\n var r;\n o(this, \"_invoke\", {\n value: function value(t, n) {\n function callInvokeWithMethodAndArg() {\n return new e(function (e, r) {\n invoke(t, n, e, r);\n });\n }\n return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();\n }\n });\n }\n function makeInvokeMethod(e, r, n) {\n var o = h;\n return function (i, a) {\n if (o === f) throw Error(\"Generator is already running\");\n if (o === s) {\n if (\"throw\" === i) throw a;\n return {\n value: t,\n done: !0\n };\n }\n for (n.method = i, n.arg = a;;) {\n var c = n.delegate;\n if (c) {\n var u = maybeInvokeDelegate(c, n);\n if (u) {\n if (u === y) continue;\n return u;\n }\n }\n if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) {\n if (o === h) throw o = s, n.arg;\n n.dispatchException(n.arg);\n } else \"return\" === n.method && n.abrupt(\"return\", n.arg);\n o = f;\n var p = tryCatch(e, r, n);\n if (\"normal\" === p.type) {\n if (o = n.done ? s : l, p.arg === y) continue;\n return {\n value: p.arg,\n done: n.done\n };\n }\n \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg);\n }\n };\n }\n function maybeInvokeDelegate(e, r) {\n var n = r.method,\n o = e.iterator[n];\n if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y;\n var i = tryCatch(o, e.iterator, r.arg);\n if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y;\n var a = i.arg;\n return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y);\n }\n function pushTryEntry(t) {\n var e = {\n tryLoc: t[0]\n };\n 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);\n }\n function resetTryEntry(t) {\n var e = t.completion || {};\n e.type = \"normal\", delete e.arg, t.completion = e;\n }\n function Context(t) {\n this.tryEntries = [{\n tryLoc: \"root\"\n }], t.forEach(pushTryEntry, this), this.reset(!0);\n }\n function values(e) {\n if (e || \"\" === e) {\n var r = e[a];\n if (r) return r.call(e);\n if (\"function\" == typeof e.next) return e;\n if (!isNaN(e.length)) {\n var o = -1,\n i = function next() {\n for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;\n return next.value = t, next.done = !0, next;\n };\n return i.next = i;\n }\n }\n throw new TypeError(_typeof(e) + \" is not iterable\");\n }\n return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", {\n value: GeneratorFunctionPrototype,\n configurable: !0\n }), o(GeneratorFunctionPrototype, \"constructor\", {\n value: GeneratorFunction,\n configurable: !0\n }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) {\n var e = \"function\" == typeof t && t.constructor;\n return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name));\n }, e.mark = function (t) {\n return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t;\n }, e.awrap = function (t) {\n return {\n __await: t\n };\n }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {\n return this;\n }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {\n void 0 === i && (i = Promise);\n var a = new AsyncIterator(wrap(t, r, n, o), i);\n return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {\n return t.done ? t.value : a.next();\n });\n }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () {\n return this;\n }), define(g, \"toString\", function () {\n return \"[object Generator]\";\n }), e.keys = function (t) {\n var e = Object(t),\n r = [];\n for (var n in e) r.push(n);\n return r.reverse(), function next() {\n for (; r.length;) {\n var t = r.pop();\n if (t in e) return next.value = t, next.done = !1, next;\n }\n return next.done = !0, next;\n };\n }, e.values = values, Context.prototype = {\n constructor: Context,\n reset: function reset(e) {\n if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);\n },\n stop: function stop() {\n this.done = !0;\n var t = this.tryEntries[0].completion;\n if (\"throw\" === t.type) throw t.arg;\n return this.rval;\n },\n dispatchException: function dispatchException(e) {\n if (this.done) throw e;\n var r = this;\n function handle(n, o) {\n return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o;\n }\n for (var o = this.tryEntries.length - 1; o >= 0; --o) {\n var i = this.tryEntries[o],\n a = i.completion;\n if (\"root\" === i.tryLoc) return handle(\"end\");\n if (i.tryLoc <= this.prev) {\n var c = n.call(i, \"catchLoc\"),\n u = n.call(i, \"finallyLoc\");\n if (c && u) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n } else if (c) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n } else {\n if (!u) throw Error(\"try statement without catch or finally\");\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n }\n }\n }\n },\n abrupt: function abrupt(t, e) {\n for (var r = this.tryEntries.length - 1; r >= 0; --r) {\n var o = this.tryEntries[r];\n if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) {\n var i = o;\n break;\n }\n }\n i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);\n var a = i ? i.completion : {};\n return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a);\n },\n complete: function complete(t, e) {\n if (\"throw\" === t.type) throw t.arg;\n return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y;\n },\n finish: function finish(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;\n }\n },\n \"catch\": function _catch(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.tryLoc === t) {\n var n = r.completion;\n if (\"throw\" === n.type) {\n var o = n.arg;\n resetTryEntry(r);\n }\n return o;\n }\n }\n throw Error(\"illegal catch attempt\");\n },\n delegateYield: function delegateYield(e, r, n) {\n return this.delegate = {\n iterator: values(e),\n resultName: r,\n nextLoc: n\n }, \"next\" === this.method && (this.arg = t), y;\n }\n }, e;\n}\nmodule.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(o);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","// TODO(Babel 8): Remove this file.\n\nvar runtime = require(\"../helpers/regeneratorRuntime\")();\nmodule.exports = runtime;\n\n// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\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\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (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__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (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};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","function _setPrototypeOf(t, e) {\n return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {\n return t.__proto__ = e, t;\n }, _setPrototypeOf(t, e);\n}\nexport { _setPrototypeOf as default };","import setPrototypeOf from \"./setPrototypeOf.js\";\nfunction _inheritsLoose(t, o) {\n t.prototype = Object.create(o.prototype), t.prototype.constructor = t, setPrototypeOf(t, o);\n}\nexport { _inheritsLoose as default };","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/utils/saveSettings'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Alert'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Select'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Switch'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/UploadImageButton'];","import app from 'flarum/admin/app';\nimport FlarumUploadImageButton from 'flarum/admin/components/UploadImageButton';\n\nexport default class UploadImageButton extends FlarumUploadImageButton {\n resourceUrl() {\n return app.forum.attribute('apiUrl') + '/' + this.attrs.path;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/withAttr'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/ExtensionPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","import app from 'flarum/admin/app';\nimport Modal from 'flarum/common/components/Modal';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\n\nexport default class InspectMimeModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.uploading = false;\n this.inspection = {};\n }\n\n className() {\n return 'Modal--small fof-upload-inspect-mime-modal';\n }\n\n title() {\n return app.translator.trans('fof-upload.admin.inspect-mime.title');\n }\n\n content() {\n return (\n
    \n

    \n {app.translator.trans('fof-upload.admin.inspect-mime.description', {\n a: ,\n })}\n

    \n

    {app.translator.trans('fof-upload.admin.inspect-mime.select')}

    \n
    \n \n {this.uploading ? LoadingIndicator.component() : null}\n
    \n
    \n
    {app.translator.trans('fof-upload.admin.inspect-mime.laravel-validation')}
    \n
    \n {typeof this.inspection.laravel_validation === 'undefined' ? (\n {app.translator.trans('fof-upload.admin.inspect-mime.no-file-selected')}\n ) : this.inspection.laravel_validation ? (\n app.translator.trans('fof-upload.admin.inspect-mime.validation-passed')\n ) : (\n app.translator.trans('fof-upload.admin.inspect-mime.validation-failed', {\n error: this.inspection.laravel_validation_error || '?',\n })\n )}\n
    \n
    \n
    \n
    {app.translator.trans('fof-upload.admin.inspect-mime.mime-detector')}
    \n
    \n {this.inspection.mime_detector ? (\n {this.inspection.mime_detector}\n ) : (\n {app.translator.trans('fof-upload.admin.inspect-mime.not-available')}\n )}\n
    \n
    \n
    \n
    {app.translator.trans('fof-upload.admin.inspect-mime.mime-fileinfo')}
    \n
    \n {this.inspection.php_mime ? (\n {this.inspection.php_mime}\n ) : (\n {app.translator.trans('fof-upload.admin.inspect-mime.not-available')}\n )}\n
    \n
    \n
    \n
    {app.translator.trans('fof-upload.admin.inspect-mime.guessed-extension')}
    \n
    \n {this.inspection.guessed_extension ? (\n {this.inspection.guessed_extension}\n ) : (\n {app.translator.trans('fof-upload.admin.inspect-mime.not-available')}\n )}\n
    \n
    \n
    \n );\n }\n\n onupload(event) {\n const body = new FormData();\n\n for (let i = 0; i < event.target.files.length; i++) {\n body.append('files[]', event.target.files[i]);\n }\n\n this.uploading = true;\n\n return app\n .request({\n method: 'POST',\n url: app.forum.attribute('apiUrl') + '/fof/upload/inspect-mime',\n serialize: (raw) => raw,\n body,\n })\n .then((result) => {\n this.uploading = false;\n this.inspection = result;\n m.redraw();\n })\n .catch((error) => {\n this.uploading = false;\n this.inspection = {};\n m.redraw();\n\n throw error;\n });\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Link'];","import app from 'flarum/admin/app';\nimport Button from 'flarum/common/components/Button';\nimport saveSettings from 'flarum/admin/utils/saveSettings';\nimport Alert from 'flarum/common/components/Alert';\nimport Select from 'flarum/common/components/Select';\nimport Switch from 'flarum/common/components/Switch';\nimport UploadImageButton from './UploadImageButton';\nimport withAttr from 'flarum/common/utils/withAttr';\nimport Stream from 'flarum/common/utils/Stream';\nimport ExtensionPage from 'flarum/admin/components/ExtensionPage';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport InspectMimeModal from './InspectMimeModal';\nimport icon from 'flarum/common/helpers/icon';\nimport Link from 'flarum/common/components/Link';\n\n/* global m */\n\nexport default class UploadPage extends ExtensionPage {\n oninit(vnode) {\n super.oninit(vnode);\n // whether we are saving the settings or not right now\n this.loading = false;\n\n // the fields we need to watch and to save\n this.fields = [\n // image\n 'resizeMaxWidth',\n 'cdnUrl',\n 'maxFileSize',\n 'whitelistedClientExtensions',\n 'composerButtonVisiblity',\n // watermark\n 'watermark',\n 'watermarkPosition',\n // Imgur\n 'imgurClientId',\n // AWS\n 'awsS3Key',\n 'awsS3Secret',\n 'awsS3Bucket',\n 'awsS3Region',\n 'awsS3Endpoint',\n 'awsS3ACL',\n 'awsS3CustomUrl',\n // QIniu\n 'qiniuKey',\n 'qiniuSecret',\n 'qiniuBucket',\n ];\n\n // the checkboxes we need to watch and to save.\n this.checkboxes = ['mustResize', 'addsWatermarks', 'disableHotlinkProtection', 'disableDownloadLogging', 'awsS3UsePathStyleEndpoint'];\n\n // fields that are objects\n this.objects = ['mimeTypes'];\n\n // watermark positions\n this.watermarkPositions = {\n 'top-left': 'top-left',\n 'top-right': 'top-right',\n 'bottom-left': 'bottom-left',\n 'bottom-right': 'bottom-right',\n center: 'center',\n left: 'left',\n top: 'top',\n right: 'right',\n bottom: 'bottom',\n };\n\n // Composer button options\n this.composerButtonVisiblityOptions = {\n both: app.translator.trans('fof-upload.admin.labels.composer_buttons.options.both'),\n 'upload-btn': app.translator.trans('fof-upload.admin.labels.composer_buttons.options.upload-btn'),\n 'media-btn': app.translator.trans('fof-upload.admin.labels.composer_buttons.options.media-btn'),\n };\n\n // get the saved settings from the database\n const settings = app.data.settings;\n\n // our package prefix (to be added to every field and checkbox in the setting table)\n this.settingsPrefix = 'fof-upload';\n\n // Options for the Upload methods dropdown menu.\n this.uploadMethodOptions = settings[this.addPrefix('availableUploadMethods')] || {};\n // Options for the Template dropdown menu.\n this.templateOptions = settings[this.addPrefix('availableTemplates')] || {};\n // Contains current values.\n this.values = {};\n // bind the values of the fields and checkboxes to the getter/setter functions\n this.fields.forEach((key) => (this.values[key] = Stream(settings[this.addPrefix(key)])));\n this.checkboxes.forEach((key) => (this.values[key] = Stream(settings[this.addPrefix(key)] === '1')));\n this.objects.forEach((key) => (this.values[key] = settings[this.addPrefix(key)] ? Stream(JSON.parse(settings[this.addPrefix(key)])) : Stream()));\n\n // Set a sane default in case no mimeTypes have been configured yet.\n // Since 'local' (or others) can now be disabled, pick the last entry in the object for default\n this.defaultAdap = Object.keys(this.uploadMethodOptions)[Object.keys(this.uploadMethodOptions).length - 1];\n this.values.mimeTypes() ||\n (this.values.mimeTypes = Stream({\n '^image\\\\/.*': {\n adapter: this.defaultAdap,\n template: 'image-preview',\n },\n }));\n\n this.newMimeType = {\n regex: Stream(''),\n adapter: Stream(this.defaultAdap),\n template: Stream('file'),\n };\n }\n\n /**\n * Show the actual ImageUploadPage.\n *\n * @returns {*}\n */\n content() {\n const max_post = app.data.settings[this.addPrefix('php_ini.post_max_size')];\n const max_upload = app.data.settings[this.addPrefix('php_ini.upload_max_filesize')];\n return [\n m('.UploadPage', [\n m('.container', [\n m(\n 'form',\n {\n onsubmit: this.onsubmit.bind(this),\n },\n [\n m('fieldset', [\n m('legend', app.translator.trans('fof-upload.admin.labels.preferences.title')),\n m('label', app.translator.trans('fof-upload.admin.labels.preferences.max_file_size')),\n m('input.FormControl', {\n value: this.values.maxFileSize(),\n oninput: withAttr('value', this.values.maxFileSize),\n type: 'number',\n min: '0',\n }),\n m(\n '.helpText',\n app.translator.trans('fof-upload.admin.labels.preferences.php_ini_values', {\n post: max_post,\n upload: max_upload,\n })\n ),\n m('label', app.translator.trans('fof-upload.admin.labels.preferences.mime_types')),\n m(\n '.MimeTypes--Container',\n Object.keys(this.values.mimeTypes()).map((mime) => {\n let config = this.values.mimeTypes()[mime];\n // Compatibility for older versions.\n if (typeof config !== 'object') {\n config = {\n adapter: config,\n template: 'file',\n };\n }\n\n return m('div', [\n m('input.FormControl.MimeTypes', {\n value: mime,\n oninput: withAttr('value', this.updateMimeTypeKey.bind(this, mime)),\n }),\n Select.component({\n options: this.uploadMethodOptions,\n onchange: this.updateMimeTypeAdapter.bind(this, mime, config),\n value: config.adapter || 'local',\n }),\n Select.component({\n options: this.getTemplateOptionsForInput(),\n onchange: this.updateMimeTypeTemplate.bind(this, mime, config),\n value: config.template || 'local',\n }),\n Button.component(\n {\n type: 'button',\n className: 'Button Button--warning',\n onclick: this.deleteMimeType.bind(this, mime),\n },\n 'x'\n ),\n ]);\n }),\n m('br'),\n m('div', [\n m('input.FormControl.MimeTypes.add-MimeType-key', {\n value: this.newMimeType.regex(),\n oninput: withAttr('value', this.newMimeType.regex),\n }),\n Select.component({\n options: this.uploadMethodOptions,\n className: 'add-MimeType-value',\n oninput: withAttr('value', this.newMimeType.adapter),\n value: this.newMimeType.adapter(),\n }),\n Select.component({\n options: this.getTemplateOptionsForInput(),\n className: 'add-MimeType-value',\n oninput: withAttr('value', this.newMimeType.template),\n value: this.newMimeType.template(),\n }),\n Button.component(\n {\n type: 'button',\n className: 'Button Button--warning',\n onclick: this.addMimeType.bind(this),\n },\n '+'\n ),\n ])\n ),\n m('.helpText', app.translator.trans('fof-upload.admin.help_texts.mime_types')),\n Button.component(\n {\n className: 'Button',\n onclick() {\n app.modal.show(InspectMimeModal);\n },\n },\n app.translator.trans('fof-upload.admin.labels.inspect-mime')\n ),\n m('.helpText', app.translator.trans('fof-upload.admin.help_texts.download_templates')),\n this.templateOptionsDescriptions(),\n ]),\n m('fieldset.composerButtons', [\n m('legend', app.translator.trans('fof-upload.admin.labels.composer_buttons.title')),\n m('.helpText', app.translator.trans('fof-upload.admin.help_texts.composer_buttons')),\n m('div', [\n Select.component({\n options: this.composerButtonVisiblityOptions,\n onchange: this.values.composerButtonVisiblity,\n value: this.values.composerButtonVisiblity() || 'both',\n }),\n ]),\n ]),\n m('fieldset', [\n m('legend', app.translator.trans('fof-upload.admin.labels.resize.title')),\n m('.helpText', app.translator.trans('fof-upload.admin.help_texts.resize')),\n Switch.component(\n {\n state: this.values.mustResize() || false,\n onchange: this.values.mustResize,\n },\n app.translator.trans('fof-upload.admin.labels.resize.toggle')\n ),\n m('label', app.translator.trans('fof-upload.admin.labels.resize.max_width')),\n m('input', {\n className: 'FormControl',\n value: this.values.resizeMaxWidth() || 100,\n oninput: withAttr('value', this.values.resizeMaxWidth),\n disabled: !this.values.mustResize(),\n type: 'number',\n min: '0',\n }),\n ]),\n m('fieldset', [\n m('legend', app.translator.trans('fof-upload.admin.labels.client_extension.title')),\n m('.helpText', app.translator.trans('fof-upload.admin.help_texts.client_extension')),\n m('input', {\n className: 'FormControl',\n value: this.values.whitelistedClientExtensions() || '',\n oninput: withAttr('value', this.values.whitelistedClientExtensions),\n }),\n ]),\n m('fieldset', [\n m('legend', app.translator.trans('fof-upload.admin.labels.watermark.title')),\n m('.helpText', app.translator.trans('fof-upload.admin.help_texts.watermark')),\n Switch.component(\n {\n state: this.values.addsWatermarks() || false,\n onchange: this.values.addsWatermarks,\n },\n app.translator.trans('fof-upload.admin.labels.watermark.toggle')\n ),\n m('label', app.translator.trans('fof-upload.admin.labels.watermark.position')),\n m('div', [\n Select.component({\n options: this.watermarkPositions,\n onchange: this.values.watermarkPosition,\n value: this.values.watermarkPosition() || 'bottom-right',\n }),\n ]),\n m('label', {}, app.translator.trans('fof-upload.admin.labels.watermark.file')),\n UploadImageButton.component({\n name: 'fof-watermark',\n path: 'fof/watermark',\n }),\n ]),\n m('fieldset', [\n m('legend', app.translator.trans('fof-upload.admin.labels.disable-hotlink-protection.title')),\n m('.helpText', app.translator.trans('fof-upload.admin.help_texts.disable-hotlink-protection')),\n Switch.component(\n {\n state: this.values.disableHotlinkProtection() || false,\n onchange: this.values.disableHotlinkProtection,\n },\n app.translator.trans('fof-upload.admin.labels.disable-hotlink-protection.toggle')\n ),\n m('legend', app.translator.trans('fof-upload.admin.labels.disable-download-logging.title')),\n m('.helpText', app.translator.trans('fof-upload.admin.help_texts.disable-download-logging')),\n Switch.component(\n {\n state: this.values.disableDownloadLogging() || false,\n onchange: this.values.disableDownloadLogging,\n },\n app.translator.trans('fof-upload.admin.labels.disable-download-logging.toggle')\n ),\n ]),\n m('fieldset', [\n m('legend', app.translator.trans('fof-upload.admin.labels.local.title')),\n m('label', app.translator.trans('fof-upload.admin.labels.local.cdn_url')),\n m('input.FormControl', {\n value: this.values.cdnUrl() || '',\n oninput: withAttr('value', this.values.cdnUrl),\n }),\n ]),\n\n this.adaptorItems().toArray(),\n\n Button.component(\n {\n type: 'submit',\n className: 'Button Button--primary',\n loading: this.loading,\n disabled: !this.changed(),\n },\n app.translator.trans('core.admin.settings.submit_button')\n ),\n ]\n ),\n ]),\n ]),\n ];\n }\n\n adaptorItems() {\n const items = new ItemList();\n\n if (this.uploadMethodOptions['imgur'] !== undefined) {\n items.add(\n 'imgur',\n
    \n
    \n {app.translator.trans('fof-upload.admin.labels.imgur.title')}\n

    \n {icon('fas fa-exclamation-circle')}{' '}\n {app.translator.trans('fof-upload.admin.labels.imgur.tos', {\n a: ,\n })}\n

    \n \n \n
    \n
    ,\n 100\n );\n }\n\n if (this.uploadMethodOptions['qiniu'] !== undefined) {\n items.add(\n 'qiniu',\n m('.qiniu', [\n m('fieldset', [\n m('legend', app.translator.trans('fof-upload.admin.labels.qiniu.title')),\n m('label', app.translator.trans('fof-upload.admin.labels.qiniu.key')),\n m('input.FormControl', {\n value: this.values.qiniuKey() || '',\n oninput: withAttr('value', this.values.qiniuKey),\n }),\n m('label', {}, app.translator.trans('fof-upload.admin.labels.qiniu.secret')),\n m('input.FormControl', {\n value: this.values.qiniuSecret() || '',\n oninput: withAttr('value', this.values.qiniuSecret),\n }),\n m('label', {}, app.translator.trans('fof-upload.admin.labels.qiniu.bucket')),\n m('input.FormControl', {\n value: this.values.qiniuBucket() || '',\n oninput: withAttr('value', this.values.qiniuBucket),\n }),\n ]),\n ]),\n 80\n );\n }\n\n if (this.uploadMethodOptions['aws-s3'] !== undefined) {\n items.add(\n 'aws-s3',\n m('.aws', [\n m('fieldset', [\n m('legend', app.translator.trans('fof-upload.admin.labels.aws-s3.title')),\n m('.helpText', app.translator.trans('fof-upload.admin.help_texts.s3_instance_profile')),\n m('label', app.translator.trans('fof-upload.admin.labels.aws-s3.key')),\n m('input.FormControl', {\n value: this.values.awsS3Key() || '',\n oninput: withAttr('value', this.values.awsS3Key),\n }),\n m('label', app.translator.trans('fof-upload.admin.labels.aws-s3.secret')),\n m('input.FormControl', {\n value: this.values.awsS3Secret() || '',\n oninput: withAttr('value', this.values.awsS3Secret),\n }),\n m('label', app.translator.trans('fof-upload.admin.labels.aws-s3.bucket')),\n m('input.FormControl', {\n value: this.values.awsS3Bucket() || '',\n oninput: withAttr('value', this.values.awsS3Bucket),\n }),\n m('label', app.translator.trans('fof-upload.admin.labels.aws-s3.region')),\n m('input.FormControl', {\n value: this.values.awsS3Region() || '',\n oninput: withAttr('value', this.values.awsS3Region),\n }),\n ]),\n m('fieldset', [\n m('legend', app.translator.trans('fof-upload.admin.labels.aws-s3.advanced_title')),\n m('.helpText', app.translator.trans('fof-upload.admin.help_texts.s3_compatible_storage')),\n m('label', app.translator.trans('fof-upload.admin.labels.aws-s3.endpoint')),\n m('input.FormControl', {\n value: this.values.awsS3Endpoint() || '',\n oninput: withAttr('value', this.values.awsS3Endpoint),\n }),\n Switch.component(\n {\n state: this.values.awsS3UsePathStyleEndpoint() || false,\n onchange: this.values.awsS3UsePathStyleEndpoint,\n },\n app.translator.trans('fof-upload.admin.labels.aws-s3.use_path_style_endpoint')\n ),\n m('label', app.translator.trans('fof-upload.admin.labels.aws-s3.acl')),\n m('input.FormControl', {\n value: this.values.awsS3ACL() || '',\n oninput: withAttr('value', this.values.awsS3ACL),\n }),\n m('.helpText', app.translator.trans('fof-upload.admin.help_texts.s3_acl')),\n m('label', app.translator.trans('fof-upload.admin.labels.aws-s3.custom_url')),\n m('input.FormControl', {\n value: this.values.awsS3CustomUrl() || '',\n oninput: withAttr('value', this.values.awsS3CustomUrl),\n }),\n m('.helpText', app.translator.trans('fof-upload.admin.help_texts.custom_s3_url')),\n ]),\n ]),\n 60\n );\n }\n\n return items;\n }\n\n getTemplateOptionsForInput() {\n const options = {};\n\n for (let option in this.templateOptions) {\n if (!this.templateOptions.hasOwnProperty(option)) {\n continue;\n }\n\n options[option] = this.templateOptions[option].name;\n }\n\n return options;\n }\n\n updateMimeTypeKey(mime, value) {\n this.values.mimeTypes()[value] = this.values.mimeTypes()[mime];\n\n this.deleteMimeType(mime);\n }\n\n updateMimeTypeAdapter(mime, config, value) {\n config.adapter = value;\n this.values.mimeTypes()[mime] = config;\n }\n\n updateMimeTypeTemplate(mime, config, value) {\n config.template = value;\n this.values.mimeTypes()[mime] = config;\n }\n\n deleteMimeType(mime) {\n delete this.values.mimeTypes()[mime];\n }\n\n templateOptionsDescriptions() {\n const children = [];\n\n for (let template in this.templateOptions) {\n if (!this.templateOptions.hasOwnProperty(template)) {\n continue;\n }\n\n children.push(\n
  • \n {this.templateOptions[template].name}: {m.trust(this.templateOptions[template].description)}\n
  • \n );\n }\n\n return m('ul', children);\n }\n\n addMimeType() {\n this.values.mimeTypes()[this.newMimeType.regex()] = {\n adapter: this.newMimeType.adapter(),\n template: this.newMimeType.template(),\n };\n\n this.newMimeType.regex('');\n this.newMimeType.adapter('local');\n this.newMimeType.template('file');\n }\n\n /**\n * Checks if the values of the fields and checkboxes are different from\n * the ones stored in the database\n *\n * @returns boolean\n */\n changed() {\n const fieldsCheck = this.fields.some((key) => this.values[key]() !== app.data.settings[this.addPrefix(key)]);\n const checkboxesCheck = this.checkboxes.some((key) => this.values[key]() !== (app.data.settings[this.addPrefix(key)] === '1'));\n const objectsCheck = this.objects.some((key) => JSON.stringify(this.values[key]()) !== app.data.settings[this.addPrefix(key)]);\n\n return fieldsCheck || checkboxesCheck || objectsCheck;\n }\n\n /**\n * Saves the settings to the database and redraw the page\n *\n * @param e\n */\n onsubmit(e) {\n // prevent the usual form submit behaviour\n e.preventDefault();\n\n // if the page is already saving, do nothing\n if (this.loading) return;\n\n // prevents multiple savings\n this.loading = true;\n\n // remove previous success popup\n app.alerts.dismiss(this.successAlert);\n\n const settings = {};\n\n // gets all the values from the form\n this.fields.forEach((key) => (settings[this.addPrefix(key)] = this.values[key]()));\n this.checkboxes.forEach((key) => (settings[this.addPrefix(key)] = this.values[key]()));\n this.objects.forEach((key) => (settings[this.addPrefix(key)] = JSON.stringify(this.values[key]())));\n\n // actually saves everything in the database\n saveSettings(settings)\n .then(() => {\n // on success, show popup\n this.successAlert = app.alerts.show(Alert, { type: 'success' }, app.translator.trans('core.admin.settings.saved_message'));\n })\n .catch(() => {})\n .then(() => {\n // return to the initial state and redraw the page\n this.loading = false;\n m.redraw();\n });\n }\n\n /**\n * Adds the prefix `this.settingsPrefix` at the beginning of `key`\n *\n * @returns string\n */\n addPrefix(key) {\n return this.settingsPrefix + '.' + key;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/AdminNav'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LinkButton'];","function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };","function asyncGeneratorStep(n, t, e, r, o, a, c) {\n try {\n var i = n[a](c),\n u = i.value;\n } catch (n) {\n return void e(n);\n }\n i.done ? t(u) : Promise.resolve(u).then(r, o);\n}\nfunction _asyncToGenerator(n) {\n return function () {\n var t = this,\n e = arguments;\n return new Promise(function (r, o) {\n var a = n.apply(t, e);\n function _next(n) {\n asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n);\n }\n function _throw(n) {\n asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n);\n }\n _next(void 0);\n });\n };\n}\nexport { _asyncToGenerator as default };","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/app'];","const mimeToIconMap = new Map([\n // Image formats\n ['image/png', 'far fa-file-image'],\n ['image/jpg', 'far fa-file-image'],\n ['image/jpeg', 'far fa-file-image'],\n ['image/svg+xml', 'far fa-file-image'],\n ['image/gif', 'far fa-file-image'],\n ['image/bmp', 'far fa-file-image'],\n ['image/webp', 'far fa-file-image'],\n\n // Compressed file formats\n ['application/zip', 'far fa-file-archive'],\n ['application/x-7z-compressed', 'far fa-file-archive'],\n ['application/gzip', 'far fa-file-archive'],\n ['application/vnd.rar', 'far fa-file-archive'],\n ['application/x-rar-compressed', 'far fa-file-archive'],\n ['application/x-tar', 'far fa-file-archive'],\n ['application/x-iso9660-image', 'far fa-file-archive'],\n\n // Text and code file formats\n ['text/plain', 'far fa-file-alt'],\n ['text/csv', 'far fa-file-csv'],\n ['text/xml', 'far fa-file-code'],\n ['text/html', 'far fa-file-code'],\n ['text/css', 'far fa-file-code'],\n ['text/javascript', 'far fa-file-code'],\n ['application/json', 'far fa-file-code'],\n ['application/ld+json', 'far fa-file-code'],\n ['application/x-httpd-php', 'far fa-file-code'],\n ['application/xml', 'far fa-file-code'],\n ['text/xml', 'far fa-file-code'],\n\n // Document formats\n ['application/x-abiword', 'far fa-file-word'],\n ['application/msword', 'far fa-file-word'],\n ['application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'far fa-file-word'],\n ['application/vnd.oasis.opendocument.text', 'far fa-file-word'],\n ['application/vnd.ms-excel', 'far fa-file-excel'],\n ['application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'far fa-file-excel'],\n ['application/vnd.oasis.opendocument.spreadsheet', 'far fa-file-excel'],\n ['application/vnd.ms-powerpoint', 'far fa-file-powerpoint'],\n ['application/vnd.openxmlformats-officedocument.presentationml.presentation', 'far fa-file-powerpoint'],\n ['application/vnd.oasis.opendocument.presentation', 'far fa-file-powerpoint'],\n ['application/pdf', 'far fa-file-pdf'],\n ['application/rtf', 'far fa-file-alt'],\n\n // eBook formats\n ['application/epub+zip', 'far fa-book'],\n ['application/x-mobipocket-ebook', 'far fa-book'],\n ['application/vnd.amazon.ebook', 'far fa-book'],\n\n // Audio formats\n ['audio/mpeg', 'far fa-file-audio'],\n ['audio/wav', 'far fa-file-audio'],\n ['audio/x-wav', 'far fa-file-audio'],\n ['audio/aac', 'far fa-file-audio'],\n ['audio/ogg', 'far fa-file-audio'],\n ['audio/flac', 'far fa-file-audio'],\n ['audio/aiff', 'far fa-file-audio'],\n ['audio/x-aiff', 'far fa-file-audio'],\n\n // Video formats\n ['video/x-msvideo', 'far fa-file-video'],\n ['video/mp4', 'far fa-file-video'],\n ['video/quicktime', 'far fa-file-video'],\n]);\n\nexport default function mimeToIcon(fileType: string): string {\n // Directly return the icon if the fileType is in the map\n return (\n mimeToIconMap.get(fileType) ||\n (function () {\n // Check for generic types\n if (fileType.startsWith('image/')) {\n return 'far fa-file-image';\n } else if (fileType.startsWith('video/')) {\n return 'far fa-file-video';\n } else if (fileType.startsWith('audio/')) {\n return 'far fa-file-audio';\n }\n\n // Default icon\n return 'far fa-file';\n })()\n );\n}\n","import app from 'flarum/common/app';\nimport Modal, { IInternalModalAttrs } from 'flarum/common/components/Modal';\nimport Switch from 'flarum/common/components/Switch';\nimport mimeToIcon from '../mimeToIcon';\nimport Button from 'flarum/common/components/Button';\nimport type Mithril from 'mithril';\nimport { ApiResponsePlural } from 'flarum/common/Store';\nimport File from '../models/File';\n\ninterface CustomAttrs extends IInternalModalAttrs {\n onUploadComplete: (files: File | File[]) => void;\n}\n\nexport default class UploadSharedFileModal extends Modal {\n files = [];\n fileInput = null;\n options = {\n shared: true,\n hidden: false,\n };\n loading: boolean = false;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n }\n\n className() {\n return 'UploadSharedFileModal Modal--medium';\n }\n\n title() {\n return app.translator.trans('fof-upload.lib.upload-shared-file-modal.title');\n }\n\n onFileChange(e) {\n this.addFiles(Array.from(e.target.files));\n }\n\n addFiles(newFiles: File[]) {\n (this.files as File[]).push(...newFiles);\n m.redraw();\n }\n\n onDragOver(e) {\n e.preventDefault();\n e.stopPropagation();\n }\n\n onDrop(e) {\n e.preventDefault();\n e.stopPropagation();\n if (e.dataTransfer && e.dataTransfer.files) {\n this.addFiles(Array.from(e.dataTransfer.files));\n }\n }\n\n onDropzoneClick() {\n if (this.fileInput) {\n this.fileInput.click();\n }\n }\n\n content() {\n return (\n
    \n this.onDropzoneClick()}\n ondragover={this.onDragOver.bind(this)}\n ondrop={this.onDrop.bind(this)}\n >\n {app.translator.trans('fof-upload.lib.upload-shared-file-modal.dropzone')}\n {\n this.fileInput = vnode.dom;\n }}\n />\n
    \n
    \n {this.files.map((file: File) => {\n const isImage = file.type.startsWith('image/');\n return (\n
    \n {isImage ? {file.name} : }\n
    {file.name}
    \n {/* Remove button */}\n {\n this.files = this.files.filter((f) => f !== file);\n }}\n />\n
    \n );\n })}\n
    \n
    \n (this.options.hidden = value)}>\n {app.translator.trans('fof-upload.lib.upload-shared-file-modal.hide-from-media-gallery')}\n \n
    \n
    \n \n {app.translator.trans('fof-upload.lib.upload-shared-file-modal.upload')}\n \n
    \n \n );\n }\n\n async upload() {\n this.loading = true;\n m.redraw();\n\n const formData = new FormData();\n\n // Append each file to the form data\n this.files.forEach((file) => {\n formData.append('files[]', file);\n });\n\n Object.keys(this.options).forEach((key) => {\n formData.append(`options[${key}]`, this.options[key]);\n });\n\n const results = await app.request>({\n method: 'POST',\n url: app.forum.attribute('apiUrl') + '/fof/upload',\n serialize: (raw: FormData) => raw, // Prevent mithril from trying to serialize FormData\n body: formData,\n });\n\n const uploadedFiles = app.store.pushPayload(results);\n\n this.attrs.onUploadComplete(uploadedFiles);\n this.files = [];\n this.hide();\n\n this.loading = false;\n m.redraw();\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","import Component, { ComponentAttrs } from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport type Mithril from 'mithril';\nimport mimeToIcon from '../mimeToIcon';\nimport File from '../models/File';\nimport icon from 'flarum/common/helpers/icon';\nimport app from 'flarum/common/app';\nimport classList from 'flarum/common/utils/classList';\n\ninterface CustomAttrs extends ComponentAttrs {\n file: File;\n selectable: boolean;\n fileClassNames: string;\n onDelete: (file: File) => void | undefined;\n onFileSelect: (file: File) => void | undefined;\n}\n\nexport default class UploadedFile extends Component {\n file!: File;\n callback!: () => void | undefined;\n imageLoaded: boolean = true;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.file = this.attrs.file;\n }\n\n view() {\n const isImage = this.file.type().startsWith('image/');\n const fileIcon = mimeToIcon(this.file.type());\n const errorIcon = 'fas fa-exclamation-triangle';\n const statusIcon = this.file.isPrivateShared() ? 'fas fa-lock' : 'fas fa-unlock';\n\n return (\n
    \n
    \n \n {icon(statusIcon)}\n {this.file.baseName()}\n \n
    \n
    this.onFileClick(this.file)}>\n {isImage ? (\n this.imageLoaded ? (\n \n ) : (\n icon(errorIcon, { className: 'icon-fallback' }) // Error icon for failed image load\n )\n ) : (\n icon(fileIcon, { className: 'icon-fallback' }) // Icon representing the file type\n )}\n
    \n
    {this.actionItems().toArray()}
    \n
    \n );\n }\n\n actionItems(): ItemList {\n const items = new ItemList();\n\n items.add(\n 'view-info',\n \n \n )}\n \n );\n }\n\n onDelete(file: File) {\n if (this.attrs.onDelete) {\n this.attrs.onDelete(file);\n }\n }\n\n // Common methods like onFileClick, isSelectable, hideFile...\n\n onFileClick(file: File) {\n // Custom functionality\n if (this.attrs.onFileSelect) {\n this.attrs.onFileSelect(file);\n return;\n }\n\n // Download on click\n if (this.attrs.downloadOnClick) {\n window.open(file.url());\n return;\n }\n }\n\n isSelectable(file: File) {\n const fileType = file.type();\n\n // Custom defined file types\n if (Array.isArray(this.restrictFileType)) {\n return this.restrictFileType.indexOf(fileType) >= 0;\n }\n\n // Image\n else if (this.restrictFileType === 'image') {\n return fileType.includes('image/');\n }\n\n // Audio\n else if (this.restrictFileType === 'audio') {\n return fileType.includes('audio/');\n }\n\n // Video\n else if (this.restrictFileType === 'video') {\n return fileType.includes('video/');\n }\n\n return false;\n }\n\n /**\n * Begins the hiding process for a file.\n *\n * - Shows a native confirmation dialog\n * - If confirmed, sends AJAX request to the hide file API\n */\n async hideFile(file: File) {\n const uuid = file.uuid();\n\n if (this.filesBeingHidden.includes(uuid)) return;\n\n this.filesBeingHidden.push(uuid);\n\n const transPrefix = file.isShared() ? 'fof-upload.lib.file_list.hide_shared_file' : 'fof-upload.lib.file_list.hide_file';\n\n const confirmToggleHide = confirm(\n extractText(\n app.translator.trans(file.hidden() ? `${transPrefix}.show_confirmation` : `${transPrefix}.hide_confirmation`, {\n fileName: file.baseName(),\n })\n )\n );\n\n if (confirmToggleHide) {\n try {\n const filePayload = await app.request({\n method: 'PATCH',\n url: `${app.forum.attribute('apiUrl')}/fof/upload/hide`,\n body: { uuid },\n });\n\n app.store.pushPayload(filePayload);\n m.redraw();\n\n app.alerts.show(Alert, { type: 'success' }, [\n icon(file.hidden() ? 'fas fa-eye-slash' : 'fas fa-eye'),\n ' ',\n app.translator.trans(file?.hidden() ? `${transPrefix}.hide_success` : `${transPrefix}.show_success`),\n ]);\n\n if (this.fileState.user) {\n const index = this.fileState.files.findIndex((file: File) => uuid === file.uuid());\n this.fileState.files.splice(index, 1);\n }\n } catch (error) {\n app.alerts.show(\n Alert,\n { type: 'error' },\n app.translator.trans(file?.hidden() ? `${transPrefix}.hide_fail` : `${transPrefix}.show_fail`, {\n fileName: file.baseName(),\n })\n );\n } finally {\n // Remove file from hiding list\n const i = this.filesBeingHidden.indexOf(uuid);\n this.filesBeingHidden.splice(i, 1);\n }\n }\n }\n}\n","import UploadPage from './UploadPage';\nimport { commonComponents } from '../../common/components';\n\nexport const components = {\n ...commonComponents,\n UploadPage,\n};\n","import UploadSharedFileModal from './UploadSharedFileModal';\nimport UploadedFile from './UploadedFile';\nimport UserFileList from './UserFileList';\n\nexport const commonComponents = {\n UploadedFile,\n UploadSharedFileModal,\n UserFileList,\n};\n","import app from 'flarum/common/app';\nimport File from '../models/File';\nimport AbstractFileList from './AbstractFIleList';\nimport FileListState from '../states/FileListState';\n\nexport default class UserFileList extends AbstractFileList {\n public loadFileList(): void {\n //app.fileListState.setUser(this.attrs.user || app.session.user);\n this.fileState.setUser(this.attrs.user || app.session.user);\n /**\n * The user who's media we are dealing with\n */\n this.user = this.fileState.user; //app.fileListState.user;\n }\n\n hasMoreResults(): boolean {\n return this.fileState.hasMoreResults();\n }\n\n loadMore(): void {\n this.fileState.loadMore();\n }\n\n isLoading(): boolean {\n return this.fileState.isLoading();\n }\n\n fileCollection(): File[] {\n return this.fileState.files;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extenders'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","import Model from 'flarum/common/Model';\n\nexport default class File extends Model {\n baseName() {\n return Model.attribute('baseName').call(this);\n }\n\n path() {\n return Model.attribute('path').call(this);\n }\n\n url() {\n return Model.attribute('url').call(this);\n }\n\n size() {\n return Model.attribute('size').call(this);\n }\n\n type() {\n return Model.attribute('type').call(this);\n }\n\n humanSize() {\n return Model.attribute('humanSize').call(this);\n }\n\n createdAt() {\n return Model.attribute('createdAt', Model.transformDate).call(this);\n }\n\n uuid() {\n return Model.attribute('uuid').call(this);\n }\n\n tag() {\n return Model.attribute('tag').call(this);\n }\n\n hidden() {\n return Model.attribute('hidden').call(this);\n }\n\n bbcode() {\n return Model.attribute('bbcode').call(this);\n }\n\n isShared() {\n return Model.attribute('shared').call(this);\n }\n\n isPrivateShared() {\n return Model.attribute('isPrivateShared').call(this);\n }\n\n canViewInfo() {\n return Model.attribute('canViewInfo').call(this);\n }\n\n canHide() {\n return Model.attribute('canHide').call(this);\n }\n\n canDelete() {\n return Model.attribute('canDelete').call(this);\n }\n\n apiEndpoint() {\n return '/fof/uploads' + (this.exists ? '/' + this.id() : '');\n }\n}\n","import Extend from 'flarum/common/extenders';\nimport File from './models/File';\n\nexport default [\n new Extend.Store() //\n .add('files', File)\n .add('shared-files', File),\n];\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/AdminPage'];","import app from 'flarum/common/app';\nimport File from '../models/File';\nimport AbstractFileList from './AbstractFIleList';\n\nexport default class SharedFileList extends AbstractFileList {\n public loadFileList(): void {\n this.fileState.loadResults();\n }\n\n hasMoreResults() {\n return this.fileState.hasMoreResults();\n }\n\n loadMore() {\n this.fileState.loadMore();\n }\n\n isLoading(): boolean {\n return this.fileState.isLoading();\n }\n\n fileCollection(): File[] {\n return this.fileState.files;\n }\n}\n","import app from 'flarum/common/app';\nimport User from 'flarum/common/models/User';\nimport File from '../models/File';\nimport { ApiQueryParamsPlural, ApiResponsePlural } from 'flarum/common/Store';\n\nexport default class FileListState {\n public user: User | null;\n public files: File[];\n private moreResults: boolean;\n private loading: boolean;\n private sharedFiles: boolean;\n\n constructor(sharedFiles: boolean = false) {\n this.user = null;\n this.files = [];\n this.moreResults = false;\n this.loading = false;\n this.sharedFiles = sharedFiles;\n }\n\n /**\n * Set the user and load their file list.\n * @param user The user whose files to load.\n */\n public setUser(user: User): void {\n if (user === this.user) return;\n\n this.user = user;\n this.files = [];\n this.loadResults();\n }\n\n public refresh(): void {\n this.files = [];\n this.loadResults();\n m.redraw();\n }\n\n /**\n * Load more files for the current user, starting from the given offset.\n * @param offset The starting index for loading more files.\n * @returns A promise resolving to the loaded files.\n */\n public async loadResults(offset: number = 0): Promise> {\n if (!this.sharedFiles && !this.user) return Promise.reject('User not set');\n\n this.loading = true;\n\n let route: string = 'fof/uploads';\n let params: ApiQueryParamsPlural = {};\n\n if (!this.sharedFiles && this.user) {\n params = {\n filter: { user: this.user.id() },\n page: { offset },\n } as ApiQueryParamsPlural;\n } else {\n route = 'fof/upload/shared-files';\n params = {\n page: { offset },\n } as ApiQueryParamsPlural;\n }\n\n const results = await app.store.find(route, params);\n\n return this.parseResults(results);\n }\n\n /**\n * Load the next set of results.\n */\n public async loadMore(): Promise> {\n this.loading = true;\n return this.loadResults(this.files.length);\n }\n\n private parseResults(results: ApiResponsePlural): ApiResponsePlural {\n this.files = this.files.concat(results);\n this.loading = false;\n this.moreResults = !!results.payload?.links?.next;\n m.redraw();\n return results;\n }\n\n /**\n * Add files to the beginning of the list.\n * @param files The files to be added.\n */\n public addToList(files: File | File[]): void {\n if (Array.isArray(files)) {\n this.files.unshift(...files);\n } else {\n this.files.unshift(files);\n }\n m.redraw();\n }\n\n /**\n * Remove files from the list.\n * @param files The files to be removed.\n */\n public removeFromList(files: File | File[]): void {\n if (Array.isArray(files)) {\n this.files = this.files.filter((file) => !files.includes(file));\n } else {\n this.files = this.files.filter((file) => file !== files);\n }\n\n m.redraw();\n }\n\n /**\n * Check if there are files in the list.\n * @returns True if there are files, false otherwise.\n */\n public hasFiles(): boolean {\n return this.files.length > 0;\n }\n\n /**\n * Check if the file list is currently loading.\n * @returns True if loading, false otherwise.\n */\n public isLoading(): boolean {\n return this.loading;\n }\n\n /**\n * Check if there are more files to load.\n * @returns True if there are more files, false otherwise.\n */\n public hasMoreResults(): boolean {\n return this.moreResults;\n }\n\n /**\n * Check if the user has no files and the list is not loading.\n * @returns True if the list is empty and not loading, false otherwise.\n */\n public empty(): boolean {\n return !this.hasFiles() && !this.isLoading();\n }\n}\n","import app from 'flarum/admin/app';\nimport AdminPage, { AdminHeaderAttrs } from 'flarum/admin/components/AdminPage';\nimport Button from 'flarum/common/components/Button';\nimport { IPageAttrs } from 'flarum/common/components/Page';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport type Mithril from 'mithril';\nimport UploadSharedFileModal from '../../common/components/UploadSharedFileModal';\nimport File from 'src/common/models/File';\nimport SharedFileList from '../../common/components/SharedFileList';\nimport FileListState from '../../common/states/FileListState';\n\nexport default class SharedUploadPage extends AdminPage {\n sharedUploads: File[] = [];\n currentPage: number = 1;\n fileState!: FileListState;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.fileState = new FileListState(true);\n }\n\n headerInfo(): AdminHeaderAttrs {\n return {\n className: 'SharedUploadPage--header',\n icon: 'fas fa-file-upload',\n title: app.translator.trans('fof-upload.admin.shared-uploads.title'),\n description: app.translator.trans('fof-upload.admin.shared-uploads.description'),\n };\n }\n\n content(): Mithril.Children {\n return (\n
    \n

    {app.translator.trans('fof-upload.admin.shared-uploads.introduction')}

    \n
    \n
    {this.mainActionItems().toArray()}
    \n
    \n
    \n \n
    \n
    \n );\n }\n\n showUploadModal() {\n app.modal.show(UploadSharedFileModal, {\n onUploadComplete: (files: File | File[]) => {\n this.uploadComplete(files);\n },\n });\n }\n\n mainActionItems(): ItemList {\n const items = new ItemList();\n\n items.add('refresh', \n );\n\n return items;\n }\n\n fileActionItems(file: File): ItemList {\n const items = new ItemList();\n\n return items;\n }\n\n uploadComplete(files: File | File[]) {\n console.log('upload complete', files);\n this.fileState.addToList(files);\n }\n\n refresh() {\n this.fileState.refresh();\n }\n\n onDelete(file: File) {\n this.fileState.removeFromList(file);\n }\n}\n","import { default as extend } from '../common/extend';\nimport Extend from 'flarum/common/extenders';\nimport SharedUploadPage from './components/SharedUploadPage';\n\nexport default [\n ...extend,\n\n new Extend.Routes() //\n .add('adminUploads', '/uploads', SharedUploadPage),\n];\n","import app from 'flarum/admin/app';\nimport UploadPage from './components/UploadPage';\nimport extendAdminNav from './extendAdminNav';\nimport FileListState from '../common/states/FileListState';\n\nexport * from './components';\n\nexport { default as extend } from './extend';\n\napp.initializers.add('fof-upload', () => {\n app.extensionData\n .for('fof-upload')\n .registerPage(UploadPage)\n .registerPermission(\n {\n icon: 'far fa-file',\n label: app.translator.trans('fof-upload.admin.permissions.upload_label'),\n permission: 'fof-upload.upload',\n },\n 'start',\n 50\n )\n .registerPermission(\n {\n icon: 'fas fa-download',\n label: app.translator.trans('fof-upload.admin.permissions.download_label'),\n permission: 'fof-upload.download',\n allowGuest: true,\n },\n 'view',\n 50\n )\n .registerPermission(\n {\n icon: 'fas fa-eye',\n label: app.translator.trans('fof-upload.admin.permissions.view_user_uploads_label'),\n permission: 'fof-upload.viewUserUploads',\n },\n 'moderate',\n 50\n )\n .registerPermission(\n {\n icon: 'fas fa-trash',\n label: app.translator.trans('fof-upload.admin.permissions.delete_uploads_of_others_label'),\n permission: 'fof-upload.deleteUserUploads',\n },\n 'moderate',\n 50\n )\n .registerPermission(\n {\n icon: 'far fa-file-alt',\n label: app.translator.trans('fof-upload.admin.permissions.upload_shared_label'),\n permission: 'fof-upload.upload-shared-files',\n },\n 'start'\n )\n .registerPermission(\n {\n icon: 'far fa-file-alt',\n label: app.translator.trans('fof-upload.admin.permissions.access_shared_label'),\n permission: 'fof-upload.access-shared-files',\n },\n 'start'\n );\n\n extendAdminNav();\n\n //app.fileListState = new FileListState();\n});\n","import app from 'flarum/admin/app';\nimport { extend } from 'flarum/common/extend';\nimport AdminNav from 'flarum/admin/components/AdminNav';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport type Mithril from 'mithril';\n\nexport default function extendAdminNav() {\n extend(AdminNav.prototype, 'items', function (items: ItemList) {\n items.add(\n 'shared-uploads',\n \n {app.translator.trans('fof-upload.admin.nav.shared-uploads-button')}\n ,\n 49\n );\n });\n}\n"],"names":["_typeof","require","_regeneratorRuntime","module","exports","e","__esModule","t","r","Object","prototype","n","hasOwnProperty","o","defineProperty","value","i","Symbol","a","iterator","c","asyncIterator","u","toStringTag","define","enumerable","configurable","writable","wrap","Generator","create","Context","makeInvokeMethod","tryCatch","type","arg","call","h","l","f","s","y","GeneratorFunction","GeneratorFunctionPrototype","p","this","d","getPrototypeOf","v","values","g","defineIteratorMethods","forEach","_invoke","AsyncIterator","invoke","resolve","__await","then","callInvokeWithMethodAndArg","Error","done","method","delegate","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","TypeError","resultName","next","nextLoc","pushTryEntry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","isNaN","length","displayName","isGeneratorFunction","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","keys","reverse","pop","prev","charAt","slice","stop","rval","handle","complete","finish","delegateYield","runtime","regeneratorRuntime","accidentalStrictMode","globalThis","Function","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","getter","definition","key","get","obj","prop","flarum","core","compat","_setPrototypeOf","bind","_inheritsLoose","UploadImageButton","_FlarumUploadImageBut","apply","arguments","resourceUrl","app","attribute","attrs","path","FlarumUploadImageButton","InspectMimeModal","_Modal","_proto","oninit","vnode","uploading","inspection","className","title","trans","content","m","href","onchange","onupload","disabled","LoadingIndicator","laravel_validation","error","laravel_validation_error","mime_detector","php_mime","guessed_extension","event","_this","body","FormData","target","files","append","url","serialize","raw","result","redraw","Modal","UploadPage","_ExtensionPage","loading","fields","checkboxes","objects","watermarkPositions","center","left","top","right","bottom","composerButtonVisiblityOptions","both","settings","settingsPrefix","uploadMethodOptions","addPrefix","templateOptions","Stream","JSON","parse","defaultAdap","mimeTypes","adapter","template","newMimeType","regex","_this2","max_post","max_upload","onsubmit","maxFileSize","oninput","withAttr","min","post","upload","map","mime","config","updateMimeTypeKey","Select","options","updateMimeTypeAdapter","getTemplateOptionsForInput","updateMimeTypeTemplate","Button","onclick","deleteMimeType","addMimeType","show","templateOptionsDescriptions","composerButtonVisiblity","Switch","state","mustResize","resizeMaxWidth","whitelistedClientExtensions","addsWatermarks","watermarkPosition","component","disableHotlinkProtection","disableDownloadLogging","cdnUrl","adaptorItems","toArray","changed","items","ItemList","add","icon","Link","external","imgurClientId","qiniuKey","qiniuSecret","qiniuBucket","awsS3Key","awsS3Secret","awsS3Bucket","awsS3Region","awsS3Endpoint","awsS3UsePathStyleEndpoint","awsS3ACL","awsS3CustomUrl","option","children","trust","description","_this3","fieldsCheck","some","checkboxesCheck","objectsCheck","stringify","_this4","preventDefault","dismiss","successAlert","saveSettings","Alert","ExtensionPage","_extends","assign","asyncGeneratorStep","_asyncToGenerator","_next","_throw","mimeToIconMap","Map","mimeToIcon","fileType","startsWith","UploadSharedFileModal","_len","args","Array","_key","concat","fileInput","shared","hidden","onFileChange","addFiles","from","newFiles","_ref","onDragOver","stopPropagation","onDrop","dataTransfer","onDropzoneClick","click","ondragover","ondrop","multiple","style","opacity","position","oncreate","dom","file","isImage","src","URL","createObjectURL","alt","filter","_upload","_callee","formData","results","uploadedFiles","_context","pushPayload","onUploadComplete","hide","UploadedFile","_Component","callback","imageLoaded","handleImageError","handleImageLoad","view","fileIcon","statusIcon","isPrivateShared","uuid","baseName","onFileClick","fileClassNames","onerror","onload","actionItems","viewFileInfo","window","open","hideFileIcon","hideFile","confirmDelete","_confirmDelete","confirm","onDelete","console","log","onFileSelect","Component","DisplayFile","isFileHiding","isSelected","isSelectable","fileSelectable","onbeforeupdate","fileSelectedClass","draggable","displayIcon","Tooltip","text","class","role","display","alignItems","justifyContent","height","canViewInfo","transPrefix","isShared","hideTranslation","fileName","canHide","deleteTranslation","canDelete","onHide","extractText","_x","AbstractFileList","user","inModal","restrictFileType","downloadOnClick","filesBeingHidden","fileState","selectable","loadFileList","isLoading","fileCollection","_file$id","_file$id2","classList","selectedFiles","indexOf","id","includes","hasMoreResults","loadMore","isArray","_hideFile","filePayload","index","findIndex","splice","t0","components","UserFileList","_AbstractFileList","setUser","File","_Model","Model","size","humanSize","createdAt","tag","bbcode","apiEndpoint","exists","Extend","SharedFileList","loadResults","FileListState","sharedFiles","moreResults","refresh","_loadResults","offset","route","params","reject","page","find","parseResults","_loadMore","_callee2","_context2","_results$payload","payload","links","addToList","_this$files","unshift","removeFromList","hasFiles","empty","SharedUploadPage","_AdminPage","sharedUploads","currentPage","headerInfo","mainActionItems","showUploadModal","uploadComplete","fileActionItems","AdminPage","extend","registerPage","registerPermission","label","permission","allowGuest","AdminNav","LinkButton"],"sourceRoot":""} \ No newline at end of file diff --git a/js/dist/forum.js b/js/dist/forum.js index f7442eb..e19d16a 100644 --- a/js/dist/forum.js +++ b/js/dist/forum.js @@ -1,3 +1,3 @@ /*! For license information please see forum.js.LICENSE.txt */ -(()=>{var t={24:(t,e,i)=>{var o=i(735).default;function a(){"use strict";t.exports=a=function(){return i},t.exports.__esModule=!0,t.exports.default=t.exports;var e,i={},r=Object.prototype,n=r.hasOwnProperty,s=Object.defineProperty||function(t,e,i){t[e]=i.value},l="function"==typeof Symbol?Symbol:{},u=l.iterator||"@@iterator",f=l.asyncIterator||"@@asyncIterator",c=l.toStringTag||"@@toStringTag";function d(t,e,i){return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{d({},"")}catch(e){d=function(t,e,i){return t[e]=i}}function p(t,e,i,o){var a=e&&e.prototype instanceof w?e:w,r=Object.create(a.prototype),n=new C(o||[]);return s(r,"_invoke",{value:D(t,i,n)}),r}function h(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}i.wrap=p;var m="suspendedStart",v="suspendedYield",g="executing",y="completed",b={};function w(){}function F(){}function x(){}var S={};d(S,u,(function(){return this}));var L=Object.getPrototypeOf,N=L&&L(L(O([])));N&&N!==r&&n.call(N,u)&&(S=N);var k=x.prototype=w.prototype=Object.create(S);function _(t){["next","throw","return"].forEach((function(e){d(t,e,(function(t){return this._invoke(e,t)}))}))}function B(t,e){function i(a,r,s,l){var u=h(t[a],t,r);if("throw"!==u.type){var f=u.arg,c=f.value;return c&&"object"==o(c)&&n.call(c,"__await")?e.resolve(c.__await).then((function(t){i("next",t,s,l)}),(function(t){i("throw",t,s,l)})):e.resolve(c).then((function(t){f.value=t,s(f)}),(function(t){return i("throw",t,s,l)}))}l(u.arg)}var a;s(this,"_invoke",{value:function(t,o){function r(){return new e((function(e,a){i(t,o,e,a)}))}return a=a?a.then(r,r):r()}})}function D(t,i,o){var a=m;return function(r,n){if(a===g)throw Error("Generator is already running");if(a===y){if("throw"===r)throw n;return{value:e,done:!0}}for(o.method=r,o.arg=n;;){var s=o.delegate;if(s){var l=E(s,o);if(l){if(l===b)continue;return l}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if(a===m)throw a=y,o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);a=g;var u=h(t,i,o);if("normal"===u.type){if(a=o.done?y:v,u.arg===b)continue;return{value:u.arg,done:o.done}}"throw"===u.type&&(a=y,o.method="throw",o.arg=u.arg)}}}function E(t,i){var o=i.method,a=t.iterator[o];if(a===e)return i.delegate=null,"throw"===o&&t.iterator.return&&(i.method="return",i.arg=e,E(t,i),"throw"===i.method)||"return"!==o&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+o+"' method")),b;var r=h(a,t.iterator,i.arg);if("throw"===r.type)return i.method="throw",i.arg=r.arg,i.delegate=null,b;var n=r.arg;return n?n.done?(i[t.resultName]=n.value,i.next=t.nextLoc,"return"!==i.method&&(i.method="next",i.arg=e),i.delegate=null,b):n:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,b)}function M(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function U(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(M,this),this.reset(!0)}function O(t){if(t||""===t){var i=t[u];if(i)return i.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,r=function i(){for(;++a=0;--a){var r=this.tryEntries[a],s=r.completion;if("root"===r.tryLoc)return o("end");if(r.tryLoc<=this.prev){var l=n.call(r,"catchLoc"),u=n.call(r,"finallyLoc");if(l&&u){if(this.prev=0;--i){var o=this.tryEntries[i];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),U(i),b}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var o=i.completion;if("throw"===o.type){var a=o.arg;U(i)}return a}}throw Error("illegal catch attempt")},delegateYield:function(t,i,o){return this.delegate={iterator:O(t),resultName:i,nextLoc:o},"next"===this.method&&(this.arg=e),b}},i}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports},735:t=>{function e(i){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(i)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},183:(t,e,i)=>{var o=i(24)();t.exports=o;try{regeneratorRuntime=o}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=o:Function("r","regeneratorRuntime = r")(o)}}},e={};function i(o){var a=e[o];if(void 0!==a)return a.exports;var r=e[o]={exports:{}};return t[o](r,r.exports,i),r.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var o in e)i.o(e,o)&&!i.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};(()=>{"use strict";i.r(o),i.d(o,{components:()=>mt,extend:()=>pt});const t=flarum.core.compat["forum/app"];var e=i.n(t);const a=flarum.core.compat["common/models/User"];var r=i.n(a);const n=flarum.core.compat["common/Model"];var s=i.n(n);const l=flarum.core.compat["common/extend"],u=flarum.core.compat["forum/components/Post"];var f=i.n(u);const c=flarum.core.compat["common/components/TextEditor"];var d=i.n(c);function p(t,e){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},p(t,e)}function h(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,p(t,e)}const v=flarum.core.compat["common/Component"];var g=i.n(v);const y=flarum.core.compat["common/components/Button"];var b=i.n(y);const w=flarum.core.compat["common/components/LoadingIndicator"];var F=i.n(w);const x=flarum.core.compat["common/utils/classList"];var S=i.n(x),L=function(t){function i(){return t.apply(this,arguments)||this}h(i,t);var o=i.prototype;return o.oninit=function(e){var i=this;t.prototype.oninit.call(this,e),this.attrs.uploader.on("uploaded",(function(){i.$("form")[0].reset(),m.redraw()})),this.isMediaUploadButton=e.attrs.isMediaUploadButton||!1},o.view=function(){var t=this.attrs.uploader.uploading?e().translator.trans("fof-upload.forum.states.loading"):e().translator.trans("fof-upload.forum.buttons.upload");return m(b(),{className:S()(["Button","hasIcon","fof-upload-button",!this.isMediaUploadButton&&!this.attrs.uploader.uploading&&"Button--icon",!this.isMediaUploadButton&&!this.attrs.uploader.uploading&&"Button--link",this.attrs.uploader.uploading&&"uploading"]),icon:!this.attrs.uploader.uploading&&"fas fa-file-upload",onclick:this.uploadButtonClicked.bind(this),disabled:this.attrs.disabled},this.attrs.uploader.uploading&&m(F(),{size:"small",display:"inline",className:"Button-icon"}),(this.isMediaUploadButton||this.attrs.uploader.uploading)&&m("span",{className:"Button-label"},t),m("form",null,m("input",{type:"file",multiple:!0,onchange:this.process.bind(this)})))},o.process=function(t){var e=this.$("input").prop("files");0!==e.length&&this.attrs.uploader.upload(e,!this.isMediaUploadButton)},o.uploadButtonClicked=function(t){this.$("input").click()},i}(g()),N=function(){function t(t,e){this.upload=t,this.composerElement=e,this.handlers={},this.supportsFileDragging()&&(this.composerElement.addEventListener("dragover",this.handlers.in=this.in.bind(this)),this.composerElement.addEventListener("dragleave",this.handlers.out=this.out.bind(this)),this.composerElement.addEventListener("dragend",this.handlers.out),this.composerElement.addEventListener("drop",this.handlers.dropping=this.dropping.bind(this)))}var e=t.prototype;return e.supportsFileDragging=function(){var t=document.createElement("div");return("draggable"in t||"ondragstart"in t&&"ondrop"in t)&&"FormData"in window&&"FileReader"in window},e.unload=function(){this.handlers.in&&(this.composerElement.removeEventListener("dragover",this.handlers.in),this.composerElement.removeEventListener("dragleave",this.handlers.out),this.composerElement.removeEventListener("dragend",this.handlers.out),this.composerElement.removeEventListener("drop",this.handlers.dropping))},e.isNotFile=function(t){if(t.dataTransfer.items)for(var e=0;e0&&(t.preventDefault(),this.upload(i))}},t}(),_=function(){function t(){this.callbacks={success:[],failure:[],uploading:[],uploaded:[]},this.uploading=!1}var i=t.prototype;return i.setState=function(t){this.fileState=t},i.on=function(t,e){this.callbacks[t].push(e)},i.dispatch=function(t,e){this.callbacks[t].forEach((function(t){return t(e)}))},i.upload=function(t,i){var o=this;void 0===i&&(i=!0),this.uploading=!0,this.dispatch("uploading",t),m.redraw();for(var a=new FormData,r=0;r=0&&"fof-file-selected"]),s=t.filesBeingHidden.includes(e.uuid());return m("li",{"aria-busy":s,key:e.uuid()},m(W,{file:e,fileSelectable:r,isSelected:t.attrs.selectedFiles&&t.attrs.selectedFiles.indexOf(null!=(o=e.id())?o:"")>=0,fileClassNames:n,isFileHiding:s,onHide:t.hideFile.bind(t),onFileClick:t.onFileClick.bind(t),user:t.attrs.user,onDelete:t.onDelete.bind(t)}))})),this.hasMoreResults()&&m("div",{className:"fof-load-more-files"},m(b(),{className:"Button Button--primary",disabled:this.isLoading(),loading:this.isLoading(),onclick:function(){return t.loadMore()}},M().translator.trans("fof-upload.lib.file_list.load_more_files_btn")))))},i.onDelete=function(t){this.attrs.onDelete&&this.attrs.onDelete(t)},i.onFileClick=function(t){this.attrs.onFileSelect?this.attrs.onFileSelect(t):this.attrs.downloadOnClick&&window.open(t.url())},i.isSelectable=function(t){var e=t.type();return Array.isArray(this.restrictFileType)?this.restrictFileType.indexOf(e)>=0:"image"===this.restrictFileType?e.includes("image/"):"audio"===this.restrictFileType?e.includes("audio/"):"video"===this.restrictFileType&&e.includes("video/")},i.hideFile=function(){var t=C(T().mark((function t(e){var i,o,a,r,n;return T().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=e.uuid(),!this.filesBeingHidden.includes(i)){t.next=3;break}return t.abrupt("return");case 3:if(this.filesBeingHidden.push(i),o=e.isShared()?"fof-upload.lib.file_list.hide_shared_file":"fof-upload.lib.file_list.hide_file",!confirm(q()(M().translator.trans(e.hidden()?o+".show_confirmation":o+".hide_confirmation",{fileName:e.baseName()})))){t.next=24;break}return t.prev=7,t.next=10,M().request({method:"PATCH",url:M().forum.attribute("apiUrl")+"/fof/upload/hide",body:{uuid:i}});case 10:a=t.sent,M().store.pushPayload(a),m.redraw(),M().alerts.show(Y(),{type:"success"},[j()(e.hidden()?"fas fa-eye-slash":"fas fa-eye")," ",M().translator.trans(null!=e&&e.hidden()?o+".hide_success":o+".show_success")]),this.fileState.user&&(r=this.fileState.files.findIndex((function(t){return i===t.uuid()})),this.fileState.files.splice(r,1)),t.next=20;break;case 17:t.prev=17,t.t0=t.catch(7),M().alerts.show(Y(),{type:"error"},M().translator.trans(null!=e&&e.hidden()?o+".hide_fail":o+".show_fail",{fileName:e.baseName()}));case 20:return t.prev=20,n=this.filesBeingHidden.indexOf(i),this.filesBeingHidden.splice(n,1),t.finish(20);case 24:case"end":return t.stop()}}),t,this,[[7,17,20,24]])})));return function(e){return t.apply(this,arguments)}}(),e}(g()),K=function(t){function e(){return t.apply(this,arguments)||this}h(e,t);var i=e.prototype;return i.loadFileList=function(){this.fileState.setUser(this.attrs.user||M().session.user),this.user=this.fileState.user},i.hasMoreResults=function(){return this.fileState.hasMoreResults()},i.loadMore=function(){this.fileState.loadMore()},i.isLoading=function(){return this.fileState.isLoading()},i.fileCollection=function(){return this.fileState.files},e}(J);const Q=flarum.core.compat["common/components/Switch"];var X=i.n(Q),Z=function(t){function e(){for(var e,i=arguments.length,o=new Array(i),a=0;a0},e.isLoading=function(){return this.loading},e.hasMoreResults=function(){return this.moreResults},e.empty=function(){return!this.hasFiles()&&!this.isLoading()},t}(),it=function(t){function i(){return t.apply(this,arguments)||this}h(i,t);var o=i.prototype;return o.oninit=function(e){t.prototype.oninit.call(this,e),this.uploader=e.attrs.uploader,this.selectedFiles=[],this.multiSelect=void 0===e.attrs.multiSelect||e.attrs.multiSelect,this.restrictFileType=e.attrs.restrictFileType||null,this.dragDrop=null,this.selectedFilesLibrary=e.attrs.defaultFilesLibrary||"user",this.sharedUploads=null,this.userFileState=new et,this.sharedFileState=new et(!0),this.uploader.setState(this.userFileState),this.onUpload()},o.className=function(){return"Modal--large fof-file-manager-modal"},o.oncreate=function(e){var i=this;t.prototype.oncreate.call(this,e),this.dragDrop=new N((function(t){return i.uploader.upload(t,!1)}),this.$().find(".Modal-content")[0])},o.onremove=function(){this.dragDrop&&this.dragDrop.unload()},o.view=function(){var t,i=this,o=this.selectedFiles.length,a=this.attrs,r=a.hideUser,n=a.hideShared;return m("div",{className:"Modal modal-dialog "+this.className()},m("div",{className:"Modal-content"},m("div",{className:"fof-modal-buttons App-backControl"},!r&&"user"===this.selectedFilesLibrary&&m(L,{uploader:this.uploader,disabled:this.userFileState.isLoading(),isMediaUploadButton:!0}),e().session.user&&e().session.user.uploadSharedFiles()&&!n&&"shared"===this.selectedFilesLibrary&&m(b(),{className:"Button",icon:"fas fa-file-upload",onclick:function(){i.showUploadModal()}},e().translator.trans("fof-upload.forum.buttons.upload"))),m("div",{className:"fof-drag-and-drop"},m("div",{className:"fof-drag-and-drop-release"},m("i",{className:"fas fa-cloud-upload-alt"}),e().translator.trans("fof-upload.lib.file_list.release_to_upload"))),m("div",{className:"Modal-header"},m("h3",{className:"App-titleControl App-titleControl--text"},e().translator.trans("fof-upload.forum.media_manager")),(null==(t=e().session.user)?void 0:t.accessSharedFiles())&&!r&&!n&&m("div",{className:"LibrarySelection"},this.fileLibraryButtonItems().toArray())),this.alertAttrs&&m("div",{className:"Modal-alert"},m(Alert,this.alertAttrs)),m("div",{className:"Modal-body"},"user"===this.selectedFilesLibrary&&this.userFilesContent(),"shared"===this.selectedFilesLibrary&&this.sharedFilesContent()),m("div",{className:"Modal-footer"},m(b(),{onclick:this.hide.bind(this),className:"Button"},e().translator.trans("fof-upload.forum.buttons.cancel")),m(b(),{onclick:this.onSelect.bind(this),disabled:0===this.selectedFiles.length||!this.multiSelect&&this.selectedFiles.length>1,className:"Button Button--primary"},e().translator.trans("fof-upload.lib.file_list.confirm_selection_btn",{fileCount:o})))))},o.fileLibraryButtonItems=function(){var t=this,i=new(H());return i.add("user",m(b(),{className:"Button Button--flat "+("user"===this.selectedFilesLibrary?"active":""),onclick:function(){return t.setLibrary("user")}},e().translator.trans("fof-upload.forum.buttons.media"))),i.add("shared",m(b(),{className:"Button Button--flat "+("shared"===this.selectedFilesLibrary?"active":""),onclick:function(){return t.setLibrary("shared")}},e().translator.trans("fof-upload.forum.buttons.shared_media"))),i},o.setLibrary=function(t){this.selectedFilesLibrary=t,m.redraw()},o.userFilesContent=function(){return m(K,{user:this.attrs.user,selectable:!0,onFileSelect:this.onFileSelect.bind(this),selectedFiles:this.selectedFiles,restrictFileType:this.restrictFileType,fileState:this.userFileState,onDelete:this.onDelete.bind(this)})},o.sharedFilesContent=function(){return m(tt,{selectable:!0,onFileSelect:this.onFileSelect.bind(this),selectedFiles:this.selectedFiles,restrictFileType:this.restrictFileType,user:this.attrs.user,fileState:this.sharedFileState,onDelete:this.onDelete.bind(this)})},o.onFileSelect=function(t){var e=this.selectedFiles.indexOf(t.id());e>=0?this.selectedFiles.splice(e,1):this.multiSelect?this.selectedFiles.push(t.id()):this.selectedFiles=[t.id()]},o.onUpload=function(){var t=this;this.uploader.on("success",(function(e){var i=e.file;t.multiSelect?t.selectedFiles.push(i.id()):t.selectedFiles=[i.id()]}))},o.onSelect=function(){this.hide(),this.attrs.onSelect?this.attrs.onSelect(this.selectedFiles):this.selectedFiles.map((function(t){var i=e().store.getById("files",t)||e().store.getById("shared-files",t);e().composer.editor.insertAtCursor(i.bbcode()+"\n",!1)}))},o.showUploadModal=function(){var t=this;e().modal.show(Z,{onUploadComplete:function(e){t.sharedFileState.addToList(e)}},!0)},o.onDelete=function(t){this.sharedFileState.removeFromList(t),this.userFileState.removeFromList(t)},i}(D()),ot=function(t){function i(){return t.apply(this,arguments)||this}h(i,t);var o=i.prototype;return o.view=function(){return m(G(),{text:e().translator.trans("fof-upload.forum.buttons.media")},b().component({className:"Button fof-upload-button Button--icon",onclick:this.fileManagerButtonClicked.bind(this),icon:"fas fa-photo-video"}))},o.fileManagerButtonClicked=function(t){t.preventDefault(),e().modal.show(it,{uploader:this.attrs.uploader})},i}(g());const at=flarum.core.compat["forum/components/UserPage"];var rt=i.n(at);const nt=flarum.core.compat["common/components/LinkButton"];var st=i.n(nt);const lt=flarum.core.compat["common/extenders"];var ut=i.n(lt),ft=function(t){function e(){return t.apply(this,arguments)||this}h(e,t);var i=e.prototype;return i.baseName=function(){return s().attribute("baseName").call(this)},i.path=function(){return s().attribute("path").call(this)},i.url=function(){return s().attribute("url").call(this)},i.size=function(){return s().attribute("size").call(this)},i.type=function(){return s().attribute("type").call(this)},i.humanSize=function(){return s().attribute("humanSize").call(this)},i.createdAt=function(){return s().attribute("createdAt",s().transformDate).call(this)},i.uuid=function(){return s().attribute("uuid").call(this)},i.tag=function(){return s().attribute("tag").call(this)},i.hidden=function(){return s().attribute("hidden").call(this)},i.bbcode=function(){return s().attribute("bbcode").call(this)},i.isShared=function(){return s().attribute("shared").call(this)},i.isPrivateShared=function(){return s().attribute("isPrivateShared").call(this)},i.canViewInfo=function(){return s().attribute("canViewInfo").call(this)},i.canHide=function(){return s().attribute("canHide").call(this)},i.canDelete=function(){return s().attribute("canDelete").call(this)},i.apiEndpoint=function(){return"/fof/uploads"+(this.exists?"/"+this.id():"")},e}(s());const ct=[(new(ut().Store)).add("files",ft).add("shared-files",ft)];var dt=function(t){function i(){for(var e,i=arguments.length,o=new Array(i),a=0;a0?m("span",{className:"Button-badge"},a):""]),80)}}))}))})(),module.exports=o})(); +(()=>{var t={24:(t,e,i)=>{var o=i(735).default;function a(){"use strict";t.exports=a=function(){return i},t.exports.__esModule=!0,t.exports.default=t.exports;var e,i={},r=Object.prototype,n=r.hasOwnProperty,s=Object.defineProperty||function(t,e,i){t[e]=i.value},l="function"==typeof Symbol?Symbol:{},u=l.iterator||"@@iterator",f=l.asyncIterator||"@@asyncIterator",c=l.toStringTag||"@@toStringTag";function d(t,e,i){return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{d({},"")}catch(e){d=function(t,e,i){return t[e]=i}}function p(t,e,i,o){var a=e&&e.prototype instanceof w?e:w,r=Object.create(a.prototype),n=new C(o||[]);return s(r,"_invoke",{value:D(t,i,n)}),r}function h(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}i.wrap=p;var m="suspendedStart",v="suspendedYield",g="executing",y="completed",b={};function w(){}function F(){}function x(){}var S={};d(S,u,(function(){return this}));var L=Object.getPrototypeOf,N=L&&L(L(O([])));N&&N!==r&&n.call(N,u)&&(S=N);var k=x.prototype=w.prototype=Object.create(S);function _(t){["next","throw","return"].forEach((function(e){d(t,e,(function(t){return this._invoke(e,t)}))}))}function B(t,e){function i(a,r,s,l){var u=h(t[a],t,r);if("throw"!==u.type){var f=u.arg,c=f.value;return c&&"object"==o(c)&&n.call(c,"__await")?e.resolve(c.__await).then((function(t){i("next",t,s,l)}),(function(t){i("throw",t,s,l)})):e.resolve(c).then((function(t){f.value=t,s(f)}),(function(t){return i("throw",t,s,l)}))}l(u.arg)}var a;s(this,"_invoke",{value:function(t,o){function r(){return new e((function(e,a){i(t,o,e,a)}))}return a=a?a.then(r,r):r()}})}function D(t,i,o){var a=m;return function(r,n){if(a===g)throw Error("Generator is already running");if(a===y){if("throw"===r)throw n;return{value:e,done:!0}}for(o.method=r,o.arg=n;;){var s=o.delegate;if(s){var l=E(s,o);if(l){if(l===b)continue;return l}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if(a===m)throw a=y,o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);a=g;var u=h(t,i,o);if("normal"===u.type){if(a=o.done?y:v,u.arg===b)continue;return{value:u.arg,done:o.done}}"throw"===u.type&&(a=y,o.method="throw",o.arg=u.arg)}}}function E(t,i){var o=i.method,a=t.iterator[o];if(a===e)return i.delegate=null,"throw"===o&&t.iterator.return&&(i.method="return",i.arg=e,E(t,i),"throw"===i.method)||"return"!==o&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+o+"' method")),b;var r=h(a,t.iterator,i.arg);if("throw"===r.type)return i.method="throw",i.arg=r.arg,i.delegate=null,b;var n=r.arg;return n?n.done?(i[t.resultName]=n.value,i.next=t.nextLoc,"return"!==i.method&&(i.method="next",i.arg=e),i.delegate=null,b):n:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,b)}function M(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function U(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(M,this),this.reset(!0)}function O(t){if(t||""===t){var i=t[u];if(i)return i.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,r=function i(){for(;++a=0;--a){var r=this.tryEntries[a],s=r.completion;if("root"===r.tryLoc)return o("end");if(r.tryLoc<=this.prev){var l=n.call(r,"catchLoc"),u=n.call(r,"finallyLoc");if(l&&u){if(this.prev=0;--i){var o=this.tryEntries[i];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),U(i),b}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var o=i.completion;if("throw"===o.type){var a=o.arg;U(i)}return a}}throw Error("illegal catch attempt")},delegateYield:function(t,i,o){return this.delegate={iterator:O(t),resultName:i,nextLoc:o},"next"===this.method&&(this.arg=e),b}},i}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports},735:t=>{function e(i){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(i)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},183:(t,e,i)=>{var o=i(24)();t.exports=o;try{regeneratorRuntime=o}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=o:Function("r","regeneratorRuntime = r")(o)}}},e={};function i(o){var a=e[o];if(void 0!==a)return a.exports;var r=e[o]={exports:{}};return t[o](r,r.exports,i),r.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var o in e)i.o(e,o)&&!i.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};(()=>{"use strict";i.r(o),i.d(o,{components:()=>mt,extend:()=>pt});const t=flarum.core.compat["forum/app"];var e=i.n(t);const a=flarum.core.compat["common/models/User"];var r=i.n(a);const n=flarum.core.compat["common/Model"];var s=i.n(n);const l=flarum.core.compat["common/extend"],u=flarum.core.compat["forum/components/Post"];var f=i.n(u);const c=flarum.core.compat["common/components/TextEditor"];var d=i.n(c);function p(t,e){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},p(t,e)}function h(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,p(t,e)}const v=flarum.core.compat["common/Component"];var g=i.n(v);const y=flarum.core.compat["common/components/Button"];var b=i.n(y);const w=flarum.core.compat["common/components/LoadingIndicator"];var F=i.n(w);const x=flarum.core.compat["common/utils/classList"];var S=i.n(x),L=function(t){function i(){return t.apply(this,arguments)||this}h(i,t);var o=i.prototype;return o.oninit=function(e){var i=this;t.prototype.oninit.call(this,e),this.attrs.uploader.on("uploaded",(function(){i.$("form")[0].reset(),m.redraw()})),this.isMediaUploadButton=e.attrs.isMediaUploadButton||!1},o.view=function(){var t=this.attrs.uploader.uploading?e().translator.trans("fof-upload.forum.states.loading"):e().translator.trans("fof-upload.forum.buttons.upload");return m(b(),{className:S()(["Button","hasIcon","fof-upload-button",!this.isMediaUploadButton&&!this.attrs.uploader.uploading&&"Button--icon",!this.isMediaUploadButton&&!this.attrs.uploader.uploading&&"Button--link",this.attrs.uploader.uploading&&"uploading"]),icon:!this.attrs.uploader.uploading&&"fas fa-file-upload",onclick:this.uploadButtonClicked.bind(this),disabled:this.attrs.disabled},this.attrs.uploader.uploading&&m(F(),{size:"small",display:"inline",className:"Button-icon"}),(this.isMediaUploadButton||this.attrs.uploader.uploading)&&m("span",{className:"Button-label"},t),m("form",null,m("input",{type:"file",multiple:!0,onchange:this.process.bind(this)})))},o.process=function(t){var e=this.$("input").prop("files");0!==e.length&&this.attrs.uploader.upload(e,!this.isMediaUploadButton)},o.uploadButtonClicked=function(t){this.$("input").click()},i}(g()),N=function(){function t(t,e){this.upload=t,this.composerElement=e,this.handlers={},this.supportsFileDragging()&&(this.composerElement.addEventListener("dragover",this.handlers.in=this.in.bind(this)),this.composerElement.addEventListener("dragleave",this.handlers.out=this.out.bind(this)),this.composerElement.addEventListener("dragend",this.handlers.out),this.composerElement.addEventListener("drop",this.handlers.dropping=this.dropping.bind(this)))}var e=t.prototype;return e.supportsFileDragging=function(){var t=document.createElement("div");return("draggable"in t||"ondragstart"in t&&"ondrop"in t)&&"FormData"in window&&"FileReader"in window},e.unload=function(){this.handlers.in&&(this.composerElement.removeEventListener("dragover",this.handlers.in),this.composerElement.removeEventListener("dragleave",this.handlers.out),this.composerElement.removeEventListener("dragend",this.handlers.out),this.composerElement.removeEventListener("drop",this.handlers.dropping))},e.isNotFile=function(t){if(t.dataTransfer.items)for(var e=0;e0&&(t.preventDefault(),this.upload(i))}},t}(),_=function(){function t(){this.callbacks={success:[],failure:[],uploading:[],uploaded:[]},this.uploading=!1}var i=t.prototype;return i.setState=function(t){this.fileState=t},i.on=function(t,e){this.callbacks[t].push(e)},i.dispatch=function(t,e){this.callbacks[t].forEach((function(t){return t(e)}))},i.upload=function(t,i){var o=this;void 0===i&&(i=!0),this.uploading=!0,this.dispatch("uploading",t),m.redraw();for(var a=new FormData,r=0;r=0&&"fof-file-selected"]),s=t.filesBeingHidden.includes(e.uuid());return m("li",{"aria-busy":s,key:e.uuid()},m(W,{file:e,fileSelectable:r,isSelected:t.attrs.selectedFiles&&t.attrs.selectedFiles.indexOf(null!=(o=e.id())?o:"")>=0,fileClassNames:n,isFileHiding:s,onHide:t.hideFile.bind(t),onFileClick:t.onFileClick.bind(t),user:t.attrs.user,onDelete:t.onDelete.bind(t)}))}))),this.hasMoreResults()&&m("div",{className:"fof-load-more-files"},m(b(),{className:"Button Button--primary",disabled:this.isLoading(),loading:this.isLoading(),onclick:function(){return t.loadMore()}},M().translator.trans("fof-upload.lib.file_list.load_more_files_btn"))))},i.onDelete=function(t){this.attrs.onDelete&&this.attrs.onDelete(t)},i.onFileClick=function(t){this.attrs.onFileSelect?this.attrs.onFileSelect(t):this.attrs.downloadOnClick&&window.open(t.url())},i.isSelectable=function(t){var e=t.type();return Array.isArray(this.restrictFileType)?this.restrictFileType.indexOf(e)>=0:"image"===this.restrictFileType?e.includes("image/"):"audio"===this.restrictFileType?e.includes("audio/"):"video"===this.restrictFileType&&e.includes("video/")},i.hideFile=function(){var t=C(T().mark((function t(e){var i,o,a,r,n;return T().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=e.uuid(),!this.filesBeingHidden.includes(i)){t.next=3;break}return t.abrupt("return");case 3:if(this.filesBeingHidden.push(i),o=e.isShared()?"fof-upload.lib.file_list.hide_shared_file":"fof-upload.lib.file_list.hide_file",!confirm(q()(M().translator.trans(e.hidden()?o+".show_confirmation":o+".hide_confirmation",{fileName:e.baseName()})))){t.next=24;break}return t.prev=7,t.next=10,M().request({method:"PATCH",url:M().forum.attribute("apiUrl")+"/fof/upload/hide",body:{uuid:i}});case 10:a=t.sent,M().store.pushPayload(a),m.redraw(),M().alerts.show(Y(),{type:"success"},[j()(e.hidden()?"fas fa-eye-slash":"fas fa-eye")," ",M().translator.trans(null!=e&&e.hidden()?o+".hide_success":o+".show_success")]),this.fileState.user&&(r=this.fileState.files.findIndex((function(t){return i===t.uuid()})),this.fileState.files.splice(r,1)),t.next=20;break;case 17:t.prev=17,t.t0=t.catch(7),M().alerts.show(Y(),{type:"error"},M().translator.trans(null!=e&&e.hidden()?o+".hide_fail":o+".show_fail",{fileName:e.baseName()}));case 20:return t.prev=20,n=this.filesBeingHidden.indexOf(i),this.filesBeingHidden.splice(n,1),t.finish(20);case 24:case"end":return t.stop()}}),t,this,[[7,17,20,24]])})));return function(e){return t.apply(this,arguments)}}(),e}(g()),K=function(t){function e(){return t.apply(this,arguments)||this}h(e,t);var i=e.prototype;return i.loadFileList=function(){this.fileState.setUser(this.attrs.user||M().session.user),this.user=this.fileState.user},i.hasMoreResults=function(){return this.fileState.hasMoreResults()},i.loadMore=function(){this.fileState.loadMore()},i.isLoading=function(){return this.fileState.isLoading()},i.fileCollection=function(){return this.fileState.files},e}(J);const Q=flarum.core.compat["common/components/Switch"];var X=i.n(Q),Z=function(t){function e(){for(var e,i=arguments.length,o=new Array(i),a=0;a0},e.isLoading=function(){return this.loading},e.hasMoreResults=function(){return this.moreResults},e.empty=function(){return!this.hasFiles()&&!this.isLoading()},t}(),it=function(t){function i(){return t.apply(this,arguments)||this}h(i,t);var o=i.prototype;return o.oninit=function(e){t.prototype.oninit.call(this,e),this.uploader=e.attrs.uploader,this.selectedFiles=[],this.multiSelect=void 0===e.attrs.multiSelect||e.attrs.multiSelect,this.restrictFileType=e.attrs.restrictFileType||null,this.dragDrop=null,this.selectedFilesLibrary=e.attrs.defaultFilesLibrary||"user",this.sharedUploads=null,this.userFileState=new et,this.sharedFileState=new et(!0),this.uploader.setState(this.userFileState),this.onUpload()},o.className=function(){return"Modal--large fof-file-manager-modal"},o.oncreate=function(e){var i=this;t.prototype.oncreate.call(this,e),this.dragDrop=new N((function(t){return i.uploader.upload(t,!1)}),this.$().find(".Modal-content")[0])},o.onremove=function(){this.dragDrop&&this.dragDrop.unload()},o.view=function(){var t,i=this,o=this.selectedFiles.length,a=this.attrs,r=a.hideUser,n=a.hideShared;return m("div",{className:"Modal modal-dialog "+this.className()},m("div",{className:"Modal-content"},m("div",{className:"fof-modal-buttons App-backControl"},!r&&"user"===this.selectedFilesLibrary&&m(L,{uploader:this.uploader,disabled:this.userFileState.isLoading(),isMediaUploadButton:!0}),e().session.user&&e().session.user.uploadSharedFiles()&&!n&&"shared"===this.selectedFilesLibrary&&m(b(),{className:"Button",icon:"fas fa-file-upload",onclick:function(){i.showUploadModal()}},e().translator.trans("fof-upload.forum.buttons.upload"))),m("div",{className:"fof-drag-and-drop"},m("div",{className:"fof-drag-and-drop-release"},m("i",{className:"fas fa-cloud-upload-alt"}),e().translator.trans("fof-upload.lib.file_list.release_to_upload"))),m("div",{className:"Modal-header"},m("h3",{className:"App-titleControl App-titleControl--text"},e().translator.trans("fof-upload.forum.media_manager")),(null==(t=e().session.user)?void 0:t.accessSharedFiles())&&!r&&!n&&m("div",{className:"LibrarySelection"},this.fileLibraryButtonItems().toArray())),this.alertAttrs&&m("div",{className:"Modal-alert"},m(Alert,this.alertAttrs)),m("div",{className:"Modal-body"},"user"===this.selectedFilesLibrary&&this.userFilesContent(),"shared"===this.selectedFilesLibrary&&this.sharedFilesContent()),m("div",{className:"Modal-footer"},m(b(),{onclick:this.hide.bind(this),className:"Button"},e().translator.trans("fof-upload.forum.buttons.cancel")),m(b(),{onclick:this.onSelect.bind(this),disabled:0===this.selectedFiles.length||!this.multiSelect&&this.selectedFiles.length>1,className:"Button Button--primary"},e().translator.trans("fof-upload.lib.file_list.confirm_selection_btn",{fileCount:o})))))},o.fileLibraryButtonItems=function(){var t=this,i=new(H());return i.add("user",m(b(),{className:"Button Button--flat "+("user"===this.selectedFilesLibrary?"active":""),onclick:function(){return t.setLibrary("user")}},e().translator.trans("fof-upload.forum.buttons.media"))),i.add("shared",m(b(),{className:"Button Button--flat "+("shared"===this.selectedFilesLibrary?"active":""),onclick:function(){return t.setLibrary("shared")}},e().translator.trans("fof-upload.forum.buttons.shared_media"))),i},o.setLibrary=function(t){this.selectedFilesLibrary=t,m.redraw()},o.userFilesContent=function(){return m(K,{user:this.attrs.user,selectable:!0,onFileSelect:this.onFileSelect.bind(this),selectedFiles:this.selectedFiles,restrictFileType:this.restrictFileType,fileState:this.userFileState,onDelete:this.onDelete.bind(this)})},o.sharedFilesContent=function(){return m(tt,{selectable:!0,onFileSelect:this.onFileSelect.bind(this),selectedFiles:this.selectedFiles,restrictFileType:this.restrictFileType,user:this.attrs.user,fileState:this.sharedFileState,onDelete:this.onDelete.bind(this)})},o.onFileSelect=function(t){var e=this.selectedFiles.indexOf(t.id());e>=0?this.selectedFiles.splice(e,1):this.multiSelect?this.selectedFiles.push(t.id()):this.selectedFiles=[t.id()]},o.onUpload=function(){var t=this;this.uploader.on("success",(function(e){var i=e.file;t.multiSelect?t.selectedFiles.push(i.id()):t.selectedFiles=[i.id()]}))},o.onSelect=function(){this.hide(),this.attrs.onSelect?this.attrs.onSelect(this.selectedFiles):this.selectedFiles.map((function(t){var i=e().store.getById("files",t)||e().store.getById("shared-files",t);e().composer.editor.insertAtCursor(i.bbcode()+"\n",!1)}))},o.showUploadModal=function(){var t=this;e().modal.show(Z,{onUploadComplete:function(e){t.sharedFileState.addToList(e)}},!0)},o.onDelete=function(t){this.sharedFileState.removeFromList(t),this.userFileState.removeFromList(t)},i}(D()),ot=function(t){function i(){return t.apply(this,arguments)||this}h(i,t);var o=i.prototype;return o.view=function(){return m(G(),{text:e().translator.trans("fof-upload.forum.buttons.media")},b().component({className:"Button fof-upload-button Button--icon",onclick:this.fileManagerButtonClicked.bind(this),icon:"fas fa-photo-video"}))},o.fileManagerButtonClicked=function(t){t.preventDefault(),e().modal.show(it,{uploader:this.attrs.uploader})},i}(g());const at=flarum.core.compat["forum/components/UserPage"];var rt=i.n(at);const nt=flarum.core.compat["common/components/LinkButton"];var st=i.n(nt);const lt=flarum.core.compat["common/extenders"];var ut=i.n(lt),ft=function(t){function e(){return t.apply(this,arguments)||this}h(e,t);var i=e.prototype;return i.baseName=function(){return s().attribute("baseName").call(this)},i.path=function(){return s().attribute("path").call(this)},i.url=function(){return s().attribute("url").call(this)},i.size=function(){return s().attribute("size").call(this)},i.type=function(){return s().attribute("type").call(this)},i.humanSize=function(){return s().attribute("humanSize").call(this)},i.createdAt=function(){return s().attribute("createdAt",s().transformDate).call(this)},i.uuid=function(){return s().attribute("uuid").call(this)},i.tag=function(){return s().attribute("tag").call(this)},i.hidden=function(){return s().attribute("hidden").call(this)},i.bbcode=function(){return s().attribute("bbcode").call(this)},i.isShared=function(){return s().attribute("shared").call(this)},i.isPrivateShared=function(){return s().attribute("isPrivateShared").call(this)},i.canViewInfo=function(){return s().attribute("canViewInfo").call(this)},i.canHide=function(){return s().attribute("canHide").call(this)},i.canDelete=function(){return s().attribute("canDelete").call(this)},i.apiEndpoint=function(){return"/fof/uploads"+(this.exists?"/"+this.id():"")},e}(s());const ct=[(new(ut().Store)).add("files",ft).add("shared-files",ft)];var dt=function(t){function i(){for(var e,i=arguments.length,o=new Array(i),a=0;a0?m("span",{className:"Button-badge"},a):""]),80)}}))}))})(),module.exports=o})(); //# sourceMappingURL=forum.js.map \ No newline at end of file diff --git a/js/dist/forum.js.map b/js/dist/forum.js.map index 9228ecd..c5467b9 100644 --- a/js/dist/forum.js.map +++ b/js/dist/forum.js.map @@ -1 +1 @@ -{"version":3,"file":"forum.js","mappings":";0BAAA,IAAIA,EAAUC,EAAAA,KAAAA,QACd,SAASC,IACP,aACAC,EAAOC,QAAUF,EAAsB,WACrC,OAAOG,CACT,EAAGF,EAAOC,QAAQE,YAAa,EAAMH,EAAOC,QAAiB,QAAID,EAAOC,QACxE,IAAIG,EACFF,EAAI,CAAC,EACLG,EAAIC,OAAOC,UACXC,EAAIH,EAAEI,eACNC,EAAIJ,OAAOK,gBAAkB,SAAUP,EAAGF,EAAGG,GAC3CD,EAAEF,GAAKG,EAAEO,KACX,EACAC,EAAI,mBAAqBC,OAASA,OAAS,CAAC,EAC5CC,EAAIF,EAAEG,UAAY,aAClBC,EAAIJ,EAAEK,eAAiB,kBACvBC,EAAIN,EAAEO,aAAe,gBACvB,SAASC,EAAOjB,EAAGF,EAAGG,GACpB,OAAOC,OAAOK,eAAeP,EAAGF,EAAG,CACjCU,MAAOP,EACPiB,YAAY,EACZC,cAAc,EACdC,UAAU,IACRpB,EAAEF,EACR,CACA,IACEmB,EAAO,CAAC,EAAG,GACb,CAAE,MAAOjB,GACPiB,EAAS,SAAgBjB,EAAGF,EAAGG,GAC7B,OAAOD,EAAEF,GAAKG,CAChB,CACF,CACA,SAASoB,EAAKrB,EAAGF,EAAGG,EAAGG,GACrB,IAAIK,EAAIX,GAAKA,EAAEK,qBAAqBmB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,mBAAmB3U,EAAKC,MAAM8U,KAAK9J,MAChDzG,GAAO,IAAMmQ,mBAAmBhU,IAAAA,QAAYqU,WAE5CxS,OAAO+I,KAAK/G,EARZ,MAFEyQ,MAAMtU,IAAAA,WAAeC,MAAM,wCAW/B,GACJ,KCrBAuS,EAAAA,EAAAA,QAAOD,KAAAA,UAAoB,YAAY,SAAUpQ,GAC/C,IAAMoS,IAAcvU,IAAAA,MAAU8D,UAAU,wBAClC0Q,IAAe/a,KAAK+P,KAAKyJ,qBAE/B,GAAIjT,IAAAA,QAAYwJ,OAASxJ,IAAAA,QAAYwJ,KAAK6I,0BAA6B5Y,KAAK+P,OAASxJ,IAAAA,QAAYwJ,OAAS+K,GAAaC,IAAe,CACpI,IAAMC,EAAchb,KAAK+P,KAAKyJ,qBAE9B9Q,EAAMI,IACJ,UACAmS,KAAAA,UACE,CACEC,KAAM3U,IAAAA,MAAU,eAAgB,CAC9B4U,SAAUnb,KAAK+P,KAAKqL,SAEtBzY,KAAM,UACNiE,KAAM,sBAER,CACE5G,KAAK+P,OAASxJ,IAAAA,QAAYwJ,KACtBxJ,IAAAA,WAAeC,MAAM,kCACrBD,IAAAA,WAAeC,MAAM,yCACzB,IACAwU,EAAc,EAAI/U,EAAA,QAAMS,UAAU,gBAAgBsU,GAAsB,KAG5E,GAEJ,CACF,GHTF","sources":["webpack://@fof/upload/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js","webpack://@fof/upload/./node_modules/@babel/runtime/helpers/typeof.js","webpack://@fof/upload/./node_modules/@babel/runtime/regenerator/index.js","webpack://@fof/upload/webpack/bootstrap","webpack://@fof/upload/webpack/runtime/compat get default export","webpack://@fof/upload/webpack/runtime/define property getters","webpack://@fof/upload/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/upload/webpack/runtime/make namespace object","webpack://@fof/upload/external root \"flarum.core.compat['forum/app']\"","webpack://@fof/upload/external root \"flarum.core.compat['common/models/User']\"","webpack://@fof/upload/external root \"flarum.core.compat['common/Model']\"","webpack://@fof/upload/external root \"flarum.core.compat['common/extend']\"","webpack://@fof/upload/external root \"flarum.core.compat['forum/components/Post']\"","webpack://@fof/upload/external root \"flarum.core.compat['common/components/TextEditor']\"","webpack://@fof/upload/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/upload/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/upload/external root \"flarum.core.compat['common/Component']\"","webpack://@fof/upload/external root \"flarum.core.compat['common/components/Button']\"","webpack://@fof/upload/external root \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@fof/upload/external root \"flarum.core.compat['common/utils/classList']\"","webpack://@fof/upload/./src/forum/components/UploadButton.js","webpack://@fof/upload/./src/forum/components/DragAndDrop.js","webpack://@fof/upload/./src/forum/components/PasteClipboard.js","webpack://@fof/upload/./src/forum/handler/Uploader.js","webpack://@fof/upload/external root \"flarum.core.compat['common/components/Modal']\"","webpack://@fof/upload/external root \"flarum.core.compat['common/app']\"","webpack://@fof/upload/./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js","webpack://@fof/upload/./src/common/mimeToIcon.ts","webpack://@fof/upload/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://@fof/upload/external root \"flarum.core.compat['common/utils/ItemList']\"","webpack://@fof/upload/external root \"flarum.core.compat['common/components/Tooltip']\"","webpack://@fof/upload/external root \"flarum.core.compat['common/utils/extractText']\"","webpack://@fof/upload/./src/common/components/DisplayFile.tsx","webpack://@fof/upload/external root \"flarum.core.compat['common/components/Alert']\"","webpack://@fof/upload/./src/common/components/AbstractFIleList.tsx","webpack://@fof/upload/./src/common/components/UserFileList.tsx","webpack://@fof/upload/external root \"flarum.core.compat['common/components/Switch']\"","webpack://@fof/upload/./src/common/components/UploadSharedFileModal.tsx","webpack://@fof/upload/./src/common/components/SharedFileList.tsx","webpack://@fof/upload/./src/common/states/FileListState.ts","webpack://@fof/upload/./src/forum/components/FileManagerModal.js","webpack://@fof/upload/./src/forum/components/FileManagerButton.tsx","webpack://@fof/upload/external root \"flarum.core.compat['forum/components/UserPage']\"","webpack://@fof/upload/external root \"flarum.core.compat['common/components/LinkButton']\"","webpack://@fof/upload/external root \"flarum.core.compat['common/extenders']\"","webpack://@fof/upload/./src/common/models/File.ts","webpack://@fof/upload/./src/common/extend.ts","webpack://@fof/upload/./src/forum/components/UploadsUserPage.tsx","webpack://@fof/upload/./src/forum/extend.ts","webpack://@fof/upload/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://@fof/upload/./src/common/components/UploadedFile.tsx","webpack://@fof/upload/./src/forum/components/index.ts","webpack://@fof/upload/./src/common/components/index.ts","webpack://@fof/upload/./src/forum/index.js","webpack://@fof/upload/./src/forum/addUploadButton.js","webpack://@fof/upload/./src/forum/downloadButtonInteraction.js","webpack://@fof/upload/./src/forum/addUserPageButton.js"],"sourcesContent":["var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction _regeneratorRuntime() {\n \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */\n module.exports = _regeneratorRuntime = function _regeneratorRuntime() {\n return e;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n var t,\n e = {},\n r = Object.prototype,\n n = r.hasOwnProperty,\n o = Object.defineProperty || function (t, e, r) {\n t[e] = r.value;\n },\n i = \"function\" == typeof Symbol ? Symbol : {},\n a = i.iterator || \"@@iterator\",\n c = i.asyncIterator || \"@@asyncIterator\",\n u = i.toStringTag || \"@@toStringTag\";\n function define(t, e, r) {\n return Object.defineProperty(t, e, {\n value: r,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }), t[e];\n }\n try {\n define({}, \"\");\n } catch (t) {\n define = function define(t, e, r) {\n return t[e] = r;\n };\n }\n function wrap(t, e, r, n) {\n var i = e && e.prototype instanceof Generator ? e : Generator,\n a = Object.create(i.prototype),\n c = new Context(n || []);\n return o(a, \"_invoke\", {\n value: makeInvokeMethod(t, r, c)\n }), a;\n }\n function tryCatch(t, e, r) {\n try {\n return {\n type: \"normal\",\n arg: t.call(e, r)\n };\n } catch (t) {\n return {\n type: \"throw\",\n arg: t\n };\n }\n }\n e.wrap = wrap;\n var h = \"suspendedStart\",\n l = \"suspendedYield\",\n f = \"executing\",\n s = \"completed\",\n y = {};\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n var p = {};\n define(p, a, function () {\n return this;\n });\n var d = Object.getPrototypeOf,\n v = d && d(d(values([])));\n v && v !== r && n.call(v, a) && (p = v);\n var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);\n function defineIteratorMethods(t) {\n [\"next\", \"throw\", \"return\"].forEach(function (e) {\n define(t, e, function (t) {\n return this._invoke(e, t);\n });\n });\n }\n function AsyncIterator(t, e) {\n function invoke(r, o, i, a) {\n var c = tryCatch(t[r], t, o);\n if (\"throw\" !== c.type) {\n var u = c.arg,\n h = u.value;\n return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) {\n invoke(\"next\", t, i, a);\n }, function (t) {\n invoke(\"throw\", t, i, a);\n }) : e.resolve(h).then(function (t) {\n u.value = t, i(u);\n }, function (t) {\n return invoke(\"throw\", t, i, a);\n });\n }\n a(c.arg);\n }\n var r;\n o(this, \"_invoke\", {\n value: function value(t, n) {\n function callInvokeWithMethodAndArg() {\n return new e(function (e, r) {\n invoke(t, n, e, r);\n });\n }\n return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();\n }\n });\n }\n function makeInvokeMethod(e, r, n) {\n var o = h;\n return function (i, a) {\n if (o === f) throw Error(\"Generator is already running\");\n if (o === s) {\n if (\"throw\" === i) throw a;\n return {\n value: t,\n done: !0\n };\n }\n for (n.method = i, n.arg = a;;) {\n var c = n.delegate;\n if (c) {\n var u = maybeInvokeDelegate(c, n);\n if (u) {\n if (u === y) continue;\n return u;\n }\n }\n if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) {\n if (o === h) throw o = s, n.arg;\n n.dispatchException(n.arg);\n } else \"return\" === n.method && n.abrupt(\"return\", n.arg);\n o = f;\n var p = tryCatch(e, r, n);\n if (\"normal\" === p.type) {\n if (o = n.done ? s : l, p.arg === y) continue;\n return {\n value: p.arg,\n done: n.done\n };\n }\n \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg);\n }\n };\n }\n function maybeInvokeDelegate(e, r) {\n var n = r.method,\n o = e.iterator[n];\n if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y;\n var i = tryCatch(o, e.iterator, r.arg);\n if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y;\n var a = i.arg;\n return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y);\n }\n function pushTryEntry(t) {\n var e = {\n tryLoc: t[0]\n };\n 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);\n }\n function resetTryEntry(t) {\n var e = t.completion || {};\n e.type = \"normal\", delete e.arg, t.completion = e;\n }\n function Context(t) {\n this.tryEntries = [{\n tryLoc: \"root\"\n }], t.forEach(pushTryEntry, this), this.reset(!0);\n }\n function values(e) {\n if (e || \"\" === e) {\n var r = e[a];\n if (r) return r.call(e);\n if (\"function\" == typeof e.next) return e;\n if (!isNaN(e.length)) {\n var o = -1,\n i = function next() {\n for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;\n return next.value = t, next.done = !0, next;\n };\n return i.next = i;\n }\n }\n throw new TypeError(_typeof(e) + \" is not iterable\");\n }\n return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", {\n value: GeneratorFunctionPrototype,\n configurable: !0\n }), o(GeneratorFunctionPrototype, \"constructor\", {\n value: GeneratorFunction,\n configurable: !0\n }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) {\n var e = \"function\" == typeof t && t.constructor;\n return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name));\n }, e.mark = function (t) {\n return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t;\n }, e.awrap = function (t) {\n return {\n __await: t\n };\n }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {\n return this;\n }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {\n void 0 === i && (i = Promise);\n var a = new AsyncIterator(wrap(t, r, n, o), i);\n return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {\n return t.done ? t.value : a.next();\n });\n }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () {\n return this;\n }), define(g, \"toString\", function () {\n return \"[object Generator]\";\n }), e.keys = function (t) {\n var e = Object(t),\n r = [];\n for (var n in e) r.push(n);\n return r.reverse(), function next() {\n for (; r.length;) {\n var t = r.pop();\n if (t in e) return next.value = t, next.done = !1, next;\n }\n return next.done = !0, next;\n };\n }, e.values = values, Context.prototype = {\n constructor: Context,\n reset: function reset(e) {\n if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);\n },\n stop: function stop() {\n this.done = !0;\n var t = this.tryEntries[0].completion;\n if (\"throw\" === t.type) throw t.arg;\n return this.rval;\n },\n dispatchException: function dispatchException(e) {\n if (this.done) throw e;\n var r = this;\n function handle(n, o) {\n return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o;\n }\n for (var o = this.tryEntries.length - 1; o >= 0; --o) {\n var i = this.tryEntries[o],\n a = i.completion;\n if (\"root\" === i.tryLoc) return handle(\"end\");\n if (i.tryLoc <= this.prev) {\n var c = n.call(i, \"catchLoc\"),\n u = n.call(i, \"finallyLoc\");\n if (c && u) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n } else if (c) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n } else {\n if (!u) throw Error(\"try statement without catch or finally\");\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n }\n }\n }\n },\n abrupt: function abrupt(t, e) {\n for (var r = this.tryEntries.length - 1; r >= 0; --r) {\n var o = this.tryEntries[r];\n if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) {\n var i = o;\n break;\n }\n }\n i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);\n var a = i ? i.completion : {};\n return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a);\n },\n complete: function complete(t, e) {\n if (\"throw\" === t.type) throw t.arg;\n return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y;\n },\n finish: function finish(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;\n }\n },\n \"catch\": function _catch(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.tryLoc === t) {\n var n = r.completion;\n if (\"throw\" === n.type) {\n var o = n.arg;\n resetTryEntry(r);\n }\n return o;\n }\n }\n throw Error(\"illegal catch attempt\");\n },\n delegateYield: function delegateYield(e, r, n) {\n return this.delegate = {\n iterator: values(e),\n resultName: r,\n nextLoc: n\n }, \"next\" === this.method && (this.arg = t), y;\n }\n }, e;\n}\nmodule.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(o);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","// TODO(Babel 8): Remove this file.\n\nvar runtime = require(\"../helpers/regeneratorRuntime\")();\nmodule.exports = runtime;\n\n// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\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\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (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__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (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};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/User'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/Post'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/TextEditor'];","function _setPrototypeOf(t, e) {\n return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {\n return t.__proto__ = e, t;\n }, _setPrototypeOf(t, e);\n}\nexport { _setPrototypeOf as default };","import setPrototypeOf from \"./setPrototypeOf.js\";\nfunction _inheritsLoose(t, o) {\n t.prototype = Object.create(o.prototype), t.prototype.constructor = t, setPrototypeOf(t, o);\n}\nexport { _inheritsLoose as default };","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/classList'];","import app from 'flarum/forum/app';\nimport Component from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport classList from 'flarum/common/utils/classList';\n\nexport default class UploadButton extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.attrs.uploader.on('uploaded', () => {\n // reset the button for a new upload\n this.$('form')[0].reset();\n\n // redraw to reflect uploader.loading in the DOM\n m.redraw();\n });\n\n this.isMediaUploadButton = vnode.attrs.isMediaUploadButton || false;\n }\n\n view() {\n const buttonText = this.attrs.uploader.uploading\n ? app.translator.trans('fof-upload.forum.states.loading')\n : app.translator.trans('fof-upload.forum.buttons.upload');\n\n return (\n \n {this.attrs.uploader.uploading && }\n {(this.isMediaUploadButton || this.attrs.uploader.uploading) && {buttonText}}\n
    \n \n
    \n \n );\n }\n\n /**\n * Process the upload event.\n *\n * @param e\n */\n process(e) {\n // get the file from the input field\n const files = this.$('input').prop('files');\n\n if (files.length === 0) {\n // We've got no files to upload, so trying\n // to begin an upload will show an error\n // to the user.\n return;\n }\n\n this.attrs.uploader.upload(files, !this.isMediaUploadButton);\n }\n\n /**\n * Event handler for upload button being clicked\n *\n * @param {PointerEvent} e\n */\n uploadButtonClicked(e) {\n // Trigger click on hidden input element\n // (Opens file dialog)\n this.$('input').click();\n }\n}\n","export default class DragAndDrop {\n constructor(upload, composerElement) {\n this.upload = upload;\n this.composerElement = composerElement;\n\n // Keep references to the bound methods so we can remove the event listeners later\n this.handlers = {};\n\n if (!this.supportsFileDragging()) {\n return;\n }\n\n this.composerElement.addEventListener('dragover', (this.handlers.in = this.in.bind(this)));\n\n this.composerElement.addEventListener('dragleave', (this.handlers.out = this.out.bind(this)));\n this.composerElement.addEventListener('dragend', this.handlers.out);\n\n this.composerElement.addEventListener('drop', (this.handlers.dropping = this.dropping.bind(this)));\n }\n\n supportsFileDragging() {\n // Based on https://css-tricks.com/drag-and-drop-file-uploading/\n const div = document.createElement('div');\n\n return ('draggable' in div || ('ondragstart' in div && 'ondrop' in div)) && 'FormData' in window && 'FileReader' in window;\n }\n\n unload() {\n // If the handlers were not set (drag and drop not supported), we skip removing them\n if (!this.handlers.in) {\n return;\n }\n\n this.composerElement.removeEventListener('dragover', this.handlers.in);\n\n this.composerElement.removeEventListener('dragleave', this.handlers.out);\n this.composerElement.removeEventListener('dragend', this.handlers.out);\n\n this.composerElement.removeEventListener('drop', this.handlers.dropping);\n }\n\n isNotFile(event) {\n // Checking event.dataTransfer.files.length does not work on dragover event, it's always zero\n // So we use the dataTransfer.items property to check whether any file is being dragged\n if (event.dataTransfer.items) {\n for (let i = 0; i < event.dataTransfer.items.length; i++) {\n if (event.dataTransfer.items[i].kind !== 'file') {\n return true;\n }\n }\n }\n\n return false;\n }\n\n in(event) {\n if (this.isNotFile(event)) {\n return;\n }\n\n event.preventDefault();\n\n if (!this.over) {\n this.composerElement.classList.add('fof-upload-dragging');\n this.over = true;\n }\n }\n\n out(event) {\n if (this.isNotFile(event)) {\n return;\n }\n\n event.preventDefault();\n\n if (this.over) {\n this.composerElement.classList.remove('fof-upload-dragging');\n this.over = false;\n }\n }\n\n dropping(event) {\n if (this.isNotFile(event)) {\n return;\n }\n\n event.preventDefault();\n\n this.upload(event.dataTransfer.files);\n\n this.composerElement.classList.remove('fof-upload-dragging');\n }\n}\n","export default class PasteClipboard {\n constructor(upload, element) {\n this.upload = upload;\n\n // We don't need to remove the events listeners, because they'll get removed when the DOM does.\n element.addEventListener('paste', this.paste.bind(this));\n }\n\n paste(e) {\n if (e.clipboardData && e.clipboardData.items) {\n const items = e.clipboardData.items;\n\n const files = [];\n\n for (let i = 0; i < items.length; i++) {\n if (items[i].type.indexOf('image') !== -1) {\n files.push(items[i].getAsFile());\n }\n }\n\n if (files.length > 0) {\n e.preventDefault();\n\n this.upload(files);\n }\n }\n }\n}\n","import app from 'flarum/forum/app';\n\nexport default class Uploader {\n constructor() {\n this.callbacks = {\n success: [],\n failure: [],\n uploading: [],\n uploaded: [],\n };\n this.uploading = false;\n }\n\n setState(fileState) {\n this.fileState = fileState;\n }\n\n on(type, callback) {\n this.callbacks[type].push(callback);\n }\n\n dispatch(type, response) {\n this.callbacks[type].forEach((callback) => callback(response));\n }\n\n upload(files, addBBcode = true) {\n this.uploading = true;\n this.dispatch('uploading', files);\n\n m.redraw(); // Forcing a redraw so that the button also updates if uploadFiles() is called from DragAndDrop or PasteClipboard\n\n const body = new FormData();\n\n for (let i = 0; i < files.length; i++) {\n body.append('files[]', files[i]);\n }\n\n // send a POST request to the api\n return app\n .request({\n method: 'POST',\n url: app.forum.attribute('apiUrl') + '/fof/upload',\n // prevent JSON.stringify'ing the form data in the XHR call\n serialize: (raw) => raw,\n body,\n })\n .then((result) => this.uploaded(result, addBBcode))\n .catch((error) => {\n this.uploading = false;\n m.redraw();\n\n const e = error.response.errors[0];\n\n if (!e.code.includes('fof-upload')) {\n throw error;\n }\n\n app.alerts.clear();\n app.alerts.show(\n {\n type: 'error',\n },\n e.detail\n );\n });\n }\n\n uploaded(result, addBBcode = false) {\n this.uploading = false;\n\n result.data.forEach((file) => {\n const fileObj = app.store.pushObject(file);\n\n // Add file to media manager\n this.fileState?.addToList(fileObj);\n\n // Dispatch\n this.dispatch('success', {\n file: fileObj,\n addBBcode,\n });\n });\n\n this.dispatch('uploaded');\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/app'];","function asyncGeneratorStep(n, t, e, r, o, a, c) {\n try {\n var i = n[a](c),\n u = i.value;\n } catch (n) {\n return void e(n);\n }\n i.done ? t(u) : Promise.resolve(u).then(r, o);\n}\nfunction _asyncToGenerator(n) {\n return function () {\n var t = this,\n e = arguments;\n return new Promise(function (r, o) {\n var a = n.apply(t, e);\n function _next(n) {\n asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n);\n }\n function _throw(n) {\n asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n);\n }\n _next(void 0);\n });\n };\n}\nexport { _asyncToGenerator as default };","const mimeToIconMap = new Map([\n // Image formats\n ['image/png', 'far fa-file-image'],\n ['image/jpg', 'far fa-file-image'],\n ['image/jpeg', 'far fa-file-image'],\n ['image/svg+xml', 'far fa-file-image'],\n ['image/gif', 'far fa-file-image'],\n ['image/bmp', 'far fa-file-image'],\n ['image/webp', 'far fa-file-image'],\n\n // Compressed file formats\n ['application/zip', 'far fa-file-archive'],\n ['application/x-7z-compressed', 'far fa-file-archive'],\n ['application/gzip', 'far fa-file-archive'],\n ['application/vnd.rar', 'far fa-file-archive'],\n ['application/x-rar-compressed', 'far fa-file-archive'],\n ['application/x-tar', 'far fa-file-archive'],\n ['application/x-iso9660-image', 'far fa-file-archive'],\n\n // Text and code file formats\n ['text/plain', 'far fa-file-alt'],\n ['text/csv', 'far fa-file-csv'],\n ['text/xml', 'far fa-file-code'],\n ['text/html', 'far fa-file-code'],\n ['text/css', 'far fa-file-code'],\n ['text/javascript', 'far fa-file-code'],\n ['application/json', 'far fa-file-code'],\n ['application/ld+json', 'far fa-file-code'],\n ['application/x-httpd-php', 'far fa-file-code'],\n ['application/xml', 'far fa-file-code'],\n ['text/xml', 'far fa-file-code'],\n\n // Document formats\n ['application/x-abiword', 'far fa-file-word'],\n ['application/msword', 'far fa-file-word'],\n ['application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'far fa-file-word'],\n ['application/vnd.oasis.opendocument.text', 'far fa-file-word'],\n ['application/vnd.ms-excel', 'far fa-file-excel'],\n ['application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'far fa-file-excel'],\n ['application/vnd.oasis.opendocument.spreadsheet', 'far fa-file-excel'],\n ['application/vnd.ms-powerpoint', 'far fa-file-powerpoint'],\n ['application/vnd.openxmlformats-officedocument.presentationml.presentation', 'far fa-file-powerpoint'],\n ['application/vnd.oasis.opendocument.presentation', 'far fa-file-powerpoint'],\n ['application/pdf', 'far fa-file-pdf'],\n ['application/rtf', 'far fa-file-alt'],\n\n // eBook formats\n ['application/epub+zip', 'far fa-book'],\n ['application/x-mobipocket-ebook', 'far fa-book'],\n ['application/vnd.amazon.ebook', 'far fa-book'],\n\n // Audio formats\n ['audio/mpeg', 'far fa-file-audio'],\n ['audio/wav', 'far fa-file-audio'],\n ['audio/x-wav', 'far fa-file-audio'],\n ['audio/aac', 'far fa-file-audio'],\n ['audio/ogg', 'far fa-file-audio'],\n ['audio/flac', 'far fa-file-audio'],\n ['audio/aiff', 'far fa-file-audio'],\n ['audio/x-aiff', 'far fa-file-audio'],\n\n // Video formats\n ['video/x-msvideo', 'far fa-file-video'],\n ['video/mp4', 'far fa-file-video'],\n ['video/quicktime', 'far fa-file-video'],\n]);\n\nexport default function mimeToIcon(fileType: string): string {\n // Directly return the icon if the fileType is in the map\n return (\n mimeToIconMap.get(fileType) ||\n (function () {\n // Check for generic types\n if (fileType.startsWith('image/')) {\n return 'far fa-file-image';\n } else if (fileType.startsWith('video/')) {\n return 'far fa-file-video';\n } else if (fileType.startsWith('audio/')) {\n return 'far fa-file-audio';\n }\n\n // Default icon\n return 'far fa-file';\n })()\n );\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Tooltip'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/extractText'];","import app from 'flarum/common/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport File from '../models/File';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport Button from 'flarum/common/components/Button';\nimport icon from 'flarum/common/helpers/icon';\nimport mimeToIcon from '../mimeToIcon';\nimport User from 'flarum/common/models/User';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport type Mithril from 'mithril';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport extractText from 'flarum/common/utils/extractText';\n\ninterface CustomAttrs extends ComponentAttrs {\n file: File;\n fileSelectable: boolean;\n isSelected: boolean;\n fileClassNames: string;\n isFileHiding: boolean;\n onHide: (file: File) => void | undefined;\n onFileClick: (file: File) => void | undefined;\n onDelete: (file: File) => void | undefined;\n user: User;\n}\n\nexport default class DisplayFile extends Component {\n isFileHiding!: boolean;\n imageLoaded: boolean = true;\n file!: File;\n fileIcon!: string;\n isSelected!: boolean;\n isSelectable!: boolean;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.file = this.attrs.file;\n this.isFileHiding = this.attrs.isFileHiding === undefined ? false : this.attrs.isFileHiding;\n this.fileIcon = mimeToIcon(this.file.type());\n this.isSelected = this.attrs.isSelected === undefined ? false : this.attrs.isSelected;\n this.isSelectable = this.attrs.fileSelectable === undefined ? true : this.attrs.fileSelectable;\n }\n\n onbeforeupdate(vnode: Mithril.VnodeDOM): void {\n super.onbeforeupdate(vnode);\n\n // Make sure the isSelected property is updated\n this.isSelected = this.attrs.isSelected === undefined ? false : this.attrs.isSelected;\n }\n\n view() {\n const isImage = this.file.type().startsWith('image/');\n\n const fileSelectedClass = this.isSelected ? 'selected' : '';\n\n return (\n {\n if (this.isSelectable && !this.isFileHiding) {\n this.isSelected = !this.isSelected;\n this.attrs.onFileClick(this.file);\n }\n }}\n disabled={!this.isSelectable || this.isFileHiding}\n >\n {this.imageLoaded && isImage ? (\n \n ) : (\n this.displayIcon(this.fileIcon)\n )}\n\n
    {this.actionItems(this.file).toArray()}
    \n\n
    \n \n {this.file.baseName()}\n \n
    \n\n {this.isFileHiding && (\n
    \n \n
    \n )}\n \n );\n }\n\n displayIcon(fileIcon: string): Mithril.Children {\n return (\n \n {icon(`fa-fw ${fileIcon}`)}\n \n );\n }\n\n actionItems(file: File): ItemList {\n const items = new ItemList();\n\n file.canViewInfo() &&\n items.add(\n 'view-info',\n \n \n )}\n \n \n );\n }\n\n onDelete(file: File) {\n if (this.attrs.onDelete) {\n this.attrs.onDelete(file);\n }\n }\n\n // Common methods like onFileClick, isSelectable, hideFile...\n\n onFileClick(file: File) {\n // Custom functionality\n if (this.attrs.onFileSelect) {\n this.attrs.onFileSelect(file);\n return;\n }\n\n // Download on click\n if (this.attrs.downloadOnClick) {\n window.open(file.url());\n return;\n }\n }\n\n isSelectable(file: File) {\n const fileType = file.type();\n\n // Custom defined file types\n if (Array.isArray(this.restrictFileType)) {\n return this.restrictFileType.indexOf(fileType) >= 0;\n }\n\n // Image\n else if (this.restrictFileType === 'image') {\n return fileType.includes('image/');\n }\n\n // Audio\n else if (this.restrictFileType === 'audio') {\n return fileType.includes('audio/');\n }\n\n // Video\n else if (this.restrictFileType === 'video') {\n return fileType.includes('video/');\n }\n\n return false;\n }\n\n /**\n * Begins the hiding process for a file.\n *\n * - Shows a native confirmation dialog\n * - If confirmed, sends AJAX request to the hide file API\n */\n async hideFile(file: File) {\n const uuid = file.uuid();\n\n if (this.filesBeingHidden.includes(uuid)) return;\n\n this.filesBeingHidden.push(uuid);\n\n const transPrefix = file.isShared() ? 'fof-upload.lib.file_list.hide_shared_file' : 'fof-upload.lib.file_list.hide_file';\n\n const confirmToggleHide = confirm(\n extractText(\n app.translator.trans(file.hidden() ? `${transPrefix}.show_confirmation` : `${transPrefix}.hide_confirmation`, {\n fileName: file.baseName(),\n })\n )\n );\n\n if (confirmToggleHide) {\n try {\n const filePayload = await app.request({\n method: 'PATCH',\n url: `${app.forum.attribute('apiUrl')}/fof/upload/hide`,\n body: { uuid },\n });\n\n app.store.pushPayload(filePayload);\n m.redraw();\n\n app.alerts.show(Alert, { type: 'success' }, [\n icon(file.hidden() ? 'fas fa-eye-slash' : 'fas fa-eye'),\n ' ',\n app.translator.trans(file?.hidden() ? `${transPrefix}.hide_success` : `${transPrefix}.show_success`),\n ]);\n\n if (this.fileState.user) {\n const index = this.fileState.files.findIndex((file: File) => uuid === file.uuid());\n this.fileState.files.splice(index, 1);\n }\n } catch (error) {\n app.alerts.show(\n Alert,\n { type: 'error' },\n app.translator.trans(file?.hidden() ? `${transPrefix}.hide_fail` : `${transPrefix}.show_fail`, {\n fileName: file.baseName(),\n })\n );\n } finally {\n // Remove file from hiding list\n const i = this.filesBeingHidden.indexOf(uuid);\n this.filesBeingHidden.splice(i, 1);\n }\n }\n }\n}\n","import app from 'flarum/common/app';\nimport File from '../models/File';\nimport AbstractFileList from './AbstractFIleList';\nimport FileListState from '../states/FileListState';\n\nexport default class UserFileList extends AbstractFileList {\n public loadFileList(): void {\n //app.fileListState.setUser(this.attrs.user || app.session.user);\n this.fileState.setUser(this.attrs.user || app.session.user);\n /**\n * The user who's media we are dealing with\n */\n this.user = this.fileState.user; //app.fileListState.user;\n }\n\n hasMoreResults(): boolean {\n return this.fileState.hasMoreResults();\n }\n\n loadMore(): void {\n this.fileState.loadMore();\n }\n\n isLoading(): boolean {\n return this.fileState.isLoading();\n }\n\n fileCollection(): File[] {\n return this.fileState.files;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Switch'];","import app from 'flarum/common/app';\nimport Modal, { IInternalModalAttrs } from 'flarum/common/components/Modal';\nimport Switch from 'flarum/common/components/Switch';\nimport mimeToIcon from '../mimeToIcon';\nimport Button from 'flarum/common/components/Button';\nimport type Mithril from 'mithril';\nimport { ApiResponsePlural } from 'flarum/common/Store';\nimport File from '../models/File';\n\ninterface CustomAttrs extends IInternalModalAttrs {\n onUploadComplete: (files: File | File[]) => void;\n}\n\nexport default class UploadSharedFileModal extends Modal {\n files = [];\n fileInput = null;\n options = {\n shared: true,\n hidden: false,\n };\n loading: boolean = false;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n }\n\n className() {\n return 'UploadSharedFileModal Modal--medium';\n }\n\n title() {\n return app.translator.trans('fof-upload.lib.upload-shared-file-modal.title');\n }\n\n onFileChange(e) {\n this.addFiles(Array.from(e.target.files));\n }\n\n addFiles(newFiles: File[]) {\n (this.files as File[]).push(...newFiles);\n m.redraw();\n }\n\n onDragOver(e) {\n e.preventDefault();\n e.stopPropagation();\n }\n\n onDrop(e) {\n e.preventDefault();\n e.stopPropagation();\n if (e.dataTransfer && e.dataTransfer.files) {\n this.addFiles(Array.from(e.dataTransfer.files));\n }\n }\n\n onDropzoneClick() {\n if (this.fileInput) {\n this.fileInput.click();\n }\n }\n\n content() {\n return (\n
    \n this.onDropzoneClick()}\n ondragover={this.onDragOver.bind(this)}\n ondrop={this.onDrop.bind(this)}\n >\n {app.translator.trans('fof-upload.lib.upload-shared-file-modal.dropzone')}\n {\n this.fileInput = vnode.dom;\n }}\n />\n
    \n
    \n {this.files.map((file: File) => {\n const isImage = file.type.startsWith('image/');\n return (\n
    \n {isImage ? {file.name} : }\n
    {file.name}
    \n {/* Remove button */}\n {\n this.files = this.files.filter((f) => f !== file);\n }}\n />\n
    \n );\n })}\n
    \n
    \n (this.options.hidden = value)}>\n {app.translator.trans('fof-upload.lib.upload-shared-file-modal.hide-from-media-gallery')}\n \n
    \n
    \n \n {app.translator.trans('fof-upload.lib.upload-shared-file-modal.upload')}\n \n
    \n \n );\n }\n\n async upload() {\n this.loading = true;\n m.redraw();\n\n const formData = new FormData();\n\n // Append each file to the form data\n this.files.forEach((file) => {\n formData.append('files[]', file);\n });\n\n Object.keys(this.options).forEach((key) => {\n formData.append(`options[${key}]`, this.options[key]);\n });\n\n const results = await app.request>({\n method: 'POST',\n url: app.forum.attribute('apiUrl') + '/fof/upload',\n serialize: (raw: FormData) => raw, // Prevent mithril from trying to serialize FormData\n body: formData,\n });\n\n const uploadedFiles = app.store.pushPayload(results);\n\n this.attrs.onUploadComplete(uploadedFiles);\n this.files = [];\n this.hide();\n\n this.loading = false;\n m.redraw();\n }\n}\n","import app from 'flarum/common/app';\nimport File from '../models/File';\nimport AbstractFileList from './AbstractFIleList';\n\nexport default class SharedFileList extends AbstractFileList {\n public loadFileList(): void {\n this.fileState.loadResults();\n }\n\n hasMoreResults() {\n return this.fileState.hasMoreResults();\n }\n\n loadMore() {\n this.fileState.loadMore();\n }\n\n isLoading(): boolean {\n return this.fileState.isLoading();\n }\n\n fileCollection(): File[] {\n return this.fileState.files;\n }\n}\n","import app from 'flarum/common/app';\nimport User from 'flarum/common/models/User';\nimport File from '../models/File';\nimport { ApiQueryParamsPlural, ApiResponsePlural } from 'flarum/common/Store';\n\nexport default class FileListState {\n public user: User | null;\n public files: File[];\n private moreResults: boolean;\n private loading: boolean;\n private sharedFiles: boolean;\n\n constructor(sharedFiles: boolean = false) {\n this.user = null;\n this.files = [];\n this.moreResults = false;\n this.loading = false;\n this.sharedFiles = sharedFiles;\n }\n\n /**\n * Set the user and load their file list.\n * @param user The user whose files to load.\n */\n public setUser(user: User): void {\n if (user === this.user) return;\n\n this.user = user;\n this.files = [];\n this.loadResults();\n }\n\n public refresh(): void {\n this.files = [];\n this.loadResults();\n m.redraw();\n }\n\n /**\n * Load more files for the current user, starting from the given offset.\n * @param offset The starting index for loading more files.\n * @returns A promise resolving to the loaded files.\n */\n public async loadResults(offset: number = 0): Promise> {\n if (!this.sharedFiles && !this.user) return Promise.reject('User not set');\n\n this.loading = true;\n\n let route: string = 'fof/uploads';\n let params: ApiQueryParamsPlural = {};\n\n if (!this.sharedFiles && this.user) {\n params = {\n filter: { user: this.user.id() },\n page: { offset },\n } as ApiQueryParamsPlural;\n } else {\n route = 'fof/upload/shared-files';\n params = {\n page: { offset },\n } as ApiQueryParamsPlural;\n }\n\n const results = await app.store.find(route, params);\n\n return this.parseResults(results);\n }\n\n /**\n * Load the next set of results.\n */\n public async loadMore(): Promise> {\n this.loading = true;\n return this.loadResults(this.files.length);\n }\n\n private parseResults(results: ApiResponsePlural): ApiResponsePlural {\n this.files = results;\n this.loading = false;\n this.moreResults = !!results.payload?.links?.next;\n m.redraw();\n return results;\n }\n\n /**\n * Add files to the beginning of the list.\n * @param files The files to be added.\n */\n public addToList(files: File | File[]): void {\n if (Array.isArray(files)) {\n this.files.unshift(...files);\n } else {\n this.files.unshift(files);\n }\n m.redraw();\n }\n\n /**\n * Remove files from the list.\n * @param files The files to be removed.\n */\n public removeFromList(files: File | File[]): void {\n if (Array.isArray(files)) {\n this.files = this.files.filter((file) => !files.includes(file));\n } else {\n this.files = this.files.filter((file) => file !== files);\n }\n\n m.redraw();\n }\n\n /**\n * Check if there are files in the list.\n * @returns True if there are files, false otherwise.\n */\n public hasFiles(): boolean {\n return this.files.length > 0;\n }\n\n /**\n * Check if the file list is currently loading.\n * @returns True if loading, false otherwise.\n */\n public isLoading(): boolean {\n return this.loading;\n }\n\n /**\n * Check if there are more files to load.\n * @returns True if there are more files, false otherwise.\n */\n public hasMoreResults(): boolean {\n return this.moreResults;\n }\n\n /**\n * Check if the user has no files and the list is not loading.\n * @returns True if the list is empty and not loading, false otherwise.\n */\n public empty(): boolean {\n return !this.hasFiles() && !this.isLoading();\n }\n}\n","import app from 'flarum/forum/app';\nimport Modal from 'flarum/common/components/Modal';\nimport Button from 'flarum/common/components/Button';\nimport UploadButton from './UploadButton';\nimport UserFileList from '../../common/components/UserFileList';\nimport DragAndDrop from './DragAndDrop';\nimport UploadSharedFileModal from '../../common/components/UploadSharedFileModal';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport SharedFileList from '../../common/components/SharedFileList';\nimport FileListState from '../../common/states/FileListState';\n\nexport default class FileManagerModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n // Initialize upload managers\n this.uploader = vnode.attrs.uploader;\n\n // Current selected files\n this.selectedFiles = [];\n\n // Allow multiselect\n this.multiSelect = vnode.attrs.multiSelect === undefined ? true : vnode.attrs.multiSelect;\n\n // Restrict file selection to specific types\n this.restrictFileType = vnode.attrs.restrictFileType || null;\n\n // Drag & drop\n this.dragDrop = null;\n\n this.selectedFilesLibrary = vnode.attrs.defaultFilesLibrary || 'user';\n\n this.sharedUploads = null;\n\n this.userFileState = new FileListState();\n this.sharedFileState = new FileListState(true);\n\n this.uploader.setState(this.userFileState);\n\n // Initialize uploads\n this.onUpload();\n }\n\n className() {\n return 'Modal--large fof-file-manager-modal';\n }\n\n /**\n * Initialize drag & drop\n */\n oncreate(vnode) {\n super.oncreate(vnode);\n\n this.dragDrop = new DragAndDrop((files) => this.uploader.upload(files, false), this.$().find('.Modal-content')[0]);\n }\n\n /**\n * Remove events from modal content\n */\n onremove() {\n if (this.dragDrop) {\n this.dragDrop.unload();\n }\n }\n\n view() {\n const fileCount = this.selectedFiles.length;\n const { hideUser, hideShared } = this.attrs;\n\n return (\n
    \n
    \n
    \n {!hideUser && this.selectedFilesLibrary === 'user' && (\n \n )}\n {app.session.user && app.session.user.uploadSharedFiles() && !hideShared && this.selectedFilesLibrary === 'shared' && (\n {\n this.showUploadModal();\n }}\n >\n {app.translator.trans('fof-upload.forum.buttons.upload')}\n \n )}\n
    \n\n
    \n
    \n \n\n {app.translator.trans('fof-upload.lib.file_list.release_to_upload')}\n
    \n
    \n\n
    \n

    {app.translator.trans('fof-upload.forum.media_manager')}

    \n {app.session.user?.accessSharedFiles() && !hideUser && !hideShared && (\n
    {this.fileLibraryButtonItems().toArray()}
    \n )}\n
    \n\n {this.alertAttrs && (\n
    \n \n
    \n )}\n\n
    \n {this.selectedFilesLibrary === 'user' && this.userFilesContent()}\n {this.selectedFilesLibrary === 'shared' && this.sharedFilesContent()}\n
    \n\n
    \n \n\n 1)}\n className=\"Button Button--primary\"\n >\n {app.translator.trans('fof-upload.lib.file_list.confirm_selection_btn', { fileCount })}\n \n
    \n
    \n
    \n );\n }\n\n fileLibraryButtonItems() {\n const items = new ItemList();\n\n items.add(\n 'user',\n \n );\n\n items.add(\n 'shared',\n \n );\n\n return items;\n }\n\n setLibrary(library) {\n this.selectedFilesLibrary = library;\n m.redraw();\n }\n\n userFilesContent() {\n return (\n \n );\n }\n\n sharedFilesContent() {\n return (\n \n );\n }\n\n /**\n * Add or remove file from selected files\n *\n * @param {File} file\n */\n onFileSelect(file) {\n const itemPosition = this.selectedFiles.indexOf(file.id());\n\n if (itemPosition >= 0) {\n this.selectedFiles.splice(itemPosition, 1);\n } else {\n if (this.multiSelect) {\n this.selectedFiles.push(file.id());\n } else {\n this.selectedFiles = [file.id()];\n }\n }\n }\n\n /**\n * Add files to file list after upload\n */\n onUpload() {\n this.uploader.on('success', ({ file }) => {\n if (this.multiSelect) {\n this.selectedFiles.push(file.id());\n } else {\n this.selectedFiles = [file.id()];\n }\n });\n }\n\n /**\n * Add selected files to the composer\n */\n onSelect() {\n this.hide();\n\n // Custom callback\n if (this.attrs.onSelect) {\n this.attrs.onSelect(this.selectedFiles);\n\n return;\n }\n\n // Add selected files to composer\n this.selectedFiles.map((fileId) => {\n const file = app.store.getById('files', fileId) || app.store.getById('shared-files', fileId);\n\n app.composer.editor.insertAtCursor(file.bbcode() + '\\n', false);\n });\n }\n\n showUploadModal() {\n app.modal.show(\n UploadSharedFileModal,\n {\n onUploadComplete: (files) => {\n this.sharedFileState.addToList(files);\n },\n },\n true\n );\n }\n\n onDelete(file) {\n this.sharedFileState.removeFromList(file);\n this.userFileState.removeFromList(file);\n }\n}\n","import app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport FileManagerModal from './FileManagerModal';\nimport Tooltip from 'flarum/common/components/Tooltip';\n\ninterface FileManagerButtonAttrs extends ComponentAttrs {\n uploader: any;\n}\n\nexport default class FileManagerButton extends Component {\n view() {\n return (\n \n {Button.component({\n className: 'Button fof-upload-button Button--icon',\n onclick: this.fileManagerButtonClicked.bind(this),\n icon: 'fas fa-photo-video',\n })}\n \n );\n }\n\n /**\n * Event handler for upload button being clicked\n */\n fileManagerButtonClicked(e: PointerEvent) {\n e.preventDefault();\n\n // Open dialog\n app.modal.show(FileManagerModal, {\n uploader: this.attrs.uploader,\n });\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/UserPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LinkButton'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extenders'];","import Model from 'flarum/common/Model';\n\nexport default class File extends Model {\n baseName() {\n return Model.attribute('baseName').call(this);\n }\n\n path() {\n return Model.attribute('path').call(this);\n }\n\n url() {\n return Model.attribute('url').call(this);\n }\n\n size() {\n return Model.attribute('size').call(this);\n }\n\n type() {\n return Model.attribute('type').call(this);\n }\n\n humanSize() {\n return Model.attribute('humanSize').call(this);\n }\n\n createdAt() {\n return Model.attribute('createdAt', Model.transformDate).call(this);\n }\n\n uuid() {\n return Model.attribute('uuid').call(this);\n }\n\n tag() {\n return Model.attribute('tag').call(this);\n }\n\n hidden() {\n return Model.attribute('hidden').call(this);\n }\n\n bbcode() {\n return Model.attribute('bbcode').call(this);\n }\n\n isShared() {\n return Model.attribute('shared').call(this);\n }\n\n isPrivateShared() {\n return Model.attribute('isPrivateShared').call(this);\n }\n\n canViewInfo() {\n return Model.attribute('canViewInfo').call(this);\n }\n\n canHide() {\n return Model.attribute('canHide').call(this);\n }\n\n canDelete() {\n return Model.attribute('canDelete').call(this);\n }\n\n apiEndpoint() {\n return '/fof/uploads' + (this.exists ? '/' + this.id() : '');\n }\n}\n","import Extend from 'flarum/common/extenders';\nimport File from './models/File';\n\nexport default [\n new Extend.Store() //\n .add('files', File)\n .add('shared-files', File),\n];\n","import app from 'flarum/forum/app';\nimport UserPage from 'flarum/forum/components/UserPage';\nimport UserFileList from '../../common/components/UserFileList';\nimport type Mithril from 'mithril';\nimport User from 'flarum/common/models/User';\nimport FileListState from '../../common/states/FileListState';\n\nimport type File from '../../common/models/File';\n\nexport default class UploadsUserPage extends UserPage {\n fileState!: FileListState;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.user = null;\n this.fileState = new FileListState();\n\n this.loadUser(m.route.param('username'));\n }\n\n content() {\n if (app.session.user && (app.session.user.viewOthersMediaLibrary() || this.user === app.session.user)) {\n return (\n this.user &&\n UserFileList.component({\n user: this.user,\n selectable: false,\n downloadOnClick: true,\n fileState: this.fileState,\n onDelete: this.onDelete.bind(this),\n })\n );\n } else {\n return null;\n }\n }\n\n onDelete(file: File) {\n this.fileState.removeFromList(file);\n }\n\n show(user: User) {\n super.show(user);\n this.user = user;\n }\n}\n","import User from 'flarum/common/models/User';\nimport { default as extend } from '../common/extend';\nimport Extend from 'flarum/common/extenders';\nimport UploadsUserPage from './components/UploadsUserPage';\n\nexport default [\n ...extend,\n\n // Not using the new extender yet, thinking about if to change the serialized names,\n // or the js property names, as we can't change the key->attribute name via the extender,\n // like we used to do with ie `User.prototype.viewOthersMediaLibrary = Model.attribute('fof-upload-viewOthersMediaLibrary');`\n // new Extend.Model(User) //\n // .attribute('fof-upload-viewOthersMediaLibrary')\n // .attribute('fof-upload-deleteOthersMediaLibrary')\n // .attribute('fof-upload-uploadCountCurrent')\n // .attribute('fof-upload-uploadCountAll'),\n\n new Extend.Routes() //\n .add('user.uploads', '/u/:username/uploads', UploadsUserPage),\n];\n","function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };","import Component, { ComponentAttrs } from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport type Mithril from 'mithril';\nimport mimeToIcon from '../mimeToIcon';\nimport File from '../models/File';\nimport icon from 'flarum/common/helpers/icon';\nimport app from 'flarum/common/app';\nimport classList from 'flarum/common/utils/classList';\n\ninterface CustomAttrs extends ComponentAttrs {\n file: File;\n selectable: boolean;\n fileClassNames: string;\n onDelete: (file: File) => void | undefined;\n onFileSelect: (file: File) => void | undefined;\n}\n\nexport default class UploadedFile extends Component {\n file!: File;\n callback!: () => void | undefined;\n imageLoaded: boolean = true;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.file = this.attrs.file;\n }\n\n view() {\n const isImage = this.file.type().startsWith('image/');\n const fileIcon = mimeToIcon(this.file.type());\n const errorIcon = 'fas fa-exclamation-triangle';\n const statusIcon = this.file.isPrivateShared() ? 'fas fa-lock' : 'fas fa-unlock';\n\n return (\n
    \n
    \n \n {icon(statusIcon)}\n {this.file.baseName()}\n \n
    \n
    this.onFileClick(this.file)}>\n {isImage ? (\n this.imageLoaded ? (\n \n ) : (\n icon(errorIcon, { className: 'icon-fallback' }) // Error icon for failed image load\n )\n ) : (\n icon(fileIcon, { className: 'icon-fallback' }) // Icon representing the file type\n )}\n
    \n
    {this.actionItems().toArray()}
    \n
    \n );\n }\n\n actionItems(): ItemList {\n const items = new ItemList();\n\n items.add(\n 'view-info',\n \n );\n }\n\n /**\n * Process the upload event.\n *\n * @param e\n */\n process(e) {\n // get the file from the input field\n const files = this.$('input').prop('files');\n\n if (files.length === 0) {\n // We've got no files to upload, so trying\n // to begin an upload will show an error\n // to the user.\n return;\n }\n\n this.attrs.uploader.upload(files, !this.isMediaUploadButton);\n }\n\n /**\n * Event handler for upload button being clicked\n *\n * @param {PointerEvent} e\n */\n uploadButtonClicked(e) {\n // Trigger click on hidden input element\n // (Opens file dialog)\n this.$('input').click();\n }\n}\n","export default class DragAndDrop {\n constructor(upload, composerElement) {\n this.upload = upload;\n this.composerElement = composerElement;\n\n // Keep references to the bound methods so we can remove the event listeners later\n this.handlers = {};\n\n if (!this.supportsFileDragging()) {\n return;\n }\n\n this.composerElement.addEventListener('dragover', (this.handlers.in = this.in.bind(this)));\n\n this.composerElement.addEventListener('dragleave', (this.handlers.out = this.out.bind(this)));\n this.composerElement.addEventListener('dragend', this.handlers.out);\n\n this.composerElement.addEventListener('drop', (this.handlers.dropping = this.dropping.bind(this)));\n }\n\n supportsFileDragging() {\n // Based on https://css-tricks.com/drag-and-drop-file-uploading/\n const div = document.createElement('div');\n\n return ('draggable' in div || ('ondragstart' in div && 'ondrop' in div)) && 'FormData' in window && 'FileReader' in window;\n }\n\n unload() {\n // If the handlers were not set (drag and drop not supported), we skip removing them\n if (!this.handlers.in) {\n return;\n }\n\n this.composerElement.removeEventListener('dragover', this.handlers.in);\n\n this.composerElement.removeEventListener('dragleave', this.handlers.out);\n this.composerElement.removeEventListener('dragend', this.handlers.out);\n\n this.composerElement.removeEventListener('drop', this.handlers.dropping);\n }\n\n isNotFile(event) {\n // Checking event.dataTransfer.files.length does not work on dragover event, it's always zero\n // So we use the dataTransfer.items property to check whether any file is being dragged\n if (event.dataTransfer.items) {\n for (let i = 0; i < event.dataTransfer.items.length; i++) {\n if (event.dataTransfer.items[i].kind !== 'file') {\n return true;\n }\n }\n }\n\n return false;\n }\n\n in(event) {\n if (this.isNotFile(event)) {\n return;\n }\n\n event.preventDefault();\n\n if (!this.over) {\n this.composerElement.classList.add('fof-upload-dragging');\n this.over = true;\n }\n }\n\n out(event) {\n if (this.isNotFile(event)) {\n return;\n }\n\n event.preventDefault();\n\n if (this.over) {\n this.composerElement.classList.remove('fof-upload-dragging');\n this.over = false;\n }\n }\n\n dropping(event) {\n if (this.isNotFile(event)) {\n return;\n }\n\n event.preventDefault();\n\n this.upload(event.dataTransfer.files);\n\n this.composerElement.classList.remove('fof-upload-dragging');\n }\n}\n","export default class PasteClipboard {\n constructor(upload, element) {\n this.upload = upload;\n\n // We don't need to remove the events listeners, because they'll get removed when the DOM does.\n element.addEventListener('paste', this.paste.bind(this));\n }\n\n paste(e) {\n if (e.clipboardData && e.clipboardData.items) {\n const items = e.clipboardData.items;\n\n const files = [];\n\n for (let i = 0; i < items.length; i++) {\n if (items[i].type.indexOf('image') !== -1) {\n files.push(items[i].getAsFile());\n }\n }\n\n if (files.length > 0) {\n e.preventDefault();\n\n this.upload(files);\n }\n }\n }\n}\n","import app from 'flarum/forum/app';\n\nexport default class Uploader {\n constructor() {\n this.callbacks = {\n success: [],\n failure: [],\n uploading: [],\n uploaded: [],\n };\n this.uploading = false;\n }\n\n setState(fileState) {\n this.fileState = fileState;\n }\n\n on(type, callback) {\n this.callbacks[type].push(callback);\n }\n\n dispatch(type, response) {\n this.callbacks[type].forEach((callback) => callback(response));\n }\n\n upload(files, addBBcode = true) {\n this.uploading = true;\n this.dispatch('uploading', files);\n\n m.redraw(); // Forcing a redraw so that the button also updates if uploadFiles() is called from DragAndDrop or PasteClipboard\n\n const body = new FormData();\n\n for (let i = 0; i < files.length; i++) {\n body.append('files[]', files[i]);\n }\n\n // send a POST request to the api\n return app\n .request({\n method: 'POST',\n url: app.forum.attribute('apiUrl') + '/fof/upload',\n // prevent JSON.stringify'ing the form data in the XHR call\n serialize: (raw) => raw,\n body,\n })\n .then((result) => this.uploaded(result, addBBcode))\n .catch((error) => {\n this.uploading = false;\n m.redraw();\n\n const e = error.response.errors[0];\n\n if (!e.code.includes('fof-upload')) {\n throw error;\n }\n\n app.alerts.clear();\n app.alerts.show(\n {\n type: 'error',\n },\n e.detail\n );\n });\n }\n\n uploaded(result, addBBcode = false) {\n this.uploading = false;\n\n result.data.forEach((file) => {\n const fileObj = app.store.pushObject(file);\n\n // Add file to media manager\n this.fileState?.addToList(fileObj);\n\n // Dispatch\n this.dispatch('success', {\n file: fileObj,\n addBBcode,\n });\n });\n\n this.dispatch('uploaded');\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/app'];","function asyncGeneratorStep(n, t, e, r, o, a, c) {\n try {\n var i = n[a](c),\n u = i.value;\n } catch (n) {\n return void e(n);\n }\n i.done ? t(u) : Promise.resolve(u).then(r, o);\n}\nfunction _asyncToGenerator(n) {\n return function () {\n var t = this,\n e = arguments;\n return new Promise(function (r, o) {\n var a = n.apply(t, e);\n function _next(n) {\n asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n);\n }\n function _throw(n) {\n asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n);\n }\n _next(void 0);\n });\n };\n}\nexport { _asyncToGenerator as default };","const mimeToIconMap = new Map([\n // Image formats\n ['image/png', 'far fa-file-image'],\n ['image/jpg', 'far fa-file-image'],\n ['image/jpeg', 'far fa-file-image'],\n ['image/svg+xml', 'far fa-file-image'],\n ['image/gif', 'far fa-file-image'],\n ['image/bmp', 'far fa-file-image'],\n ['image/webp', 'far fa-file-image'],\n\n // Compressed file formats\n ['application/zip', 'far fa-file-archive'],\n ['application/x-7z-compressed', 'far fa-file-archive'],\n ['application/gzip', 'far fa-file-archive'],\n ['application/vnd.rar', 'far fa-file-archive'],\n ['application/x-rar-compressed', 'far fa-file-archive'],\n ['application/x-tar', 'far fa-file-archive'],\n ['application/x-iso9660-image', 'far fa-file-archive'],\n\n // Text and code file formats\n ['text/plain', 'far fa-file-alt'],\n ['text/csv', 'far fa-file-csv'],\n ['text/xml', 'far fa-file-code'],\n ['text/html', 'far fa-file-code'],\n ['text/css', 'far fa-file-code'],\n ['text/javascript', 'far fa-file-code'],\n ['application/json', 'far fa-file-code'],\n ['application/ld+json', 'far fa-file-code'],\n ['application/x-httpd-php', 'far fa-file-code'],\n ['application/xml', 'far fa-file-code'],\n ['text/xml', 'far fa-file-code'],\n\n // Document formats\n ['application/x-abiword', 'far fa-file-word'],\n ['application/msword', 'far fa-file-word'],\n ['application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'far fa-file-word'],\n ['application/vnd.oasis.opendocument.text', 'far fa-file-word'],\n ['application/vnd.ms-excel', 'far fa-file-excel'],\n ['application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'far fa-file-excel'],\n ['application/vnd.oasis.opendocument.spreadsheet', 'far fa-file-excel'],\n ['application/vnd.ms-powerpoint', 'far fa-file-powerpoint'],\n ['application/vnd.openxmlformats-officedocument.presentationml.presentation', 'far fa-file-powerpoint'],\n ['application/vnd.oasis.opendocument.presentation', 'far fa-file-powerpoint'],\n ['application/pdf', 'far fa-file-pdf'],\n ['application/rtf', 'far fa-file-alt'],\n\n // eBook formats\n ['application/epub+zip', 'far fa-book'],\n ['application/x-mobipocket-ebook', 'far fa-book'],\n ['application/vnd.amazon.ebook', 'far fa-book'],\n\n // Audio formats\n ['audio/mpeg', 'far fa-file-audio'],\n ['audio/wav', 'far fa-file-audio'],\n ['audio/x-wav', 'far fa-file-audio'],\n ['audio/aac', 'far fa-file-audio'],\n ['audio/ogg', 'far fa-file-audio'],\n ['audio/flac', 'far fa-file-audio'],\n ['audio/aiff', 'far fa-file-audio'],\n ['audio/x-aiff', 'far fa-file-audio'],\n\n // Video formats\n ['video/x-msvideo', 'far fa-file-video'],\n ['video/mp4', 'far fa-file-video'],\n ['video/quicktime', 'far fa-file-video'],\n]);\n\nexport default function mimeToIcon(fileType: string): string {\n // Directly return the icon if the fileType is in the map\n return (\n mimeToIconMap.get(fileType) ||\n (function () {\n // Check for generic types\n if (fileType.startsWith('image/')) {\n return 'far fa-file-image';\n } else if (fileType.startsWith('video/')) {\n return 'far fa-file-video';\n } else if (fileType.startsWith('audio/')) {\n return 'far fa-file-audio';\n }\n\n // Default icon\n return 'far fa-file';\n })()\n );\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Tooltip'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/extractText'];","import app from 'flarum/common/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport File from '../models/File';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport Button from 'flarum/common/components/Button';\nimport icon from 'flarum/common/helpers/icon';\nimport mimeToIcon from '../mimeToIcon';\nimport User from 'flarum/common/models/User';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport type Mithril from 'mithril';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport extractText from 'flarum/common/utils/extractText';\n\ninterface CustomAttrs extends ComponentAttrs {\n file: File;\n fileSelectable: boolean;\n isSelected: boolean;\n fileClassNames: string;\n isFileHiding: boolean;\n onHide: (file: File) => void | undefined;\n onFileClick: (file: File) => void | undefined;\n onDelete: (file: File) => void | undefined;\n user: User;\n}\n\nexport default class DisplayFile extends Component {\n isFileHiding!: boolean;\n imageLoaded: boolean = true;\n file!: File;\n fileIcon!: string;\n isSelected!: boolean;\n isSelectable!: boolean;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.file = this.attrs.file;\n this.isFileHiding = this.attrs.isFileHiding === undefined ? false : this.attrs.isFileHiding;\n this.fileIcon = mimeToIcon(this.file.type());\n this.isSelected = this.attrs.isSelected === undefined ? false : this.attrs.isSelected;\n this.isSelectable = this.attrs.fileSelectable === undefined ? true : this.attrs.fileSelectable;\n }\n\n onbeforeupdate(vnode: Mithril.VnodeDOM): void {\n super.onbeforeupdate(vnode);\n\n // Make sure the isSelected property is updated\n this.isSelected = this.attrs.isSelected === undefined ? false : this.attrs.isSelected;\n }\n\n view() {\n const isImage = this.file.type().startsWith('image/');\n\n const fileSelectedClass = this.isSelected ? 'selected' : '';\n\n return (\n {\n if (this.isSelectable && !this.isFileHiding) {\n this.isSelected = !this.isSelected;\n this.attrs.onFileClick(this.file);\n }\n }}\n disabled={!this.isSelectable || this.isFileHiding}\n >\n {this.imageLoaded && isImage ? (\n \n ) : (\n this.displayIcon(this.fileIcon)\n )}\n\n
    {this.actionItems(this.file).toArray()}
    \n\n
    \n \n {this.file.baseName()}\n \n
    \n\n {this.isFileHiding && (\n
    \n \n
    \n )}\n \n );\n }\n\n displayIcon(fileIcon: string): Mithril.Children {\n return (\n \n {icon(`fa-fw ${fileIcon}`)}\n \n );\n }\n\n actionItems(file: File): ItemList {\n const items = new ItemList();\n\n file.canViewInfo() &&\n items.add(\n 'view-info',\n \n \n )}\n \n );\n }\n\n onDelete(file: File) {\n if (this.attrs.onDelete) {\n this.attrs.onDelete(file);\n }\n }\n\n // Common methods like onFileClick, isSelectable, hideFile...\n\n onFileClick(file: File) {\n // Custom functionality\n if (this.attrs.onFileSelect) {\n this.attrs.onFileSelect(file);\n return;\n }\n\n // Download on click\n if (this.attrs.downloadOnClick) {\n window.open(file.url());\n return;\n }\n }\n\n isSelectable(file: File) {\n const fileType = file.type();\n\n // Custom defined file types\n if (Array.isArray(this.restrictFileType)) {\n return this.restrictFileType.indexOf(fileType) >= 0;\n }\n\n // Image\n else if (this.restrictFileType === 'image') {\n return fileType.includes('image/');\n }\n\n // Audio\n else if (this.restrictFileType === 'audio') {\n return fileType.includes('audio/');\n }\n\n // Video\n else if (this.restrictFileType === 'video') {\n return fileType.includes('video/');\n }\n\n return false;\n }\n\n /**\n * Begins the hiding process for a file.\n *\n * - Shows a native confirmation dialog\n * - If confirmed, sends AJAX request to the hide file API\n */\n async hideFile(file: File) {\n const uuid = file.uuid();\n\n if (this.filesBeingHidden.includes(uuid)) return;\n\n this.filesBeingHidden.push(uuid);\n\n const transPrefix = file.isShared() ? 'fof-upload.lib.file_list.hide_shared_file' : 'fof-upload.lib.file_list.hide_file';\n\n const confirmToggleHide = confirm(\n extractText(\n app.translator.trans(file.hidden() ? `${transPrefix}.show_confirmation` : `${transPrefix}.hide_confirmation`, {\n fileName: file.baseName(),\n })\n )\n );\n\n if (confirmToggleHide) {\n try {\n const filePayload = await app.request({\n method: 'PATCH',\n url: `${app.forum.attribute('apiUrl')}/fof/upload/hide`,\n body: { uuid },\n });\n\n app.store.pushPayload(filePayload);\n m.redraw();\n\n app.alerts.show(Alert, { type: 'success' }, [\n icon(file.hidden() ? 'fas fa-eye-slash' : 'fas fa-eye'),\n ' ',\n app.translator.trans(file?.hidden() ? `${transPrefix}.hide_success` : `${transPrefix}.show_success`),\n ]);\n\n if (this.fileState.user) {\n const index = this.fileState.files.findIndex((file: File) => uuid === file.uuid());\n this.fileState.files.splice(index, 1);\n }\n } catch (error) {\n app.alerts.show(\n Alert,\n { type: 'error' },\n app.translator.trans(file?.hidden() ? `${transPrefix}.hide_fail` : `${transPrefix}.show_fail`, {\n fileName: file.baseName(),\n })\n );\n } finally {\n // Remove file from hiding list\n const i = this.filesBeingHidden.indexOf(uuid);\n this.filesBeingHidden.splice(i, 1);\n }\n }\n }\n}\n","import app from 'flarum/common/app';\nimport File from '../models/File';\nimport AbstractFileList from './AbstractFIleList';\nimport FileListState from '../states/FileListState';\n\nexport default class UserFileList extends AbstractFileList {\n public loadFileList(): void {\n //app.fileListState.setUser(this.attrs.user || app.session.user);\n this.fileState.setUser(this.attrs.user || app.session.user);\n /**\n * The user who's media we are dealing with\n */\n this.user = this.fileState.user; //app.fileListState.user;\n }\n\n hasMoreResults(): boolean {\n return this.fileState.hasMoreResults();\n }\n\n loadMore(): void {\n this.fileState.loadMore();\n }\n\n isLoading(): boolean {\n return this.fileState.isLoading();\n }\n\n fileCollection(): File[] {\n return this.fileState.files;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Switch'];","import app from 'flarum/common/app';\nimport Modal, { IInternalModalAttrs } from 'flarum/common/components/Modal';\nimport Switch from 'flarum/common/components/Switch';\nimport mimeToIcon from '../mimeToIcon';\nimport Button from 'flarum/common/components/Button';\nimport type Mithril from 'mithril';\nimport { ApiResponsePlural } from 'flarum/common/Store';\nimport File from '../models/File';\n\ninterface CustomAttrs extends IInternalModalAttrs {\n onUploadComplete: (files: File | File[]) => void;\n}\n\nexport default class UploadSharedFileModal extends Modal {\n files = [];\n fileInput = null;\n options = {\n shared: true,\n hidden: false,\n };\n loading: boolean = false;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n }\n\n className() {\n return 'UploadSharedFileModal Modal--medium';\n }\n\n title() {\n return app.translator.trans('fof-upload.lib.upload-shared-file-modal.title');\n }\n\n onFileChange(e) {\n this.addFiles(Array.from(e.target.files));\n }\n\n addFiles(newFiles: File[]) {\n (this.files as File[]).push(...newFiles);\n m.redraw();\n }\n\n onDragOver(e) {\n e.preventDefault();\n e.stopPropagation();\n }\n\n onDrop(e) {\n e.preventDefault();\n e.stopPropagation();\n if (e.dataTransfer && e.dataTransfer.files) {\n this.addFiles(Array.from(e.dataTransfer.files));\n }\n }\n\n onDropzoneClick() {\n if (this.fileInput) {\n this.fileInput.click();\n }\n }\n\n content() {\n return (\n
    \n this.onDropzoneClick()}\n ondragover={this.onDragOver.bind(this)}\n ondrop={this.onDrop.bind(this)}\n >\n {app.translator.trans('fof-upload.lib.upload-shared-file-modal.dropzone')}\n {\n this.fileInput = vnode.dom;\n }}\n />\n
    \n
    \n {this.files.map((file: File) => {\n const isImage = file.type.startsWith('image/');\n return (\n
    \n {isImage ? {file.name} : }\n
    {file.name}
    \n {/* Remove button */}\n {\n this.files = this.files.filter((f) => f !== file);\n }}\n />\n
    \n );\n })}\n
    \n
    \n (this.options.hidden = value)}>\n {app.translator.trans('fof-upload.lib.upload-shared-file-modal.hide-from-media-gallery')}\n \n
    \n
    \n \n {app.translator.trans('fof-upload.lib.upload-shared-file-modal.upload')}\n \n
    \n \n );\n }\n\n async upload() {\n this.loading = true;\n m.redraw();\n\n const formData = new FormData();\n\n // Append each file to the form data\n this.files.forEach((file) => {\n formData.append('files[]', file);\n });\n\n Object.keys(this.options).forEach((key) => {\n formData.append(`options[${key}]`, this.options[key]);\n });\n\n const results = await app.request>({\n method: 'POST',\n url: app.forum.attribute('apiUrl') + '/fof/upload',\n serialize: (raw: FormData) => raw, // Prevent mithril from trying to serialize FormData\n body: formData,\n });\n\n const uploadedFiles = app.store.pushPayload(results);\n\n this.attrs.onUploadComplete(uploadedFiles);\n this.files = [];\n this.hide();\n\n this.loading = false;\n m.redraw();\n }\n}\n","import app from 'flarum/common/app';\nimport File from '../models/File';\nimport AbstractFileList from './AbstractFIleList';\n\nexport default class SharedFileList extends AbstractFileList {\n public loadFileList(): void {\n this.fileState.loadResults();\n }\n\n hasMoreResults() {\n return this.fileState.hasMoreResults();\n }\n\n loadMore() {\n this.fileState.loadMore();\n }\n\n isLoading(): boolean {\n return this.fileState.isLoading();\n }\n\n fileCollection(): File[] {\n return this.fileState.files;\n }\n}\n","import app from 'flarum/common/app';\nimport User from 'flarum/common/models/User';\nimport File from '../models/File';\nimport { ApiQueryParamsPlural, ApiResponsePlural } from 'flarum/common/Store';\n\nexport default class FileListState {\n public user: User | null;\n public files: File[];\n private moreResults: boolean;\n private loading: boolean;\n private sharedFiles: boolean;\n\n constructor(sharedFiles: boolean = false) {\n this.user = null;\n this.files = [];\n this.moreResults = false;\n this.loading = false;\n this.sharedFiles = sharedFiles;\n }\n\n /**\n * Set the user and load their file list.\n * @param user The user whose files to load.\n */\n public setUser(user: User): void {\n if (user === this.user) return;\n\n this.user = user;\n this.files = [];\n this.loadResults();\n }\n\n public refresh(): void {\n this.files = [];\n this.loadResults();\n m.redraw();\n }\n\n /**\n * Load more files for the current user, starting from the given offset.\n * @param offset The starting index for loading more files.\n * @returns A promise resolving to the loaded files.\n */\n public async loadResults(offset: number = 0): Promise> {\n if (!this.sharedFiles && !this.user) return Promise.reject('User not set');\n\n this.loading = true;\n\n let route: string = 'fof/uploads';\n let params: ApiQueryParamsPlural = {};\n\n if (!this.sharedFiles && this.user) {\n params = {\n filter: { user: this.user.id() },\n page: { offset },\n } as ApiQueryParamsPlural;\n } else {\n route = 'fof/upload/shared-files';\n params = {\n page: { offset },\n } as ApiQueryParamsPlural;\n }\n\n const results = await app.store.find(route, params);\n\n return this.parseResults(results);\n }\n\n /**\n * Load the next set of results.\n */\n public async loadMore(): Promise> {\n this.loading = true;\n return this.loadResults(this.files.length);\n }\n\n private parseResults(results: ApiResponsePlural): ApiResponsePlural {\n this.files = this.files.concat(results);\n this.loading = false;\n this.moreResults = !!results.payload?.links?.next;\n m.redraw();\n return results;\n }\n\n /**\n * Add files to the beginning of the list.\n * @param files The files to be added.\n */\n public addToList(files: File | File[]): void {\n if (Array.isArray(files)) {\n this.files.unshift(...files);\n } else {\n this.files.unshift(files);\n }\n m.redraw();\n }\n\n /**\n * Remove files from the list.\n * @param files The files to be removed.\n */\n public removeFromList(files: File | File[]): void {\n if (Array.isArray(files)) {\n this.files = this.files.filter((file) => !files.includes(file));\n } else {\n this.files = this.files.filter((file) => file !== files);\n }\n\n m.redraw();\n }\n\n /**\n * Check if there are files in the list.\n * @returns True if there are files, false otherwise.\n */\n public hasFiles(): boolean {\n return this.files.length > 0;\n }\n\n /**\n * Check if the file list is currently loading.\n * @returns True if loading, false otherwise.\n */\n public isLoading(): boolean {\n return this.loading;\n }\n\n /**\n * Check if there are more files to load.\n * @returns True if there are more files, false otherwise.\n */\n public hasMoreResults(): boolean {\n return this.moreResults;\n }\n\n /**\n * Check if the user has no files and the list is not loading.\n * @returns True if the list is empty and not loading, false otherwise.\n */\n public empty(): boolean {\n return !this.hasFiles() && !this.isLoading();\n }\n}\n","import app from 'flarum/forum/app';\nimport Modal from 'flarum/common/components/Modal';\nimport Button from 'flarum/common/components/Button';\nimport UploadButton from './UploadButton';\nimport UserFileList from '../../common/components/UserFileList';\nimport DragAndDrop from './DragAndDrop';\nimport UploadSharedFileModal from '../../common/components/UploadSharedFileModal';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport SharedFileList from '../../common/components/SharedFileList';\nimport FileListState from '../../common/states/FileListState';\n\nexport default class FileManagerModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n // Initialize upload managers\n this.uploader = vnode.attrs.uploader;\n\n // Current selected files\n this.selectedFiles = [];\n\n // Allow multiselect\n this.multiSelect = vnode.attrs.multiSelect === undefined ? true : vnode.attrs.multiSelect;\n\n // Restrict file selection to specific types\n this.restrictFileType = vnode.attrs.restrictFileType || null;\n\n // Drag & drop\n this.dragDrop = null;\n\n this.selectedFilesLibrary = vnode.attrs.defaultFilesLibrary || 'user';\n\n this.sharedUploads = null;\n\n this.userFileState = new FileListState();\n this.sharedFileState = new FileListState(true);\n\n this.uploader.setState(this.userFileState);\n\n // Initialize uploads\n this.onUpload();\n }\n\n className() {\n return 'Modal--large fof-file-manager-modal';\n }\n\n /**\n * Initialize drag & drop\n */\n oncreate(vnode) {\n super.oncreate(vnode);\n\n this.dragDrop = new DragAndDrop((files) => this.uploader.upload(files, false), this.$().find('.Modal-content')[0]);\n }\n\n /**\n * Remove events from modal content\n */\n onremove() {\n if (this.dragDrop) {\n this.dragDrop.unload();\n }\n }\n\n view() {\n const fileCount = this.selectedFiles.length;\n const { hideUser, hideShared } = this.attrs;\n\n return (\n
    \n
    \n
    \n {!hideUser && this.selectedFilesLibrary === 'user' && (\n \n )}\n {app.session.user && app.session.user.uploadSharedFiles() && !hideShared && this.selectedFilesLibrary === 'shared' && (\n {\n this.showUploadModal();\n }}\n >\n {app.translator.trans('fof-upload.forum.buttons.upload')}\n \n )}\n
    \n\n
    \n
    \n \n\n {app.translator.trans('fof-upload.lib.file_list.release_to_upload')}\n
    \n
    \n\n
    \n

    {app.translator.trans('fof-upload.forum.media_manager')}

    \n {app.session.user?.accessSharedFiles() && !hideUser && !hideShared && (\n
    {this.fileLibraryButtonItems().toArray()}
    \n )}\n
    \n\n {this.alertAttrs && (\n
    \n \n
    \n )}\n\n
    \n {this.selectedFilesLibrary === 'user' && this.userFilesContent()}\n {this.selectedFilesLibrary === 'shared' && this.sharedFilesContent()}\n
    \n\n
    \n \n\n 1)}\n className=\"Button Button--primary\"\n >\n {app.translator.trans('fof-upload.lib.file_list.confirm_selection_btn', { fileCount })}\n \n
    \n
    \n
    \n );\n }\n\n fileLibraryButtonItems() {\n const items = new ItemList();\n\n items.add(\n 'user',\n \n );\n\n items.add(\n 'shared',\n \n );\n\n return items;\n }\n\n setLibrary(library) {\n this.selectedFilesLibrary = library;\n m.redraw();\n }\n\n userFilesContent() {\n return (\n \n );\n }\n\n sharedFilesContent() {\n return (\n \n );\n }\n\n /**\n * Add or remove file from selected files\n *\n * @param {File} file\n */\n onFileSelect(file) {\n const itemPosition = this.selectedFiles.indexOf(file.id());\n\n if (itemPosition >= 0) {\n this.selectedFiles.splice(itemPosition, 1);\n } else {\n if (this.multiSelect) {\n this.selectedFiles.push(file.id());\n } else {\n this.selectedFiles = [file.id()];\n }\n }\n }\n\n /**\n * Add files to file list after upload\n */\n onUpload() {\n this.uploader.on('success', ({ file }) => {\n if (this.multiSelect) {\n this.selectedFiles.push(file.id());\n } else {\n this.selectedFiles = [file.id()];\n }\n });\n }\n\n /**\n * Add selected files to the composer\n */\n onSelect() {\n this.hide();\n\n // Custom callback\n if (this.attrs.onSelect) {\n this.attrs.onSelect(this.selectedFiles);\n\n return;\n }\n\n // Add selected files to composer\n this.selectedFiles.map((fileId) => {\n const file = app.store.getById('files', fileId) || app.store.getById('shared-files', fileId);\n\n app.composer.editor.insertAtCursor(file.bbcode() + '\\n', false);\n });\n }\n\n showUploadModal() {\n app.modal.show(\n UploadSharedFileModal,\n {\n onUploadComplete: (files) => {\n this.sharedFileState.addToList(files);\n },\n },\n true\n );\n }\n\n onDelete(file) {\n this.sharedFileState.removeFromList(file);\n this.userFileState.removeFromList(file);\n }\n}\n","import app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport FileManagerModal from './FileManagerModal';\nimport Tooltip from 'flarum/common/components/Tooltip';\n\ninterface FileManagerButtonAttrs extends ComponentAttrs {\n uploader: any;\n}\n\nexport default class FileManagerButton extends Component {\n view() {\n return (\n \n {Button.component({\n className: 'Button fof-upload-button Button--icon',\n onclick: this.fileManagerButtonClicked.bind(this),\n icon: 'fas fa-photo-video',\n })}\n \n );\n }\n\n /**\n * Event handler for upload button being clicked\n */\n fileManagerButtonClicked(e: PointerEvent) {\n e.preventDefault();\n\n // Open dialog\n app.modal.show(FileManagerModal, {\n uploader: this.attrs.uploader,\n });\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/UserPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LinkButton'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extenders'];","import Model from 'flarum/common/Model';\n\nexport default class File extends Model {\n baseName() {\n return Model.attribute('baseName').call(this);\n }\n\n path() {\n return Model.attribute('path').call(this);\n }\n\n url() {\n return Model.attribute('url').call(this);\n }\n\n size() {\n return Model.attribute('size').call(this);\n }\n\n type() {\n return Model.attribute('type').call(this);\n }\n\n humanSize() {\n return Model.attribute('humanSize').call(this);\n }\n\n createdAt() {\n return Model.attribute('createdAt', Model.transformDate).call(this);\n }\n\n uuid() {\n return Model.attribute('uuid').call(this);\n }\n\n tag() {\n return Model.attribute('tag').call(this);\n }\n\n hidden() {\n return Model.attribute('hidden').call(this);\n }\n\n bbcode() {\n return Model.attribute('bbcode').call(this);\n }\n\n isShared() {\n return Model.attribute('shared').call(this);\n }\n\n isPrivateShared() {\n return Model.attribute('isPrivateShared').call(this);\n }\n\n canViewInfo() {\n return Model.attribute('canViewInfo').call(this);\n }\n\n canHide() {\n return Model.attribute('canHide').call(this);\n }\n\n canDelete() {\n return Model.attribute('canDelete').call(this);\n }\n\n apiEndpoint() {\n return '/fof/uploads' + (this.exists ? '/' + this.id() : '');\n }\n}\n","import Extend from 'flarum/common/extenders';\nimport File from './models/File';\n\nexport default [\n new Extend.Store() //\n .add('files', File)\n .add('shared-files', File),\n];\n","import app from 'flarum/forum/app';\nimport UserPage from 'flarum/forum/components/UserPage';\nimport UserFileList from '../../common/components/UserFileList';\nimport type Mithril from 'mithril';\nimport User from 'flarum/common/models/User';\nimport FileListState from '../../common/states/FileListState';\n\nimport type File from '../../common/models/File';\n\nexport default class UploadsUserPage extends UserPage {\n fileState!: FileListState;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.user = null;\n this.fileState = new FileListState();\n\n this.loadUser(m.route.param('username'));\n }\n\n content() {\n if (app.session.user && (app.session.user.viewOthersMediaLibrary() || this.user === app.session.user)) {\n return (\n this.user &&\n UserFileList.component({\n user: this.user,\n selectable: false,\n downloadOnClick: true,\n fileState: this.fileState,\n onDelete: this.onDelete.bind(this),\n })\n );\n } else {\n return null;\n }\n }\n\n onDelete(file: File) {\n this.fileState.removeFromList(file);\n }\n\n show(user: User) {\n super.show(user);\n this.user = user;\n }\n}\n","import User from 'flarum/common/models/User';\nimport { default as extend } from '../common/extend';\nimport Extend from 'flarum/common/extenders';\nimport UploadsUserPage from './components/UploadsUserPage';\n\nexport default [\n ...extend,\n\n // Not using the new extender yet, thinking about if to change the serialized names,\n // or the js property names, as we can't change the key->attribute name via the extender,\n // like we used to do with ie `User.prototype.viewOthersMediaLibrary = Model.attribute('fof-upload-viewOthersMediaLibrary');`\n // new Extend.Model(User) //\n // .attribute('fof-upload-viewOthersMediaLibrary')\n // .attribute('fof-upload-deleteOthersMediaLibrary')\n // .attribute('fof-upload-uploadCountCurrent')\n // .attribute('fof-upload-uploadCountAll'),\n\n new Extend.Routes() //\n .add('user.uploads', '/u/:username/uploads', UploadsUserPage),\n];\n","function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };","import Component, { ComponentAttrs } from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport type Mithril from 'mithril';\nimport mimeToIcon from '../mimeToIcon';\nimport File from '../models/File';\nimport icon from 'flarum/common/helpers/icon';\nimport app from 'flarum/common/app';\nimport classList from 'flarum/common/utils/classList';\n\ninterface CustomAttrs extends ComponentAttrs {\n file: File;\n selectable: boolean;\n fileClassNames: string;\n onDelete: (file: File) => void | undefined;\n onFileSelect: (file: File) => void | undefined;\n}\n\nexport default class UploadedFile extends Component {\n file!: File;\n callback!: () => void | undefined;\n imageLoaded: boolean = true;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.file = this.attrs.file;\n }\n\n view() {\n const isImage = this.file.type().startsWith('image/');\n const fileIcon = mimeToIcon(this.file.type());\n const errorIcon = 'fas fa-exclamation-triangle';\n const statusIcon = this.file.isPrivateShared() ? 'fas fa-lock' : 'fas fa-unlock';\n\n return (\n
    \n
    \n \n {icon(statusIcon)}\n {this.file.baseName()}\n \n
    \n
    this.onFileClick(this.file)}>\n {isImage ? (\n this.imageLoaded ? (\n \n ) : (\n icon(errorIcon, { className: 'icon-fallback' }) // Error icon for failed image load\n )\n ) : (\n icon(fileIcon, { className: 'icon-fallback' }) // Icon representing the file type\n )}\n
    \n
    {this.actionItems().toArray()}
    \n
    \n );\n }\n\n actionItems(): ItemList {\n const items = new ItemList();\n\n items.add(\n 'view-info',\n