From 73c519e3ee6b6521f9fefee2abdbcf56e222d5dc Mon Sep 17 00:00:00 2001 From: flarum-bot Date: Sat, 22 Sep 2018 21:51:01 +0000 Subject: [PATCH] Bundled output for commit 7de5770d5bd45d40978263c79f30cb45b5dab2e2 [skip ci] --- extensions/tags/js/dist/forum.js | 2 +- extensions/tags/js/dist/forum.js.map | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/tags/js/dist/forum.js b/extensions/tags/js/dist/forum.js index 125aaf4a7..009f08f5e 100644 --- a/extensions/tags/js/dist/forum.js +++ b/extensions/tags/js/dist/forum.js @@ -1,2 +1,2 @@ -module.exports=function(t){var e={};function n(s){if(e[s])return e[s].exports;var a=e[s]={i:s,l:!1,exports:{}};return t[s].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=t,n.c=e,n.d=function(t,e,s){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:s})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var s=Object.create(null);if(n.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)n.d(s,a,function(e){return t[e]}.bind(null,a));return s},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=44)}([function(t,e){t.exports=flarum.core.compat.Model},function(t,e){t.exports=flarum.core.compat.extend},function(t,e,n){"use strict";function s(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}n.d(e,"a",function(){return s})},function(t,e,n){"use strict";function s(t){return t.slice(0).sort(function(t,e){var n=t.position(),s=e.position();if(null===n&&null===s)return e.discussionCount()-t.discussionCount();if(null===s)return-1;if(null===n)return 1;var a=t.parent(),o=e.parent();return a===o?n-s:a&&o?a.position()-o.position():a?a===e?1:a.position()-s:o?o===t?-1:n-o.position():0})}n.d(e,"a",function(){return s})},function(t,e){t.exports=flarum.core.compat["components/IndexPage"]},function(t,e,n){"use strict";n.d(e,"a",function(){return o});var s=n(9),a=n.n(s);function o(t,e){void 0===e&&(e={}),e.style=e.style||{},e.className="TagLabel "+(e.className||"");var n=a()(e,"link");if(t){var s=t.color();s&&(e.style.backgroundColor=e.style.color=s,e.className+=" colored"),n&&(e.title=t.description()||"",e.href=app.route("tag",{tags:t.slug()}),e.config=m.route)}else e.className+=" untagged";return m(n?"a":"span",e,m("span",{className:"TagLabel-text"},t?t.name():app.translator.trans("flarum-tags.lib.deleted_tag_text")))}},function(t,e){t.exports=flarum.core.compat["components/Button"]},function(t,e,n){"use strict";function s(t,e){return void 0===e&&(e={}),e.className="icon TagIcon "+(e.className||""),t?(e.style=e.style||{},e.style.backgroundColor=t.color()):e.className+=" untagged",m("span",e)}n.d(e,"a",function(){return s})},function(t,e,n){"use strict";n.d(e,"a",function(){return p});var s=n(2),a=n(0),o=n.n(a),r=n(13),i=n.n(r),c=n(14),u=n.n(c),p=function(t){function e(){return t.apply(this,arguments)||this}return Object(s.a)(e,t),e}(i()(o.a,{name:o.a.attribute("name"),slug:o.a.attribute("slug"),description:o.a.attribute("description"),color:o.a.attribute("color"),backgroundUrl:o.a.attribute("backgroundUrl"),backgroundMode:o.a.attribute("backgroundMode"),position:o.a.attribute("position"),parent:o.a.hasOne("parent"),defaultSort:o.a.attribute("defaultSort"),isChild:o.a.attribute("isChild"),isHidden:o.a.attribute("isHidden"),discussionCount:o.a.attribute("discussionCount"),lastPostedAt:o.a.attribute("lastPostedAt",o.a.transformDate),lastPostedDiscussion:o.a.hasOne("lastPostedDiscussion"),isRestricted:o.a.attribute("isRestricted"),canStartDiscussion:o.a.attribute("canStartDiscussion"),canAddToDiscussion:o.a.attribute("canAddToDiscussion"),isPrimary:u()("position","parent",function(t,e){return null!==t&&!1===e})}))},function(t,e){t.exports=flarum.core.compat["utils/extract"]},,function(t,e){t.exports=flarum.core.compat["components/DiscussionComposer"]},function(t,e){},function(t,e){t.exports=flarum.core.compat["utils/mixin"]},function(t,e){t.exports=flarum.core.compat["utils/computed"]},function(t,e){t.exports=flarum.core.compat["components/Page"]},function(t,e){t.exports=flarum.core.compat["components/Modal"]},function(t,e){t.exports=flarum.core.compat["components/LinkButton"]},function(t,e){t.exports=flarum.core.compat["components/DiscussionPage"]},function(t,e){t.exports=flarum.core.compat["models/Discussion"]},function(t,e){t.exports=flarum.core.compat["components/DiscussionHero"]},function(t,e,n){"use strict";var s=n(0),a=n.n(s),o=n(19),r=n.n(o),i=n(4),c=n.n(i),u=n(8),p=n(2),l=n(15),d=n.n(l),f=n(23),g=n.n(f),h=n(24),b=n.n(h),v=n(5),y=n(3),x=function(t){function e(){return t.apply(this,arguments)||this}Object(p.a)(e,t);var n=e.prototype;return n.init=function(){t.prototype.init.call(this),this.tags=Object(y.a)(app.store.all("tags").filter(function(t){return!t.parent()})),app.history.push("tags",app.translator.trans("flarum-tags.forum.header.back_to_tags_tooltip"))},n.view=function(){var t=this.tags.filter(function(t){return null!==t.position()}),e=this.tags.filter(function(t){return null===t.position()});return m("div",{className:"TagsPage"},c.a.prototype.hero(),m("div",{className:"container"},m("nav",{className:"TagsPage-nav IndexPage-nav sideNav",config:c.a.prototype.affixSidebar},m("ul",null,g()(c.a.prototype.sidebarItems().toArray()))),m("div",{className:"TagsPage-content sideNavOffset"},m("ul",{className:"TagTiles"},t.map(function(t){var e=t.lastPostedDiscussion(),n=Object(y.a)(app.store.all("tags").filter(function(e){return e.parent()===t}));return m("li",{className:"TagTile "+(t.color()?"colored":""),style:{backgroundColor:t.color()}},m("a",{className:"TagTile-info",href:app.route.tag(t),config:m.route},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("a",{href:app.route.tag(t),config:function(t,e){e||($(t).on("click",function(t){return t.stopPropagation()}),m.route.apply(this,arguments))}},t.name())," "]})):""),e?m("a",{className:"TagTile-lastPostedDiscussion",href:app.route.discussion(e,e.lastPostNumber()),config:m.route},m("span",{className:"TagTile-lastPostedDiscussion-title"},e.title()),b()(e.lastPostedAt())):m("span",{className:"TagTile-lastPostedDiscussion"}))})),e.length?m("div",{className:"TagCloud"},e.map(function(t){return[Object(v.a)(t,{link:!0})," "]})):"")))},e}(d.a),T=n(25),N=n.n(T),O=n(9),_=n.n(O);function P(t,e){void 0===e&&(e={});var n=[],s=_()(e,"link");return e.className="TagsLabel "+(e.className||""),t?Object(y.a)(t).forEach(function(e){(e||1===t.length)&&n.push(Object(v.a)(e,{link:s}))}):n.push(Object(v.a)()),m("span",e,n)}var j=function(t){function e(){return t.apply(this,arguments)||this}Object(p.a)(e,t),e.initProps=function(e){t.initProps.call(this,e);var n=e.post.content()[0],s=e.post.content()[1];function a(t,e){return t.filter(function(t){return-1===e.indexOf(t)}).map(function(t){return app.store.getById("tags",t)})}e.tagsAdded=a(s,n),e.tagsRemoved=a(n,s)};var n=e.prototype;return n.icon=function(){return"fas fa-tag"},n.descriptionKey=function(){return this.props.tagsAdded.length?this.props.tagsRemoved.length?"flarum-tags.forum.post_stream.added_and_removed_tags_text":"flarum-tags.forum.post_stream.added_tags_text":"flarum-tags.forum.post_stream.removed_tags_text"},n.descriptionData=function(){var t={};return this.props.tagsAdded.length&&(t.tagsAdded=app.translator.transChoice("flarum-tags.forum.post_stream.tags_text",this.props.tagsAdded.length,{tags:P(this.props.tagsAdded,{link:!0}),count:this.props.tagsAdded.length})),this.props.tagsRemoved.length&&(t.tagsRemoved=app.translator.transChoice("flarum-tags.forum.post_stream.tags_text",this.props.tagsRemoved.length,{tags:P(this.props.tagsRemoved,{link:!0}),count:this.props.tagsRemoved.length})),t},e}(N.a),C=n(1),I=n(26),D=n.n(I),k=n(17),S=n.n(k),w=n(7),L=function(t){function e(){return t.apply(this,arguments)||this}return Object(p.a)(e,t),e.prototype.view=function(){var t=this.props.tag,e=this.constructor.isActive(this.props),n=t&&t.description();return m("a",{className:"TagLinkButton hasIcon "+(t.isChild()?"child":""),href:this.props.href,config:m.route,style:e&&t?{color:t.color()}:"",title:n||""},Object(w.a)(t,{className:"Button-icon"}),this.props.children)},e.initProps=function(t){var e=t.tag;t.params.tags=e?e.slug():"untagged",t.href=app.route("tag",t.params),t.children=e?e.name():app.translator.trans("flarum-tags.forum.index.untagged_link")},e}(S.a),M=function(){Object(C.extend)(c.a.prototype,"navItems",function(t){if(t.add("tags",S.a.component({icon:"fas fa-th-large",children:app.translator.trans("flarum-tags.forum.index.tags_link"),href:app.route("tags")}),-10),!(app.current instanceof x)){t.add("separator",D.a.component(),-10);var e=this.stickyParams(),n=app.store.all("tags"),s=this.currentTag(),a=function(n){var a=s===n;!a&&s&&(a=s.parent()===n),t.add("tag"+n.id(),L.component({tag:n,params:e,active:a}),-10)};Object(y.a)(n).filter(function(t){return null!==t.position()&&(!t.isChild()||s&&(t.parent()===s||t.parent()===s.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",S.a.component({children:app.translator.trans("flarum-tags.forum.index.more_link"),href:app.route("tags")}),-10)}})},A=n(27),H=n.n(A),B=n(28),R=function(t){function e(){return t.apply(this,arguments)||this}return Object(p.a)(e,t),e.prototype.view=function(){var t=this.props.tag,e=t.color();return m("header",{className:"Hero TagHero"+(e?" TagHero--colored":""),style:e?{color:"#fff",backgroundColor:e}:""},m("div",{className:"container"},m("div",{className:"containerNarrow"},m("h2",{className:"Hero-title"},t.name()),m("div",{className:"Hero-subtitle"},t.description()))))},e}(n.n(B).a),E=function(){c.a.prototype.currentTag=function(){var t=this.params().tags;if(t)return app.store.getBy("tags","slug",t)},Object(C.override)(c.a.prototype,"hero",function(t){var e=this.currentTag();return e?R.component({tag:e}):t()}),Object(C.extend)(c.a.prototype,"view",function(t){var e=this.currentTag();e&&(t.attrs.className+=" IndexPage--tag"+e.id())}),Object(C.extend)(c.a.prototype,"sidebarItems",function(t){var e=this.currentTag();if(e){var n=e.color();n&&(t.get("newDiscussion").props.style={backgroundColor:n})}}),Object(C.extend)(c.a.prototype,"params",function(t){t.tags=m.route.param("tags")}),Object(C.extend)(H.a.prototype,"requestParams",function(t){t.include.push("tags"),this.props.params.tags&&(t.filter.q=(t.filter.q||"")+" tag:"+this.props.params.tags)})},q=n(29),K=n.n(q),F=n(18),U=n.n(F),z=n(20),G=n.n(z),J=function(){Object(C.extend)(K.a.prototype,"infoItems",function(t){var e=this.props.discussion.tags();e&&e.length&&t.add("tags",P(e),10)}),Object(C.extend)(U.a.prototype,"params",function(t){t.include.push("tags")}),Object(C.extend)(G.a.prototype,"view",function(t){var e=Object(y.a)(this.props.discussion.tags());if(e&&e.length){var n=e[0].color();n&&(t.attrs.style={backgroundColor:n},t.attrs.className+=" DiscussionHero--colored")}}),Object(C.extend)(G.a.prototype,"items",function(t){var e=this.props.discussion.tags();e&&e.length&&t.add("tags",P(e,{link:!0}),5)})},Q=n(30),V=n.n(Q),W=n(6),X=n.n(W),Y=n(16),Z=n.n(Y),tt=n(31),et=n.n(tt),nt=n(32),st=n.n(nt),at=n(33),ot=n.n(at),rt=n(34),it=n.n(rt),ct=function(t){function e(){return t.apply(this,arguments)||this}Object(p.a)(e,t);var n=e.prototype;return n.init=function(){var e=this;t.prototype.init.call(this),this.tags=app.store.all("tags"),this.props.discussion?this.tags=this.tags.filter(function(t){return t.canAddToDiscussion()||-1!==e.props.discussion.tags().indexOf(t)}):this.tags=this.tags.filter(function(t){return t.canStartDiscussion()}),this.tags=Object(y.a)(this.tags),this.selected=[],this.filter=m.prop(""),this.index=this.tags[0].id(),this.focused=!1,this.props.selectedTags?this.props.selectedTags.map(this.addTag.bind(this)):this.props.discussion&&this.props.discussion.tags().map(this.addTag.bind(this)),this.minPrimary=app.forum.attribute("minPrimaryTags"),this.maxPrimary=app.forum.attribute("maxPrimaryTags"),this.minSecondary=app.forum.attribute("minSecondaryTags"),this.maxSecondary=app.forum.attribute("maxSecondaryTags"),this.navigator=new it.a,this.navigator.onUp(function(){return e.setIndex(e.getCurrentNumericIndex()-1,!0)}).onDown(function(){return e.setIndex(e.getCurrentNumericIndex()+1,!0)}).onSelect(this.select.bind(this)).onRemove(function(){return e.selected.splice(e.selected.length-1,1)})},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.addTag=function(t){if(t.canStartDiscussion()){var e=t.parent();if(e)-1===this.selected.indexOf(e)&&this.selected.push(e);this.selected.push(t)}},n.removeTag=function(t){var e=this.selected.indexOf(t);-1!==e&&(this.selected.splice(e,1),this.selected.filter(function(e){return e.parent()===t}).forEach(this.removeTag.bind(this)))},n.className=function(){return"TagDiscussionModal"},n.title=function(){return this.props.discussion?app.translator.trans("flarum-tags.forum.choose_tags.edit_title",{title:m("em",null,this.props.discussion.title())}):app.translator.trans("flarum-tags.forum.choose_tags.title")},n.getInstruction=function(t,e){if(t=this.maxPrimary&&(e=e.filter(function(e){return!e.isPrimary()||-1!==t.selected.indexOf(e)})),a>=this.maxSecondary&&(e=e.filter(function(e){return e.isPrimary()||-1!==t.selected.indexOf(e)})),n&&(e=e.filter(function(t){return t.name().substr(0,n.length).toLowerCase()===n})),-1===e.indexOf(this.index)&&(this.index=e[0]),[m("div",{className:"Modal-body"},m("div",{className:"TagDiscussionModal-form"},m("div",{className:"TagDiscussionModal-form-input"},m("div",{className:"TagsInput FormControl "+(this.focused?"focus":"")},m("span",{className:"TagsInput-selected"},this.selected.map(function(e){return m("span",{className:"TagsInput-tag",onclick:function(){t.removeTag(e),t.onready()}},Object(v.a)(e))})),m("input",{className:"FormControl",placeholder:ot()(this.getInstruction(s,a)),value:this.filter(),oninput:m.withAttr("value",this.filter),onkeydown:this.navigator.navigate.bind(this.navigator),onfocus:function(){return t.focused=!0},onblur:function(){return t.focused=!1}}))),m("div",{className:"TagDiscussionModal-form-submit App-primaryControl"},X.a.component({type:"submit",className:"Button Button--primary",disabled:s li")},n.getCurrentNumericIndex=function(){return this.selectableItems().index(this.getItem(this.index))},n.getItem=function(t){return this.selectableItems().filter('[data-index="'+t.id()+'"]')},n.setIndex=function(t,e){var n=this.selectableItems(),s=n.parent();t<0?t=n.length-1:t>=n.length&&(t=0);var a=n.eq(t);if(this.index=app.store.getById("tags",a.attr("data-index")),m.redraw(),e){var o,r=s.scrollTop(),i=s.offset().top,c=i+s.outerHeight(),u=a.offset().top,p=u+a.outerHeight();uc&&(o=r-c+p+parseInt(s.css("padding-bottom"),10)),void 0!==o&&s.stop(!0).animate({scrollTop:o},100)}},n.onsubmit=function(t){t.preventDefault();var e=this.props.discussion,n=this.selected;e&&e.save({relationships:{tags:n}}).then(function(){app.current instanceof U.a&&app.current.stream.update(),m.redraw()}),this.props.onsubmit&&this.props.onsubmit(n),app.modal.close(),m.redraw.strategy("none")},e}(Z.a),ut=function(){Object(C.extend)(V.a,"moderationControls",function(t,e){e.canTag()&&t.add("tags",X.a.component({children:app.translator.trans("flarum-tags.forum.discussion_controls.edit_tags_button"),icon:"fas fa-tag",onclick:function(){return app.modal.show(new ct({discussion:e}))}}))})},pt=n(11),lt=n.n(pt),mt=function(){Object(C.extend)(c.a.prototype,"composeNewDiscussion",function(t){var e=app.store.getBy("tags","slug",this.params().tags);if(e){var n=e.parent(),s=n?[n,e]:[e];t.then(function(t){return t.tags=s})}}),lt.a.prototype.tags=[],lt.a.prototype.chooseTags=function(){var t=this;app.modal.show(new ct({selectedTags:this.tags.slice(0),onsubmit:function(e){t.tags=e,t.$("textarea").focus()}}))},Object(C.extend)(lt.a.prototype,"headerItems",function(t){t.add("tags",m("a",{className:"DiscussionComposer-changeTags",onclick:this.chooseTags.bind(this)},this.tags.length?P(this.tags):m("span",{className:"TagLabel untagged"},app.translator.trans("flarum-tags.forum.composer_discussion.choose_tags_link"))),10)}),Object(C.override)(lt.a.prototype,"onsubmit",function(t){var e=this,n=this.tags,s=n.filter(function(t){return null!==t.position()&&!t.isChild()}),a=n.filter(function(t){return null===t.position()});!n.length||s.length=this.maxPrimary&&(e=e.filter(function(e){return!e.isPrimary()||-1!==t.selected.indexOf(e)})),a>=this.maxSecondary&&(e=e.filter(function(e){return e.isPrimary()||-1!==t.selected.indexOf(e)})),n&&(e=e.filter(function(t){return t.name().substr(0,n.length).toLowerCase()===n})),-1===e.indexOf(this.index)&&(this.index=e[0]),[m("div",{className:"Modal-body"},m("div",{className:"TagDiscussionModal-form"},m("div",{className:"TagDiscussionModal-form-input"},m("div",{className:"TagsInput FormControl "+(this.focused?"focus":"")},m("span",{className:"TagsInput-selected"},this.selected.map(function(e){return m("span",{className:"TagsInput-tag",onclick:function(){t.removeTag(e),t.onready()}},Object(v.a)(e))})),m("input",{className:"FormControl",placeholder:ot()(this.getInstruction(s,a)),value:this.filter(),oninput:m.withAttr("value",this.filter),onkeydown:this.navigator.navigate.bind(this.navigator),onfocus:function(){return t.focused=!0},onblur:function(){return t.focused=!1}}))),m("div",{className:"TagDiscussionModal-form-submit App-primaryControl"},X.a.component({type:"submit",className:"Button Button--primary",disabled:s li")},n.getCurrentNumericIndex=function(){return this.selectableItems().index(this.getItem(this.index))},n.getItem=function(t){return this.selectableItems().filter('[data-index="'+t.id()+'"]')},n.setIndex=function(t,e){var n=this.selectableItems(),s=n.parent();t<0?t=n.length-1:t>=n.length&&(t=0);var a=n.eq(t);if(this.index=app.store.getById("tags",a.attr("data-index")),m.redraw(),e){var o,r=s.scrollTop(),i=s.offset().top,c=i+s.outerHeight(),u=a.offset().top,l=u+a.outerHeight();uc&&(o=r-c+l+parseInt(s.css("padding-bottom"),10)),void 0!==o&&s.stop(!0).animate({scrollTop:o},100)}},n.onsubmit=function(t){t.preventDefault();var e=this.props.discussion,n=this.selected;e&&e.save({relationships:{tags:n}}).then(function(){app.current instanceof U.a&&app.current.stream.update(),m.redraw()}),this.props.onsubmit&&this.props.onsubmit(n),app.modal.close(),m.redraw.strategy("none")},e}(Z.a),ut=function(){Object(C.extend)(V.a,"moderationControls",function(t,e){e.canTag()&&t.add("tags",X.a.component({children:app.translator.trans("flarum-tags.forum.discussion_controls.edit_tags_button"),icon:"fas fa-tag",onclick:function(){return app.modal.show(new ct({discussion:e}))}}))})},lt=n(11),pt=n.n(lt),mt=function(){Object(C.extend)(c.a.prototype,"newDiscussionAction",function(t){var e=app.store.getBy("tags","slug",this.params().tags);if(e){var n=e.parent(),s=n?[n,e]:[e];t.then(function(t){return t.tags=s})}}),pt.a.prototype.tags=[],pt.a.prototype.chooseTags=function(){var t=this;app.modal.show(new ct({selectedTags:this.tags.slice(0),onsubmit:function(e){t.tags=e,t.$("textarea").focus()}}))},Object(C.extend)(pt.a.prototype,"headerItems",function(t){t.add("tags",m("a",{className:"DiscussionComposer-changeTags",onclick:this.chooseTags.bind(this)},this.tags.length?P(this.tags):m("span",{className:"TagLabel untagged"},app.translator.trans("flarum-tags.forum.composer_discussion.choose_tags_link"))),10)}),Object(C.override)(pt.a.prototype,"onsubmit",function(t){var e=this,n=this.tags,s=n.filter(function(t){return null!==t.position()&&!t.isChild()}),a=n.filter(function(t){return null===t.position()});!n.length||s.length {\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)\n 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\n // If they are both child tags, then we will compare the positions of their\n // parents.\n else if (aParent && bParent)\n return aParent.position() - bParent.position();\n\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)\n return aParent === b ? 1 : aParent.position() - bPos;\n\n else if (bParent)\n return bParent === a ? -1 : aPos - bParent.position();\n\n return 0;\n });\n}\n","module.exports = flarum.core.compat['components/IndexPage'];","import extract from 'flarum/utils/extract';\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\n if (tag) {\n const color = tag.color();\n if (color) {\n attrs.style.backgroundColor = attrs.style.color = color;\n attrs.className += ' colored';\n }\n\n if (link) {\n attrs.title = tag.description() || '';\n attrs.href = app.route('tag', {tags: tag.slug()});\n attrs.config = m.route;\n }\n } else {\n attrs.className += ' untagged';\n }\n\n return (\n m((link ? 'a' : 'span'), attrs,\n \n {tag ? tag.name() : app.translator.trans('flarum-tags.lib.deleted_tag_text')}\n \n )\n );\n}\n","module.exports = flarum.core.compat['components/Button'];","export default function tagIcon(tag, attrs = {}) {\n attrs.className = 'icon TagIcon ' + (attrs.className || '');\n\n if (tag) {\n attrs.style = attrs.style || {};\n attrs.style.backgroundColor = tag.color();\n } else {\n attrs.className += ' untagged';\n }\n\n return ;\n}\n","import Model from 'flarum/Model';\nimport mixin from 'flarum/utils/mixin';\nimport computed from 'flarum/utils/computed';\n\nexport default class Tag extends mixin(Model, {\n name: Model.attribute('name'),\n slug: Model.attribute('slug'),\n description: Model.attribute('description'),\n\n color: Model.attribute('color'),\n backgroundUrl: Model.attribute('backgroundUrl'),\n backgroundMode: Model.attribute('backgroundMode'),\n\n position: Model.attribute('position'),\n parent: Model.hasOne('parent'),\n defaultSort: Model.attribute('defaultSort'),\n isChild: Model.attribute('isChild'),\n isHidden: Model.attribute('isHidden'),\n\n discussionCount: Model.attribute('discussionCount'),\n lastPostedAt: Model.attribute('lastPostedAt', Model.transformDate),\n lastPostedDiscussion: Model.hasOne('lastPostedDiscussion'),\n\n isRestricted: Model.attribute('isRestricted'),\n canStartDiscussion: Model.attribute('canStartDiscussion'),\n canAddToDiscussion: Model.attribute('canAddToDiscussion'),\n\n isPrimary: computed('position', 'parent', (position, parent) => position !== null && parent === false)\n}) {}\n","module.exports = flarum.core.compat['utils/extract'];","module.exports = flarum.core.compat['components/DiscussionComposer'];","module.exports = flarum.core.compat['utils/mixin'];","module.exports = flarum.core.compat['utils/computed'];","module.exports = flarum.core.compat['components/Page'];","module.exports = flarum.core.compat['components/Modal'];","module.exports = flarum.core.compat['components/LinkButton'];","module.exports = flarum.core.compat['components/DiscussionPage'];","module.exports = flarum.core.compat['models/Discussion'];","module.exports = flarum.core.compat['components/DiscussionHero'];","import Page from 'flarum/components/Page';\nimport IndexPage from 'flarum/components/IndexPage';\nimport listItems from 'flarum/helpers/listItems';\nimport humanTime from 'flarum/helpers/humanTime';\n\nimport tagLabel from '../../common/helpers/tagLabel';\nimport sortTags from '../../common/utils/sortTags';\n\nexport default class TagsPage extends Page {\n init() {\n super.init();\n\n this.tags = sortTags(app.store.all('tags').filter(tag => !tag.parent()));\n\n app.history.push('tags', app.translator.trans('flarum-tags.forum.header.back_to_tags_tooltip'));\n }\n\n view() {\n const pinned = this.tags.filter(tag => tag.position() !== null);\n const cloud = this.tags.filter(tag => tag.position() === null);\n\n return (\n
\n {IndexPage.prototype.hero()}\n
\n \n\n
\n \n\n {cloud.length ? (\n
\n {cloud.map(tag => [\n tagLabel(tag, {link: true}),\n ' ',\n ])}\n
\n ) : ''}\n
\n
\n
\n );\n }\n}\n","import extract from 'flarum/utils/extract';\nimport tagLabel from './tagLabel';\nimport sortTags from '../utils/sortTags';\n\nexport default function tagsLabel(tags, attrs = {}) {\n const children = [];\n const link = extract(attrs, 'link');\n\n attrs.className = 'TagsLabel ' + (attrs.className || '');\n\n if (tags) {\n sortTags(tags).forEach(tag => {\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 EventPost from 'flarum/components/EventPost';\nimport tagsLabel from '../../common/helpers/tagsLabel';\n\nexport default class DiscussionTaggedPost extends EventPost {\n static initProps(props) {\n super.initProps(props);\n\n const oldTags = props.post.content()[0];\n const newTags = props.post.content()[1];\n\n function diffTags(tags1, tags2) {\n return tags1\n .filter(tag => tags2.indexOf(tag) === -1)\n .map(id => app.store.getById('tags', id));\n }\n\n props.tagsAdded = diffTags(newTags, oldTags);\n props.tagsRemoved = diffTags(oldTags, newTags);\n }\n\n icon() {\n return 'fas fa-tag';\n }\n\n descriptionKey() {\n if (this.props.tagsAdded.length) {\n if (this.props.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.props.tagsAdded.length) {\n data.tagsAdded = app.translator.transChoice('flarum-tags.forum.post_stream.tags_text', this.props.tagsAdded.length, {\n tags: tagsLabel(this.props.tagsAdded, {link: true}),\n count: this.props.tagsAdded.length\n });\n }\n\n if (this.props.tagsRemoved.length) {\n data.tagsRemoved = app.translator.transChoice('flarum-tags.forum.post_stream.tags_text', this.props.tagsRemoved.length, {\n tags: tagsLabel(this.props.tagsRemoved, {link: true}),\n count: this.props.tagsRemoved.length\n });\n }\n\n return data;\n }\n}\n","import LinkButton from 'flarum/components/LinkButton';\nimport tagIcon from '../../common/helpers/tagIcon';\n\nexport default class TagLinkButton extends LinkButton {\n view() {\n const tag = this.props.tag;\n const active = this.constructor.isActive(this.props);\n const description = tag && tag.description();\n\n return (\n \n {tagIcon(tag, {className: 'Button-icon'})}\n {this.props.children}\n \n );\n }\n\n static initProps(props) {\n const tag = props.tag;\n\n props.params.tags = tag ? tag.slug() : 'untagged';\n props.href = app.route('tag', props.params);\n props.children = tag ? tag.name() : app.translator.trans('flarum-tags.forum.index.untagged_link');\n }\n}\n","import { extend } from 'flarum/extend';\nimport IndexPage from 'flarum/components/IndexPage';\nimport Separator from 'flarum/components/Separator';\nimport LinkButton from 'flarum/components/LinkButton';\n\nimport TagLinkButton from './components/TagLinkButton';\nimport TagsPage from './components/TagsPage';\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('tags', LinkButton.component({\n icon: 'fas fa-th-large',\n children: app.translator.trans('flarum-tags.forum.index.tags_link'),\n href: app.route('tags')\n }), -10);\n\n if (app.current instanceof TagsPage) return;\n\n items.add('separator', Separator.component(), -10);\n\n const params = this.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 items.add('tag' + tag.id(), TagLinkButton.component({tag, params, active}), -10);\n };\n\n sortTags(tags)\n .filter(tag => tag.position() !== null && (!tag.isChild() || (currentTag && (tag.parent() === currentTag || tag.parent() === currentTag.parent()))))\n .forEach(addTag);\n\n const more = tags\n .filter(tag => tag.position() === null)\n .sort((a, b) => b.discussionCount() - a.discussionCount());\n\n more.splice(0, 3).forEach(addTag);\n\n if (more.length) {\n items.add('moreTags', LinkButton.component({\n children: app.translator.trans('flarum-tags.forum.index.more_link'),\n href: app.route('tags')\n }), -10);\n }\n });\n}\n","import Component from 'flarum/Component';\n\nexport default class TagHero extends Component {\n view() {\n const tag = this.props.tag;\n const color = tag.color();\n\n return (\n
\n
\n
\n

{tag.name()}

\n
{tag.description()}
\n
\n
\n
\n );\n }\n}\n","import { extend, override } from 'flarum/extend';\nimport IndexPage from 'flarum/components/IndexPage';\nimport DiscussionList from 'flarum/components/DiscussionList';\n\nimport TagHero from './components/TagHero';\n\nexport default function() {\n IndexPage.prototype.currentTag = function() {\n const slug = this.params().tags;\n\n if (slug) return app.store.getBy('tags', 'slug', slug);\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 TagHero.component({tag});\n\n return original();\n });\n\n extend(IndexPage.prototype, 'view', function(vdom) {\n const tag = this.currentTag();\n\n if (tag) {\n vdom.attrs.className += ' IndexPage--tag'+tag.id();\n }\n });\n\n // If currently viewing a tag, restyle the 'new discussion' button to use\n // the tag's color.\n extend(IndexPage.prototype, 'sidebarItems', function(items) {\n const tag = this.currentTag();\n\n if (tag) {\n const color = tag.color();\n\n if (color) {\n items.get('newDiscussion').props.style = {backgroundColor: color};\n }\n }\n });\n\n // Add a parameter for the IndexPage to pass on to the DiscussionList that\n // will let us filter discussions by tag.\n extend(IndexPage.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(DiscussionList.prototype, 'requestParams', function(params) {\n params.include.push('tags');\n\n if (this.props.params.tags) {\n params.filter.q = (params.filter.q || '') + ' tag:' + this.props.params.tags;\n }\n });\n}\n","import { extend } from 'flarum/extend';\nimport DiscussionListItem from 'flarum/components/DiscussionListItem';\nimport DiscussionPage from 'flarum/components/DiscussionPage';\nimport DiscussionHero from 'flarum/components/DiscussionHero';\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.props.discussion.tags();\n\n if (tags && tags.length) {\n items.add('tags', tagsLabel(tags), 10);\n }\n });\n\n // Include a discussion's tags when fetching it.\n extend(DiscussionPage.prototype, 'params', function(params) {\n params.include.push('tags');\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.props.discussion.tags());\n\n if (tags && tags.length) {\n const color = tags[0].color();\n if (color) {\n view.attrs.style = {backgroundColor: color};\n view.attrs.className += ' DiscussionHero--colored';\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.props.discussion.tags();\n\n if (tags && tags.length) {\n items.add('tags', tagsLabel(tags, {link: true}), 5);\n }\n });\n}\n","import Modal from 'flarum/components/Modal';\nimport DiscussionPage from 'flarum/components/DiscussionPage';\nimport Button from 'flarum/components/Button';\nimport highlight from 'flarum/helpers/highlight';\nimport classList from 'flarum/utils/classList';\nimport extractText from 'flarum/utils/extractText';\nimport KeyboardNavigatable from 'flarum/utils/KeyboardNavigatable';\n\nimport tagLabel from '../../common/helpers/tagLabel';\nimport tagIcon from '../../common/helpers/tagIcon';\nimport sortTags from '../../common/utils/sortTags';\n\nexport default class TagDiscussionModal extends Modal {\n init() {\n super.init();\n\n this.tags = app.store.all('tags');\n\n if (this.props.discussion) {\n this.tags = this.tags.filter(tag => tag.canAddToDiscussion() || this.props.discussion.tags().indexOf(tag) !== -1);\n } else {\n this.tags = this.tags.filter(tag => tag.canStartDiscussion());\n }\n\n this.tags = sortTags(this.tags);\n\n this.selected = [];\n this.filter = m.prop('');\n this.index = this.tags[0].id();\n this.focused = false;\n\n if (this.props.selectedTags) {\n this.props.selectedTags.map(this.addTag.bind(this));\n } else if (this.props.discussion) {\n this.props.discussion.tags().map(this.addTag.bind(this));\n }\n\n this.minPrimary = app.forum.attribute('minPrimaryTags');\n this.maxPrimary = app.forum.attribute('maxPrimaryTags');\n this.minSecondary = app.forum.attribute('minSecondaryTags');\n this.maxSecondary = app.forum.attribute('maxSecondaryTags');\n\n this.navigator = new KeyboardNavigatable();\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\n primaryCount() {\n return this.selected.filter(tag => tag.isPrimary()).length;\n }\n\n secondaryCount() {\n return this.selected.filter(tag => !tag.isPrimary()).length;\n }\n\n /**\n * Add the given tag to the list of selected tags.\n *\n * @param {Tag} tag\n */\n addTag(tag) {\n if (!tag.canStartDiscussion()) return;\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 const parent = tag.parent();\n if (parent) {\n const index = this.selected.indexOf(parent);\n if (index === -1) {\n this.selected.push(parent);\n }\n }\n\n this.selected.push(tag);\n }\n\n /**\n * Remove the given tag from the list of selected tags.\n *\n * @param {Tag} tag\n */\n removeTag(tag) {\n const index = this.selected.indexOf(tag);\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 this.selected\n .filter(selected => selected.parent() === tag)\n .forEach(this.removeTag.bind(this));\n }\n }\n\n className() {\n return 'TagDiscussionModal';\n }\n\n title() {\n return this.props.discussion\n ? app.translator.trans('flarum-tags.forum.choose_tags.edit_title', {title: {this.props.discussion.title()}})\n : app.translator.trans('flarum-tags.forum.choose_tags.title');\n }\n\n getInstruction(primaryCount, secondaryCount) {\n if (primaryCount < this.minPrimary) {\n const remaining = this.minPrimary - primaryCount;\n return app.translator.transChoice('flarum-tags.forum.choose_tags.choose_primary_placeholder', remaining, {count: remaining});\n } else if (secondaryCount < this.minSecondary) {\n const remaining = this.minSecondary - secondaryCount;\n return app.translator.transChoice('flarum-tags.forum.choose_tags.choose_secondary_placeholder', remaining, {count: remaining});\n }\n\n return '';\n }\n\n content() {\n let tags = this.tags;\n const filter = this.filter().toLowerCase();\n const primaryCount = this.primaryCount();\n const secondaryCount = this.secondaryCount();\n\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 === false || this.selected.indexOf(parent) !== -1;\n });\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 if (primaryCount >= this.maxPrimary) {\n tags = tags.filter(tag => !tag.isPrimary() || this.selected.indexOf(tag) !== -1);\n }\n\n if (secondaryCount >= this.maxSecondary) {\n tags = tags.filter(tag => tag.isPrimary() || this.selected.indexOf(tag) !== -1);\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().substr(0, filter.length).toLowerCase() === filter);\n }\n\n if (tags.indexOf(this.index) === -1) this.index = tags[0];\n\n return [\n
\n
\n
\n
\n \n {this.selected.map(tag =>\n {\n this.removeTag(tag);\n this.onready();\n }}>\n {tagLabel(tag)}\n \n )}\n \n this.focused = true}\n onblur={() => this.focused = false}/>\n
\n
\n
\n {Button.component({\n type: 'submit',\n className: 'Button Button--primary',\n disabled: primaryCount < this.minPrimary || secondaryCount < this.minSecondary,\n icon: 'fas fa-check',\n children: app.translator.trans('flarum-tags.forum.choose_tags.submit_button')\n })}\n
\n
\n
,\n\n
\n
    \n {tags\n .filter(tag => filter || !tag.parent() || this.selected.indexOf(tag.parent()) !== -1)\n .map(tag => (\n
  • this.index = tag}\n onclick={this.toggleTag.bind(this, tag)}\n >\n {tagIcon(tag)}\n \n {highlight(tag.name(), filter)}\n \n {tag.description()\n ? (\n \n {tag.description()}\n \n ) : ''}\n
  • \n ))}\n
\n
\n ];\n }\n\n toggleTag(tag) {\n const index = this.selected.indexOf(tag);\n\n if (index !== -1) {\n this.removeTag(tag);\n } else {\n this.addTag(tag);\n }\n\n if (this.filter()) {\n this.filter('');\n this.index = this.tags[0];\n }\n\n this.onready();\n }\n\n select(e) {\n // Ctrl + Enter submits the selection, just Enter completes the current entry\n if (e.metaKey || e.ctrlKey || this.selected.indexOf(this.index) !== -1) {\n if (this.selected.length) {\n this.$('form').submit();\n }\n } else {\n this.getItem(this.index)[0].dispatchEvent(new Event('click'));\n }\n }\n\n selectableItems() {\n return this.$('.TagDiscussionModal-list > li');\n }\n\n getCurrentNumericIndex() {\n return this.selectableItems().index(\n this.getItem(this.index)\n );\n }\n\n getItem(index) {\n return this.selectableItems().filter(`[data-index=\"${index.id()}\"]`);\n }\n\n setIndex(index, scrollToItem) {\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.index = app.store.getById('tags', $item.attr('data-index'));\n\n m.redraw();\n\n if (scrollToItem) {\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 onsubmit(e) {\n e.preventDefault();\n\n const discussion = this.props.discussion;\n const tags = this.selected;\n\n if (discussion) {\n discussion.save({relationships: {tags}})\n .then(() => {\n if (app.current instanceof DiscussionPage) {\n app.current.stream.update();\n }\n m.redraw();\n });\n }\n\n if (this.props.onsubmit) this.props.onsubmit(tags);\n\n app.modal.close();\n\n m.redraw.strategy('none');\n }\n}\n","import { extend } from 'flarum/extend';\nimport DiscussionControls from 'flarum/utils/DiscussionControls';\nimport Button from 'flarum/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('tags', Button.component({\n children: app.translator.trans('flarum-tags.forum.discussion_controls.edit_tags_button'),\n icon: 'fas fa-tag',\n onclick: () => app.modal.show(new TagDiscussionModal({discussion}))\n }));\n }\n });\n}\n","import { extend, override } from 'flarum/extend';\nimport IndexPage from 'flarum/components/IndexPage';\nimport DiscussionComposer from 'flarum/components/DiscussionComposer';\n\nimport TagDiscussionModal from './components/TagDiscussionModal';\nimport tagsLabel from '../common/helpers/tagsLabel';\n\nexport default function() {\n extend(IndexPage.prototype, 'composeNewDiscussion', function(promise) {\n const tag = app.store.getBy('tags', 'slug', this.params().tags);\n\n if (tag) {\n const parent = tag.parent();\n const tags = parent ? [parent, tag] : [tag];\n promise.then(component => component.tags = tags);\n }\n });\n\n // Add tag-selection abilities to the discussion composer.\n DiscussionComposer.prototype.tags = [];\n DiscussionComposer.prototype.chooseTags = function() {\n app.modal.show(\n new TagDiscussionModal({\n selectedTags: this.tags.slice(0),\n onsubmit: tags => {\n this.tags = tags;\n this.$('textarea').focus();\n }\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 items.add('tags', (\n \n {this.tags.length\n ? tagsLabel(this.tags)\n : {app.translator.trans('flarum-tags.forum.composer_discussion.choose_tags_link')}}\n \n ), 10);\n });\n\n override(DiscussionComposer.prototype, 'onsubmit', function(original) {\n const chosenTags = this.tags;\n const chosenPrimaryTags = chosenTags.filter(tag => tag.position() !== null && !tag.isChild());\n const chosenSecondaryTags = chosenTags.filter(tag => tag.position() === null);\n if (!chosenTags.length\n || (chosenPrimaryTags.length < app.forum.attribute('minPrimaryTags'))\n || (chosenSecondaryTags.length < app.forum.attribute('minSecondaryTags'))) {\n app.modal.show(\n new TagDiscussionModal({\n selectedTags: chosenTags,\n onsubmit: tags => {\n this.tags = tags;\n original();\n }\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.tags;\n });\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';\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};\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';\n\nexport default Object.assign(compat, {\n 'addTagFilter': addTagFilter,\n 'addTagControl': addTagControl,\n 'components/TagHero': TagHero,\n 'components/TagDiscussionModal': TagDiscussionModal,\n 'components/TagsPage': TagsPage,\n 'components/DiscussionTaggedPost': DiscussionTaggedPost,\n 'components/TagLinkButton': TagLinkButton,\n 'addTagList': addTagList,\n 'addTagLabels': addTagLabels,\n 'addTagComposer': addTagComposer,\n});\n","import Model from 'flarum/Model';\nimport Discussion from 'flarum/models/Discussion';\nimport IndexPage from 'flarum/components/IndexPage';\n\nimport Tag from '../common/models/Tag';\nimport TagsPage from './components/TagsPage';\nimport DiscussionTaggedPost from './components/DiscussionTaggedPost';\n\nimport addTagList from './addTagList';\nimport addTagFilter from './addTagFilter';\nimport addTagLabels from './addTagLabels';\nimport addTagControl from './addTagControl';\nimport addTagComposer from './addTagComposer';\n\napp.initializers.add('flarum-tags', function(app) {\n app.routes.tags = {path: '/tags', component: TagsPage.component()};\n app.routes.tag = {path: '/t/:tags', component: IndexPage.component()};\n\n app.route.tag = tag => app.route('tag', {tags: tag.slug()});\n\n app.postComponents.discussionTagged = DiscussionTaggedPost;\n\n app.store.models.tags = Tag;\n\n Discussion.prototype.tags = Model.hasMany('tags');\n Discussion.prototype.canTag = Model.attribute('canTag');\n\n addTagList();\n addTagFilter();\n addTagLabels();\n addTagControl();\n addTagComposer();\n});\n\n\n// Expose compat API\nimport tagsCompat from './compat';\nimport { compat } from '@flarum/core/forum';\n\nObject.assign(compat, tagsCompat);","module.exports = flarum.core.compat['helpers/listItems'];","module.exports = flarum.core.compat['helpers/humanTime'];","module.exports = flarum.core.compat['components/EventPost'];","module.exports = flarum.core.compat['components/Separator'];","module.exports = flarum.core.compat['components/DiscussionList'];","module.exports = flarum.core.compat['Component'];","module.exports = flarum.core.compat['components/DiscussionListItem'];","module.exports = flarum.core.compat['utils/DiscussionControls'];","module.exports = flarum.core.compat['helpers/highlight'];","module.exports = flarum.core.compat['utils/classList'];","module.exports = flarum.core.compat['utils/extractText'];","module.exports = flarum.core.compat['utils/KeyboardNavigatable'];","module.exports = flarum.core;","/*\n * This file is part of Flarum.\n *\n * (c) Toby Zerner \n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nexport * from './src/common';\nexport * from './src/forum';\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://@flarum/flarum-ext-tags/webpack/bootstrap","webpack://@flarum/flarum-ext-tags/external \"flarum.core.compat['Model']\"","webpack://@flarum/flarum-ext-tags/external \"flarum.core.compat['extend']\"","webpack://@flarum/flarum-ext-tags/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@flarum/flarum-ext-tags/./src/common/utils/sortTags.js","webpack://@flarum/flarum-ext-tags/external \"flarum.core.compat['components/IndexPage']\"","webpack://@flarum/flarum-ext-tags/./src/common/helpers/tagLabel.js","webpack://@flarum/flarum-ext-tags/external \"flarum.core.compat['components/Button']\"","webpack://@flarum/flarum-ext-tags/./src/common/helpers/tagIcon.js","webpack://@flarum/flarum-ext-tags/./src/common/models/Tag.js","webpack://@flarum/flarum-ext-tags/external \"flarum.core.compat['utils/extract']\"","webpack://@flarum/flarum-ext-tags/external \"flarum.core.compat['components/DiscussionComposer']\"","webpack://@flarum/flarum-ext-tags/external \"flarum.core.compat['utils/mixin']\"","webpack://@flarum/flarum-ext-tags/external \"flarum.core.compat['utils/computed']\"","webpack://@flarum/flarum-ext-tags/external \"flarum.core.compat['components/Page']\"","webpack://@flarum/flarum-ext-tags/external \"flarum.core.compat['components/Modal']\"","webpack://@flarum/flarum-ext-tags/external \"flarum.core.compat['components/LinkButton']\"","webpack://@flarum/flarum-ext-tags/external \"flarum.core.compat['components/DiscussionPage']\"","webpack://@flarum/flarum-ext-tags/external \"flarum.core.compat['models/Discussion']\"","webpack://@flarum/flarum-ext-tags/external \"flarum.core.compat['components/DiscussionHero']\"","webpack://@flarum/flarum-ext-tags/./src/forum/components/TagsPage.js","webpack://@flarum/flarum-ext-tags/./src/common/helpers/tagsLabel.js","webpack://@flarum/flarum-ext-tags/./src/forum/components/DiscussionTaggedPost.js","webpack://@flarum/flarum-ext-tags/./src/forum/components/TagLinkButton.js","webpack://@flarum/flarum-ext-tags/./src/forum/addTagList.js","webpack://@flarum/flarum-ext-tags/./src/forum/components/TagHero.js","webpack://@flarum/flarum-ext-tags/./src/forum/addTagFilter.js","webpack://@flarum/flarum-ext-tags/./src/forum/addTagLabels.js","webpack://@flarum/flarum-ext-tags/./src/forum/components/TagDiscussionModal.js","webpack://@flarum/flarum-ext-tags/./src/forum/addTagControl.js","webpack://@flarum/flarum-ext-tags/./src/forum/addTagComposer.js","webpack://@flarum/flarum-ext-tags/./src/common/compat.js","webpack://@flarum/flarum-ext-tags/./src/forum/compat.js","webpack://@flarum/flarum-ext-tags/./src/forum/index.js","webpack://@flarum/flarum-ext-tags/external \"flarum.core.compat['helpers/listItems']\"","webpack://@flarum/flarum-ext-tags/external \"flarum.core.compat['helpers/humanTime']\"","webpack://@flarum/flarum-ext-tags/external \"flarum.core.compat['components/EventPost']\"","webpack://@flarum/flarum-ext-tags/external \"flarum.core.compat['components/Separator']\"","webpack://@flarum/flarum-ext-tags/external \"flarum.core.compat['components/DiscussionList']\"","webpack://@flarum/flarum-ext-tags/external \"flarum.core.compat['Component']\"","webpack://@flarum/flarum-ext-tags/external \"flarum.core.compat['components/DiscussionListItem']\"","webpack://@flarum/flarum-ext-tags/external \"flarum.core.compat['utils/DiscussionControls']\"","webpack://@flarum/flarum-ext-tags/external \"flarum.core.compat['helpers/highlight']\"","webpack://@flarum/flarum-ext-tags/external \"flarum.core.compat['utils/classList']\"","webpack://@flarum/flarum-ext-tags/external \"flarum.core.compat['utils/extractText']\"","webpack://@flarum/flarum-ext-tags/external \"flarum.core.compat['utils/KeyboardNavigatable']\"","webpack://@flarum/flarum-ext-tags/external \"flarum.core\"","webpack://@flarum/flarum-ext-tags/./forum.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","flarum","core","compat","_inheritsLoose","subClass","superClass","constructor","__proto__","__webpack_exports__","sortTags","tags","slice","sort","a","b","aPos","position","bPos","discussionCount","aParent","parent","bParent","tagLabel","flarum_utils_extract__WEBPACK_IMPORTED_MODULE_0__","flarum_utils_extract__WEBPACK_IMPORTED_MODULE_0___default","tag","attrs","style","className","link","extract","color","backgroundColor","title","description","href","app","route","slug","config","translator","trans","tagIcon","Tag","mixin","Model","attribute","backgroundUrl","backgroundMode","hasOne","defaultSort","isChild","isHidden","lastPostedAt","transformDate","lastPostedDiscussion","isRestricted","canStartDiscussion","canAddToDiscussion","isPrimary","computed","TagsPage","init","_Page","this","store","all","filter","history","push","view","pinned","cloud","IndexPage","hero","affixSidebar","listItems","sidebarItems","toArray","map","children","child","element","isInitialized","$","on","e","stopPropagation","apply","arguments","discussion","lastPostNumber","humanTime","length","Page","tagsLabel","forEach","DiscussionTaggedPost","initProps","props","_EventPost","oldTags","post","content","newTags","diffTags","tags1","tags2","indexOf","id","getById","tagsAdded","tagsRemoved","icon","descriptionKey","descriptionData","data","transChoice","count","EventPost","TagLinkButton","active","isActive","params","LinkButton","addTagList","extend","items","add","component","current","Separator","stickyParams","currentTag","addTag","more","splice","TagHero","Component","addTagFilter","getBy","override","original","vdom","param","DiscussionList","include","q","addTagLabels","DiscussionListItem","DiscussionPage","DiscussionHero","TagDiscussionModal","_this","_Modal","selected","prop","index","focused","selectedTags","minPrimary","forum","maxPrimary","minSecondary","maxSecondary","navigator","KeyboardNavigatable","onUp","setIndex","getCurrentNumericIndex","onDown","onSelect","select","onRemove","primaryCount","secondaryCount","removeTag","getInstruction","remaining","_this2","toLowerCase","substr","onclick","onready","placeholder","extractText","oninput","withAttr","onkeydown","navigate","onfocus","onblur","Button","type","disabled","data-index","classList","colored","onmouseover","toggleTag","highlight","metaKey","ctrlKey","submit","getItem","dispatchEvent","Event","selectableItems","scrollToItem","$items","$dropdown","$item","eq","attr","redraw","scrollTop","dropdownScroll","dropdownTop","offset","top","dropdownBottom","outerHeight","itemTop","itemBottom","parseInt","css","stop","animate","onsubmit","preventDefault","save","relationships","then","stream","update","modal","close","strategy","Modal","addTagControl","DiscussionControls","canTag","show","addTagComposer","promise","DiscussionComposer","chooseTags","focus","chosenTags","chosenPrimaryTags","chosenSecondaryTags","tags/utils/sortTags","tags/models/Tag","tags/helpers/tagsLabel","tags/helpers/tagIcon","tags/helpers/tagLabel","assign","components/TagHero","components/TagDiscussionModal","components/TagsPage","components/DiscussionTaggedPost","components/TagLinkButton","initializers","routes","path","postComponents","discussionTagged","models","Discussion","hasMany","tagsCompat","_src_common__WEBPACK_IMPORTED_MODULE_0__","__WEBPACK_IMPORT_KEY__"],"mappings":"2BACA,IAAAA,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,IACAG,EAAAH,EACAI,GAAA,EACAH,YAUA,OANAI,EAAAL,GAAAM,KAAAJ,EAAAD,QAAAC,IAAAD,QAAAF,GAGAG,EAAAE,GAAA,EAGAF,EAAAD,QA0DA,OArDAF,EAAAQ,EAAAF,EAGAN,EAAAS,EAAAV,EAGAC,EAAAU,EAAA,SAAAR,EAAA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ourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 44);\n","module.exports = flarum.core.compat['Model'];","module.exports = flarum.core.compat['extend'];","export default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}","export default function sortTags(tags) {\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)\n 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\n // If they are both child tags, then we will compare the positions of their\n // parents.\n else if (aParent && bParent)\n return aParent.position() - bParent.position();\n\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)\n return aParent === b ? 1 : aParent.position() - bPos;\n\n else if (bParent)\n return bParent === a ? -1 : aPos - bParent.position();\n\n return 0;\n });\n}\n","module.exports = flarum.core.compat['components/IndexPage'];","import extract from 'flarum/utils/extract';\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\n if (tag) {\n const color = tag.color();\n if (color) {\n attrs.style.backgroundColor = attrs.style.color = color;\n attrs.className += ' colored';\n }\n\n if (link) {\n attrs.title = tag.description() || '';\n attrs.href = app.route('tag', {tags: tag.slug()});\n attrs.config = m.route;\n }\n } else {\n attrs.className += ' untagged';\n }\n\n return (\n m((link ? 'a' : 'span'), attrs,\n \n {tag ? tag.name() : app.translator.trans('flarum-tags.lib.deleted_tag_text')}\n \n )\n );\n}\n","module.exports = flarum.core.compat['components/Button'];","export default function tagIcon(tag, attrs = {}) {\n attrs.className = 'icon TagIcon ' + (attrs.className || '');\n\n if (tag) {\n attrs.style = attrs.style || {};\n attrs.style.backgroundColor = tag.color();\n } else {\n attrs.className += ' untagged';\n }\n\n return ;\n}\n","import Model from 'flarum/Model';\nimport mixin from 'flarum/utils/mixin';\nimport computed from 'flarum/utils/computed';\n\nexport default class Tag extends mixin(Model, {\n name: Model.attribute('name'),\n slug: Model.attribute('slug'),\n description: Model.attribute('description'),\n\n color: Model.attribute('color'),\n backgroundUrl: Model.attribute('backgroundUrl'),\n backgroundMode: Model.attribute('backgroundMode'),\n\n position: Model.attribute('position'),\n parent: Model.hasOne('parent'),\n defaultSort: Model.attribute('defaultSort'),\n isChild: Model.attribute('isChild'),\n isHidden: Model.attribute('isHidden'),\n\n discussionCount: Model.attribute('discussionCount'),\n lastPostedAt: Model.attribute('lastPostedAt', Model.transformDate),\n lastPostedDiscussion: Model.hasOne('lastPostedDiscussion'),\n\n isRestricted: Model.attribute('isRestricted'),\n canStartDiscussion: Model.attribute('canStartDiscussion'),\n canAddToDiscussion: Model.attribute('canAddToDiscussion'),\n\n isPrimary: computed('position', 'parent', (position, parent) => position !== null && parent === false)\n}) {}\n","module.exports = flarum.core.compat['utils/extract'];","module.exports = flarum.core.compat['components/DiscussionComposer'];","module.exports = flarum.core.compat['utils/mixin'];","module.exports = flarum.core.compat['utils/computed'];","module.exports = flarum.core.compat['components/Page'];","module.exports = flarum.core.compat['components/Modal'];","module.exports = flarum.core.compat['components/LinkButton'];","module.exports = flarum.core.compat['components/DiscussionPage'];","module.exports = flarum.core.compat['models/Discussion'];","module.exports = flarum.core.compat['components/DiscussionHero'];","import Page from 'flarum/components/Page';\nimport IndexPage from 'flarum/components/IndexPage';\nimport listItems from 'flarum/helpers/listItems';\nimport humanTime from 'flarum/helpers/humanTime';\n\nimport tagLabel from '../../common/helpers/tagLabel';\nimport sortTags from '../../common/utils/sortTags';\n\nexport default class TagsPage extends Page {\n init() {\n super.init();\n\n this.tags = sortTags(app.store.all('tags').filter(tag => !tag.parent()));\n\n app.history.push('tags', app.translator.trans('flarum-tags.forum.header.back_to_tags_tooltip'));\n }\n\n view() {\n const pinned = this.tags.filter(tag => tag.position() !== null);\n const cloud = this.tags.filter(tag => tag.position() === null);\n\n return (\n
\n {IndexPage.prototype.hero()}\n
\n \n\n
\n \n\n {cloud.length ? (\n
\n {cloud.map(tag => [\n tagLabel(tag, {link: true}),\n ' ',\n ])}\n
\n ) : ''}\n
\n
\n
\n );\n }\n}\n","import extract from 'flarum/utils/extract';\nimport tagLabel from './tagLabel';\nimport sortTags from '../utils/sortTags';\n\nexport default function tagsLabel(tags, attrs = {}) {\n const children = [];\n const link = extract(attrs, 'link');\n\n attrs.className = 'TagsLabel ' + (attrs.className || '');\n\n if (tags) {\n sortTags(tags).forEach(tag => {\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 EventPost from 'flarum/components/EventPost';\nimport tagsLabel from '../../common/helpers/tagsLabel';\n\nexport default class DiscussionTaggedPost extends EventPost {\n static initProps(props) {\n super.initProps(props);\n\n const oldTags = props.post.content()[0];\n const newTags = props.post.content()[1];\n\n function diffTags(tags1, tags2) {\n return tags1\n .filter(tag => tags2.indexOf(tag) === -1)\n .map(id => app.store.getById('tags', id));\n }\n\n props.tagsAdded = diffTags(newTags, oldTags);\n props.tagsRemoved = diffTags(oldTags, newTags);\n }\n\n icon() {\n return 'fas fa-tag';\n }\n\n descriptionKey() {\n if (this.props.tagsAdded.length) {\n if (this.props.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.props.tagsAdded.length) {\n data.tagsAdded = app.translator.transChoice('flarum-tags.forum.post_stream.tags_text', this.props.tagsAdded.length, {\n tags: tagsLabel(this.props.tagsAdded, {link: true}),\n count: this.props.tagsAdded.length\n });\n }\n\n if (this.props.tagsRemoved.length) {\n data.tagsRemoved = app.translator.transChoice('flarum-tags.forum.post_stream.tags_text', this.props.tagsRemoved.length, {\n tags: tagsLabel(this.props.tagsRemoved, {link: true}),\n count: this.props.tagsRemoved.length\n });\n }\n\n return data;\n }\n}\n","import LinkButton from 'flarum/components/LinkButton';\nimport tagIcon from '../../common/helpers/tagIcon';\n\nexport default class TagLinkButton extends LinkButton {\n view() {\n const tag = this.props.tag;\n const active = this.constructor.isActive(this.props);\n const description = tag && tag.description();\n\n return (\n \n {tagIcon(tag, {className: 'Button-icon'})}\n {this.props.children}\n \n );\n }\n\n static initProps(props) {\n const tag = props.tag;\n\n props.params.tags = tag ? tag.slug() : 'untagged';\n props.href = app.route('tag', props.params);\n props.children = tag ? tag.name() : app.translator.trans('flarum-tags.forum.index.untagged_link');\n }\n}\n","import { extend } from 'flarum/extend';\nimport IndexPage from 'flarum/components/IndexPage';\nimport Separator from 'flarum/components/Separator';\nimport LinkButton from 'flarum/components/LinkButton';\n\nimport TagLinkButton from './components/TagLinkButton';\nimport TagsPage from './components/TagsPage';\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('tags', LinkButton.component({\n icon: 'fas fa-th-large',\n children: app.translator.trans('flarum-tags.forum.index.tags_link'),\n href: app.route('tags')\n }), -10);\n\n if (app.current instanceof TagsPage) return;\n\n items.add('separator', Separator.component(), -10);\n\n const params = this.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 items.add('tag' + tag.id(), TagLinkButton.component({tag, params, active}), -10);\n };\n\n sortTags(tags)\n .filter(tag => tag.position() !== null && (!tag.isChild() || (currentTag && (tag.parent() === currentTag || tag.parent() === currentTag.parent()))))\n .forEach(addTag);\n\n const more = tags\n .filter(tag => tag.position() === null)\n .sort((a, b) => b.discussionCount() - a.discussionCount());\n\n more.splice(0, 3).forEach(addTag);\n\n if (more.length) {\n items.add('moreTags', LinkButton.component({\n children: app.translator.trans('flarum-tags.forum.index.more_link'),\n href: app.route('tags')\n }), -10);\n }\n });\n}\n","import Component from 'flarum/Component';\n\nexport default class TagHero extends Component {\n view() {\n const tag = this.props.tag;\n const color = tag.color();\n\n return (\n
\n
\n
\n

{tag.name()}

\n
{tag.description()}
\n
\n
\n
\n );\n }\n}\n","import { extend, override } from 'flarum/extend';\nimport IndexPage from 'flarum/components/IndexPage';\nimport DiscussionList from 'flarum/components/DiscussionList';\n\nimport TagHero from './components/TagHero';\n\nexport default function() {\n IndexPage.prototype.currentTag = function() {\n const slug = this.params().tags;\n\n if (slug) return app.store.getBy('tags', 'slug', slug);\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 TagHero.component({tag});\n\n return original();\n });\n\n extend(IndexPage.prototype, 'view', function(vdom) {\n const tag = this.currentTag();\n\n if (tag) {\n vdom.attrs.className += ' IndexPage--tag'+tag.id();\n }\n });\n\n // If currently viewing a tag, restyle the 'new discussion' button to use\n // the tag's color.\n extend(IndexPage.prototype, 'sidebarItems', function(items) {\n const tag = this.currentTag();\n\n if (tag) {\n const color = tag.color();\n\n if (color) {\n items.get('newDiscussion').props.style = {backgroundColor: color};\n }\n }\n });\n\n // Add a parameter for the IndexPage to pass on to the DiscussionList that\n // will let us filter discussions by tag.\n extend(IndexPage.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(DiscussionList.prototype, 'requestParams', function(params) {\n params.include.push('tags');\n\n if (this.props.params.tags) {\n params.filter.q = (params.filter.q || '') + ' tag:' + this.props.params.tags;\n }\n });\n}\n","import { extend } from 'flarum/extend';\nimport DiscussionListItem from 'flarum/components/DiscussionListItem';\nimport DiscussionPage from 'flarum/components/DiscussionPage';\nimport DiscussionHero from 'flarum/components/DiscussionHero';\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.props.discussion.tags();\n\n if (tags && tags.length) {\n items.add('tags', tagsLabel(tags), 10);\n }\n });\n\n // Include a discussion's tags when fetching it.\n extend(DiscussionPage.prototype, 'params', function(params) {\n params.include.push('tags');\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.props.discussion.tags());\n\n if (tags && tags.length) {\n const color = tags[0].color();\n if (color) {\n view.attrs.style = {backgroundColor: color};\n view.attrs.className += ' DiscussionHero--colored';\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.props.discussion.tags();\n\n if (tags && tags.length) {\n items.add('tags', tagsLabel(tags, {link: true}), 5);\n }\n });\n}\n","import Modal from 'flarum/components/Modal';\nimport DiscussionPage from 'flarum/components/DiscussionPage';\nimport Button from 'flarum/components/Button';\nimport highlight from 'flarum/helpers/highlight';\nimport classList from 'flarum/utils/classList';\nimport extractText from 'flarum/utils/extractText';\nimport KeyboardNavigatable from 'flarum/utils/KeyboardNavigatable';\n\nimport tagLabel from '../../common/helpers/tagLabel';\nimport tagIcon from '../../common/helpers/tagIcon';\nimport sortTags from '../../common/utils/sortTags';\n\nexport default class TagDiscussionModal extends Modal {\n init() {\n super.init();\n\n this.tags = app.store.all('tags');\n\n if (this.props.discussion) {\n this.tags = this.tags.filter(tag => tag.canAddToDiscussion() || this.props.discussion.tags().indexOf(tag) !== -1);\n } else {\n this.tags = this.tags.filter(tag => tag.canStartDiscussion());\n }\n\n this.tags = sortTags(this.tags);\n\n this.selected = [];\n this.filter = m.prop('');\n this.index = this.tags[0].id();\n this.focused = false;\n\n if (this.props.selectedTags) {\n this.props.selectedTags.map(this.addTag.bind(this));\n } else if (this.props.discussion) {\n this.props.discussion.tags().map(this.addTag.bind(this));\n }\n\n this.minPrimary = app.forum.attribute('minPrimaryTags');\n this.maxPrimary = app.forum.attribute('maxPrimaryTags');\n this.minSecondary = app.forum.attribute('minSecondaryTags');\n this.maxSecondary = app.forum.attribute('maxSecondaryTags');\n\n this.navigator = new KeyboardNavigatable();\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\n primaryCount() {\n return this.selected.filter(tag => tag.isPrimary()).length;\n }\n\n secondaryCount() {\n return this.selected.filter(tag => !tag.isPrimary()).length;\n }\n\n /**\n * Add the given tag to the list of selected tags.\n *\n * @param {Tag} tag\n */\n addTag(tag) {\n if (!tag.canStartDiscussion()) return;\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 const parent = tag.parent();\n if (parent) {\n const index = this.selected.indexOf(parent);\n if (index === -1) {\n this.selected.push(parent);\n }\n }\n\n this.selected.push(tag);\n }\n\n /**\n * Remove the given tag from the list of selected tags.\n *\n * @param {Tag} tag\n */\n removeTag(tag) {\n const index = this.selected.indexOf(tag);\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 this.selected\n .filter(selected => selected.parent() === tag)\n .forEach(this.removeTag.bind(this));\n }\n }\n\n className() {\n return 'TagDiscussionModal';\n }\n\n title() {\n return this.props.discussion\n ? app.translator.trans('flarum-tags.forum.choose_tags.edit_title', {title: {this.props.discussion.title()}})\n : app.translator.trans('flarum-tags.forum.choose_tags.title');\n }\n\n getInstruction(primaryCount, secondaryCount) {\n if (primaryCount < this.minPrimary) {\n const remaining = this.minPrimary - primaryCount;\n return app.translator.transChoice('flarum-tags.forum.choose_tags.choose_primary_placeholder', remaining, {count: remaining});\n } else if (secondaryCount < this.minSecondary) {\n const remaining = this.minSecondary - secondaryCount;\n return app.translator.transChoice('flarum-tags.forum.choose_tags.choose_secondary_placeholder', remaining, {count: remaining});\n }\n\n return '';\n }\n\n content() {\n let tags = this.tags;\n const filter = this.filter().toLowerCase();\n const primaryCount = this.primaryCount();\n const secondaryCount = this.secondaryCount();\n\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 === false || this.selected.indexOf(parent) !== -1;\n });\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 if (primaryCount >= this.maxPrimary) {\n tags = tags.filter(tag => !tag.isPrimary() || this.selected.indexOf(tag) !== -1);\n }\n\n if (secondaryCount >= this.maxSecondary) {\n tags = tags.filter(tag => tag.isPrimary() || this.selected.indexOf(tag) !== -1);\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().substr(0, filter.length).toLowerCase() === filter);\n }\n\n if (tags.indexOf(this.index) === -1) this.index = tags[0];\n\n return [\n
\n
\n
\n
\n \n {this.selected.map(tag =>\n {\n this.removeTag(tag);\n this.onready();\n }}>\n {tagLabel(tag)}\n \n )}\n \n this.focused = true}\n onblur={() => this.focused = false}/>\n
\n
\n
\n {Button.component({\n type: 'submit',\n className: 'Button Button--primary',\n disabled: primaryCount < this.minPrimary || secondaryCount < this.minSecondary,\n icon: 'fas fa-check',\n children: app.translator.trans('flarum-tags.forum.choose_tags.submit_button')\n })}\n
\n
\n
,\n\n
\n
    \n {tags\n .filter(tag => filter || !tag.parent() || this.selected.indexOf(tag.parent()) !== -1)\n .map(tag => (\n
  • this.index = tag}\n onclick={this.toggleTag.bind(this, tag)}\n >\n {tagIcon(tag)}\n \n {highlight(tag.name(), filter)}\n \n {tag.description()\n ? (\n \n {tag.description()}\n \n ) : ''}\n
  • \n ))}\n
