diff --git a/extend.php b/extend.php index 259a1c9..1b18c6a 100644 --- a/extend.php +++ b/extend.php @@ -10,8 +10,10 @@ */ use Flarum\Extend; +use Flarum\Api\Serializer\BasicUserSerializer; use Mattoid\MoneyHistory\Api\Controller\ListUserMoneyHistoryController; +use Mattoid\MoneyHistory\Attributes\UserAttributes; use Mattoid\MoneyHistory\Event\MoneyAllHistoryEvent; use Mattoid\MoneyHistory\Listeners\MoneyAllHistoryListeners; use Mattoid\MoneyHistory\Listeners\MoneyHistoryListeners; @@ -27,6 +29,9 @@ ->css(__DIR__.'/less/admin.less'), new Extend\Locales(__DIR__.'/locale'), + (new Extend\ApiSerializer(BasicUserSerializer::class)) + ->attributes(UserAttributes::class), + (new Extend\Routes('api')) ->get('/users/{id}/money/history', 'user.money.history', ListUserMoneyHistoryController::class), diff --git a/js/dist/admin.js b/js/dist/admin.js index 3e7f04d..ac90351 100644 --- a/js/dist/admin.js +++ b/js/dist/admin.js @@ -1,2 +1,2 @@ -(()=>{var e={n:o=>{var t=o&&o.__esModule?()=>o.default:()=>o;return e.d(t,{a:t}),t},d:(o,t)=>{for(var r in t)e.o(t,r)&&!e.o(o,r)&&Object.defineProperty(o,r,{enumerable:!0,get:t[r]})},o:(e,o)=>Object.prototype.hasOwnProperty.call(e,o),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},o={};(()=>{"use strict";e.r(o);const t=flarum.core.compat["admin/app"];e.n(t)().initializers.add("mattoid/flarum-ext-money-history",(function(){console.log("[mattoid/flarum-ext-money-history] Hello, forum and admin!")}))})(),module.exports=o})(); +(()=>{var e={n:t=>{var o=t&&t.__esModule?()=>t.default:()=>t;return e.d(o,{a:o}),o},d:(t,o)=>{for(var r in o)e.o(o,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:o[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};(()=>{"use strict";e.r(t);const o=flarum.core.compat["admin/app"];var r=e.n(o);r().initializers.add("mattoid/flarum-ext-money-history",(function(){r().extensionData.for("mattoid-money-history").registerPermission({icon:"fas fa-id-card",label:r().translator.trans("mattoid-money-history.admin.settings.query-others-history"),permission:"money-history.queryOthersMoneyHistory",allowGuest:!0},"view")}))})(),module.exports=t})(); //# sourceMappingURL=admin.js.map \ No newline at end of file diff --git a/js/dist/admin.js.map b/js/dist/admin.js.map index 89cc934..2477b23 100644 --- a/js/dist/admin.js.map +++ b/js/dist/admin.js.map @@ -1 +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,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,+BCL9D,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,a,MCExDC,GAAAA,aAAiBC,IAAI,oCAAoC,WACvDC,QAAQC,IAAI,6DACd,G","sources":["webpack://@mattoid/flarum-ext-money-history/webpack/bootstrap","webpack://@mattoid/flarum-ext-money-history/webpack/runtime/compat get default export","webpack://@mattoid/flarum-ext-money-history/webpack/runtime/define property getters","webpack://@mattoid/flarum-ext-money-history/webpack/runtime/hasOwnProperty shorthand","webpack://@mattoid/flarum-ext-money-history/webpack/runtime/make namespace object","webpack://@mattoid/flarum-ext-money-history/external root \"flarum.core.compat['admin/app']\"","webpack://@mattoid/flarum-ext-money-history/./src/admin/index.ts"],"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))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","import app from 'flarum/admin/app';\n\napp.initializers.add('mattoid/flarum-ext-money-history', () => {\n console.log('[mattoid/flarum-ext-money-history] Hello, forum and admin!');\n});\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","app","add","console","log"],"sourceRoot":""} \ No newline at end of file +{"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,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,+BCL9D,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,a,aCExDC,IAAAA,aAAiBC,IAAI,oCAAoC,WACvDD,IAAAA,cAAiB,IAAK,yBACrBE,mBACC,CACEC,KAAM,iBACNC,MAAOJ,IAAAA,WAAeK,MAAM,6DAC5BC,WAAY,wCACZC,YAAY,GACX,OACP,G","sources":["webpack://@mattoid/flarum-ext-money-history/webpack/bootstrap","webpack://@mattoid/flarum-ext-money-history/webpack/runtime/compat get default export","webpack://@mattoid/flarum-ext-money-history/webpack/runtime/define property getters","webpack://@mattoid/flarum-ext-money-history/webpack/runtime/hasOwnProperty shorthand","webpack://@mattoid/flarum-ext-money-history/webpack/runtime/make namespace object","webpack://@mattoid/flarum-ext-money-history/external root \"flarum.core.compat['admin/app']\"","webpack://@mattoid/flarum-ext-money-history/./src/admin/index.ts"],"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))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","import app from 'flarum/admin/app';\n\napp.initializers.add('mattoid/flarum-ext-money-history', () => {\n app.extensionData.for(\"mattoid-money-history\")\n .registerPermission(\n {\n icon: 'fas fa-id-card',\n label: app.translator.trans('mattoid-money-history.admin.settings.query-others-history'),\n permission: 'money-history.queryOthersMoneyHistory',\n allowGuest: true\n }, 'view')\n});\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","app","add","registerPermission","icon","label","trans","permission","allowGuest"],"sourceRoot":""} \ No newline at end of file diff --git a/js/dist/forum.js b/js/dist/forum.js index f3a0c74..f22cdf9 100644 --- a/js/dist/forum.js +++ b/js/dist/forum.js @@ -1,2 +1,2 @@ -(()=>{var t={n:o=>{var e=o&&o.__esModule?()=>o.default:()=>o;return t.d(e,{a:e}),e},d:(o,e)=>{for(var r in e)t.o(e,r)&&!t.o(o,r)&&Object.defineProperty(o,r,{enumerable:!0,get:e[r]})},o:(t,o)=>Object.prototype.hasOwnProperty.call(t,o),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},o={};(()=>{"use strict";t.r(o);const e=flarum.core.compat["forum/app"];var r=t.n(e);const n=flarum.core.compat["common/extend"],s=flarum.core.compat["forum/components/UserPage"];var a=t.n(s);const i=flarum.core.compat["common/components/LinkButton"];var u=t.n(i);function l(t,o){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,o){return t.__proto__=o,t},l(t,o)}function c(t,o){t.prototype=Object.create(o.prototype),t.prototype.constructor=t,l(t,o)}const p=flarum.core.compat.Component;var y=t.n(p);const d=flarum.core.compat.app;var h=t.n(d);const f=flarum.core.compat["components/LoadingIndicator"];var v=t.n(f);const g=flarum.core.compat["components/Button"];var b=t.n(g);const M=flarum.core.compat["components/Link"];var x=t.n(M);const H=flarum.core.compat["helpers/avatar"];var O=t.n(H);const _=flarum.core.compat["helpers/username"];var R=t.n(_),j=function(t){function o(){return t.apply(this,arguments)||this}return c(o,t),o.prototype.view=function(){var t=this.attrs.userMoneyHistory,o=t.changeTime(),e=t.money(),r=t.sourceDesc(),n=t.id(),s=(t.user(),t.createUser()),a=t.balanceMoney(),i=t.lastMoney(),u=app.translator.trans("D"===t.type()?"mattoid-money-history.forum.record.money-out":"mattoid-money-history.forum.record.money-in"),l="D"===t.type()?"color:red":"color:green";return m("div",{className:"transferHistoryContainer"},m("div",{style:"padding-top: 5px;"},m("b",null,app.translator.trans("mattoid-money-history.forum.record.money-list-type"),": "),m("span",{style:l},u)," | ",m("b",null,app.translator.trans("mattoid-money-history.forum.record.money-list-assign-at"),": "),o),m("div",{style:"padding-top: 5px;"},m("b",null,app.translator.trans("mattoid-money-history.forum.record.money-list-id"),": "),n," | ",m("b",null,app.translator.trans("mattoid-money-history.forum.record.money-list-from-user"),": "),m(x(),{href:"#",className:"moneyHistoryUser",style:"color:var(--heading-color)"},O()(s)," ",R()(s))," | ",m("b",null,app.translator.trans("mattoid-money-history.forum.record.money-list-amount"),": "),e," | ",m("b",null,app.translator.trans("mattoid-money-history.forum.record.money-list-balance"),": "),a," → ",i," | ",m("span",null,m("b",null,app.translator.trans("mattoid-money-history.forum.record.money-list-transfer-notes"),": "),r)))},o}(y()),P=function(t){function o(){return t.apply(this,arguments)||this}c(o,t);var e=o.prototype;return e.oninit=function(o){t.prototype.oninit.call(this,o),this.loading=!0,this.moreResults=!1,this.userMoneyHistory=[],this.user=this.attrs.params.user,this.loadResults()},e.view=function(){var t=this;return this.loading&&v().component({size:"large"}),m("div",null,m("div",{style:"padding-bottom:10px; font-size: 24px;font-weight: bold;"},h().translator.trans("mattoid-money-history.forum.title")),m("ul",{style:"margin: 0;padding: 0;list-style-type: none;position: relative;"},this.userMoneyHistory.map((function(t){return m("li",{style:"padding-top:5px",key:t.id,"data-id":t.id},j.component({userMoneyHistory:t}))}))),!this.loading&&0===this.userMoneyHistory.length&&m("div",null,m("div",{style:"font-size:1.4em;color: var(--muted-more-color);text-align: center;height: 300px;line-height: 100px;"},h().translator.trans("mattoid-money-history.forum.list-empty"))),this.hasMoreResults()&&m("div",{style:"text-align:center;padding:20px"},m(b(),{className:"Button Button--primary",disabled:this.loading,loading:this.loading,onclick:function(){return t.loadMore()}},h().translator.trans("mattoid-money-history.forum.money-list-load-more"))))},e.loadMore=function(){this.loading=!0,this.loadResults(this.userMoneyHistory.length)},e.parseResults=function(t){return this.moreResults=!!t.payload.links&&!!t.payload.links.next,[].push.apply(this.userMoneyHistory,t),this.loading=!1,m.redraw(),t},e.hasMoreResults=function(){return this.moreResults},e.loadResults=function(t){void 0===t&&(t=0);var o="/users/"+this.user.id()+"/money/history";return h().store.find(o,{filter:{user:this.user.id()},page:{offset:t}}).catch((function(){})).then(this.parseResults.bind(this))},o}(y()),k=function(t){function o(){return t.apply(this,arguments)||this}c(o,t);var e=o.prototype;return e.oninit=function(o){t.prototype.oninit.call(this,o),this.loadUser(m.route.param("username"))},e.content=function(){return m("div",{className:"Post-body"},P.component({params:{user:this.user}}))},o}(a());const U=flarum.core.compat["common/Model"];var w=t.n(U),S=function(t){function o(){return t.apply(this,arguments)||this}return c(o,t),o}(w());Object.assign(S.prototype,{type:w().attribute("type"),money:w().attribute("money"),sourceDesc:w().attribute("source_desc"),changeTime:w().attribute("change_time"),balanceMoney:w().attribute("balance_money"),lastMoney:w().attribute("last_money"),user:w().hasOne("user"),createUser:w().hasOne("createUser")}),r().initializers.add("flarum-ext-money-history",(function(){r().store.models.userMoneyHistory=S,r().routes.userMoneyHistory={path:"/u/:username/money/history",component:k},(0,n.extend)(a().prototype,"navItems",(function(t){r().session.user&&t.add("userMoneyHistory",u().component({href:r().route("userMoneyHistory",{username:r().session.user.username()}),icon:"fas fa-money-bill"},r().translator.trans("mattoid-money-history.forum.nav")))}))}))})(),module.exports=o})(); +(()=>{var t={n:o=>{var e=o&&o.__esModule?()=>o.default:()=>o;return t.d(e,{a:e}),e},d:(o,e)=>{for(var r in e)t.o(e,r)&&!t.o(o,r)&&Object.defineProperty(o,r,{enumerable:!0,get:e[r]})},o:(t,o)=>Object.prototype.hasOwnProperty.call(t,o),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},o={};(()=>{"use strict";t.r(o);const e=flarum.core.compat["forum/app"];var r=t.n(e);const n=flarum.core.compat["common/extend"],s=flarum.core.compat["forum/components/UserPage"];var a=t.n(s);const i=flarum.core.compat["common/components/LinkButton"];var u=t.n(i);function l(t,o){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,o){return t.__proto__=o,t},l(t,o)}function c(t,o){t.prototype=Object.create(o.prototype),t.prototype.constructor=t,l(t,o)}const y=flarum.core.compat.Component;var p=t.n(y);const d=flarum.core.compat.app;var h=t.n(d);const f=flarum.core.compat["components/LoadingIndicator"];var g=t.n(f);const v=flarum.core.compat["components/Button"];var b=t.n(v);const M=flarum.core.compat["components/Link"];var x=t.n(M);const H=flarum.core.compat["helpers/avatar"];var O=t.n(H);const _=flarum.core.compat["helpers/username"];var R=t.n(_),j=function(t){function o(){return t.apply(this,arguments)||this}return c(o,t),o.prototype.view=function(){var t=this.attrs.userMoneyHistory,o=t.changeTime(),e=t.money(),r=t.sourceDesc(),n=t.id(),s=(t.user(),t.createUser()),a=t.balanceMoney(),i=t.lastMoney(),u=app.translator.trans("D"===t.type()?"mattoid-money-history.forum.record.money-out":"mattoid-money-history.forum.record.money-in"),l="D"===t.type()?"color:red":"color:green";return m("div",{className:"transferHistoryContainer"},m("div",{style:"padding-top: 5px;"},m("b",null,app.translator.trans("mattoid-money-history.forum.record.money-list-type"),": "),m("span",{style:l},u)," | ",m("b",null,app.translator.trans("mattoid-money-history.forum.record.money-list-assign-at"),": "),o),m("div",{style:"padding-top: 5px;"},m("b",null,app.translator.trans("mattoid-money-history.forum.record.money-list-id"),": "),n," | ",m("b",null,app.translator.trans("mattoid-money-history.forum.record.money-list-from-user"),": "),m(x(),{href:"#",className:"moneyHistoryUser",style:"color:var(--heading-color)"},O()(s)," ",R()(s))," | ",m("b",null,app.translator.trans("mattoid-money-history.forum.record.money-list-amount"),": "),e," | ",m("b",null,app.translator.trans("mattoid-money-history.forum.record.money-list-balance"),": "),a," → ",i," | ",m("span",null,m("b",null,app.translator.trans("mattoid-money-history.forum.record.money-list-transfer-notes"),": "),r)))},o}(p()),P=function(t){function o(){return t.apply(this,arguments)||this}c(o,t);var e=o.prototype;return e.oninit=function(o){t.prototype.oninit.call(this,o),this.loading=!0,this.moreResults=!1,this.userMoneyHistory=[],this.user=this.attrs.params.user,this.loadResults()},e.view=function(){var t=this;return this.loading&&g().component({size:"large"}),m("div",null,m("div",{style:"padding-bottom:10px; font-size: 24px;font-weight: bold;"},h().translator.trans("mattoid-money-history.forum.title")),m("ul",{style:"margin: 0;padding: 0;list-style-type: none;position: relative;"},this.userMoneyHistory.map((function(t){return m("li",{style:"padding-top:5px",key:t.id,"data-id":t.id},j.component({userMoneyHistory:t}))}))),!this.loading&&0===this.userMoneyHistory.length&&m("div",null,m("div",{style:"font-size:1.4em;color: var(--muted-more-color);text-align: center;height: 300px;line-height: 100px;"},h().translator.trans("mattoid-money-history.forum.list-empty"))),this.hasMoreResults()&&m("div",{style:"text-align:center;padding:20px"},m(b(),{className:"Button Button--primary",disabled:this.loading,loading:this.loading,onclick:function(){return t.loadMore()}},h().translator.trans("mattoid-money-history.forum.money-list-load-more"))))},e.loadMore=function(){this.loading=!0,this.loadResults(this.userMoneyHistory.length)},e.parseResults=function(t){return this.moreResults=!!t.payload.links&&!!t.payload.links.next,[].push.apply(this.userMoneyHistory,t),this.loading=!1,m.redraw(),t},e.hasMoreResults=function(){return this.moreResults},e.loadResults=function(t){void 0===t&&(t=0);var o="/users/"+this.user.id()+"/money/history";return h().store.find(o,{filter:{user:this.user.id()},page:{offset:t}}).catch((function(){})).then(this.parseResults.bind(this))},o}(p()),k=function(t){function o(){return t.apply(this,arguments)||this}c(o,t);var e=o.prototype;return e.oninit=function(o){t.prototype.oninit.call(this,o),this.loadUser(m.route.param("username"))},e.content=function(){return m("div",{className:"Post-body"},P.component({params:{user:this.user}}))},o}(a());const U=flarum.core.compat["common/Model"];var w=t.n(U),S=function(t){function o(){return t.apply(this,arguments)||this}return c(o,t),o}(w());Object.assign(S.prototype,{type:w().attribute("type"),money:w().attribute("money"),sourceDesc:w().attribute("source_desc"),changeTime:w().attribute("change_time"),balanceMoney:w().attribute("balance_money"),lastMoney:w().attribute("last_money"),user:w().hasOne("user"),createUser:w().hasOne("createUser")}),r().initializers.add("flarum-ext-money-history",(function(){r().store.models.userMoneyHistory=S,r().routes.userMoneyHistory={path:"/u/:username/money/history",component:k},(0,n.extend)(a().prototype,"navItems",(function(t){(r().session.user.id()===this.user.id()||this.user&&this.user.attribute("canQueryOthersHistory"))&&t.add("userMoneyHistory",u().component({href:r().route("userMoneyHistory",{username:this.user.slug()}),icon:"fas fa-money-bill"},r().translator.trans("mattoid-money-history.forum.nav")))}))}))})(),module.exports=o})(); //# sourceMappingURL=forum.js.map \ No newline at end of file diff --git a/js/dist/forum.js.map b/js/dist/forum.js.map index 5b1094f..2695336 100644 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AOoG,OAAOH,EAAiB3F,UAAW,CACxCwC,KAAOqD,IAAAA,UAAgB,QACvBjE,MAAQiE,IAAAA,UAAgB,SACxBhE,WAAagE,IAAAA,UAAgB,eAC7BlE,WAAakE,IAAAA,UAAgB,eAC7B3D,aAAc2D,IAAAA,UAAgB,iBAC9B1D,UAAW0D,IAAAA,UAAgB,cAC3B5D,KAAO4D,IAAAA,OAAa,QACpB7D,WAAa6D,IAAAA,OAAa,gBCJ5BxD,IAAAA,aAAiB0D,IAAI,4BAA4B,WAC/C1D,IAAAA,MAAU2D,OAAOxE,iBAAmBmE,EAEpCtD,IAAAA,OAAWb,iBAAmB,CAC5ByE,KAAM,6BACNlC,UAAWoB,IAGbe,EAAAA,EAAAA,QAAOR,IAAAA,UAAoB,YAAY,SAAUS,GAC1C9D,IAAAA,QAAYJ,MAKjBkE,EAAMJ,IAAI,mBAAoBK,IAAAA,UAAqB,CACjDtD,KAAMT,IAAAA,MAAU,mBAAoB,CAClCW,SAAUX,IAAAA,QAAYJ,KAAKe,aAE7BqD,KAAM,qBACLhE,IAAAA,WAAeE,MAAM,oCAC1B,GACF,G","sources":["webpack://@mattoid/flarum-ext-money-history/webpack/bootstrap","webpack://@mattoid/flarum-ext-money-history/webpack/runtime/compat get default export","webpack://@mattoid/flarum-ext-money-history/webpack/runtime/define property getters","webpack://@mattoid/flarum-ext-money-history/webpack/runtime/hasOwnProperty shorthand","webpack://@mattoid/flarum-ext-money-history/webpack/runtime/make namespace object","webpack://@mattoid/flarum-ext-money-history/external root \"flarum.core.compat['forum/app']\"","webpack://@mattoid/flarum-ext-money-history/external root \"flarum.core.compat['common/extend']\"","webpack://@mattoid/flarum-ext-money-history/external root \"flarum.core.compat['forum/components/UserPage']\"","webpack://@mattoid/flarum-ext-money-history/external root \"flarum.core.compat['common/components/LinkButton']\"","webpack://@mattoid/flarum-ext-money-history/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@mattoid/flarum-ext-money-history/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@mattoid/flarum-ext-money-history/external root \"flarum.core.compat['Component']\"","webpack://@mattoid/flarum-ext-money-history/external root \"flarum.core.compat['app']\"","webpack://@mattoid/flarum-ext-money-history/external root \"flarum.core.compat['components/LoadingIndicator']\"","webpack://@mattoid/flarum-ext-money-history/external root \"flarum.core.compat['components/Button']\"","webpack://@mattoid/flarum-ext-money-history/external root \"flarum.core.compat['components/Link']\"","webpack://@mattoid/flarum-ext-money-history/external root \"flarum.core.compat['helpers/avatar']\"","webpack://@mattoid/flarum-ext-money-history/external root \"flarum.core.compat['helpers/username']\"","webpack://@mattoid/flarum-ext-money-history/./src/forum/components/MoneyHistoryListItem.js","webpack://@mattoid/flarum-ext-money-history/./src/forum/components/MoneyHistoryList.js","webpack://@mattoid/flarum-ext-money-history/./src/forum/components/MoneyHistoryPage.js","webpack://@mattoid/flarum-ext-money-history/external root \"flarum.core.compat['common/Model']\"","webpack://@mattoid/flarum-ext-money-history/./src/forum/models/UserMoneyHistory.js","webpack://@mattoid/flarum-ext-money-history/./src/forum/index.ts"],"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))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/UserPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LinkButton'];","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['Component'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['components/LoadingIndicator'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['components/Link'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['helpers/avatar'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['helpers/username'];","import Component from \"flarum/Component\";\nimport Link from \"flarum/components/Link\";\nimport avatar from \"flarum/helpers/avatar\";\nimport username from \"flarum/helpers/username\";\n\nexport default class TransferHistoryListItem extends Component {\n view() {\n const {userMoneyHistory} = this.attrs;\n const changeTime = userMoneyHistory.changeTime();\n const money = userMoneyHistory.money();\n const sourceDesc = userMoneyHistory.sourceDesc();\n const moneyID = userMoneyHistory.id();\n const moneyUser = userMoneyHistory.user();\n const createUser = userMoneyHistory.createUser();\n const balanceMoney = userMoneyHistory.balanceMoney();\n const lastMoney = userMoneyHistory.lastMoney();\n const moneyType = app.translator.trans(userMoneyHistory.type()==='D'?\"mattoid-money-history.forum.record.money-out\":\"mattoid-money-history.forum.record.money-in\");\n const moneyTypeStyle = userMoneyHistory.type()==='D'?\"color:red\":\"color:green\";\n\n return (\n