diff --git a/extensions/tags/js/dist/forum.js b/extensions/tags/js/dist/forum.js index 70f990ca38..011e6326e3 100644 --- a/extensions/tags/js/dist/forum.js +++ b/extensions/tags/js/dist/forum.js @@ -1,3 +1,3 @@ /*! For license information please see forum.js.LICENSE.txt */ -(()=>{var t={810:()=>{},477:(t,e,n)=>{"use strict";n.d(e,{l:()=>Jt});const r=flarum.core.compat["forum/app"];var a=n.n(r);function o(t,e,n,r,a,o,s){try{var i=t[o](s),c=i.value}catch(t){return void n(t)}i.done?e(c):Promise.resolve(c).then(r,a)}function s(t){return function(){var e=this,n=arguments;return new Promise((function(r,a){var s=t.apply(e,n);function i(t){o(s,r,a,i,c,"next",t)}function c(t){o(s,r,a,i,c,"throw",t)}i(void 0)}))}}var i=n(507),c=n.n(i);const l=flarum.core.compat["common/app"];var u=n.n(l),d=function(){function t(){this.loadedIncludes=void 0}var e=t.prototype;return e.load=function(){var t=s(c().mark((function t(e){var n,r=this;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0===e&&(e=[]),this.loadedIncludes){t.next=3;break}return t.abrupt("return",this.query(e));case 3:if(0!==(n=e.filter((function(t){return!r.loadedIncludes.has(t)}))).length){t.next=6;break}return t.abrupt("return",Promise.resolve(u().store.all("tags")));case 6:return t.abrupt("return",this.query(n));case 7:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.query=function(){var t=s(c().mark((function t(e){var n=this;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return void 0===e&&(e=[]),null!=this.loadedIncludes||(this.loadedIncludes=new Set),t.abrupt("return",u().store.find("tags",{include:e.join(",")}).then((function(t){return e.forEach((function(t){return n.loadedIncludes.add(t)})),t})));case 3:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),t}();const f=flarum.core.compat["common/extend"],p=flarum.core.compat["forum/components/IndexPage"];var h=n.n(p);const g=flarum.core.compat["common/components/Separator"];var v=n.n(g);const y=flarum.core.compat["common/components/LinkButton"];var b=n.n(y);function T(t,e){return T=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},T(t,e)}function x(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,T(t,e)}const w=flarum.core.compat["common/components/Link"];var _=n.n(w);const N=flarum.core.compat["common/utils/classList"];var L=n.n(N);function I(t,e,n){void 0===e&&(e={}),void 0===n&&(n={});var r=t&&t.icon(),a=n.useColor,o=void 0===a||a;return e.className=L()([e.className,"icon",r?t.icon():"TagIcon"]),t&&o?(e.style=e.style||{},e.style["--color"]=t.color(),r&&(e.style.color=t.color())):t||(e.className+=" untagged"),r?m("i",e):m("span",e)}var S=function(t){function e(){return t.apply(this,arguments)||this}return x(e,t),e.prototype.view=function(t){var e=this.attrs.model,n=e&&e.description(),r=L()("TagLinkButton hasIcon",{child:e.isChild()},this.attrs.className);return m(_(),{className:r,href:this.attrs.route,style:e?{"--color":e.color()}:void 0,title:n||void 0},I(e,{className:"Button-icon"}),m("span",{className:"Button-label"},e?e.name():app.translator.trans("flarum-tags.forum.index.untagged_link")))},e.initAttrs=function(e){t.initAttrs.call(this,e);var n=e.model;e.params.tags=n?n.slug():"untagged",e.route=app.route("tag",e.params)},e}(b());const P=flarum.core.compat["common/components/Page"];var C=n.n(P);const k=flarum.core.compat["common/components/LoadingIndicator"];var A=n.n(k);const D=flarum.core.compat["common/helpers/listItems"];var E=n.n(D);const O=flarum.core.compat["common/utils/ItemList"];var j=n.n(O);const M=flarum.core.compat["common/helpers/humanTime"];var R=n.n(M);const q=flarum.core.compat["common/helpers/textContrastClass"];var B=n.n(q);const H=flarum.core.compat["common/utils/extract"];var F=n.n(H);function G(t,e){void 0===e&&(e={}),e.style=e.style||{},e.className="TagLabel "+(e.className||"");var n=F()(e,"link"),r=t?t.name():app.translator.trans("flarum-tags.lib.deleted_tag_text");if(t){var a=t.color();a&&(e.style["--tag-bg"]=a,e.className=L()(e.className,"colored",B()(a))),n&&(e.title=t.description()||"",e.href=app.route("tag",{tags:t.slug()})),t.isChild()&&(e.className+=" TagLabel--child")}else e.className+=" untagged";return m(n?_():"span",e,m("span",{className:"TagLabel-text"},t&&t.icon()&&I(t,{className:"TagLabel-icon"},{useColor:!1}),m("span",{className:"TagLabel-name"},r)))}function V(t){return t.slice(0).sort((function(t,e){var n=t.position(),r=e.position();if(null===n&&null===r)return e.discussionCount()-t.discussionCount();if(null===r)return-1;if(null===n)return 1;var a=t.parent(),o=e.parent();return a===o?n-r:a&&o?a.position()-o.position():a?a===e?1:a.position()-r:o?o===t?-1:n-o.position():0}))}var K=function(t){function e(){return t.apply(this,arguments)||this}x(e,t);var n=e.prototype;return n.oninit=function(e){var n=this;t.prototype.oninit.call(this,e),app.history.push("tags",app.translator.trans("flarum-tags.forum.header.back_to_tags_tooltip")),this.tags=[];var r=app.preloadedApiDocument();r?this.tags=V(r.filter((function(t){return!t.isChild()}))):(this.loading=!0,app.tagList.load(["children","lastPostedDiscussion","parent"]).then((function(){n.tags=V(app.store.all("tags").filter((function(t){return!t.isChild()}))),n.loading=!1,m.redraw()})))},n.oncreate=function(e){t.prototype.oncreate.call(this,e),app.setTitle(app.translator.trans("flarum-tags.forum.all_tags.meta_title_text")),app.setTitleCount(0)},n.view=function(){return m("div",{className:"TagsPage"},this.pageContent().toArray())},n.pageContent=function(){var t=new(j());return t.add("hero",this.hero(),100),t.add("main",m("div",{className:"container"},this.mainContent().toArray()),10),t},n.mainContent=function(){var t=new(j());return t.add("sidebar",this.sidebar(),100),t.add("content",this.content(),10),t},n.content=function(){return m("div",{className:"TagsPage-content sideNavOffset"},this.contentItems().toArray())},n.contentItems=function(){var t=new(j());if(this.loading)t.add("loading",m(A(),null));else{var e=this.tags.filter((function(t){return null!==t.position()})),n=this.tags.filter((function(t){return null===t.position()}));t.add("tagTiles",this.tagTileListView(e),100),n.length&&t.add("cloud",this.cloudView(n),10)}return t},n.hero=function(){return h().prototype.hero()},n.sidebar=function(){return m("nav",{className:"TagsPage-nav IndexPage-nav sideNav"},m("ul",null,E()(this.sidebarItems().toArray())))},n.sidebarItems=function(){return h().prototype.sidebarItems()},n.tagTileListView=function(t){return m("ul",{className:"TagTiles"},t.map(this.tagTileView.bind(this)))},n.tagTileView=function(t){var e=t.lastPostedDiscussion(),n=V(t.children()||[]);return m("li",{className:L()("TagTile",{colored:t.color()},B()(t.color())),style:{"--tag-bg":t.color()}},m(_(),{className:"TagTile-info",href:app.route.tag(t)},t.icon()&&I(t,{},{useColor:!1}),m("h3",{className:"TagTile-name"},t.name()),m("p",{className:"TagTile-description"},t.description()),!!n&&m("div",{className:"TagTile-children"},n.map((function(t){return[m(_(),{href:app.route.tag(t)},t.name())," "]})))),e?m(_(),{className:"TagTile-lastPostedDiscussion",href:app.route.discussion(e,e.lastPostNumber())},m("span",{className:"TagTile-lastPostedDiscussion-title"},e.title()),R()(e.lastPostedAt())):m("span",{className:"TagTile-lastPostedDiscussion"}))},n.cloudView=function(t){return m("div",{className:"TagCloud"},t.map((function(t){return[G(t,{link:!0})," "]})))},e}(C());const $=flarum.core.compat["admin/app"];var U=n.n($);function Y(){(0,f.extend)(h().prototype,"navItems",(function(t){if(t.add("tags",m(b(),{icon:"fas fa-th-large",href:U().route("tags")},U().translator.trans("flarum-tags.forum.index.tags_link")),-10),!U().current.matches(K)){t.add("separator",m(v(),null),-12);var e=U().search.stickyParams(),n=U().store.all("tags"),r=this.currentTag(),a=function(n){var a=r===n;!a&&r&&(a=r.parent()===n),t.add("tag"+n.id(),m(S,{model:n,params:e,active:a},null==n?void 0:n.name()),-14)};V(n).filter((function(t){return null!==t.position()&&(!t.isChild()||r&&(t.parent()===r||t.parent()===r.parent()))})).forEach(a);var o=n.filter((function(t){return null===t.position()})).sort((function(t,e){return e.discussionCount()-t.discussionCount()}));o.splice(0,3).forEach(a),o.length&&t.add("moreTags",m(b(),{href:U().route("tags")},U().translator.trans("flarum-tags.forum.index.more_link")),-16)}}))}const z=flarum.core.compat["forum/states/DiscussionListState"];var J=n.n(z);const Q=flarum.core.compat["forum/states/GlobalSearchState"];var W=n.n(Q);const X=flarum.core.compat["common/Component"];var Z=n.n(X),tt=function(t){function e(){return t.apply(this,arguments)||this}return x(e,t),e.prototype.view=function(){var t,e=this.attrs.model,n=e.color();return m("header",{className:L()("Hero","TagHero",(t={"TagHero--colored":n},t[B()(n)]=n,t)),style:n?{"--hero-bg":n}:void 0},m("div",{className:"container"},m("div",{className:"containerNarrow"},m("h1",{className:"Hero-title"},e.icon()&&I(e,{},{useColor:!1})," ",e.name()),m("div",{className:"Hero-subtitle"},e.description()))))},e}(Z()),et=function(t){return a().store.all("tags").find((function(e){return 0===e.slug().localeCompare(t,void 0,{sensitivity:"base"})}))};function nt(){h().prototype.currentTag=function(){var t=this;if(this.currentActiveTag)return this.currentActiveTag;var e=a().search.params().tags,n=null;if(e&&(n=et(e)),e&&!n||n&&!n.isChild()&&!n.children()){if(this.currentTagLoading)return;this.currentTagLoading=!0,a().store.find("tags",e,{include:"children,children.parent,parent,state"}).then((function(){t.currentActiveTag=et(e),m.redraw()})).finally((function(){t.currentTagLoading=!1}))}return n?(this.currentActiveTag=n,this.currentActiveTag):void 0},(0,f.override)(h().prototype,"hero",(function(t){var e=this.currentTag();return e?m(tt,{model:e}):t()})),(0,f.extend)(h().prototype,"view",(function(t){var e=this.currentTag();e&&(t.attrs.className+=" IndexPage--tag"+e.id())})),(0,f.extend)(h().prototype,"setTitle",(function(){var t=this.currentTag();t&&a().setTitle(t.name())})),(0,f.extend)(h().prototype,"sidebarItems",(function(t){var e=this.currentTag();if(e){var n=e.color(),r=e.canStartDiscussion()||!a().session.user,o=t.get("newDiscussion");n&&(o.attrs.className=L()([o.attrs.className,"Button--tagColored",B()(n)]),o.attrs.style={"--color":n}),o.attrs.disabled=!r,o.children=a().translator.trans(r?"core.forum.index.start_discussion_button":"core.forum.index.cannot_start_discussion_button")}})),(0,f.extend)(W().prototype,"params",(function(t){t.tags=m.route.param("tags")})),(0,f.extend)(J().prototype,"requestParams",(function(t){var e;if("string"==typeof t.include?t.include=[t.include]:null==(e=t.include)||e.push("tags","tags.parent"),this.params.tags){var n,r=null!=(n=t.filter)?n:{};r.tag=this.params.tags;var a=r.q;a&&(r.q=a+" tag:"+this.params.tags),t.filter=r}}))}const rt=flarum.core.compat["forum/components/DiscussionListItem"];var at=n.n(rt);const ot=flarum.core.compat["forum/components/DiscussionHero"];var st=n.n(ot);function it(t,e){if(null==t)return{};var n,r,a={},o=Object.keys(t);for(r=0;r=0||(a[n]=t[n]);return a}function ct(t){var e,n,r="";if("string"==typeof t||"number"==typeof t)r+=t;else if("object"==typeof t)if(Array.isArray(t))for(e=0;et.max.primary)throw new Error("The minimum number of primary tags allowed cannot be more than the maximum number of primary tags allowed.");if(t.min.secondary>t.max.secondary)throw new Error("The minimum number of secondary tags allowed cannot be more than the maximum number of secondary tags allowed.");if(t.min.total>t.max.primary+t.max.secondary)throw new Error("The minimum number of tags allowed cannot be more than the maximum number of primary and secondary tags allowed together.");if(t.max.totalt.max.total)throw new Error("The minimum number of tags allowed cannot be more than the maximum number of tags allowed.")}(e.limits)};var n=e.prototype;return n.oninit=function(e){var n=this;t.prototype.oninit.call(this,e),this.navigator.onUp((function(){return n.setIndex(n.getCurrentNumericIndex()-1,!0)})).onDown((function(){return n.setIndex(n.getCurrentNumericIndex()+1,!0)})).onSelect(this.select.bind(this)).onRemove((function(){return n.selected.splice(n.selected.length-1,1)})),u().tagList.load(["parent"]).then((function(t){n.loading=!1,n.attrs.selectableTags&&(t=n.attrs.selectableTags(t)),n.tags=V(t),n.attrs.selectedTags&&n.attrs.selectedTags.map(n.addTag.bind(n)),n.indexTag=t[0],m.redraw()}))},n.className=function(){return L()("TagSelectionModal",this.attrs.className)},n.title=function(){return this.attrs.title},n.content=function(){var t=this;if(this.loading||!this.tags)return m(A(),null);var e=this.filter().toLowerCase(),n=this.primaryCount(),r=this.secondaryCount(),a=this.getFilteredTags(),o=Math.max(bt()(this.getInstruction(n,r)).length,this.filter().length);return[m("div",{className:"Modal-body"},m("div",{className:"TagSelectionModal-form"},m("div",{className:"TagSelectionModal-form-input"},m("div",{className:"TagsInput FormControl "+(this.focused?"focus":""),onclick:function(){return t.$(".TagsInput input").focus()}},m("span",{className:"TagsInput-selected"},this.selected.map((function(e){return m("span",{className:"TagsInput-tag",onclick:function(){t.removeTag(e),t.onready()}},G(e))}))),m("input",{className:"FormControl",placeholder:bt()(this.getInstruction(n,r)),bidi:this.filter,style:{width:o+"ch"},onkeydown:this.navigator.navigate.bind(this.navigator),onfocus:function(){return t.focused=!0},onblur:function(){return t.focused=!1}}))),m("div",{className:"TagSelectionModal-form-submit App-primaryControl"},m(ht(),{type:"submit",className:"Button Button--primary",disabled:!this.meetsRequirements(n,r),icon:"fas fa-check"},u().translator.trans("flarum-tags.lib.tag_selection_modal.submit_button"))))),m("div",{className:"Modal-footer"},m("ul",{className:"TagSelectionModal-list SelectTagList"},a.map((function(n){return m("li",{"data-index":n.id(),className:L()({pinned:null!==n.position(),child:!!n.parent(),colored:!!n.color(),selected:t.selected.includes(n),active:t.indexTag===n}),style:{color:n.color()},onmouseover:function(){return t.indexTag=n},onclick:t.toggleTag.bind(t,n)},I(n),m("span",{className:"SelectTagListItem-name"},wt()(n.name(),e)),n.description()?m("span",{className:"SelectTagListItem-description"},n.description()):"")}))),this.attrs.limits.allowBypassing&&m("div",{className:"TagSelectionModal-controls"},m(kt,{className:"Button",onclick:function(){return t.bypassReqs=!t.bypassReqs},isToggled:this.bypassReqs},u().translator.trans("flarum-tags.lib.tag_selection_modal.bypass_requirements"))))]},n.getFilteredTags=function(){var t=this,e=this.filter().toLowerCase(),n=this.primaryCount(),r=this.secondaryCount(),a=this.tags;return this.attrs.requireParentTag&&(a=a.filter((function(e){var n=e.parent();return null!==n&&(!1===n||t.selected.includes(n))}))),this.bypassReqs||(this.selected.length>=this.attrs.limits.max.total?a=a.filter((function(e){return t.selected.includes(e)})):(n>=this.attrs.limits.max.primary&&(a=a.filter((function(e){return!e.isPrimary()||t.selected.includes(e)}))),r>=this.attrs.limits.max.secondary&&(a=a.filter((function(e){return e.isPrimary()||t.selected.includes(e)}))))),e&&(a=a.filter((function(t){return t.name().toLowerCase().includes(e)}))),this.indexTag&&a.includes(this.indexTag)||(this.indexTag=a[0]),a},n.primaryCount=function(){return this.selected.filter((function(t){return t.isPrimary()})).length},n.secondaryCount=function(){return this.selected.filter((function(t){return!t.isPrimary()})).length},n.meetsRequirements=function(t,e){return!!(this.bypassReqs||this.attrs.allowResetting&&0===this.selected.length)||!(this.selected.length=this.attrs.limits.min.primary&&e>=this.attrs.limits.min.secondary},n.addTag=function(t){if(t&&this.attrs.canSelect(t)){if(this.attrs.onSelect&&this.attrs.onSelect(t,this.selected),this.attrs.requireParentTag){var e=t.parent();e&&!this.selected.includes(e)&&this.selected.push(e)}this.selected.includes(t)||this.selected.push(t)}},n.removeTag=function(t){var e=this.selected.indexOf(t);-1!==e&&(this.selected.splice(e,1),this.attrs.requireParentTag&&this.selected.filter((function(e){return e.parent()===t})).forEach(this.removeTag.bind(this)),this.attrs.onDeselect&&this.attrs.onDeselect(t,this.selected))},n.toggleTag=function(t){this.tags&&(this.selected.includes(t)?this.removeTag(t):this.addTag(t),this.filter()&&(this.filter(""),this.indexTag=this.tags[0]),this.onready())},n.getInstruction=function(t,e){if(this.bypassReqs)return"";if(t li")},n.getCurrentNumericIndex=function(){return this.indexTag?this.selectableItems().index(this.getItem(this.indexTag)):-1},n.getItem=function(t){return this.selectableItems().filter('[data-index="'+t.id()+'"]')},n.setIndex=function(t,e){var n=this.selectableItems(),r=n.parent();t<0?t=n.length-1:t>=n.length&&(t=0);var a=n.eq(t);if(this.indexTag=u().store.getById("tags",a.attr("data-index")),m.redraw(),e&&this.indexTag){var o,s=r.scrollTop(),i=r.offset().top,c=i+r.outerHeight(),l=a.offset().top,d=l+a.outerHeight();lc&&(o=s-c+d+parseInt(r.css("padding-bottom"),10)),void 0!==o&&r.stop(!0).animate({scrollTop:o},100)}},e}(It()),Dt=function(t){function e(){return t.apply(this,arguments)||this}return x(e,t),e.initAttrs=function(e){var n;t.initAttrs.call(this,e);var r=e.discussion?a().translator.trans("flarum-tags.forum.choose_tags.edit_title",{title:m("em",null,e.discussion.title())}):a().translator.trans("flarum-tags.forum.choose_tags.title");e.className=L()(e.className,"TagDiscussionModal"),e.title=bt()(r),e.allowResetting=!!a().forum.attribute("canBypassTagCounts"),e.limits={allowBypassing:e.allowResetting,max:{primary:a().forum.attribute("maxPrimaryTags"),secondary:a().forum.attribute("maxSecondaryTags")},min:{primary:a().forum.attribute("minPrimaryTags"),secondary:a().forum.attribute("minSecondaryTags")}},e.requireParentTag=!0,e.selectableTags=function(){return Tt(e.discussion)},null!=e.selectedTags||(e.selectedTags=(null==(n=e.discussion)?void 0:n.tags())||[]),e.canSelect=function(t){return t.canStartDiscussion()};var o=e.onsubmit||null;e.onsubmit=function(t){var n=e.discussion;n&&n.save({relationships:{tags:t}}).then((function(){a().current.matches(vt())&&a().current.get("stream").update(),m.redraw()})),o&&o(t)}},e}(At);function Et(){(0,f.extend)(ft(),"moderationControls",(function(t,e){e.canTag()&&t.add("tags",m(ht(),{icon:"fas fa-tag",onclick:function(){return app.modal.show(Dt,{discussion:e})}},app.translator.trans("flarum-tags.forum.discussion_controls.edit_tags_button")))}))}const Ot=flarum.core.compat["forum/components/DiscussionComposer"];var jt=n.n(Ot);function Mt(){(0,f.extend)(h().prototype,"newDiscussionAction",(function(t){var e=this.currentTag();if(e){var n=e.parent(),r=n?[n,e]:[e];t.then((function(t){return t.fields.tags=r}))}else app.composer.fields.tags=[]})),(0,f.extend)(jt().prototype,"oninit",(function(){app.tagList.load(["parent"]).then((function(){return m.redraw()}))})),jt().prototype.chooseTags=function(){var t=this;Tt().length&&app.modal.show(Dt,{selectedTags:(this.composer.fields.tags||[]).slice(0),onsubmit:function(e){t.composer.fields.tags=e,t.$("textarea").focus()}})},(0,f.extend)(jt().prototype,"headerItems",(function(t){var e=this.composer.fields.tags||[],n=Tt();t.add("tags",m("a",{className:L()(["DiscussionComposer-changeTags",!n.length&&"disabled"]),onclick:this.chooseTags.bind(this)},e.length?ut(e):m("span",{className:"TagLabel untagged"},app.translator.trans("flarum-tags.forum.composer_discussion.choose_tags_link"))),10)})),(0,f.override)(jt().prototype,"onsubmit",(function(t){var e=this,n=this.composer.fields.tags||[],r=n.filter((function(t){return null!==t.position()&&!t.isChild()})),a=n.filter((function(t){return null===t.position()})),o=Tt(),s=parseInt(app.forum.attribute("minPrimaryTags")),i=parseInt(app.forum.attribute("minSecondaryTags")),c=parseInt(app.forum.attribute("maxPrimaryTags")),l=parseInt(app.forum.attribute("maxSecondaryTags"));(!n.length&&0!==c&&0!==l||r.length{var r=n(75).default;function a(){"use strict";t.exports=a=function(){return e},t.exports.__esModule=!0,t.exports.default=t.exports;var e={},n=Object.prototype,o=n.hasOwnProperty,s=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},c=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function m(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{m({},"")}catch(t){m=function(t,e,n){return t[e]=n}}function d(t,e,n,r){var a=e&&e.prototype instanceof h?e:h,o=Object.create(a.prototype),i=new P(r||[]);return s(o,"_invoke",{value:N(t,n,i)}),o}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var p={};function h(){}function g(){}function v(){}var y={};m(y,c,(function(){return this}));var b=Object.getPrototypeOf,T=b&&b(b(C([])));T&&T!==n&&o.call(T,c)&&(y=T);var x=v.prototype=h.prototype=Object.create(y);function w(t){["next","throw","return"].forEach((function(e){m(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function n(a,s,i,c){var l=f(t[a],t,s);if("throw"!==l.type){var u=l.arg,m=u.value;return m&&"object"==r(m)&&o.call(m,"__await")?e.resolve(m.__await).then((function(t){n("next",t,i,c)}),(function(t){n("throw",t,i,c)})):e.resolve(m).then((function(t){u.value=t,i(u)}),(function(t){return n("throw",t,i,c)}))}c(l.arg)}var a;s(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,a){n(t,r,e,a)}))}return a=a?a.then(o,o):o()}})}function N(t,e,n){var r="suspendedStart";return function(a,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===a)throw o;return{value:void 0,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var i=L(s,n);if(i){if(i===p)continue;return i}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=f(t,e,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}function L(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,L(t,e),"throw"===e.method))return p;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var r=f(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,p;var a=r.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function C(t){if(t){var e=t[c];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n=0;--r){var a=this.tryEntries[r],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var i=o.call(a,"catchLoc"),c=o.call(a,"finallyLoc");if(i&&c){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),S(n),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;S(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:C(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},e}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports},75:t=>{function e(n){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},507:(t,e,n)=>{var r=n(440)();t.exports=r;try{regeneratorRuntime=r}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}},e={};function n(r){var a=e[r];if(void 0!==a)return a.exports;var o=e[r]={exports:{}};return t[r](o,o.exports,n),o.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.r(r),n.d(r,{extend:()=>a.l});var t=n(810),e={};for(const n in t)"default"!==n&&(e[n]=()=>t[n]);n.d(r,e);var a=n(477)})(),module.exports=r})(); +(()=>{var t={810:()=>{},206:(t,e,n)=>{"use strict";n.d(e,{l:()=>Yt});const r=flarum.core.compat["forum/app"];var a=n.n(r);function o(t,e,n,r,a,o,s){try{var i=t[o](s),c=i.value}catch(t){return void n(t)}i.done?e(c):Promise.resolve(c).then(r,a)}function s(t){return function(){var e=this,n=arguments;return new Promise((function(r,a){var s=t.apply(e,n);function i(t){o(s,r,a,i,c,"next",t)}function c(t){o(s,r,a,i,c,"throw",t)}i(void 0)}))}}var i=n(507),c=n.n(i);const l=flarum.core.compat["common/app"];var u=n.n(l),d=function(){function t(){this.loadedIncludes=void 0}var e=t.prototype;return e.load=function(){var t=s(c().mark((function t(e){var n,r=this;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0===e&&(e=[]),this.loadedIncludes){t.next=3;break}return t.abrupt("return",this.query(e));case 3:if(0!==(n=e.filter((function(t){return!r.loadedIncludes.has(t)}))).length){t.next=6;break}return t.abrupt("return",Promise.resolve(u().store.all("tags")));case 6:return t.abrupt("return",this.query(n));case 7:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.query=function(){var t=s(c().mark((function t(e){var n=this;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return void 0===e&&(e=[]),null!=this.loadedIncludes||(this.loadedIncludes=new Set),t.abrupt("return",u().store.find("tags",{include:e.join(",")}).then((function(t){return e.forEach((function(t){return n.loadedIncludes.add(t)})),t})));case 3:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),t}();const f=flarum.core.compat["common/extend"],p=flarum.core.compat["forum/components/IndexPage"];var h=n.n(p);const g=flarum.core.compat["common/components/Separator"];var v=n.n(g);const y=flarum.core.compat["common/components/LinkButton"];var b=n.n(y);function T(t,e){return T=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},T(t,e)}function x(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,T(t,e)}const w=flarum.core.compat["common/components/Link"];var _=n.n(w);const N=flarum.core.compat["common/utils/classList"];var L=n.n(N);function I(t,e,n){void 0===e&&(e={}),void 0===n&&(n={});var r=t&&t.icon(),a=n.useColor,o=void 0===a||a;return e.className=L()([e.className,"icon",r?t.icon():"TagIcon"]),t&&o?(e.style=e.style||{},e.style["--color"]=t.color(),r&&(e.style.color=t.color())):t||(e.className+=" untagged"),r?m("i",e):m("span",e)}var S=function(t){function e(){return t.apply(this,arguments)||this}return x(e,t),e.prototype.view=function(t){var e=this.attrs.model,n=e&&e.description(),r=L()("TagLinkButton hasIcon",{child:e.isChild()},this.attrs.className);return m(_(),{className:r,href:this.attrs.route,style:e?{"--color":e.color()}:void 0,title:n||void 0},I(e,{className:"Button-icon"}),m("span",{className:"Button-label"},e?e.name():app.translator.trans("flarum-tags.forum.index.untagged_link")))},e.initAttrs=function(e){t.initAttrs.call(this,e);var n=e.model;e.params.tags=n?n.slug():"untagged",e.route=app.route("tag",e.params)},e}(b());const P=flarum.core.compat["common/components/Page"];var C=n.n(P);const k=flarum.core.compat["common/components/LoadingIndicator"];var A=n.n(k);const D=flarum.core.compat["common/helpers/listItems"];var E=n.n(D);const O=flarum.core.compat["common/utils/ItemList"];var j=n.n(O);const M=flarum.core.compat["common/helpers/humanTime"];var R=n.n(M);const q=flarum.core.compat["common/helpers/textContrastClass"];var B=n.n(q);const H=flarum.core.compat["common/utils/extract"];var F=n.n(H);function G(t,e){void 0===e&&(e={}),e.style=e.style||{},e.className="TagLabel "+(e.className||"");var n=F()(e,"link"),r=t?t.name():app.translator.trans("flarum-tags.lib.deleted_tag_text");if(t){var a=t.color();a&&(e.style["--tag-bg"]=a,e.className=L()(e.className,"colored",B()(a))),n&&(e.title=t.description()||"",e.href=app.route("tag",{tags:t.slug()})),t.isChild()&&(e.className+=" TagLabel--child")}else e.className+=" untagged";return m(n?_():"span",e,m("span",{className:"TagLabel-text"},t&&t.icon()&&I(t,{className:"TagLabel-icon"},{useColor:!1}),m("span",{className:"TagLabel-name"},r)))}function V(t){return t.slice(0).sort((function(t,e){var n=t.position(),r=e.position();if(null===n&&null===r)return e.discussionCount()-t.discussionCount();if(null===r)return-1;if(null===n)return 1;var a=t.parent(),o=e.parent();return a===o?n-r:a&&o?a.position()-o.position():a?a===e?1:a.position()-r:o?o===t?-1:n-o.position():0}))}var K=function(t){function e(){return t.apply(this,arguments)||this}x(e,t);var n=e.prototype;return n.oninit=function(e){var n=this;t.prototype.oninit.call(this,e),app.history.push("tags",app.translator.trans("flarum-tags.forum.header.back_to_tags_tooltip")),this.tags=[];var r=app.preloadedApiDocument();r?this.tags=V(r.filter((function(t){return!t.isChild()}))):(this.loading=!0,app.tagList.load(["children","lastPostedDiscussion","parent"]).then((function(){n.tags=V(app.store.all("tags").filter((function(t){return!t.isChild()}))),n.loading=!1,m.redraw()})))},n.oncreate=function(e){t.prototype.oncreate.call(this,e),app.setTitle(app.translator.trans("flarum-tags.forum.all_tags.meta_title_text")),app.setTitleCount(0)},n.view=function(){return m("div",{className:"TagsPage"},this.pageContent().toArray())},n.pageContent=function(){var t=new(j());return t.add("hero",this.hero(),100),t.add("main",m("div",{className:"container"},this.mainContent().toArray()),10),t},n.mainContent=function(){var t=new(j());return t.add("sidebar",this.sidebar(),100),t.add("content",this.content(),10),t},n.content=function(){return m("div",{className:"TagsPage-content sideNavOffset"},this.contentItems().toArray())},n.contentItems=function(){var t=new(j());if(this.loading)t.add("loading",m(A(),null));else{var e=this.tags.filter((function(t){return null!==t.position()})),n=this.tags.filter((function(t){return null===t.position()}));t.add("tagTiles",this.tagTileListView(e),100),n.length&&t.add("cloud",this.cloudView(n),10)}return t},n.hero=function(){return h().prototype.hero()},n.sidebar=function(){return m("nav",{className:"TagsPage-nav IndexPage-nav sideNav"},m("ul",null,E()(this.sidebarItems().toArray())))},n.sidebarItems=function(){return h().prototype.sidebarItems()},n.tagTileListView=function(t){return m("ul",{className:"TagTiles"},t.map(this.tagTileView.bind(this)))},n.tagTileView=function(t){var e=t.lastPostedDiscussion(),n=V(t.children()||[]);return m("li",{className:L()("TagTile",{colored:t.color()},B()(t.color())),style:{"--tag-bg":t.color()}},m(_(),{className:"TagTile-info",href:app.route.tag(t)},t.icon()&&I(t,{},{useColor:!1}),m("h3",{className:"TagTile-name"},t.name()),m("p",{className:"TagTile-description"},t.description()),!!n&&m("div",{className:"TagTile-children"},n.map((function(t){return[m(_(),{href:app.route.tag(t)},t.name())," "]})))),e?m(_(),{className:"TagTile-lastPostedDiscussion",href:app.route.discussion(e,e.lastPostNumber())},m("span",{className:"TagTile-lastPostedDiscussion-title"},e.title()),R()(e.lastPostedAt())):m("span",{className:"TagTile-lastPostedDiscussion"}))},n.cloudView=function(t){return m("div",{className:"TagCloud"},t.map((function(t){return[G(t,{link:!0})," "]})))},e}(C());function $(){(0,f.extend)(h().prototype,"navItems",(function(t){if(t.add("tags",m(b(),{icon:"fas fa-th-large",href:a().route("tags")},a().translator.trans("flarum-tags.forum.index.tags_link")),-10),!a().current.matches(K)){t.add("separator",m(v(),null),-12);var e=a().search.stickyParams(),n=a().store.all("tags"),r=this.currentTag(),o=function(n){var a=r===n;!a&&r&&(a=r.parent()===n),t.add("tag"+n.id(),m(S,{model:n,params:e,active:a},null==n?void 0:n.name()),-14)};V(n).filter((function(t){return null!==t.position()&&(!t.isChild()||r&&(t.parent()===r||t.parent()===r.parent()))})).forEach(o);var s=n.filter((function(t){return null===t.position()})).sort((function(t,e){return e.discussionCount()-t.discussionCount()}));s.splice(0,3).forEach(o),s.length&&t.add("moreTags",m(b(),{href:a().route("tags")},a().translator.trans("flarum-tags.forum.index.more_link")),-16)}}))}const U=flarum.core.compat["forum/states/DiscussionListState"];var Y=n.n(U);const z=flarum.core.compat["forum/states/GlobalSearchState"];var J=n.n(z);const Q=flarum.core.compat["common/Component"];var W=n.n(Q),X=function(t){function e(){return t.apply(this,arguments)||this}return x(e,t),e.prototype.view=function(){var t,e=this.attrs.model,n=e.color();return m("header",{className:L()("Hero","TagHero",(t={"TagHero--colored":n},t[B()(n)]=n,t)),style:n?{"--hero-bg":n}:void 0},m("div",{className:"container"},m("div",{className:"containerNarrow"},m("h1",{className:"Hero-title"},e.icon()&&I(e,{},{useColor:!1})," ",e.name()),m("div",{className:"Hero-subtitle"},e.description()))))},e}(W()),Z=function(t){return a().store.all("tags").find((function(e){return 0===e.slug().localeCompare(t,void 0,{sensitivity:"base"})}))};function tt(){h().prototype.currentTag=function(){var t=this;if(this.currentActiveTag)return this.currentActiveTag;var e=a().search.params().tags,n=null;if(e&&(n=Z(e)),e&&!n||n&&!n.isChild()&&!n.children()){if(this.currentTagLoading)return;this.currentTagLoading=!0,a().store.find("tags",e,{include:"children,children.parent,parent,state"}).then((function(){t.currentActiveTag=Z(e),m.redraw()})).finally((function(){t.currentTagLoading=!1}))}return n?(this.currentActiveTag=n,this.currentActiveTag):void 0},(0,f.override)(h().prototype,"hero",(function(t){var e=this.currentTag();return e?m(X,{model:e}):t()})),(0,f.extend)(h().prototype,"view",(function(t){var e=this.currentTag();e&&(t.attrs.className+=" IndexPage--tag"+e.id())})),(0,f.extend)(h().prototype,"setTitle",(function(){var t=this.currentTag();t&&a().setTitle(t.name())})),(0,f.extend)(h().prototype,"sidebarItems",(function(t){var e=this.currentTag();if(e){var n=e.color(),r=e.canStartDiscussion()||!a().session.user,o=t.get("newDiscussion");n&&(o.attrs.className=L()([o.attrs.className,"Button--tagColored",B()(n)]),o.attrs.style={"--color":n}),o.attrs.disabled=!r,o.children=a().translator.trans(r?"core.forum.index.start_discussion_button":"core.forum.index.cannot_start_discussion_button")}})),(0,f.extend)(J().prototype,"params",(function(t){t.tags=m.route.param("tags")})),(0,f.extend)(Y().prototype,"requestParams",(function(t){var e;if("string"==typeof t.include?t.include=[t.include]:null==(e=t.include)||e.push("tags","tags.parent"),this.params.tags){var n,r=null!=(n=t.filter)?n:{};r.tag=this.params.tags;var a=r.q;a&&(r.q=a+" tag:"+this.params.tags),t.filter=r}}))}const et=flarum.core.compat["forum/components/DiscussionListItem"];var nt=n.n(et);const rt=flarum.core.compat["forum/components/DiscussionHero"];var at=n.n(rt);function ot(t,e){if(null==t)return{};var n,r,a={},o=Object.keys(t);for(r=0;r=0||(a[n]=t[n]);return a}function st(t){var e,n,r="";if("string"==typeof t||"number"==typeof t)r+=t;else if("object"==typeof t)if(Array.isArray(t))for(e=0;et.max.primary)throw new Error("The minimum number of primary tags allowed cannot be more than the maximum number of primary tags allowed.");if(t.min.secondary>t.max.secondary)throw new Error("The minimum number of secondary tags allowed cannot be more than the maximum number of secondary tags allowed.");if(t.min.total>t.max.primary+t.max.secondary)throw new Error("The minimum number of tags allowed cannot be more than the maximum number of primary and secondary tags allowed together.");if(t.max.totalt.max.total)throw new Error("The minimum number of tags allowed cannot be more than the maximum number of tags allowed.")}(e.limits)};var n=e.prototype;return n.oninit=function(e){var n=this;t.prototype.oninit.call(this,e),this.navigator.onUp((function(){return n.setIndex(n.getCurrentNumericIndex()-1,!0)})).onDown((function(){return n.setIndex(n.getCurrentNumericIndex()+1,!0)})).onSelect(this.select.bind(this)).onRemove((function(){return n.selected.splice(n.selected.length-1,1)})),u().tagList.load(["parent"]).then((function(t){n.loading=!1,n.attrs.selectableTags&&(t=n.attrs.selectableTags(t)),n.tags=V(t),n.attrs.selectedTags&&n.attrs.selectedTags.map(n.addTag.bind(n)),n.indexTag=t[0],m.redraw()}))},n.className=function(){return L()("TagSelectionModal",this.attrs.className)},n.title=function(){return this.attrs.title},n.content=function(){var t=this;if(this.loading||!this.tags)return m(A(),null);var e=this.filter().toLowerCase(),n=this.primaryCount(),r=this.secondaryCount(),a=this.getFilteredTags(),o=Math.max(vt()(this.getInstruction(n,r)).length,this.filter().length);return[m("div",{className:"Modal-body"},m("div",{className:"TagSelectionModal-form"},m("div",{className:"TagSelectionModal-form-input"},m("div",{className:"TagsInput FormControl "+(this.focused?"focus":""),onclick:function(){return t.$(".TagsInput input").focus()}},m("span",{className:"TagsInput-selected"},this.selected.map((function(e){return m("span",{className:"TagsInput-tag",onclick:function(){t.removeTag(e),t.onready()}},G(e))}))),m("input",{className:"FormControl",placeholder:vt()(this.getInstruction(n,r)),bidi:this.filter,style:{width:o+"ch"},onkeydown:this.navigator.navigate.bind(this.navigator),onfocus:function(){return t.focused=!0},onblur:function(){return t.focused=!1}}))),m("div",{className:"TagSelectionModal-form-submit App-primaryControl"},m(ft(),{type:"submit",className:"Button Button--primary",disabled:!this.meetsRequirements(n,r),icon:"fas fa-check"},u().translator.trans("flarum-tags.lib.tag_selection_modal.submit_button"))))),m("div",{className:"Modal-footer"},m("ul",{className:"TagSelectionModal-list SelectTagList"},a.map((function(n){return m("li",{"data-index":n.id(),className:L()({pinned:null!==n.position(),child:!!n.parent(),colored:!!n.color(),selected:t.selected.includes(n),active:t.indexTag===n}),style:{color:n.color()},onmouseover:function(){return t.indexTag=n},onclick:t.toggleTag.bind(t,n)},I(n),m("span",{className:"SelectTagListItem-name"},Tt()(n.name(),e)),n.description()?m("span",{className:"SelectTagListItem-description"},n.description()):"")}))),this.attrs.limits.allowBypassing&&m("div",{className:"TagSelectionModal-controls"},m(Pt,{className:"Button",onclick:function(){return t.bypassReqs=!t.bypassReqs},isToggled:this.bypassReqs},u().translator.trans("flarum-tags.lib.tag_selection_modal.bypass_requirements"))))]},n.getFilteredTags=function(){var t=this,e=this.filter().toLowerCase(),n=this.primaryCount(),r=this.secondaryCount(),a=this.tags;return this.attrs.requireParentTag&&(a=a.filter((function(e){var n=e.parent();return null!==n&&(!1===n||t.selected.includes(n))}))),this.bypassReqs||(this.selected.length>=this.attrs.limits.max.total?a=a.filter((function(e){return t.selected.includes(e)})):(n>=this.attrs.limits.max.primary&&(a=a.filter((function(e){return!e.isPrimary()||t.selected.includes(e)}))),r>=this.attrs.limits.max.secondary&&(a=a.filter((function(e){return e.isPrimary()||t.selected.includes(e)}))))),e&&(a=a.filter((function(t){return t.name().toLowerCase().includes(e)}))),this.indexTag&&a.includes(this.indexTag)||(this.indexTag=a[0]),a},n.primaryCount=function(){return this.selected.filter((function(t){return t.isPrimary()})).length},n.secondaryCount=function(){return this.selected.filter((function(t){return!t.isPrimary()})).length},n.meetsRequirements=function(t,e){return!!(this.bypassReqs||this.attrs.allowResetting&&0===this.selected.length)||!(this.selected.length=this.attrs.limits.min.primary&&e>=this.attrs.limits.min.secondary},n.addTag=function(t){if(t&&this.attrs.canSelect(t)){if(this.attrs.onSelect&&this.attrs.onSelect(t,this.selected),this.attrs.requireParentTag){var e=t.parent();e&&!this.selected.includes(e)&&this.selected.push(e)}this.selected.includes(t)||this.selected.push(t)}},n.removeTag=function(t){var e=this.selected.indexOf(t);-1!==e&&(this.selected.splice(e,1),this.attrs.requireParentTag&&this.selected.filter((function(e){return e.parent()===t})).forEach(this.removeTag.bind(this)),this.attrs.onDeselect&&this.attrs.onDeselect(t,this.selected))},n.toggleTag=function(t){this.tags&&(this.selected.includes(t)?this.removeTag(t):this.addTag(t),this.filter()&&(this.filter(""),this.indexTag=this.tags[0]),this.onready())},n.getInstruction=function(t,e){if(this.bypassReqs)return"";if(t li")},n.getCurrentNumericIndex=function(){return this.indexTag?this.selectableItems().index(this.getItem(this.indexTag)):-1},n.getItem=function(t){return this.selectableItems().filter('[data-index="'+t.id()+'"]')},n.setIndex=function(t,e){var n=this.selectableItems(),r=n.parent();t<0?t=n.length-1:t>=n.length&&(t=0);var a=n.eq(t);if(this.indexTag=u().store.getById("tags",a.attr("data-index")),m.redraw(),e&&this.indexTag){var o,s=r.scrollTop(),i=r.offset().top,c=i+r.outerHeight(),l=a.offset().top,d=l+a.outerHeight();lc&&(o=s-c+d+parseInt(r.css("padding-bottom"),10)),void 0!==o&&r.stop(!0).animate({scrollTop:o},100)}},e}(Nt()),kt=function(t){function e(){return t.apply(this,arguments)||this}return x(e,t),e.initAttrs=function(e){var n;t.initAttrs.call(this,e);var r=e.discussion?a().translator.trans("flarum-tags.forum.choose_tags.edit_title",{title:m("em",null,e.discussion.title())}):a().translator.trans("flarum-tags.forum.choose_tags.title");e.className=L()(e.className,"TagDiscussionModal"),e.title=vt()(r),e.allowResetting=!!a().forum.attribute("canBypassTagCounts"),e.limits={allowBypassing:e.allowResetting,max:{primary:a().forum.attribute("maxPrimaryTags"),secondary:a().forum.attribute("maxSecondaryTags")},min:{primary:a().forum.attribute("minPrimaryTags"),secondary:a().forum.attribute("minSecondaryTags")}},e.requireParentTag=!0,e.selectableTags=function(){return yt(e.discussion)},null!=e.selectedTags||(e.selectedTags=(null==(n=e.discussion)?void 0:n.tags())||[]),e.canSelect=function(t){return t.canStartDiscussion()};var o=e.onsubmit||null;e.onsubmit=function(t){var n=e.discussion;n&&n.save({relationships:{tags:t}}).then((function(){a().current.matches(ht())&&a().current.get("stream").update(),m.redraw()})),o&&o(t)}},e}(Ct);function At(){(0,f.extend)(mt(),"moderationControls",(function(t,e){e.canTag()&&t.add("tags",m(ft(),{icon:"fas fa-tag",onclick:function(){return app.modal.show(kt,{discussion:e})}},app.translator.trans("flarum-tags.forum.discussion_controls.edit_tags_button")))}))}const Dt=flarum.core.compat["forum/components/DiscussionComposer"];var Et=n.n(Dt);function Ot(){(0,f.extend)(h().prototype,"newDiscussionAction",(function(t){var e=this.currentTag();if(e){var n=e.parent(),r=n?[n,e]:[e];t.then((function(t){return t.fields.tags=r}))}else app.composer.fields.tags=[]})),(0,f.extend)(Et().prototype,"oninit",(function(){app.tagList.load(["parent"]).then((function(){return m.redraw()}))})),Et().prototype.chooseTags=function(){var t=this;yt().length&&app.modal.show(kt,{selectedTags:(this.composer.fields.tags||[]).slice(0),onsubmit:function(e){t.composer.fields.tags=e,t.$("textarea").focus()}})},(0,f.extend)(Et().prototype,"headerItems",(function(t){var e=this.composer.fields.tags||[],n=yt();t.add("tags",m("a",{className:L()(["DiscussionComposer-changeTags",!n.length&&"disabled"]),onclick:this.chooseTags.bind(this)},e.length?ct(e):m("span",{className:"TagLabel untagged"},app.translator.trans("flarum-tags.forum.composer_discussion.choose_tags_link"))),10)})),(0,f.override)(Et().prototype,"onsubmit",(function(t){var e=this,n=this.composer.fields.tags||[],r=n.filter((function(t){return null!==t.position()&&!t.isChild()})),a=n.filter((function(t){return null===t.position()})),o=yt(),s=parseInt(app.forum.attribute("minPrimaryTags")),i=parseInt(app.forum.attribute("minSecondaryTags")),c=parseInt(app.forum.attribute("maxPrimaryTags")),l=parseInt(app.forum.attribute("maxSecondaryTags"));(!n.length&&0!==c&&0!==l||r.length{var r=n(75).default;function a(){"use strict";t.exports=a=function(){return e},t.exports.__esModule=!0,t.exports.default=t.exports;var e={},n=Object.prototype,o=n.hasOwnProperty,s=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},c=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function m(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{m({},"")}catch(t){m=function(t,e,n){return t[e]=n}}function d(t,e,n,r){var a=e&&e.prototype instanceof h?e:h,o=Object.create(a.prototype),i=new P(r||[]);return s(o,"_invoke",{value:N(t,n,i)}),o}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var p={};function h(){}function g(){}function v(){}var y={};m(y,c,(function(){return this}));var b=Object.getPrototypeOf,T=b&&b(b(C([])));T&&T!==n&&o.call(T,c)&&(y=T);var x=v.prototype=h.prototype=Object.create(y);function w(t){["next","throw","return"].forEach((function(e){m(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function n(a,s,i,c){var l=f(t[a],t,s);if("throw"!==l.type){var u=l.arg,m=u.value;return m&&"object"==r(m)&&o.call(m,"__await")?e.resolve(m.__await).then((function(t){n("next",t,i,c)}),(function(t){n("throw",t,i,c)})):e.resolve(m).then((function(t){u.value=t,i(u)}),(function(t){return n("throw",t,i,c)}))}c(l.arg)}var a;s(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,a){n(t,r,e,a)}))}return a=a?a.then(o,o):o()}})}function N(t,e,n){var r="suspendedStart";return function(a,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===a)throw o;return{value:void 0,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var i=L(s,n);if(i){if(i===p)continue;return i}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=f(t,e,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}function L(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,L(t,e),"throw"===e.method))return p;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var r=f(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,p;var a=r.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function C(t){if(t){var e=t[c];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n=0;--r){var a=this.tryEntries[r],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var i=o.call(a,"catchLoc"),c=o.call(a,"finallyLoc");if(i&&c){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),S(n),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;S(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:C(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},e}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports},75:t=>{function e(n){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},507:(t,e,n)=>{var r=n(440)();t.exports=r;try{regeneratorRuntime=r}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}},e={};function n(r){var a=e[r];if(void 0!==a)return a.exports;var o=e[r]={exports:{}};return t[r](o,o.exports,n),o.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.r(r),n.d(r,{extend:()=>a.l});var t=n(810),e={};for(const n in t)"default"!==n&&(e[n]=()=>t[n]);n.d(r,e);var a=n(206)})(),module.exports=r})(); //# sourceMappingURL=forum.js.map \ No newline at end of file diff --git a/extensions/tags/js/dist/forum.js.map b/extensions/tags/js/dist/forum.js.map index 8574f0e565..604b3b0094 100644 --- a/extensions/tags/js/dist/forum.js.map +++ b/extensions/tags/js/dist/forum.js.map @@ -1 +1 @@ -{"version":3,"file":"forum.js","mappings":";qEAAA,MAAM,EAA+BA,OAAOC,KAAKC,OAAO,0BCAxD,SAASC,EAAmBC,EAAKC,EAASC,EAAQC,EAAOC,EAAQC,EAAKC,GACpE,IACE,IAAIC,EAAOP,EAAIK,GAAKC,GAChBE,EAAQD,EAAKC,KAInB,CAHE,MAAOC,GAEP,YADAP,EAAOO,EAET,CACIF,EAAKG,KACPT,EAAQO,GAERG,QAAQV,QAAQO,GAAOI,KAAKT,EAAOC,EAEvC,CACe,SAASS,EAAkBC,GACxC,OAAO,WACL,IAAIC,EAAOC,KACTC,EAAOC,UACT,OAAO,IAAIP,SAAQ,SAAUV,EAASC,GACpC,IAAIF,EAAMc,EAAGK,MAAMJ,EAAME,GACzB,SAASd,EAAMK,GACbT,EAAmBC,EAAKC,EAASC,EAAQC,EAAOC,EAAQ,OAAQI,EAClE,CACA,SAASJ,EAAOgB,GACdrB,EAAmBC,EAAKC,EAASC,EAAQC,EAAOC,EAAQ,QAASgB,EACnE,CACAjB,OAAMkB,EACR,GACF,CACF,uBC7BA,MAAM,EAA+BzB,OAAOC,KAAKC,OAAO,2BCGnCwB,EAAY,6BAC/BC,oBAAc,oBAuBb,OAvBa,EAERC,KAAI,6BAAV,WAAWC,GAAkB,8EAAK,QAAL,IAAlBA,IAAAA,EAAqB,IACzBT,KAAKO,eAAgB,CAAF,wCACfP,KAAKU,MAAMD,IAAS,OAG4D,GAEzD,KAF1BE,EAAmBF,EAASG,QAAO,SAACC,GAAO,OAAM,EAAKN,eAAgBO,IAAID,EAAQ,KAEnEE,OAAY,yCACxBpB,QAAQV,QAAQ+B,IAAAA,MAAAA,IAAmB,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B,IACEC,mBAAqBD,CAOvB,CANE,MAAOE,GACmB,iBAAfC,WACTA,WAAWF,mBAAqBD,EAEhCI,SAAS,IAAK,yBAAdA,CAAwCJ,EAE5C,ICbIK,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBlb,IAAjBmb,EACH,OAAOA,EAAalH,QAGrB,IAAID,EAASgH,EAAyBE,GAAY,CAGjDjH,QAAS,CAAC,GAOX,OAHAmH,EAAoBF,GAAUlH,EAAQA,EAAOC,QAASgH,GAG/CjH,EAAOC,OACf,CCrBAgH,EAAoBrR,EAAKoK,IACxB,IAAIqH,EAASrH,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAiH,EAAoBK,EAAED,EAAQ,CAAEhX,EAAGgX,IAC5BA,CAAM,ECLdJ,EAAoBK,EAAI,CAACrH,EAASsH,KACjC,IAAI,IAAIvc,KAAOuc,EACXN,EAAoB/Z,EAAEqa,EAAYvc,KAASic,EAAoB/Z,EAAE+S,EAASjV,IAC5EoC,OAAOkT,eAAeL,EAASjV,EAAK,CAAEkW,YAAY,EAAMxM,IAAK6S,EAAWvc,IAE1E,ECNDic,EAAoB/Z,EAAI,CAACqT,EAAKiH,IAAUpa,OAAOO,UAAU0S,eAAe3B,KAAK6B,EAAKiH,GCClFP,EAAoBzR,EAAKyK,IACH,oBAAXS,QAA0BA,OAAOM,aAC1C5T,OAAOkT,eAAeL,EAASS,OAAOM,YAAa,CAAE7V,MAAO,WAE7DiC,OAAOkT,eAAeL,EAAS,aAAc,CAAE9U,OAAO,GAAO","sources":["webpack://@flarum/tags/external root \"flarum.core.compat['forum/app']\"","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js","webpack://@flarum/tags/external root \"flarum.core.compat['common/app']\"","webpack://@flarum/tags/./src/common/states/TagListState.ts","webpack://@flarum/tags/external root \"flarum.core.compat['common/extend']\"","webpack://@flarum/tags/external root \"flarum.core.compat['forum/components/IndexPage']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/components/Separator']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/components/LinkButton']\"","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@flarum/tags/external root \"flarum.core.compat['common/components/Link']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/utils/classList']\"","webpack://@flarum/tags/./src/common/helpers/tagIcon.js","webpack://@flarum/tags/./src/forum/components/TagLinkButton.js","webpack://@flarum/tags/external root \"flarum.core.compat['common/components/Page']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/helpers/listItems']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/utils/ItemList']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/helpers/humanTime']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/helpers/textContrastClass']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/utils/extract']\"","webpack://@flarum/tags/./src/common/helpers/tagLabel.js","webpack://@flarum/tags/./src/common/utils/sortTags.tsx","webpack://@flarum/tags/./src/forum/components/TagsPage.js","webpack://@flarum/tags/external root \"flarum.core.compat['admin/app']\"","webpack://@flarum/tags/./src/forum/addTagList.js","webpack://@flarum/tags/external root \"flarum.core.compat['forum/states/DiscussionListState']\"","webpack://@flarum/tags/external root \"flarum.core.compat['forum/states/GlobalSearchState']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/Component']\"","webpack://@flarum/tags/./src/forum/components/TagHero.js","webpack://@flarum/tags/./src/forum/addTagFilter.tsx","webpack://@flarum/tags/external root \"flarum.core.compat['forum/components/DiscussionListItem']\"","webpack://@flarum/tags/external root \"flarum.core.compat['forum/components/DiscussionHero']\"","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","webpack://@flarum/tags/../../../node_modules/clsx/dist/clsx.m.js","webpack://@flarum/tags/./src/common/helpers/tagsLabel.js","webpack://@flarum/tags/./src/forum/addTagLabels.js","webpack://@flarum/tags/external root \"flarum.core.compat['forum/utils/DiscussionControls']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/components/Button']\"","webpack://@flarum/tags/external root \"flarum.core.compat['forum/components/DiscussionPage']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/utils/extractText']\"","webpack://@flarum/tags/./src/forum/utils/getSelectableTags.js","webpack://@flarum/tags/external root \"flarum.core.compat['common/helpers/highlight']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/utils/KeyboardNavigatable']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/components/Modal']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/utils/Stream']\"","webpack://@flarum/tags/./src/forum/components/ToggleButton.js","webpack://@flarum/tags/./src/common/components/TagSelectionModal.tsx","webpack://@flarum/tags/./src/forum/components/TagDiscussionModal.tsx","webpack://@flarum/tags/./src/forum/addTagControl.js","webpack://@flarum/tags/external root \"flarum.core.compat['forum/components/DiscussionComposer']\"","webpack://@flarum/tags/./src/forum/addTagComposer.js","webpack://@flarum/tags/external root \"flarum.core.compat['common/extenders']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/models/Discussion']\"","webpack://@flarum/tags/external root \"flarum.core.compat['forum/components/EventPost']\"","webpack://@flarum/tags/./src/forum/components/DiscussionTaggedPost.js","webpack://@flarum/tags/external root \"flarum.core.compat['common/utils/computed']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/Model']\"","webpack://@flarum/tags/./src/common/models/Tag.ts","webpack://@flarum/tags/./src/common/extend.ts","webpack://@flarum/tags/./src/forum/extend.ts","webpack://@flarum/tags/./src/common/compat.js","webpack://@flarum/tags/./src/forum/compat.js","webpack://@flarum/tags/external assign \"flarum.core\"","webpack://@flarum/tags/./src/forum/index.ts","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/regeneratorRuntime.js","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/typeof.js","webpack://@flarum/tags/../../../node_modules/@babel/runtime/regenerator/index.js","webpack://@flarum/tags/webpack/bootstrap","webpack://@flarum/tags/webpack/runtime/compat get default export","webpack://@flarum/tags/webpack/runtime/define property getters","webpack://@flarum/tags/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/tags/webpack/runtime/make namespace object"],"sourcesContent":["const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/app'];","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\nexport default function _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n _next(undefined);\n });\n };\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/app'];","import app from 'flarum/common/app';\nimport type Tag from '../../common/models/Tag';\n\nexport default class TagListState {\n loadedIncludes?: Set;\n\n async load(includes: string[] = []): Promise {\n if (!this.loadedIncludes) {\n return this.query(includes);\n }\n\n const unloadedIncludes = includes.filter((include) => !this.loadedIncludes!.has(include));\n\n if (unloadedIncludes.length === 0) {\n return Promise.resolve(app.store.all('tags'));\n }\n\n return this.query(unloadedIncludes);\n }\n\n async query(includes: string[] = []): Promise {\n this.loadedIncludes ??= new Set();\n\n return app.store.find('tags', { include: includes.join(',') }).then((val) => {\n includes.forEach((include) => this.loadedIncludes!.add(include));\n return val;\n });\n }\n}\n","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['common/components/Separator'];","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['common/components/Link'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/classList'];","import classList from 'flarum/common/utils/classList';\n\nexport default function tagIcon(tag, attrs = {}, settings = {}) {\n const hasIcon = tag && tag.icon();\n const { useColor = true } = settings;\n\n attrs.className = classList([attrs.className, 'icon', hasIcon ? tag.icon() : 'TagIcon']);\n\n if (tag && useColor) {\n attrs.style = attrs.style || {};\n attrs.style['--color'] = tag.color();\n\n if (hasIcon) {\n attrs.style.color = tag.color();\n }\n } else if (!tag) {\n attrs.className += ' untagged';\n }\n\n return hasIcon ? : ;\n}\n","import Link from 'flarum/common/components/Link';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport classList from 'flarum/common/utils/classList';\nimport tagIcon from '../../common/helpers/tagIcon';\n\nexport default class TagLinkButton extends LinkButton {\n view(vnode) {\n const tag = this.attrs.model;\n const description = tag && tag.description();\n const className = classList('TagLinkButton hasIcon', { child: tag.isChild() }, this.attrs.className);\n\n return (\n \n {tagIcon(tag, { className: 'Button-icon' })}\n {tag ? tag.name() : app.translator.trans('flarum-tags.forum.index.untagged_link')}\n \n );\n }\n\n static initAttrs(attrs) {\n super.initAttrs(attrs);\n\n const tag = attrs.model;\n\n attrs.params.tags = tag ? tag.slug() : 'untagged';\n attrs.route = app.route('tag', attrs.params);\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Page'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/listItems'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/humanTime'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/textContrastClass'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/extract'];","import extract from 'flarum/common/utils/extract';\nimport Link from 'flarum/common/components/Link';\nimport classList from 'flarum/common/utils/classList';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport tagIcon from './tagIcon';\n\nexport default function tagLabel(tag, attrs = {}) {\n attrs.style = attrs.style || {};\n attrs.className = 'TagLabel ' + (attrs.className || '');\n\n const link = extract(attrs, 'link');\n const tagText = tag ? tag.name() : app.translator.trans('flarum-tags.lib.deleted_tag_text');\n\n if (tag) {\n const color = tag.color();\n if (color) {\n attrs.style['--tag-bg'] = color;\n attrs.className = classList(attrs.className, 'colored', textContrastClass(color));\n }\n\n if (link) {\n attrs.title = tag.description() || '';\n attrs.href = app.route('tag', { tags: tag.slug() });\n }\n\n if (tag.isChild()) {\n attrs.className += ' TagLabel--child';\n }\n } else {\n attrs.className += ' untagged';\n }\n\n return m(\n link ? Link : 'span',\n attrs,\n \n {tag && tag.icon() && tagIcon(tag, { className: 'TagLabel-icon' }, { useColor: false })}\n {tagText}\n \n );\n}\n","import Tag from '../models/Tag';\n\nexport default function sortTags(tags: Tag[]) {\n return tags.slice(0).sort((a, b) => {\n const aPos = a.position();\n const bPos = b.position();\n\n // If they're both secondary tags, sort them by their discussions count,\n // descending.\n if (aPos === null && bPos === null) return b.discussionCount() - a.discussionCount();\n\n // If just one is a secondary tag, then the primary tag should\n // come first.\n if (bPos === null) return -1;\n if (aPos === null) return 1;\n\n // If we've made it this far, we know they're both primary tags. So we'll\n // need to see if they have parents.\n const aParent = a.parent();\n const bParent = b.parent();\n\n // If they both have the same parent, then their positions are local,\n // so we can compare them directly.\n if (aParent === bParent) return aPos - bPos;\n // If they are both child tags, then we will compare the positions of their\n // parents.\n else if (aParent && bParent) return aParent.position()! - bParent.position()!;\n // If we are comparing a child tag with its parent, then we let the parent\n // come first. If we are comparing an unrelated parent/child, then we\n // compare both of the parents.\n else if (aParent) return aParent === b ? 1 : aParent.position()! - bPos;\n else if (bParent) return bParent === a ? -1 : aPos - bParent.position()!;\n\n return 0;\n });\n}\n","import Page from 'flarum/common/components/Page';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport Link from 'flarum/common/components/Link';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport listItems from 'flarum/common/helpers/listItems';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport humanTime from 'flarum/common/helpers/humanTime';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport classList from 'flarum/common/utils/classList';\n\nimport tagIcon from '../../common/helpers/tagIcon';\nimport tagLabel from '../../common/helpers/tagLabel';\nimport sortTags from '../../common/utils/sortTags';\n\nexport default class TagsPage extends Page {\n oninit(vnode) {\n super.oninit(vnode);\n\n app.history.push('tags', app.translator.trans('flarum-tags.forum.header.back_to_tags_tooltip'));\n\n this.tags = [];\n\n const preloaded = app.preloadedApiDocument();\n\n if (preloaded) {\n this.tags = sortTags(preloaded.filter((tag) => !tag.isChild()));\n return;\n }\n\n this.loading = true;\n\n app.tagList.load(['children', 'lastPostedDiscussion', 'parent']).then(() => {\n this.tags = sortTags(app.store.all('tags').filter((tag) => !tag.isChild()));\n\n this.loading = false;\n\n m.redraw();\n });\n }\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n app.setTitle(app.translator.trans('flarum-tags.forum.all_tags.meta_title_text'));\n app.setTitleCount(0);\n }\n\n view() {\n return
{this.pageContent().toArray()}
;\n }\n\n pageContent() {\n const items = new ItemList();\n\n items.add('hero', this.hero(), 100);\n items.add('main',
{this.mainContent().toArray()}
, 10);\n\n return items;\n }\n\n mainContent() {\n const items = new ItemList();\n\n items.add('sidebar', this.sidebar(), 100);\n items.add('content', this.content(), 10);\n\n return items;\n }\n\n content() {\n return
{this.contentItems().toArray()}
;\n }\n\n contentItems() {\n const items = new ItemList();\n\n if (this.loading) {\n items.add('loading', );\n } else {\n const pinned = this.tags.filter((tag) => tag.position() !== null);\n const cloud = this.tags.filter((tag) => tag.position() === null);\n\n items.add('tagTiles', this.tagTileListView(pinned), 100);\n\n if (cloud.length) {\n items.add('cloud', this.cloudView(cloud), 10);\n }\n }\n\n return items;\n }\n\n hero() {\n return IndexPage.prototype.hero();\n }\n\n sidebar() {\n return (\n \n );\n }\n\n sidebarItems() {\n return IndexPage.prototype.sidebarItems();\n }\n\n tagTileListView(pinned) {\n return
    {pinned.map(this.tagTileView.bind(this))}
;\n }\n\n tagTileView(tag) {\n const lastPostedDiscussion = tag.lastPostedDiscussion();\n const children = sortTags(tag.children() || []);\n\n return (\n
  • \n \n {tag.icon() && tagIcon(tag, {}, { useColor: false })}\n

    {tag.name()}

    \n

    {tag.description()}

    \n {!!children && (\n
    {children.map((child) => [{child.name()}, ' '])}
    \n )}\n \n {lastPostedDiscussion ? (\n \n {lastPostedDiscussion.title()}\n {humanTime(lastPostedDiscussion.lastPostedAt())}\n \n ) : (\n \n )}\n
  • \n );\n }\n\n cloudView(cloud) {\n return
    {cloud.map((tag) => [tagLabel(tag, { link: true }), ' '])}
    ;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","import { extend } from 'flarum/common/extend';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport Separator from 'flarum/common/components/Separator';\nimport LinkButton from 'flarum/common/components/LinkButton';\n\nimport TagLinkButton from './components/TagLinkButton';\nimport TagsPage from './components/TagsPage';\nimport app from 'flarum/admin/app';\nimport sortTags from '../common/utils/sortTags';\n\nexport default function () {\n // Add a link to the tags page, as well as a list of all the tags,\n // to the index page's sidebar.\n extend(IndexPage.prototype, 'navItems', function (items) {\n items.add(\n 'tags',\n \n {app.translator.trans('flarum-tags.forum.index.tags_link')}\n ,\n -10\n );\n\n if (app.current.matches(TagsPage)) return;\n\n items.add('separator', , -12);\n\n const params = app.search.stickyParams();\n const tags = app.store.all('tags');\n const currentTag = this.currentTag();\n\n const addTag = (tag) => {\n let active = currentTag === tag;\n\n if (!active && currentTag) {\n active = currentTag.parent() === tag;\n }\n\n // tag.name() is passed here as children even though it isn't used directly\n // because when we need to get the active child in SelectDropdown, we need to\n // use its children to populate the dropdown. The problem here is that `view`\n // on TagLinkButton is only called AFTER SelectDropdown, so no children are available\n // for SelectDropdown to use at the time.\n items.add(\n 'tag' + tag.id(),\n \n {tag?.name()}\n ,\n -14\n );\n };\n\n sortTags(tags)\n .filter(\n (tag) => tag.position() !== null && (!tag.isChild() || (currentTag && (tag.parent() === currentTag || tag.parent() === currentTag.parent())))\n )\n .forEach(addTag);\n\n const more = tags.filter((tag) => tag.position() === null).sort((a, b) => b.discussionCount() - a.discussionCount());\n\n more.splice(0, 3).forEach(addTag);\n\n if (more.length) {\n items.add('moreTags', {app.translator.trans('flarum-tags.forum.index.more_link')}, -16);\n }\n });\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/states/DiscussionListState'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/states/GlobalSearchState'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","import Component from 'flarum/common/Component';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport tagIcon from '../../common/helpers/tagIcon';\nimport classList from 'flarum/common/utils/classList';\n\nexport default class TagHero extends Component {\n view() {\n const tag = this.attrs.model;\n const color = tag.color();\n\n return (\n \n
    \n
    \n

    \n {tag.icon() && tagIcon(tag, {}, { useColor: false })} {tag.name()}\n

    \n
    {tag.description()}
    \n
    \n
    \n \n );\n }\n}\n","import app from 'flarum/forum/app';\nimport type Mithril from 'mithril';\nimport { extend, override } from 'flarum/common/extend';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport DiscussionListState from 'flarum/forum/states/DiscussionListState';\nimport GlobalSearchState from 'flarum/forum/states/GlobalSearchState';\nimport classList from 'flarum/common/utils/classList';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\n\nimport TagHero from './components/TagHero';\nimport Tag from '../common/models/Tag';\nimport { ComponentAttrs } from 'flarum/common/Component';\n\nconst findTag = (slug: string) => app.store.all('tags').find((tag) => tag.slug().localeCompare(slug, undefined, { sensitivity: 'base' }) === 0);\n\nexport default function () {\n IndexPage.prototype.currentTag = function () {\n if (this.currentActiveTag) {\n return this.currentActiveTag;\n }\n\n const slug = app.search.params().tags;\n let tag = null;\n\n if (slug) {\n tag = findTag(slug);\n }\n\n if ((slug && !tag) || (tag && !tag.isChild() && !tag.children())) {\n if (this.currentTagLoading) {\n return;\n }\n\n this.currentTagLoading = true;\n\n // Unlike the backend, no need to fetch parent.children because if we're on\n // a child tag page, then either:\n // - We loaded in that child tag (and its siblings) in the API document\n // - We first navigated to the current tag's parent, which would have loaded in the current tag's siblings.\n app.store\n .find('tags', slug, { include: 'children,children.parent,parent,state' })\n .then(() => {\n this.currentActiveTag = findTag(slug);\n\n m.redraw();\n })\n .finally(() => {\n this.currentTagLoading = false;\n });\n }\n\n if (tag) {\n this.currentActiveTag = tag;\n return this.currentActiveTag;\n }\n\n return;\n };\n\n // If currently viewing a tag, insert a tag hero at the top of the view.\n override(IndexPage.prototype, 'hero', function (original) {\n const tag = this.currentTag();\n\n if (tag) return ;\n\n return original();\n });\n\n extend(IndexPage.prototype, 'view', function (vdom: Mithril.Vnode) {\n const tag = this.currentTag();\n\n if (tag) vdom.attrs.className += ' IndexPage--tag' + tag.id();\n });\n\n extend(IndexPage.prototype, 'setTitle', function () {\n const tag = this.currentTag();\n\n if (tag) {\n app.setTitle(tag.name());\n }\n });\n\n // If currently viewing a tag, restyle the 'new discussion' button to use\n // the tag's color, and disable if the user isn't allowed to edit.\n extend(IndexPage.prototype, 'sidebarItems', function (items) {\n const tag = this.currentTag();\n\n if (tag) {\n const color = tag.color();\n const canStartDiscussion = tag.canStartDiscussion() || !app.session.user;\n const newDiscussion = items.get('newDiscussion') as Mithril.Vnode;\n\n if (color) {\n newDiscussion.attrs.className = classList([newDiscussion.attrs.className, 'Button--tagColored', textContrastClass(color)]);\n newDiscussion.attrs.style = { '--color': color };\n }\n\n newDiscussion.attrs.disabled = !canStartDiscussion;\n newDiscussion.children = app.translator.trans(\n canStartDiscussion ? 'core.forum.index.start_discussion_button' : 'core.forum.index.cannot_start_discussion_button'\n );\n }\n });\n\n // Add a parameter for the global search state to pass on to the\n // DiscussionListState that will let us filter discussions by tag.\n extend(GlobalSearchState.prototype, 'params', function (params) {\n params.tags = m.route.param('tags');\n });\n\n // Translate that parameter into a gambit appended to the search query.\n extend(DiscussionListState.prototype, 'requestParams', function (this: DiscussionListState, params) {\n if (typeof params.include === 'string') {\n params.include = [params.include];\n } else {\n params.include?.push('tags', 'tags.parent');\n }\n\n if (this.params.tags) {\n const filter = params.filter ?? {};\n filter.tag = this.params.tags;\n // TODO: replace this with a more robust system.\n const q = filter.q;\n if (q) {\n filter.q = `${q} tag:${this.params.tags}`;\n }\n params.filter = filter;\n }\n });\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionListItem'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionHero'];","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e))for(t=0;t {\n if (tag || tags.length === 1) {\n children.push(tagLabel(tag, { link }));\n }\n });\n } else {\n children.push(tagLabel());\n }\n\n return {children};\n}\n","import { extend } from 'flarum/common/extend';\nimport DiscussionListItem from 'flarum/forum/components/DiscussionListItem';\nimport DiscussionHero from 'flarum/forum/components/DiscussionHero';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport classList from 'flarum/common/utils/classList';\n\nimport tagsLabel from '../common/helpers/tagsLabel';\nimport sortTags from '../common/utils/sortTags';\n\nexport default function () {\n // Add tag labels to each discussion in the discussion list.\n extend(DiscussionListItem.prototype, 'infoItems', function (items) {\n const tags = this.attrs.discussion.tags();\n\n if (tags && tags.length) {\n items.add('tags', tagsLabel(tags), 10);\n }\n });\n\n // Restyle a discussion's hero to use its first tag's color.\n extend(DiscussionHero.prototype, 'view', function (view) {\n const tags = sortTags(this.attrs.discussion.tags());\n\n if (tags && tags.length) {\n const color = tags[0].color();\n if (color) {\n view.attrs.style = { '--hero-bg': color };\n view.attrs.className = classList(view.attrs.className, 'DiscussionHero--colored', textContrastClass(color));\n }\n }\n });\n\n // Add a list of a discussion's tags to the discussion hero, displayed\n // before the title. Put the title on its own line.\n extend(DiscussionHero.prototype, 'items', function (items) {\n const tags = this.attrs.discussion.tags();\n\n if (tags && tags.length) {\n items.add('tags', tagsLabel(tags, { link: true }), 5);\n }\n });\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/DiscussionControls'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/extractText'];","export default function getSelectableTags(discussion) {\n let tags = app.store.all('tags');\n\n if (discussion) {\n tags = tags.filter((tag) => tag.canAddToDiscussion() || discussion.tags().indexOf(tag) !== -1);\n } else {\n tags = tags.filter((tag) => tag.canStartDiscussion());\n }\n\n return tags;\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/highlight'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/KeyboardNavigatable'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","import Component from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport classList from 'flarum/common/utils/classList';\n\n/**\n * @TODO move to core\n */\nexport default class ToggleButton extends Component {\n view(vnode) {\n const { className, isToggled, ...attrs } = this.attrs;\n const icon = isToggled ? 'far fa-check-circle' : 'far fa-circle';\n\n return (\n \n );\n }\n}\n","import app from 'flarum/common/app';\nimport Button from 'flarum/common/components/Button';\nimport classList from 'flarum/common/utils/classList';\nimport extractText from 'flarum/common/utils/extractText';\nimport highlight from 'flarum/common/helpers/highlight';\nimport KeyboardNavigatable from 'flarum/common/utils/KeyboardNavigatable';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport Modal from 'flarum/common/components/Modal';\nimport Stream from 'flarum/common/utils/Stream';\n\nimport sortTags from '../utils/sortTags';\nimport tagLabel from '../helpers/tagLabel';\nimport tagIcon from '../helpers/tagIcon';\nimport ToggleButton from '../../forum/components/ToggleButton';\n\nimport type Tag from '../models/Tag';\nimport type { IInternalModalAttrs } from 'flarum/common/components/Modal';\nimport type Mithril from 'mithril';\n\nexport interface ITagSelectionModalLimits {\n /** Whether to allow bypassing the limits set here. This will show a toggle button to bypass limits. */\n allowBypassing?: boolean;\n /** Maximum number of primary/secondary tags allowed. */\n max?: {\n total?: number;\n primary?: number;\n secondary?: number;\n };\n /** Minimum number of primary/secondary tags to be selected. */\n min?: {\n total?: number;\n primary?: number;\n secondary?: number;\n };\n}\n\nexport interface ITagSelectionModalAttrs extends IInternalModalAttrs {\n /** Custom modal className to use. */\n className?: string;\n /** Modal title, defaults to 'Choose Tags'. */\n title?: string;\n /** Initial tag selection value. */\n selectedTags?: Tag[];\n /** Limits set based on minimum and maximum number of primary/secondary tags that can be selected. */\n limits?: ITagSelectionModalLimits;\n /** Whether to allow resetting the value. Defaults to true. */\n allowResetting?: boolean;\n /** Whether to require the parent tag of a selected tag to be selected as well. */\n requireParentTag?: boolean;\n /** Filter tags that can be selected. */\n selectableTags?: (tags: Tag[]) => Tag[];\n /** Whether a tag can be selected. */\n canSelect: (tag: Tag) => boolean;\n /** Callback for when a tag is selected. */\n onSelect?: (tag: Tag, selected: Tag[]) => void;\n /** Callback for when a tag is deselected. */\n onDeselect?: (tag: Tag, selected: Tag[]) => void;\n /** Callback for when the selection is submitted. */\n onsubmit?: (selected: Tag[]) => void;\n}\n\nexport type ITagSelectionModalState = undefined;\n\nexport default class TagSelectionModal<\n CustomAttrs extends ITagSelectionModalAttrs = ITagSelectionModalAttrs,\n CustomState extends ITagSelectionModalState = ITagSelectionModalState\n> extends Modal {\n protected loading = true;\n protected tags!: Tag[];\n protected selected: Tag[] = [];\n protected bypassReqs: boolean = false;\n\n protected filter = Stream('');\n protected focused = false;\n protected navigator = new KeyboardNavigatable();\n protected indexTag?: Tag;\n\n static initAttrs(attrs: ITagSelectionModalAttrs) {\n super.initAttrs(attrs);\n\n // Default values for optional attributes.\n attrs.title ||= extractText(app.translator.trans('flarum-tags.lib.tag_selection_modal.title'));\n attrs.canSelect ||= () => true;\n attrs.allowResetting ??= true;\n attrs.limits = {\n min: {\n total: attrs.limits?.min?.total ?? -Infinity,\n primary: attrs.limits?.min?.primary ?? -Infinity,\n secondary: attrs.limits?.min?.secondary ?? -Infinity,\n },\n max: {\n total: attrs.limits?.max?.total ?? Infinity,\n primary: attrs.limits?.max?.primary ?? Infinity,\n secondary: attrs.limits?.max?.secondary ?? Infinity,\n },\n };\n\n // Prevent illogical limits from being provided.\n catchInvalidLimits(attrs.limits);\n }\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.navigator\n .onUp(() => this.setIndex(this.getCurrentNumericIndex() - 1, true))\n .onDown(() => this.setIndex(this.getCurrentNumericIndex() + 1, true))\n .onSelect(this.select.bind(this))\n .onRemove(() => this.selected.splice(this.selected.length - 1, 1));\n\n app.tagList.load(['parent']).then((tags) => {\n this.loading = false;\n\n if (this.attrs.selectableTags) {\n tags = this.attrs.selectableTags(tags);\n }\n\n this.tags = sortTags(tags);\n\n if (this.attrs.selectedTags) {\n this.attrs.selectedTags.map(this.addTag.bind(this));\n }\n\n this.indexTag = tags[0];\n\n m.redraw();\n });\n }\n\n className() {\n return classList('TagSelectionModal', this.attrs.className);\n }\n\n title() {\n return this.attrs.title;\n }\n\n content() {\n if (this.loading || !this.tags) {\n return ;\n }\n\n const filter = this.filter().toLowerCase();\n const primaryCount = this.primaryCount();\n const secondaryCount = this.secondaryCount();\n const tags = this.getFilteredTags();\n\n const inputWidth = Math.max(extractText(this.getInstruction(primaryCount, secondaryCount)).length, this.filter().length);\n\n return [\n
    \n
    \n
    \n
    this.$('.TagsInput input').focus()}>\n \n {this.selected.map((tag) => (\n {\n this.removeTag(tag);\n this.onready();\n }}\n >\n {tagLabel(tag)}\n \n ))}\n \n (this.focused = true)}\n onblur={() => (this.focused = false)}\n />\n
    \n
    \n
    \n \n {app.translator.trans('flarum-tags.lib.tag_selection_modal.submit_button')}\n \n
    \n
    \n
    ,\n\n
    \n
      \n {tags.map((tag) => (\n (this.indexTag = tag)}\n onclick={this.toggleTag.bind(this, tag)}\n >\n {tagIcon(tag)}\n {highlight(tag.name(), filter)}\n {tag.description() ? {tag.description()} : ''}\n \n ))}\n
    \n {this.attrs.limits!.allowBypassing && (\n
    \n (this.bypassReqs = !this.bypassReqs)} isToggled={this.bypassReqs}>\n {app.translator.trans('flarum-tags.lib.tag_selection_modal.bypass_requirements')}\n \n
    \n )}\n
    ,\n ];\n }\n\n /**\n * Filters the available tags on every state change.\n */\n private getFilteredTags(): Tag[] {\n const filter = this.filter().toLowerCase();\n const primaryCount = this.primaryCount();\n const secondaryCount = this.secondaryCount();\n let tags = this.tags;\n\n if (this.attrs.requireParentTag) {\n // Filter out all child tags whose parents have not been selected. This\n // makes it impossible to select a child if its parent hasn't been selected.\n tags = tags.filter((tag) => {\n const parent = tag.parent();\n return parent !== null && (parent === false || this.selected.includes(parent));\n });\n }\n\n if (!this.bypassReqs) {\n // If we reached the total maximum number of tags, we can't select anymore.\n if (this.selected.length >= this.attrs.limits!.max!.total!) {\n tags = tags.filter((tag) => this.selected.includes(tag));\n }\n // If the number of selected primary/secondary tags is at the maximum, then\n // we'll filter out all other tags of that type.\n else {\n if (primaryCount >= this.attrs.limits!.max!.primary!) {\n tags = tags.filter((tag) => !tag.isPrimary() || this.selected.includes(tag));\n }\n if (secondaryCount >= this.attrs.limits!.max!.secondary!) {\n tags = tags.filter((tag) => tag.isPrimary() || this.selected.includes(tag));\n }\n }\n }\n\n // If the user has entered text in the filter input, then filter by tags\n // whose name matches what they've entered.\n if (filter) {\n tags = tags.filter((tag) => tag.name().toLowerCase().includes(filter));\n }\n\n if (!this.indexTag || !tags.includes(this.indexTag)) this.indexTag = tags[0];\n\n return tags;\n }\n\n /**\n * Counts the number of selected primary tags.\n */\n protected primaryCount(): number {\n return this.selected.filter((tag) => tag.isPrimary()).length;\n }\n\n /**\n * Counts the number of selected secondary tags.\n */\n protected secondaryCount(): number {\n return this.selected.filter((tag) => !tag.isPrimary()).length;\n }\n\n /**\n * Validates the number of selected primary/secondary tags against the set min max limits.\n */\n protected meetsRequirements(primaryCount: number, secondaryCount: number) {\n if (this.bypassReqs || (this.attrs.allowResetting && this.selected.length === 0)) {\n return true;\n }\n\n if (this.selected.length < this.attrs.limits!.min!.total!) {\n return false;\n }\n\n return primaryCount >= this.attrs.limits!.min!.primary! && secondaryCount >= this.attrs.limits!.min!.secondary!;\n }\n\n /**\n * Add the given tag to the list of selected tags.\n */\n protected addTag(tag: Tag | undefined) {\n if (!tag || !this.attrs.canSelect(tag)) return;\n\n if (this.attrs.onSelect) {\n this.attrs.onSelect(tag, this.selected);\n }\n\n // If this tag has a parent, we'll also need to add the parent tag to the\n // selected list if it's not already in there.\n if (this.attrs.requireParentTag) {\n const parent = tag.parent();\n if (parent && !this.selected.includes(parent)) {\n this.selected.push(parent);\n }\n }\n\n if (!this.selected.includes(tag)) {\n this.selected.push(tag);\n }\n }\n\n /**\n * Remove the given tag from the list of selected tags.\n */\n protected removeTag(tag: Tag) {\n const index = this.selected.indexOf(tag);\n\n if (index !== -1) {\n this.selected.splice(index, 1);\n\n // Look through the list of selected tags for any tags which have the tag\n // we just removed as their parent. We'll need to remove them too.\n if (this.attrs.requireParentTag) {\n this.selected.filter((t) => t.parent() === tag).forEach(this.removeTag.bind(this));\n }\n\n if (this.attrs.onDeselect) {\n this.attrs.onDeselect(tag, this.selected);\n }\n }\n }\n\n protected toggleTag(tag: Tag) {\n // Won't happen, needed for type safety.\n if (!this.tags) return;\n\n if (this.selected.includes(tag)) {\n this.removeTag(tag);\n } else {\n this.addTag(tag);\n }\n\n if (this.filter()) {\n this.filter('');\n this.indexTag = this.tags[0];\n }\n\n this.onready();\n }\n\n /**\n * Gives human text instructions based on the current number of selected tags and set limits.\n */\n protected getInstruction(primaryCount: number, secondaryCount: number) {\n if (this.bypassReqs) {\n return '';\n }\n\n if (primaryCount < this.attrs.limits!.min!.primary!) {\n const remaining = this.attrs.limits!.min!.primary! - primaryCount;\n return extractText(app.translator.trans('flarum-tags.lib.tag_selection_modal.choose_primary_placeholder', { count: remaining }));\n } else if (secondaryCount < this.attrs.limits!.min!.secondary!) {\n const remaining = this.attrs.limits!.min!.secondary! - secondaryCount;\n return extractText(app.translator.trans('flarum-tags.lib.tag_selection_modal.choose_secondary_placeholder', { count: remaining }));\n } else if (this.selected.length < this.attrs.limits!.min!.total!) {\n const remaining = this.attrs.limits!.min!.total! - this.selected.length;\n return extractText(app.translator.trans('flarum-tags.lib.tag_selection_modal.choose_tags_placeholder', { count: remaining }));\n }\n\n return '';\n }\n\n /**\n * Submit tag selection.\n */\n onsubmit(e: SubmitEvent) {\n e.preventDefault();\n\n if (this.attrs.onsubmit) this.attrs.onsubmit(this.selected);\n\n this.hide();\n }\n\n protected select(e: KeyboardEvent) {\n // Ctrl + Enter submits the selection, just Enter completes the current entry\n if (e.metaKey || e.ctrlKey || (this.indexTag && this.selected.includes(this.indexTag))) {\n if (this.selected.length) {\n // The DOM submit method doesn't emit a `submit event, so we\n // simulate a manual submission so our `onsubmit` logic is run.\n this.$('button[type=\"submit\"]').click();\n }\n } else if (this.indexTag) {\n this.getItem(this.indexTag)[0].dispatchEvent(new Event('click'));\n }\n }\n\n protected selectableItems() {\n return this.$('.TagSelectionModal-list > li');\n }\n\n protected getCurrentNumericIndex() {\n if (!this.indexTag) return -1;\n\n return this.selectableItems().index(this.getItem(this.indexTag));\n }\n\n protected getItem(selectedTag: Tag) {\n return this.selectableItems().filter(`[data-index=\"${selectedTag.id()}\"]`);\n }\n\n protected setIndex(index: number, scrollToItem: boolean) {\n const $items = this.selectableItems();\n const $dropdown = $items.parent();\n\n if (index < 0) {\n index = $items.length - 1;\n } else if (index >= $items.length) {\n index = 0;\n }\n\n const $item = $items.eq(index);\n\n this.indexTag = app.store.getById('tags', $item.attr('data-index')!);\n\n m.redraw();\n\n if (scrollToItem && this.indexTag) {\n const dropdownScroll = $dropdown.scrollTop()!;\n const dropdownTop = $dropdown.offset()!.top;\n const dropdownBottom = dropdownTop + $dropdown.outerHeight()!;\n const itemTop = $item.offset()!.top;\n const itemBottom = itemTop + $item.outerHeight()!;\n\n let scrollTop;\n if (itemTop < dropdownTop) {\n scrollTop = dropdownScroll - dropdownTop + itemTop - parseInt($dropdown.css('padding-top'), 10);\n } else if (itemBottom > dropdownBottom) {\n scrollTop = dropdownScroll - dropdownBottom + itemBottom + parseInt($dropdown.css('padding-bottom'), 10);\n }\n\n if (typeof scrollTop !== 'undefined') {\n $dropdown.stop(true).animate({ scrollTop }, 100);\n }\n }\n }\n}\n\n/**\n * Catch invalid limits provided to the tag selection modal.\n */\nfunction catchInvalidLimits(limits: ITagSelectionModalLimits) {\n if (limits.min!.primary! > limits.max!.primary!) {\n throw new Error('The minimum number of primary tags allowed cannot be more than the maximum number of primary tags allowed.');\n }\n\n if (limits.min!.secondary! > limits.max!.secondary!) {\n throw new Error('The minimum number of secondary tags allowed cannot be more than the maximum number of secondary tags allowed.');\n }\n\n if (limits.min!.total! > limits.max!.primary! + limits.max!.secondary!) {\n throw new Error('The minimum number of tags allowed cannot be more than the maximum number of primary and secondary tags allowed together.');\n }\n\n if (limits.max!.total! < limits.min!.primary! + limits.min!.secondary!) {\n throw new Error('The maximum number of tags allowed cannot be less than the minimum number of primary and secondary tags allowed together.');\n }\n\n if (limits.min!.total! > limits.max!.total!) {\n throw new Error('The minimum number of tags allowed cannot be more than the maximum number of tags allowed.');\n }\n}\n","import app from 'flarum/forum/app';\nimport DiscussionPage from 'flarum/forum/components/DiscussionPage';\nimport classList from 'flarum/common/utils/classList';\nimport extractText from 'flarum/common/utils/extractText';\n\nimport getSelectableTags from '../utils/getSelectableTags';\nimport TagSelectionModal, { ITagSelectionModalAttrs } from '../../common/components/TagSelectionModal';\n\nimport type Discussion from 'flarum/common/models/Discussion';\nimport type Tag from '../../common/models/Tag';\n\nexport interface TagDiscussionModalAttrs extends ITagSelectionModalAttrs {\n discussion?: Discussion;\n}\n\nexport default class TagDiscussionModal extends TagSelectionModal {\n static initAttrs(attrs: TagDiscussionModalAttrs) {\n super.initAttrs(attrs);\n\n const title = attrs.discussion\n ? app.translator.trans('flarum-tags.forum.choose_tags.edit_title', { title: {attrs.discussion.title()} })\n : app.translator.trans('flarum-tags.forum.choose_tags.title');\n\n attrs.className = classList(attrs.className, 'TagDiscussionModal');\n attrs.title = extractText(title);\n attrs.allowResetting = !!app.forum.attribute('canBypassTagCounts');\n attrs.limits = {\n allowBypassing: attrs.allowResetting,\n max: {\n primary: app.forum.attribute('maxPrimaryTags'),\n secondary: app.forum.attribute('maxSecondaryTags'),\n },\n min: {\n primary: app.forum.attribute('minPrimaryTags'),\n secondary: app.forum.attribute('minSecondaryTags'),\n },\n };\n attrs.requireParentTag = true;\n attrs.selectableTags = () => getSelectableTags(attrs.discussion);\n attrs.selectedTags ??= (attrs.discussion?.tags() as Tag[]) || [];\n attrs.canSelect = (tag) => tag.canStartDiscussion();\n\n const suppliedOnsubmit = attrs.onsubmit || null;\n\n // Save changes.\n attrs.onsubmit = function (tags) {\n const discussion = attrs.discussion;\n\n if (discussion) {\n discussion.save({ relationships: { tags } }).then(() => {\n if (app.current.matches(DiscussionPage)) {\n app.current.get('stream').update();\n }\n\n m.redraw();\n });\n }\n\n if (suppliedOnsubmit) suppliedOnsubmit(tags);\n };\n }\n}\n","import { extend } from 'flarum/common/extend';\nimport DiscussionControls from 'flarum/forum/utils/DiscussionControls';\nimport Button from 'flarum/common/components/Button';\n\nimport TagDiscussionModal from './components/TagDiscussionModal';\n\nexport default function () {\n // Add a control allowing the discussion to be moved to another category.\n extend(DiscussionControls, 'moderationControls', function (items, discussion) {\n if (discussion.canTag()) {\n items.add(\n 'tags',\n \n );\n }\n });\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionComposer'];","import { extend, override } from 'flarum/common/extend';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport DiscussionComposer from 'flarum/forum/components/DiscussionComposer';\nimport classList from 'flarum/common/utils/classList';\n\nimport TagDiscussionModal from './components/TagDiscussionModal';\nimport tagsLabel from '../common/helpers/tagsLabel';\nimport getSelectableTags from './utils/getSelectableTags';\n\nexport default function () {\n extend(IndexPage.prototype, 'newDiscussionAction', function (promise) {\n // From `addTagFilter\n const tag = this.currentTag();\n\n if (tag) {\n const parent = tag.parent();\n const tags = parent ? [parent, tag] : [tag];\n promise.then((composer) => (composer.fields.tags = tags));\n } else {\n app.composer.fields.tags = [];\n }\n });\n\n extend(DiscussionComposer.prototype, 'oninit', function () {\n app.tagList.load(['parent']).then(() => m.redraw());\n });\n\n // Add tag-selection abilities to the discussion composer.\n DiscussionComposer.prototype.chooseTags = function () {\n const selectableTags = getSelectableTags();\n\n if (!selectableTags.length) return;\n\n app.modal.show(TagDiscussionModal, {\n selectedTags: (this.composer.fields.tags || []).slice(0),\n onsubmit: (tags) => {\n this.composer.fields.tags = tags;\n this.$('textarea').focus();\n },\n });\n };\n\n // Add a tag-selection menu to the discussion composer's header, after the\n // title.\n extend(DiscussionComposer.prototype, 'headerItems', function (items) {\n const tags = this.composer.fields.tags || [];\n const selectableTags = getSelectableTags();\n\n items.add(\n 'tags',\n \n {tags.length ? (\n tagsLabel(tags)\n ) : (\n {app.translator.trans('flarum-tags.forum.composer_discussion.choose_tags_link')}\n )}\n ,\n 10\n );\n });\n\n override(DiscussionComposer.prototype, 'onsubmit', function (original) {\n const chosenTags = this.composer.fields.tags || [];\n const chosenPrimaryTags = chosenTags.filter((tag) => tag.position() !== null && !tag.isChild());\n const chosenSecondaryTags = chosenTags.filter((tag) => tag.position() === null);\n const selectableTags = getSelectableTags();\n\n const minPrimaryTags = parseInt(app.forum.attribute('minPrimaryTags'));\n const minSecondaryTags = parseInt(app.forum.attribute('minSecondaryTags'));\n const maxPrimaryTags = parseInt(app.forum.attribute('maxPrimaryTags'));\n const maxSecondaryTags = parseInt(app.forum.attribute('maxSecondaryTags'));\n\n if (\n ((!chosenTags.length && maxPrimaryTags !== 0 && maxSecondaryTags !== 0) ||\n chosenPrimaryTags.length < minPrimaryTags ||\n chosenSecondaryTags.length < minSecondaryTags) &&\n selectableTags.length\n ) {\n app.modal.show(TagDiscussionModal, {\n selectedTags: chosenTags,\n onsubmit: (tags) => {\n this.composer.fields.tags = tags;\n original();\n },\n });\n } else {\n original();\n }\n });\n\n // Add the selected tags as data to submit to the server.\n extend(DiscussionComposer.prototype, 'data', function (data) {\n data.relationships = data.relationships || {};\n data.relationships.tags = this.composer.fields.tags;\n });\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extenders'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Discussion'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/EventPost'];","import EventPost from 'flarum/forum/components/EventPost';\nimport tagsLabel from '../../common/helpers/tagsLabel';\n\nexport default class DiscussionTaggedPost extends EventPost {\n static initAttrs(attrs) {\n super.initAttrs(attrs);\n\n const oldTags = attrs.post.content()[0];\n const newTags = attrs.post.content()[1];\n\n function diffTags(tags1, tags2) {\n return tags1.filter((tag) => tags2.indexOf(tag) === -1).map((id) => app.store.getById('tags', id));\n }\n\n attrs.tagsAdded = diffTags(newTags, oldTags);\n attrs.tagsRemoved = diffTags(oldTags, newTags);\n }\n\n icon() {\n return 'fas fa-tag';\n }\n\n descriptionKey() {\n if (this.attrs.tagsAdded.length) {\n if (this.attrs.tagsRemoved.length) {\n return 'flarum-tags.forum.post_stream.added_and_removed_tags_text';\n }\n\n return 'flarum-tags.forum.post_stream.added_tags_text';\n }\n\n return 'flarum-tags.forum.post_stream.removed_tags_text';\n }\n\n descriptionData() {\n const data = {};\n\n if (this.attrs.tagsAdded.length) {\n data.tagsAdded = app.translator.trans('flarum-tags.forum.post_stream.tags_text', {\n tags: tagsLabel(this.attrs.tagsAdded, { link: true }),\n count: this.attrs.tagsAdded.length,\n });\n }\n\n if (this.attrs.tagsRemoved.length) {\n data.tagsRemoved = app.translator.trans('flarum-tags.forum.post_stream.tags_text', {\n tags: tagsLabel(this.attrs.tagsRemoved, { link: true }),\n count: this.attrs.tagsRemoved.length,\n });\n }\n\n return data;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/computed'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","import computed from 'flarum/common/utils/computed';\nimport Model from 'flarum/common/Model';\nimport type Discussion from 'flarum/common/models/Discussion';\n\nexport default class Tag extends Model {\n name() {\n return Model.attribute('name').call(this);\n }\n slug() {\n return Model.attribute('slug').call(this);\n }\n description() {\n return Model.attribute('description').call(this);\n }\n\n color() {\n return Model.attribute('color').call(this);\n }\n backgroundUrl() {\n return Model.attribute('backgroundUrl').call(this);\n }\n backgroundMode() {\n return Model.attribute('backgroundMode').call(this);\n }\n icon() {\n return Model.attribute('icon').call(this);\n }\n\n position() {\n return Model.attribute('position').call(this);\n }\n parent() {\n return Model.hasOne('parent').call(this);\n }\n children() {\n return Model.hasMany('children').call(this);\n }\n defaultSort() {\n return Model.attribute('defaultSort').call(this);\n }\n isChild() {\n return Model.attribute('isChild').call(this);\n }\n isHidden() {\n return Model.attribute('isHidden').call(this);\n }\n\n discussionCount() {\n return Model.attribute('discussionCount').call(this);\n }\n lastPostedAt() {\n return Model.attribute('lastPostedAt', Model.transformDate).call(this);\n }\n lastPostedDiscussion() {\n return Model.hasOne('lastPostedDiscussion').call(this);\n }\n\n isRestricted() {\n return Model.attribute('isRestricted').call(this);\n }\n canStartDiscussion() {\n return Model.attribute('canStartDiscussion').call(this);\n }\n canAddToDiscussion() {\n return Model.attribute('canAddToDiscussion').call(this);\n }\n\n isPrimary() {\n return computed('position', 'parent', (position, parent) => position !== null && parent === false).call(this);\n }\n}\n","import Extend from 'flarum/common/extenders';\nimport Tag from './models/Tag';\n\nexport default [\n new Extend.Store() //\n .add('tags', Tag),\n];\n","import app from 'flarum/forum/app';\nimport Extend from 'flarum/common/extenders';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport Discussion from 'flarum/common/models/Discussion';\nimport DiscussionTaggedPost from './components/DiscussionTaggedPost';\nimport TagsPage from './components/TagsPage';\nimport Tag from '../common/models/Tag';\n\nimport commonExtend from '../common/extend';\n\nexport default [\n ...commonExtend,\n\n new Extend.Routes() //\n .add('tags', '/tags', TagsPage) //\n .add('tag', '/t/:tags', IndexPage) //\n .helper('tag', (tag) => app.route('tag', { tags: tag.slug() })),\n\n new Extend.PostTypes() //\n .add('discussionTagged', DiscussionTaggedPost),\n\n new Extend.Model(Discussion) //\n .hasMany('tags') //\n .attribute('canTag'),\n];\n","import sortTags from './utils/sortTags';\nimport Tag from './models/Tag';\nimport tagsLabel from './helpers/tagsLabel';\nimport tagIcon from './helpers/tagIcon';\nimport tagLabel from './helpers/tagLabel';\nimport TagSelectionModal from './components/TagSelectionModal';\nimport TagListState from './states/TagListState';\n\nexport default {\n 'tags/utils/sortTags': sortTags,\n 'tags/models/Tag': Tag,\n 'tags/helpers/tagsLabel': tagsLabel,\n 'tags/helpers/tagIcon': tagIcon,\n 'tags/helpers/tagLabel': tagLabel,\n 'tags/components/TagSelectionModal': TagSelectionModal,\n 'tags/states/TagListState': TagListState,\n};\n","import compat from '../common/compat';\n\nimport addTagFilter from './addTagFilter';\nimport addTagControl from './addTagControl';\nimport TagHero from './components/TagHero';\nimport TagDiscussionModal from './components/TagDiscussionModal';\nimport TagsPage from './components/TagsPage';\nimport DiscussionTaggedPost from './components/DiscussionTaggedPost';\nimport TagLinkButton from './components/TagLinkButton';\nimport addTagList from './addTagList';\nimport addTagLabels from './addTagLabels';\nimport addTagComposer from './addTagComposer';\nimport getSelectableTags from './utils/getSelectableTags';\n\nexport default Object.assign(compat, {\n 'tags/addTagFilter': addTagFilter,\n 'tags/addTagControl': addTagControl,\n 'tags/components/TagHero': TagHero,\n 'tags/components/TagDiscussionModal': TagDiscussionModal,\n 'tags/components/TagsPage': TagsPage,\n 'tags/components/DiscussionTaggedPost': DiscussionTaggedPost,\n 'tags/components/TagLinkButton': TagLinkButton,\n 'tags/addTagList': addTagList,\n 'tags/addTagLabels': addTagLabels,\n 'tags/addTagComposer': addTagComposer,\n 'tags/utils/getSelectableTags': getSelectableTags,\n});\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core;","import app from 'flarum/forum/app';\n\nimport TagListState from '../common/states/TagListState';\n\nimport addTagList from './addTagList';\nimport addTagFilter from './addTagFilter';\nimport addTagLabels from './addTagLabels';\nimport addTagControl from './addTagControl';\nimport addTagComposer from './addTagComposer';\n\nexport { default as extend } from './extend';\n\napp.initializers.add('flarum-tags', function () {\n app.tagList = new TagListState();\n\n addTagList();\n addTagFilter();\n addTagLabels();\n addTagControl();\n addTagComposer();\n});\n\n// Expose compat API\nimport tagsCompat from './compat';\nimport { compat } from '@flarum/core/forum';\n\nObject.assign(compat, tagsCompat);\n","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 exports;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n var exports = {},\n Op = Object.prototype,\n hasOwn = Op.hasOwnProperty,\n defineProperty = Object.defineProperty || function (obj, key, desc) {\n obj[key] = desc.value;\n },\n $Symbol = \"function\" == typeof Symbol ? Symbol : {},\n iteratorSymbol = $Symbol.iterator || \"@@iterator\",\n asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\",\n toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n function define(obj, key, value) {\n return Object.defineProperty(obj, key, {\n value: value,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }), obj[key];\n }\n try {\n define({}, \"\");\n } catch (err) {\n define = function define(obj, key, value) {\n return obj[key] = value;\n };\n }\n function wrap(innerFn, outerFn, self, tryLocsList) {\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,\n generator = Object.create(protoGenerator.prototype),\n context = new Context(tryLocsList || []);\n return defineProperty(generator, \"_invoke\", {\n value: makeInvokeMethod(innerFn, self, context)\n }), generator;\n }\n function tryCatch(fn, obj, arg) {\n try {\n return {\n type: \"normal\",\n arg: fn.call(obj, arg)\n };\n } catch (err) {\n return {\n type: \"throw\",\n arg: err\n };\n }\n }\n exports.wrap = wrap;\n var ContinueSentinel = {};\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n var getProto = Object.getPrototypeOf,\n NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);\n var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n define(prototype, method, function (arg) {\n return this._invoke(method, arg);\n });\n });\n }\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (\"throw\" !== record.type) {\n var result = record.arg,\n value = result.value;\n return value && \"object\" == _typeof(value) && hasOwn.call(value, \"__await\") ? PromiseImpl.resolve(value.__await).then(function (value) {\n invoke(\"next\", value, resolve, reject);\n }, function (err) {\n invoke(\"throw\", err, resolve, reject);\n }) : PromiseImpl.resolve(value).then(function (unwrapped) {\n result.value = unwrapped, resolve(result);\n }, function (error) {\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n reject(record.arg);\n }\n var previousPromise;\n defineProperty(this, \"_invoke\", {\n value: function value(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function (resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();\n }\n });\n }\n function makeInvokeMethod(innerFn, self, context) {\n var state = \"suspendedStart\";\n return function (method, arg) {\n if (\"executing\" === state) throw new Error(\"Generator is already running\");\n if (\"completed\" === state) {\n if (\"throw\" === method) throw arg;\n return doneResult();\n }\n for (context.method = method, context.arg = arg;;) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n if (\"next\" === context.method) context.sent = context._sent = context.arg;else if (\"throw\" === context.method) {\n if (\"suspendedStart\" === state) throw state = \"completed\", context.arg;\n context.dispatchException(context.arg);\n } else \"return\" === context.method && context.abrupt(\"return\", context.arg);\n state = \"executing\";\n var record = tryCatch(innerFn, self, context);\n if (\"normal\" === record.type) {\n if (state = context.done ? \"completed\" : \"suspendedYield\", record.arg === ContinueSentinel) continue;\n return {\n value: record.arg,\n done: context.done\n };\n }\n \"throw\" === record.type && (state = \"completed\", context.method = \"throw\", context.arg = record.arg);\n }\n };\n }\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (undefined === method) {\n if (context.delegate = null, \"throw\" === context.method) {\n if (delegate.iterator[\"return\"] && (context.method = \"return\", context.arg = undefined, maybeInvokeDelegate(delegate, context), \"throw\" === context.method)) return ContinueSentinel;\n context.method = \"throw\", context.arg = new TypeError(\"The iterator does not provide a 'throw' method\");\n }\n return ContinueSentinel;\n }\n var record = tryCatch(method, delegate.iterator, context.arg);\n if (\"throw\" === record.type) return context.method = \"throw\", context.arg = record.arg, context.delegate = null, ContinueSentinel;\n var info = record.arg;\n return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, \"return\" !== context.method && (context.method = \"next\", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = \"throw\", context.arg = new TypeError(\"iterator result is not an object\"), context.delegate = null, ContinueSentinel);\n }\n function pushTryEntry(locs) {\n var entry = {\n tryLoc: locs[0]\n };\n 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);\n }\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\", delete record.arg, entry.completion = record;\n }\n function Context(tryLocsList) {\n this.tryEntries = [{\n tryLoc: \"root\"\n }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);\n }\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) return iteratorMethod.call(iterable);\n if (\"function\" == typeof iterable.next) return iterable;\n if (!isNaN(iterable.length)) {\n var i = -1,\n next = function next() {\n for (; ++i < iterable.length;) {\n if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;\n }\n return next.value = undefined, next.done = !0, next;\n };\n return next.next = next;\n }\n }\n return {\n next: doneResult\n };\n }\n function doneResult() {\n return {\n value: undefined,\n done: !0\n };\n }\n return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, \"constructor\", {\n value: GeneratorFunctionPrototype,\n configurable: !0\n }), defineProperty(GeneratorFunctionPrototype, \"constructor\", {\n value: GeneratorFunction,\n configurable: !0\n }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, \"GeneratorFunction\"), exports.isGeneratorFunction = function (genFun) {\n var ctor = \"function\" == typeof genFun && genFun.constructor;\n return !!ctor && (ctor === GeneratorFunction || \"GeneratorFunction\" === (ctor.displayName || ctor.name));\n }, exports.mark = function (genFun) {\n return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, \"GeneratorFunction\")), genFun.prototype = Object.create(Gp), genFun;\n }, exports.awrap = function (arg) {\n return {\n __await: arg\n };\n }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n void 0 === PromiseImpl && (PromiseImpl = Promise);\n var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);\n return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {\n return result.done ? result.value : iter.next();\n });\n }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, \"Generator\"), define(Gp, iteratorSymbol, function () {\n return this;\n }), define(Gp, \"toString\", function () {\n return \"[object Generator]\";\n }), exports.keys = function (val) {\n var object = Object(val),\n keys = [];\n for (var key in object) {\n keys.push(key);\n }\n return keys.reverse(), function next() {\n for (; keys.length;) {\n var key = keys.pop();\n if (key in object) return next.value = key, next.done = !1, next;\n }\n return next.done = !0, next;\n };\n }, exports.values = values, Context.prototype = {\n constructor: Context,\n reset: function reset(skipTempReset) {\n if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) {\n \"t\" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);\n }\n },\n stop: function stop() {\n this.done = !0;\n var rootRecord = this.tryEntries[0].completion;\n if (\"throw\" === rootRecord.type) throw rootRecord.arg;\n return this.rval;\n },\n dispatchException: function dispatchException(exception) {\n if (this.done) throw exception;\n var context = this;\n function handle(loc, caught) {\n return record.type = \"throw\", record.arg = exception, context.next = loc, caught && (context.method = \"next\", context.arg = undefined), !!caught;\n }\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i],\n record = entry.completion;\n if (\"root\" === entry.tryLoc) return handle(\"end\");\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\"),\n hasFinally = hasOwn.call(entry, \"finallyLoc\");\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);\n if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);\n } else {\n if (!hasFinally) throw new Error(\"try statement without catch or finally\");\n if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);\n }\n }\n }\n },\n abrupt: function abrupt(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev && hasOwn.call(entry, \"finallyLoc\") && this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n finallyEntry && (\"break\" === type || \"continue\" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);\n var record = finallyEntry ? finallyEntry.completion : {};\n return record.type = type, record.arg = arg, finallyEntry ? (this.method = \"next\", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);\n },\n complete: function complete(record, afterLoc) {\n if (\"throw\" === record.type) throw record.arg;\n return \"break\" === record.type || \"continue\" === record.type ? this.next = record.arg : \"return\" === record.type ? (this.rval = this.arg = record.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;\n },\n finish: function finish(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;\n }\n },\n \"catch\": function _catch(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (\"throw\" === record.type) {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n throw new Error(\"illegal catch attempt\");\n },\n delegateYield: function delegateYield(iterable, resultName, nextLoc) {\n return this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n }, \"next\" === this.method && (this.arg = undefined), ContinueSentinel;\n }\n }, exports;\n}\nmodule.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(obj);\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))","// 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};"],"names":["flarum","core","compat","asyncGeneratorStep","gen","resolve","reject","_next","_throw","key","arg","info","value","error","done","Promise","then","_asyncToGenerator","fn","self","this","args","arguments","apply","err","undefined","TagListState","loadedIncludes","load","includes","query","unloadedIncludes","filter","include","has","length","app","Set","join","val","forEach","add","_setPrototypeOf","o","p","Object","setPrototypeOf","bind","__proto__","_inheritsLoose","subClass","superClass","prototype","create","constructor","tagIcon","tag","attrs","settings","hasIcon","icon","useColor","className","classList","style","color","TagLinkButton","view","vnode","model","description","child","isChild","href","route","title","name","translator","trans","initAttrs","params","tags","slug","LinkButton","tagLabel","link","extract","tagText","textContrastClass","m","Link","sortTags","slice","sort","a","b","aPos","position","bPos","discussionCount","aParent","parent","bParent","TagsPage","oninit","history","push","preloaded","preloadedApiDocument","loading","tagList","store","all","redraw","oncreate","setTitle","setTitleCount","pageContent","toArray","items","ItemList","hero","mainContent","sidebar","content","contentItems","pinned","cloud","tagTileListView","cloudView","IndexPage","listItems","sidebarItems","map","tagTileView","lastPostedDiscussion","children","colored","discussion","lastPostNumber","humanTime","lastPostedAt","Page","extend","currentTag","addTag","active","id","more","splice","TagHero","Component","findTag","find","localeCompare","sensitivity","currentActiveTag","currentTagLoading","override","original","vdom","canStartDiscussion","newDiscussion","get","disabled","GlobalSearchState","param","DiscussionListState","q","_objectWithoutPropertiesLoose","source","excluded","i","target","sourceKeys","keys","indexOf","r","e","t","f","n","Array","isArray","tagsLabel","otherAttrs","DiscussionListItem","DiscussionHero","getSelectableTags","canAddToDiscussion","ToggleButton","isToggled","TagSelectionModal","selected","bypassReqs","Stream","focused","navigator","KeyboardNavigatable","indexTag","extractText","canSelect","allowResetting","limits","min","total","primary","secondary","max","Infinity","Error","catchInvalidLimits","onUp","setIndex","getCurrentNumericIndex","onDown","onSelect","select","onRemove","selectableTags","selectedTags","toLowerCase","primaryCount","secondaryCount","getFilteredTags","inputWidth","Math","getInstruction","onclick","$","focus","removeTag","onready","placeholder","bidi","width","onkeydown","navigate","onfocus","onblur","type","meetsRequirements","onmouseover","toggleTag","highlight","allowBypassing","requireParentTag","isPrimary","index","onDeselect","remaining","count","onsubmit","preventDefault","hide","metaKey","ctrlKey","click","getItem","dispatchEvent","Event","selectableItems","selectedTag","scrollToItem","$items","$dropdown","$item","eq","attr","scrollTop","dropdownScroll","dropdownTop","offset","top","dropdownBottom","outerHeight","itemTop","itemBottom","parseInt","css","stop","animate","Modal","TagDiscussionModal","suppliedOnsubmit","save","relationships","DiscussionPage","update","DiscussionControls","canTag","modal","show","promise","composer","fields","DiscussionComposer","chooseTags","chosenTags","chosenPrimaryTags","chosenSecondaryTags","minPrimaryTags","forum","attribute","minSecondaryTags","maxPrimaryTags","maxSecondaryTags","data","DiscussionTaggedPost","oldTags","post","newTags","diffTags","tags1","tags2","getById","tagsAdded","tagsRemoved","descriptionKey","descriptionData","EventPost","Tag","Model","call","backgroundUrl","backgroundMode","defaultSort","isHidden","isRestricted","computed","Extend","commonExtend","helper","Discussion","hasMany","assign","addTagFilter","addTagControl","addTagList","addTagLabels","addTagComposer","tagsCompat","_typeof","require","_regeneratorRuntime","module","exports","__esModule","Op","hasOwn","hasOwnProperty","defineProperty","obj","desc","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","enumerable","configurable","writable","wrap","innerFn","outerFn","tryLocsList","protoGenerator","Generator","generator","context","Context","makeInvokeMethod","tryCatch","ContinueSentinel","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","method","_invoke","AsyncIterator","PromiseImpl","invoke","record","result","__await","unwrapped","previousPromise","callInvokeWithMethodAndArg","state","delegate","delegateResult","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","TypeError","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","doneResult","displayName","isGeneratorFunction","genFun","ctor","mark","awrap","async","iter","object","reverse","pop","skipTempReset","prev","charAt","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","runtime","regeneratorRuntime","accidentalStrictMode","globalThis","Function","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","d","definition","prop"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"forum.js","mappings":";qEAAA,MAAM,EAA+BA,OAAOC,KAAKC,OAAO,0BCAxD,SAASC,EAAmBC,EAAKC,EAASC,EAAQC,EAAOC,EAAQC,EAAKC,GACpE,IACE,IAAIC,EAAOP,EAAIK,GAAKC,GAChBE,EAAQD,EAAKC,KAInB,CAHE,MAAOC,GAEP,YADAP,EAAOO,EAET,CACIF,EAAKG,KACPT,EAAQO,GAERG,QAAQV,QAAQO,GAAOI,KAAKT,EAAOC,EAEvC,CACe,SAASS,EAAkBC,GACxC,OAAO,WACL,IAAIC,EAAOC,KACTC,EAAOC,UACT,OAAO,IAAIP,SAAQ,SAAUV,EAASC,GACpC,IAAIF,EAAMc,EAAGK,MAAMJ,EAAME,GACzB,SAASd,EAAMK,GACbT,EAAmBC,EAAKC,EAASC,EAAQC,EAAOC,EAAQ,OAAQI,EAClE,CACA,SAASJ,EAAOgB,GACdrB,EAAmBC,EAAKC,EAASC,EAAQC,EAAOC,EAAQ,QAASgB,EACnE,CACAjB,OAAMkB,EACR,GACF,CACF,uBC7BA,MAAM,EAA+BzB,OAAOC,KAAKC,OAAO,2BCGnCwB,EAAY,6BAC/BC,oBAAc,oBAuBb,OAvBa,EAERC,KAAI,6BAAV,WAAWC,GAAkB,8EAAK,QAAL,IAAlBA,IAAAA,EAAqB,IACzBT,KAAKO,eAAgB,CAAF,wCACfP,KAAKU,MAAMD,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QAAQC,YAAa,EAAMF,EAAOC,QAAiB,QAAID,EAAOC,uBCP/F,IAAI0G,EAAU7G,EAAQ,IAARA,GACdE,EAAOC,QAAU0G,EAGjB,IACEC,mBAAqBD,CAOvB,CANE,MAAOE,GACmB,iBAAfC,WACTA,WAAWF,mBAAqBD,EAEhCI,SAAS,IAAK,yBAAdA,CAAwCJ,EAE5C,ICbIK,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBlb,IAAjBmb,EACH,OAAOA,EAAalH,QAGrB,IAAID,EAASgH,EAAyBE,GAAY,CAGjDjH,QAAS,CAAC,GAOX,OAHAmH,EAAoBF,GAAUlH,EAAQA,EAAOC,QAASgH,GAG/CjH,EAAOC,OACf,CCrBAgH,EAAoBrR,EAAKoK,IACxB,IAAIqH,EAASrH,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAiH,EAAoBK,EAAED,EAAQ,CAAEhX,EAAGgX,IAC5BA,CAAM,ECLdJ,EAAoBK,EAAI,CAACrH,EAASsH,KACjC,IAAI,IAAIvc,KAAOuc,EACXN,EAAoB/Z,EAAEqa,EAAYvc,KAASic,EAAoB/Z,EAAE+S,EAASjV,IAC5EoC,OAAOkT,eAAeL,EAASjV,EAAK,CAAEkW,YAAY,EAAMxM,IAAK6S,EAAWvc,IAE1E,ECNDic,EAAoB/Z,EAAI,CAACqT,EAAKiH,IAAUpa,OAAOO,UAAU0S,eAAe3B,KAAK6B,EAAKiH,GCClFP,EAAoBzR,EAAKyK,IACH,oBAAXS,QAA0BA,OAAOM,aAC1C5T,OAAOkT,eAAeL,EAASS,OAAOM,YAAa,CAAE7V,MAAO,WAE7DiC,OAAOkT,eAAeL,EAAS,aAAc,CAAE9U,OAAO,GAAO","sources":["webpack://@flarum/tags/external root \"flarum.core.compat['forum/app']\"","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js","webpack://@flarum/tags/external root \"flarum.core.compat['common/app']\"","webpack://@flarum/tags/./src/common/states/TagListState.ts","webpack://@flarum/tags/external root \"flarum.core.compat['common/extend']\"","webpack://@flarum/tags/external root \"flarum.core.compat['forum/components/IndexPage']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/components/Separator']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/components/LinkButton']\"","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@flarum/tags/external root \"flarum.core.compat['common/components/Link']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/utils/classList']\"","webpack://@flarum/tags/./src/common/helpers/tagIcon.js","webpack://@flarum/tags/./src/forum/components/TagLinkButton.js","webpack://@flarum/tags/external root \"flarum.core.compat['common/components/Page']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/helpers/listItems']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/utils/ItemList']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/helpers/humanTime']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/helpers/textContrastClass']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/utils/extract']\"","webpack://@flarum/tags/./src/common/helpers/tagLabel.js","webpack://@flarum/tags/./src/common/utils/sortTags.tsx","webpack://@flarum/tags/./src/forum/components/TagsPage.js","webpack://@flarum/tags/./src/forum/addTagList.js","webpack://@flarum/tags/external root \"flarum.core.compat['forum/states/DiscussionListState']\"","webpack://@flarum/tags/external root \"flarum.core.compat['forum/states/GlobalSearchState']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/Component']\"","webpack://@flarum/tags/./src/forum/components/TagHero.js","webpack://@flarum/tags/./src/forum/addTagFilter.tsx","webpack://@flarum/tags/external root \"flarum.core.compat['forum/components/DiscussionListItem']\"","webpack://@flarum/tags/external root \"flarum.core.compat['forum/components/DiscussionHero']\"","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","webpack://@flarum/tags/../../../node_modules/clsx/dist/clsx.m.js","webpack://@flarum/tags/./src/common/helpers/tagsLabel.js","webpack://@flarum/tags/./src/forum/addTagLabels.js","webpack://@flarum/tags/external root \"flarum.core.compat['forum/utils/DiscussionControls']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/components/Button']\"","webpack://@flarum/tags/external root \"flarum.core.compat['forum/components/DiscussionPage']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/utils/extractText']\"","webpack://@flarum/tags/./src/forum/utils/getSelectableTags.js","webpack://@flarum/tags/external root \"flarum.core.compat['common/helpers/highlight']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/utils/KeyboardNavigatable']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/components/Modal']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/utils/Stream']\"","webpack://@flarum/tags/./src/forum/components/ToggleButton.js","webpack://@flarum/tags/./src/common/components/TagSelectionModal.tsx","webpack://@flarum/tags/./src/forum/components/TagDiscussionModal.tsx","webpack://@flarum/tags/./src/forum/addTagControl.js","webpack://@flarum/tags/external root \"flarum.core.compat['forum/components/DiscussionComposer']\"","webpack://@flarum/tags/./src/forum/addTagComposer.js","webpack://@flarum/tags/external root \"flarum.core.compat['common/extenders']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/models/Discussion']\"","webpack://@flarum/tags/external root \"flarum.core.compat['forum/components/EventPost']\"","webpack://@flarum/tags/./src/forum/components/DiscussionTaggedPost.js","webpack://@flarum/tags/external root \"flarum.core.compat['common/utils/computed']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/Model']\"","webpack://@flarum/tags/./src/common/models/Tag.ts","webpack://@flarum/tags/./src/common/extend.ts","webpack://@flarum/tags/./src/forum/extend.ts","webpack://@flarum/tags/./src/common/compat.js","webpack://@flarum/tags/./src/forum/compat.js","webpack://@flarum/tags/external assign \"flarum.core\"","webpack://@flarum/tags/./src/forum/index.ts","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/regeneratorRuntime.js","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/typeof.js","webpack://@flarum/tags/../../../node_modules/@babel/runtime/regenerator/index.js","webpack://@flarum/tags/webpack/bootstrap","webpack://@flarum/tags/webpack/runtime/compat get default export","webpack://@flarum/tags/webpack/runtime/define property getters","webpack://@flarum/tags/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/tags/webpack/runtime/make namespace object"],"sourcesContent":["const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/app'];","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\nexport default function _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n _next(undefined);\n });\n };\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/app'];","import app from 'flarum/common/app';\nimport type Tag from '../../common/models/Tag';\n\nexport default class TagListState {\n loadedIncludes?: Set;\n\n async load(includes: string[] = []): Promise {\n if (!this.loadedIncludes) {\n return this.query(includes);\n }\n\n const unloadedIncludes = includes.filter((include) => !this.loadedIncludes!.has(include));\n\n if (unloadedIncludes.length === 0) {\n return Promise.resolve(app.store.all('tags'));\n }\n\n return this.query(unloadedIncludes);\n }\n\n async query(includes: string[] = []): Promise {\n this.loadedIncludes ??= new Set();\n\n return app.store.find('tags', { include: includes.join(',') }).then((val) => {\n includes.forEach((include) => this.loadedIncludes!.add(include));\n return val;\n });\n }\n}\n","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['common/components/Separator'];","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['common/components/Link'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/classList'];","import classList from 'flarum/common/utils/classList';\n\nexport default function tagIcon(tag, attrs = {}, settings = {}) {\n const hasIcon = tag && tag.icon();\n const { useColor = true } = settings;\n\n attrs.className = classList([attrs.className, 'icon', hasIcon ? tag.icon() : 'TagIcon']);\n\n if (tag && useColor) {\n attrs.style = attrs.style || {};\n attrs.style['--color'] = tag.color();\n\n if (hasIcon) {\n attrs.style.color = tag.color();\n }\n } else if (!tag) {\n attrs.className += ' untagged';\n }\n\n return hasIcon ? : ;\n}\n","import Link from 'flarum/common/components/Link';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport classList from 'flarum/common/utils/classList';\nimport tagIcon from '../../common/helpers/tagIcon';\n\nexport default class TagLinkButton extends LinkButton {\n view(vnode) {\n const tag = this.attrs.model;\n const description = tag && tag.description();\n const className = classList('TagLinkButton hasIcon', { child: tag.isChild() }, this.attrs.className);\n\n return (\n \n {tagIcon(tag, { className: 'Button-icon' })}\n {tag ? tag.name() : app.translator.trans('flarum-tags.forum.index.untagged_link')}\n \n );\n }\n\n static initAttrs(attrs) {\n super.initAttrs(attrs);\n\n const tag = attrs.model;\n\n attrs.params.tags = tag ? tag.slug() : 'untagged';\n attrs.route = app.route('tag', attrs.params);\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Page'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/listItems'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/humanTime'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/textContrastClass'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/extract'];","import extract from 'flarum/common/utils/extract';\nimport Link from 'flarum/common/components/Link';\nimport classList from 'flarum/common/utils/classList';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport tagIcon from './tagIcon';\n\nexport default function tagLabel(tag, attrs = {}) {\n attrs.style = attrs.style || {};\n attrs.className = 'TagLabel ' + (attrs.className || '');\n\n const link = extract(attrs, 'link');\n const tagText = tag ? tag.name() : app.translator.trans('flarum-tags.lib.deleted_tag_text');\n\n if (tag) {\n const color = tag.color();\n if (color) {\n attrs.style['--tag-bg'] = color;\n attrs.className = classList(attrs.className, 'colored', textContrastClass(color));\n }\n\n if (link) {\n attrs.title = tag.description() || '';\n attrs.href = app.route('tag', { tags: tag.slug() });\n }\n\n if (tag.isChild()) {\n attrs.className += ' TagLabel--child';\n }\n } else {\n attrs.className += ' untagged';\n }\n\n return m(\n link ? Link : 'span',\n attrs,\n \n {tag && tag.icon() && tagIcon(tag, { className: 'TagLabel-icon' }, { useColor: false })}\n {tagText}\n \n );\n}\n","import Tag from '../models/Tag';\n\nexport default function sortTags(tags: Tag[]) {\n return tags.slice(0).sort((a, b) => {\n const aPos = a.position();\n const bPos = b.position();\n\n // If they're both secondary tags, sort them by their discussions count,\n // descending.\n if (aPos === null && bPos === null) return b.discussionCount() - a.discussionCount();\n\n // If just one is a secondary tag, then the primary tag should\n // come first.\n if (bPos === null) return -1;\n if (aPos === null) return 1;\n\n // If we've made it this far, we know they're both primary tags. So we'll\n // need to see if they have parents.\n const aParent = a.parent();\n const bParent = b.parent();\n\n // If they both have the same parent, then their positions are local,\n // so we can compare them directly.\n if (aParent === bParent) return aPos - bPos;\n // If they are both child tags, then we will compare the positions of their\n // parents.\n else if (aParent && bParent) return aParent.position()! - bParent.position()!;\n // If we are comparing a child tag with its parent, then we let the parent\n // come first. If we are comparing an unrelated parent/child, then we\n // compare both of the parents.\n else if (aParent) return aParent === b ? 1 : aParent.position()! - bPos;\n else if (bParent) return bParent === a ? -1 : aPos - bParent.position()!;\n\n return 0;\n });\n}\n","import Page from 'flarum/common/components/Page';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport Link from 'flarum/common/components/Link';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport listItems from 'flarum/common/helpers/listItems';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport humanTime from 'flarum/common/helpers/humanTime';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport classList from 'flarum/common/utils/classList';\n\nimport tagIcon from '../../common/helpers/tagIcon';\nimport tagLabel from '../../common/helpers/tagLabel';\nimport sortTags from '../../common/utils/sortTags';\n\nexport default class TagsPage extends Page {\n oninit(vnode) {\n super.oninit(vnode);\n\n app.history.push('tags', app.translator.trans('flarum-tags.forum.header.back_to_tags_tooltip'));\n\n this.tags = [];\n\n const preloaded = app.preloadedApiDocument();\n\n if (preloaded) {\n this.tags = sortTags(preloaded.filter((tag) => !tag.isChild()));\n return;\n }\n\n this.loading = true;\n\n app.tagList.load(['children', 'lastPostedDiscussion', 'parent']).then(() => {\n this.tags = sortTags(app.store.all('tags').filter((tag) => !tag.isChild()));\n\n this.loading = false;\n\n m.redraw();\n });\n }\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n app.setTitle(app.translator.trans('flarum-tags.forum.all_tags.meta_title_text'));\n app.setTitleCount(0);\n }\n\n view() {\n return
    {this.pageContent().toArray()}
    ;\n }\n\n pageContent() {\n const items = new ItemList();\n\n items.add('hero', this.hero(), 100);\n items.add('main',
    {this.mainContent().toArray()}
    , 10);\n\n return items;\n }\n\n mainContent() {\n const items = new ItemList();\n\n items.add('sidebar', this.sidebar(), 100);\n items.add('content', this.content(), 10);\n\n return items;\n }\n\n content() {\n return
    {this.contentItems().toArray()}
    ;\n }\n\n contentItems() {\n const items = new ItemList();\n\n if (this.loading) {\n items.add('loading', );\n } else {\n const pinned = this.tags.filter((tag) => tag.position() !== null);\n const cloud = this.tags.filter((tag) => tag.position() === null);\n\n items.add('tagTiles', this.tagTileListView(pinned), 100);\n\n if (cloud.length) {\n items.add('cloud', this.cloudView(cloud), 10);\n }\n }\n\n return items;\n }\n\n hero() {\n return IndexPage.prototype.hero();\n }\n\n sidebar() {\n return (\n \n );\n }\n\n sidebarItems() {\n return IndexPage.prototype.sidebarItems();\n }\n\n tagTileListView(pinned) {\n return
      {pinned.map(this.tagTileView.bind(this))}
    ;\n }\n\n tagTileView(tag) {\n const lastPostedDiscussion = tag.lastPostedDiscussion();\n const children = sortTags(tag.children() || []);\n\n return (\n
  • \n \n {tag.icon() && tagIcon(tag, {}, { useColor: false })}\n

    {tag.name()}

    \n

    {tag.description()}

    \n {!!children && (\n
    {children.map((child) => [{child.name()}, ' '])}
    \n )}\n \n {lastPostedDiscussion ? (\n \n {lastPostedDiscussion.title()}\n {humanTime(lastPostedDiscussion.lastPostedAt())}\n \n ) : (\n \n )}\n
  • \n );\n }\n\n cloudView(cloud) {\n return
    {cloud.map((tag) => [tagLabel(tag, { link: true }), ' '])}
    ;\n }\n}\n","import { extend } from 'flarum/common/extend';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport Separator from 'flarum/common/components/Separator';\nimport LinkButton from 'flarum/common/components/LinkButton';\n\nimport TagLinkButton from './components/TagLinkButton';\nimport TagsPage from './components/TagsPage';\nimport app from 'flarum/forum/app';\nimport sortTags from '../common/utils/sortTags';\n\nexport default function () {\n // Add a link to the tags page, as well as a list of all the tags,\n // to the index page's sidebar.\n extend(IndexPage.prototype, 'navItems', function (items) {\n items.add(\n 'tags',\n \n {app.translator.trans('flarum-tags.forum.index.tags_link')}\n ,\n -10\n );\n\n if (app.current.matches(TagsPage)) return;\n\n items.add('separator', , -12);\n\n const params = app.search.stickyParams();\n const tags = app.store.all('tags');\n const currentTag = this.currentTag();\n\n const addTag = (tag) => {\n let active = currentTag === tag;\n\n if (!active && currentTag) {\n active = currentTag.parent() === tag;\n }\n\n // tag.name() is passed here as children even though it isn't used directly\n // because when we need to get the active child in SelectDropdown, we need to\n // use its children to populate the dropdown. The problem here is that `view`\n // on TagLinkButton is only called AFTER SelectDropdown, so no children are available\n // for SelectDropdown to use at the time.\n items.add(\n 'tag' + tag.id(),\n \n {tag?.name()}\n ,\n -14\n );\n };\n\n sortTags(tags)\n .filter(\n (tag) => tag.position() !== null && (!tag.isChild() || (currentTag && (tag.parent() === currentTag || tag.parent() === currentTag.parent())))\n )\n .forEach(addTag);\n\n const more = tags.filter((tag) => tag.position() === null).sort((a, b) => b.discussionCount() - a.discussionCount());\n\n more.splice(0, 3).forEach(addTag);\n\n if (more.length) {\n items.add('moreTags', {app.translator.trans('flarum-tags.forum.index.more_link')}, -16);\n }\n });\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/states/DiscussionListState'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/states/GlobalSearchState'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","import Component from 'flarum/common/Component';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport tagIcon from '../../common/helpers/tagIcon';\nimport classList from 'flarum/common/utils/classList';\n\nexport default class TagHero extends Component {\n view() {\n const tag = this.attrs.model;\n const color = tag.color();\n\n return (\n \n
    \n
    \n

    \n {tag.icon() && tagIcon(tag, {}, { useColor: false })} {tag.name()}\n

    \n
    {tag.description()}
    \n
    \n
    \n \n );\n }\n}\n","import app from 'flarum/forum/app';\nimport type Mithril from 'mithril';\nimport { extend, override } from 'flarum/common/extend';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport DiscussionListState from 'flarum/forum/states/DiscussionListState';\nimport GlobalSearchState from 'flarum/forum/states/GlobalSearchState';\nimport classList from 'flarum/common/utils/classList';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\n\nimport TagHero from './components/TagHero';\nimport Tag from '../common/models/Tag';\nimport { ComponentAttrs } from 'flarum/common/Component';\n\nconst findTag = (slug: string) => app.store.all('tags').find((tag) => tag.slug().localeCompare(slug, undefined, { sensitivity: 'base' }) === 0);\n\nexport default function () {\n IndexPage.prototype.currentTag = function () {\n if (this.currentActiveTag) {\n return this.currentActiveTag;\n }\n\n const slug = app.search.params().tags;\n let tag = null;\n\n if (slug) {\n tag = findTag(slug);\n }\n\n if ((slug && !tag) || (tag && !tag.isChild() && !tag.children())) {\n if (this.currentTagLoading) {\n return;\n }\n\n this.currentTagLoading = true;\n\n // Unlike the backend, no need to fetch parent.children because if we're on\n // a child tag page, then either:\n // - We loaded in that child tag (and its siblings) in the API document\n // - We first navigated to the current tag's parent, which would have loaded in the current tag's siblings.\n app.store\n .find('tags', slug, { include: 'children,children.parent,parent,state' })\n .then(() => {\n this.currentActiveTag = findTag(slug);\n\n m.redraw();\n })\n .finally(() => {\n this.currentTagLoading = false;\n });\n }\n\n if (tag) {\n this.currentActiveTag = tag;\n return this.currentActiveTag;\n }\n\n return;\n };\n\n // If currently viewing a tag, insert a tag hero at the top of the view.\n override(IndexPage.prototype, 'hero', function (original) {\n const tag = this.currentTag();\n\n if (tag) return ;\n\n return original();\n });\n\n extend(IndexPage.prototype, 'view', function (vdom: Mithril.Vnode) {\n const tag = this.currentTag();\n\n if (tag) vdom.attrs.className += ' IndexPage--tag' + tag.id();\n });\n\n extend(IndexPage.prototype, 'setTitle', function () {\n const tag = this.currentTag();\n\n if (tag) {\n app.setTitle(tag.name());\n }\n });\n\n // If currently viewing a tag, restyle the 'new discussion' button to use\n // the tag's color, and disable if the user isn't allowed to edit.\n extend(IndexPage.prototype, 'sidebarItems', function (items) {\n const tag = this.currentTag();\n\n if (tag) {\n const color = tag.color();\n const canStartDiscussion = tag.canStartDiscussion() || !app.session.user;\n const newDiscussion = items.get('newDiscussion') as Mithril.Vnode;\n\n if (color) {\n newDiscussion.attrs.className = classList([newDiscussion.attrs.className, 'Button--tagColored', textContrastClass(color)]);\n newDiscussion.attrs.style = { '--color': color };\n }\n\n newDiscussion.attrs.disabled = !canStartDiscussion;\n newDiscussion.children = app.translator.trans(\n canStartDiscussion ? 'core.forum.index.start_discussion_button' : 'core.forum.index.cannot_start_discussion_button'\n );\n }\n });\n\n // Add a parameter for the global search state to pass on to the\n // DiscussionListState that will let us filter discussions by tag.\n extend(GlobalSearchState.prototype, 'params', function (params) {\n params.tags = m.route.param('tags');\n });\n\n // Translate that parameter into a gambit appended to the search query.\n extend(DiscussionListState.prototype, 'requestParams', function (this: DiscussionListState, params) {\n if (typeof params.include === 'string') {\n params.include = [params.include];\n } else {\n params.include?.push('tags', 'tags.parent');\n }\n\n if (this.params.tags) {\n const filter = params.filter ?? {};\n filter.tag = this.params.tags;\n // TODO: replace this with a more robust system.\n const q = filter.q;\n if (q) {\n filter.q = `${q} tag:${this.params.tags}`;\n }\n params.filter = filter;\n }\n });\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionListItem'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionHero'];","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e))for(t=0;t {\n if (tag || tags.length === 1) {\n children.push(tagLabel(tag, { link }));\n }\n });\n } else {\n children.push(tagLabel());\n }\n\n return {children};\n}\n","import { extend } from 'flarum/common/extend';\nimport DiscussionListItem from 'flarum/forum/components/DiscussionListItem';\nimport DiscussionHero from 'flarum/forum/components/DiscussionHero';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport classList from 'flarum/common/utils/classList';\n\nimport tagsLabel from '../common/helpers/tagsLabel';\nimport sortTags from '../common/utils/sortTags';\n\nexport default function () {\n // Add tag labels to each discussion in the discussion list.\n extend(DiscussionListItem.prototype, 'infoItems', function (items) {\n const tags = this.attrs.discussion.tags();\n\n if (tags && tags.length) {\n items.add('tags', tagsLabel(tags), 10);\n }\n });\n\n // Restyle a discussion's hero to use its first tag's color.\n extend(DiscussionHero.prototype, 'view', function (view) {\n const tags = sortTags(this.attrs.discussion.tags());\n\n if (tags && tags.length) {\n const color = tags[0].color();\n if (color) {\n view.attrs.style = { '--hero-bg': color };\n view.attrs.className = classList(view.attrs.className, 'DiscussionHero--colored', textContrastClass(color));\n }\n }\n });\n\n // Add a list of a discussion's tags to the discussion hero, displayed\n // before the title. Put the title on its own line.\n extend(DiscussionHero.prototype, 'items', function (items) {\n const tags = this.attrs.discussion.tags();\n\n if (tags && tags.length) {\n items.add('tags', tagsLabel(tags, { link: true }), 5);\n }\n });\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/DiscussionControls'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/extractText'];","export default function getSelectableTags(discussion) {\n let tags = app.store.all('tags');\n\n if (discussion) {\n tags = tags.filter((tag) => tag.canAddToDiscussion() || discussion.tags().indexOf(tag) !== -1);\n } else {\n tags = tags.filter((tag) => tag.canStartDiscussion());\n }\n\n return tags;\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/highlight'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/KeyboardNavigatable'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","import Component from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport classList from 'flarum/common/utils/classList';\n\n/**\n * @TODO move to core\n */\nexport default class ToggleButton extends Component {\n view(vnode) {\n const { className, isToggled, ...attrs } = this.attrs;\n const icon = isToggled ? 'far fa-check-circle' : 'far fa-circle';\n\n return (\n \n );\n }\n}\n","import app from 'flarum/common/app';\nimport Button from 'flarum/common/components/Button';\nimport classList from 'flarum/common/utils/classList';\nimport extractText from 'flarum/common/utils/extractText';\nimport highlight from 'flarum/common/helpers/highlight';\nimport KeyboardNavigatable from 'flarum/common/utils/KeyboardNavigatable';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport Modal from 'flarum/common/components/Modal';\nimport Stream from 'flarum/common/utils/Stream';\n\nimport sortTags from '../utils/sortTags';\nimport tagLabel from '../helpers/tagLabel';\nimport tagIcon from '../helpers/tagIcon';\nimport ToggleButton from '../../forum/components/ToggleButton';\n\nimport type Tag from '../models/Tag';\nimport type { IInternalModalAttrs } from 'flarum/common/components/Modal';\nimport type Mithril from 'mithril';\n\nexport interface ITagSelectionModalLimits {\n /** Whether to allow bypassing the limits set here. This will show a toggle button to bypass limits. */\n allowBypassing?: boolean;\n /** Maximum number of primary/secondary tags allowed. */\n max?: {\n total?: number;\n primary?: number;\n secondary?: number;\n };\n /** Minimum number of primary/secondary tags to be selected. */\n min?: {\n total?: number;\n primary?: number;\n secondary?: number;\n };\n}\n\nexport interface ITagSelectionModalAttrs extends IInternalModalAttrs {\n /** Custom modal className to use. */\n className?: string;\n /** Modal title, defaults to 'Choose Tags'. */\n title?: string;\n /** Initial tag selection value. */\n selectedTags?: Tag[];\n /** Limits set based on minimum and maximum number of primary/secondary tags that can be selected. */\n limits?: ITagSelectionModalLimits;\n /** Whether to allow resetting the value. Defaults to true. */\n allowResetting?: boolean;\n /** Whether to require the parent tag of a selected tag to be selected as well. */\n requireParentTag?: boolean;\n /** Filter tags that can be selected. */\n selectableTags?: (tags: Tag[]) => Tag[];\n /** Whether a tag can be selected. */\n canSelect: (tag: Tag) => boolean;\n /** Callback for when a tag is selected. */\n onSelect?: (tag: Tag, selected: Tag[]) => void;\n /** Callback for when a tag is deselected. */\n onDeselect?: (tag: Tag, selected: Tag[]) => void;\n /** Callback for when the selection is submitted. */\n onsubmit?: (selected: Tag[]) => void;\n}\n\nexport type ITagSelectionModalState = undefined;\n\nexport default class TagSelectionModal<\n CustomAttrs extends ITagSelectionModalAttrs = ITagSelectionModalAttrs,\n CustomState extends ITagSelectionModalState = ITagSelectionModalState\n> extends Modal {\n protected loading = true;\n protected tags!: Tag[];\n protected selected: Tag[] = [];\n protected bypassReqs: boolean = false;\n\n protected filter = Stream('');\n protected focused = false;\n protected navigator = new KeyboardNavigatable();\n protected indexTag?: Tag;\n\n static initAttrs(attrs: ITagSelectionModalAttrs) {\n super.initAttrs(attrs);\n\n // Default values for optional attributes.\n attrs.title ||= extractText(app.translator.trans('flarum-tags.lib.tag_selection_modal.title'));\n attrs.canSelect ||= () => true;\n attrs.allowResetting ??= true;\n attrs.limits = {\n min: {\n total: attrs.limits?.min?.total ?? -Infinity,\n primary: attrs.limits?.min?.primary ?? -Infinity,\n secondary: attrs.limits?.min?.secondary ?? -Infinity,\n },\n max: {\n total: attrs.limits?.max?.total ?? Infinity,\n primary: attrs.limits?.max?.primary ?? Infinity,\n secondary: attrs.limits?.max?.secondary ?? Infinity,\n },\n };\n\n // Prevent illogical limits from being provided.\n catchInvalidLimits(attrs.limits);\n }\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.navigator\n .onUp(() => this.setIndex(this.getCurrentNumericIndex() - 1, true))\n .onDown(() => this.setIndex(this.getCurrentNumericIndex() + 1, true))\n .onSelect(this.select.bind(this))\n .onRemove(() => this.selected.splice(this.selected.length - 1, 1));\n\n app.tagList.load(['parent']).then((tags) => {\n this.loading = false;\n\n if (this.attrs.selectableTags) {\n tags = this.attrs.selectableTags(tags);\n }\n\n this.tags = sortTags(tags);\n\n if (this.attrs.selectedTags) {\n this.attrs.selectedTags.map(this.addTag.bind(this));\n }\n\n this.indexTag = tags[0];\n\n m.redraw();\n });\n }\n\n className() {\n return classList('TagSelectionModal', this.attrs.className);\n }\n\n title() {\n return this.attrs.title;\n }\n\n content() {\n if (this.loading || !this.tags) {\n return ;\n }\n\n const filter = this.filter().toLowerCase();\n const primaryCount = this.primaryCount();\n const secondaryCount = this.secondaryCount();\n const tags = this.getFilteredTags();\n\n const inputWidth = Math.max(extractText(this.getInstruction(primaryCount, secondaryCount)).length, this.filter().length);\n\n return [\n
    \n
    \n
    \n
    this.$('.TagsInput input').focus()}>\n \n {this.selected.map((tag) => (\n {\n this.removeTag(tag);\n this.onready();\n }}\n >\n {tagLabel(tag)}\n \n ))}\n \n (this.focused = true)}\n onblur={() => (this.focused = false)}\n />\n
    \n
    \n
    \n \n {app.translator.trans('flarum-tags.lib.tag_selection_modal.submit_button')}\n \n
    \n
    \n
    ,\n\n
    \n
      \n {tags.map((tag) => (\n (this.indexTag = tag)}\n onclick={this.toggleTag.bind(this, tag)}\n >\n {tagIcon(tag)}\n {highlight(tag.name(), filter)}\n {tag.description() ? {tag.description()} : ''}\n \n ))}\n
    \n {this.attrs.limits!.allowBypassing && (\n
    \n (this.bypassReqs = !this.bypassReqs)} isToggled={this.bypassReqs}>\n {app.translator.trans('flarum-tags.lib.tag_selection_modal.bypass_requirements')}\n \n
    \n )}\n
    ,\n ];\n }\n\n /**\n * Filters the available tags on every state change.\n */\n private getFilteredTags(): Tag[] {\n const filter = this.filter().toLowerCase();\n const primaryCount = this.primaryCount();\n const secondaryCount = this.secondaryCount();\n let tags = this.tags;\n\n if (this.attrs.requireParentTag) {\n // Filter out all child tags whose parents have not been selected. This\n // makes it impossible to select a child if its parent hasn't been selected.\n tags = tags.filter((tag) => {\n const parent = tag.parent();\n return parent !== null && (parent === false || this.selected.includes(parent));\n });\n }\n\n if (!this.bypassReqs) {\n // If we reached the total maximum number of tags, we can't select anymore.\n if (this.selected.length >= this.attrs.limits!.max!.total!) {\n tags = tags.filter((tag) => this.selected.includes(tag));\n }\n // If the number of selected primary/secondary tags is at the maximum, then\n // we'll filter out all other tags of that type.\n else {\n if (primaryCount >= this.attrs.limits!.max!.primary!) {\n tags = tags.filter((tag) => !tag.isPrimary() || this.selected.includes(tag));\n }\n if (secondaryCount >= this.attrs.limits!.max!.secondary!) {\n tags = tags.filter((tag) => tag.isPrimary() || this.selected.includes(tag));\n }\n }\n }\n\n // If the user has entered text in the filter input, then filter by tags\n // whose name matches what they've entered.\n if (filter) {\n tags = tags.filter((tag) => tag.name().toLowerCase().includes(filter));\n }\n\n if (!this.indexTag || !tags.includes(this.indexTag)) this.indexTag = tags[0];\n\n return tags;\n }\n\n /**\n * Counts the number of selected primary tags.\n */\n protected primaryCount(): number {\n return this.selected.filter((tag) => tag.isPrimary()).length;\n }\n\n /**\n * Counts the number of selected secondary tags.\n */\n protected secondaryCount(): number {\n return this.selected.filter((tag) => !tag.isPrimary()).length;\n }\n\n /**\n * Validates the number of selected primary/secondary tags against the set min max limits.\n */\n protected meetsRequirements(primaryCount: number, secondaryCount: number) {\n if (this.bypassReqs || (this.attrs.allowResetting && this.selected.length === 0)) {\n return true;\n }\n\n if (this.selected.length < this.attrs.limits!.min!.total!) {\n return false;\n }\n\n return primaryCount >= this.attrs.limits!.min!.primary! && secondaryCount >= this.attrs.limits!.min!.secondary!;\n }\n\n /**\n * Add the given tag to the list of selected tags.\n */\n protected addTag(tag: Tag | undefined) {\n if (!tag || !this.attrs.canSelect(tag)) return;\n\n if (this.attrs.onSelect) {\n this.attrs.onSelect(tag, this.selected);\n }\n\n // If this tag has a parent, we'll also need to add the parent tag to the\n // selected list if it's not already in there.\n if (this.attrs.requireParentTag) {\n const parent = tag.parent();\n if (parent && !this.selected.includes(parent)) {\n this.selected.push(parent);\n }\n }\n\n if (!this.selected.includes(tag)) {\n this.selected.push(tag);\n }\n }\n\n /**\n * Remove the given tag from the list of selected tags.\n */\n protected removeTag(tag: Tag) {\n const index = this.selected.indexOf(tag);\n\n if (index !== -1) {\n this.selected.splice(index, 1);\n\n // Look through the list of selected tags for any tags which have the tag\n // we just removed as their parent. We'll need to remove them too.\n if (this.attrs.requireParentTag) {\n this.selected.filter((t) => t.parent() === tag).forEach(this.removeTag.bind(this));\n }\n\n if (this.attrs.onDeselect) {\n this.attrs.onDeselect(tag, this.selected);\n }\n }\n }\n\n protected toggleTag(tag: Tag) {\n // Won't happen, needed for type safety.\n if (!this.tags) return;\n\n if (this.selected.includes(tag)) {\n this.removeTag(tag);\n } else {\n this.addTag(tag);\n }\n\n if (this.filter()) {\n this.filter('');\n this.indexTag = this.tags[0];\n }\n\n this.onready();\n }\n\n /**\n * Gives human text instructions based on the current number of selected tags and set limits.\n */\n protected getInstruction(primaryCount: number, secondaryCount: number) {\n if (this.bypassReqs) {\n return '';\n }\n\n if (primaryCount < this.attrs.limits!.min!.primary!) {\n const remaining = this.attrs.limits!.min!.primary! - primaryCount;\n return extractText(app.translator.trans('flarum-tags.lib.tag_selection_modal.choose_primary_placeholder', { count: remaining }));\n } else if (secondaryCount < this.attrs.limits!.min!.secondary!) {\n const remaining = this.attrs.limits!.min!.secondary! - secondaryCount;\n return extractText(app.translator.trans('flarum-tags.lib.tag_selection_modal.choose_secondary_placeholder', { count: remaining }));\n } else if (this.selected.length < this.attrs.limits!.min!.total!) {\n const remaining = this.attrs.limits!.min!.total! - this.selected.length;\n return extractText(app.translator.trans('flarum-tags.lib.tag_selection_modal.choose_tags_placeholder', { count: remaining }));\n }\n\n return '';\n }\n\n /**\n * Submit tag selection.\n */\n onsubmit(e: SubmitEvent) {\n e.preventDefault();\n\n if (this.attrs.onsubmit) this.attrs.onsubmit(this.selected);\n\n this.hide();\n }\n\n protected select(e: KeyboardEvent) {\n // Ctrl + Enter submits the selection, just Enter completes the current entry\n if (e.metaKey || e.ctrlKey || (this.indexTag && this.selected.includes(this.indexTag))) {\n if (this.selected.length) {\n // The DOM submit method doesn't emit a `submit event, so we\n // simulate a manual submission so our `onsubmit` logic is run.\n this.$('button[type=\"submit\"]').click();\n }\n } else if (this.indexTag) {\n this.getItem(this.indexTag)[0].dispatchEvent(new Event('click'));\n }\n }\n\n protected selectableItems() {\n return this.$('.TagSelectionModal-list > li');\n }\n\n protected getCurrentNumericIndex() {\n if (!this.indexTag) return -1;\n\n return this.selectableItems().index(this.getItem(this.indexTag));\n }\n\n protected getItem(selectedTag: Tag) {\n return this.selectableItems().filter(`[data-index=\"${selectedTag.id()}\"]`);\n }\n\n protected setIndex(index: number, scrollToItem: boolean) {\n const $items = this.selectableItems();\n const $dropdown = $items.parent();\n\n if (index < 0) {\n index = $items.length - 1;\n } else if (index >= $items.length) {\n index = 0;\n }\n\n const $item = $items.eq(index);\n\n this.indexTag = app.store.getById('tags', $item.attr('data-index')!);\n\n m.redraw();\n\n if (scrollToItem && this.indexTag) {\n const dropdownScroll = $dropdown.scrollTop()!;\n const dropdownTop = $dropdown.offset()!.top;\n const dropdownBottom = dropdownTop + $dropdown.outerHeight()!;\n const itemTop = $item.offset()!.top;\n const itemBottom = itemTop + $item.outerHeight()!;\n\n let scrollTop;\n if (itemTop < dropdownTop) {\n scrollTop = dropdownScroll - dropdownTop + itemTop - parseInt($dropdown.css('padding-top'), 10);\n } else if (itemBottom > dropdownBottom) {\n scrollTop = dropdownScroll - dropdownBottom + itemBottom + parseInt($dropdown.css('padding-bottom'), 10);\n }\n\n if (typeof scrollTop !== 'undefined') {\n $dropdown.stop(true).animate({ scrollTop }, 100);\n }\n }\n }\n}\n\n/**\n * Catch invalid limits provided to the tag selection modal.\n */\nfunction catchInvalidLimits(limits: ITagSelectionModalLimits) {\n if (limits.min!.primary! > limits.max!.primary!) {\n throw new Error('The minimum number of primary tags allowed cannot be more than the maximum number of primary tags allowed.');\n }\n\n if (limits.min!.secondary! > limits.max!.secondary!) {\n throw new Error('The minimum number of secondary tags allowed cannot be more than the maximum number of secondary tags allowed.');\n }\n\n if (limits.min!.total! > limits.max!.primary! + limits.max!.secondary!) {\n throw new Error('The minimum number of tags allowed cannot be more than the maximum number of primary and secondary tags allowed together.');\n }\n\n if (limits.max!.total! < limits.min!.primary! + limits.min!.secondary!) {\n throw new Error('The maximum number of tags allowed cannot be less than the minimum number of primary and secondary tags allowed together.');\n }\n\n if (limits.min!.total! > limits.max!.total!) {\n throw new Error('The minimum number of tags allowed cannot be more than the maximum number of tags allowed.');\n }\n}\n","import app from 'flarum/forum/app';\nimport DiscussionPage from 'flarum/forum/components/DiscussionPage';\nimport classList from 'flarum/common/utils/classList';\nimport extractText from 'flarum/common/utils/extractText';\n\nimport getSelectableTags from '../utils/getSelectableTags';\nimport TagSelectionModal, { ITagSelectionModalAttrs } from '../../common/components/TagSelectionModal';\n\nimport type Discussion from 'flarum/common/models/Discussion';\nimport type Tag from '../../common/models/Tag';\n\nexport interface TagDiscussionModalAttrs extends ITagSelectionModalAttrs {\n discussion?: Discussion;\n}\n\nexport default class TagDiscussionModal extends TagSelectionModal {\n static initAttrs(attrs: TagDiscussionModalAttrs) {\n super.initAttrs(attrs);\n\n const title = attrs.discussion\n ? app.translator.trans('flarum-tags.forum.choose_tags.edit_title', { title: {attrs.discussion.title()} })\n : app.translator.trans('flarum-tags.forum.choose_tags.title');\n\n attrs.className = classList(attrs.className, 'TagDiscussionModal');\n attrs.title = extractText(title);\n attrs.allowResetting = !!app.forum.attribute('canBypassTagCounts');\n attrs.limits = {\n allowBypassing: attrs.allowResetting,\n max: {\n primary: app.forum.attribute('maxPrimaryTags'),\n secondary: app.forum.attribute('maxSecondaryTags'),\n },\n min: {\n primary: app.forum.attribute('minPrimaryTags'),\n secondary: app.forum.attribute('minSecondaryTags'),\n },\n };\n attrs.requireParentTag = true;\n attrs.selectableTags = () => getSelectableTags(attrs.discussion);\n attrs.selectedTags ??= (attrs.discussion?.tags() as Tag[]) || [];\n attrs.canSelect = (tag) => tag.canStartDiscussion();\n\n const suppliedOnsubmit = attrs.onsubmit || null;\n\n // Save changes.\n attrs.onsubmit = function (tags) {\n const discussion = attrs.discussion;\n\n if (discussion) {\n discussion.save({ relationships: { tags } }).then(() => {\n if (app.current.matches(DiscussionPage)) {\n app.current.get('stream').update();\n }\n\n m.redraw();\n });\n }\n\n if (suppliedOnsubmit) suppliedOnsubmit(tags);\n };\n }\n}\n","import { extend } from 'flarum/common/extend';\nimport DiscussionControls from 'flarum/forum/utils/DiscussionControls';\nimport Button from 'flarum/common/components/Button';\n\nimport TagDiscussionModal from './components/TagDiscussionModal';\n\nexport default function () {\n // Add a control allowing the discussion to be moved to another category.\n extend(DiscussionControls, 'moderationControls', function (items, discussion) {\n if (discussion.canTag()) {\n items.add(\n 'tags',\n \n );\n }\n });\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionComposer'];","import { extend, override } from 'flarum/common/extend';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport DiscussionComposer from 'flarum/forum/components/DiscussionComposer';\nimport classList from 'flarum/common/utils/classList';\n\nimport TagDiscussionModal from './components/TagDiscussionModal';\nimport tagsLabel from '../common/helpers/tagsLabel';\nimport getSelectableTags from './utils/getSelectableTags';\n\nexport default function () {\n extend(IndexPage.prototype, 'newDiscussionAction', function (promise) {\n // From `addTagFilter\n const tag = this.currentTag();\n\n if (tag) {\n const parent = tag.parent();\n const tags = parent ? [parent, tag] : [tag];\n promise.then((composer) => (composer.fields.tags = tags));\n } else {\n app.composer.fields.tags = [];\n }\n });\n\n extend(DiscussionComposer.prototype, 'oninit', function () {\n app.tagList.load(['parent']).then(() => m.redraw());\n });\n\n // Add tag-selection abilities to the discussion composer.\n DiscussionComposer.prototype.chooseTags = function () {\n const selectableTags = getSelectableTags();\n\n if (!selectableTags.length) return;\n\n app.modal.show(TagDiscussionModal, {\n selectedTags: (this.composer.fields.tags || []).slice(0),\n onsubmit: (tags) => {\n this.composer.fields.tags = tags;\n this.$('textarea').focus();\n },\n });\n };\n\n // Add a tag-selection menu to the discussion composer's header, after the\n // title.\n extend(DiscussionComposer.prototype, 'headerItems', function (items) {\n const tags = this.composer.fields.tags || [];\n const selectableTags = getSelectableTags();\n\n items.add(\n 'tags',\n \n {tags.length ? (\n tagsLabel(tags)\n ) : (\n {app.translator.trans('flarum-tags.forum.composer_discussion.choose_tags_link')}\n )}\n ,\n 10\n );\n });\n\n override(DiscussionComposer.prototype, 'onsubmit', function (original) {\n const chosenTags = this.composer.fields.tags || [];\n const chosenPrimaryTags = chosenTags.filter((tag) => tag.position() !== null && !tag.isChild());\n const chosenSecondaryTags = chosenTags.filter((tag) => tag.position() === null);\n const selectableTags = getSelectableTags();\n\n const minPrimaryTags = parseInt(app.forum.attribute('minPrimaryTags'));\n const minSecondaryTags = parseInt(app.forum.attribute('minSecondaryTags'));\n const maxPrimaryTags = parseInt(app.forum.attribute('maxPrimaryTags'));\n const maxSecondaryTags = parseInt(app.forum.attribute('maxSecondaryTags'));\n\n if (\n ((!chosenTags.length && maxPrimaryTags !== 0 && maxSecondaryTags !== 0) ||\n chosenPrimaryTags.length < minPrimaryTags ||\n chosenSecondaryTags.length < minSecondaryTags) &&\n selectableTags.length\n ) {\n app.modal.show(TagDiscussionModal, {\n selectedTags: chosenTags,\n onsubmit: (tags) => {\n this.composer.fields.tags = tags;\n original();\n },\n });\n } else {\n original();\n }\n });\n\n // Add the selected tags as data to submit to the server.\n extend(DiscussionComposer.prototype, 'data', function (data) {\n data.relationships = data.relationships || {};\n data.relationships.tags = this.composer.fields.tags;\n });\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extenders'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Discussion'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/EventPost'];","import EventPost from 'flarum/forum/components/EventPost';\nimport tagsLabel from '../../common/helpers/tagsLabel';\n\nexport default class DiscussionTaggedPost extends EventPost {\n static initAttrs(attrs) {\n super.initAttrs(attrs);\n\n const oldTags = attrs.post.content()[0];\n const newTags = attrs.post.content()[1];\n\n function diffTags(tags1, tags2) {\n return tags1.filter((tag) => tags2.indexOf(tag) === -1).map((id) => app.store.getById('tags', id));\n }\n\n attrs.tagsAdded = diffTags(newTags, oldTags);\n attrs.tagsRemoved = diffTags(oldTags, newTags);\n }\n\n icon() {\n return 'fas fa-tag';\n }\n\n descriptionKey() {\n if (this.attrs.tagsAdded.length) {\n if (this.attrs.tagsRemoved.length) {\n return 'flarum-tags.forum.post_stream.added_and_removed_tags_text';\n }\n\n return 'flarum-tags.forum.post_stream.added_tags_text';\n }\n\n return 'flarum-tags.forum.post_stream.removed_tags_text';\n }\n\n descriptionData() {\n const data = {};\n\n if (this.attrs.tagsAdded.length) {\n data.tagsAdded = app.translator.trans('flarum-tags.forum.post_stream.tags_text', {\n tags: tagsLabel(this.attrs.tagsAdded, { link: true }),\n count: this.attrs.tagsAdded.length,\n });\n }\n\n if (this.attrs.tagsRemoved.length) {\n data.tagsRemoved = app.translator.trans('flarum-tags.forum.post_stream.tags_text', {\n tags: tagsLabel(this.attrs.tagsRemoved, { link: true }),\n count: this.attrs.tagsRemoved.length,\n });\n }\n\n return data;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/computed'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","import computed from 'flarum/common/utils/computed';\nimport Model from 'flarum/common/Model';\nimport type Discussion from 'flarum/common/models/Discussion';\n\nexport default class Tag extends Model {\n name() {\n return Model.attribute('name').call(this);\n }\n slug() {\n return Model.attribute('slug').call(this);\n }\n description() {\n return Model.attribute('description').call(this);\n }\n\n color() {\n return Model.attribute('color').call(this);\n }\n backgroundUrl() {\n return Model.attribute('backgroundUrl').call(this);\n }\n backgroundMode() {\n return Model.attribute('backgroundMode').call(this);\n }\n icon() {\n return Model.attribute('icon').call(this);\n }\n\n position() {\n return Model.attribute('position').call(this);\n }\n parent() {\n return Model.hasOne('parent').call(this);\n }\n children() {\n return Model.hasMany('children').call(this);\n }\n defaultSort() {\n return Model.attribute('defaultSort').call(this);\n }\n isChild() {\n return Model.attribute('isChild').call(this);\n }\n isHidden() {\n return Model.attribute('isHidden').call(this);\n }\n\n discussionCount() {\n return Model.attribute('discussionCount').call(this);\n }\n lastPostedAt() {\n return Model.attribute('lastPostedAt', Model.transformDate).call(this);\n }\n lastPostedDiscussion() {\n return Model.hasOne('lastPostedDiscussion').call(this);\n }\n\n isRestricted() {\n return Model.attribute('isRestricted').call(this);\n }\n canStartDiscussion() {\n return Model.attribute('canStartDiscussion').call(this);\n }\n canAddToDiscussion() {\n return Model.attribute('canAddToDiscussion').call(this);\n }\n\n isPrimary() {\n return computed('position', 'parent', (position, parent) => position !== null && parent === false).call(this);\n }\n}\n","import Extend from 'flarum/common/extenders';\nimport Tag from './models/Tag';\n\nexport default [\n new Extend.Store() //\n .add('tags', Tag),\n];\n","import app from 'flarum/forum/app';\nimport Extend from 'flarum/common/extenders';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport Discussion from 'flarum/common/models/Discussion';\nimport DiscussionTaggedPost from './components/DiscussionTaggedPost';\nimport TagsPage from './components/TagsPage';\nimport Tag from '../common/models/Tag';\n\nimport commonExtend from '../common/extend';\n\nexport default [\n ...commonExtend,\n\n new Extend.Routes() //\n .add('tags', '/tags', TagsPage) //\n .add('tag', '/t/:tags', IndexPage) //\n .helper('tag', (tag) => app.route('tag', { tags: tag.slug() })),\n\n new Extend.PostTypes() //\n .add('discussionTagged', DiscussionTaggedPost),\n\n new Extend.Model(Discussion) //\n .hasMany('tags') //\n .attribute('canTag'),\n];\n","import sortTags from './utils/sortTags';\nimport Tag from './models/Tag';\nimport tagsLabel from './helpers/tagsLabel';\nimport tagIcon from './helpers/tagIcon';\nimport tagLabel from './helpers/tagLabel';\nimport TagSelectionModal from './components/TagSelectionModal';\nimport TagListState from './states/TagListState';\n\nexport default {\n 'tags/utils/sortTags': sortTags,\n 'tags/models/Tag': Tag,\n 'tags/helpers/tagsLabel': tagsLabel,\n 'tags/helpers/tagIcon': tagIcon,\n 'tags/helpers/tagLabel': tagLabel,\n 'tags/components/TagSelectionModal': TagSelectionModal,\n 'tags/states/TagListState': TagListState,\n};\n","import compat from '../common/compat';\n\nimport addTagFilter from './addTagFilter';\nimport addTagControl from './addTagControl';\nimport TagHero from './components/TagHero';\nimport TagDiscussionModal from './components/TagDiscussionModal';\nimport TagsPage from './components/TagsPage';\nimport DiscussionTaggedPost from './components/DiscussionTaggedPost';\nimport TagLinkButton from './components/TagLinkButton';\nimport addTagList from './addTagList';\nimport addTagLabels from './addTagLabels';\nimport addTagComposer from './addTagComposer';\nimport getSelectableTags from './utils/getSelectableTags';\n\nexport default Object.assign(compat, {\n 'tags/addTagFilter': addTagFilter,\n 'tags/addTagControl': addTagControl,\n 'tags/components/TagHero': TagHero,\n 'tags/components/TagDiscussionModal': TagDiscussionModal,\n 'tags/components/TagsPage': TagsPage,\n 'tags/components/DiscussionTaggedPost': DiscussionTaggedPost,\n 'tags/components/TagLinkButton': TagLinkButton,\n 'tags/addTagList': addTagList,\n 'tags/addTagLabels': addTagLabels,\n 'tags/addTagComposer': addTagComposer,\n 'tags/utils/getSelectableTags': getSelectableTags,\n});\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core;","import app from 'flarum/forum/app';\n\nimport TagListState from '../common/states/TagListState';\n\nimport addTagList from './addTagList';\nimport addTagFilter from './addTagFilter';\nimport addTagLabels from './addTagLabels';\nimport addTagControl from './addTagControl';\nimport addTagComposer from './addTagComposer';\n\nexport { default as extend } from './extend';\n\napp.initializers.add('flarum-tags', function () {\n app.tagList = new TagListState();\n\n addTagList();\n addTagFilter();\n addTagLabels();\n addTagControl();\n addTagComposer();\n});\n\n// Expose compat API\nimport tagsCompat from './compat';\nimport { compat } from '@flarum/core/forum';\n\nObject.assign(compat, tagsCompat);\n","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 exports;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n var exports = {},\n Op = Object.prototype,\n hasOwn = Op.hasOwnProperty,\n defineProperty = Object.defineProperty || function (obj, key, desc) {\n obj[key] = desc.value;\n },\n $Symbol = \"function\" == typeof Symbol ? Symbol : {},\n iteratorSymbol = $Symbol.iterator || \"@@iterator\",\n asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\",\n toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n function define(obj, key, value) {\n return Object.defineProperty(obj, key, {\n value: value,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }), obj[key];\n }\n try {\n define({}, \"\");\n } catch (err) {\n define = function define(obj, key, value) {\n return obj[key] = value;\n };\n }\n function wrap(innerFn, outerFn, self, tryLocsList) {\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,\n generator = Object.create(protoGenerator.prototype),\n context = new Context(tryLocsList || []);\n return defineProperty(generator, \"_invoke\", {\n value: makeInvokeMethod(innerFn, self, context)\n }), generator;\n }\n function tryCatch(fn, obj, arg) {\n try {\n return {\n type: \"normal\",\n arg: fn.call(obj, arg)\n };\n } catch (err) {\n return {\n type: \"throw\",\n arg: err\n };\n }\n }\n exports.wrap = wrap;\n var ContinueSentinel = {};\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n var getProto = Object.getPrototypeOf,\n NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);\n var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n define(prototype, method, function (arg) {\n return this._invoke(method, arg);\n });\n });\n }\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (\"throw\" !== record.type) {\n var result = record.arg,\n value = result.value;\n return value && \"object\" == _typeof(value) && hasOwn.call(value, \"__await\") ? PromiseImpl.resolve(value.__await).then(function (value) {\n invoke(\"next\", value, resolve, reject);\n }, function (err) {\n invoke(\"throw\", err, resolve, reject);\n }) : PromiseImpl.resolve(value).then(function (unwrapped) {\n result.value = unwrapped, resolve(result);\n }, function (error) {\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n reject(record.arg);\n }\n var previousPromise;\n defineProperty(this, \"_invoke\", {\n value: function value(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function (resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();\n }\n });\n }\n function makeInvokeMethod(innerFn, self, context) {\n var state = \"suspendedStart\";\n return function (method, arg) {\n if (\"executing\" === state) throw new Error(\"Generator is already running\");\n if (\"completed\" === state) {\n if (\"throw\" === method) throw arg;\n return doneResult();\n }\n for (context.method = method, context.arg = arg;;) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n if (\"next\" === context.method) context.sent = context._sent = context.arg;else if (\"throw\" === context.method) {\n if (\"suspendedStart\" === state) throw state = \"completed\", context.arg;\n context.dispatchException(context.arg);\n } else \"return\" === context.method && context.abrupt(\"return\", context.arg);\n state = \"executing\";\n var record = tryCatch(innerFn, self, context);\n if (\"normal\" === record.type) {\n if (state = context.done ? \"completed\" : \"suspendedYield\", record.arg === ContinueSentinel) continue;\n return {\n value: record.arg,\n done: context.done\n };\n }\n \"throw\" === record.type && (state = \"completed\", context.method = \"throw\", context.arg = record.arg);\n }\n };\n }\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (undefined === method) {\n if (context.delegate = null, \"throw\" === context.method) {\n if (delegate.iterator[\"return\"] && (context.method = \"return\", context.arg = undefined, maybeInvokeDelegate(delegate, context), \"throw\" === context.method)) return ContinueSentinel;\n context.method = \"throw\", context.arg = new TypeError(\"The iterator does not provide a 'throw' method\");\n }\n return ContinueSentinel;\n }\n var record = tryCatch(method, delegate.iterator, context.arg);\n if (\"throw\" === record.type) return context.method = \"throw\", context.arg = record.arg, context.delegate = null, ContinueSentinel;\n var info = record.arg;\n return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, \"return\" !== context.method && (context.method = \"next\", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = \"throw\", context.arg = new TypeError(\"iterator result is not an object\"), context.delegate = null, ContinueSentinel);\n }\n function pushTryEntry(locs) {\n var entry = {\n tryLoc: locs[0]\n };\n 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);\n }\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\", delete record.arg, entry.completion = record;\n }\n function Context(tryLocsList) {\n this.tryEntries = [{\n tryLoc: \"root\"\n }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);\n }\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) return iteratorMethod.call(iterable);\n if (\"function\" == typeof iterable.next) return iterable;\n if (!isNaN(iterable.length)) {\n var i = -1,\n next = function next() {\n for (; ++i < iterable.length;) {\n if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;\n }\n return next.value = undefined, next.done = !0, next;\n };\n return next.next = next;\n }\n }\n return {\n next: doneResult\n };\n }\n function doneResult() {\n return {\n value: undefined,\n done: !0\n };\n }\n return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, \"constructor\", {\n value: GeneratorFunctionPrototype,\n configurable: !0\n }), defineProperty(GeneratorFunctionPrototype, \"constructor\", {\n value: GeneratorFunction,\n configurable: !0\n }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, \"GeneratorFunction\"), exports.isGeneratorFunction = function (genFun) {\n var ctor = \"function\" == typeof genFun && genFun.constructor;\n return !!ctor && (ctor === GeneratorFunction || \"GeneratorFunction\" === (ctor.displayName || ctor.name));\n }, exports.mark = function (genFun) {\n return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, \"GeneratorFunction\")), genFun.prototype = Object.create(Gp), genFun;\n }, exports.awrap = function (arg) {\n return {\n __await: arg\n };\n }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n void 0 === PromiseImpl && (PromiseImpl = Promise);\n var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);\n return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {\n return result.done ? result.value : iter.next();\n });\n }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, \"Generator\"), define(Gp, iteratorSymbol, function () {\n return this;\n }), define(Gp, \"toString\", function () {\n return \"[object Generator]\";\n }), exports.keys = function (val) {\n var object = Object(val),\n keys = [];\n for (var key in object) {\n keys.push(key);\n }\n return keys.reverse(), function next() {\n for (; keys.length;) {\n var key = keys.pop();\n if (key in object) return next.value = key, next.done = !1, next;\n }\n return next.done = !0, next;\n };\n }, exports.values = values, Context.prototype = {\n constructor: Context,\n reset: function reset(skipTempReset) {\n if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) {\n \"t\" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);\n }\n },\n stop: function stop() {\n this.done = !0;\n var rootRecord = this.tryEntries[0].completion;\n if (\"throw\" === rootRecord.type) throw rootRecord.arg;\n return this.rval;\n },\n dispatchException: function dispatchException(exception) {\n if (this.done) throw exception;\n var context = this;\n function handle(loc, caught) {\n return record.type = \"throw\", record.arg = exception, context.next = loc, caught && (context.method = \"next\", context.arg = undefined), !!caught;\n }\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i],\n record = entry.completion;\n if (\"root\" === entry.tryLoc) return handle(\"end\");\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\"),\n hasFinally = hasOwn.call(entry, \"finallyLoc\");\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);\n if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);\n } else {\n if (!hasFinally) throw new Error(\"try statement without catch or finally\");\n if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);\n }\n }\n }\n },\n abrupt: function abrupt(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev && hasOwn.call(entry, \"finallyLoc\") && this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n finallyEntry && (\"break\" === type || \"continue\" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);\n var record = finallyEntry ? finallyEntry.completion : {};\n return record.type = type, record.arg = arg, finallyEntry ? (this.method = \"next\", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);\n },\n complete: function complete(record, afterLoc) {\n if (\"throw\" === record.type) throw record.arg;\n return \"break\" === record.type || \"continue\" === record.type ? this.next = record.arg : \"return\" === record.type ? (this.rval = this.arg = record.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;\n },\n finish: function finish(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;\n }\n },\n \"catch\": function _catch(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (\"throw\" === record.type) {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n throw new Error(\"illegal catch attempt\");\n },\n delegateYield: function delegateYield(iterable, resultName, nextLoc) {\n return this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n }, \"next\" === this.method && (this.arg = undefined), ContinueSentinel;\n }\n }, exports;\n}\nmodule.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(obj);\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))","// 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};"],"names":["flarum","core","compat","asyncGeneratorStep","gen","resolve","reject","_next","_throw","key","arg","info","value","error","done","Promise","then","_asyncToGenerator","fn","self","this","args","arguments","apply","err","undefined","TagListState","loadedIncludes","load","includes","query","unloadedIncludes","filter","include","has","length","app","Set","join","val","forEach","add","_setPrototypeOf","o","p","Object","setPrototypeOf","bind","__proto__","_inheritsLoose","subClass","superClass","prototype","create","constructor","tagIcon","tag","attrs","settings","hasIcon","icon","useColor","className","classList","style","color","TagLinkButton","view","vnode","model","description","child","isChild","href","route","title","name","translator","trans","initAttrs","params","tags","slug","LinkButton","tagLabel","link","extract","tagText","textContrastClass","m","Link","sortTags","slice","sort","a","b","aPos","position","bPos","discussionCount","aParent","parent","bParent","TagsPage","oninit","history","push","preloaded","preloadedApiDocument","loading","tagList","store","all","redraw","oncreate","setTitle","setTitleCount","pageContent","toArray","items","ItemList","hero","mainContent","sidebar","content","contentItems","pinned","cloud","tagTileListView","cloudView","IndexPage","listItems","sidebarItems","map","tagTileView","lastPostedDiscussion","children","colored","discussion","lastPostNumber","humanTime","lastPostedAt","Page","extend","currentTag","addTag","active","id","more","splice","TagHero","Component","findTag","find","localeCompare","sensitivity","currentActiveTag","currentTagLoading","override","original","vdom","canStartDiscussion","newDiscussion","get","disabled","GlobalSearchState","param","DiscussionListState","q","_objectWithoutPropertiesLoose","source","excluded","i","target","sourceKeys","keys","indexOf","r","e","t","f","n","Array","isArray","tagsLabel","otherAttrs","DiscussionListItem","DiscussionHero","getSelectableTags","canAddToDiscussion","ToggleButton","isToggled","TagSelectionModal","selected","bypassReqs","Stream","focused","navigator","KeyboardNavigatable","indexTag","extractText","canSelect","allowResetting","limits","min","total","primary","secondary","max","Infinity","Error","catchInvalidLimits","onUp","setIndex","getCurrentNumericIndex","onDown","onSelect","select","onRemove","selectableTags","selectedTags","toLowerCase","primaryCount","secondaryCount","getFilteredTags","inputWidth","Math","getInstruction","onclick","$","focus","removeTag","onready","placeholder","bidi","width","onkeydown","navigate","onfocus","onblur","type","meetsRequirements","onmouseover","toggleTag","highlight","allowBypassing","requireParentTag","isPrimary","index","onDeselect","remaining","count","onsubmit","preventDefault","hide","metaKey","ctrlKey","click","getItem","dispatchEvent","Event","selectableItems","selectedTag","scrollToItem","$items","$dropdown","$item","eq","attr","scrollTop","dropdownScroll","dropdownTop","offset","top","dropdownBottom","outerHeight","itemTop","itemBottom","parseInt","css","stop","animate","Modal","TagDiscussionModal","suppliedOnsubmit","save","relationships","DiscussionPage","update","DiscussionControls","canTag","modal","show","promise","composer","fields","DiscussionComposer","chooseTags","chosenTags","chosenPrimaryTags","chosenSecondaryTags","minPrimaryTags","forum","attribute","minSecondaryTags","maxPrimaryTags","maxSecondaryTags","data","DiscussionTaggedPost","oldTags","post","newTags","diffTags","tags1","tags2","getById","tagsAdded","tagsRemoved","descriptionKey","descriptionData","EventPost","Tag","Model","call","backgroundUrl","backgroundMode","defaultSort","isHidden","isRestricted","computed","Extend","commonExtend","helper","Discussion","hasMany","assign","addTagFilter","addTagControl","addTagList","addTagLabels","addTagComposer","tagsCompat","_typeof","require","_regeneratorRuntime","module","exports","__esModule","Op","hasOwn","hasOwnProperty","defineProperty","obj","desc","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","enumerable","configurable","writable","wrap","innerFn","outerFn","tryLocsList","protoGenerator","Generator","generator","context","Context","makeInvokeMethod","tryCatch","ContinueSentinel","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","method","_invoke","AsyncIterator","PromiseImpl","invoke","record","result","__await","unwrapped","previousPromise","callInvokeWithMethodAndArg","state","delegate","delegateResult","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","TypeError","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","doneResult","displayName","isGeneratorFunction","genFun","ctor","mark","awrap","async","iter","object","reverse","pop","skipTempReset","prev","charAt","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","runtime","regeneratorRuntime","accidentalStrictMode","globalThis","Function","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","d","definition","prop"],"sourceRoot":""} \ No newline at end of file