From 731cbf880e951b81ca185f146130ca6e2b2ee9b8 Mon Sep 17 00:00:00 2001 From: flarum-bot Date: Sat, 15 Jul 2023 16:08:20 +0000 Subject: [PATCH] Bundled output for commit 7b9ba5a132bf0a911727b8e8c93c534ac1a96711 Includes transpiled JS/TS. [skip ci] --- js/dist/admin.js | 2 +- js/dist/admin.js.map | 2 +- js/dist/forum.js | 2 +- js/dist/forum.js.map | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/js/dist/admin.js b/js/dist/admin.js index 6a002f4..0b75679 100644 --- a/js/dist/admin.js +++ b/js/dist/admin.js @@ -1,2 +1,2 @@ -module.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var a=e[r]={i:r,l:!1,exports:{}};return t[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)n.d(r,a,function(e){return t[e]}.bind(null,a));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=12)}([function(t,e,n){"use strict";e.a={module:{name:"nomiscz-auth-wechat",id:"WeChatAuth",icon:"fab fa-weixin"},package:{name:"flarum-ext-auth-wechat"},api:{uri:"/auth/wechat"}}},function(t,e){t.exports=flarum.core.compat.app},function(t,e,n){"use strict";function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}n.d(e,"a",(function(){return r}))},,,,,,,function(t,e){t.exports=flarum.extensions["fof-components"]},function(t,e){t.exports=flarum.core.compat["components/ExtensionPage"]},,function(t,e,n){"use strict";n.r(e);var r=n(1),a=n.n(r);function o(){return(o=Object.assign||function(t){for(var e=1;e{var t={n:e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};(()=>{"use strict";t.r(e);const n=flarum.core.compat.app;var r=t.n(n);function o(t,e){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},o(t,e)}const a=flarum.extensions["fof-components"],i=flarum.core.compat["components/ExtensionPage"];var s=t.n(i);const p="nomiscz-auth-wechat",c="flarum-ext-auth-wechat";var u=a.settings.items.StringItem,l=function(t){var e,n;function r(){return t.apply(this,arguments)||this}n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,o(e,n);var a=r.prototype;return a.oninit=function(e){t.prototype.oninit.call(this,e),this.setting=this.setting.bind(this)},a.content=function(){var t,e;return[m("div",{className:"WeChatAuthSettingsPage"},m("div",{className:"container"},m("div",{className:"Form-group"},m(u,Object.assign({name:c+".app_id",setting:this.setting},(t={},t.required=!0,t)),app.translator.trans(p+".admin.settings.api_app_id"))),m("div",{className:"Form-group"},m(u,Object.assign({name:c+".app_secret",setting:this.setting},(e={},e.required=!0,e)),app.translator.trans(p+".admin.settings.api_app_secret"))),this.submitButton()))]},r}(s());r().initializers.add("nomiscz/"+p,(function(){r().extensionData.for(p).registerPage(l)}))})(),module.exports=e})(); //# 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 48b79a4..c6381f1 100644 --- a/js/dist/admin.js.map +++ b/js/dist/admin.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://@nomiscz/flarum-ext-auth-wechat/webpack/bootstrap","webpack://@nomiscz/flarum-ext-auth-wechat/./src/config.js","webpack://@nomiscz/flarum-ext-auth-wechat/external \"flarum.core.compat['app']\"","webpack://@nomiscz/flarum-ext-auth-wechat/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@nomiscz/flarum-ext-auth-wechat/external \"flarum.extensions['fof-components']\"","webpack://@nomiscz/flarum-ext-auth-wechat/external \"flarum.core.compat['components/ExtensionPage']\"","webpack://@nomiscz/flarum-ext-auth-wechat/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://@nomiscz/flarum-ext-auth-wechat/./src/admin/components/SettingsPage.js","webpack://@nomiscz/flarum-ext-auth-wechat/./src/admin/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","id","icon","package","api","uri","flarum","core","compat","_inheritsLoose","subClass","superClass","constructor","__proto__","extensions","_extends","assign","target","arguments","length","source","apply","this","StringItem","settings","items","SettingsPage","oninit","vnode","setting","content","className","config","app","translator","trans","submitButton","ExtensionPage","initializers","add","extensionData","registerPage"],"mappings":"2BACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QA0Df,OArDAF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,S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":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 12);\n","export default {\n module: {\n name: 'nomiscz-auth-wechat',\n id: 'WeChatAuth',\n icon: 'fab fa-weixin'\n },\n package: {\n name: 'flarum-ext-auth-wechat'\n },\n api: {\n uri: '/auth/wechat'\n }\n};\n","module.exports = flarum.core.compat['app'];","export default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}","module.exports = flarum.extensions['fof-components'];","module.exports = flarum.core.compat['components/ExtensionPage'];","export default function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}","import { settings } from '@fof-components';\nimport ExtensionPage from 'flarum/components/ExtensionPage';\n\nimport config from '../../config';\n\nconst {\n items: { StringItem },\n} = settings;\n\nexport default class SettingsPage extends ExtensionPage {\n oninit(vnode) {\n super.oninit(vnode);\n this.setting = this.setting.bind(this);\n }\n content() {\n return [\n
\n
\n
\n \n {app.translator.trans(`${config.module.name}.admin.settings.api_app_id`)}\n \n
\n
\n \n {app.translator.trans(`${config.module.name}.admin.settings.api_app_secret`)}\n \n
\n {this.submitButton()}\n
\n
\n ];\n }\n}\n","import app from 'flarum/app';\nimport SettingsPage from './components/SettingsPage';\n\nimport config from '../config';\n\napp.initializers.add(`nomiscz/${config.module.name}`, () => {\n app.extensionData.for(config.module.name).registerPage(SettingsPage);\n});\n"],"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,OAAY,I,aCA9C,SAASC,EAAgBhB,EAAGiB,GAKzC,OAJAD,EAAkBf,OAAOiB,eAAiBjB,OAAOiB,eAAeC,OAAS,SAAyBnB,EAAGiB,GAEnG,OADAjB,EAAEoB,UAAYH,EACPjB,CACT,EACOgB,EAAgBhB,EAAGiB,EAC5B,CCNA,MAAM,EAA+BJ,OAAOQ,WAAW,kBCAjD,EAA+BR,OAAOC,KAAKC,OAAO,4B,aCAxD,QAEU,sBAFV,EAOU,yBCFV,IACaO,EACTC,EAAAA,SADAC,MAASF,WAGQG,EAAY,SAAAC,GCRlB,IAAwBC,EAAUC,EDQhB,SAAAH,IAAA,OAAAC,EAAAG,MAAA,KAAAC,YAAA,KCRgBF,EDQhBF,GCRMC,EDQNF,GCPtBlB,UAAYN,OAAO8B,OAAOH,EAAWrB,WAC9CoB,EAASpB,UAAUyB,YAAcL,EACjCT,EAAeS,EAAUC,GDKM,IAAAK,EAAAR,EAAAlB,UA+B5B,OA/B4B0B,EAC7BC,OAAA,SAAOC,GACHT,EAAAnB,UAAM2B,OAAMzB,KAAC,KAAA0B,GACbC,KAAKC,QAAUD,KAAKC,QAAQlB,KAAKiB,KACrC,EAACH,EACDK,QAAA,WAAU,IAAAC,EAAAC,EACN,MAAO,CACHC,EAAA,OAAKC,UAAU,0BACXD,EAAA,OAAKC,UAAU,aACXD,EAAA,OAAKC,UAAU,cACXD,EAACnB,EAAUrB,OAAA0C,OAAA,CACPC,KAASC,EAAmB,UAC5BR,QAASD,KAAKC,UAAQE,EAAA,GAAAA,EACL,UAAG,EAAIA,IAEvBO,IAAIC,WAAWC,MAASH,EAAkB,gCAGnDJ,EAAA,OAAKC,UAAU,cACXD,EAACnB,EAAUrB,OAAA0C,OAAA,CACPC,KAASC,EAAmB,cAC5BR,QAASD,KAAKC,UAAQG,EAAA,GAAAA,EACL,UAAG,EAAIA,IAEvBM,IAAIC,WAAWC,MAASH,EAAkB,oCAGlDT,KAAKa,iBAItB,EAACxB,CAAA,CA/B4B,CAASyB,KEJ1CJ,IAAAA,aAAiBK,IAAI,WAAWN,GAAsB,WAClDC,IAAAA,cAAiB,IAAKD,GAAoBO,aAAa3B,EAC3D,G","sources":["webpack://@nomiscz/flarum-ext-auth-wechat/webpack/bootstrap","webpack://@nomiscz/flarum-ext-auth-wechat/webpack/runtime/compat get default export","webpack://@nomiscz/flarum-ext-auth-wechat/webpack/runtime/define property getters","webpack://@nomiscz/flarum-ext-auth-wechat/webpack/runtime/hasOwnProperty shorthand","webpack://@nomiscz/flarum-ext-auth-wechat/webpack/runtime/make namespace object","webpack://@nomiscz/flarum-ext-auth-wechat/external root \"flarum.core.compat['app']\"","webpack://@nomiscz/flarum-ext-auth-wechat/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@nomiscz/flarum-ext-auth-wechat/external assign \"flarum.extensions['fof-components']\"","webpack://@nomiscz/flarum-ext-auth-wechat/external root \"flarum.core.compat['components/ExtensionPage']\"","webpack://@nomiscz/flarum-ext-auth-wechat/./src/config.js","webpack://@nomiscz/flarum-ext-auth-wechat/./src/admin/components/SettingsPage.js","webpack://@nomiscz/flarum-ext-auth-wechat/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@nomiscz/flarum-ext-auth-wechat/./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))","// 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['app'];","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}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.extensions['fof-components'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['components/ExtensionPage'];","export default {\n module: {\n name: 'nomiscz-auth-wechat',\n id: 'WeChatAuth',\n icon: 'fab fa-weixin'\n },\n package: {\n name: 'flarum-ext-auth-wechat'\n },\n api: {\n uri: '/auth/wechat'\n }\n};\n","import { settings } from '@fof-components';\nimport ExtensionPage from 'flarum/components/ExtensionPage';\n\nimport config from '../../config';\n\nconst {\n items: { StringItem },\n} = settings;\n\nexport default class SettingsPage extends ExtensionPage {\n oninit(vnode) {\n super.oninit(vnode);\n this.setting = this.setting.bind(this);\n }\n content() {\n return [\n
\n
\n
\n \n {app.translator.trans(`${config.module.name}.admin.settings.api_app_id`)}\n \n
\n
\n \n {app.translator.trans(`${config.module.name}.admin.settings.api_app_secret`)}\n \n
\n {this.submitButton()}\n
\n
\n ];\n }\n}\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}","import app from 'flarum/app';\nimport SettingsPage from './components/SettingsPage';\n\nimport config from '../config';\n\napp.initializers.add(`nomiscz/${config.module.name}`, () => {\n app.extensionData.for(config.module.name).registerPage(SettingsPage);\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","_setPrototypeOf","p","setPrototypeOf","bind","__proto__","extensions","StringItem","settings","items","SettingsPage","_ExtensionPage","subClass","superClass","apply","arguments","create","constructor","_proto","oninit","vnode","this","setting","content","_ref","_ref2","m","className","assign","name","config","app","translator","trans","submitButton","ExtensionPage","add","registerPage"],"sourceRoot":""} \ No newline at end of file diff --git a/js/dist/forum.js b/js/dist/forum.js index 0af8ffb..dbc53c3 100644 --- a/js/dist/forum.js +++ b/js/dist/forum.js @@ -1,2 +1,2 @@ -module.exports=function(t){var a={};function n(e){if(a[e])return a[e].exports;var o=a[e]={i:e,l:!1,exports:{}};return t[e].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=a,n.d=function(t,a,e){n.o(t,a)||Object.defineProperty(t,a,{enumerable:!0,get:e})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,a){if(1&a&&(t=n(t)),8&a)return t;if(4&a&&"object"==typeof t&&t&&t.__esModule)return t;var e=Object.create(null);if(n.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:t}),2&a&&"string"!=typeof t)for(var o in t)n.d(e,o,function(a){return t[a]}.bind(null,o));return e},n.n=function(t){var a=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(a,"a",a),a},n.o=function(t,a){return Object.prototype.hasOwnProperty.call(t,a)},n.p="",n(n.s=11)}([function(t,a,n){"use strict";a.a={module:{name:"nomiscz-auth-wechat",id:"WeChatAuth",icon:"fab fa-weixin"},package:{name:"flarum-ext-auth-wechat"},api:{uri:"/auth/wechat"}}},function(t,a){t.exports=flarum.core.compat.app},function(t,a,n){"use strict";function e(t,a){t.prototype=Object.create(a.prototype),t.prototype.constructor=t,t.__proto__=a}n.d(a,"a",(function(){return e}))},function(t,a){t.exports=flarum.core.compat["components/Button"]},function(t,a){t.exports=flarum.core.compat["components/Modal"]},function(t,a){t.exports=flarum.core.compat.extend},function(t,a){t.exports=flarum.core.compat["components/SettingsPage"]},function(t,a){t.exports=flarum.core.compat["components/LogInButtons"]},function(t,a){t.exports=flarum.core.compat["components/LogInButton"]},,,function(t,a,n){"use strict";n.r(a);var e=n(5),o=n(1),r=n.n(o),u=n(0),s=n(6),i=n.n(s),l=function(){function t(){}return t.prototype.linkDone=function(t){var a;switch(t){case"already_linked":app.modal.close(),a=app.alerts.show({type:"error"},app.translator.trans(u.a.module.name+".forum.alerts.already_linked"));break;case"already_used":a=app.alerts.show({type:"error"},app.translator.trans(u.a.module.name+".forum.alerts.already_used"));break;case"done":app.modal.close(),app.session.user.savePreferences(),a=app.alerts.show({type:"success"},app.translator.trans(u.a.module.name+".forum.alerts.link_success"));break;case"error":a=app.alerts.show({type:"error"},app.translator.trans(u.a.module.name+".forum.alerts.error"))}setTimeout((function(){app.alerts.dismiss(a)}),5e3)},t}(),c=n(2),p=n(4),d=n.n(p),f=n(3),h=n.n(f),b=function(t){function a(){return t.apply(this,arguments)||this}Object(c.a)(a,t);var n=a.prototype;return n.className=function(){return u.a.module.id+"UnlinkModal Modal--small"},n.title=function(){return app.translator.trans(u.a.module.name+".forum.modals.unlink.title")},n.content=function(){var t=this,a=app.session.user.data.attributes.WeChatAuth.providersCount,n=void 0===a?0:a;return m("div",{className:"Modal-body"},m("div",{className:"Form Form--centered"},m("div",{className:"Form-group",id:"submit-button-group"},m("h3",null,app.translator.trans(u.a.module.name+".forum.modals.unlink.info.confirm")),n<=1?m("p",{className:u.a.module.id+"Text--danger"},m("i",{className:"fas fa-exclamation-triangle fa-fw"}),m("b",null,app.translator.trans(u.a.module.name+".forum.modals.unlink.info.no_providers"))):"",m("br",null),m("div",{className:"ButtonGroup"},m(h.a,{type:"submit",className:"Button "+u.a.module.id+"Button--danger",icon:"fas fa-exclamation-triangle",loading:this.loading},app.translator.trans(u.a.module.name+".forum.modals.unlink.buttons.confirm")),m(h.a,{className:"Button Button--primary",icon:"fas fa-exclamation-triangle",onclick:function(){return t.hide()},disabled:this.loading},app.translator.trans(u.a.module.name+".forum.modals.unlink.buttons.cancel"))))))},n.onsubmit=function(t){var a,n=this;t.preventDefault(),this.loading=!0,app.request({method:"POST",url:app.forum.attribute("apiUrl")+"/"+u.a.api.uri+"/unlink"}).then((function(){app.session.user.savePreferences(),n.hide(),a=app.alerts.show({type:"success"},app.translator.trans(u.a.module.name+".forum.alerts.unlink_success"))})),setTimeout((function(){app.alerts.dismiss(a)}),5e3)},a}(d.a),g=function(t){function a(){return t.apply(this,arguments)||this}Object(c.a)(a,t);var n=a.prototype;return n.className=function(){return u.a.module.id+"LinkModal Modal--small"},n.title=function(){return app.translator.trans(u.a.module.name+".forum.modals.link.title")},n.content=function(){var t=this;return m("div",{className:"Modal-body"},m("div",{className:"Form Form--centered"},m("div",{className:"Form-group"},m(h.a,{className:"Button LogInButton--"+u.a.module.id,icon:u.a.module.icon,loading:this.loading,disabled:this.loading,path:"/auth/"+name,onclick:function(){return t.showLogin()}},app.translator.trans(u.a.module.name+".forum.buttons.login")))))},n.showLogin=function(){var t=$(window);window.open(app.forum.attribute("apiUrl")+"/"+u.a.api.uri+"/link",u.a.module.id+"LinkPopup","width=600,height=400,top="+(t.height()/2-200)+",left="+(t.width()/2-300)+",status=no,scrollbars=no,resizable=no"),this.loading=!0},a}(d.a),y=n(7),v=n.n(y),k=n(8),w=n.n(k);r.a.initializers.add("nomiscz/"+u.a.package.name,(function(){Object(e.extend)(i.a.prototype,"accountItems",(function(t){var a=r.a.session.user.data.attributes.WeChatAuth.isLinked,n=void 0!==a&&a;t.add("link"+u.a.module.id,m(h.a,{className:"Button "+u.a.module.id+"Button--"+(n?"danger":"success"),icon:u.a.module.icon,path:"/auth/"+name,onclick:function(){return r.a.modal.show(n?b:g)}},r.a.translator.trans(u.a.module.name+".forum.buttons."+(n?"unlink":"link"))))})),Object(e.extend)(v.a.prototype,"items",(function(t){t.add(u.a.package.id,m(w.a,{className:"Button LogInButton--"+u.a.module.id,icon:u.a.module.icon,path:u.a.api.uri},r.a.translator.trans(u.a.module.name+".forum.buttons.login")))}))})),r.a.wechat=new l}]); +(()=>{var t={n:a=>{var o=a&&a.__esModule?()=>a.default:()=>a;return t.d(o,{a:o}),o},d:(a,o)=>{for(var e in o)t.o(o,e)&&!t.o(a,e)&&Object.defineProperty(a,e,{enumerable:!0,get:o[e]})},o:(t,a)=>Object.prototype.hasOwnProperty.call(t,a),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},a={};(()=>{"use strict";t.r(a);const o=flarum.core.compat.extend,e=flarum.core.compat.app;var n=t.n(e);const r={module:{name:"nomiscz-auth-wechat",id:"WeChatAuth",icon:"fab fa-weixin"},package:{name:"flarum-ext-auth-wechat"},api:{uri:"/auth/wechat"}},s=flarum.core.compat["components/SettingsPage"];var i=t.n(s),u=function(){function t(){}return t.prototype.linkDone=function(t){var a;switch(t){case"already_linked":app.modal.close(),a=app.alerts.show({type:"error"},app.translator.trans(r.module.name+".forum.alerts.already_linked"));break;case"already_used":a=app.alerts.show({type:"error"},app.translator.trans(r.module.name+".forum.alerts.already_used"));break;case"done":app.modal.close(),app.session.user.savePreferences(),a=app.alerts.show({type:"success"},app.translator.trans(r.module.name+".forum.alerts.link_success"));break;case"error":a=app.alerts.show({type:"error"},app.translator.trans(r.module.name+".forum.alerts.error"))}setTimeout((function(){app.alerts.dismiss(a)}),5e3)},t}();function l(t,a){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,a){return t.__proto__=a,t},l(t,a)}function c(t,a){t.prototype=Object.create(a.prototype),t.prototype.constructor=t,l(t,a)}const p=flarum.core.compat["components/Modal"];var d=t.n(p);const f=flarum.core.compat["components/Button"];var h=t.n(f),b=function(t){function a(){return t.apply(this,arguments)||this}c(a,t);var o=a.prototype;return o.className=function(){return r.module.id+"UnlinkModal Modal--small"},o.title=function(){return app.translator.trans(r.module.name+".forum.modals.unlink.title")},o.content=function(){var t=this,a=app.session.user.data.attributes.WeChatAuth.providersCount,o=void 0===a?0:a;return m("div",{className:"Modal-body"},m("div",{className:"Form Form--centered"},m("div",{className:"Form-group",id:"submit-button-group"},m("h3",null,app.translator.trans(r.module.name+".forum.modals.unlink.info.confirm")),o<=1?m("p",{className:r.module.id+"Text--danger"},m("i",{className:"fas fa-exclamation-triangle fa-fw"}),m("b",null,app.translator.trans(r.module.name+".forum.modals.unlink.info.no_providers"))):"",m("br",null),m("div",{className:"ButtonGroup"},m(h(),{type:"submit",className:"Button "+r.module.id+"Button--danger",icon:"fas fa-exclamation-triangle",loading:this.loading},app.translator.trans(r.module.name+".forum.modals.unlink.buttons.confirm")),m(h(),{className:"Button Button--primary",icon:"fas fa-exclamation-triangle",onclick:function(){return t.hide()},disabled:this.loading},app.translator.trans(r.module.name+".forum.modals.unlink.buttons.cancel"))))))},o.onsubmit=function(t){var a,o=this;t.preventDefault(),this.loading=!0,app.request({method:"POST",url:app.forum.attribute("apiUrl")+"/"+r.api.uri+"/unlink"}).then((function(){app.session.user.savePreferences(),o.hide(),a=app.alerts.show({type:"success"},app.translator.trans(r.module.name+".forum.alerts.unlink_success"))})),setTimeout((function(){app.alerts.dismiss(a)}),5e3)},a}(d()),g=function(t){function a(){return t.apply(this,arguments)||this}c(a,t);var o=a.prototype;return o.className=function(){return r.module.id+"LinkModal Modal--small"},o.title=function(){return app.translator.trans(r.module.name+".forum.modals.link.title")},o.content=function(){var t=this;return m("div",{className:"Modal-body"},m("div",{className:"Form Form--centered"},m("div",{className:"Form-group"},m(h(),{className:"Button LogInButton--"+r.module.id,icon:r.module.icon,loading:this.loading,disabled:this.loading,path:"/auth/"+name,onclick:function(){return t.showLogin()}},app.translator.trans(r.module.name+".forum.buttons.login")))))},o.showLogin=function(){var t=$(window);window.open(app.forum.attribute("apiUrl")+"/"+r.api.uri+"/link",r.module.id+"LinkPopup","width=600,height=400,top="+(t.height()/2-200)+",left="+(t.width()/2-300)+",status=no,scrollbars=no,resizable=no"),this.loading=!0},a}(d());const y=flarum.core.compat["components/LogInButtons"];var v=t.n(y);const k=flarum.core.compat["components/LogInButton"];var w=t.n(k);n().initializers.add("nomiscz/"+r.package.name,(function(){(0,o.extend)(i().prototype,"accountItems",(function(t){var a=n().session.user.data.attributes.WeChatAuth.isLinked,o=void 0!==a&&a;t.add("link"+r.module.id,m(h(),{className:"Button "+r.module.id+"Button--"+(o?"danger":"success"),icon:r.module.icon,path:"/auth/"+name,onclick:function(){return n().modal.show(o?b:g)}},n().translator.trans(r.module.name+".forum.buttons."+(o?"unlink":"link"))))})),(0,o.extend)(v().prototype,"items",(function(t){t.add(r.package.id,m(w(),{className:"Button LogInButton--"+r.module.id,icon:r.module.icon,path:r.api.uri},n().translator.trans(r.module.name+".forum.buttons.login")))}))})),n().wechat=new u})(),module.exports=a})(); //# 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 6af66a5..7dadc55 100644 --- a/js/dist/forum.js.map +++ b/js/dist/forum.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://@nomiscz/flarum-ext-auth-wechat/webpack/bootstrap","webpack://@nomiscz/flarum-ext-auth-wechat/./src/config.js","webpack://@nomiscz/flarum-ext-auth-wechat/external \"flarum.core.compat['app']\"","webpack://@nomiscz/flarum-ext-auth-wechat/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@nomiscz/flarum-ext-auth-wechat/external \"flarum.core.compat['components/Button']\"","webpack://@nomiscz/flarum-ext-auth-wechat/external \"flarum.core.compat['components/Modal']\"","webpack://@nomiscz/flarum-ext-auth-wechat/external \"flarum.core.compat['extend']\"","webpack://@nomiscz/flarum-ext-auth-wechat/external \"flarum.core.compat['components/SettingsPage']\"","webpack://@nomiscz/flarum-ext-auth-wechat/external \"flarum.core.compat['components/LogInButtons']\"","webpack://@nomiscz/flarum-ext-auth-wechat/external \"flarum.core.compat['components/LogInButton']\"","webpack://@nomiscz/flarum-ext-auth-wechat/./src/forum/components/Application.js","webpack://@nomiscz/flarum-ext-auth-wechat/./src/forum/components/UnlinkModal.js","webpack://@nomiscz/flarum-ext-auth-wechat/./src/forum/components/LinkModal.js","webpack://@nomiscz/flarum-ext-auth-wechat/./src/forum/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","id","icon","package","api","uri","flarum","core","compat","_inheritsLoose","subClass","superClass","constructor","__proto__","Application","linkDone","returnCode","alert","app","modal","close","alerts","show","type","translator","trans","config","session","user","savePreferences","setTimeout","dismiss","UnlinkModal","className","title","content","data","attributes","providersCount","loading","this","onclick","hide","disabled","onsubmit","e","preventDefault","request","method","url","forum","attribute","then","Modal","LinkModal","path","showLogin","$window","$","window","open","height","width","initializers","add","extend","SettingsPage","items","WeChatAuth","isLinked","LogInButtons","wechat"],"mappings":"2BACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QA0Df,OArDAF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,EAAEe,EAA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,IAAjB,WAAgCtC,IAAM,QAASlD,MAAQ,WAEnDyF,iBAAOC,IAAarE,UAAW,gBAAgB,SAACsE,GAAU,MASlDjD,IAAIS,QAAQC,KAPZQ,KACIC,WACI+B,WACIC,gBALsC,SAWtDF,EAAMH,IAAN,OAAiBtC,IAAO1D,OAAOiC,GAC3B,EAAC,IAAD,CAAQgC,UAAS,UAAYP,IAAO1D,OAAOiC,GAA1B,YAAuCoE,EAAW,SAAW,WAAanE,KAAMwB,IAAO1D,OAAOkC,KAC3GqD,KAAI,SAAW/E,KAAQiE,QAAS,kBAAMvB,IAAIC,MAAMG,KAAK+C,EAAWrC,EAAcsB,KAC7EpC,IAAIM,WAAWC,MAASC,IAAO1D,OAAOQ,KAAtC,mBAA4D6F,EAAW,SAAW,cAK/FJ,iBAAOK,IAAazE,UAAW,SAAS,SAACsE,GACrCA,EAAMH,IAAItC,IAAM,QAASzB,GACrB,EAAC,IAAD,CACIgC,UAAS,uBAAyBP,IAAO1D,OAAOiC,GAChDC,KAAMwB,IAAO1D,OAAOkC,KACpBqD,KAAM7B,IAAOtB,IAAIC,KAChBa,IAAIM,WAAWC,MAASC,IAAO1D,OAAOQ,KAAtC,gCAMjB0C,IAAIqD,OAAS,IAAIzD","file":"forum.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 11);\n","export default {\n module: {\n name: 'nomiscz-auth-wechat',\n id: 'WeChatAuth',\n icon: 'fab fa-weixin'\n },\n package: {\n name: 'flarum-ext-auth-wechat'\n },\n api: {\n uri: '/auth/wechat'\n }\n};\n","module.exports = flarum.core.compat['app'];","export default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}","module.exports = flarum.core.compat['components/Button'];","module.exports = flarum.core.compat['components/Modal'];","module.exports = flarum.core.compat['extend'];","module.exports = flarum.core.compat['components/SettingsPage'];","module.exports = flarum.core.compat['components/LogInButtons'];","module.exports = flarum.core.compat['components/LogInButton'];","import config from '../../config';\n\nexport default class Application {\n linkDone(returnCode) {\n\n let alert;\n\n switch (returnCode) {\n\n case 'already_linked':\n app.modal.close();\n alert = app.alerts.show({ type: 'error' }, app.translator.trans(`${config.module.name}.forum.alerts.already_linked`));\n break;\n case 'already_used':\n alert = app.alerts.show({ type: 'error' }, app.translator.trans(`${config.module.name}.forum.alerts.already_used`));\n break;\n case 'done':\n app.modal.close();\n app.session.user.savePreferences();\n alert = app.alerts.show({ type: 'success' }, app.translator.trans(`${config.module.name}.forum.alerts.link_success`));\n break;\n case 'error':\n alert = app.alerts.show({ type: 'error' }, app.translator.trans(`${config.module.name}.forum.alerts.error`));\n break;\n }\n\n setTimeout(() => {\n app.alerts.dismiss(alert);\n }, 5000);\n }\n}\n","import Modal from 'flarum/components/Modal';\nimport Button from 'flarum/components/Button';\n\nimport config from '../../config';\n\nexport default class UnlinkModal extends Modal {\n className() {\n return `${config.module.id}UnlinkModal Modal--small`;\n }\n\n title() {\n return app.translator.trans(`${config.module.name}.forum.modals.unlink.title`);\n }\n\n content() {\n const {\n data: {\n attributes: {\n 'WeChatAuth': {\n providersCount = 0\n },\n },\n },\n } = app.session.user;\n\n return (\n
\n
\n
\n

{app.translator.trans(`${config.module.name}.forum.modals.unlink.info.confirm`)}

\n {(providersCount <= 1)\n ?\n

\n {app.translator.trans(`${config.module.name}.forum.modals.unlink.info.no_providers`)}\n

\n : ''\n }\n
\n
\n \n \n
\n
\n
\n
\n );\n }\n\n onsubmit(e) {\n\n let alert;\n\n e.preventDefault();\n this.loading = true;\n\n app.request({\n method: 'POST',\n url: `${app.forum.attribute('apiUrl')}/${config.api.uri}/unlink`,\n }).then(() => {\n app.session.user.savePreferences();\n this.hide();\n alert = app.alerts.show({ type: 'success' }, app.translator.trans(`${config.module.name}.forum.alerts.unlink_success`));\n });\n\n setTimeout(() => {\n app.alerts.dismiss(alert);\n }, 5000);\n }\n}\n","import Modal from 'flarum/components/Modal';\nimport Button from 'flarum/components/Button';\n\nimport config from '../../config';\n\nexport default class LinkModal extends Modal {\n className() {\n return `${config.module.id}LinkModal Modal--small`;\n }\n\n title() {\n return app.translator.trans(`${config.module.name}.forum.modals.link.title`);\n }\n\n content() {\n return (\n
\n
\n
\n \n
\n
\n
\n );\n }\n\n showLogin() {\n\n const width = 600;\n const height = 400;\n const $window = $(window);\n\n window.open(`${app.forum.attribute('apiUrl')}/${config.api.uri}/link`, `${config.module.id}LinkPopup`,\n `width=${width},` +\n `height=${height},` +\n `top=${$window.height() / 2 - height / 2},` +\n `left=${$window.width() / 2 - width / 2},` +\n 'status=no,scrollbars=no,resizable=no');\n\n this.loading = true;\n }\n}","import { extend } from 'flarum/extend';\nimport app from 'flarum/app';\n\nimport config from '../config';\n\nimport SettingsPage from 'flarum/components/SettingsPage';\nimport Application from './components/Application';\nimport UnlinkModal from \"./components/UnlinkModal\";\nimport LinkModal from \"./components/LinkModal\";\n\nimport LogInButtons from 'flarum/components/LogInButtons';\nimport LogInButton from 'flarum/components/LogInButton';\nimport Button from 'flarum/components/Button';\n\napp.initializers.add(`nomiscz/${config.package.name}`, () => {\n\n extend(SettingsPage.prototype, 'accountItems', (items) => {\n const {\n data: {\n attributes: {\n WeChatAuth: {\n isLinked = false\n },\n },\n },\n } = app.session.user;\n\n items.add(`link${config.module.id}`,\n \n );\n });\n\n extend(LogInButtons.prototype, 'items', (items) => {\n items.add(config.package.id,\n \n {app.translator.trans(`${config.module.name}.forum.buttons.login`)}\n \n );\n });\n});\n\napp.wechat = new Application();"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"forum.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,OAAe,OCA1D,EAA+BF,OAAOC,KAAKC,OAAY,I,aCA7D,SACEvB,OAAQ,CACNwB,KAAM,sBACNC,GAAI,aACJC,KAAM,iBAERC,QAAS,CACPH,KAAM,0BAERI,IAAK,CACHC,IAAK,iBCVH,EAA+BR,OAAOC,KAAKC,OAAO,2B,aCEnCO,EAAW,oBAAAA,IAAA,CA2B3B,OA3B2BA,EAAAf,UAC5BgB,SAAA,SAASC,GAEL,IAAIC,EAEJ,OAAQD,GAEJ,IAAK,iBACDE,IAAIC,MAAMC,QACVH,EAAQC,IAAIG,OAAOC,KAAK,CAAEC,KAAM,SAAWL,IAAIM,WAAWC,MAASC,EAAO1C,OAAOwB,KAAI,iCACrF,MACJ,IAAK,eACDS,EAAQC,IAAIG,OAAOC,KAAK,CAAEC,KAAM,SAAWL,IAAIM,WAAWC,MAASC,EAAO1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,OAAOxD,EAAO1C,OAAOyB,GAC3B8C,EAACC,IAAM,CAACT,UAAS,UAAYrB,EAAO1C,OAAOyB,GAAE,YAAW8E,EAAW,SAAW,WAAa7E,KAAMgB,EAAO1C,OAAO0B,KAC3GgE,KAAI,SAAWlE,KAAQmD,QAAS,kBAAMzC,IAAAA,MAAUI,KAAKiE,EAAW7C,EAAc+B,EAAU,GACvFvD,IAAAA,WAAeO,MAASC,EAAO1C,OAAOwB,KAAI,mBAAkB+E,EAAW,SAAW,UAG/F,KAEAJ,EAAAA,EAAAA,QAAOK,IAAAA,UAAwB,SAAS,SAACH,GACrCA,EAAMH,IAAIxD,EAAM,QAASjB,GACrB8C,EAACkC,IAAW,CACR1C,UAAS,uBAAyBrB,EAAO1C,OAAOyB,GAChDC,KAAMgB,EAAO1C,OAAO0B,KACpBgE,KAAMhD,EAAOd,IAAIC,KAChBK,IAAAA,WAAeO,MAASC,EAAO1C,OAAOwB,KAAI,yBAGvD,GACJ,IAEAU,IAAAA,OAAa,IAAIJ,C","sources":["webpack://@nomiscz/flarum-ext-auth-wechat/webpack/bootstrap","webpack://@nomiscz/flarum-ext-auth-wechat/webpack/runtime/compat get default export","webpack://@nomiscz/flarum-ext-auth-wechat/webpack/runtime/define property getters","webpack://@nomiscz/flarum-ext-auth-wechat/webpack/runtime/hasOwnProperty shorthand","webpack://@nomiscz/flarum-ext-auth-wechat/webpack/runtime/make namespace object","webpack://@nomiscz/flarum-ext-auth-wechat/external root \"flarum.core.compat['extend']\"","webpack://@nomiscz/flarum-ext-auth-wechat/external root \"flarum.core.compat['app']\"","webpack://@nomiscz/flarum-ext-auth-wechat/./src/config.js","webpack://@nomiscz/flarum-ext-auth-wechat/external root \"flarum.core.compat['components/SettingsPage']\"","webpack://@nomiscz/flarum-ext-auth-wechat/./src/forum/components/Application.js","webpack://@nomiscz/flarum-ext-auth-wechat/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@nomiscz/flarum-ext-auth-wechat/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@nomiscz/flarum-ext-auth-wechat/external root \"flarum.core.compat['components/Modal']\"","webpack://@nomiscz/flarum-ext-auth-wechat/external root \"flarum.core.compat['components/Button']\"","webpack://@nomiscz/flarum-ext-auth-wechat/./src/forum/components/UnlinkModal.js","webpack://@nomiscz/flarum-ext-auth-wechat/./src/forum/components/LinkModal.js","webpack://@nomiscz/flarum-ext-auth-wechat/external root \"flarum.core.compat['components/LogInButtons']\"","webpack://@nomiscz/flarum-ext-auth-wechat/external root \"flarum.core.compat['components/LogInButton']\"","webpack://@nomiscz/flarum-ext-auth-wechat/./src/forum/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))","// 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['extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['app'];","export default {\n module: {\n name: 'nomiscz-auth-wechat',\n id: 'WeChatAuth',\n icon: 'fab fa-weixin'\n },\n package: {\n name: 'flarum-ext-auth-wechat'\n },\n api: {\n uri: '/auth/wechat'\n }\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['components/SettingsPage'];","import config from '../../config';\n\nexport default class Application {\n linkDone(returnCode) {\n\n let alert;\n\n switch (returnCode) {\n\n case 'already_linked':\n app.modal.close();\n alert = app.alerts.show({ type: 'error' }, app.translator.trans(`${config.module.name}.forum.alerts.already_linked`));\n break;\n case 'already_used':\n alert = app.alerts.show({ type: 'error' }, app.translator.trans(`${config.module.name}.forum.alerts.already_used`));\n break;\n case 'done':\n app.modal.close();\n app.session.user.savePreferences();\n alert = app.alerts.show({ type: 'success' }, app.translator.trans(`${config.module.name}.forum.alerts.link_success`));\n break;\n case 'error':\n alert = app.alerts.show({ type: 'error' }, app.translator.trans(`${config.module.name}.forum.alerts.error`));\n break;\n }\n\n setTimeout(() => {\n app.alerts.dismiss(alert);\n }, 5000);\n }\n}\n","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['components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['components/Button'];","import Modal from 'flarum/components/Modal';\nimport Button from 'flarum/components/Button';\n\nimport config from '../../config';\n\nexport default class UnlinkModal extends Modal {\n className() {\n return `${config.module.id}UnlinkModal Modal--small`;\n }\n\n title() {\n return app.translator.trans(`${config.module.name}.forum.modals.unlink.title`);\n }\n\n content() {\n const {\n data: {\n attributes: {\n 'WeChatAuth': {\n providersCount = 0\n },\n },\n },\n } = app.session.user;\n\n return (\n
\n
\n
\n

{app.translator.trans(`${config.module.name}.forum.modals.unlink.info.confirm`)}

\n {(providersCount <= 1)\n ?\n

\n {app.translator.trans(`${config.module.name}.forum.modals.unlink.info.no_providers`)}\n

\n : ''\n }\n
\n
\n \n \n
\n
\n
\n
\n );\n }\n\n onsubmit(e) {\n\n let alert;\n\n e.preventDefault();\n this.loading = true;\n\n app.request({\n method: 'POST',\n url: `${app.forum.attribute('apiUrl')}/${config.api.uri}/unlink`,\n }).then(() => {\n app.session.user.savePreferences();\n this.hide();\n alert = app.alerts.show({ type: 'success' }, app.translator.trans(`${config.module.name}.forum.alerts.unlink_success`));\n });\n\n setTimeout(() => {\n app.alerts.dismiss(alert);\n }, 5000);\n }\n}\n","import Modal from 'flarum/components/Modal';\nimport Button from 'flarum/components/Button';\n\nimport config from '../../config';\n\nexport default class LinkModal extends Modal {\n className() {\n return `${config.module.id}LinkModal Modal--small`;\n }\n\n title() {\n return app.translator.trans(`${config.module.name}.forum.modals.link.title`);\n }\n\n content() {\n return (\n
\n
\n
\n \n
\n
\n
\n );\n }\n\n showLogin() {\n\n const width = 600;\n const height = 400;\n const $window = $(window);\n\n window.open(`${app.forum.attribute('apiUrl')}/${config.api.uri}/link`, `${config.module.id}LinkPopup`,\n `width=${width},` +\n `height=${height},` +\n `top=${$window.height() / 2 - height / 2},` +\n `left=${$window.width() / 2 - width / 2},` +\n 'status=no,scrollbars=no,resizable=no');\n\n this.loading = true;\n }\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['components/LogInButtons'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['components/LogInButton'];","import { extend } from 'flarum/extend';\nimport app from 'flarum/app';\n\nimport config from '../config';\n\nimport SettingsPage from 'flarum/components/SettingsPage';\nimport Application from './components/Application';\nimport UnlinkModal from \"./components/UnlinkModal\";\nimport LinkModal from \"./components/LinkModal\";\n\nimport LogInButtons from 'flarum/components/LogInButtons';\nimport LogInButton from 'flarum/components/LogInButton';\nimport Button from 'flarum/components/Button';\n\napp.initializers.add(`nomiscz/${config.package.name}`, () => {\n\n extend(SettingsPage.prototype, 'accountItems', (items) => {\n const {\n data: {\n attributes: {\n WeChatAuth: {\n isLinked = false\n },\n },\n },\n } = app.session.user;\n\n items.add(`link${config.module.id}`,\n \n );\n });\n\n extend(LogInButtons.prototype, 'items', (items) => {\n items.add(config.package.id,\n \n {app.translator.trans(`${config.module.name}.forum.buttons.login`)}\n \n );\n });\n});\n\napp.wechat = new Application();"],"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","name","id","icon","package","api","uri","Application","linkDone","returnCode","alert","app","modal","close","alerts","show","type","translator","trans","config","session","user","savePreferences","setTimeout","dismiss","_setPrototypeOf","p","setPrototypeOf","bind","__proto__","_inheritsLoose","subClass","superClass","create","constructor","UnlinkModal","_Modal","apply","arguments","_proto","className","title","content","_this","_app$session$user$dat","data","attributes","providersCount","m","Button","loading","this","onclick","hide","disabled","onsubmit","e","_this2","preventDefault","request","method","url","forum","attribute","then","Modal","LinkModal","path","showLogin","$window","$","window","open","height","width","add","extend","SettingsPage","items","WeChatAuth","isLinked","LogInButtons","LogInButton"],"sourceRoot":""} \ No newline at end of file