From f022018be31a959e412497f27bbb8f20f733c4ae Mon Sep 17 00:00:00 2001 From: flarum-bot Date: Fri, 24 Apr 2020 12:33:10 +0000 Subject: [PATCH] Bundled output for commit 751c14c889e51f61c328a0304d013e17a6b74229 [skip ci] --- extensions/tags/js/dist/admin.js | 2 +- extensions/tags/js/dist/admin.js.map | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/tags/js/dist/admin.js b/extensions/tags/js/dist/admin.js index d66868b53..39db6324d 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";n.d(e,"a",(function(){return o}));var a=n(12),r=n.n(a);function o(t,e,n){void 0===e&&(e={}),void 0===n&&(n={});var a=t&&t.icon(),o=n.useColor,i=void 0===o||o;return e.className=r()([e.className,"icon",a?t.icon():"TagIcon"]),t?(e.style=e.style||{},a?e.style.color=i?t.color():"":e.style.backgroundColor=t.color()):e.className+=" untagged",a?m("i",e):m("span",e)}},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&&t.icon()&&Object(o.a)(t,{},{useColor:!1})," ",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(18),vt=n.n(ht),bt=n(19),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(20),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(21);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(15);for(var r in a)"default"!==r&&function(t){n.d(e,t,(function(){return a[t]}))}(r);n(27)}]); +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";n.d(e,"a",(function(){return o}));var a=n(12),r=n.n(a);function o(t,e,n){void 0===e&&(e={}),void 0===n&&(n={});var a=t&&t.icon(),o=n.useColor,i=void 0===o||o;return e.className=r()([e.className,"icon",a?t.icon():"TagIcon"]),t?(e.style=e.style||{},a?e.style.color=i?t.color():"":e.style.backgroundColor=t.color()):e.className+=" untagged",a?m("i",e):m("span",e)}},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&&t.icon()&&Object(o.a)(t,{},{useColor:!1})," ",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;e0&&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},W={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 z,X,G,V,J,K,Q,Z,tt=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"))}},et=function(t){j(t,"dragstart"),j(t,"dragend"),j(t,"dragover"),j(t,"dragenter"),j(t,"drop"),j(t,"mouseenter"),j(t,"mouseleave")},nt=function(t){var e;(e=t).h5s&&delete e.h5s.data,S(t,"aria-dropeffect")},at=function(t){S(t,"aria-grabbed"),S(t,"aria-copied"),S(t,"draggable"),S(t,"role")};function rt(t,e){if(e.composedPath)return e.composedPath().find((function(t){return t.isSortable}));for(;!0!==t.isSortable;)t=t.parentElement;return t}function ot(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 it=function(t){var e=C(t,"opts"),n=N(t.children,e.items),a=Y(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()}})))};function st(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 function(t,e,n){if(void 0===e&&(e=function(t,e){return t}),void 0===n&&(n=function(t){return t}),!(t instanceof HTMLElement)||!0==!t.isSortable)throw new Error("You need to provide a sortableContainer to be serialized.");if("function"!=typeof e||"function"!=typeof n)throw new Error("You need to provide a valid serializer for items and the container.");var a=C(t,"opts").items,r=N(t.children,a),o=r.map((function(e){return{parent:t,node:e,html:e.outerHTML,index:P(e,r)}}));return{container:n({node:t,itemCount:o.length}),items:o.map((function(n){return e(n,t)}))}}(t,e.itemSerializer,e.containerSerializer)})):(t.forEach((function(t){if(/enable|disable|destroy/.test(n))return st[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({},W,M(t).config,e),M(t).config=e,C(t,"opts",e),t.isSortable=!0,function(t){var e=C(t,"opts"),n=N(t.children,e.items),a=Y(n,e.handle);C(t,"_disabled","false"),et(n),j(a,"mousedown"),j(t,"dragover"),j(t,"dragenter"),j(t,"drop")}(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=function(t,e,n){var a;if(void 0===n&&(n="sortable-placeholder"),!(t instanceof HTMLElement))throw new Error("You must provide a valid element as a sortable.");if(!(e instanceof HTMLElement)&&void 0!==e)throw new Error("You must provide a valid element as a placeholder or set ot to undefined.");return void 0===e&&(["UL","OL"].includes(t.tagName)?e=document.createElement("li"):["TABLE","TBODY"].includes(t.tagName)?(e=document.createElement("tr")).innerHTML='':e=document.createElement("div")),"string"==typeof n&&(a=e.classList).add.apply(a,n.split(" ")),e}(t,a,e.placeholderClass),C(t,"items",e.items),e.acceptFrom?C(t,"acceptFrom",e.acceptFrom):e.connectWith&&C(t,"connectWith",e.connectWith),it(t),I(r,"role","option"),I(r,"aria-grabbed","false"),tt(t,!0),D(t,"dragstart",(function(t){var n=R(t);if(!0!==n.isSortable&&(t.stopImmediatePropagation(),(!e.handle||n.matches(e.handle))&&"false"!==n.getAttribute("draggable"))){var a=rt(n,t),r=ot(a,n);K=N(a.children,e.items),V=K.indexOf(r),J=P(r,a.children),G=a,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=q),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",R(t).id),t.dataTransfer.setDragImage(a.element,a.posX,a.posY)}}(t,r,e.customDragImage),X=B(r),r.classList.add(e.draggingClass),z=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}(r,a),I(z,"aria-grabbed","true"),a.dispatchEvent(new CustomEvent("sortstart",{detail:{origin:{elementIndex:J,index:V,container:G},item:z,originalTarget:n}}))}})),D(t,"dragenter",(function(e){var n=R(e),a=rt(n,e);a&&a!==Q&&(Z=N(a.children,C(a,"items")).filter((function(e){return e!==M(t).placeholder})),a.dispatchEvent(new CustomEvent("sortenter",{detail:{origin:{elementIndex:J,index:V,container:G},destination:{container:a,itemsBeforeUpdate:Z},item:z,originalTarget:n}}))),Q=a})),D(t,"dragend",(function(n){if(z){z.classList.remove(e.draggingClass),I(z,"aria-grabbed","false"),"true"===z.getAttribute("aria-copied")&&"true"!==C(z,"dropped")&&z.remove(),z.style.display=z.oldDisplay,delete z.oldDisplay;var a=Array.from(L.values()).map((function(t){return t.placeholder})).filter((function(t){return t instanceof HTMLElement})).filter(H)[0];a&&a.remove(),t.dispatchEvent(new CustomEvent("sortstop",{detail:{origin:{elementIndex:J,index:V,container:G},item:z}})),Q=null,z=null,X=null}})),D(t,"drop",(function(n){if(U(t,z.parentElement)){n.preventDefault(),n.stopPropagation(),C(z,"dropped","true");var a=Array.from(L.values()).map((function(t){return t.placeholder})).filter((function(t){return t instanceof HTMLElement})).filter(H)[0];k(a,z),a.remove(),t.dispatchEvent(new CustomEvent("sortstop",{detail:{origin:{elementIndex:J,index:V,container:G},item:z}}));var r=M(t).placeholder,o=N(G.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=P(z,Array.from(z.parentElement.children).filter((function(t){return t!==r}))),c=P(z,s);J===l&&G===i||t.dispatchEvent(new CustomEvent("sortupdate",{detail:{origin:{elementIndex:J,index:V,container:G,itemsBeforeUpdate:K,items:o},destination:{index:c,elementIndex:l,container:i,itemsBeforeUpdate:Z,items:s},item:z}}))}}));var i,s,l,c=(i=function(t,n,a){if(z)if(e.forcePlaceholderSize&&(M(t).placeholder.style.height=X+"px"),Array.from(t.children).indexOf(n)>-1){var r=B(n),o=P(M(t).placeholder,n.parentElement.children),i=P(n,n.parentElement.children);if(r>X){var s=r-X,l=A(n).top;if(oi&&a>l+r-s)return}void 0===z.oldDisplay&&(z.oldDisplay=z.style.display),"none"!==z.style.display&&(z.style.display="none");var c=!1;try{c=a>=A(n).top+n.offsetHeight/2}catch(t){c=o=parseInt(a.maxItems)&&z.parentElement!==n||(t.preventDefault(),t.stopPropagation(),t.dataTransfer.dropEffect=!0===M(n).getConfig("copy")?"copy":"move",c(n,e,t.pageY))}};D(r.concat(t),"dragover",u),D(r.concat(t),"dragenter",u)})),t)}st.destroy=function(t){!function(t){var e=C(t,"opts")||{},n=N(t.children,e.items),a=Y(n,e.handle);j(t,"dragover"),j(t,"dragenter"),j(t,"drop"),nt(t),j(a,"mousedown"),et(n),at(n)}(t)},st.enable=function(t){it(t)},st.disable=function(t){!function(t){var e=C(t,"opts"),n=N(t.children,e.items),a=Y(n,e.handle);I(t,"aria-dropeffect","none"),C(t,"_disabled","true"),I(a,"draggable","false"),j(a,"mousedown")}(t)},st.__testing={_data:C,_removeItemEvents:et,_removeItemData:at,_removeSortableData:nt};var lt=st,ct=n(18),ut=n.n(ct),dt=n(19),pt=n.n(dt),mt=n(43),ft=n.n(mt),gt=n(44),ht=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 ft.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(gt.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}(pt.a),vt=n(45),bt=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(vt).a);function yt(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 ht({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(yt)))}var _t=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 ht)}}),f.a.component({className:"Button",children:app.translator.trans("flarum-tags.admin.tags.settings_button"),onclick:function(){return app.modal.show(new bt)}}))),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(yt))),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(yt))))))},n.config=function(){lt(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}(ut.a),wt=function(){app.routes.tags={path:"/tags",component:_t.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")}))}))},Et=n(46),Tt=n.n(Et),xt=function(){Object(o.extend)(Tt.a.prototype,"homePageItems",(function(t){t.add("tags",{path:"/tags",label:app.translator.trans("flarum-tags.admin.basics.tags_label")})}))},Ct=n(47),Nt=n.n(Ct),Lt=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 Nt.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)}))},Ot=n(20),Mt=Object(a.a)(Ot.a,{"tags/addTagsHomePageOption":xt,"tags/addTagChangePermission":Lt,"tags/addTagsPane":wt,"tags/components/TagSettingsModal":bt,"tags/components/TagsPage":_t,"tags/components/EditTagModal":ht,"tags/addTagPermission":y,"tags/addTagsPermissionScope":b}),Dt=n(21);app.initializers.add("flarum-tags",(function(t){t.store.models.tags=r.a,b(),y(),wt(),xt(),Lt()})),Object(a.a)(Dt.compat,Mt)},,,,,,,,,,,,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(15);for(var r in a)"default"!==r&&function(t){n.d(e,t,(function(){return a[t]}))}(r);n(27)}]); //# 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 f722e057e..3bd538e18 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['utils/classList']\"","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","_inheritsLoose","subClass","superClass","constructor","__proto__","tagIcon","tag","attrs","settings","hasIcon","icon","useColor","className","classList","style","color","backgroundColor","tagLabel","link","extract","tagText","app","translator","trans","title","description","href","route","slug","config","tagsLabel","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","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","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","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","EditTagModal","init","props","createRecord","prop","content","fields","toArray","ItemList","oninput","withAttr","tabindex","type","checked","onchange","loading","exists","submitData","onsubmit","then","hide","response","handleErrors","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","routes","path","extensionSettings","AdminNav","AdminLinkButton","BasicsPage","minutes","allow_tag_change","SettingDropdown","defaultLabel","transChoice","count","addTagsHomePageOption","addTagChangePermission","addTagsPane","addTagPermission","addTagsPermissionScope","initializers","models","tagsCompat"],"mappings":"2BACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QA0Df,OArDAF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAA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MAAM,6DACzBhD,IAAK,mBACLgS,QAAS,CACP,CAACtS,MAAO,KAAM2G,MAAOvD,IAAIC,WAAWC,MAAM,8DAC1C,CAACtD,MAAO,KAAM2G,MAAOvD,IAAIC,WAAWC,MAAM,6DAC1C,CAACtD,MAAO,QAAS2G,MAAOvD,IAAIC,WAAWC,MAAM,kEAIlD,Q,SCbQ,GAAA7D,OAAA,KAAcwB,KAAQ,CACnC,6BAA8B4Z,GAC9B,8BAA+BC,GAC/B,mBAAoBC,GACpB,mCAAoCjD,GACpC,2BAA4BoB,GAC5B,+BAAgCjD,GAChC,wBAAyB+E,EACzB,8BAA+BC,I,SCZjC7X,IAAI8X,aAAazU,IAAI,eAAe,SAAArD,GAClCA,EAAIkD,MAAM6U,OAAOha,KAAOsD,IAExBwW,IACAD,IACAD,KACAF,KACAC,QAQFrb,OAAA,IAAAA,CAAcwB,UAAQma,K,yBCtBtBtc,EAAOD,QAAUkC,OAAOC,KAAKC,OAAO,kC,cCApCnC,EAAOD,QAAUkC,OAAOC,KAAKC,OAAO,wB,cCApCnC,EAAOD,QAAUkC,OAAOC,KAAKC,OAAO,wB,cCApCnC,EAAOD,QAAUkC,OAAOC,KAAKC,OAAO,+B,cCApCnC,EAAOD,QAAUkC,OAAOC,KAAKC,OAAO,mB,cCApCnC,EAAOD,QAAUkC,OAAOC,KAAKC,OAAO,iB,cCApCnC,EAAOD,QAAUkC,OAAOC,KAAKC,OAAO,6B,cCApCnC,EAAOD,QAAUkC,OAAOC,KAAKC,OAAO,0B,cCApCnC,EAAOD,QAAUkC,OAAOC,KAAKC,OAAO,+B,8BCApC","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}","import classList from 'flarum/utils/classList';\n\nexport default function tagIcon(tag, attrs = {}, settings = {}) {\n const hasIcon = tag && tag.icon();\n const { useColor = true } = settings;\n\n attrs.className = classList([\n attrs.className,\n 'icon',\n hasIcon ? tag.icon() : 'TagIcon'\n ]);\n\n if (tag) {\n attrs.style = attrs.style || {};\n\n if (hasIcon) {\n attrs.style.color = useColor ? 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 const tagText = tag ? tag.name() : app.translator.trans('flarum-tags.lib.deleted_tag_text');\n\n if (tag) {\n const color = tag.color();\n if (color) {\n attrs.style.backgroundColor = attrs.style.color = color;\n attrs.className += ' colored';\n }\n\n if (link) {\n attrs.title = tag.description() || '';\n attrs.href = app.route('tag', {tags: tag.slug()});\n attrs.config = m.route;\n }\n } else {\n attrs.className += ' untagged';\n }\n\n return (\n m((link ? 'a' : 'span'), attrs,\n \n {tag && tag.icon() && tagIcon(tag, {}, {useColor: false})} {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['utils/classList'];","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