diff --git a/extensions/tags/js/dist/admin.js b/extensions/tags/js/dist/admin.js index 1ac2b9133..4d61dc759 100644 --- a/extensions/tags/js/dist/admin.js +++ b/extensions/tags/js/dist/admin.js @@ -1,2 +1,2 @@ -module.exports=function(t){var e={};function n(a){if(e[a])return e[a].exports;var r=e[a]={i:a,l:!1,exports:{}};return t[a].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,a){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:a})},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 a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(a,r,function(e){return t[e]}.bind(null,r));return a},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=49)}([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 a(t){return t.slice(0).sort(function(t,e){var n=t.position(),a=e.position();if(null===n&&null===a)return e.discussionCount()-t.discussionCount();if(null===a)return-1;if(null===n)return 1;var r=t.parent(),o=e.parent();return r===o?n-a:r&&o?r.position()-o.position():r?r===e?1:r.position()-a:o?o===t?-1:n-o.position():0})}n.d(e,"a",function(){return a})},function(t,e,n){"use strict";function a(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}n.d(e,"a",function(){return a})},function(t,e,n){"use strict";function a(t,e,n){void 0===e&&(e={}),void 0===n&&(n={});var a=t&&t.icon();return e.className=a?"icon "+t.icon()+" "+(e.className||""):"icon TagIcon "+(e.className||""),t?(e.style=e.style||{},a?e.style.color=n.disableColors?"":t.color():e.style.backgroundColor=t.color()):e.className+=" untagged",a?m("i",e):m("span",e)}n.d(e,"a",function(){return a})},function(t,e,n){"use strict";n.d(e,"a",function(){return i});var a=n(11),r=n.n(a),o=n(4);function i(t,e){void 0===e&&(e={}),e.style=e.style||{},e.className="TagLabel "+(e.className||"");var n=r()(e,"link"),a=t?t.name():app.translator.trans("flarum-tags.lib.deleted_tag_text");if(t){var i=t.color();i&&(e.style.backgroundColor=e.style.color=i,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.icon()&&Object(o.a)(t,{},{disableColors:!0})," ",a))}},,function(t,e,n){"use strict";n.d(e,"a",function(){return s});var a=n(11),r=n.n(a),o=n(5),i=n(2);function s(t,e){void 0===e&&(e={});var n=[],a=r()(e,"link");return e.className="TagsLabel "+(e.className||""),t?Object(i.a)(t).forEach(function(e){(e||1===t.length)&&n.push(Object(o.a)(e,{link:a}))}):n.push(Object(o.a)()),m("span",e,n)}},function(t,e){t.exports=flarum.core.compat["components/Button"]},function(t,e,n){"use strict";function a(){return(a=Object.assign||function(t){for(var e=1;e':e=document.createElement("div")),"string"==typeof n&&(a=e.classList).add.apply(a,n.split(" ")),e},U=function(t){if(!(t instanceof HTMLElement))throw new Error("You must provide a valid dom element");var e=window.getComputedStyle(t);return["height","padding-top","padding-bottom"].map(function(t){var n=parseInt(e.getPropertyValue(t),10);return isNaN(n)?0:n}).reduce(function(t,e){return t+e})},W=function(t,e){if(!(t instanceof Array))throw new Error("You must provide a Array of HTMLElements to be filtered.");return"string"!=typeof e?t:t.filter(function(t){return t.querySelector(e)instanceof HTMLElement||t.shadowRoot&&t.shadowRoot.querySelector(e)instanceof HTMLElement}).map(function(t){return t.querySelector(e)||t.shadowRoot&&t.shadowRoot.querySelector(e)})},z=function(t){return t.composedPath&&t.composedPath()[0]||t.target},X=function(t,e,n){return{element:t,posX:n.pageX-e.left,posY:n.pageY-e.top}},G=function(t,e,n){if(!(t instanceof Event))throw new Error("setDragImage requires a DragEvent as the first argument.");if(!(e instanceof HTMLElement))throw new Error("setDragImage requires the dragged element as the second argument.");if(n||(n=X),t.dataTransfer&&t.dataTransfer.setDragImage){var a=n(e,A(e),t);if(!(a.element instanceof HTMLElement)||"number"!=typeof a.posX||"number"!=typeof a.posY)throw new Error("The customDragImage function you provided must return and object with the properties element[string], posX[integer], posY[integer].");t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setData("text/plain",z(t).id),t.dataTransfer.setDragImage(a.element,a.posX,a.posY)}},V=function(t,e){if(!0===t.isSortable){var n=M(t).getConfig("acceptFrom");if(null!==n&&!1!==n&&"string"!=typeof n)throw new Error('HTML5Sortable: Wrong argument, "acceptFrom" must be "null", "false", or a valid selector string.');if(null!==n)return!1!==n&&n.split(",").filter(function(t){return t.length>0&&e.matches(t)}).length>0;if(t===e)return!0;if(void 0!==M(t).getConfig("connectWith")&&null!==M(t).getConfig("connectWith"))return M(t).getConfig("connectWith")===M(e).getConfig("connectWith")}return!1},J={items:null,connectWith:null,disableIEFix:null,acceptFrom:null,copy:!1,placeholder:null,placeholderClass:"sortable-placeholder",draggingClass:"sortable-dragging",hoverClass:!1,debounce:0,throttleTime:100,maxItems:0,itemSerializer:void 0,containerSerializer:void 0,customDragImage:null};var K,Q,Z,tt,et,nt,at,rt,ot=function(t,e){if("string"==typeof M(t).getConfig("hoverClass")){var n=M(t).getConfig("hoverClass").split(" ");!0===e?(D(t,"mousemove",function(t,e){var n=this;if(void 0===e&&(e=250),"function"!=typeof t)throw new Error("You must provide a function as the first argument for throttle.");if("number"!=typeof e)throw new Error("You must provide a number as the second argument for throttle.");var a=null;return function(){for(var r=[],o=0;o=e)&&(a=i,t.apply(n,r))}}(function(e){0===e.buttons&&N(t.children,M(t).getConfig("items")).forEach(function(t){var a,r;t!==e.target?(a=t.classList).remove.apply(a,n):(r=t.classList).add.apply(r,n)})},M(t).getConfig("throttleTime"))),D(t,"mouseleave",function(){N(t.children,M(t).getConfig("items")).forEach(function(t){var e;(e=t.classList).remove.apply(e,n)})})):(j(t,"mousemove"),j(t,"mouseleave"))}},it=function(t){j(t,"dragstart"),j(t,"dragend"),j(t,"dragover"),j(t,"dragenter"),j(t,"drop"),j(t,"mouseenter"),j(t,"mouseleave")},st=function(t,e){var n=t;return!0===M(e).getConfig("copy")&&(I(n=t.cloneNode(!0),"aria-copied","true"),t.parentElement.appendChild(n),n.style.display="none",n.oldDisplay=t.style.display),n},lt=function(t){var e;(e=t).h5s&&delete e.h5s.data,S(t,"aria-dropeffect")},ct=function(t){S(t,"aria-grabbed"),S(t,"aria-copied"),S(t,"draggable"),S(t,"role")};function ut(t,e){if(e.composedPath)return e.composedPath().find(function(t){return t.isSortable});for(;!0!==t.isSortable;)t=t.parentElement;return t}function dt(t,e){var n=C(t,"opts"),a=N(t.children,n.items).filter(function(t){return t.contains(e)||t.shadowRoot&&t.shadowRoot.contains(e)});return a.length>0?a[0]:e}var pt=function(t){var e=C(t,"opts"),n=N(t.children,e.items),a=W(n,e.handle);(I(t,"aria-dropeffect","move"),C(t,"_disabled","false"),I(a,"draggable","true"),!1===e.disableIEFix)&&("function"==typeof(document||window.document).createElement("span").dragDrop&&D(a,"mousedown",function(){if(-1!==n.indexOf(this))this.dragDrop();else{for(var t=this.parentElement;-1===n.indexOf(t);)t=t.parentElement;t.dragDrop()}}))},mt=function(t){var e=C(t,"opts"),n=N(t.children,e.items),a=W(n,e.handle);C(t,"_disabled","false"),it(n),j(a,"mousedown"),j(t,"dragover"),j(t,"dragenter"),j(t,"drop")};function ft(t,e){var n=String(e);return e=e||{},"string"==typeof t&&(t=document.querySelectorAll(t)),t instanceof HTMLElement&&(t=[t]),t=Array.prototype.slice.call(t),/serialize/.test(n)?t.map(function(t){var e=C(t,"opts");return R(t,e.itemSerializer,e.containerSerializer)}):(t.forEach(function(t){if(/enable|disable|destroy/.test(n))return ft[n](t);["connectWith","disableIEFix"].forEach(function(t){e.hasOwnProperty(t)&&null!==e[t]&&console.warn('HTML5Sortable: You are using the deprecated configuration "'+t+'". This will be removed in an upcoming version, make sure to migrate to the new options when updating.')}),e=Object.assign({},J,M(t).config,e),M(t).config=e,C(t,"opts",e),t.isSortable=!0,mt(t);var a,r=N(t.children,e.items);if(null!==e.placeholder&&void 0!==e.placeholder){var o=document.createElement(t.tagName);e.placeholder instanceof HTMLElement?o.appendChild(e.placeholder):o.innerHTML=e.placeholder,a=o.children[0]}M(t).placeholder=q(t,a,e.placeholderClass),C(t,"items",e.items),e.acceptFrom?C(t,"acceptFrom",e.acceptFrom):e.connectWith&&C(t,"connectWith",e.connectWith),pt(t),I(r,"role","option"),I(r,"aria-grabbed","false"),ot(t,!0),D(t,"dragstart",function(t){var n=z(t);if(!0!==n.isSortable&&(t.stopImmediatePropagation(),(!e.handle||n.matches(e.handle))&&"false"!==n.getAttribute("draggable"))){var a=ut(n,t),r=dt(a,n);nt=N(a.children,e.items),tt=nt.indexOf(r),et=H(r,a.children),Z=a,G(t,r,e.customDragImage),Q=U(r),r.classList.add(e.draggingClass),I(K=st(r,a),"aria-grabbed","true"),a.dispatchEvent(new CustomEvent("sortstart",{detail:{origin:{elementIndex:et,index:tt,container:Z},item:K,originalTarget:n}}))}}),D(t,"dragenter",function(e){var n=z(e),a=ut(n,e);a&&a!==at&&(rt=N(a.children,C(a,"items")).filter(function(e){return e!==M(t).placeholder}),a.dispatchEvent(new CustomEvent("sortenter",{detail:{origin:{elementIndex:et,index:tt,container:Z},destination:{container:a,itemsBeforeUpdate:rt},item:K,originalTarget:n}}))),at=a}),D(t,"dragend",function(n){if(K){K.classList.remove(e.draggingClass),I(K,"aria-grabbed","false"),"true"===K.getAttribute("aria-copied")&&"true"!==C(K,"dropped")&&K.remove(),K.style.display=K.oldDisplay,delete K.oldDisplay;var a=Array.from(L.values()).map(function(t){return t.placeholder}).filter(function(t){return t instanceof HTMLElement}).filter(F)[0];a&&a.remove(),t.dispatchEvent(new CustomEvent("sortstop",{detail:{origin:{elementIndex:et,index:tt,container:Z},item:K}})),at=null,K=null,Q=null}}),D(t,"drop",function(n){if(V(t,K.parentElement)){n.preventDefault(),n.stopPropagation(),C(K,"dropped","true");var a=Array.from(L.values()).map(function(t){return t.placeholder}).filter(function(t){return t instanceof HTMLElement}).filter(F)[0];Y(a,K),a.remove(),t.dispatchEvent(new CustomEvent("sortstop",{detail:{origin:{elementIndex:et,index:tt,container:Z},item:K}}));var r=M(t).placeholder,o=N(Z.children,e.items).filter(function(t){return t!==r}),i=!0===this.isSortable?this:this.parentElement,s=N(i.children,C(i,"items")).filter(function(t){return t!==r}),l=H(K,Array.from(K.parentElement.children).filter(function(t){return t!==r})),c=H(K,s);et===l&&Z===i||t.dispatchEvent(new CustomEvent("sortupdate",{detail:{origin:{elementIndex:et,index:tt,container:Z,itemsBeforeUpdate:nt,items:o},destination:{index:c,elementIndex:l,container:i,itemsBeforeUpdate:rt,items:s},item:K}}))}});var i=P(function(t,n,a){if(K)if(e.forcePlaceholderSize&&(M(t).placeholder.style.height=Q+"px"),Array.from(t.children).indexOf(n)>-1){var r=U(n),o=H(M(t).placeholder,n.parentElement.children),i=H(n,n.parentElement.children);if(r>Q){var s=r-Q,l=A(n).top;if(oi&&a>l+r-s)return}void 0===K.oldDisplay&&(K.oldDisplay=K.style.display),"none"!==K.style.display&&(K.style.display="none");var c=!1;try{c=a>=A(n).top+n.offsetHeight/2}catch(t){c=o=parseInt(a.maxItems)&&K.parentElement!==n||(t.preventDefault(),t.stopPropagation(),t.dataTransfer.dropEffect=!0===M(n).getConfig("copy")?"copy":"move",i(n,e,t.pageY))}};D(r.concat(t),"dragover",s),D(r.concat(t),"dragenter",s)}),t)}ft.destroy=function(t){!function(t){var e=C(t,"opts")||{},n=N(t.children,e.items),a=W(n,e.handle);j(t,"dragover"),j(t,"dragenter"),j(t,"drop"),lt(t),j(a,"mousedown"),it(n),ct(n)}(t)},ft.enable=function(t){pt(t)},ft.disable=function(t){!function(t){var e=C(t,"opts"),n=N(t.children,e.items),a=W(n,e.handle);I(t,"aria-dropeffect","none"),C(t,"_disabled","true"),I(a,"draggable","false"),j(a,"mousedown")}(t)},ft.__testing={_data:C,_removeItemEvents:it,_removeItemData:ct,_removeSortableData:lt};var gt=ft,ht=n(17),vt=n.n(ht),bt=n(18),yt=n.n(bt),_t=n(43),wt=n.n(_t),Et=n(44),Tt=function(t){function e(){return t.apply(this,arguments)||this}Object(x.a)(e,t);var n=e.prototype;return n.init=function(){t.prototype.init.call(this),this.tag=this.props.tag||app.store.createRecord("tags"),this.name=m.prop(this.tag.name()||""),this.slug=m.prop(this.tag.slug()||""),this.description=m.prop(this.tag.description()||""),this.color=m.prop(this.tag.color()||""),this.icon=m.prop(this.tag.icon()||""),this.isHidden=m.prop(this.tag.isHidden()||!1)},n.className=function(){return"EditTagModal Modal--small"},n.title=function(){return this.name()?Object(g.a)({name:this.name,color:this.color,icon:this.icon}):app.translator.trans("flarum-tags.admin.edit_tag.title")},n.content=function(){return m("div",{className:"Modal-body"},m("div",{className:"Form"},this.fields().toArray()))},n.fields=function(){var t=this,e=new wt.a;return e.add("name",m("div",{className:"Form-group"},m("label",null,app.translator.trans("flarum-tags.admin.edit_tag.name_label")),m("input",{className:"FormControl",placeholder:app.translator.trans("flarum-tags.admin.edit_tag.name_placeholder"),value:this.name(),oninput:function(e){t.name(e.target.value),t.slug(Object(Et.slug)(e.target.value))}})),50),e.add("slug",m("div",{className:"Form-group"},m("label",null,app.translator.trans("flarum-tags.admin.edit_tag.slug_label")),m("input",{className:"FormControl",value:this.slug(),oninput:m.withAttr("value",this.slug)})),40),e.add("description",m("div",{className:"Form-group"},m("label",null,app.translator.trans("flarum-tags.admin.edit_tag.description_label")),m("textarea",{className:"FormControl",value:this.description(),oninput:m.withAttr("value",this.description)})),30),e.add("color",m("div",{className:"Form-group"},m("label",null,app.translator.trans("flarum-tags.admin.edit_tag.color_label")),m("input",{className:"FormControl",placeholder:"#aaaaaa",value:this.color(),oninput:m.withAttr("value",this.color)})),20),e.add("icon",m("div",{className:"Form-group"},m("label",null,app.translator.trans("core.admin.edit_group.icon_label")),m("div",{className:"helpText"},app.translator.trans("core.admin.edit_group.icon_text",{a:m("a",{href:"https://fontawesome.com/icons?m=free",tabindex:"-1"})})),m("input",{className:"FormControl",placeholder:"fas fa-bolt",value:this.icon(),oninput:m.withAttr("value",this.icon)})),10),e.add("hidden",m("div",{className:"Form-group"},m("div",null,m("label",{className:"checkbox"},m("input",{type:"checkbox",value:"1",checked:this.isHidden(),onchange:m.withAttr("checked",this.isHidden)}),app.translator.trans("flarum-tags.admin.edit_tag.hide_label")))),10),e.add("submit",m("div",{className:"Form-group"},f.a.component({type:"submit",className:"Button Button--primary EditTagModal-save",loading:this.loading,children:app.translator.trans("flarum-tags.admin.edit_tag.submit_button")}),this.tag.exists?m("button",{type:"button",className:"Button EditTagModal-delete",onclick:this.delete.bind(this)},app.translator.trans("flarum-tags.admin.edit_tag.delete_tag_button")):""),-10),e},n.submitData=function(){return{name:this.name(),slug:this.slug(),description:this.description(),color:this.color(),icon:this.icon(),isHidden:this.isHidden()}},n.onsubmit=function(t){var e=this;t.preventDefault(),this.loading=!0,this.tag.save(this.submitData()).then(function(){return e.hide()},function(t){e.loading=!1,e.handleErrors(t)})},n.delete=function(){var t=this;if(confirm(app.translator.trans("flarum-tags.admin.edit_tag.delete_tag_confirmation"))){var e=app.store.all("tags").filter(function(e){return e.parent()===t.tag});this.tag.delete().then(function(){e.forEach(function(t){return t.pushData({attributes:{isChild:!1},relationships:{parent:null}})}),m.redraw()}),this.hide()}},e}(yt.a),xt=n(45),Ct=function(t){function e(){return t.apply(this,arguments)||this}Object(x.a)(e,t);var n=e.prototype;return n.setMinTags=function(t,e,n){t(n),e(Math.max(n,e()))},n.className=function(){return"TagSettingsModal Modal--small"},n.title=function(){return app.translator.trans("flarum-tags.admin.tag_settings.title")},n.form=function(){var t=this.setting("flarum-tags.min_primary_tags",0),e=this.setting("flarum-tags.max_primary_tags",0),n=this.setting("flarum-tags.min_secondary_tags",0),a=this.setting("flarum-tags.max_secondary_tags",0);return[m("div",{className:"Form-group"},m("label",null,app.translator.trans("flarum-tags.admin.tag_settings.required_primary_heading")),m("div",{className:"helpText"},app.translator.trans("flarum-tags.admin.tag_settings.required_primary_text")),m("div",{className:"TagSettingsModal-rangeInput"},m("input",{className:"FormControl",type:"number",min:"0",value:t(),oninput:m.withAttr("value",this.setMinTags.bind(this,t,e))}),app.translator.trans("flarum-tags.admin.tag_settings.range_separator_text"),m("input",{className:"FormControl",type:"number",min:t(),bidi:e}))),m("div",{className:"Form-group"},m("label",null,app.translator.trans("flarum-tags.admin.tag_settings.required_secondary_heading")),m("div",{className:"helpText"},app.translator.trans("flarum-tags.admin.tag_settings.required_secondary_text")),m("div",{className:"TagSettingsModal-rangeInput"},m("input",{className:"FormControl",type:"number",min:"0",value:n(),oninput:m.withAttr("value",this.setMinTags.bind(this,n,a))}),app.translator.trans("flarum-tags.admin.tag_settings.range_separator_text"),m("input",{className:"FormControl",type:"number",min:n(),bidi:a})))]},e}(n.n(xt).a);function Nt(t){return m("li",{"data-id":t.id(),style:{color:t.color()}},m("div",{className:"TagListItem-info"},Object(h.a)(t),m("span",{className:"TagListItem-name"},t.name()),f.a.component({className:"Button Button--link",icon:"fas fa-pencil-alt",onclick:function(){return app.modal.show(new Tt({tag:t}))}})),t.isChild()||null===t.position()?"":m("ol",{className:"TagListItem-children"},Object(v.a)(app.store.all("tags")).filter(function(e){return e.parent()===t}).map(Nt)))}var Lt=function(t){function e(){return t.apply(this,arguments)||this}Object(x.a)(e,t);var n=e.prototype;return n.view=function(){return m("div",{className:"TagsPage"},m("div",{className:"TagsPage-header"},m("div",{className:"container"},m("p",null,app.translator.trans("flarum-tags.admin.tags.about_tags_text")),f.a.component({className:"Button Button--primary",icon:"fas fa-plus",children:app.translator.trans("flarum-tags.admin.tags.create_tag_button"),onclick:function(){return app.modal.show(new Tt)}}),f.a.component({className:"Button",children:app.translator.trans("flarum-tags.admin.tags.settings_button"),onclick:function(){return app.modal.show(new Ct)}}))),m("div",{className:"TagsPage-list"},m("div",{className:"container"},m("div",{className:"TagGroup"},m("label",null,app.translator.trans("flarum-tags.admin.tags.primary_heading")),m("ol",{className:"TagList TagList--primary"},Object(v.a)(app.store.all("tags")).filter(function(t){return null!==t.position()&&!t.isChild()}).map(Nt))),m("div",{className:"TagGroup"},m("label",null,app.translator.trans("flarum-tags.admin.tags.secondary_heading")),m("ul",{className:"TagList"},app.store.all("tags").filter(function(t){return null===t.position()}).sort(function(t,e){return t.name().localeCompare(e.name())}).map(Nt))))))},n.config=function(){gt(this.$("ol, ul"),{acceptFrom:"ol,ul"}).forEach(this.onSortUpdate.bind(this))},n.onSortUpdate=function(t){var e=this;t.addEventListener("sortupdate",function(t){t.detail.origin.container instanceof HTMLOListElement&&t.detail.destination.container instanceof HTMLUListElement&&app.store.getById("tags",t.detail.item.getAttribute("data-id")).pushData({attributes:{position:null,isChild:!1},relationships:{parent:null}});var n=e.$(".TagList--primary > li").map(function(){return{id:$(this).data("id"),children:$(this).find("li").map(function(){return $(this).data("id")}).get()}}).get();n.forEach(function(t,e){var n=app.store.getById("tags",t.id);n.pushData({attributes:{position:e,isChild:!1},relationships:{parent:null}}),t.children.forEach(function(t,e){app.store.getById("tags",t).pushData({attributes:{position:e,isChild:!0},relationships:{parent:n}})})}),app.request({url:app.forum.attribute("apiUrl")+"/tags/order",method:"POST",data:{order:n}}),m.redraw.strategy("all"),m.redraw()})},e}(vt.a),Ot=function(){app.routes.tags={path:"/tags",component:Lt.component()},app.extensionSettings["flarum-tags"]=function(){return m.route(app.route("tags"))},Object(o.extend)(w.a.prototype,"items",function(t){t.add("tags",T.a.component({href:app.route("tags"),icon:"fas fa-tags",children:app.translator.trans("flarum-tags.admin.nav.tags_button"),description:app.translator.trans("flarum-tags.admin.nav.tags_text")}))})},Mt=n(46),Dt=n.n(Mt),jt=function(){Object(o.extend)(Dt.a.prototype,"homePageItems",function(t){t.add("tags",{path:"/tags",label:app.translator.trans("flarum-tags.admin.basics.tags_label")})})},It=n(47),St=n.n(It),At=function(){Object(o.extend)(s.a.prototype,"startItems",function(t){t.add("allowTagChange",{icon:"fas fa-tag",label:app.translator.trans("flarum-tags.admin.permissions.allow_edit_tags_label"),setting:function(){var t=parseInt(app.data.settings.allow_tag_change,10);return St.a.component({defaultLabel:t?app.translator.transChoice("core.admin.permissions_controls.allow_some_minutes_button",t,{count:t}):app.translator.trans("core.admin.permissions_controls.allow_indefinitely_button"),key:"allow_tag_change",options:[{value:"-1",label:app.translator.trans("core.admin.permissions_controls.allow_indefinitely_button")},{value:"10",label:app.translator.trans("core.admin.permissions_controls.allow_ten_minutes_button")},{value:"reply",label:app.translator.trans("core.admin.permissions_controls.allow_until_reply_button")}]})}},90)})},Pt=n(19),Ht=Object(a.a)(Pt.a,{"tags/addTagsHomePageOption":jt,"tags/addTagChangePermission":At,"tags/addTagsPane":Ot,"tags/components/TagSettingsModal":Ct,"tags/components/TagsPage":Lt,"tags/components/EditTagModal":Tt,"tags/addTagPermission":y,"tags/addTagsPermissionScope":b}),Ft=n(20);app.initializers.add("flarum-tags",function(t){t.store.models.tags=r.a,b(),y(),Ot(),jt(),At()}),Object(a.a)(Ft.compat,Ht)},,,,,,,,,,,,,function(t,e){t.exports=flarum.core.compat["components/PermissionDropdown"]},function(t,e){t.exports=flarum.core.compat["components/Dropdown"]},function(t,e){t.exports=flarum.core.compat["components/AdminNav"]},function(t,e){t.exports=flarum.core.compat["components/AdminLinkButton"]},function(t,e){t.exports=flarum.core.compat["utils/ItemList"]},function(t,e){t.exports=flarum.core.compat["utils/string"]},function(t,e){t.exports=flarum.core.compat["components/SettingsModal"]},function(t,e){t.exports=flarum.core.compat["components/BasicsPage"]},function(t,e){t.exports=flarum.core.compat["components/SettingDropdown"]},,function(t,e,n){"use strict";n.r(e);var a=n(14);for(var r in a)"default"!==r&&function(t){n.d(e,t,function(){return a[t]})}(r);n(26)}]); +module.exports=function(t){var e={};function n(a){if(e[a])return e[a].exports;var r=e[a]={i:a,l:!1,exports:{}};return t[a].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,a){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:a})},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 a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(a,r,function(e){return t[e]}.bind(null,r));return a},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=49)}([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 a(t){return t.slice(0).sort(function(t,e){var n=t.position(),a=e.position();if(null===n&&null===a)return e.discussionCount()-t.discussionCount();if(null===a)return-1;if(null===n)return 1;var r=t.parent(),o=e.parent();return r===o?n-a:r&&o?r.position()-o.position():r?r===e?1:r.position()-a:o?o===t?-1:n-o.position():0})}n.d(e,"a",function(){return a})},function(t,e,n){"use strict";function a(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}n.d(e,"a",function(){return a})},function(t,e,n){"use strict";function a(t,e,n){void 0===e&&(e={}),void 0===n&&(n={});var a=t&&t.icon();return e.className=a?"icon "+t.icon()+" "+(e.className||""):"icon TagIcon "+(e.className||""),t?(e.style=e.style||{},a?e.style.color=n.disableColors?"":t.color():e.style.backgroundColor=t.color()):e.className+=" untagged",a?m("i",e):m("span",e)}n.d(e,"a",function(){return a})},function(t,e,n){"use strict";n.d(e,"a",function(){return i});var a=n(11),r=n.n(a),o=n(4);function i(t,e){void 0===e&&(e={}),e.style=e.style||{},e.className="TagLabel "+(e.className||"");var n=r()(e,"link"),a=t?t.name():app.translator.trans("flarum-tags.lib.deleted_tag_text");if(t){var i=t.color();i&&(e.style.backgroundColor=e.style.color=i,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.icon()&&Object(o.a)(t,{},{disableColors:!0})," ",a))}},,function(t,e,n){"use strict";n.d(e,"a",function(){return s});var a=n(11),r=n.n(a),o=n(5),i=n(2);function s(t,e){void 0===e&&(e={});var n=[],a=r()(e,"link");return e.className="TagsLabel "+(e.className||""),t?Object(i.a)(t).forEach(function(e){(e||1===t.length)&&n.push(Object(o.a)(e,{link:a}))}):n.push(Object(o.a)()),m("span",e,n)}},function(t,e){t.exports=flarum.core.compat["components/Button"]},function(t,e,n){"use strict";function a(){return(a=Object.assign||function(t){for(var e=1;e':e=document.createElement("div")),"string"==typeof n&&(a=e.classList).add.apply(a,n.split(" ")),e},U=function(t){if(!(t instanceof HTMLElement))throw new Error("You must provide a valid dom element");var e=window.getComputedStyle(t);return["height","padding-top","padding-bottom"].map(function(t){var n=parseInt(e.getPropertyValue(t),10);return isNaN(n)?0:n}).reduce(function(t,e){return t+e})},W=function(t,e){if(!(t instanceof Array))throw new Error("You must provide a Array of HTMLElements to be filtered.");return"string"!=typeof e?t:t.filter(function(t){return t.querySelector(e)instanceof HTMLElement||t.shadowRoot&&t.shadowRoot.querySelector(e)instanceof HTMLElement}).map(function(t){return t.querySelector(e)||t.shadowRoot&&t.shadowRoot.querySelector(e)})},z=function(t){return t.composedPath&&t.composedPath()[0]||t.target},X=function(t,e,n){return{element:t,posX:n.pageX-e.left,posY:n.pageY-e.top}},G=function(t,e,n){if(!(t instanceof Event))throw new Error("setDragImage requires a DragEvent as the first argument.");if(!(e instanceof HTMLElement))throw new Error("setDragImage requires the dragged element as the second argument.");if(n||(n=X),t.dataTransfer&&t.dataTransfer.setDragImage){var a=n(e,A(e),t);if(!(a.element instanceof HTMLElement)||"number"!=typeof a.posX||"number"!=typeof a.posY)throw new Error("The customDragImage function you provided must return and object with the properties element[string], posX[integer], posY[integer].");t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setData("text/plain",z(t).id),t.dataTransfer.setDragImage(a.element,a.posX,a.posY)}},V=function(t,e){if(!0===t.isSortable){var n=M(t).getConfig("acceptFrom");if(null!==n&&!1!==n&&"string"!=typeof n)throw new Error('HTML5Sortable: Wrong argument, "acceptFrom" must be "null", "false", or a valid selector string.');if(null!==n)return!1!==n&&n.split(",").filter(function(t){return t.length>0&&e.matches(t)}).length>0;if(t===e)return!0;if(void 0!==M(t).getConfig("connectWith")&&null!==M(t).getConfig("connectWith"))return M(t).getConfig("connectWith")===M(e).getConfig("connectWith")}return!1},J={items:null,connectWith:null,disableIEFix:null,acceptFrom:null,copy:!1,placeholder:null,placeholderClass:"sortable-placeholder",draggingClass:"sortable-dragging",hoverClass:!1,debounce:0,throttleTime:100,maxItems:0,itemSerializer:void 0,containerSerializer:void 0,customDragImage:null};var K,Q,Z,tt,et,nt,at,rt,ot=function(t,e){if("string"==typeof M(t).getConfig("hoverClass")){var n=M(t).getConfig("hoverClass").split(" ");!0===e?(D(t,"mousemove",function(t,e){var n=this;if(void 0===e&&(e=250),"function"!=typeof t)throw new Error("You must provide a function as the first argument for throttle.");if("number"!=typeof e)throw new Error("You must provide a number as the second argument for throttle.");var a=null;return function(){for(var r=[],o=0;o=e)&&(a=i,t.apply(n,r))}}(function(e){0===e.buttons&&N(t.children,M(t).getConfig("items")).forEach(function(t){var a,r;t!==e.target?(a=t.classList).remove.apply(a,n):(r=t.classList).add.apply(r,n)})},M(t).getConfig("throttleTime"))),D(t,"mouseleave",function(){N(t.children,M(t).getConfig("items")).forEach(function(t){var e;(e=t.classList).remove.apply(e,n)})})):(j(t,"mousemove"),j(t,"mouseleave"))}},it=function(t){j(t,"dragstart"),j(t,"dragend"),j(t,"dragover"),j(t,"dragenter"),j(t,"drop"),j(t,"mouseenter"),j(t,"mouseleave")},st=function(t,e){var n=t;return!0===M(e).getConfig("copy")&&(I(n=t.cloneNode(!0),"aria-copied","true"),t.parentElement.appendChild(n),n.style.display="none",n.oldDisplay=t.style.display),n},lt=function(t){var e;(e=t).h5s&&delete e.h5s.data,S(t,"aria-dropeffect")},ct=function(t){S(t,"aria-grabbed"),S(t,"aria-copied"),S(t,"draggable"),S(t,"role")};function ut(t,e){if(e.composedPath)return e.composedPath().find(function(t){return t.isSortable});for(;!0!==t.isSortable;)t=t.parentElement;return t}function dt(t,e){var n=C(t,"opts"),a=N(t.children,n.items).filter(function(t){return t.contains(e)||t.shadowRoot&&t.shadowRoot.contains(e)});return a.length>0?a[0]:e}var pt=function(t){var e=C(t,"opts"),n=N(t.children,e.items),a=W(n,e.handle);(I(t,"aria-dropeffect","move"),C(t,"_disabled","false"),I(a,"draggable","true"),!1===e.disableIEFix)&&("function"==typeof(document||window.document).createElement("span").dragDrop&&D(a,"mousedown",function(){if(-1!==n.indexOf(this))this.dragDrop();else{for(var t=this.parentElement;-1===n.indexOf(t);)t=t.parentElement;t.dragDrop()}}))},mt=function(t){var e=C(t,"opts"),n=N(t.children,e.items),a=W(n,e.handle);C(t,"_disabled","false"),it(n),j(a,"mousedown"),j(t,"dragover"),j(t,"dragenter"),j(t,"drop")};function ft(t,e){var n=String(e);return e=e||{},"string"==typeof t&&(t=document.querySelectorAll(t)),t instanceof HTMLElement&&(t=[t]),t=Array.prototype.slice.call(t),/serialize/.test(n)?t.map(function(t){var e=C(t,"opts");return R(t,e.itemSerializer,e.containerSerializer)}):(t.forEach(function(t){if(/enable|disable|destroy/.test(n))return ft[n](t);["connectWith","disableIEFix"].forEach(function(t){e.hasOwnProperty(t)&&null!==e[t]&&console.warn('HTML5Sortable: You are using the deprecated configuration "'+t+'". This will be removed in an upcoming version, make sure to migrate to the new options when updating.')}),e=Object.assign({},J,M(t).config,e),M(t).config=e,C(t,"opts",e),t.isSortable=!0,mt(t);var a,r=N(t.children,e.items);if(null!==e.placeholder&&void 0!==e.placeholder){var o=document.createElement(t.tagName);e.placeholder instanceof HTMLElement?o.appendChild(e.placeholder):o.innerHTML=e.placeholder,a=o.children[0]}M(t).placeholder=q(t,a,e.placeholderClass),C(t,"items",e.items),e.acceptFrom?C(t,"acceptFrom",e.acceptFrom):e.connectWith&&C(t,"connectWith",e.connectWith),pt(t),I(r,"role","option"),I(r,"aria-grabbed","false"),ot(t,!0),D(t,"dragstart",function(t){var n=z(t);if(!0!==n.isSortable&&(t.stopImmediatePropagation(),(!e.handle||n.matches(e.handle))&&"false"!==n.getAttribute("draggable"))){var a=ut(n,t),r=dt(a,n);nt=N(a.children,e.items),tt=nt.indexOf(r),et=H(r,a.children),Z=a,G(t,r,e.customDragImage),Q=U(r),r.classList.add(e.draggingClass),I(K=st(r,a),"aria-grabbed","true"),a.dispatchEvent(new CustomEvent("sortstart",{detail:{origin:{elementIndex:et,index:tt,container:Z},item:K,originalTarget:n}}))}}),D(t,"dragenter",function(e){var n=z(e),a=ut(n,e);a&&a!==at&&(rt=N(a.children,C(a,"items")).filter(function(e){return e!==M(t).placeholder}),a.dispatchEvent(new CustomEvent("sortenter",{detail:{origin:{elementIndex:et,index:tt,container:Z},destination:{container:a,itemsBeforeUpdate:rt},item:K,originalTarget:n}}))),at=a}),D(t,"dragend",function(n){if(K){K.classList.remove(e.draggingClass),I(K,"aria-grabbed","false"),"true"===K.getAttribute("aria-copied")&&"true"!==C(K,"dropped")&&K.remove(),K.style.display=K.oldDisplay,delete K.oldDisplay;var a=Array.from(L.values()).map(function(t){return t.placeholder}).filter(function(t){return t instanceof HTMLElement}).filter(F)[0];a&&a.remove(),t.dispatchEvent(new CustomEvent("sortstop",{detail:{origin:{elementIndex:et,index:tt,container:Z},item:K}})),at=null,K=null,Q=null}}),D(t,"drop",function(n){if(V(t,K.parentElement)){n.preventDefault(),n.stopPropagation(),C(K,"dropped","true");var a=Array.from(L.values()).map(function(t){return t.placeholder}).filter(function(t){return t instanceof HTMLElement}).filter(F)[0];Y(a,K),a.remove(),t.dispatchEvent(new CustomEvent("sortstop",{detail:{origin:{elementIndex:et,index:tt,container:Z},item:K}}));var r=M(t).placeholder,o=N(Z.children,e.items).filter(function(t){return t!==r}),i=!0===this.isSortable?this:this.parentElement,s=N(i.children,C(i,"items")).filter(function(t){return t!==r}),l=H(K,Array.from(K.parentElement.children).filter(function(t){return t!==r})),c=H(K,s);et===l&&Z===i||t.dispatchEvent(new CustomEvent("sortupdate",{detail:{origin:{elementIndex:et,index:tt,container:Z,itemsBeforeUpdate:nt,items:o},destination:{index:c,elementIndex:l,container:i,itemsBeforeUpdate:rt,items:s},item:K}}))}});var i=P(function(t,n,a){if(K)if(e.forcePlaceholderSize&&(M(t).placeholder.style.height=Q+"px"),Array.from(t.children).indexOf(n)>-1){var r=U(n),o=H(M(t).placeholder,n.parentElement.children),i=H(n,n.parentElement.children);if(r>Q){var s=r-Q,l=A(n).top;if(oi&&a>l+r-s)return}void 0===K.oldDisplay&&(K.oldDisplay=K.style.display),"none"!==K.style.display&&(K.style.display="none");var c=!1;try{c=a>=A(n).top+n.offsetHeight/2}catch(t){c=o=parseInt(a.maxItems)&&K.parentElement!==n||(t.preventDefault(),t.stopPropagation(),t.dataTransfer.dropEffect=!0===M(n).getConfig("copy")?"copy":"move",i(n,e,t.pageY))}};D(r.concat(t),"dragover",s),D(r.concat(t),"dragenter",s)}),t)}ft.destroy=function(t){!function(t){var e=C(t,"opts")||{},n=N(t.children,e.items),a=W(n,e.handle);j(t,"dragover"),j(t,"dragenter"),j(t,"drop"),lt(t),j(a,"mousedown"),it(n),ct(n)}(t)},ft.enable=function(t){pt(t)},ft.disable=function(t){!function(t){var e=C(t,"opts"),n=N(t.children,e.items),a=W(n,e.handle);I(t,"aria-dropeffect","none"),C(t,"_disabled","true"),I(a,"draggable","false"),j(a,"mousedown")}(t)},ft.__testing={_data:C,_removeItemEvents:it,_removeItemData:ct,_removeSortableData:lt};var gt=ft,ht=n(17),vt=n.n(ht),bt=n(18),yt=n.n(bt),_t=n(43),wt=n.n(_t),Et=n(44),Tt=function(t){function e(){return t.apply(this,arguments)||this}Object(x.a)(e,t);var n=e.prototype;return n.init=function(){t.prototype.init.call(this),this.tag=this.props.tag||app.store.createRecord("tags"),this.name=m.prop(this.tag.name()||""),this.slug=m.prop(this.tag.slug()||""),this.description=m.prop(this.tag.description()||""),this.color=m.prop(this.tag.color()||""),this.icon=m.prop(this.tag.icon()||""),this.isHidden=m.prop(this.tag.isHidden()||!1)},n.className=function(){return"EditTagModal Modal--small"},n.title=function(){return this.name()?Object(g.a)({name:this.name,color:this.color,icon:this.icon}):app.translator.trans("flarum-tags.admin.edit_tag.title")},n.content=function(){return m("div",{className:"Modal-body"},m("div",{className:"Form"},this.fields().toArray()))},n.fields=function(){var t=this,e=new wt.a;return e.add("name",m("div",{className:"Form-group"},m("label",null,app.translator.trans("flarum-tags.admin.edit_tag.name_label")),m("input",{className:"FormControl",placeholder:app.translator.trans("flarum-tags.admin.edit_tag.name_placeholder"),value:this.name(),oninput:function(e){t.name(e.target.value),t.slug(Object(Et.slug)(e.target.value))}})),50),e.add("slug",m("div",{className:"Form-group"},m("label",null,app.translator.trans("flarum-tags.admin.edit_tag.slug_label")),m("input",{className:"FormControl",value:this.slug(),oninput:m.withAttr("value",this.slug)})),40),e.add("description",m("div",{className:"Form-group"},m("label",null,app.translator.trans("flarum-tags.admin.edit_tag.description_label")),m("textarea",{className:"FormControl",value:this.description(),oninput:m.withAttr("value",this.description)})),30),e.add("color",m("div",{className:"Form-group"},m("label",null,app.translator.trans("flarum-tags.admin.edit_tag.color_label")),m("input",{className:"FormControl",placeholder:"#aaaaaa",value:this.color(),oninput:m.withAttr("value",this.color)})),20),e.add("icon",m("div",{className:"Form-group"},m("label",null,app.translator.trans("flarum-tags.admin.edit_tag.icon_label")),m("div",{className:"helpText"},app.translator.trans("flarum-tags.admin.edit_tag.icon_text",{a:m("a",{href:"https://fontawesome.com/icons?m=free",tabindex:"-1"})})),m("input",{className:"FormControl",placeholder:"fas fa-bolt",value:this.icon(),oninput:m.withAttr("value",this.icon)})),10),e.add("hidden",m("div",{className:"Form-group"},m("div",null,m("label",{className:"checkbox"},m("input",{type:"checkbox",value:"1",checked:this.isHidden(),onchange:m.withAttr("checked",this.isHidden)}),app.translator.trans("flarum-tags.admin.edit_tag.hide_label")))),10),e.add("submit",m("div",{className:"Form-group"},f.a.component({type:"submit",className:"Button Button--primary EditTagModal-save",loading:this.loading,children:app.translator.trans("flarum-tags.admin.edit_tag.submit_button")}),this.tag.exists?m("button",{type:"button",className:"Button EditTagModal-delete",onclick:this.delete.bind(this)},app.translator.trans("flarum-tags.admin.edit_tag.delete_tag_button")):""),-10),e},n.submitData=function(){return{name:this.name(),slug:this.slug(),description:this.description(),color:this.color(),icon:this.icon(),isHidden:this.isHidden()}},n.onsubmit=function(t){var e=this;t.preventDefault(),this.loading=!0,this.tag.save(this.submitData()).then(function(){return e.hide()},function(t){e.loading=!1,e.handleErrors(t)})},n.delete=function(){var t=this;if(confirm(app.translator.trans("flarum-tags.admin.edit_tag.delete_tag_confirmation"))){var e=app.store.all("tags").filter(function(e){return e.parent()===t.tag});this.tag.delete().then(function(){e.forEach(function(t){return t.pushData({attributes:{isChild:!1},relationships:{parent:null}})}),m.redraw()}),this.hide()}},e}(yt.a),xt=n(45),Ct=function(t){function e(){return t.apply(this,arguments)||this}Object(x.a)(e,t);var n=e.prototype;return n.setMinTags=function(t,e,n){t(n),e(Math.max(n,e()))},n.className=function(){return"TagSettingsModal Modal--small"},n.title=function(){return app.translator.trans("flarum-tags.admin.tag_settings.title")},n.form=function(){var t=this.setting("flarum-tags.min_primary_tags",0),e=this.setting("flarum-tags.max_primary_tags",0),n=this.setting("flarum-tags.min_secondary_tags",0),a=this.setting("flarum-tags.max_secondary_tags",0);return[m("div",{className:"Form-group"},m("label",null,app.translator.trans("flarum-tags.admin.tag_settings.required_primary_heading")),m("div",{className:"helpText"},app.translator.trans("flarum-tags.admin.tag_settings.required_primary_text")),m("div",{className:"TagSettingsModal-rangeInput"},m("input",{className:"FormControl",type:"number",min:"0",value:t(),oninput:m.withAttr("value",this.setMinTags.bind(this,t,e))}),app.translator.trans("flarum-tags.admin.tag_settings.range_separator_text"),m("input",{className:"FormControl",type:"number",min:t(),bidi:e}))),m("div",{className:"Form-group"},m("label",null,app.translator.trans("flarum-tags.admin.tag_settings.required_secondary_heading")),m("div",{className:"helpText"},app.translator.trans("flarum-tags.admin.tag_settings.required_secondary_text")),m("div",{className:"TagSettingsModal-rangeInput"},m("input",{className:"FormControl",type:"number",min:"0",value:n(),oninput:m.withAttr("value",this.setMinTags.bind(this,n,a))}),app.translator.trans("flarum-tags.admin.tag_settings.range_separator_text"),m("input",{className:"FormControl",type:"number",min:n(),bidi:a})))]},e}(n.n(xt).a);function Nt(t){return m("li",{"data-id":t.id(),style:{color:t.color()}},m("div",{className:"TagListItem-info"},Object(h.a)(t),m("span",{className:"TagListItem-name"},t.name()),f.a.component({className:"Button Button--link",icon:"fas fa-pencil-alt",onclick:function(){return app.modal.show(new Tt({tag:t}))}})),t.isChild()||null===t.position()?"":m("ol",{className:"TagListItem-children"},Object(v.a)(app.store.all("tags")).filter(function(e){return e.parent()===t}).map(Nt)))}var Lt=function(t){function e(){return t.apply(this,arguments)||this}Object(x.a)(e,t);var n=e.prototype;return n.view=function(){return m("div",{className:"TagsPage"},m("div",{className:"TagsPage-header"},m("div",{className:"container"},m("p",null,app.translator.trans("flarum-tags.admin.tags.about_tags_text")),f.a.component({className:"Button Button--primary",icon:"fas fa-plus",children:app.translator.trans("flarum-tags.admin.tags.create_tag_button"),onclick:function(){return app.modal.show(new Tt)}}),f.a.component({className:"Button",children:app.translator.trans("flarum-tags.admin.tags.settings_button"),onclick:function(){return app.modal.show(new Ct)}}))),m("div",{className:"TagsPage-list"},m("div",{className:"container"},m("div",{className:"TagGroup"},m("label",null,app.translator.trans("flarum-tags.admin.tags.primary_heading")),m("ol",{className:"TagList TagList--primary"},Object(v.a)(app.store.all("tags")).filter(function(t){return null!==t.position()&&!t.isChild()}).map(Nt))),m("div",{className:"TagGroup"},m("label",null,app.translator.trans("flarum-tags.admin.tags.secondary_heading")),m("ul",{className:"TagList"},app.store.all("tags").filter(function(t){return null===t.position()}).sort(function(t,e){return t.name().localeCompare(e.name())}).map(Nt))))))},n.config=function(){gt(this.$("ol, ul"),{acceptFrom:"ol,ul"}).forEach(this.onSortUpdate.bind(this))},n.onSortUpdate=function(t){var e=this;t.addEventListener("sortupdate",function(t){t.detail.origin.container instanceof HTMLOListElement&&t.detail.destination.container instanceof HTMLUListElement&&app.store.getById("tags",t.detail.item.getAttribute("data-id")).pushData({attributes:{position:null,isChild:!1},relationships:{parent:null}});var n=e.$(".TagList--primary > li").map(function(){return{id:$(this).data("id"),children:$(this).find("li").map(function(){return $(this).data("id")}).get()}}).get();n.forEach(function(t,e){var n=app.store.getById("tags",t.id);n.pushData({attributes:{position:e,isChild:!1},relationships:{parent:null}}),t.children.forEach(function(t,e){app.store.getById("tags",t).pushData({attributes:{position:e,isChild:!0},relationships:{parent:n}})})}),app.request({url:app.forum.attribute("apiUrl")+"/tags/order",method:"POST",data:{order:n}}),m.redraw.strategy("all"),m.redraw()})},e}(vt.a),Ot=function(){app.routes.tags={path:"/tags",component:Lt.component()},app.extensionSettings["flarum-tags"]=function(){return m.route(app.route("tags"))},Object(o.extend)(w.a.prototype,"items",function(t){t.add("tags",T.a.component({href:app.route("tags"),icon:"fas fa-tags",children:app.translator.trans("flarum-tags.admin.nav.tags_button"),description:app.translator.trans("flarum-tags.admin.nav.tags_text")}))})},Mt=n(46),Dt=n.n(Mt),jt=function(){Object(o.extend)(Dt.a.prototype,"homePageItems",function(t){t.add("tags",{path:"/tags",label:app.translator.trans("flarum-tags.admin.basics.tags_label")})})},It=n(47),St=n.n(It),At=function(){Object(o.extend)(s.a.prototype,"startItems",function(t){t.add("allowTagChange",{icon:"fas fa-tag",label:app.translator.trans("flarum-tags.admin.permissions.allow_edit_tags_label"),setting:function(){var t=parseInt(app.data.settings.allow_tag_change,10);return St.a.component({defaultLabel:t?app.translator.transChoice("core.admin.permissions_controls.allow_some_minutes_button",t,{count:t}):app.translator.trans("core.admin.permissions_controls.allow_indefinitely_button"),key:"allow_tag_change",options:[{value:"-1",label:app.translator.trans("core.admin.permissions_controls.allow_indefinitely_button")},{value:"10",label:app.translator.trans("core.admin.permissions_controls.allow_ten_minutes_button")},{value:"reply",label:app.translator.trans("core.admin.permissions_controls.allow_until_reply_button")}]})}},90)})},Pt=n(19),Ht=Object(a.a)(Pt.a,{"tags/addTagsHomePageOption":jt,"tags/addTagChangePermission":At,"tags/addTagsPane":Ot,"tags/components/TagSettingsModal":Ct,"tags/components/TagsPage":Lt,"tags/components/EditTagModal":Tt,"tags/addTagPermission":y,"tags/addTagsPermissionScope":b}),Ft=n(20);app.initializers.add("flarum-tags",function(t){t.store.models.tags=r.a,b(),y(),Ot(),jt(),At()}),Object(a.a)(Ft.compat,Ht)},,,,,,,,,,,,,function(t,e){t.exports=flarum.core.compat["components/PermissionDropdown"]},function(t,e){t.exports=flarum.core.compat["components/Dropdown"]},function(t,e){t.exports=flarum.core.compat["components/AdminNav"]},function(t,e){t.exports=flarum.core.compat["components/AdminLinkButton"]},function(t,e){t.exports=flarum.core.compat["utils/ItemList"]},function(t,e){t.exports=flarum.core.compat["utils/string"]},function(t,e){t.exports=flarum.core.compat["components/SettingsModal"]},function(t,e){t.exports=flarum.core.compat["components/BasicsPage"]},function(t,e){t.exports=flarum.core.compat["components/SettingDropdown"]},,function(t,e,n){"use strict";n.r(e);var a=n(14);for(var r in a)"default"!==r&&function(t){n.d(e,t,function(){return a[t]})}(r);n(26)}]); //# sourceMappingURL=admin.js.map \ No newline at end of file diff --git a/extensions/tags/js/dist/admin.js.map b/extensions/tags/js/dist/admin.js.map index 1deb7486f..f276bd7d3 100644 --- a/extensions/tags/js/dist/admin.js.map +++ b/extensions/tags/js/dist/admin.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://@flarum/tags/webpack/bootstrap","webpack://@flarum/tags/external \"flarum.core.compat['Model']\"","webpack://@flarum/tags/external \"flarum.core.compat['extend']\"","webpack://@flarum/tags/./src/common/utils/sortTags.js","webpack://@flarum/tags/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@flarum/tags/./src/common/helpers/tagIcon.js","webpack://@flarum/tags/./src/common/helpers/tagLabel.js","webpack://@flarum/tags/./src/common/helpers/tagsLabel.js","webpack://@flarum/tags/external \"flarum.core.compat['components/Button']\"","webpack://@flarum/tags/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://@flarum/tags/./src/common/models/Tag.js","webpack://@flarum/tags/external \"flarum.core.compat['utils/extract']\"","webpack://@flarum/tags/external \"flarum.core.compat['components/PermissionGrid']\"","webpack://@flarum/tags/external \"flarum.core.compat['utils/mixin']\"","webpack://@flarum/tags/external \"flarum.core.compat['utils/computed']\"","webpack://@flarum/tags/external \"flarum.core.compat['components/Page']\"","webpack://@flarum/tags/external \"flarum.core.compat['components/Modal']\"","webpack://@flarum/tags/./src/common/compat.js","webpack://@flarum/tags/external \"flarum.core\"","webpack://@flarum/tags/./src/admin/addTagsPermissionScope.js","webpack://@flarum/tags/./src/admin/addTagPermission.js","webpack://@flarum/tags/./node_modules/html5sortable/dist/html5sortable.es.js","webpack://@flarum/tags/./src/admin/components/EditTagModal.js","webpack://@flarum/tags/./src/admin/components/TagSettingsModal.js","webpack://@flarum/tags/./src/admin/components/TagsPage.js","webpack://@flarum/tags/./src/admin/addTagsPane.js","webpack://@flarum/tags/./src/admin/addTagsHomePageOption.js","webpack://@flarum/tags/./src/admin/addTagChangePermission.js","webpack://@flarum/tags/./src/admin/compat.js","webpack://@flarum/tags/./src/admin/index.js","webpack://@flarum/tags/external \"flarum.core.compat['components/PermissionDropdown']\"","webpack://@flarum/tags/external \"flarum.core.compat['components/Dropdown']\"","webpack://@flarum/tags/external \"flarum.core.compat['components/AdminNav']\"","webpack://@flarum/tags/external \"flarum.core.compat['components/AdminLinkButton']\"","webpack://@flarum/tags/external \"flarum.core.compat['utils/ItemList']\"","webpack://@flarum/tags/external \"flarum.core.compat['utils/string']\"","webpack://@flarum/tags/external \"flarum.core.compat['components/SettingsModal']\"","webpack://@flarum/tags/external \"flarum.core.compat['components/BasicsPage']\"","webpack://@flarum/tags/external \"flarum.core.compat['components/SettingDropdown']\"","webpack://@flarum/tags/./admin.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","sortTags","tags","slice","sort","a","b","aPos","position","bPos","discussionCount","aParent","parent","bParent","__webpack_exports__","_inheritsLoose","subClass","superClass","constructor","__proto__","tagIcon","tag","attrs","settings","hasIcon","icon","className","style","color","disableColors","backgroundColor","tagLabel","flarum_utils_extract__WEBPACK_IMPORTED_MODULE_0__","flarum_utils_extract__WEBPACK_IMPORTED_MODULE_0___default","_tagIcon__WEBPACK_IMPORTED_MODULE_1__","link","extract","tagText","app","translator","trans","title","description","href","route","slug","config","tagsLabel","_tagLabel__WEBPACK_IMPORTED_MODULE_1__","_utils_sortTags__WEBPACK_IMPORTED_MODULE_2__","children","forEach","length","push","_extends","assign","target","arguments","source","apply","this","Tag","mixin","Model","attribute","backgroundUrl","backgroundMode","hasOne","defaultSort","isChild","isHidden","lastPostedAt","transformDate","lastPostedDiscussion","isRestricted","canStartDiscussion","canAddToDiscussion","isPrimary","computed","_utils_sortTags__WEBPACK_IMPORTED_MODULE_0__","_models_Tag__WEBPACK_IMPORTED_MODULE_1__","_helpers_tagsLabel__WEBPACK_IMPORTED_MODULE_2__","_helpers_tagIcon__WEBPACK_IMPORTED_MODULE_3__","_helpers_tagLabel__WEBPACK_IMPORTED_MODULE_4__","tags/utils/sortTags","tags/models/Tag","tags/helpers/tagsLabel","tags/helpers/tagIcon","tags/helpers/tagLabel","addTagsPermissionScope","override","original","permission","tagPrefix","match","substr","map","required","extend","PermissionGrid","items","store","all","filter","add","id","label","onremove","save","render","item","indexOf","PermissionDropdown","component","allowGuest","Dropdown","buttonClassName","caretIcon","Button","onclick","addTagPermission","addData","element","undefined","h5s","data","_filter","nodes","selector","NodeList","HTMLCollection","Array","Error","from","nodeType","matches","stores","Map","Store","_config","_placeholder","_data","set","mergedConfig","entries","configurable","setConfig","has","getConfig","placeholder","HTMLElement","setData","getData","deleteData","delete","sortableElement","addEventListener","eventName","callback","removeEventListener","addAttribute","setAttribute","removeAttribute","_offset","parentElement","getClientRects","rect","left","window","pageXOffset","right","top","pageYOffset","bottom","_debounce","func","wait","timeout","args","_i","clearTimeout","setTimeout","_index","elementList","isInDom","parentNode","insertNode","referenceNode","newElement","insertBefore","nextElementSibling","insertAfter","_serialize","sortableContainer","customItemSerializer","customContainerSerializer","serializedItem","serializedContainer","isSortable","serializedItems","node","html","outerHTML","index","container","itemCount","_makePlaceholder","placeholderClass","_a","includes","tagName","document","createElement","innerHTML","classList","split","_getElementHeight","getComputedStyle","int","parseInt","getPropertyValue","isNaN","reduce","sum","_getHandles","querySelector","shadowRoot","getEventTarget","event","composedPath","defaultDragImage","draggedElement","elementOffset","posX","pageX","posY","pageY","setDragImage","customDragImage","Event","dataTransfer","dragImage","effectAllowed","_listsConnected","destination","origin","acceptFrom","sel","defaultConfiguration","connectWith","disableIEFix","copy","draggingClass","hoverClass","debounce","throttleTime","maxItems","itemSerializer","containerSerializer","dragging","draggingHeight","originContainer","originIndex","originElementIndex","originItemsBeforeUpdate","previousContainer","destinationItemsBeforeUpdate","enableHoverClass","enable","hoverClasses_1","fn","threshold","_this","lastEventTimestamp","now","Date","_throttle","buttons","_b","remove","_removeItemEvents","_getDragging","draggedItem","sortable","ditem","cloneNode","appendChild","display","oldDisplay","_removeSortableData","_removeItemData","findSortable","find","el","findDragElement","options","itemlist","ele","contains","_enableSortable","opts","handles","handle","dragDrop","_reloadSortable","sortableElements","method","String","querySelectorAll","test","configKey","console","warn","customPlaceholder","listItems","tempContainer","e","stopImmediatePropagation","getAttribute","dragItem","dispatchEvent","CustomEvent","detail","elementIndex","originalTarget","itemsBeforeUpdate","visiblePlaceholder","values","preventDefault","stopPropagation","originItems","destinationContainer","destinationItems","destinationElementIndex","destinationIndex","debouncedDragOverEnter","forcePlaceholderSize","height","thisHeight","placeholderIndex","thisIndex","deadZone","offsetTop","placeAfter","offsetHeight","placeholders","onDragOverEnter","dropEffect","concat","destroy","_destroySortable","disable","_disableSortable","__testing","html5sortable_es","EditTagModal","init","_Modal","props","createRecord","prop","content","fields","toArray","ItemList","oninput","withAttr","tabindex","type","checked","onchange","loading","exists","submitData","onsubmit","_this2","then","hide","response","handleErrors","_this3","confirm","pushData","attributes","relationships","redraw","Modal","TagSettingsModal","setMinTags","minTags","maxTags","Math","max","form","minPrimaryTags","setting","maxPrimaryTags","minSecondaryTags","maxSecondaryTags","min","bidi","SettingsModal","tagItem","data-id","modal","show","child","TagsPage","view","localeCompare","$","onSortUpdate","HTMLOListElement","HTMLUListElement","getById","order","j","request","url","forum","strategy","Page","addTagsPane","routes","path","extensionSettings","AdminNav","AdminLinkButton","addTagsHomePageOption","BasicsPage","addTagChangePermission","minutes","allow_tag_change","SettingDropdown","defaultLabel","transChoice","count","admin_compat","esm_extends","tags/addTagsHomePageOption","tags/addTagChangePermission","tags/addTagsPane","tags/components/TagSettingsModal","tags/components/TagsPage","tags/components/EditTagModal","tags/addTagPermission","tags/addTagsPermissionScope","initializers","models","tagsCompat","_src_common__WEBPACK_IMPORTED_MODULE_0__","__WEBPACK_IMPORT_KEY__"],"mappings":"2BACA,IAAAA,EAAA,GAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,E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A4BpC,GAC5BqC,+BAAgCzF,GAChC0F,wBAAyBrU,EACzBsU,8BAA+BrW,aCZjCnD,IAAIyZ,aAAavV,IAAI,cAAe,SAAAlE,GAClCA,EAAI+D,MAAM2V,OAAO9b,KAAO2D,IAExB4B,IACA+B,IACA8S,KACAM,KACAE,OAQFtc,OAAA8c,EAAA,EAAA9c,CAAcwB,UAAQic,+BCtBtBpe,EAAAD,QAAAkC,OAAAC,KAAAC,OAAA,gDCAAnC,EAAAD,QAAAkC,OAAAC,KAAAC,OAAA,sCCAAnC,EAAAD,QAAAkC,OAAAC,KAAAC,OAAA,sCCAAnC,EAAAD,QAAAkC,OAAAC,KAAAC,OAAA,6CCAAnC,EAAAD,QAAAkC,OAAAC,KAAAC,OAAA,iCCAAnC,EAAAD,QAAAkC,OAAAC,KAAAC,OAAA,+BCAAnC,EAAAD,QAAAkC,OAAAC,KAAAC,OAAA,2CCAAnC,EAAAD,QAAAkC,OAAAC,KAAAC,OAAA,wCCAAnC,EAAAD,QAAAkC,OAAAC,KAAAC,OAAA,6DCAAtC,EAAAkB,EAAAkC,GAAA,IAAAob,EAAAxe,EAAA,YAAAye,KAAAD,EAAA,YAAAC,GAAA,SAAA9c,GAAA3B,EAAAU,EAAA0C,EAAAzB,EAAA,kBAAA6c,EAAA7c,KAAA,CAAA8c,GAAAze,EAAA","file":"admin.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 49);\n","module.exports = flarum.core.compat['Model'];","module.exports = flarum.core.compat['extend'];","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","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 tagIcon(tag, attrs = {}, settings = {}) {\n const hasIcon = tag && tag.icon();\n\n attrs.className = hasIcon ? 'icon ' + tag.icon() + ' ' + (attrs.className || '') : 'icon TagIcon ' + (attrs.className || '');\n\n if (tag) {\n attrs.style = attrs.style || {};\n\n if (hasIcon) {\n attrs.style.color = settings.disableColors ? '' : tag.color();\n } else {\n attrs.style.backgroundColor = tag.color();\n }\n\n } else {\n attrs.className += ' untagged';\n }\n\n return hasIcon ? : ;\n}\n","import extract from 'flarum/utils/extract';\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 let 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.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 return (\n m((link ? 'a' : 'span'), attrs,\n \n {tag.icon() && tagIcon(tag, {}, {disableColors: true})} {tagText}\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","module.exports = flarum.core.compat['components/Button'];","export default function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}","import 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 icon: Model.attribute('icon'),\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/PermissionGrid'];","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'];","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","module.exports = flarum.core;","import { extend, override } from 'flarum/extend';\nimport PermissionGrid from 'flarum/components/PermissionGrid';\nimport PermissionDropdown from 'flarum/components/PermissionDropdown';\nimport Dropdown from 'flarum/components/Dropdown';\nimport Button from 'flarum/components/Button';\n\nimport tagLabel from '../common/helpers/tagLabel';\nimport tagIcon from '../common/helpers/tagIcon';\nimport sortTags from '../common/utils/sortTags';\n\nexport default function() {\n override(app, 'getRequiredPermissions', (original, permission) => {\n const tagPrefix = permission.match(/^tag\\d+\\./);\n\n if (tagPrefix) {\n const globalPermission = permission.substr(tagPrefix[0].length);\n\n const required = original(globalPermission);\n\n return required.map(required => tagPrefix[0] + required);\n }\n\n return original(permission);\n });\n\n extend(PermissionGrid.prototype, 'scopeItems', items => {\n sortTags(app.store.all('tags'))\n .filter(tag => tag.isRestricted())\n .forEach(tag => items.add('tag' + tag.id(), {\n label: tagLabel(tag),\n onremove: () => tag.save({isRestricted: false}),\n render: item => {\n if (item.permission === 'viewDiscussions'\n || item.permission === 'startDiscussion'\n || (item.permission && item.permission.indexOf('discussion.') === 0)) {\n return PermissionDropdown.component({\n permission: 'tag' + tag.id() + '.' + item.permission,\n allowGuest: item.allowGuest\n });\n }\n\n return '';\n }\n }));\n });\n\n extend(PermissionGrid.prototype, 'scopeControlItems', items => {\n const tags = sortTags(app.store.all('tags').filter(tag => !tag.isRestricted()));\n\n if (tags.length) {\n items.add('tag', Dropdown.component({\n className: 'Dropdown--restrictByTag',\n buttonClassName: 'Button Button--text',\n label: app.translator.trans('flarum-tags.admin.permissions.restrict_by_tag_heading'),\n icon: 'fas fa-plus',\n caretIcon: null,\n children: tags.map(tag => Button.component({\n icon: true,\n children: [tagIcon(tag, {className: 'Button-icon'}), ' ', tag.name()],\n onclick: () => tag.save({isRestricted: true})\n }))\n }));\n }\n });\n}\n","import { extend } from 'flarum/extend';\nimport PermissionGrid from 'flarum/components/PermissionGrid';\n\nexport default function() {\n extend(PermissionGrid.prototype, 'moderateItems', items => {\n items.add('tag', {\n icon: 'fas fa-tag',\n label: app.translator.trans('flarum-tags.admin.permissions.tag_discussions_label'),\n permission: 'discussion.tag'\n }, 95);\n });\n}\n","/*\n * HTML5Sortable package\n * https://github.com/lukasoppermann/html5sortable\n *\n * Maintained by Lukas Oppermann \n *\n * Released under the MIT license.\n */\n/**\n * Get or set data on element\n * @param {HTMLElement} element\n * @param {string} key\n * @param {any} value\n * @return {*}\n */\nfunction addData(element, key, value) {\n if (value === undefined) {\n return element && element.h5s && element.h5s.data && element.h5s.data[key];\n }\n else {\n element.h5s = element.h5s || {};\n element.h5s.data = element.h5s.data || {};\n element.h5s.data[key] = value;\n }\n}\n/**\n * Remove data from element\n * @param {HTMLElement} element\n */\nfunction removeData(element) {\n if (element.h5s) {\n delete element.h5s.data;\n }\n}\n\n/* eslint-env browser */\n/**\n * Filter only wanted nodes\n * @param {NodeList|HTMLCollection|Array} nodes\n * @param {String} selector\n * @returns {Array}\n */\nvar _filter = (function (nodes, selector) {\n if (!(nodes instanceof NodeList || nodes instanceof HTMLCollection || nodes instanceof Array)) {\n throw new Error('You must provide a nodeList/HTMLCollection/Array of elements to be filtered.');\n }\n if (typeof selector !== 'string') {\n return Array.from(nodes);\n }\n return Array.from(nodes).filter(function (item) { return item.nodeType === 1 && item.matches(selector); });\n});\n\n/* eslint-env browser */\nvar stores = new Map();\n/**\n * Stores data & configurations per Sortable\n * @param {Object} config\n */\nvar Store = /** @class */ (function () {\n function Store() {\n this._config = new Map(); // eslint-disable-line no-undef\n this._placeholder = undefined; // eslint-disable-line no-undef\n this._data = new Map(); // eslint-disable-line no-undef\n }\n Object.defineProperty(Store.prototype, \"config\", {\n /**\n * get the configuration map of a class instance\n * @method config\n * @return {object}\n */\n get: function () {\n // transform Map to object\n var config = {};\n this._config.forEach(function (value, key) {\n config[key] = value;\n });\n // return object\n return config;\n },\n /**\n * set the configuration of a class instance\n * @method config\n * @param {object} config object of configurations\n */\n set: function (config) {\n if (typeof config !== 'object') {\n throw new Error('You must provide a valid configuration object to the config setter.');\n }\n // combine config with default\n var mergedConfig = Object.assign({}, config);\n // add config to map\n this._config = new Map(Object.entries(mergedConfig));\n },\n enumerable: true,\n configurable: true\n });\n /**\n * set individual configuration of a class instance\n * @method setConfig\n * @param key valid configuration key\n * @param value any value\n * @return void\n */\n Store.prototype.setConfig = function (key, value) {\n if (!this._config.has(key)) {\n throw new Error(\"Trying to set invalid configuration item: \" + key);\n }\n // set config\n this._config.set(key, value);\n };\n /**\n * get an individual configuration of a class instance\n * @method getConfig\n * @param key valid configuration key\n * @return any configuration value\n */\n Store.prototype.getConfig = function (key) {\n if (!this._config.has(key)) {\n throw new Error(\"Invalid configuration item requested: \" + key);\n }\n return this._config.get(key);\n };\n Object.defineProperty(Store.prototype, \"placeholder\", {\n /**\n * get the placeholder for a class instance\n * @method placeholder\n * @return {HTMLElement|null}\n */\n get: function () {\n return this._placeholder;\n },\n /**\n * set the placeholder for a class instance\n * @method placeholder\n * @param {HTMLElement} placeholder\n * @return {void}\n */\n set: function (placeholder) {\n if (!(placeholder instanceof HTMLElement) && placeholder !== null) {\n throw new Error('A placeholder must be an html element or null.');\n }\n this._placeholder = placeholder;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * set an data entry\n * @method setData\n * @param {string} key\n * @param {any} value\n * @return {void}\n */\n Store.prototype.setData = function (key, value) {\n if (typeof key !== 'string') {\n throw new Error(\"The key must be a string.\");\n }\n this._data.set(key, value);\n };\n /**\n * get an data entry\n * @method getData\n * @param {string} key an existing key\n * @return {any}\n */\n Store.prototype.getData = function (key) {\n if (typeof key !== 'string') {\n throw new Error(\"The key must be a string.\");\n }\n return this._data.get(key);\n };\n /**\n * delete an data entry\n * @method deleteData\n * @param {string} key an existing key\n * @return {boolean}\n */\n Store.prototype.deleteData = function (key) {\n if (typeof key !== 'string') {\n throw new Error(\"The key must be a string.\");\n }\n return this._data.delete(key);\n };\n return Store;\n}());\n/**\n * @param {HTMLElement} sortableElement\n * @returns {Class: Store}\n */\nvar store = (function (sortableElement) {\n // if sortableElement is wrong type\n if (!(sortableElement instanceof HTMLElement)) {\n throw new Error('Please provide a sortable to the store function.');\n }\n // create new instance if not avilable\n if (!stores.has(sortableElement)) {\n stores.set(sortableElement, new Store());\n }\n // return instance\n return stores.get(sortableElement);\n});\n\n/**\n * @param {Array|HTMLElement} element\n * @param {Function} callback\n * @param {string} event\n */\nfunction addEventListener(element, eventName, callback) {\n if (element instanceof Array) {\n for (var i = 0; i < element.length; ++i) {\n addEventListener(element[i], eventName, callback);\n }\n return;\n }\n element.addEventListener(eventName, callback);\n store(element).setData(\"event\" + eventName, callback);\n}\n/**\n * @param {Array|HTMLElement} element\n * @param {string} eventName\n */\nfunction removeEventListener(element, eventName) {\n if (element instanceof Array) {\n for (var i = 0; i < element.length; ++i) {\n removeEventListener(element[i], eventName);\n }\n return;\n }\n element.removeEventListener(eventName, store(element).getData(\"event\" + eventName));\n store(element).deleteData(\"event\" + eventName);\n}\n\n/**\n * @param {Array|HTMLElement} element\n * @param {string} attribute\n * @param {string} value\n */\nfunction addAttribute(element, attribute, value) {\n if (element instanceof Array) {\n for (var i = 0; i < element.length; ++i) {\n addAttribute(element[i], attribute, value);\n }\n return;\n }\n element.setAttribute(attribute, value);\n}\n/**\n * @param {Array|HTMLElement} element\n * @param {string} attribute\n */\nfunction removeAttribute(element, attribute) {\n if (element instanceof Array) {\n for (var i = 0; i < element.length; ++i) {\n removeAttribute(element[i], attribute);\n }\n return;\n }\n element.removeAttribute(attribute);\n}\n\n/**\n * @param {HTMLElement} element\n * @returns {Object}\n */\nvar _offset = (function (element) {\n if (!element.parentElement || element.getClientRects().length === 0) {\n throw new Error('target element must be part of the dom');\n }\n var rect = element.getClientRects()[0];\n return {\n left: rect.left + window.pageXOffset,\n right: rect.right + window.pageXOffset,\n top: rect.top + window.pageYOffset,\n bottom: rect.bottom + window.pageYOffset\n };\n});\n\n/**\n * Creates and returns a new debounced version of the passed function which will postpone its execution until after wait milliseconds have elapsed\n * @param {Function} func to debounce\n * @param {number} time to wait before calling function with latest arguments, 0 - no debounce\n * @returns {function} - debounced function\n */\nvar _debounce = (function (func, wait) {\n if (wait === void 0) { wait = 0; }\n var timeout;\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n clearTimeout(timeout);\n timeout = setTimeout(function () {\n func.apply(void 0, args);\n }, wait);\n };\n});\n\n/* eslint-env browser */\n/**\n * Get position of the element relatively to its sibling elements\n * @param {HTMLElement} element\n * @returns {number}\n */\nvar _index = (function (element, elementList) {\n if (!(element instanceof HTMLElement) || !(elementList instanceof NodeList || elementList instanceof HTMLCollection || elementList instanceof Array)) {\n throw new Error('You must provide an element and a list of elements.');\n }\n return Array.from(elementList).indexOf(element);\n});\n\n/* eslint-env browser */\n/**\n * Test whether element is in DOM\n * @param {HTMLElement} element\n * @returns {boolean}\n */\nvar isInDom = (function (element) {\n if (!(element instanceof HTMLElement)) {\n throw new Error('Element is not a node element.');\n }\n return element.parentNode !== null;\n});\n\n/* eslint-env browser */\n/**\n * Insert node before or after target\n * @param {HTMLElement} referenceNode - reference element\n * @param {HTMLElement} newElement - element to be inserted\n * @param {String} position - insert before or after reference element\n */\nvar insertNode = function (referenceNode, newElement, position) {\n if (!(referenceNode instanceof HTMLElement) || !(referenceNode.parentElement instanceof HTMLElement)) {\n throw new Error('target and element must be a node');\n }\n referenceNode.parentElement.insertBefore(newElement, (position === 'before' ? referenceNode : referenceNode.nextElementSibling));\n};\n/**\n * Insert before target\n * @param {HTMLElement} target\n * @param {HTMLElement} element\n */\nvar insertBefore = function (target, element) { return insertNode(target, element, 'before'); };\n/**\n * Insert after target\n * @param {HTMLElement} target\n * @param {HTMLElement} element\n */\nvar insertAfter = function (target, element) { return insertNode(target, element, 'after'); };\n\n/* eslint-env browser */\n/**\n * Filter only wanted nodes\n * @param {HTMLElement} sortableContainer\n * @param {Function} customSerializer\n * @returns {Array}\n */\nvar _serialize = (function (sortableContainer, customItemSerializer, customContainerSerializer) {\n if (customItemSerializer === void 0) { customItemSerializer = function (serializedItem, sortableContainer) { return serializedItem; }; }\n if (customContainerSerializer === void 0) { customContainerSerializer = function (serializedContainer) { return serializedContainer; }; }\n // check for valid sortableContainer\n if (!(sortableContainer instanceof HTMLElement) || !sortableContainer.isSortable === true) {\n throw new Error('You need to provide a sortableContainer to be serialized.');\n }\n // check for valid serializers\n if (typeof customItemSerializer !== 'function' || typeof customContainerSerializer !== 'function') {\n throw new Error('You need to provide a valid serializer for items and the container.');\n }\n // get options\n var options = addData(sortableContainer, 'opts');\n var item = options.items;\n // serialize container\n var items = _filter(sortableContainer.children, item);\n var serializedItems = items.map(function (item) {\n return {\n parent: sortableContainer,\n node: item,\n html: item.outerHTML,\n index: _index(item, items)\n };\n });\n // serialize container\n var container = {\n node: sortableContainer,\n itemCount: serializedItems.length\n };\n return {\n container: customContainerSerializer(container),\n items: serializedItems.map(function (item) { return customItemSerializer(item, sortableContainer); })\n };\n});\n\n/* eslint-env browser */\n/**\n * create a placeholder element\n * @param {HTMLElement} sortableElement a single sortable\n * @param {string|undefined} placeholder a string representing an html element\n * @param {string} placeholderClasses a string representing the classes that should be added to the placeholder\n */\nvar _makePlaceholder = (function (sortableElement, placeholder, placeholderClass) {\n var _a;\n if (placeholderClass === void 0) { placeholderClass = 'sortable-placeholder'; }\n if (!(sortableElement instanceof HTMLElement)) {\n throw new Error('You must provide a valid element as a sortable.');\n }\n // if placeholder is not an element\n if (!(placeholder instanceof HTMLElement) && placeholder !== undefined) {\n throw new Error('You must provide a valid element as a placeholder or set ot to undefined.');\n }\n // if no placeholder element is given\n if (placeholder === undefined) {\n if (['UL', 'OL'].includes(sortableElement.tagName)) {\n placeholder = document.createElement('li');\n }\n else if (['TABLE', 'TBODY'].includes(sortableElement.tagName)) {\n placeholder = document.createElement('tr');\n // set colspan to always all rows, otherwise the item can only be dropped in first column\n placeholder.innerHTML = '';\n }\n else {\n placeholder = document.createElement('div');\n }\n }\n // add classes to placeholder\n if (typeof placeholderClass === 'string') {\n (_a = placeholder.classList).add.apply(_a, placeholderClass.split(' '));\n }\n return placeholder;\n});\n\n/* eslint-env browser */\n/**\n * Get height of an element including padding\n * @param {HTMLElement} element an dom element\n */\nvar _getElementHeight = (function (element) {\n if (!(element instanceof HTMLElement)) {\n throw new Error('You must provide a valid dom element');\n }\n // get calculated style of element\n var style = window.getComputedStyle(element);\n // pick applicable properties, convert to int and reduce by adding\n return ['height', 'padding-top', 'padding-bottom']\n .map(function (key) {\n var int = parseInt(style.getPropertyValue(key), 10);\n return isNaN(int) ? 0 : int;\n })\n .reduce(function (sum, value) { return sum + value; });\n});\n\n/* eslint-env browser */\n/**\n * get handle or return item\n * @param {Array} items\n * @param {string} selector\n */\nvar _getHandles = (function (items, selector) {\n if (!(items instanceof Array)) {\n throw new Error('You must provide a Array of HTMLElements to be filtered.');\n }\n if (typeof selector !== 'string') {\n return items;\n }\n return items\n // remove items without handle from array\n .filter(function (item) {\n return item.querySelector(selector) instanceof HTMLElement ||\n (item.shadowRoot && item.shadowRoot.querySelector(selector) instanceof HTMLElement);\n })\n // replace item with handle in array\n .map(function (item) {\n return item.querySelector(selector) || (item.shadowRoot && item.shadowRoot.querySelector(selector));\n });\n});\n\n/**\n * @param {Event} event\n * @returns {HTMLElement}\n */\nvar getEventTarget = (function (event) {\n return (event.composedPath && event.composedPath()[0]) || event.target;\n});\n\n/* eslint-env browser */\n/**\n * defaultDragImage returns the current item as dragged image\n * @param {HTMLElement} draggedElement - the item that the user drags\n * @param {object} elementOffset - an object with the offsets top, left, right & bottom\n * @param {Event} event - the original drag event object\n * @return {object} with element, posX and posY properties\n */\nvar defaultDragImage = function (draggedElement, elementOffset, event) {\n return {\n element: draggedElement,\n posX: event.pageX - elementOffset.left,\n posY: event.pageY - elementOffset.top\n };\n};\n/**\n * attaches an element as the drag image to an event\n * @param {Event} event - the original drag event object\n * @param {HTMLElement} draggedElement - the item that the user drags\n * @param {Function} customDragImage - function to create a custom dragImage\n * @return void\n */\nvar setDragImage = (function (event, draggedElement, customDragImage) {\n // check if event is provided\n if (!(event instanceof Event)) {\n throw new Error('setDragImage requires a DragEvent as the first argument.');\n }\n // check if draggedElement is provided\n if (!(draggedElement instanceof HTMLElement)) {\n throw new Error('setDragImage requires the dragged element as the second argument.');\n }\n // set default function of none provided\n if (!customDragImage) {\n customDragImage = defaultDragImage;\n }\n // check if setDragImage method is available\n if (event.dataTransfer && event.dataTransfer.setDragImage) {\n // get the elements offset\n var elementOffset = _offset(draggedElement);\n // get the dragImage\n var dragImage = customDragImage(draggedElement, elementOffset, event);\n // check if custom function returns correct values\n if (!(dragImage.element instanceof HTMLElement) || typeof dragImage.posX !== 'number' || typeof dragImage.posY !== 'number') {\n throw new Error('The customDragImage function you provided must return and object with the properties element[string], posX[integer], posY[integer].');\n }\n // needs to be set for HTML5 drag & drop to work\n event.dataTransfer.effectAllowed = 'copyMove';\n // Firefox requires it to use the event target's id for the data\n event.dataTransfer.setData('text/plain', getEventTarget(event).id);\n // set the drag image on the event\n event.dataTransfer.setDragImage(dragImage.element, dragImage.posX, dragImage.posY);\n }\n});\n\n/**\n * Check if curList accepts items from destList\n * @param {sortable} destination the container an item is move to\n * @param {sortable} origin the container an item comes from\n */\nvar _listsConnected = (function (destination, origin) {\n // check if valid sortable\n if (destination.isSortable === true) {\n var acceptFrom = store(destination).getConfig('acceptFrom');\n // check if acceptFrom is valid\n if (acceptFrom !== null && acceptFrom !== false && typeof acceptFrom !== 'string') {\n throw new Error('HTML5Sortable: Wrong argument, \"acceptFrom\" must be \"null\", \"false\", or a valid selector string.');\n }\n if (acceptFrom !== null) {\n return acceptFrom !== false && acceptFrom.split(',').filter(function (sel) {\n return sel.length > 0 && origin.matches(sel);\n }).length > 0;\n }\n // drop in same list\n if (destination === origin) {\n return true;\n }\n // check if lists are connected with connectWith\n if (store(destination).getConfig('connectWith') !== undefined && store(destination).getConfig('connectWith') !== null) {\n return store(destination).getConfig('connectWith') === store(origin).getConfig('connectWith');\n }\n }\n return false;\n});\n\n/**\n * default configurations\n */\nvar defaultConfiguration = {\n items: null,\n // deprecated\n connectWith: null,\n // deprecated\n disableIEFix: null,\n acceptFrom: null,\n copy: false,\n placeholder: null,\n placeholderClass: 'sortable-placeholder',\n draggingClass: 'sortable-dragging',\n hoverClass: false,\n debounce: 0,\n throttleTime: 100,\n maxItems: 0,\n itemSerializer: undefined,\n containerSerializer: undefined,\n customDragImage: null\n};\n\n/**\n * make sure a function is only called once within the given amount of time\n * @param {Function} fn the function to throttle\n * @param {number} threshold time limit for throttling\n */\n// must use function to keep this context\nfunction _throttle (fn, threshold) {\n var _this = this;\n if (threshold === void 0) { threshold = 250; }\n // check function\n if (typeof fn !== 'function') {\n throw new Error('You must provide a function as the first argument for throttle.');\n }\n // check threshold\n if (typeof threshold !== 'number') {\n throw new Error('You must provide a number as the second argument for throttle.');\n }\n var lastEventTimestamp = null;\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var now = Date.now();\n if (lastEventTimestamp === null || now - lastEventTimestamp >= threshold) {\n lastEventTimestamp = now;\n fn.apply(_this, args);\n }\n };\n}\n\n/* eslint-env browser */\n/**\n * enable or disable hoverClass on mouseenter/leave if container Items\n * @param {sortable} sortableContainer a valid sortableContainer\n * @param {boolean} enable enable or disable event\n */\n// export default (sortableContainer: sortable, enable: boolean) => {\nvar enableHoverClass = (function (sortableContainer, enable) {\n if (typeof store(sortableContainer).getConfig('hoverClass') === 'string') {\n var hoverClasses_1 = store(sortableContainer).getConfig('hoverClass').split(' ');\n // add class on hover\n if (enable === true) {\n addEventListener(sortableContainer, 'mousemove', _throttle(function (event) {\n // check of no mouse button was pressed when mousemove started == no drag\n if (event.buttons === 0) {\n _filter(sortableContainer.children, store(sortableContainer).getConfig('items')).forEach(function (item) {\n var _a, _b;\n if (item !== event.target) {\n (_a = item.classList).remove.apply(_a, hoverClasses_1);\n }\n else {\n (_b = item.classList).add.apply(_b, hoverClasses_1);\n }\n });\n }\n }, store(sortableContainer).getConfig('throttleTime')));\n // remove class on leave\n addEventListener(sortableContainer, 'mouseleave', function () {\n _filter(sortableContainer.children, store(sortableContainer).getConfig('items')).forEach(function (item) {\n var _a;\n (_a = item.classList).remove.apply(_a, hoverClasses_1);\n });\n });\n // remove events\n }\n else {\n removeEventListener(sortableContainer, 'mousemove');\n removeEventListener(sortableContainer, 'mouseleave');\n }\n }\n});\n\n/* eslint-env browser */\n/*\n * variables global to the plugin\n */\nvar dragging;\nvar draggingHeight;\n/*\n * Keeps track of the initialy selected list, where 'dragstart' event was triggered\n * It allows us to move the data in between individual Sortable List instances\n */\n// Origin List - data from before any item was changed\nvar originContainer;\nvar originIndex;\nvar originElementIndex;\nvar originItemsBeforeUpdate;\n// Previous Sortable Container - we dispatch as sortenter event when a\n// dragged item enters a sortableContainer for the first time\nvar previousContainer;\n// Destination List - data from before any item was changed\nvar destinationItemsBeforeUpdate;\n/**\n * remove event handlers from items\n * @param {Array|NodeList} items\n */\nvar _removeItemEvents = function (items) {\n removeEventListener(items, 'dragstart');\n removeEventListener(items, 'dragend');\n removeEventListener(items, 'dragover');\n removeEventListener(items, 'dragenter');\n removeEventListener(items, 'drop');\n removeEventListener(items, 'mouseenter');\n removeEventListener(items, 'mouseleave');\n};\n/**\n * _getDragging returns the current element to drag or\n * a copy of the element.\n * Is Copy Active for sortable\n * @param {HTMLElement} draggedItem - the item that the user drags\n * @param {HTMLElement} sortable a single sortable\n */\nvar _getDragging = function (draggedItem, sortable) {\n var ditem = draggedItem;\n if (store(sortable).getConfig('copy') === true) {\n ditem = draggedItem.cloneNode(true);\n addAttribute(ditem, 'aria-copied', 'true');\n draggedItem.parentElement.appendChild(ditem);\n ditem.style.display = 'none';\n ditem.oldDisplay = draggedItem.style.display;\n }\n return ditem;\n};\n/**\n * Remove data from sortable\n * @param {HTMLElement} sortable a single sortable\n */\nvar _removeSortableData = function (sortable) {\n removeData(sortable);\n removeAttribute(sortable, 'aria-dropeffect');\n};\n/**\n * Remove data from items\n * @param {Array|HTMLElement} items\n */\nvar _removeItemData = function (items) {\n removeAttribute(items, 'aria-grabbed');\n removeAttribute(items, 'aria-copied');\n removeAttribute(items, 'draggable');\n removeAttribute(items, 'role');\n};\n/**\n * find sortable from element. travels up parent element until found or null.\n * @param {HTMLElement} element a single sortable\n * @param {Event} event - the current event. We need to pass it to be able to\n * find Sortable whith shadowRoot (document fragment has no parent)\n */\nfunction findSortable(element, event) {\n if (event.composedPath) {\n return event.composedPath().find(function (el) { return el.isSortable; });\n }\n while (element.isSortable !== true) {\n element = element.parentElement;\n }\n return element;\n}\n/**\n * Dragging event is on the sortable element. finds the top child that\n * contains the element.\n * @param {HTMLElement} sortableElement a single sortable\n * @param {HTMLElement} element is that being dragged\n */\nfunction findDragElement(sortableElement, element) {\n var options = addData(sortableElement, 'opts');\n var items = _filter(sortableElement.children, options.items);\n var itemlist = items.filter(function (ele) {\n return ele.contains(element) || (ele.shadowRoot && ele.shadowRoot.contains(element));\n });\n return itemlist.length > 0 ? itemlist[0] : element;\n}\n/**\n * Destroy the sortable\n * @param {HTMLElement} sortableElement a single sortable\n */\nvar _destroySortable = function (sortableElement) {\n var opts = addData(sortableElement, 'opts') || {};\n var items = _filter(sortableElement.children, opts.items);\n var handles = _getHandles(items, opts.handle);\n // remove event handlers & data from sortable\n removeEventListener(sortableElement, 'dragover');\n removeEventListener(sortableElement, 'dragenter');\n removeEventListener(sortableElement, 'drop');\n // remove event data from sortable\n _removeSortableData(sortableElement);\n // remove event handlers & data from items\n removeEventListener(handles, 'mousedown');\n _removeItemEvents(items);\n _removeItemData(items);\n};\n/**\n * Enable the sortable\n * @param {HTMLElement} sortableElement a single sortable\n */\nvar _enableSortable = function (sortableElement) {\n var opts = addData(sortableElement, 'opts');\n var items = _filter(sortableElement.children, opts.items);\n var handles = _getHandles(items, opts.handle);\n addAttribute(sortableElement, 'aria-dropeffect', 'move');\n addData(sortableElement, '_disabled', 'false');\n addAttribute(handles, 'draggable', 'true');\n // @todo: remove this fix\n // IE FIX for ghost\n // can be disabled as it has the side effect that other events\n // (e.g. click) will be ignored\n if (opts.disableIEFix === false) {\n var spanEl = (document || window.document).createElement('span');\n if (typeof spanEl.dragDrop === 'function') {\n addEventListener(handles, 'mousedown', function () {\n if (items.indexOf(this) !== -1) {\n this.dragDrop();\n }\n else {\n var parent = this.parentElement;\n while (items.indexOf(parent) === -1) {\n parent = parent.parentElement;\n }\n parent.dragDrop();\n }\n });\n }\n }\n};\n/**\n * Disable the sortable\n * @param {HTMLElement} sortableElement a single sortable\n */\nvar _disableSortable = function (sortableElement) {\n var opts = addData(sortableElement, 'opts');\n var items = _filter(sortableElement.children, opts.items);\n var handles = _getHandles(items, opts.handle);\n addAttribute(sortableElement, 'aria-dropeffect', 'none');\n addData(sortableElement, '_disabled', 'true');\n addAttribute(handles, 'draggable', 'false');\n removeEventListener(handles, 'mousedown');\n};\n/**\n * Reload the sortable\n * @param {HTMLElement} sortableElement a single sortable\n * @description events need to be removed to not be double bound\n */\nvar _reloadSortable = function (sortableElement) {\n var opts = addData(sortableElement, 'opts');\n var items = _filter(sortableElement.children, opts.items);\n var handles = _getHandles(items, opts.handle);\n addData(sortableElement, '_disabled', 'false');\n // remove event handlers from items\n _removeItemEvents(items);\n removeEventListener(handles, 'mousedown');\n // remove event handlers from sortable\n removeEventListener(sortableElement, 'dragover');\n removeEventListener(sortableElement, 'dragenter');\n removeEventListener(sortableElement, 'drop');\n};\n/**\n * Public sortable object\n * @param {Array|NodeList} sortableElements\n * @param {object|string} options|method\n */\nfunction sortable(sortableElements, options) {\n // get method string to see if a method is called\n var method = String(options);\n options = options || {};\n // check if the user provided a selector instead of an element\n if (typeof sortableElements === 'string') {\n sortableElements = document.querySelectorAll(sortableElements);\n }\n // if the user provided an element, return it in an array to keep the return value consistant\n if (sortableElements instanceof HTMLElement) {\n sortableElements = [sortableElements];\n }\n sortableElements = Array.prototype.slice.call(sortableElements);\n if (/serialize/.test(method)) {\n return sortableElements.map(function (sortableContainer) {\n var opts = addData(sortableContainer, 'opts');\n return _serialize(sortableContainer, opts.itemSerializer, opts.containerSerializer);\n });\n }\n sortableElements.forEach(function (sortableElement) {\n if (/enable|disable|destroy/.test(method)) {\n return sortable[method](sortableElement);\n }\n // log deprecation\n ['connectWith', 'disableIEFix'].forEach(function (configKey) {\n if (options.hasOwnProperty(configKey) && options[configKey] !== null) {\n console.warn(\"HTML5Sortable: You are using the deprecated configuration \\\"\" + configKey + \"\\\". This will be removed in an upcoming version, make sure to migrate to the new options when updating.\");\n }\n });\n // merge options with default options\n options = Object.assign({}, defaultConfiguration, store(sortableElement).config, options);\n // init data store for sortable\n store(sortableElement).config = options;\n // set options on sortable\n addData(sortableElement, 'opts', options);\n // property to define as sortable\n sortableElement.isSortable = true;\n // reset sortable\n _reloadSortable(sortableElement);\n // initialize\n var listItems = _filter(sortableElement.children, options.items);\n // create element if user defined a placeholder element as a string\n var customPlaceholder;\n if (options.placeholder !== null && options.placeholder !== undefined) {\n var tempContainer = document.createElement(sortableElement.tagName);\n if (options.placeholder instanceof HTMLElement) {\n tempContainer.appendChild(options.placeholder);\n }\n else {\n tempContainer.innerHTML = options.placeholder;\n }\n customPlaceholder = tempContainer.children[0];\n }\n // add placeholder\n store(sortableElement).placeholder = _makePlaceholder(sortableElement, customPlaceholder, options.placeholderClass);\n addData(sortableElement, 'items', options.items);\n if (options.acceptFrom) {\n addData(sortableElement, 'acceptFrom', options.acceptFrom);\n }\n else if (options.connectWith) {\n addData(sortableElement, 'connectWith', options.connectWith);\n }\n _enableSortable(sortableElement);\n addAttribute(listItems, 'role', 'option');\n addAttribute(listItems, 'aria-grabbed', 'false');\n // enable hover class\n enableHoverClass(sortableElement, true);\n /*\n Handle drag events on draggable items\n Handle is set at the sortableElement level as it will bubble up\n from the item\n */\n addEventListener(sortableElement, 'dragstart', function (e) {\n // ignore dragstart events\n var target = getEventTarget(e);\n if (target.isSortable === true) {\n return;\n }\n e.stopImmediatePropagation();\n if ((options.handle && !target.matches(options.handle)) || target.getAttribute('draggable') === 'false') {\n return;\n }\n var sortableContainer = findSortable(target, e);\n var dragItem = findDragElement(sortableContainer, target);\n // grab values\n originItemsBeforeUpdate = _filter(sortableContainer.children, options.items);\n originIndex = originItemsBeforeUpdate.indexOf(dragItem);\n originElementIndex = _index(dragItem, sortableContainer.children);\n originContainer = sortableContainer;\n // add transparent clone or other ghost to cursor\n setDragImage(e, dragItem, options.customDragImage);\n // cache selsection & add attr for dragging\n draggingHeight = _getElementHeight(dragItem);\n dragItem.classList.add(options.draggingClass);\n dragging = _getDragging(dragItem, sortableContainer);\n addAttribute(dragging, 'aria-grabbed', 'true');\n // dispatch sortstart event on each element in group\n sortableContainer.dispatchEvent(new CustomEvent('sortstart', {\n detail: {\n origin: {\n elementIndex: originElementIndex,\n index: originIndex,\n container: originContainer\n },\n item: dragging,\n originalTarget: target\n }\n }));\n });\n /*\n We are capturing targetSortable before modifications with 'dragenter' event\n */\n addEventListener(sortableElement, 'dragenter', function (e) {\n var target = getEventTarget(e);\n var sortableContainer = findSortable(target, e);\n if (sortableContainer && sortableContainer !== previousContainer) {\n destinationItemsBeforeUpdate = _filter(sortableContainer.children, addData(sortableContainer, 'items'))\n .filter(function (item) { return item !== store(sortableElement).placeholder; });\n sortableContainer.dispatchEvent(new CustomEvent('sortenter', {\n detail: {\n origin: {\n elementIndex: originElementIndex,\n index: originIndex,\n container: originContainer\n },\n destination: {\n container: sortableContainer,\n itemsBeforeUpdate: destinationItemsBeforeUpdate\n },\n item: dragging,\n originalTarget: target\n }\n }));\n }\n previousContainer = sortableContainer;\n });\n /*\n * Dragend Event - https://developer.mozilla.org/en-US/docs/Web/Events/dragend\n * Fires each time dragEvent end, or ESC pressed\n * We are using it to clean up any draggable elements and placeholders\n */\n addEventListener(sortableElement, 'dragend', function (e) {\n if (!dragging) {\n return;\n }\n dragging.classList.remove(options.draggingClass);\n addAttribute(dragging, 'aria-grabbed', 'false');\n if (dragging.getAttribute('aria-copied') === 'true' && addData(dragging, 'dropped') !== 'true') {\n dragging.remove();\n }\n dragging.style.display = dragging.oldDisplay;\n delete dragging.oldDisplay;\n var visiblePlaceholder = Array.from(stores.values()).map(function (data) { return data.placeholder; })\n .filter(function (placeholder) { return placeholder instanceof HTMLElement; })\n .filter(isInDom)[0];\n if (visiblePlaceholder) {\n visiblePlaceholder.remove();\n }\n // dispatch sortstart event on each element in group\n sortableElement.dispatchEvent(new CustomEvent('sortstop', {\n detail: {\n origin: {\n elementIndex: originElementIndex,\n index: originIndex,\n container: originContainer\n },\n item: dragging\n }\n }));\n previousContainer = null;\n dragging = null;\n draggingHeight = null;\n });\n /*\n * Drop Event - https://developer.mozilla.org/en-US/docs/Web/Events/drop\n * Fires when valid drop target area is hit\n */\n addEventListener(sortableElement, 'drop', function (e) {\n if (!_listsConnected(sortableElement, dragging.parentElement)) {\n return;\n }\n e.preventDefault();\n e.stopPropagation();\n addData(dragging, 'dropped', 'true');\n // get the one placeholder that is currently visible\n var visiblePlaceholder = Array.from(stores.values()).map(function (data) {\n return data.placeholder;\n })\n // filter only HTMLElements\n .filter(function (placeholder) { return placeholder instanceof HTMLElement; })\n // filter only elements in DOM\n .filter(isInDom)[0];\n // attach element after placeholder\n insertAfter(visiblePlaceholder, dragging);\n // remove placeholder from dom\n visiblePlaceholder.remove();\n /*\n * Fires Custom Event - 'sortstop'\n */\n sortableElement.dispatchEvent(new CustomEvent('sortstop', {\n detail: {\n origin: {\n elementIndex: originElementIndex,\n index: originIndex,\n container: originContainer\n },\n item: dragging\n }\n }));\n var placeholder = store(sortableElement).placeholder;\n var originItems = _filter(originContainer.children, options.items)\n .filter(function (item) { return item !== placeholder; });\n var destinationContainer = this.isSortable === true ? this : this.parentElement;\n var destinationItems = _filter(destinationContainer.children, addData(destinationContainer, 'items'))\n .filter(function (item) { return item !== placeholder; });\n var destinationElementIndex = _index(dragging, Array.from(dragging.parentElement.children)\n .filter(function (item) { return item !== placeholder; }));\n var destinationIndex = _index(dragging, destinationItems);\n /*\n * When a list item changed container lists or index within a list\n * Fires Custom Event - 'sortupdate'\n */\n if (originElementIndex !== destinationElementIndex || originContainer !== destinationContainer) {\n sortableElement.dispatchEvent(new CustomEvent('sortupdate', {\n detail: {\n origin: {\n elementIndex: originElementIndex,\n index: originIndex,\n container: originContainer,\n itemsBeforeUpdate: originItemsBeforeUpdate,\n items: originItems\n },\n destination: {\n index: destinationIndex,\n elementIndex: destinationElementIndex,\n container: destinationContainer,\n itemsBeforeUpdate: destinationItemsBeforeUpdate,\n items: destinationItems\n },\n item: dragging\n }\n }));\n }\n });\n var debouncedDragOverEnter = _debounce(function (sortableElement, element, pageY) {\n if (!dragging) {\n return;\n }\n // set placeholder height if forcePlaceholderSize option is set\n if (options.forcePlaceholderSize) {\n store(sortableElement).placeholder.style.height = draggingHeight + 'px';\n }\n // if element the draggedItem is dragged onto is within the array of all elements in list\n // (not only items, but also disabled, etc.)\n if (Array.from(sortableElement.children).indexOf(element) > -1) {\n var thisHeight = _getElementHeight(element);\n var placeholderIndex = _index(store(sortableElement).placeholder, element.parentElement.children);\n var thisIndex = _index(element, element.parentElement.children);\n // Check if `element` is bigger than the draggable. If it is, we have to define a dead zone to prevent flickering\n if (thisHeight > draggingHeight) {\n // Dead zone?\n var deadZone = thisHeight - draggingHeight;\n var offsetTop = _offset(element).top;\n if (placeholderIndex < thisIndex && pageY < offsetTop) {\n return;\n }\n if (placeholderIndex > thisIndex &&\n pageY > offsetTop + thisHeight - deadZone) {\n return;\n }\n }\n if (dragging.oldDisplay === undefined) {\n dragging.oldDisplay = dragging.style.display;\n }\n if (dragging.style.display !== 'none') {\n dragging.style.display = 'none';\n }\n // To avoid flicker, determine where to position the placeholder\n // based on where the mouse pointer is relative to the elements\n // vertical center.\n var placeAfter = false;\n try {\n var elementMiddle = _offset(element).top + element.offsetHeight / 2;\n placeAfter = pageY >= elementMiddle;\n }\n catch (e) {\n placeAfter = placeholderIndex < thisIndex;\n }\n if (placeAfter) {\n insertAfter(element, store(sortableElement).placeholder);\n }\n else {\n insertBefore(element, store(sortableElement).placeholder);\n }\n // get placeholders from all stores & remove all but current one\n Array.from(stores.values())\n // remove empty values\n .filter(function (data) { return data.placeholder !== undefined; })\n // foreach placeholder in array if outside of current sorableContainer -> remove from DOM\n .forEach(function (data) {\n if (data.placeholder !== store(sortableElement).placeholder) {\n data.placeholder.remove();\n }\n });\n }\n else {\n // get all placeholders from store\n var placeholders = Array.from(stores.values())\n .filter(function (data) { return data.placeholder !== undefined; })\n .map(function (data) {\n return data.placeholder;\n });\n // check if element is not in placeholders\n if (placeholders.indexOf(element) === -1 && sortableElement === element && !_filter(element.children, options.items).length) {\n placeholders.forEach(function (element) { return element.remove(); });\n element.appendChild(store(sortableElement).placeholder);\n }\n }\n }, options.debounce);\n // Handle dragover and dragenter events on draggable items\n var onDragOverEnter = function (e) {\n var element = e.target;\n var sortableElement = element.isSortable === true ? element : findSortable(element, e);\n element = findDragElement(sortableElement, element);\n if (!dragging || !_listsConnected(sortableElement, dragging.parentElement) || addData(sortableElement, '_disabled') === 'true') {\n return;\n }\n var options = addData(sortableElement, 'opts');\n if (parseInt(options.maxItems) && _filter(sortableElement.children, addData(sortableElement, 'items')).length >= parseInt(options.maxItems) && dragging.parentElement !== sortableElement) {\n return;\n }\n e.preventDefault();\n e.stopPropagation();\n e.dataTransfer.dropEffect = store(sortableElement).getConfig('copy') === true ? 'copy' : 'move';\n debouncedDragOverEnter(sortableElement, element, e.pageY);\n };\n addEventListener(listItems.concat(sortableElement), 'dragover', onDragOverEnter);\n addEventListener(listItems.concat(sortableElement), 'dragenter', onDragOverEnter);\n });\n return sortableElements;\n}\nsortable.destroy = function (sortableElement) {\n _destroySortable(sortableElement);\n};\nsortable.enable = function (sortableElement) {\n _enableSortable(sortableElement);\n};\nsortable.disable = function (sortableElement) {\n _disableSortable(sortableElement);\n};\n/* START.TESTS_ONLY */\nsortable.__testing = {\n // add internal methods here for testing purposes\n _data: addData,\n _removeItemEvents: _removeItemEvents,\n _removeItemData: _removeItemData,\n _removeSortableData: _removeSortableData\n};\n\nexport default sortable;\n","import Modal from 'flarum/components/Modal';\nimport Button from 'flarum/components/Button';\nimport ItemList from 'flarum/utils/ItemList';\nimport { slug } from 'flarum/utils/string';\n\nimport tagLabel from '../../common/helpers/tagLabel';\n\n/**\n * The `EditTagModal` component shows a modal dialog which allows the user\n * to create or edit a tag.\n */\nexport default class EditTagModal extends Modal {\n init() {\n super.init();\n\n this.tag = this.props.tag || app.store.createRecord('tags');\n\n this.name = m.prop(this.tag.name() || '');\n this.slug = m.prop(this.tag.slug() || '');\n this.description = m.prop(this.tag.description() || '');\n this.color = m.prop(this.tag.color() || '');\n this.icon = m.prop(this.tag.icon() || '');\n this.isHidden = m.prop(this.tag.isHidden() || false);\n }\n\n className() {\n return 'EditTagModal Modal--small';\n }\n\n title() {\n return this.name()\n ? tagLabel({\n name: this.name,\n color: this.color,\n icon: this.icon,\n })\n : app.translator.trans('flarum-tags.admin.edit_tag.title');\n }\n\n content() {\n return (\n
\n
\n {this.fields().toArray()}\n
\n
\n );\n }\n\n fields() {\n const items = new ItemList();\n\n items.add('name',
\n \n {\n this.name(e.target.value);\n this.slug(slug(e.target.value));\n }}/>\n
, 50);\n\n items.add('slug',
\n \n \n
, 40);\n\n items.add('description',
\n \n