From efb209ffcf9949452be8ba21368e52a4948c44b6 Mon Sep 17 00:00:00 2001 From: Eli Black Date: Fri, 20 Sep 2024 16:58:46 +0800 Subject: [PATCH] Release 1.3.0 --- js/.gitignore | 1 - js/dist/admin.js | 2 ++ js/dist/admin.js.map | 1 + js/dist/forum.js | 3 +++ js/dist/forum.js.LICENSE.txt | 1 + js/dist/forum.js.map | 1 + js/src/admin/index.js | 16 ++++++++-------- 7 files changed, 16 insertions(+), 9 deletions(-) create mode 100644 js/dist/admin.js create mode 100644 js/dist/admin.js.map create mode 100644 js/dist/forum.js create mode 100644 js/dist/forum.js.LICENSE.txt create mode 100644 js/dist/forum.js.map diff --git a/js/.gitignore b/js/.gitignore index 53c37a1..e69de29 100644 --- a/js/.gitignore +++ b/js/.gitignore @@ -1 +0,0 @@ -dist \ No newline at end of file diff --git a/js/dist/admin.js b/js/dist/admin.js new file mode 100644 index 0000000..a8095d6 --- /dev/null +++ b/js/dist/admin.js @@ -0,0 +1,2 @@ +(()=>{var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var s in r)e.o(r,s)&&!e.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:r[s]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};(()=>{"use strict";const t=flarum.core.compat["admin/app"];var r=e.n(t);r().initializers.add("neoncube-private-messages",(function(){r().extensionData.for("neoncube-private-messages").registerSetting({setting:"neoncube-private-messages.return_key",type:"bool",label:r().translator.trans("neoncube-private-messages.admin.settings.return_key")}).registerPermission({icon:"fas fa-user-lock",label:r().translator.trans("neoncube-private-messages.admin.permissions.start_label"),permission:"startConversation"},"start")}))})(),module.exports={}})(); +//# sourceMappingURL=admin.js.map \ No newline at end of file diff --git a/js/dist/admin.js.map b/js/dist/admin.js.map new file mode 100644 index 0000000..d343196 --- /dev/null +++ b/js/dist/admin.js.map @@ -0,0 +1 @@ +{"version":3,"file":"admin.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,I,mBCAlF,MAAM,EAA+BI,OAAOC,KAAKC,OAAO,a,aCExDC,IAAAA,aAAiBC,IAAI,6BAA6B,WAChDD,IAAAA,cAAiB,IACV,6BACJE,gBAAgB,CACfC,QAAS,uCACTC,KAAM,OACNC,MAAOL,IAAAA,WAAeM,MAAM,yDAE7BC,mBACC,CACEC,KAAM,mBACNH,MAAOL,IAAAA,WAAeM,MAAM,2DAC5BG,WAAY,qBAEd,QAUN,G","sources":["webpack://flarum-private-messages/webpack/bootstrap","webpack://flarum-private-messages/webpack/runtime/compat get default export","webpack://flarum-private-messages/webpack/runtime/define property getters","webpack://flarum-private-messages/webpack/runtime/hasOwnProperty shorthand","webpack://flarum-private-messages/external root \"flarum.core.compat['admin/app']\"","webpack://flarum-private-messages/./src/admin/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\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))","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","import app from 'flarum/admin/app';\r\n\r\napp.initializers.add('neoncube-private-messages', () => {\r\n app.extensionData\r\n .for('neoncube-private-messages')\r\n .registerSetting({\r\n setting: 'neoncube-private-messages.return_key',\r\n type: 'bool',\r\n label: app.translator.trans('neoncube-private-messages.admin.settings.return_key'),\r\n })\r\n .registerPermission(\r\n {\r\n icon: 'fas fa-user-lock',\r\n label: app.translator.trans('neoncube-private-messages.admin.permissions.start_label'),\r\n permission: 'startConversation',\r\n },\r\n 'start'\r\n )\r\n // .registerPermission(\r\n // {\r\n // icon: 'fas fa-user-lock',\r\n // label: app.translator.trans('neoncube-private-messages.admin.permissions.allow_users_to_receive_email_notifications'),\r\n // permission: 'neoncube-private-messages.allowUsersToReceiveEmailNotifications',\r\n // },\r\n // 'start'\r\n // );\r\n});\r\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","flarum","core","compat","app","add","registerSetting","setting","type","label","trans","registerPermission","icon","permission"],"sourceRoot":""} \ No newline at end of file diff --git a/js/dist/forum.js b/js/dist/forum.js new file mode 100644 index 0000000..71b1151 --- /dev/null +++ b/js/dist/forum.js @@ -0,0 +1,3 @@ +/*! For license information please see forum.js.LICENSE.txt */ +(()=>{var t={24:(t,e,n)=>{var r=n(735).default;function s(){"use strict";t.exports=s=function(){return n},t.exports.__esModule=!0,t.exports.default=t.exports;var e,n={},o=Object.prototype,a=o.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",l=c.asyncIterator||"@@asyncIterator",m=c.toStringTag||"@@toStringTag";function p(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{p({},"")}catch(e){p=function(t,e,n){return t[e]=n}}function h(t,e,n,r){var s=e&&e.prototype instanceof w?e:w,o=Object.create(s.prototype),a=new P(r||[]);return i(o,"_invoke",{value:_(t,n,a)}),o}function d(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}n.wrap=h;var f="suspendedStart",v="suspendedYield",g="executing",y="completed",b={};function w(){}function x(){}function N(){}var I={};p(I,u,(function(){return this}));var M=Object.getPrototypeOf,T=M&&M(M(E([])));T&&T!==o&&a.call(T,u)&&(I=T);var R=N.prototype=w.prototype=Object.create(I);function C(t){["next","throw","return"].forEach((function(e){p(t,e,(function(t){return this._invoke(e,t)}))}))}function L(t,e){function n(s,o,i,c){var u=d(t[s],t,o);if("throw"!==u.type){var l=u.arg,m=l.value;return m&&"object"==r(m)&&a.call(m,"__await")?e.resolve(m.__await).then((function(t){n("next",t,i,c)}),(function(t){n("throw",t,i,c)})):e.resolve(m).then((function(t){l.value=t,i(l)}),(function(t){return n("throw",t,i,c)}))}c(u.arg)}var s;i(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,s){n(t,r,e,s)}))}return s=s?s.then(o,o):o()}})}function _(t,n,r){var s=f;return function(o,a){if(s===g)throw Error("Generator is already running");if(s===y){if("throw"===o)throw a;return{value:e,done:!0}}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var c=k(i,r);if(c){if(c===b)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(s===f)throw s=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);s=g;var u=d(t,n,r);if("normal"===u.type){if(s=r.done?y:v,u.arg===b)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(s=y,r.method="throw",r.arg=u.arg)}}}function k(t,n){var r=n.method,s=t.iterator[r];if(s===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,k(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),b;var o=d(s,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,b;var a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,b):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,b)}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 S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function E(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var s=-1,o=function n(){for(;++s=0;--s){var o=this.tryEntries[s],i=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var c=a.call(o,"catchLoc"),u=a.call(o,"finallyLoc");if(c&&u){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),S(n),b}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var s=r.arg;S(n)}return s}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:E(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),b}},n}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports},735:t=>{function e(n){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(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},183:(t,e,n)=>{var r=n(24)();t.exports=r;try{regeneratorRuntime=r}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}},e={};function n(r){var s=e[r];if(void 0!==s)return s.exports;var o=e[r]={exports:{}};return t[r](o,o.exports,n),o.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";const t=flarum.core.compat["forum/app"];var e=n.n(t);const r=flarum.core.compat["common/extend"],s=flarum.core.compat["forum/components/IndexPage"];var o=n.n(s);const a=flarum.core.compat["forum/components/NotificationGrid"];var i=n.n(a);function c(t,e){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},c(t,e)}function u(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,c(t,e)}const l=flarum.core.compat["common/Model"];var p=n.n(l);const h=flarum.core.compat["common/utils/mixin"];var d=n.n(h),f=function(t){function e(){return t.apply(this,arguments)||this}return u(e,t),e.prototype.apiEndpoint=function(){return"/neoncube-private-messages/messages"+(this.exists?"/"+this.data.id:"")},e}(d()(p(),{message:p().attribute("message"),user:p().hasOne("user"),isHidden:p().attribute("isHidden"),createdAt:p().attribute("createdAt",p().transformDate),conversation:p().hasOne("conversation"),number:p().hasOne("number")})),v=function(t){function e(){return t.apply(this,arguments)||this}return u(e,t),e.prototype.apiEndpoint=function(){return"/neoncube-private-messages/conversations"+(this.exists?"/"+this.data.id:"")},e}(d()(p(),{messages:p().hasMany("messages"),recipients:p().hasMany("recipients"),totalMessages:p().attribute("totalMessages"),notNew:p().attribute("notNew"),createdAt:p().attribute("createdAt",p().transformDate),updatedAt:p().attribute("updatedAt",p().transformDate)})),g=function(t){function e(){return t.apply(this,arguments)||this}return u(e,t),e}(d()(p(),{conversation:p().hasOne("conversation"),user:p().hasOne("user"),userId:p().attribute("userId"),conversationId:p().attribute("conversationId"),lastRead:p().attribute("lastRead")}));const y=flarum.core.compat["common/models/User"];var b=n.n(y);const w=flarum.core.compat["common/components/Page"];var x=n.n(w);function N(t,e,n,r,s,o,a){try{var i=t[o](a),c=i.value}catch(t){return void n(t)}i.done?e(c):Promise.resolve(c).then(r,s)}var I=n(183),M=n.n(I);const T=flarum.core.compat["common/components/Button"];var R=n.n(T);const C=flarum.core.compat["common/components/Link"];var L=n.n(C);const _=flarum.core.compat["common/Component"];var k=n.n(_);const O=flarum.core.compat["common/helpers/avatar"];var S=n.n(O);const P=flarum.core.compat["common/helpers/username"];var E=n.n(P);const A=flarum.core.compat["common/helpers/humanTime"];var j=n.n(A);const D=flarum.core.compat["common/components/LoadingIndicator"];var U=n.n(D),B=function(t){function e(){return t.apply(this,arguments)||this}u(e,t),e.initAttrs=function(t){null!=t.className||(t.className=""),null!=t.content||(t.content=""),null!=t.preview||(t.preview=!1)};var n=e.prototype;return n.view=function(t){return m("div",{className:this.attrs.className})},n.oncreate=function(e){var n=this;if(t.prototype.oncreate.call(this,e),this.attrs.preview){var r,s=function(){var t=n.attrs.content;r!==t&&(r=t,s9e.TextFormatter.preview(t||"",e.dom))};s(),this.updateInterval=setInterval(s,50)}else s9e.TextFormatter.preview(this.attrs.content,e.dom)},n.onremove=function(){clearInterval(this.updateInterval)},e}(k());const H=flarum.core.compat["common/utils/Stream"];var q=n.n(H);const F=flarum.core.compat["common/utils/withAttr"];var G=n.n(F);const z=flarum.core.compat["common/helpers/icon"];var Y=n.n(z),K=function(t){function n(){return t.apply(this,arguments)||this}u(n,t);var r=n.prototype;return r.oninit=function(t){var n,r,s,o=this;this.newMessageCount=0,this.loading=!0,this.vnode=t,this.firstLoad=!0,this.typingTimeout=!0,this.isSending=!1,this.sendTimeout=!0,this.typing=!1,this.messageContent=q()(""),this.isNew=!0;var a=function(){o.typingTimeout=!0,setTimeout((function(){a()}),5e3)},i=function(){o.typingTime=0&&setTimeout((function(){o.sendTimeoutInterval()}),1e3)},a(),i(),null!=this.conversation||(this.conversation=t.attrs.conversation),this.conversation.recipients().map((function(t){parseInt(t.user().id())!==parseInt(e().session.user.id())?(o.user=t.user(),o.recipient=t):o.meRecipient=t})),null!=(n=e().cache).messages||(n.messages=[]),null!=(r=e().cache.messages)[s=this.conversation.id()]||(r[s]=[]),this.getMessages()},r.onremove=function(){e().pusher&&e().pusher.then((function(t){var e=t.channels.user;e.unbind("typing"),e.unbind("newMessage")}))},r.onupdate=function(){var t=this;$(".chat-history").scroll((function(){if(t.isNew&&0===$(".chat-history").scrollTop()){var n=$(".message-content:first");t.getMessages(e().cache.messages[t.conversation.id()].length),$(".chat-history").scrollTop(n.offset().top)}}))},r.oncreate=function(){var t=this;$(".chat-history").animate({scrollTop:$(".chat-history").prop("scrollHeight")},1e3),e().pusher&&e().pusher.then((function(e){var n=e.channels;n.user.bind("newMessage",(function(e){if(parseInt(e.conversationId)===parseInt(t.conversation.id())&&$(".MessagesDropdown").children(".Dropdown-menu").is(":visible")){var n={id:q()(e.id),message:q()(e.message),user:q()(t.user),createdAt:q()(e.createdAt)};t.decryptMessages([n]),t.newMessageCount++,t.typing=!1,m.redraw(),$(".chat-history").animate({scrollTop:$(".chat-history").prop("scrollHeight")},1e3)}})),n.user.bind("typing",(function(e){if(parseInt(e.conversationId)===parseInt(t.conversation.id())){var n=$(".chat-history"),r=n.scrollTop()+n.innerHeight()>=n[0].scrollHeight-50;t.typing=!0,t.typingTime=new Date,m.redraw(),r&&n.animate({scrollTop:$(".chat-history").prop("scrollHeight")},400)}})),n.user.bind("readMessage",(function(e){parseInt(e.conversationId)===parseInt(t.conversation.id())&&(t.recipient.lastRead=q()(e.number),m.redraw())}))}))},r.view=function(t){var n=this,r=e().cache.messages[this.conversation.id()];return m("div",{className:"chat"},m("div",{className:"chat-header"},S()(this.user),m("div",{className:"chat-about"},m("div",{className:"chat-with"},e().translator.trans("neoncube-private-messages.forum.chat.chat_with",{username:E()(this.user)})),m("div",{className:"chat-num-messages"},e().translator.trans("neoncube-private-messages.forum.chat.messages_"+(parseInt(this.conversation.totalMessages())>1?"multiple":"single"),{count:this.conversation.totalMessages()+this.newMessageCount})))),(null==r?void 0:r.length)>0&&!this.loading?[m("div",{className:"chat-history"},m("ul",null,this.isNew?"":m("li",{className:"startConvo"},e().translator.trans("neoncube-private-messages.forum.chat.start_of_conversation")),r?r.sort((function(t,e){return t.createdAt()-e.createdAt()})).map((function(t,r){var s=parseInt(t.user().id())===parseInt(e().session.user.id());return m("li",{className:"clearfix message-content"},m("div",{className:"message-data "+(s?"align-right":"")},m("div",{className:"avatar-inline "+(s?"me":"other")},S()(s?e().session.user:t.user())),m("span",{className:"message-data-name"},E()(s?e().session.user:t.user())),m("span",{className:"message-data-time"},j()(t.createdAt()))),m(B,{content:t.message(),className:"message "+(s?"my-message float-right":"other-message")}),s&&parseInt(n.recipient.lastRead())>=parseInt(t.data.attributes.number)?m("span",{className:"message-read"},Y()("fas fa-check")):"")})):"",this.messageContent()?m("li",null,m(B,{content:this.messageContent(),className:"message my-message float-right message-preview",preview:!0})):"",this.typing?m("li",null,m("div",{className:"tiblock"},m("div",{className:"tidot"}),m("div",{className:"tidot"}),m("div",{className:"tidot"}))):""))]:m(U(),{display:"block",size:"medium"}),m("form",{className:"chat-message clearfix"},m("textarea",{id:"MessageTextArea",value:this.messageContent(),oninput:G()("value",this.typingPush.bind(this)),placeholder:e().translator.trans("neoncube-private-messages.forum.chat.text_placeholder"),rows:"3",disabled:this.isSending&&!this.sendTimeout,onkeydown:function(t){13===t.keyCode&&e().forum.attribute("neoncubePrivateMessagesReturnKey")&&n.sendMessage()}}),m(R(),{onclick:this.sendMessage.bind(this),className:"Button Button--primary",disabled:!this.messageContent()||!this.sendTimeout},e().translator.trans("neoncube-private-messages.forum.chat.send"))))},r.typingPush=function(t){var n=this;this.messageContent(t),m.redraw(),this.typingTimeout&&e().request({method:"POST",url:e().forum.attribute("apiUrl")+"/neoncube-private-messages/messages/typing",body:{conversationId:this.conversation.id(),userId:this.user.id()}}).then((function(){n.typingTimeout=!1}))},r.sendMessage=function(){var t=this;this.sendTimeout&&""!==this.messageContent()&&this.messageContent().replace(/\s/g,"").length&&(this.isSending=!0,this.sendTimeout=!1,this.timer=1,this.sendTimeoutInterval(),this.newMessageCount++,e().store.createRecord("messages").save({messageContents:this.messageContent(),conversationId:this.conversation.id()}).then((function(n){e().cache.messages[t.conversation.id()].push(n),m.redraw(),t.messageContent(""),t.isSending=!1,$(".chat-history").animate({scrollTop:$(".chat-history").prop("scrollHeight")},500),e().request({method:"POST",url:e().forum.attribute("apiUrl")+"/neoncube-private-messages/messages/read",body:{conversationId:t.conversation.id(),messageId:n.id()}})})))},r.getMessages=function(t){var n=this;void 0===t&&(t=0),this.isNew&&e().store.find("neoncube-private-messages/messages",this.conversation.id(),{offset:t}).then((function(t){var r;if(delete t.payload,n.firstLoad){var s=n.meRecipient.lastRead();e().request({method:"POST",url:e().forum.attribute("apiUrl")+"/neoncube-private-messages/messages/read",body:{conversationId:n.conversation.id(),messageId:t[0].id()}}).then((function(t){var r=t.data.attributes.lastRead,o=e().session.user.unreadMessages(),a=0===o?0:o-(r-s);a>=0&&e().session.user.pushAttributes({unreadMessages:a}),n.firstLoad=!1,m.redraw()}))}(r=e().cache.messages[n.conversation.id()]).push.apply(r,t),t.length<20&&(n.isNew=!1),n.loading=!1,m.redraw()}))},n}(k());const J=flarum.core.compat["common/helpers/userOnline"];var Q=n.n(J),V=function(t){function e(){return t.apply(this,arguments)||this}return u(e,t),e.prototype.view=function(t){var e,n=t.attrs,r=n.conversation,s=n.typing,o=parseInt(app.session.user.id()),a=null==(e=r.recipients().find((function(t){return parseInt(t.user().id())!==o})))?void 0:e.user();return a?m("div",{className:"UserListItem-content"},S()(a),m("div",{className:"info"},E()(a),Q()(a)),s&&m("div",{className:"tiblock"},m("div",{className:"tidot"}))):"Unknown user"},e}(k()),W=function(t){function n(){return t.apply(this,arguments)||this}u(n,t);var r=n.prototype;return r.oninit=function(e){var n=this;this.conversation=e.attrs.conversation;var r=function(){n.typingTime=3;return null!=this.sources||(this.sources=this.sourceItems().toArray()),m("div",{className:"AddRecipientModal-body"},null===e().cache.conversationsRecipient?m("div",{className:"AddRecipientModal-form-input"},m("input",{className:ct()("RecipientsInput FormControl",{open:!!this.value(),focused:!!this.value(),active:!!this.value(),loading:!!this.loadingSources}),config:function(t){t.focus()},type:"search",placeholder:lt()(e().translator.trans("neoncube-private-messages.forum.modal.search_recipients")),value:this.value(),oninput:G()("value",this.value),onfocus:function(){return n.hasFocus=!0},onblur:function(){return n.hasFocus=!1},onkeyup:function(){clearTimeout(n.typingTimer),n.doSearch=!1,n.typingTimer=setTimeout((function(){n.doSearch=!0,m.redraw()}),900)},onkeydown:function(){clearTimeout(n.typingTimer)}}),m("ul",{className:ct()("Dropdown-menu Search-results fade",{in:!!r}),onclick:function(){var t=n.$(".SearchResult.active");n.addRecipient(t.data("index")),n.$(".RecipientsInput").trigger("focus")}},this.doSearch?this.sources.map((function(t){return t.view(n.value())})):m(U(),{size:"tiny",className:"Button Button--icon Button--link"}),m("li",null,m("span",null,e().translator.trans("neoncube-private-messages.forum.modal.more_users"))))):m("div",{className:"RecipientsInput-selected RecipientsLabel"},function(t,e){var n;void 0===e&&(e={}),null!=(n=e).style||(n.style={}),e.className="RecipientLabel "+(e.className||"");var r=pt()(e,"link");return m(r?"a":"span",e,m("span",{className:"RecipientLabel-text"},S()(t),E()(t)))}(e().cache.conversationsRecipient,{onclick:function(){n.removeRecipient(e().cache.conversationsRecipient)}})))},r.sourceItems=function(){var t=new(at());return t.add("users",new st),t},r.clear=function(){this.value(""),m.redraw()},r.addRecipient=function(t){e().cache.conversationsRecipient=e().store.getById("users",t),this.clear()},r.removeRecipient=function(t){e().cache.conversationsRecipient=null,m.redraw()},r.findRecipient=function(t,n){return e().store.getById(t,n)},n}(et()),dt=function(t){function n(){return t.apply(this,arguments)||this}u(n,t);var r=n.prototype;return r.oninit=function(n){t.prototype.oninit.call(this,n),e().cache.conversationsRecipient=null,this.conversations=this.attrs.conversations,this.already=!1,this.messageContent=q()("")},r.title=function(){return e().translator.trans("neoncube-private-messages.forum.modal.title")},r.className=function(){return"StartConversationModal Modal--medium"},r.content=function(){return[m("div",{className:"Modal-body",onclick:function(t){return t.stopImmediatePropagation()}},this.already?[m("h2",null,e().translator.trans("neoncube-private-messages.forum.modal.already",{username:E()(this.recpient)})),m("h2",null,e().translator.trans("neoncube-private-messages.forum.modal.copied",{username:E()(this.recpient)}))]:m("div",null,m("div",{class:"helpText"},null!==e().cache.conversationsRecipient?e().translator.trans("neoncube-private-messages.forum.modal.help_start",{username:E()(e().cache.conversationsRecipient)}):e().translator.trans("neoncube-private-messages.forum.modal.help")),m("div",{className:"AddRecipientModal-form"},m(ht,{state:e().search}),null!==e().cache.conversationsRecipient?m("div",{className:"AddRecipientModal-form-submit"},m("textarea",{value:this.messageContent(),oninput:G()("value",this.messageContent),placeholder:e().translator.trans("neoncube-private-messages.forum.chat.text_placeholder"),rows:"3"}),m(R(),{type:"submit",className:"Button Button--primary",disabled:!this.messageContent()},e().translator.trans("neoncube-private-messages.forum.modal.submit"))):"")))]},r.onsubmit=function(t){var n=this;t.preventDefault();var r=e().cache.conversationsRecipient;this.recpient=r,e().cache.conversationsRecipient=null,e().store.createRecord("conversations").save({messageContents:this.messageContent(),recipient:r.id()}).then((function(t){if(t.notNew()){var r=document.createElement("textarea");document.body.appendChild(r),r.value=n.messageContent(),r.focus(),r.select(),document.execCommand("Copy"),r.remove(),n.already=!0,m.redraw()}else n.conversations.push(t),m.redraw(),e().modal.close()}))},n}(Z()),ft=function(t){function n(){return t.apply(this,arguments)||this}u(n,t);var r=n.prototype;return r.oninit=function(n){var r,s=this;t.prototype.oninit.call(this,n),this.loading=!0,this.currentConversationId=n.attrs.currentConversationId,null!=(r=e().cache).conversations||(r.conversations=[]),e().store.find("neoncube-private-messages/conversations").then((function(t){delete t.payload,e().cache.conversations=t,s.loading=!1,m.redraw()}))},r.oncreate=function(e){var n=this;t.prototype.oncreate.call(this,e);var r=$(".ConversationsList-list");r.off("scroll").on("scroll",(function(){r.scrollTop()+r.innerHeight()>=r[0].scrollHeight&&n.loadMore()}))},r.view=function(t){var n=this,r=e().cache.conversations,s=null==r?void 0:r.find((function(t){return t.data.id===n.currentConversationId})),o=(null==r?void 0:r.length)>0;return m("div",{style:o?"":"width: unset; padding: 10px;",className:"ConversationsList"},m("div",{className:"people-list",id:"people-list"},m(R(),{onclick:function(){return n.showModal()},className:"Button Button--primary",disabled:!e().forum.attribute("canMessage")},e().forum.attribute("canMessage")?e().translator.trans("neoncube-private-messages.forum.chat.start"):e().translator.trans("neoncube-private-messages.forum.chat.cant_start")),o&&m("div",{className:"ConversationsList-list mobile"},r.map((function(t){return m(L(),{className:"UserListItem",href:e().route("messages",{id:t.data.id})},m(V,{conversation:t}))}))),o&&m("div",{className:"ConversationsList-list desktop"},r.map((function(t){return m(W,{conversation:t,active:s===t,onclick:function(e){return n.currentConversationId=t.data.id}})})))),s&&[m(K,{key:s.id(),conversation:s})])},r.showModal=function(){e().modal.show(dt,{conversations:e().cache.conversations,messages:e().cache.messages})},r.loadMore=function(){var t,n=(t=M().mark((function t(){var n=this;return M().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.loading=!0,e().store.find("neoncube-private-messages/conversations",{offset:e().cache.conversations.length}).then((function(t){delete t.payload,t.map((function(t){e().cache.conversations.push(t)})),n.loading=!1,m.redraw()}));case 2:case"end":return t.stop()}}),t,this)})),function(){var e=this,n=arguments;return new Promise((function(r,s){var o=t.apply(e,n);function a(t){N(o,r,s,a,i,"next",t)}function i(t){N(o,r,s,a,i,"throw",t)}a(void 0)}))});return function(){return n.apply(this,arguments)}}(),n}(k()),vt=function(t){function e(){return t.apply(this,arguments)||this}u(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.currentConversationId=m.route.param("id"),this.bodyClass="App--conversations"},n.view=function(t){return m("div",{className:null!=this.currentConversationId?"ConversationsPage viewing-conversation":"ConversationsPage"},m(ft,{currentConversationId:this.currentConversationId}))},e}(x());const gt=flarum.core.compat["forum/components/Notification"];var yt=function(t){function e(){return t.apply(this,arguments)||this}u(e,t);var n=e.prototype;return n.icon=function(){return"fas fa-message"},n.href=function(){var t=this.attrs.notification.subject();return app.route("messages",{id:t.data.attributes.conversationId})},n.content=function(){var t=this.attrs.notification.fromUser(),e=t&&t.data.attributes.displayName||app.translator.trans("core.lib.username.deleted_text");return app.translator.trans("neoncube-private-messages.forum.notifications.web.new_private_message.body",{fromUser:e})},e}(n.n(gt)());const bt=flarum.core.compat["forum/components/HeaderSecondary"];var wt=n.n(bt);const xt=flarum.core.compat["forum/components/NotificationsDropdown"];var Nt=function(t){function n(){return t.apply(this,arguments)||this}u(n,t),n.initAttrs=function(n){n.label||(n.label=e().translator.trans("neoncube-private-messages.forum.dropdown.tooltip")),n.icon||(n.icon="fas fa-comment-alt"),n.className="MessagesDropdown NotificationsDropdown",t.initAttrs.call(this,n)};var r=n.prototype;return r.onclick=function(){},r.getMenu=function(){return m("form",{className:"Dropdown-menu "+this.attrs.menuClassName},this.showing&&m(ft,null))},r.getUnreadCount=function(){return e().session.user.unreadMessages()},r.getNewCount=function(){return this.getUnreadCount()},n}(n.n(xt)());e().initializers.add("neoncube-private-messages",(function(t){t.store.models.messages=f,t.store.models.conversations=v,t.store.models.conversation_users=g,b().prototype.conversations=p().hasMany("conversations"),b().prototype.unreadMessages=p().attribute("unreadMessages"),t.notificationComponents.newPrivateMessage=yt,t.routes.conversations={path:"/conversations",component:vt},t.routes.messages={path:"/conversations/:id",component:vt},(0,r.extend)(wt().prototype,"items",(function(t){e().forum.attribute("canMessage")&&t.add("Messages",m(Nt,null),20)})),(0,r.extend)(o().prototype,"oncreate",(function(){t.pusher&&t.pusher.then((function(e){var n=e.channels;n.user&&n.user.bind("newMessage",(function(e){t.session.user.unreadMessages=q()(t.session.user.unreadMessages()+1),m.redraw()}))}))})),(0,r.extend)(o().prototype,"onremove",(function(){t.pusher&&t.pusher.then((function(t){var e=t.channels;e.user&&e.user.unbind("newMessage")}))})),(0,r.extend)(i().prototype,"notificationTypes",(function(e){t.forum.attribute("neoncubePrivateMessagesAllowUsersToReceiveEmailNotifications")&&e.add("newPrivateMessage",{name:"newPrivateMessage",icon:"fas fa-comment-alt",label:t.translator.trans("neoncube-private-messages.forum.notifications.new_private_message")})}))}))})(),module.exports={}})(); +//# sourceMappingURL=forum.js.map \ No newline at end of file diff --git a/js/dist/forum.js.LICENSE.txt b/js/dist/forum.js.LICENSE.txt new file mode 100644 index 0000000..ae386fb --- /dev/null +++ b/js/dist/forum.js.LICENSE.txt @@ -0,0 +1 @@ +/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ diff --git a/js/dist/forum.js.map b/js/dist/forum.js.map new file mode 100644 index 0000000..d7a7fbe --- /dev/null +++ b/js/dist/forum.js.map @@ -0,0 +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,OAAO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4B,qBAAqB,SAAC3E,GAClD5H,EAAIwM,MAAM3J,UAAU,iEAGzB+E,EAAME,IAAI,oBAAqB,CAC7BpP,KAAM,oBACNuJ,KAAM,qBACNmJ,MAAOpL,EAAIgF,WAAWvD,MAAM,sEAEhC,GACF","sources":["webpack://flarum-private-messages/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js","webpack://flarum-private-messages/./node_modules/@babel/runtime/helpers/typeof.js","webpack://flarum-private-messages/./node_modules/@babel/runtime/regenerator/index.js","webpack://flarum-private-messages/webpack/bootstrap","webpack://flarum-private-messages/webpack/runtime/compat get default export","webpack://flarum-private-messages/webpack/runtime/define property getters","webpack://flarum-private-messages/webpack/runtime/hasOwnProperty shorthand","webpack://flarum-private-messages/external root \"flarum.core.compat['forum/app']\"","webpack://flarum-private-messages/external root \"flarum.core.compat['common/extend']\"","webpack://flarum-private-messages/external root \"flarum.core.compat['forum/components/IndexPage']\"","webpack://flarum-private-messages/external root \"flarum.core.compat['forum/components/NotificationGrid']\"","webpack://flarum-private-messages/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://flarum-private-messages/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://flarum-private-messages/external root \"flarum.core.compat['common/Model']\"","webpack://flarum-private-messages/external root \"flarum.core.compat['common/utils/mixin']\"","webpack://flarum-private-messages/./src/forum/models/Message.js","webpack://flarum-private-messages/./src/forum/models/Conversation.js","webpack://flarum-private-messages/./src/forum/models/ConversationUser.js","webpack://flarum-private-messages/external root \"flarum.core.compat['common/models/User']\"","webpack://flarum-private-messages/external root \"flarum.core.compat['common/components/Page']\"","webpack://flarum-private-messages/./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js","webpack://flarum-private-messages/external root \"flarum.core.compat['common/components/Button']\"","webpack://flarum-private-messages/external root \"flarum.core.compat['common/components/Link']\"","webpack://flarum-private-messages/external root \"flarum.core.compat['common/Component']\"","webpack://flarum-private-messages/external root \"flarum.core.compat['common/helpers/avatar']\"","webpack://flarum-private-messages/external root \"flarum.core.compat['common/helpers/username']\"","webpack://flarum-private-messages/external root \"flarum.core.compat['common/helpers/humanTime']\"","webpack://flarum-private-messages/external root \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://flarum-private-messages/./src/forum/components/MessageText.js","webpack://flarum-private-messages/external root \"flarum.core.compat['common/utils/Stream']\"","webpack://flarum-private-messages/external root \"flarum.core.compat['common/utils/withAttr']\"","webpack://flarum-private-messages/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://flarum-private-messages/./src/forum/components/ConversationView.js","webpack://flarum-private-messages/external root \"flarum.core.compat['common/helpers/userOnline']\"","webpack://flarum-private-messages/./src/forum/components/UserListItemContent.js","webpack://flarum-private-messages/./src/forum/components/UserListItem.js","webpack://flarum-private-messages/external root \"flarum.core.compat['common/components/Modal']\"","webpack://flarum-private-messages/external root \"flarum.core.compat['forum/components/Search']\"","webpack://flarum-private-messages/external root \"flarum.core.compat['common/helpers/highlight']\"","webpack://flarum-private-messages/./src/forum/components/UserSearchSource.js","webpack://flarum-private-messages/external root \"flarum.core.compat['common/utils/ItemList']\"","webpack://flarum-private-messages/external root \"flarum.core.compat['common/utils/classList']\"","webpack://flarum-private-messages/external root \"flarum.core.compat['common/utils/extractText']\"","webpack://flarum-private-messages/external root \"flarum.core.compat['common/utils/extract']\"","webpack://flarum-private-messages/./src/forum/components/RecipientSearch.js","webpack://flarum-private-messages/./src/forum/components/recipientLabel.js","webpack://flarum-private-messages/./src/forum/components/StartConversationModal.js","webpack://flarum-private-messages/./src/forum/components/ConversationsList.js","webpack://flarum-private-messages/./src/forum/components/ConversationsPage.js","webpack://flarum-private-messages/external root \"flarum.core.compat['forum/components/Notification']\"","webpack://flarum-private-messages/./src/forum/components/NewPrivateMessageNotification.js","webpack://flarum-private-messages/external root \"flarum.core.compat['forum/components/HeaderSecondary']\"","webpack://flarum-private-messages/external root \"flarum.core.compat['forum/components/NotificationsDropdown']\"","webpack://flarum-private-messages/./src/forum/components/ConversationsDropdown.js","webpack://flarum-private-messages/./src/forum/index.js","webpack://flarum-private-messages/./src/forum/addConversationsDropdown.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))","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/IndexPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/NotificationGrid'];","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/Model'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/mixin'];","import Model from 'flarum/common/Model';\nimport mixin from 'flarum/common/utils/mixin';\n\nexport default class Message extends mixin(Model, {\n message: Model.attribute('message'),\n user: Model.hasOne('user'),\n isHidden: Model.attribute('isHidden'),\n createdAt: Model.attribute('createdAt', Model.transformDate),\n conversation: Model.hasOne('conversation'),\n number: Model.hasOne('number'),\n}) {\n apiEndpoint() {\n return `/neoncube-private-messages/messages${this.exists ? `/${this.data.id}` : ''}`;\n }\n}\n","import Model from 'flarum/common/Model';\nimport mixin from 'flarum/common/utils/mixin';\n\nexport default class Conversation extends mixin(Model, {\n messages: Model.hasMany('messages'),\n recipients: Model.hasMany('recipients'),\n totalMessages: Model.attribute('totalMessages'),\n notNew: Model.attribute('notNew'),\n createdAt: Model.attribute('createdAt', Model.transformDate),\n updatedAt: Model.attribute('updatedAt', Model.transformDate),\n}) {\n apiEndpoint() {\n return `/neoncube-private-messages/conversations${this.exists ? `/${this.data.id}` : ''}`;\n }\n}\n","import Model from 'flarum/common/Model';\nimport mixin from 'flarum/common/utils/mixin';\n\nexport default class ConversationUser extends mixin(Model, {\n conversation: Model.hasOne('conversation'),\n user: Model.hasOne('user'),\n\n userId: Model.attribute('userId'),\n conversationId: Model.attribute('conversationId'),\n lastRead: Model.attribute('lastRead'),\n}) {}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/User'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Page'];","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/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Link'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/avatar'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/username'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/humanTime'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","import Component from 'flarum/common/Component';\n\nexport default class MessageText extends Component {\n static initAttrs(attrs) {\n attrs.className ??= '';\n attrs.content ??= '';\n attrs.preview ??= false;\n }\n\n view(vnode) {\n return
;\n }\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n if (this.attrs.preview) {\n let preview;\n const updatePreview = () => {\n const content = this.attrs.content;\n\n if (preview === content) return;\n\n preview = content;\n\n s9e.TextFormatter.preview(content || '', vnode.dom);\n };\n updatePreview();\n\n this.updateInterval = setInterval(updatePreview, 50);\n } else {\n s9e.TextFormatter.preview(this.attrs.content, vnode.dom);\n }\n }\n\n onremove() {\n clearInterval(this.updateInterval);\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/withAttr'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","import Component from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport avatar from 'flarum/common/helpers/avatar';\nimport username from 'flarum/common/helpers/username';\nimport humanTime from 'flarum/common/helpers/humanTime';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport MessageText from './MessageText';\nimport Stream from 'flarum/common/utils/Stream';\nimport withAttr from 'flarum/common/utils/withAttr';\nimport icon from 'flarum/common/helpers/icon';\nimport app from 'flarum/forum/app';\n\nexport default class ConversationView extends Component {\n oninit(vnode) {\n this.newMessageCount = 0;\n this.loading = true;\n this.vnode = vnode;\n this.firstLoad = true;\n this.typingTimeout = true;\n this.isSending = false;\n this.sendTimeout = true;\n this.typing = false;\n this.messageContent = Stream('');\n this.isNew = true;\n\n const typingTimeoutInterval = () => {\n this.typingTimeout = true;\n setTimeout(() => {\n typingTimeoutInterval();\n }, 5000);\n };\n\n const typingInterval = () => {\n if (this.typingTime < new Date(Date.now() - 6000)) {\n this.typing = false;\n m.redraw();\n }\n setTimeout(() => {\n typingInterval();\n }, 6000);\n };\n\n this.sendTimeoutInterval = () => {\n if (this.timer === 0) {\n this.sendTimeout = true;\n m.redraw();\n return;\n }\n this.timer--;\n if (this.timer >= 0) {\n setTimeout(() => {\n this.sendTimeoutInterval();\n }, 1000);\n }\n };\n\n typingTimeoutInterval();\n typingInterval();\n\n this.conversation ??= vnode.attrs.conversation;\n\n this.conversation.recipients().map((recipient) => {\n if (parseInt(recipient.user().id()) !== parseInt(app.session.user.id())) {\n this.user = recipient.user();\n this.recipient = recipient;\n } else {\n this.meRecipient = recipient;\n }\n });\n app.cache.messages ??= [];\n app.cache.messages[this.conversation.id()] ??= [];\n\n this.getMessages();\n }\n\n onremove() {\n if (app.pusher) {\n app.pusher.then((object) => {\n const user = object.channels.user;\n user.unbind('typing');\n user.unbind('newMessage');\n });\n }\n }\n\n onupdate() {\n $('.chat-history').scroll(() => {\n if (this.isNew) {\n const pos = $('.chat-history').scrollTop();\n if (pos === 0) {\n const firstMsg = $('.message-content:first');\n this.getMessages(app.cache.messages[this.conversation.id()].length);\n\n $('.chat-history').scrollTop(firstMsg.offset().top);\n }\n }\n });\n }\n\n oncreate() {\n $('.chat-history').animate({ scrollTop: $('.chat-history').prop('scrollHeight') }, 1000);\n\n if (app.pusher) {\n app.pusher.then((object) => {\n const channels = object.channels;\n channels.user.bind('newMessage', (data) => {\n if (\n parseInt(data.conversationId) === parseInt(this.conversation.id()) &&\n $('.MessagesDropdown').children('.Dropdown-menu').is(':visible')\n ) {\n const message = {\n id: Stream(data.id),\n message: Stream(data.message),\n user: Stream(this.user),\n createdAt: Stream(data.createdAt),\n };\n this.decryptMessages([message]);\n this.newMessageCount++;\n this.typing = false;\n m.redraw();\n $('.chat-history').animate({ scrollTop: $('.chat-history').prop('scrollHeight') }, 1000);\n }\n });\n\n channels.user.bind('typing', (data) => {\n if (parseInt(data.conversationId) === parseInt(this.conversation.id())) {\n const list = $('.chat-history');\n\n const scrollMore = list.scrollTop() + list.innerHeight() >= list[0].scrollHeight - 50;\n\n this.typing = true;\n this.typingTime = new Date();\n m.redraw();\n\n if (scrollMore) {\n list.animate({ scrollTop: $('.chat-history').prop('scrollHeight') }, 400);\n }\n }\n });\n\n channels.user.bind('readMessage', (data) => {\n if (parseInt(data.conversationId) === parseInt(this.conversation.id())) {\n this.recipient.lastRead = Stream(data.number);\n m.redraw();\n }\n });\n });\n }\n }\n\n view(vnode) {\n const messages = app.cache.messages[this.conversation.id()];\n\n return (\n
\n
\n {avatar(this.user)}\n\n
\n
\n {app.translator.trans('neoncube-private-messages.forum.chat.chat_with', { username: username(this.user) })}\n
\n
\n {app.translator.trans(\n 'neoncube-private-messages.forum.chat.messages_' + (parseInt(this.conversation.totalMessages()) > 1 ? 'multiple' : 'single'),\n { count: this.conversation.totalMessages() + this.newMessageCount }\n )}\n
\n
\n
\n\n {messages?.length > 0 && !this.loading ? (\n [\n
\n
    \n {!this.isNew ? (\n
  • {app.translator.trans('neoncube-private-messages.forum.chat.start_of_conversation')}
  • \n ) : (\n ''\n )}\n {messages\n ? messages\n // .filter((message, index, self) => index === self.findIndex(t => t.message() === message.message()))\n .sort((a, b) => a.createdAt() - b.createdAt())\n .map((message, i) => {\n const myMessage = parseInt(message.user().id()) === parseInt(app.session.user.id());\n return (\n
  • \n
    \n
    \n {avatar(myMessage ? app.session.user : message.user())}\n
    \n {username(myMessage ? app.session.user : message.user())}\n {humanTime(message.createdAt())}\n
    \n \n {myMessage ? (\n parseInt(this.recipient.lastRead()) >= parseInt(message.data.attributes.number) ? (\n {icon('fas fa-check')}\n ) : (\n ''\n )\n ) : (\n ''\n )}\n
  • \n );\n })\n : ''}\n {this.messageContent() ? (\n
  • \n \n
  • \n ) : (\n ''\n )}\n {this.typing ? (\n
  • \n
    \n
    \n
    \n
    \n
    \n
  • \n ) : (\n ''\n )}\n
\n
,\n ]\n ) : (\n \n )}\n\n
\n {\n if (e.keyCode === 13 && app.forum.attribute('neoncubePrivateMessagesReturnKey')) {\n this.sendMessage();\n }\n }} />\n\n \n \n
\n );\n }\n\n typingPush(value) {\n this.messageContent(value);\n m.redraw();\n if (this.typingTimeout) {\n app\n .request({\n method: 'POST',\n url: app.forum.attribute('apiUrl') + '/neoncube-private-messages/messages/typing',\n body: {\n conversationId: this.conversation.id(),\n userId: this.user.id(),\n },\n })\n .then(() => {\n this.typingTimeout = false;\n });\n }\n }\n\n sendMessage() {\n if (!this.sendTimeout || this.messageContent() === '' || !this.messageContent().replace(/\\s/g, '').length) return;\n\n this.isSending = true;\n this.sendTimeout = false;\n this.timer = 1;\n this.sendTimeoutInterval();\n this.newMessageCount++;\n\n app.store\n .createRecord('messages')\n .save({\n messageContents: this.messageContent(),\n conversationId: this.conversation.id(),\n })\n .then((message) => {\n app.cache.messages[this.conversation.id()].push(message);\n m.redraw();\n this.messageContent('');\n this.isSending = false;\n $('.chat-history').animate({ scrollTop: $('.chat-history').prop('scrollHeight') }, 500);\n\n // TODO: Can this be done when the message is created?\n app.request({\n method: 'POST',\n url: app.forum.attribute('apiUrl') + '/neoncube-private-messages/messages/read',\n body: {\n conversationId: this.conversation.id(),\n messageId: message.id(),\n },\n });\n });\n }\n\n getMessages(offset = 0) {\n if (!this.isNew) return;\n\n app.store\n .find('neoncube-private-messages/messages', this.conversation.id(), { offset })\n .then((results) => {\n delete results.payload;\n\n if (this.firstLoad) {\n const oldNumber = this.meRecipient.lastRead();\n app\n .request({\n method: 'POST',\n url: app.forum.attribute('apiUrl') + '/neoncube-private-messages/messages/read',\n body: {\n conversationId: this.conversation.id(),\n messageId: results[0].id(),\n },\n })\n .then((response) => {\n const newNumber = response.data.attributes.lastRead;\n const lastUnreadMessage = app.session.user.unreadMessages();\n\n const unreadMessages = lastUnreadMessage === 0 ? 0 : lastUnreadMessage - (newNumber - oldNumber);\n\n if (unreadMessages >= 0) {\n app.session.user.pushAttributes({\n unreadMessages,\n });\n }\n\n this.firstLoad = false;\n\n m.redraw();\n });\n }\n\n app.cache.messages[this.conversation.id()].push(...results);\n\n if (results.length < 20) {\n this.isNew = false;\n }\n\n this.loading = false;\n m.redraw();\n });\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/userOnline'];","import Component from 'flarum/common/Component';\nimport avatar from 'flarum/common/helpers/avatar';\nimport username from 'flarum/common/helpers/username';\nimport userOnline from 'flarum/common/helpers/userOnline';\n\nexport default class UserListItemContent extends Component {\n view(vnode) {\n const {\n conversation,\n typing\n } = vnode.attrs;\n\n const userId = parseInt(app.session.user.id());\n\n const user = conversation\n .recipients()\n .find((recipient) => parseInt(recipient.user().id()) !== userId)\n ?.user();\n\n if (!user)\n return 'Unknown user';\n\n return (\n
\n {avatar(user)}\n\n
\n {username(user)}\n {userOnline(user)}\n
\n\n {\n typing &&\n
\n
\n
\n }\n
\n );\n }\n}\n","import Component from 'flarum/common/Component';\nimport app from 'flarum/forum/app';\nimport UserListItemContent from './UserListItemContent';\n\nexport default class UserListItem extends Component {\n oninit(vnode) {\n this.conversation = vnode.attrs.conversation;\n\n const typingInterval = () => {\n if (this.typingTime < new Date(Date.now() - 6000)) {\n this.typing = false;\n m.redraw();\n }\n setTimeout(() => {\n typingInterval();\n }, 6000);\n };\n\n typingInterval();\n\n super.oncreate(vnode);\n }\n\n onremove(vnode) {\n if (app.pusher) {\n app.pusher.then((object) => {\n object.channels.user.unbind('typing');\n });\n }\n\n super.onremove(vnode);\n }\n\n oncreate(vnode) {\n if (app.pusher) {\n app.pusher.then((object) => {\n const channels = object.channels;\n channels.user.bind('typing', (data) => {\n if (parseInt(data.conversationId) === parseInt(this.conversation.id())) {\n this.typing = true;\n this.typingTime = new Date();\n m.redraw();\n }\n });\n });\n }\n\n super.oncreate(vnode);\n }\n\n view(vnode) {\n return (\n
\n \n
\n );\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/Search'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/highlight'];","import highlight from 'flarum/common/helpers/highlight';\nimport avatar from 'flarum/common/helpers/avatar';\nimport username from 'flarum/common/helpers/username';\n\nexport default class UserSearchSource {\n view(query) {\n if (query.length < 3 || this.loading) return;\n\n app.cache.conversationResults ??= [];\n\n this.query = query;\n\n if (!app.cache.conversationResults[this.query]) {\n this.loading = true;\n\n app.cache.conversationResults[this.query] = [];\n app.store\n .find('users', {\n filter: { q: this.query },\n page: { limit: 5 },\n })\n .then(this.pushResults.bind(this));\n } else\n return [\n
  • {app.translator.trans('core.forum.search.users_heading')}
  • ,\n app.cache.conversationResults[this.query].map((user) => {\n let name = username(user);\n name = highlight(name.text, this.query);\n\n return (\n
  • \n \n {avatar(user)}\n {name}\n \n
  • \n );\n }),\n ];\n }\n\n pushResults(results) {\n results.payload.data.map((result) => {\n const user = app.store.getById('users', result.id);\n if (parseInt(user.id()) !== parseInt(app.session.user.id())) {\n app.cache.conversationResults[this.query].push(user);\n }\n });\n this.loading = false;\n m.redraw();\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/classList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/extractText'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/extract'];","import Search from 'flarum/forum/components/Search';\nimport UserSearchSource from './UserSearchSource';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport classList from 'flarum/common/utils/classList';\nimport extractText from 'flarum/common/utils/extractText';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport recipientLabel from './recipientLabel';\nimport Stream from 'flarum/common/utils/Stream';\nimport withAttr from 'flarum/common/utils/withAttr';\nimport app from 'flarum/forum/app';\n\nexport default class RecipientSearch extends Search {\n oninit(vnode) {\n this.value = Stream();\n super.oninit(vnode);\n }\n\n updateMaxHeight() {\n // stub\n }\n\n view(vnode) {\n if (this.value == null) {\n this.value('');\n }\n\n const loading = this.value() && this.value().length >= 3;\n\n this.sources ??= this.sourceItems().toArray();\n\n return (\n
    \n {app.cache.conversationsRecipient === null ? (\n
    \n (this.hasFocus = true)}\n onblur={() => (this.hasFocus = false)}\n onkeyup={() => {\n clearTimeout(this.typingTimer);\n this.doSearch = false;\n this.typingTimer = setTimeout(() => {\n this.doSearch = true;\n m.redraw();\n }, 900);\n }}\n onkeydown={() => {\n clearTimeout(this.typingTimer);\n }}\n />\n {\n const target = this.$('.SearchResult.active');\n\n this.addRecipient(target.data('index'));\n this.$('.RecipientsInput').trigger('focus');\n }}\n >\n {!this.doSearch\n ? \n : this.sources.map((source) => source.view(this.value()))}\n
  • \n {app.translator.trans('neoncube-private-messages.forum.modal.more_users')}\n
  • \n \n
    \n ) : (\n
    \n {recipientLabel(app.cache.conversationsRecipient, {\n onclick: () => {\n this.removeRecipient(app.cache.conversationsRecipient);\n },\n })}\n
    \n )}\n
    \n );\n }\n\n /**\n * Build an item list of SearchSources.\n *\n * @return {ItemList}\n */\n sourceItems() {\n const items = new ItemList();\n\n items.add('users', new UserSearchSource());\n\n return items;\n }\n\n /**\n * Clear the search input and the current controller's active search.\n */\n clear() {\n this.value('');\n\n m.redraw();\n }\n\n /**\n * Adds a recipient.\n *\n * @param value\n */\n addRecipient(value) {\n app.cache.conversationsRecipient = app.store.getById('users', value);\n\n this.clear();\n }\n\n /**\n * Removes a recipient.\n *\n * @param recipient\n */\n removeRecipient(recipient) {\n app.cache.conversationsRecipient = null;\n\n m.redraw();\n }\n\n /**\n * Loads a recipient from the global store.\n *\n * @param store\n * @param id\n * @returns {Model}\n */\n findRecipient(store, id) {\n return app.store.getById(store, id);\n }\n}\n","import extract from 'flarum/common/utils/extract';\nimport avatar from 'flarum/common/helpers/avatar';\nimport username from 'flarum/common/helpers/username';\n\nexport default function recipientLabel(recipient, attrs = {}) {\n attrs.style ??= {};\n attrs.className = 'RecipientLabel ' + (attrs.className || '');\n\n const link = extract(attrs, 'link');\n\n return m(\n link ? 'a' : 'span',\n attrs,\n \n {avatar(recipient)}\n {username(recipient)}\n \n );\n}\n","import Modal from 'flarum/common/components/Modal';\nimport Button from 'flarum/common/components/Button';\nimport RecipientSearch from './RecipientSearch';\nimport username from 'flarum/common/helpers/username';\nimport Stream from 'flarum/common/utils/Stream';\nimport withAttr from 'flarum/common/utils/withAttr';\nimport app from 'flarum/forum/app';\n\nexport default class StartConversationModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n app.cache.conversationsRecipient = null;\n\n this.conversations = this.attrs.conversations;\n\n this.already = false;\n\n this.messageContent = Stream('');\n }\n\n title() {\n return app.translator.trans('neoncube-private-messages.forum.modal.title');\n }\n\n className() {\n return 'StartConversationModal Modal--medium';\n }\n\n content() {\n return [\n
    e.stopImmediatePropagation()}>\n {this.already ? (\n [\n

    {app.translator.trans('neoncube-private-messages.forum.modal.already', { username: username(this.recpient) })}

    ,\n

    {app.translator.trans('neoncube-private-messages.forum.modal.copied', { username: username(this.recpient) })}

    ,\n ]\n ) : (\n
    \n
    \n {app.cache.conversationsRecipient !== null\n ? app.translator.trans('neoncube-private-messages.forum.modal.help_start', { username: username(app.cache.conversationsRecipient) })\n : app.translator.trans('neoncube-private-messages.forum.modal.help')}\n
    \n
    \n \n {app.cache.conversationsRecipient !== null ? (\n
    \n \n \n
    \n ) : (\n ''\n )}\n
    \n
    \n )}\n
    ,\n ];\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n const recipient = app.cache.conversationsRecipient;\n this.recpient = recipient;\n app.cache.conversationsRecipient = null;\n\n app.store\n .createRecord('conversations')\n .save({\n messageContents: this.messageContent(),\n recipient: recipient.id(),\n })\n .then((conversation) => {\n if (!conversation.notNew()) {\n this.conversations.push(conversation);\n\n // const preconv = app.session.user.conversations();\n // preconv.push(conversation);\n // app.session.user.conversations = Stream(preconv);\n\n // Need to review Github diff after this point\n m.redraw();\n app.modal.close();\n } else {\n let input = document.createElement('textarea');\n document.body.appendChild(input);\n input.value = this.messageContent();\n input.focus();\n input.select();\n document.execCommand('Copy');\n input.remove();\n this.already = true;\n m.redraw();\n }\n });\n }\n}\n","import app from 'flarum/forum/app';\nimport Button from 'flarum/common/components/Button';\nimport Link from 'flarum/common/components/Link';\nimport Component from 'flarum/common/Component';\nimport ConversationView from './ConversationView';\nimport UserListItem from './UserListItem';\nimport StartConversationModal from './StartConversationModal';\nimport UserListItemContent from './UserListItemContent';\n\nexport default class ConversationsList extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.loading = true;\n this.currentConversationId = vnode.attrs.currentConversationId;\n\n app.cache.conversations ??= [];\n\n app.store\n .find('neoncube-private-messages/conversations')\n .then((results) => {\n delete results.payload;\n app.cache.conversations = results;\n\n this.loading = false;\n\n m.redraw()\n })\n }\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n const list = $('.ConversationsList-list');\n\n list.off('scroll').on('scroll', () => {\n if (list.scrollTop() + list.innerHeight() >= list[0].scrollHeight) {\n this.loadMore();\n }\n });\n }\n\n view(vnode) {\n const conversations = app.cache.conversations;\n\n const currentConversation = conversations?.find(conversation => conversation.data.id === this.currentConversationId);\n\n // This used to use app.session.user.conversations(). Not sure this makes sense, or if it makes sense to reload when opening the conversations dropdown?\n const hasConversations = conversations?.length > 0;\n\n return (\n
    \n
    \n \n {\n hasConversations &&\n
    \n {\n conversations.map(conversation => {\n return (\n \n \n \n );\n })\n }\n
    \n }\n\n {\n hasConversations &&\n
    \n {\n conversations.map(conversation => {\n return (\n this.currentConversationId = conversation.data.id}\n />\n );\n })\n }\n
    \n }\n
    \n\n {\n currentConversation &&\n []\n }\n
    \n );\n }\n\n showModal() {\n app.modal.show(StartConversationModal, {\n conversations: app.cache.conversations,\n messages: app.cache.messages,\n });\n }\n\n async loadMore() {\n this.loading = true;\n\n app.store\n .find('neoncube-private-messages/conversations', { offset: app.cache.conversations.length })\n .then((results) => {\n delete results.payload;\n results.map((result) => {\n app.cache.conversations.push(result);\n });\n\n this.loading = false;\n\n m.redraw();\n });\n }\n}\n","import Page from 'flarum/common/components/Page';\n\nimport ConversationsList from './ConversationsList';\n\nexport default class ConversationsPage extends Page {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.currentConversationId = m.route.param('id');\n\n this.bodyClass = 'App--conversations';\n }\n\n view(vnode) {\n return (\n
    \n \n
    \n );\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/Notification'];","import Notification from 'flarum/forum/components/Notification';\n\nexport default class NewPrivateMessageNotification extends Notification {\n icon() {\n return 'fas fa-message';\n }\n\n href() {\n const notification = this.attrs.notification;\n\n const message = notification.subject();\n\n return app.route('messages', { id: message.data.attributes.conversationId }/*, message.number*/);\n }\n\n content() {\n const fromUser = this.attrs.notification.fromUser();\n\n // // From https://github.com/flarum/framework/blob/main/framework/core/js/src/common/helpers/username.tsx#L9\n // // The Flarum username() function expects displayName() to be a function, and it outputs a , which I don't think is what we want.\n const username = (fromUser && fromUser.data.attributes.displayName) || app.translator.trans('core.lib.username.deleted_text');\n\n return app.translator.trans('neoncube-private-messages.forum.notifications.web.new_private_message.body', { 'fromUser': username });\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/HeaderSecondary'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/NotificationsDropdown'];","import app from 'flarum/forum/app';\nimport NotificationsDropdown from 'flarum/forum/components/NotificationsDropdown';\nimport ConversationsList from './ConversationsList';\n\nexport default class ConversationsDropdown extends NotificationsDropdown {\n static initAttrs(attrs) {\n attrs.label ||= app.translator.trans('neoncube-private-messages.forum.dropdown.tooltip');\n attrs.icon ||= 'fas fa-comment-alt';\n attrs.className = 'MessagesDropdown NotificationsDropdown';\n\n super.initAttrs(attrs);\n }\n\n onclick() {\n }\n\n getMenu() {\n return
    {this.showing && };\n }\n\n getUnreadCount() {\n return app.session.user.unreadMessages();\n }\n\n getNewCount() {\n return this.getUnreadCount();\n }\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport NotificationGrid from 'flarum/forum/components/NotificationGrid';\nimport Message from './models/Message';\nimport Conversation from './models/Conversation';\nimport ConversationUser from './models/ConversationUser';\nimport User from 'flarum/common/models/User';\nimport Model from 'flarum/common/Model';\nimport ConversationsPage from './components/ConversationsPage';\nimport NewPrivateMessageNotification from './components/NewPrivateMessageNotification';\nimport Stream from 'flarum/common/utils/Stream';\nimport addConversationsDropdown from './addConversationsDropdown';\n\napp.initializers.add('neoncube-private-messages', (app) => {\n app.store.models.messages = Message;\n app.store.models.conversations = Conversation;\n app.store.models.conversation_users = ConversationUser;\n\n User.prototype.conversations = Model.hasMany('conversations');\n User.prototype.unreadMessages = Model.attribute('unreadMessages');\n\n app.notificationComponents.newPrivateMessage = NewPrivateMessageNotification;\n\n app.routes.conversations = { path: '/conversations', component: ConversationsPage };\n app.routes.messages = { path: '/conversations/:id', component: ConversationsPage };\n\n addConversationsDropdown();\n\n extend(IndexPage.prototype, 'oncreate', () => {\n if (app.pusher) {\n app.pusher.then((object) => {\n const channels = object.channels;\n if (channels.user) {\n channels.user.bind('newMessage', (data) => {\n app.session.user.unreadMessages = Stream(app.session.user.unreadMessages() + 1);\n m.redraw();\n });\n }\n });\n }\n });\n\n extend(IndexPage.prototype, 'onremove', () => {\n if (app.pusher) {\n app.pusher.then((object) => {\n const channels = object.channels;\n if (channels.user) {\n channels.user.unbind('newMessage');\n }\n });\n }\n });\n\n extend(NotificationGrid.prototype, 'notificationTypes', (items) => {\n if (!app.forum.attribute('neoncubePrivateMessagesAllowUsersToReceiveEmailNotifications'))\n return;\n\n items.add('newPrivateMessage', {\n name: 'newPrivateMessage',\n icon: 'fas fa-comment-alt',\n label: app.translator.trans('neoncube-private-messages.forum.notifications.new_private_message'),\n });\n });\n});\n","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport HeaderSecondary from 'flarum/forum/components/HeaderSecondary';\nimport ConversationsDropdown from './components/ConversationsDropdown';\n\nexport default function () {\n extend(HeaderSecondary.prototype, 'items', function (items) {\n // TODO: It used to be that the conversations icon was also shown if the user had any conversations, but I've commented this out,\n // because it wasn't working, at least for me.\n // I think a better approach would be to load a count of how many conversations a user has, instead of actually loading all conversations\n // whenever loading a user.\n if (app.forum.attribute('canMessage') /* || (app.session.user && app.session.user.conversations().length)*/) {\n items.add('Messages', , 20);\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","Message","_mixin","apply","arguments","apiEndpoint","exists","data","id","mixin","Model","message","user","isHidden","createdAt","conversation","number","Conversation","messages","recipients","totalMessages","notNew","updatedAt","ConversationUser","userId","conversationId","lastRead","asyncGeneratorStep","MessageText","_Component","initAttrs","attrs","className","content","preview","_proto","view","vnode","m","oncreate","_this","updatePreview","s9e","TextFormatter","dom","updateInterval","setInterval","onremove","clearInterval","Component","ConversationView","oninit","_app$cache","_app$cache$messages2","_this$conversation$id","newMessageCount","loading","firstLoad","typingTimeout","isSending","sendTimeout","typing","messageContent","Stream","isNew","typingTimeoutInterval","setTimeout","typingInterval","typingTime","Date","now","redraw","sendTimeoutInterval","timer","map","recipient","parseInt","app","meRecipient","getMessages","object","channels","unbind","onupdate","_this2","$","scroll","scrollTop","firstMsg","offset","top","_this3","animate","children","is","decryptMessages","list","scrollMore","innerHeight","scrollHeight","_this4","avatar","trans","username","count","sort","b","myMessage","humanTime","attributes","icon","LoadingIndicator","display","size","oninput","withAttr","typingPush","placeholder","rows","disabled","onkeydown","keyCode","attribute","sendMessage","Button","onclick","_this5","url","body","_this6","replace","createRecord","save","messageContents","messageId","_this7","find","results","_app$cache$messages$_","payload","oldNumber","response","newNumber","lastUnreadMessage","unreadMessages","pushAttributes","UserListItemContent","_conversation$recipie","_vnode$attrs","session","userOnline","UserListItem","active","UserSearchSource","query","cache","conversationResults","translator","highlight","text","store","filter","q","page","limit","pushResults","result","getById","RecipientSearch","_Search","updateMaxHeight","sources","sourceItems","toArray","conversationsRecipient","classList","open","focused","loadingSources","config","element","focus","extractText","onfocus","hasFocus","onblur","onkeyup","clearTimeout","typingTimer","doSearch","in","target","addRecipient","trigger","source","_attrs","style","link","extract","recipientLabel","removeRecipient","items","ItemList","add","clear","findRecipient","Search","StartConversationModal","_Modal","conversations","already","title","stopImmediatePropagation","recpient","class","state","onsubmit","preventDefault","input","document","createElement","appendChild","select","execCommand","remove","close","Modal","ConversationsList","currentConversationId","off","on","loadMore","currentConversation","hasConversations","showModal","Link","href","show","_loadMore","_callee","_context","_next","_throw","ConversationsPage","_Page","route","param","bodyClass","Page","NewPrivateMessageNotification","_Notification","notification","subject","fromUser","Notification","ConversationsDropdown","_NotificationsDropdow","label","getMenu","menuClassName","showing","getUnreadCount","getNewCount","NotificationsDropdown","models","conversation_users","User","notificationComponents","newPrivateMessage","routes","path","component","extend","HeaderSecondary","IndexPage","pusher","NotificationGrid","forum"],"sourceRoot":""} \ No newline at end of file diff --git a/js/src/admin/index.js b/js/src/admin/index.js index 3ba6e51..d4a1306 100644 --- a/js/src/admin/index.js +++ b/js/src/admin/index.js @@ -16,12 +16,12 @@ app.initializers.add('neoncube-private-messages', () => { }, 'start' ) - .registerPermission( - { - icon: 'fas fa-user-lock', - label: app.translator.trans('neoncube-private-messages.admin.permissions.allow_users_to_receive_email_notifications'), - permission: 'neoncube-private-messages.allowUsersToReceiveEmailNotifications', - }, - 'start' - ); + // .registerPermission( + // { + // icon: 'fas fa-user-lock', + // label: app.translator.trans('neoncube-private-messages.admin.permissions.allow_users_to_receive_email_notifications'), + // permission: 'neoncube-private-messages.allowUsersToReceiveEmailNotifications', + // }, + // 'start' + // ); });