From da7403c5486ec1e192d8408059812f17783c5e38 Mon Sep 17 00:00:00 2001 From: Eli Black Date: Sun, 15 Sep 2024 14:25:16 +0800 Subject: [PATCH] Committing JS dist build --- 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 + 6 files changed, 8 insertions(+), 1 deletion(-) 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..9806720 --- /dev/null +++ b/js/dist/forum.js @@ -0,0 +1,3 @@ +/*! For license information please see forum.js.LICENSE.txt */ +(()=>{var e={24:(e,t,n)=>{var r=n(735).default;function s(){"use strict";e.exports=s=function(){return n},e.exports.__esModule=!0,e.exports.default=e.exports;var t,n={},o=Object.prototype,a=o.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",l=c.asyncIterator||"@@asyncIterator",m=c.toStringTag||"@@toStringTag";function p(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{p({},"")}catch(t){p=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var s=t&&t.prototype instanceof w?t:w,o=Object.create(s.prototype),a=new A(r||[]);return i(o,"_invoke",{value:L(e,n,a)}),o}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}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(e){["next","throw","return"].forEach((function(t){p(e,t,(function(e){return this._invoke(t,e)}))}))}function _(e,t){function n(s,o,i,c){var u=d(e[s],e,o);if("throw"!==u.type){var l=u.arg,m=l.value;return m&&"object"==r(m)&&a.call(m,"__await")?t.resolve(m.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(m).then((function(e){l.value=e,i(l)}),(function(e){return n("throw",e,i,c)}))}c(u.arg)}var s;i(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,s){n(e,r,t,s)}))}return s=s?s.then(o,o):o()}})}function L(e,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:t,done:!0}}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var c=O(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(e,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 O(e,n){var r=n.method,s=e.iterator[r];if(s===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,O(e,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,e.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[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,b):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,b)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function E(e){if(e||""===e){var n=e[u];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.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;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),S(n),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var s=r.arg;S(n)}return s}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:E(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),b}},n}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports},735:e=>{function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},183:(e,t,n)=>{var r=n(24)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}},t={};function n(r){var s=t[r];if(void 0!==s)return s.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=flarum.core.compat["forum/app"];var t=n.n(e);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(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}function u(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,c(e,t)}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(e){function t(){return e.apply(this,arguments)||this}return u(t,e),t.prototype.apiEndpoint=function(){return"/neoncube-private-messages/messages"+(this.exists?"/"+this.data.id:"")},t}(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(e){function t(){return e.apply(this,arguments)||this}return u(t,e),t.prototype.apiEndpoint=function(){return"/neoncube-private-messages/conversations"+(this.exists?"/"+this.data.id:"")},t}(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(e){function t(){return e.apply(this,arguments)||this}return u(t,e),t}(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(e,t,n,r,s,o,a){try{var i=e[o](a),c=i.value}catch(e){return void n(e)}i.done?t(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/Component"];var _=n.n(C);const L=flarum.core.compat["common/helpers/avatar"];var O=n.n(L);const k=flarum.core.compat["common/helpers/username"];var S=n.n(k);const A=flarum.core.compat["common/helpers/humanTime"];var E=n.n(A);const P=flarum.core.compat["common/components/LoadingIndicator"];var j=n.n(P),D=function(e){function t(){return e.apply(this,arguments)||this}u(t,e),t.initAttrs=function(e){null!=e.className||(e.className=""),null!=e.content||(e.content=""),null!=e.preview||(e.preview=!1)};var n=t.prototype;return n.view=function(e){return m("div",{className:this.attrs.className})},n.oncreate=function(t){var n=this;if(e.prototype.oncreate.call(this,t),this.attrs.preview){var r,s=function(){var e=n.attrs.content;r!==e&&(r=e,s9e.TextFormatter.preview(e||"",t.dom))};s(),this.updateInterval=setInterval(s,50)}else s9e.TextFormatter.preview(this.attrs.content,t.dom)},n.onremove=function(){clearInterval(this.updateInterval)},t}(_());const B=flarum.core.compat["common/utils/Stream"];var H=n.n(B);const U=flarum.core.compat["common/utils/withAttr"];var q=n.n(U);const F=flarum.core.compat["common/helpers/icon"];var G=n.n(F),z=function(e){function n(){return e.apply(this,arguments)||this}u(n,e);var r=n.prototype;return r.oninit=function(e){var n,r,s,o=this;this.newMessageCount=0,this.loading=!0,this.vnode=e,this.firstLoad=!0,this.typingTimeout=!0,this.isSending=!1,this.sendTimeout=!0,this.typing=!1,this.messageContent=H()(""),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=e.attrs.conversation),this.conversation.recipients().map((function(e){parseInt(e.user().id())!==parseInt(t().session.user.id())?(o.user=e.user(),o.recipient=e):o.meRecipient=e})),null!=(n=t().cache).messages||(n.messages=[]),null!=(r=t().cache.messages)[s=this.conversation.id()]||(r[s]=[]),this.getMessages()},r.onremove=function(){t().pusher&&t().pusher.then((function(e){var t=e.channels.user;t.unbind("typing"),t.unbind("newMessage")}))},r.onupdate=function(){var e=this;$(".chat-history").scroll((function(){if(e.isNew&&0===$(".chat-history").scrollTop()){var n=$(".message-content:first");e.getMessages(t().cache.messages[e.conversation.id()].length),$(".chat-history").scrollTop(n.offset().top)}}))},r.oncreate=function(){var e=this;$(".chat-history").animate({scrollTop:$(".chat-history").prop("scrollHeight")},1e3),t().pusher&&t().pusher.then((function(t){var n=t.channels;n.user.bind("newMessage",(function(t){if(parseInt(t.conversationId)===parseInt(e.conversation.id())&&$(".MessagesDropdown").children(".Dropdown-menu").is(":visible")){var n={id:H()(t.id),message:H()(t.message),user:H()(e.user),createdAt:H()(t.createdAt)};e.decryptMessages([n]),e.newMessageCount++,e.typing=!1,m.redraw(),$(".chat-history").animate({scrollTop:$(".chat-history").prop("scrollHeight")},1e3)}})),n.user.bind("typing",(function(t){if(parseInt(t.conversationId)===parseInt(e.conversation.id())){var n=$(".chat-history"),r=n.scrollTop()+n.innerHeight()>=n[0].scrollHeight-50;e.typing=!0,e.typingTime=new Date,m.redraw(),r&&n.animate({scrollTop:$(".chat-history").prop("scrollHeight")},400)}})),n.user.bind("readMessage",(function(t){parseInt(t.conversationId)===parseInt(e.conversation.id())&&(e.recipient.lastRead=H()(t.number),m.redraw())}))}))},r.view=function(e){var n=this,r=t().cache.messages[this.conversation.id()];return m("div",{className:"chat"},m("div",{className:"chat-header clearfix"},O()(this.user),m("div",{className:"chat-about"},m("div",{className:"chat-with"},t().translator.trans("neoncube-private-messages.forum.chat.chat_with",{username:S()(this.user)})),m("div",{className:"chat-num-messages"},t().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"},t().translator.trans("neoncube-private-messages.forum.chat.start_of_conversation")),r?r.sort((function(e,t){return e.createdAt()-t.createdAt()})).map((function(e,r){var s=parseInt(e.user().id())===parseInt(t().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")},O()(s?t().session.user:e.user())),m("span",{className:"message-data-name"},S()(s?t().session.user:e.user())),m("span",{className:"message-data-time"},E()(e.createdAt()))),m(D,{content:e.message(),className:"message "+(s?"my-message float-right":"other-message")}),s&&parseInt(n.recipient.lastRead())>=parseInt(e.data.attributes.number)?m("span",{className:"message-read"},G()("fas fa-check")):"")})):"",this.messageContent()?m("li",null,m(D,{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(j(),{display:"block",size:"medium"}),m("form",{className:"chat-message clearfix"},m("textarea",{id:"MessageTextArea",value:this.messageContent(),oninput:q()("value",this.typingPush.bind(this)),placeholder:t().translator.trans("neoncube-private-messages.forum.chat.text_placeholder"),rows:"3",disabled:this.isSending&&!this.sendTimeout,onkeydown:function(e){13===e.keyCode&&t().forum.attribute("neoncubePrivateMessagesReturnKey")&&n.sendMessage()}}),m(R(),{onclick:this.sendMessage.bind(this),className:"Button Button--primary",disabled:!this.messageContent()||!this.sendTimeout},t().translator.trans("neoncube-private-messages.forum.chat.send"))))},r.typingPush=function(e){var n=this;this.messageContent(e),m.redraw(),this.typingTimeout&&t().request({method:"POST",url:t().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 e=this;this.sendTimeout&&""!==this.messageContent()&&this.messageContent().replace(/\s/g,"").length&&(this.isSending=!0,this.sendTimeout=!1,this.timer=1,this.sendTimeoutInterval(),this.newMessageCount++,t().store.createRecord("messages").save({messageContents:this.messageContent(),conversationId:this.conversation.id()}).then((function(n){t().cache.messages[e.conversation.id()].push(n),m.redraw(),e.messageContent(""),e.isSending=!1,$(".chat-history").animate({scrollTop:$(".chat-history").prop("scrollHeight")},500),t().request({method:"POST",url:t().forum.attribute("apiUrl")+"/neoncube-private-messages/messages/read",body:{conversationId:e.conversation.id(),messageId:n.id()}})})))},r.getMessages=function(e){var n=this;void 0===e&&(e=0),this.isNew&&t().store.find("neoncube-private-messages/messages",this.conversation.id(),{offset:e}).then((function(e){var r;if(delete e.payload,n.firstLoad){var s=n.meRecipient.lastRead();t().request({method:"POST",url:t().forum.attribute("apiUrl")+"/neoncube-private-messages/messages/read",body:{conversationId:n.conversation.id(),messageId:e[0].id()}}).then((function(e){var r=e.data.attributes.lastRead,o=t().session.user.unreadMessages(),a=0===o?0:o-(r-s);a>=0&&t().session.user.pushAttributes({unreadMessages:a}),n.firstLoad=!1,m.redraw()}))}(r=t().cache.messages[n.conversation.id()]).push.apply(r,e),e.length<20&&(n.isNew=!1),n.loading=!1,m.redraw()}))},n}(_());const Y=flarum.core.compat["common/helpers/userOnline"];var K=n.n(Y),J=function(e){function n(){return e.apply(this,arguments)||this}u(n,e);var r=n.prototype;return r.oninit=function(n){var r,s=this;this.conversation=n.attrs.conversation,this.user=null;var o=parseInt(t().session.user.id());this.user=null==(r=this.conversation.recipients().find((function(e){return parseInt(e.user().id())!==o})))?void 0:r.user(),m.redraw();var a=function(){s.typingTime=3;return null!=this.sources||(this.sources=this.sourceItems().toArray()),m("div",{className:"AddRecipientModal-body"},null===t().cache.conversationsRecipient?m("div",{className:"AddRecipientModal-form-input"},m("input",{className:oe()("RecipientsInput FormControl",{open:!!this.value(),focused:!!this.value(),active:!!this.value(),loading:!!this.loadingSources}),config:function(e){e.focus()},type:"search",placeholder:ie()(t().translator.trans("neoncube-private-messages.forum.modal.search_recipients")),value:this.value(),oninput:q()("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:oe()("Dropdown-menu Search-results fade",{in:!!r}),onclick:function(){var e=n.$(".SearchResult.active");n.addRecipient(e.data("index")),n.$(".RecipientsInput").trigger("focus")}},this.doSearch?this.sources.map((function(e){return e.view(n.value())})):m(j(),{size:"tiny",className:"Button Button--icon Button--link"}),m("li",null,m("span",null,t().translator.trans("neoncube-private-messages.forum.modal.more_users"))))):m("div",{className:"RecipientsInput-selected RecipientsLabel"},function(e,t){var n;void 0===t&&(t={}),null!=(n=t).style||(n.style={}),t.className="RecipientLabel "+(t.className||"");var r=ue()(t,"link");return m(r?"a":"span",t,m("span",{className:"RecipientLabel-text"},O()(e),S()(e)))}(t().cache.conversationsRecipient,{onclick:function(){n.removeRecipient(t().cache.conversationsRecipient)}})))},r.sourceItems=function(){var e=new(re());return e.add("users",new te),e},r.clear=function(){this.value(""),m.redraw()},r.addRecipient=function(e){t().cache.conversationsRecipient=t().store.getById("users",e),this.clear()},r.removeRecipient=function(e){t().cache.conversationsRecipient=null,m.redraw()},r.findRecipient=function(e,n){return t().store.getById(e,n)},n}(X()),me=function(e){function n(){return e.apply(this,arguments)||this}u(n,e);var r=n.prototype;return r.oninit=function(n){e.prototype.oninit.call(this,n),t().cache.conversationsRecipient=null,this.conversations=this.attrs.conversations,this.already=!1,this.messageContent=H()("")},r.title=function(){return t().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(e){return e.stopImmediatePropagation()}},this.already?[m("h2",null,t().translator.trans("neoncube-private-messages.forum.modal.already",{username:S()(this.recpient)})),m("h2",null,t().translator.trans("neoncube-private-messages.forum.modal.copied",{username:S()(this.recpient)}))]:m("div",null,m("div",{class:"helpText"},null!==t().cache.conversationsRecipient?t().translator.trans("neoncube-private-messages.forum.modal.help_start",{username:S()(t().cache.conversationsRecipient)}):t().translator.trans("neoncube-private-messages.forum.modal.help")),m("div",{className:"AddRecipientModal-form"},m(le,{state:t().search}),null!==t().cache.conversationsRecipient?m("div",{className:"AddRecipientModal-form-submit"},m("textarea",{value:this.messageContent(),oninput:q()("value",this.messageContent),placeholder:t().translator.trans("neoncube-private-messages.forum.chat.text_placeholder"),rows:"3"}),m(R(),{type:"submit",className:"Button Button--primary",disabled:!this.messageContent()},t().translator.trans("neoncube-private-messages.forum.modal.submit"))):"")))]},r.onsubmit=function(e){var n=this;e.preventDefault();var r=t().cache.conversationsRecipient;this.recpient=r,t().cache.conversationsRecipient=null,t().store.createRecord("conversations").save({messageContents:this.messageContent(),recipient:r.id()}).then((function(e){if(e.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(e),m.redraw(),t().modal.close()}))},n}(V()),pe=function(e){function n(){return e.apply(this,arguments)||this}u(n,e);var r=n.prototype;return r.oninit=function(n){var r,s=this;e.prototype.oninit.call(this,n),this.loading=!0,this.currentConversationId=n.attrs.currentConversationId,null!=(r=t().cache).conversations||(r.conversations=[]),t().store.find("neoncube-private-messages/conversations").then((function(e){delete e.payload,t().cache.conversations=e,s.loading=!1,m.redraw()}))},r.oncreate=function(t){var n=this;e.prototype.oncreate.call(this,t);var r=$(".ConversationsList-list");r.off("scroll").on("scroll",(function(){r.scrollTop()+r.innerHeight()>=r[0].scrollHeight&&n.loadMore()}))},r.view=function(e){var n=this,r=t().cache.conversations,s=null==r?void 0:r.find((function(e){return e.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:!t().forum.attribute("canMessage")},t().forum.attribute("canMessage")?t().translator.trans("neoncube-private-messages.forum.chat.start"):t().translator.trans("neoncube-private-messages.forum.chat.cant_start")),o&&m("ul",{className:"ConversationsList-list"},Array.isArray(r)&&r.map((function(e){return m(J,{conversation:e,active:s===e,onclick:function(t){n.currentConversationId=e.data.id}})})))),s&&[m(z,{key:s.id(),conversation:s})])},r.showModal=function(){t().modal.show(me,{conversations:t().cache.conversations,messages:t().cache.messages})},r.loadMore=function(){var e,n=(e=M().mark((function e(){var n=this;return M().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.loading=!0,t().store.find("neoncube-private-messages/conversations",{offset:t().cache.conversations.length}).then((function(e){delete e.payload,e.map((function(e){t().cache.conversations.push(e)})),n.loading=!1,m.redraw()}));case 2:case"end":return e.stop()}}),e,this)})),function(){var t=this,n=arguments;return new Promise((function(r,s){var o=e.apply(t,n);function a(e){N(o,r,s,a,i,"next",e)}function i(e){N(o,r,s,a,i,"throw",e)}a(void 0)}))});return function(){return n.apply(this,arguments)}}(),n}(_()),he=function(e){function t(){return e.apply(this,arguments)||this}u(t,e);var n=t.prototype;return n.oninit=function(t){e.prototype.oninit.call(this,t),this.currentConversationId=m.route.param("id"),this.bodyClass="App--conversations"},n.view=function(e){return m("div",{className:"ConversationsPage"},m(pe,{currentConversationId:this.currentConversationId}))},t}(x());const de=flarum.core.compat["forum/components/Notification"];var fe=function(e){function t(){return e.apply(this,arguments)||this}u(t,e);var n=t.prototype;return n.icon=function(){return"fas fa-message"},n.href=function(){var e=this.attrs.notification.subject();return app.route("messages",{id:e.data.attributes.conversationId})},n.content=function(){var e=this.attrs.notification.fromUser(),t=e&&e.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:t})},t}(n.n(de)());const ve=flarum.core.compat["forum/components/HeaderSecondary"];var ge=n.n(ve);const ye=flarum.core.compat["forum/components/NotificationsDropdown"];var be=function(e){function n(){return e.apply(this,arguments)||this}u(n,e),n.initAttrs=function(n){n.label||(n.label=t().translator.trans("neoncube-private-messages.forum.dropdown.tooltip")),n.icon||(n.icon="fas fa-comment-alt"),n.className="MessagesDropdown NotificationsDropdown",e.initAttrs.call(this,n)};var r=n.prototype;return r.onclick=function(){t().drawer.isOpen()&&this.goToRoute()},r.getMenu=function(){return m("form",{className:"Dropdown-menu "+this.attrs.menuClassName},this.showing&&m(pe,null))},r.goToRoute=function(){window.location.assign(t().route("conversations"))},r.getUnreadCount=function(){return t().session.user.unreadMessages()},r.getNewCount=function(){return this.getUnreadCount()},n}(n.n(ye)());t().initializers.add("neoncube-private-messages",(function(e){e.store.models.messages=f,e.store.models.conversations=v,e.store.models.conversation_users=g,b().prototype.conversations=p().hasMany("conversations"),b().prototype.unreadMessages=p().attribute("unreadMessages"),e.notificationComponents.newPrivateMessage=fe,e.routes.conversations={path:"/conversations",component:he},e.routes.messages={path:"/conversations/:id",component:he},(0,r.extend)(ge().prototype,"items",(function(e){t().forum.attribute("canMessage")&&e.add("Messages",m(be,null),20)})),(0,r.extend)(o().prototype,"oncreate",(function(){e.pusher&&e.pusher.then((function(t){var n=t.channels;n.user&&n.user.bind("newMessage",(function(t){e.session.user.unreadMessages=H()(e.session.user.unreadMessages()+1),m.redraw()}))}))})),(0,r.extend)(o().prototype,"onremove",(function(){e.pusher&&e.pusher.then((function(e){var t=e.channels;t.user&&t.user.unbind("newMessage")}))})),(0,r.extend)(i().prototype,"notificationTypes",(function(t){e.forum.attribute("neoncubePrivateMessagesAllowUsersToReceiveEmailNotifications")&&t.add("newPrivateMessage",{name:"newPrivateMessage",icon:"fas fa-comment-alt",label:e.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..a55972b --- /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,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,EAAYxB,E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,YAAY,WAClCzM,EAAI0M,QACN1M,EAAI0M,OAAO9V,MAAK,SAACuJ,GACf,IAAMC,EAAWD,EAAOC,SACpBA,EAASrE,MACXqE,EAASrE,KAAKb,KAAK,cAAc,SAACQ,GAChCsE,EAAIwF,QAAQzJ,KAAKoI,eAAiBjF,IAAOc,EAAIwF,QAAQzJ,KAAKoI,iBAAmB,GAC7E1G,EAAEiC,QACJ,GAEJ,GAEJ,KAEA6M,EAAAA,EAAAA,QAAOE,IAAAA,UAAqB,YAAY,WAClCzM,EAAI0M,QACN1M,EAAI0M,OAAO9V,MAAK,SAACuJ,GACf,IAAMC,EAAWD,EAAOC,SACpBA,EAASrE,MACXqE,EAASrE,KAAKsE,OAAO,aAEzB,GAEJ,KAEAkM,EAAAA,EAAAA,QAAOI,IAAAA,UAA4B,qBAAqB,SAACjF,GAClD1H,EAAI4M,MAAM/J,UAAU,iEAGzB6E,EAAME,IAAI,oBAAqB,CAC7BlP,KAAM,oBACNuJ,KAAM,qBACNkJ,MAAOnL,EAAI6E,WAAWpD,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/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/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/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';\nimport app from 'flarum/forum/app';\n\nexport default class UserListItem extends Component {\n oninit(vnode) {\n this.conversation = vnode.attrs.conversation;\n this.user = null;\n\n const userId = parseInt(app.session.user.id());\n\n this.user = this.conversation\n .recipients()\n .find((recipient) => parseInt(recipient.user().id()) !== userId)\n ?.user();\n m.redraw();\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 if (!this.user) return null;\n\n return (\n
  • \n
    \n {avatar(this.user)}\n
    \n {username(this.user)}\n {userOnline(this.user)}\n
    \n {this.typing && (\n
    \n
    \n
    \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 Button from 'flarum/common/components/Button';\nimport Component from 'flarum/common/Component';\nimport ConversationView from './ConversationView';\nimport UserListItem from './UserListItem';\nimport StartConversationModal from './StartConversationModal';\nimport app from 'flarum/forum/app';\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 {hasConversations && (\n
      \n {Array.isArray(conversations) &&\n conversations.map(conversation => {\n return (\n {\n if (false/*isMobile*/) {\n // TODO: It might be nice to have real links shown if the screen is too small.\n window.location.assign(app.route('messages', { id: app.cache.conversations[$(e.currentTarget).attr('id')].id() }));\n } else {\n this.currentConversationId = conversation.data.id;\n }\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 if (app.drawer.isOpen()) {\n this.goToRoute();\n }\n }\n\n getMenu() {\n return
    {this.showing && };\n }\n\n goToRoute() {\n window.location.assign(app.route('conversations'));\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","UserListItem","_this$conversation$re","active","userOnline","UserSearchSource","query","cache","conversationResults","translator","highlight","text","store","filter","q","page","limit","pushResults","result","getById","session","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","Array","isArray","show","_loadMore","_callee","_context","_next","_throw","ConversationsPage","_Page","route","param","bodyClass","Page","NewPrivateMessageNotification","_Notification","href","notification","subject","fromUser","Notification","ConversationsDropdown","_NotificationsDropdow","label","isOpen","goToRoute","getMenu","menuClassName","showing","window","location","assign","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