text: (()=>{var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var a in r)e.o(r,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:r[a]})},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 r=flarum.core.compat["admin/app"];var a=e.n(r);const n=flarum.core.compat.extend,i=flarum.core.compat["admin/components/HeaderSecondary"];var o=e.n(i);const s=flarum.core.compat["common/components/LinkButton"];var c=e.n(s);function d(e,t){return d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},d(e,t)}const u=flarum.core.compat["components/ExtensionPage"];var l=e.n(u);const p=flarum.core.compat["components/LoadingIndicator"];var x=e.n(p);const v=flarum.core.compat["helpers/icon"];var g=e.n(v);const f=flarum.core.compat["utils/classList"];var y=e.n(f),h=function(e){var t,r;function n(){return e.apply(this,arguments)||this}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,d(t,r);var i=n.prototype;return i.oninit=function(t){var r=this;e.prototype.oninit.call(this,t),this.token=a().data.settings["extiverse-mercury.token"]||null,this.loading=!0,this.updates=[],this.token?a().request({method:"GET",url:a().forum.attribute("apiUrl")+"/extiverse/mercury/extension-updates"}).then((function(e){r.updates=e,r.loading=!1,m.redraw()})):this.loading=!1},i.className=function(){return"Extiverse Mercury ExtensionUpdates--Page"},i.content=function(){return this.loading?m(x(),null):e.prototype.content.call(this)},i.sections=function(){var t=e.prototype.sections.call(this);return t.remove("permissions"),t.add("extension-updates",this.extensionUpdates()),t},i.extensionUpdates=function(){var e=this;return this.loading?m("div",null):m("div",{className:"container UserListPage"},m("div",{className:"UserListPage-grid UserListPage-grid--loaded",style:"--columns: 4"},m("div",{"aria-rowindex":1,"aria-colindex":1,className:"UserListPage-grid-header"},a().translator.trans("extiverse-mercury.admin.extension-updates-page.extension-name")),m("div",{"aria-rowindex":1,"aria-colindex":2,className:"UserListPage-grid-header"},a().translator.trans("extiverse-mercury.admin.extension-updates-page.installed-version")),m("div",{"aria-rowindex":1,"aria-colindex":3,className:"UserListPage-grid-header"},a().translator.trans("extiverse-mercury.admin.extension-updates-page.highest-version")),m("div",{"aria-rowindex":1,"aria-colindex":4,className:"UserListPage-grid-header"},a().translator.trans("extiverse-mercury.admin.extension-updates-page.extension-is-up-to-date")),this.updates.map((function(t,r){return e.extensionUpdateItem(t,r)}))))},i.extensionUpdateItem=function(e,t){var r=e["needs-update"]?"update-available":"update-ok",a=y()(["UserListPage-grid-rowItem",t%2>0&&"UserListPage-grid-rowItem--shaded",r]);return[m("div",{className:a,"aria-rowindex":t+2,"aria-colindex":1},e.title," ",m("code",null,"(",e.name,")")),m("div",{className:a,"aria-rowindex":t+2,"aria-colindex":2},e["current-version"]),m("div",{className:a,"aria-rowindex":t+2,"aria-colindex":3},e["highest-version"]),m("div",{className:"centered "+a,"aria-rowindex":t+2,"aria-colindex":4},e["needs-update"]?g()("fas fa-exclamation-triangle"):g()("fas fa-check"))]},n}(l());const b=flarum.core.compat["common/components/Link"];var P=e.n(b);a().initializers.add("extiverse-mercury",(function(){var e="https://extiverse.com/auth/mercury?community="+window.location.host;a().extensionData.for("extiverse-mercury").registerSetting({setting:"extiverse-mercury.token",type:"text",label:a().translator.trans("extiverse-mercury.admin.settings.token",{a:m(P(),{href:e,target:"_blank",external:!0})}),help:a().translator.trans("extiverse-mercury.admin.settings.token-description",{a:m(P(),{href:e,target:"_blank",external:!0})})}).registerPage(h),(0,n.extend)(o().prototype,"items",(function(e){var t,r,n,i=a().data.settings["extiverse-mercury.token"]||null,o=Number(a().data.settings["extiverse-mercury.updates-required"]);i?(t=a().translator.trans("extiverse-mercury.admin.header-secondary.updates",{count:o}),r=(n=o>0)?"fas fa-exclamation-triangle":"fas fa-thumbs-up"):(t=a().translator.trans("extiverse-mercury.admin.header-secondary.no-token"),r="fas fa-exclamation-triangle",n=!0),e.add("extiverse-mercury",m(c(),{className:"ExtiverseMercuryButton Button "+(n&&"Button--danger"),href:a().route("extension",{id:"extiverse-mercury"}),icon:r},t),10)}))}))})(),module.exports=t})();
  //# sourceMappingURL=admin.js.map