\n
\n ];\n }\n\n toggleTag(tag) {\n const index = this.selected.indexOf(tag);\n\n if (index !== -1) {\n this.removeTag(tag);\n } else {\n this.addTag(tag);\n }\n\n if (this.filter()) {\n this.filter('');\n this.index = this.tags[0];\n }\n\n this.onready();\n }\n\n select(e) {\n // Ctrl + Enter submits the selection, just Enter completes the current entry\n if (e.metaKey || e.ctrlKey || this.selected.indexOf(this.index) !== -1) {\n if (this.selected.length) {\n this.$('form').submit();\n }\n } else {\n this.getItem(this.index)[0].dispatchEvent(new Event('click'));\n }\n }\n\n selectableItems() {\n return this.$('.TagDiscussionModal-list > li');\n }\n\n getCurrentNumericIndex() {\n return this.selectableItems().index(\n this.getItem(this.index)\n );\n }\n\n getItem(index) {\n return this.selectableItems().filter(`[data-index=\"${index.id()}\"]`);\n }\n\n setIndex(index, scrollToItem) {\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.index = app.store.getById('tags', $item.attr('data-index'));\n\n m.redraw();\n\n if (scrollToItem) {\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 onsubmit(e) {\n e.preventDefault();\n\n const discussion = this.props.discussion;\n const tags = this.selected;\n\n if (discussion) {\n discussion.save({relationships: {tags}})\n .then(() => {\n if (app.current instanceof DiscussionPage) {\n app.current.stream.update();\n }\n m.redraw();\n });\n }\n\n if (this.props.onsubmit) this.props.onsubmit(tags);\n\n app.modal.close();\n\n m.redraw.strategy('none');\n }\n}\n","import { extend } from 'flarum/extend';\nimport DiscussionControls from 'flarum/utils/DiscussionControls';\nimport Button from 'flarum/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('tags', Button.component({\n children: app.translator.trans('flarum-tags.forum.discussion_controls.edit_tags_button'),\n icon: 'fas fa-tag',\n onclick: () => app.modal.show(new TagDiscussionModal({discussion}))\n }));\n }\n });\n}\n","import { extend, override } from 'flarum/extend';\nimport IndexPage from 'flarum/components/IndexPage';\nimport DiscussionComposer from 'flarum/components/DiscussionComposer';\n\nimport TagDiscussionModal from './components/TagDiscussionModal';\nimport tagsLabel from '../common/helpers/tagsLabel';\n\nexport default function() {\n extend(IndexPage.prototype, 'newDiscussionAction', function(promise) {\n const tag = app.store.getBy('tags', 'slug', this.params().tags);\n\n if (tag) {\n const parent = tag.parent();\n const tags = parent ? [parent, tag] : [tag];\n promise.then(component => component.tags = tags);\n }\n });\n\n // Add tag-selection abilities to the discussion composer.\n DiscussionComposer.prototype.tags = [];\n DiscussionComposer.prototype.chooseTags = function() {\n app.modal.show(\n new TagDiscussionModal({\n selectedTags: this.tags.slice(0),\n onsubmit: tags => {\n this.tags = tags;\n this.$('textarea').focus();\n }\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 items.add('tags', (\n \n {this.tags.length\n ? tagsLabel(this.tags)\n : {app.translator.trans('flarum-tags.forum.composer_discussion.choose_tags_link')}}\n \n ), 10);\n });\n\n override(DiscussionComposer.prototype, 'onsubmit', function(original) {\n const chosenTags = this.tags;\n const chosenPrimaryTags = chosenTags.filter(tag => tag.position() !== null && !tag.isChild());\n const chosenSecondaryTags = chosenTags.filter(tag => tag.position() === null);\n if (!chosenTags.length\n || (chosenPrimaryTags.length < app.forum.attribute('minPrimaryTags'))\n || (chosenSecondaryTags.length < app.forum.attribute('minSecondaryTags'))) {\n app.modal.show(\n new TagDiscussionModal({\n selectedTags: chosenTags,\n onsubmit: tags => {\n this.tags = tags;\n original();\n }\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.tags;\n });\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';\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};\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';\n\nexport default Object.assign(compat, {\n 'addTagFilter': addTagFilter,\n 'addTagControl': addTagControl,\n 'components/TagHero': TagHero,\n 'components/TagDiscussionModal': TagDiscussionModal,\n 'components/TagsPage': TagsPage,\n 'components/DiscussionTaggedPost': DiscussionTaggedPost,\n 'components/TagLinkButton': TagLinkButton,\n 'addTagList': addTagList,\n 'addTagLabels': addTagLabels,\n 'addTagComposer': addTagComposer,\n});\n","import Model from 'flarum/Model';\nimport Discussion from 'flarum/models/Discussion';\nimport IndexPage from 'flarum/components/IndexPage';\n\nimport Tag from '../common/models/Tag';\nimport TagsPage from './components/TagsPage';\nimport DiscussionTaggedPost from './components/DiscussionTaggedPost';\n\nimport addTagList from './addTagList';\nimport addTagFilter from './addTagFilter';\nimport addTagLabels from './addTagLabels';\nimport addTagControl from './addTagControl';\nimport addTagComposer from './addTagComposer';\n\napp.initializers.add('flarum-tags', function(app) {\n app.routes.tags = {path: '/tags', component: TagsPage.component()};\n app.routes.tag = {path: '/t/:tags', component: IndexPage.component()};\n\n app.route.tag = tag => app.route('tag', {tags: tag.slug()});\n\n app.postComponents.discussionTagged = DiscussionTaggedPost;\n\n app.store.models.tags = Tag;\n\n Discussion.prototype.tags = Model.hasMany('tags');\n Discussion.prototype.canTag = Model.attribute('canTag');\n\n addTagList();\n addTagFilter();\n addTagLabels();\n addTagControl();\n addTagComposer();\n});\n\n\n// Expose compat API\nimport tagsCompat from './compat';\nimport { compat } from '@flarum/core/forum';\n\nObject.assign(compat, tagsCompat);","module.exports = flarum.core.compat['helpers/listItems'];","module.exports = flarum.core.compat['helpers/humanTime'];","module.exports = flarum.core.compat['components/EventPost'];","module.exports = flarum.core.compat['components/Separator'];","module.exports = flarum.core.compat['components/DiscussionList'];","module.exports = flarum.core.compat['Component'];","module.exports = flarum.core.compat['components/DiscussionListItem'];","module.exports = flarum.core.compat['utils/DiscussionControls'];","module.exports = flarum.core.compat['helpers/highlight'];","module.exports = flarum.core.compat['utils/classList'];","module.exports = flarum.core.compat['utils/extractText'];","module.exports = flarum.core.compat['utils/KeyboardNavigatable'];","module.exports = flarum.core;","/*\n * This file is part of Flarum.\n *\n * (c) Toby Zerner \n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nexport * from './src/common';\nexport * from './src/forum';\n"],"sourceRoot":""} \ No newline at end of file