diff --git a/extensions/tags/js/dist/admin.js b/extensions/tags/js/dist/admin.js index 129adb96d8..4c6542bcd1 100644 --- a/extensions/tags/js/dist/admin.js +++ b/extensions/tags/js/dist/admin.js @@ -1,3 +1,3 @@ /*! For license information please see admin.js.LICENSE.txt */ -(()=>{var t,e,n={400:(t,e,n)=>{"use strict";n.d(e,{X:()=>_n});const o=flarum.reg.get("core","admin/app");var a=n.n(o);const r=flarum.reg.get("core","common/extend"),i=flarum.reg.get("core","admin/components/PermissionGrid");var s=n.n(i);const l=flarum.reg.get("core","admin/components/PermissionDropdown");var c=n.n(l);const u=flarum.reg.get("core","common/components/Dropdown");var d=n.n(u),h=n(336),g=n.n(h),p=n(661),f=n.n(p),v=n(339),b=n(968),y=n(618);const w=flarum.reg.get("core","admin/components/BasicsPage");var _=n.n(w);function T(){(0,r.extend)(_(),"homePageItems",(t=>{t.add("tags",{path:"/tags",label:app.translator.trans("flarum-tags.admin.basics.tags_label")})}))}const S=flarum.reg.get("core","admin/components/SettingDropdown");var E=n.n(S),D=n(805),C=n(950),x=n.n(C),N=(n(414),n(443)),A=n.n(N);function O(t,e){void 0===e&&(e={});const n=[],{link:o,...a}=e;return a.className=A()("TagsLabel",a.className),t?(0,y.A)(t).forEach((e=>{(e||1===t.length)&&n.push((0,v.A)(e,{link:o}))})):n.push((0,v.A)()),m("span",a,n)}flarum.reg.add("flarum-tags","common/helpers/tagsLabel",O);class P extends(x()){constructor(){super(...arguments),(0,D.A)(this,"tags",[]),(0,D.A)(this,"loaded",!1)}view(){const t=JSON.parse(this.attrs.settingValue()||"[]");return this.loaded||a().tagList.load(["parent"]).then((e=>{this.tags=e.filter((e=>t.includes(e.id()))),this.loaded=!0,m.redraw()})),m("div",{className:"Form-group SelectTagsSettingComponent"},m("label",null,this.attrs.label),this.attrs.help&&m("p",{className:"helpText"},this.attrs.help),this.loaded?m(g(),{className:"Button Button--text",onclick:()=>a().modal.show((()=>n.e(955).then(n.bind(n,671))),{selectedTags:this.tags,onsubmit:t=>{this.tags=t,this.attrs.settingValue(JSON.stringify(t.map((t=>t.id()))))},...this.attrs.options})},this.tags.length?O(this.tags):m("span",{className:"TagLabel untagged"},a().translator.trans("flarum-tags.admin.settings.button_text"))):m(f(),{size:"small",display:"inline"}))}}flarum.reg.add("flarum-tags","admin/components/SelectTagsSettingComponent",P),flarum.reg.addChunkModule("955","671","flarum-tags","common/components/TagSelectionModal"),flarum.reg.addChunkModule("955","671","flarum-tags","forum/components/ToggleButton");const M=flarum.reg.get("core","common/components/FormGroup");var I=n.n(M),k=n(954),F=n.n(k);class L{constructor(){(0,D.A)(this,"loadedIncludes",void 0)}async load(t){if(void 0===t&&(t=[]),!this.loadedIncludes)return this.query(t);const e=t.filter((t=>!this.loadedIncludes.has(t)));return 0===e.length?Promise.resolve(F().store.all("tags")):this.query(e)}async query(t){return void 0===t&&(t=[]),null!=this.loadedIncludes||(this.loadedIncludes=new Set),F().store.find("tags",{include:t.join(",")}).then((e=>{const n=Array.isArray(e)?e:[e];return t.forEach((t=>this.loadedIncludes.add(t))),n}))}}flarum.reg.add("flarum-tags","common/states/TagListState",L);const B=flarum.reg.get("core","common/extenders");var R=n.n(B);const X=flarum.reg.get("core","common/utils/computed");var Y=n.n(X);const j=flarum.reg.get("core","common/Model");var H=n.n(j);class G extends(H()){name(){return H().attribute("name").call(this)}slug(){return H().attribute("slug").call(this)}description(){return H().attribute("description").call(this)}color(){return H().attribute("color").call(this)}backgroundUrl(){return H().attribute("backgroundUrl").call(this)}backgroundMode(){return H().attribute("backgroundMode").call(this)}icon(){return H().attribute("icon").call(this)}position(){return H().attribute("position").call(this)}parent(){return H().hasOne("parent").call(this)}children(){return H().hasMany("children").call(this)}defaultSort(){return H().attribute("defaultSort").call(this)}isChild(){return H().attribute("isChild").call(this)}isHidden(){return H().attribute("isHidden").call(this)}isPrimary(){return H().attribute("isPrimary").call(this)}discussionCount(){return H().attribute("discussionCount").call(this)}lastPostedAt(){return H().attribute("lastPostedAt",H().transformDate).call(this)}lastPostedDiscussion(){return H().hasOne("lastPostedDiscussion").call(this)}isRestricted(){return H().attribute("isRestricted").call(this)}canStartDiscussion(){return H().attribute("canStartDiscussion").call(this)}canAddToDiscussion(){return H().attribute("canAddToDiscussion").call(this)}isPrimaryParent(){return Y()("position","parent",((t,e)=>null!==t&&!1===e)).call(this)}}flarum.reg.add("flarum-tags","common/models/Tag",G);const W=flarum.reg.get("core","common/query/IGambit");class q extends W.KeyValueGambit{constructor(){super(...arguments),(0,D.A)(this,"predicates",!0)}key(){return F().translator.trans("flarum-tags.lib.gambits.discussions.tag.key",{},!0)}hint(){return F().translator.trans("flarum-tags.lib.gambits.discussions.tag.hint",{},!0)}filterKey(){return"tag"}gambitValueToFilterValue(t){return[t]}fromFilter(t,e){let n=[];return Array.isArray(t)?(n=t.map((t=>this.fromFilter(t.toString(),e))),n.join(" ")):"".concat(e?"-":"").concat(this.key(),":").concat(this.filterValueToGambitValue(t))}filterValueToGambitValue(t){return t}}flarum.reg.add("flarum-tags","common/query/discussions/TagGambit",q);const z=[(new(R().Store)).add("tags",G),(new(R().Search)).gambit("discussions",q)];function V(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function U(t){for(var e=1;e"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return!1}return!1}}function ut(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function dt(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&ct(t,e):ct(t,e))||o&&t===n)return t;if(t===n)break}while(t=ut(t))}return null}var mt,ht=/\s+/g;function gt(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(ht," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(ht," ")}}function pt(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in o||-1!==e.indexOf("webkit")||(e="-webkit-"+e),o[e]=n+("string"==typeof n?"":"px")}}function ft(t,e){var n="";if("string"==typeof t)n=t;else do{var o=pt(t,"transform");o&&"none"!==o&&(n=o+" "+n)}while(!e&&(t=t.parentNode));var a=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return a&&new a(n)}function vt(t,e,n){if(t){var o=t.getElementsByTagName(e),a=0,r=o.length;if(n)for(;a=r:a<=r))return o;if(o===bt())break;o=Dt(o,!1)}return!1}function _t(t,e,n,o){for(var a=0,r=0,i=t.children;r2&&void 0!==arguments[2]?arguments[2]:{},o=n.evt,a=function(t,e){if(null==t)return{};var n,o,a=function(t,e){if(null==t)return{};var n,o,a={},r=Object.keys(t);for(o=0;o=0||(a[n]=t[n]);return a}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(a[n]=t[n])}return a}(n,Ft);kt.pluginEvent.bind(Ne)(t,e,U({dragEl:Rt,parentEl:Xt,ghostEl:Yt,rootEl:jt,nextEl:Ht,lastDownEl:Gt,cloneEl:Wt,cloneHidden:qt,dragStarted:ae,putSortable:Jt,activeSortable:Ne.active,originalEvent:o,oldIndex:zt,oldDraggableIndex:Ut,newIndex:Vt,newDraggableIndex:$t,hideGhostForTarget:Ee,unhideGhostForTarget:De,cloneNowHidden:function(){qt=!0},cloneNowShown:function(){qt=!1},dispatchSortableEvent:function(t){Bt({sortable:e,name:t,originalEvent:o})}},a))};function Bt(t){!function(t){var e=t.sortable,n=t.rootEl,o=t.name,a=t.targetEl,r=t.cloneEl,i=t.toEl,s=t.fromEl,l=t.oldIndex,c=t.newIndex,u=t.oldDraggableIndex,d=t.newDraggableIndex,m=t.originalEvent,h=t.putSortable,g=t.extraEventProperties;if(e=e||n&&n[Pt]){var p,f=e.options,v="on"+o.charAt(0).toUpperCase()+o.substr(1);!window.CustomEvent||tt||et?(p=document.createEvent("Event")).initEvent(o,!0,!0):p=new CustomEvent(o,{bubbles:!0,cancelable:!0}),p.to=i||n,p.from=s||n,p.item=a||n,p.clone=r,p.oldIndex=l,p.newIndex=c,p.oldDraggableIndex=u,p.newDraggableIndex=d,p.originalEvent=m,p.pullMode=h?h.lastPutMode:void 0;var b=U(U({},g),kt.getEventProperties(o,e));for(var y in b)p[y]=b[y];n&&n.dispatchEvent(p),f[v]&&f[v].call(e,p)}}(U({putSortable:Jt,cloneEl:Wt,targetEl:Rt,rootEl:jt,oldIndex:zt,oldDraggableIndex:Ut,newIndex:Vt,newDraggableIndex:$t},t))}var Rt,Xt,Yt,jt,Ht,Gt,Wt,qt,zt,Vt,Ut,$t,Kt,Jt,Zt,Qt,te,ee,ne,oe,ae,re,ie,se,le,ce=!1,ue=!1,de=[],me=!1,he=!1,ge=[],pe=!1,fe=[],ve="undefined"!=typeof document,be=at,ye=et||tt?"cssFloat":"float",we=ve&&!rt&&!at&&"draggable"in document.createElement("div"),_e=function(){if(ve){if(tt)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),Te=function(t,e){var n=pt(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),a=_t(t,0,e),r=_t(t,1,e),i=a&&pt(a),s=r&&pt(r),l=i&&parseInt(i.marginLeft)+parseInt(i.marginRight)+yt(a).width,c=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+yt(r).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(a&&i.float&&"none"!==i.float){var u="left"===i.float?"left":"right";return!r||"both"!==s.clear&&s.clear!==u?"horizontal":"vertical"}return a&&("block"===i.display||"flex"===i.display||"table"===i.display||"grid"===i.display||l>=o&&"none"===n[ye]||r&&"none"===n[ye]&&l+c>o)?"vertical":"horizontal"},Se=function(t){function e(t,n){return function(o,a,r,i){var s=o.options.group.name&&a.options.group.name&&o.options.group.name===a.options.group.name;if(null==t&&(n||s))return!0;if(null==t||!1===t)return!1;if(n&&"clone"===t)return t;if("function"==typeof t)return e(t(o,a,r,i),n)(o,a,r,i);var l=(n?o:a).options.group.name;return!0===t||"string"==typeof t&&t===l||t.join&&t.indexOf(l)>-1}}var n={},o=t.group;o&&"object"==K(o)||(o={name:o}),n.name=o.name,n.checkPull=e(o.pull,!0),n.checkPut=e(o.put),n.revertClone=o.revertClone,t.group=n},Ee=function(){!_e&&Yt&&pt(Yt,"display","none")},De=function(){!_e&&Yt&&pt(Yt,"display","")};ve&&!rt&&document.addEventListener("click",(function(t){if(ue)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),ue=!1,!1}),!0);var Ce=function(t){if(Rt){t=t.touches?t.touches[0]:t;var e=(a=t.clientX,r=t.clientY,de.some((function(t){var e=t[Pt].options.emptyInsertThreshold;if(e&&!Tt(t)){var n=yt(t),o=a>=n.left-e&&a<=n.right+e,s=r>=n.top-e&&r<=n.bottom+e;return o&&s?i=t:void 0}})),i);if(e){var n={};for(var o in t)t.hasOwnProperty(o)&&(n[o]=t[o]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[Pt]._onDragOver(n)}}var a,r,i},xe=function(t){Rt&&Rt.parentNode[Pt]._isOutsideThisEl(t.target)};function Ne(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=Z({},e),t[Pt]=this;var n,o,a={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Te(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==Ne.supportPointer&&"PointerEvent"in window&&!ot,emptyInsertThreshold:5};for(var r in kt.initializePlugins(this,t,a),a)!(r in e)&&(e[r]=a[r]);for(var i in Se(e),this)"_"===i.charAt(0)&&"function"==typeof this[i]&&(this[i]=this[i].bind(this));this.nativeDraggable=!e.forceFallback&&we,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?st(t,"pointerdown",this._onTapStart):(st(t,"mousedown",this._onTapStart),st(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(st(t,"dragover",this),st(t,"dragenter",this)),de.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),Z(this,(o=[],{captureAnimationState:function(){o=[],this.options.animation&&[].slice.call(this.el.children).forEach((function(t){if("none"!==pt(t,"display")&&t!==Ne.ghost){o.push({target:t,rect:yt(t)});var e=U({},o[o.length-1].rect);if(t.thisAnimationDuration){var n=ft(t,!0);n&&(e.top-=n.f,e.left-=n.e)}t.fromRect=e}}))},addAnimationState:function(t){o.push(t)},removeAnimationState:function(t){o.splice(function(t,e){for(var n in t)if(t.hasOwnProperty(n))for(var o in e)if(e.hasOwnProperty(o)&&e[o]===t[n][o])return Number(n);return-1}(o,{target:t}),1)},animateAll:function(t){var e=this;if(!this.options.animation)return clearTimeout(n),void("function"==typeof t&&t());var a=!1,r=0;o.forEach((function(t){var n=0,o=t.target,i=o.fromRect,s=yt(o),l=o.prevFromRect,c=o.prevToRect,u=t.rect,d=ft(o,!0);d&&(s.top-=d.f,s.left-=d.e),o.toRect=s,o.thisAnimationDuration&&Ct(l,s)&&!Ct(i,s)&&(u.top-s.top)/(u.left-s.left)==(i.top-s.top)/(i.left-s.left)&&(n=function(t,e,n,o){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))*o.animation}(u,l,c,e.options)),Ct(s,i)||(o.prevFromRect=i,o.prevToRect=s,n||(n=e.options.animation),e.animate(o,u,s,n)),n&&(a=!0,r=Math.max(r,n),clearTimeout(o.animationResetTimer),o.animationResetTimer=setTimeout((function(){o.animationTime=0,o.prevFromRect=null,o.fromRect=null,o.prevToRect=null,o.thisAnimationDuration=null}),n),o.thisAnimationDuration=n)})),clearTimeout(n),a?n=setTimeout((function(){"function"==typeof t&&t()}),r):"function"==typeof t&&t(),o=[]},animate:function(t,e,n,o){if(o){pt(t,"transition",""),pt(t,"transform","");var a=ft(this.el),r=a&&a.a,i=a&&a.d,s=(e.left-n.left)/(r||1),l=(e.top-n.top)/(i||1);t.animatingX=!!s,t.animatingY=!!l,pt(t,"transform","translate3d("+s+"px,"+l+"px,0)"),this.forRepaintDummy=function(t){return t.offsetWidth}(t),pt(t,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),pt(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout((function(){pt(t,"transition",""),pt(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1}),o)}}}))}function Ae(t,e,n,o,a,r,i,s){var l,c,u=t[Pt],d=u.options.onMove;return!window.CustomEvent||tt||et?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=e,l.from=t,l.dragged=n,l.draggedRect=o,l.related=a||e,l.relatedRect=r||yt(e),l.willInsertAfter=s,l.originalEvent=i,t.dispatchEvent(l),d&&(c=d.call(u,l,i)),c}function Oe(t){t.draggable=!1}function Pe(){pe=!1}function Me(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,o=0;n--;)o+=e.charCodeAt(n);return o.toString(36)}function Ie(t){return setTimeout(t,0)}function ke(t){return clearTimeout(t)}Ne.prototype={constructor:Ne,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(re=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,Rt):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,o=this.options,a=o.preventOnFilter,r=t.type,i=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,s=(i||t).target,l=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||s,c=o.filter;if(function(t){fe.length=0;for(var e=t.getElementsByTagName("input"),n=e.length;n--;){var o=e[n];o.checked&&fe.push(o)}}(n),!Rt&&!(/mousedown|pointerdown/.test(r)&&0!==t.button||o.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!ot||!s||"SELECT"!==s.tagName.toUpperCase())&&!((s=dt(s,o.draggable,n,!1))&&s.animated||Gt===s)){if(zt=St(s),Ut=St(s,o.draggable),"function"==typeof c){if(c.call(this,t,s,this))return Bt({sortable:e,rootEl:l,name:"filter",targetEl:s,toEl:n,fromEl:n}),Lt("filter",e,{evt:t}),void(a&&t.cancelable&&t.preventDefault())}else if(c&&(c=c.split(",").some((function(o){if(o=dt(l,o.trim(),n,!1))return Bt({sortable:e,rootEl:o,name:"filter",targetEl:s,fromEl:n,toEl:n}),Lt("filter",e,{evt:t}),!0}))))return void(a&&t.cancelable&&t.preventDefault());o.handle&&!dt(l,o.handle,n,!1)||this._prepareDragStart(t,i,s)}}},_prepareDragStart:function(t,e,n){var o,a=this,r=a.el,i=a.options,s=r.ownerDocument;if(n&&!Rt&&n.parentNode===r){var l=yt(n);if(jt=r,Xt=(Rt=n).parentNode,Ht=Rt.nextSibling,Gt=n,Kt=i.group,Ne.dragged=Rt,Zt={target:Rt,clientX:(e||t).clientX,clientY:(e||t).clientY},ne=Zt.clientX-l.left,oe=Zt.clientY-l.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,Rt.style["will-change"]="all",o=function(){Lt("delayEnded",a,{evt:t}),Ne.eventCanceled?a._onDrop():(a._disableDelayedDragEvents(),!nt&&a.nativeDraggable&&(Rt.draggable=!0),a._triggerDragStart(t,e),Bt({sortable:a,name:"choose",originalEvent:t}),gt(Rt,i.chosenClass,!0))},i.ignore.split(",").forEach((function(t){vt(Rt,t.trim(),Oe)})),st(s,"dragover",Ce),st(s,"mousemove",Ce),st(s,"touchmove",Ce),st(s,"mouseup",a._onDrop),st(s,"touchend",a._onDrop),st(s,"touchcancel",a._onDrop),nt&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Rt.draggable=!0),Lt("delayStart",this,{evt:t}),!i.delay||i.delayOnTouchOnly&&!e||this.nativeDraggable&&(et||tt))o();else{if(Ne.eventCanceled)return void this._onDrop();st(s,"mouseup",a._disableDelayedDrag),st(s,"touchend",a._disableDelayedDrag),st(s,"touchcancel",a._disableDelayedDrag),st(s,"mousemove",a._delayedDragTouchMoveHandler),st(s,"touchmove",a._delayedDragTouchMoveHandler),i.supportPointer&&st(s,"pointermove",a._delayedDragTouchMoveHandler),a._dragStartTimer=setTimeout(o,i.delay)}}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Rt&&Oe(Rt),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;lt(t,"mouseup",this._disableDelayedDrag),lt(t,"touchend",this._disableDelayedDrag),lt(t,"touchcancel",this._disableDelayedDrag),lt(t,"mousemove",this._delayedDragTouchMoveHandler),lt(t,"touchmove",this._delayedDragTouchMoveHandler),lt(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?st(document,"pointermove",this._onTouchMove):st(document,e?"touchmove":"mousemove",this._onTouchMove):(st(Rt,"dragend",this),st(jt,"dragstart",this._onDragStart));try{document.selection?Ie((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){if(ce=!1,jt&&Rt){Lt("dragStarted",this,{evt:e}),this.nativeDraggable&&st(document,"dragover",xe);var n=this.options;!t&>(Rt,n.dragClass,!1),gt(Rt,n.ghostClass,!0),Ne.active=this,t&&this._appendGhost(),Bt({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(Qt){this._lastX=Qt.clientX,this._lastY=Qt.clientY,Ee();for(var t=document.elementFromPoint(Qt.clientX,Qt.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Qt.clientX,Qt.clientY))!==e;)e=t;if(Rt.parentNode[Pt]._isOutsideThisEl(t),e)do{if(e[Pt]&&e[Pt]._onDragOver({clientX:Qt.clientX,clientY:Qt.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break;t=e}while(e=e.parentNode);De()}},_onTouchMove:function(t){if(Zt){var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,a=t.touches?t.touches[0]:t,r=Yt&&ft(Yt,!0),i=Yt&&r&&r.a,s=Yt&&r&&r.d,l=be&&le&&Et(le),c=(a.clientX-Zt.clientX+o.x)/(i||1)+(l?l[0]-ge[0]:0)/(i||1),u=(a.clientY-Zt.clientY+o.y)/(s||1)+(l?l[1]-ge[1]:0)/(s||1);if(!Ne.active&&!ce){if(n&&Math.max(Math.abs(a.clientX-this._lastX),Math.abs(a.clientY-this._lastY))a.right+10||t.clientY>o.bottom&&t.clientX>o.left:t.clientY>a.bottom+10||t.clientX>o.right&&t.clientY>o.top}(t,a,this)&&!p.animated){if(p===Rt)return P(!1);if(p&&r===t.target&&(i=p),i&&(n=yt(i)),!1!==Ae(jt,r,Rt,e,i,n,t,!!i))return O(),p&&p.nextSibling?r.insertBefore(Rt,p.nextSibling):r.appendChild(Rt),Xt=r,M(),P(!0)}else if(p&&function(t,e,n){var o=yt(_t(n.el,0,n.options,!0)),a=Ot(n.el,n.options,Yt);return e?t.clientXu+c*r/2:ld-se)return-ie}else if(l>u+c*(1-a)/2&&ld-c*r/2)?l>u+c/2?1:-1:0}(t,i,n,a,_?1:s.swapThreshold,null==s.invertedSwapThreshold?s.swapThreshold:s.invertedSwapThreshold,he,re===i),0!==v){var D=St(Rt);do{D-=v,y=Xt.children[D]}while(y&&("none"===pt(y,"display")||y===Yt))}if(0===v||y===i)return P(!1);re=i,ie=v;var C=i.nextElementSibling,x=!1,N=Ae(jt,r,Rt,e,i,n,t,x=1===v);if(!1!==N)return 1!==N&&-1!==N||(x=1===N),pe=!0,setTimeout(Pe,30),O(),x&&!C?r.appendChild(Rt):i.parentNode.insertBefore(Rt,x?C:i),S&&Nt(S,0,E-S.scrollTop),Xt=Rt.parentNode,void 0===b||he||(se=Math.abs(b-yt(i)[T])),M(),P(!0)}if(r.contains(Rt))return P(!1)}return!1}function A(s,l){Lt(s,h,U({evt:t,isOwner:u,axis:a?"vertical":"horizontal",revert:o,dragRect:e,targetRect:n,canSort:d,fromSortable:m,target:i,completed:P,onMove:function(n,o){return Ae(jt,r,Rt,e,n,yt(n),t,o)},changed:M},l))}function O(){A("dragOverAnimationCapture"),h.captureAnimationState(),h!==m&&m.captureAnimationState()}function P(e){return A("dragOverCompleted",{insertion:e}),e&&(u?c._hideClone():c._showClone(h),h!==m&&(gt(Rt,Jt?Jt.options.ghostClass:c.options.ghostClass,!1),gt(Rt,s.ghostClass,!0)),Jt!==h&&h!==Ne.active?Jt=h:h===Ne.active&&Jt&&(Jt=null),m===h&&(h._ignoreWhileAnimating=i),h.animateAll((function(){A("dragOverAnimationComplete"),h._ignoreWhileAnimating=null})),h!==m&&(m.animateAll(),m._ignoreWhileAnimating=null)),(i===Rt&&!Rt.animated||i===r&&!i.animated)&&(re=null),s.dragoverBubble||t.rootEl||i===document||(Rt.parentNode[Pt]._isOutsideThisEl(t.target),!e&&Ce(t)),!s.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),g=!0}function M(){Vt=St(Rt),$t=St(Rt,s.draggable),Bt({sortable:h,name:"change",toEl:r,newIndex:Vt,newDraggableIndex:$t,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){lt(document,"mousemove",this._onTouchMove),lt(document,"touchmove",this._onTouchMove),lt(document,"pointermove",this._onTouchMove),lt(document,"dragover",Ce),lt(document,"mousemove",Ce),lt(document,"touchmove",Ce)},_offUpEvents:function(){var t=this.el.ownerDocument;lt(t,"mouseup",this._onDrop),lt(t,"touchend",this._onDrop),lt(t,"pointerup",this._onDrop),lt(t,"touchcancel",this._onDrop),lt(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;Vt=St(Rt),$t=St(Rt,n.draggable),Lt("drop",this,{evt:t}),Xt=Rt&&Rt.parentNode,Vt=St(Rt),$t=St(Rt,n.draggable),Ne.eventCanceled||(ce=!1,he=!1,me=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),ke(this.cloneId),ke(this._dragStartId),this.nativeDraggable&&(lt(document,"drop",this),lt(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),ot&&pt(document.body,"user-select",""),pt(Rt,"transform",""),t&&(ae&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),Yt&&Yt.parentNode&&Yt.parentNode.removeChild(Yt),(jt===Xt||Jt&&"clone"!==Jt.lastPutMode)&&Wt&&Wt.parentNode&&Wt.parentNode.removeChild(Wt),Rt&&(this.nativeDraggable&<(Rt,"dragend",this),Oe(Rt),Rt.style["will-change"]="",ae&&!ce&>(Rt,Jt?Jt.options.ghostClass:this.options.ghostClass,!1),gt(Rt,this.options.chosenClass,!1),Bt({sortable:this,name:"unchoose",toEl:Xt,newIndex:null,newDraggableIndex:null,originalEvent:t}),jt!==Xt?(Vt>=0&&(Bt({rootEl:Xt,name:"add",toEl:Xt,fromEl:jt,originalEvent:t}),Bt({sortable:this,name:"remove",toEl:Xt,originalEvent:t}),Bt({rootEl:Xt,name:"sort",toEl:Xt,fromEl:jt,originalEvent:t}),Bt({sortable:this,name:"sort",toEl:Xt,originalEvent:t})),Jt&&Jt.save()):Vt!==zt&&Vt>=0&&(Bt({sortable:this,name:"update",toEl:Xt,originalEvent:t}),Bt({sortable:this,name:"sort",toEl:Xt,originalEvent:t})),Ne.active&&(null!=Vt&&-1!==Vt||(Vt=zt,$t=Ut),Bt({sortable:this,name:"end",toEl:Xt,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){Lt("nulling",this),jt=Rt=Xt=Yt=Ht=Wt=Gt=qt=Zt=Qt=ae=Vt=$t=zt=Ut=re=ie=Jt=Kt=Ne.dragged=Ne.ghost=Ne.clone=Ne.active=null,fe.forEach((function(t){t.checked=!0})),fe.length=te=ee=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":Rt&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],n=this.el.children,o=0,a=n.length,r=this.options;o{const e=t.target;this.name(e.value),this.slug((0,hn.slug)(e.value))}})),50),t.add("slug",m("div",{className:"Form-group"},m("label",null,a().translator.trans("flarum-tags.admin.edit_tag.slug_label")),m("input",{className:"FormControl",bidi:this.slug})),40),t.add("description",m("div",{className:"Form-group"},m("label",null,a().translator.trans("flarum-tags.admin.edit_tag.description_label")),m("textarea",{className:"FormControl",bidi:this.description})),30),t.add("color",m("div",{className:"Form-group"},m("label",null,a().translator.trans("flarum-tags.admin.edit_tag.color_label")),m(un(),{className:"FormControl",placeholder:"#aaaaaa",bidi:this.color})),20),t.add("icon",m("div",{className:"Form-group"},m("label",null,a().translator.trans("flarum-tags.admin.edit_tag.icon_label")),m("div",{className:"helpText"},a().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",bidi:this.icon})),10),t.add("hidden",m("div",{className:"Form-group"},m("div",null,m("label",{className:"checkbox"},m("input",{type:"checkbox",bidi:this.isHidden}),a().translator.trans("flarum-tags.admin.edit_tag.hide_label")))),10),t.add("submit",m("div",{className:"Form-group Form-controls"},m(g(),{type:"submit",className:"Button Button--primary EditTagModal-save",loading:this.loading},a().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)},a().translator.trans("flarum-tags.admin.edit_tag.delete_tag_button"))),-10),t}submitData(){return{name:this.name(),slug:this.slug(),description:this.description(),color:this.color(),icon:this.icon(),isHidden:this.isHidden(),isPrimary:this.isPrimary()}}onsubmit(t){t.preventDefault(),this.loading=!0,this.tag.save(this.submitData()).then((()=>this.hide()),(()=>this.loading=!1))}delete(){if(confirm(vn()(a().translator.trans("flarum-tags.admin.edit_tag.delete_tag_confirmation")))){const t=a().store.all("tags").filter((t=>t.parent()===this.tag));this.tag.delete().then((()=>{t.forEach((t=>t.pushData({attributes:{isChild:!1}}))),m.redraw()})),this.hide()}}}function yn(t){return m("li",{"data-id":t.id(),style:{color:t.color()}},m("div",{className:"TagListItem-info"},(0,b.A)(t),m("span",{className:"TagListItem-name"},t.name()),m(g(),{className:"Button Button--link",icon:"fas fa-pencil-alt",onclick:()=>a().modal.show(bn,{model:t})})),!t.isChild()&&null!==t.position()&&m("ol",{className:"TagListItem-children TagList"},(0,y.A)(a().store.all("tags")).filter((e=>e.parent()===t)).map(yn)))}flarum.reg.add("flarum-tags","admin/components/EditTagModal",bn);class wn extends(Je()){oninit(t){super.oninit(t),this.forcedRefreshKey=0,this.loading=!0,a().tagList.load(["parent"]).then((()=>{this.loading=!1,m.redraw()}))}content(){if(this.loading)return m(f(),null);const 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),o=this.setting("flarum-tags.max_secondary_tags",0),r=(0,y.A)(a().store.all("tags").filter((t=>!t.parent())));return m("div",{className:"TagsContent"},m("div",{className:"TagsContent-list"},m("div",{className:"container",key:this.forcedRefreshKey,oncreate:this.onListOnCreate.bind(this)},m(on(),null,m(rn(),{className:"TagGroup",label:a().translator.trans("flarum-tags.admin.tags.primary_heading")},m("ol",{className:"TagList TagList--primary"},r.filter((t=>null!==t.position()&&!t.isChild())).map(yn)),m(g(),{className:"Button TagList-button",icon:"fas fa-plus",onclick:()=>a().modal.show(bn,{primary:!0})},a().translator.trans("flarum-tags.admin.tags.create_primary_tag_button"))),m(rn(),{className:"TagGroup TagGroup--secondary",label:a().translator.trans("flarum-tags.admin.tags.secondary_heading")},m("ul",{className:"TagList"},r.filter((t=>null===t.position())).sort(((t,e)=>t.name().localeCompare(e.name()))).map(yn)),m(g(),{className:"Button TagList-button",icon:"fas fa-plus",onclick:()=>a().modal.show(bn,{primary:!1})},a().translator.trans("flarum-tags.admin.tags.create_secondary_tag_button"))),m(rn(),{label:a().translator.trans("flarum-tags.admin.tags.settings_heading")},m(en(),null,m("div",{className:"Form-group"},m("label",null,a().translator.trans("flarum-tags.admin.tag_settings.required_primary_heading")),m("div",{className:"helpText"},a().translator.trans("flarum-tags.admin.tag_settings.required_primary_text")),m("div",{className:"TagSettings-rangeInput"},m("input",{className:"FormControl",type:"number",min:"0",value:t(),oninput:Qe()("value",this.setMinTags.bind(this,t,e))}),a().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,a().translator.trans("flarum-tags.admin.tag_settings.required_secondary_heading")),m("div",{className:"helpText"},a().translator.trans("flarum-tags.admin.tag_settings.required_secondary_text")),m("div",{className:"TagSettings-rangeInput"},m("input",{className:"FormControl",type:"number",min:"0",value:n(),oninput:Qe()("value",this.setMinTags.bind(this,n,o))}),a().translator.trans("flarum-tags.admin.tag_settings.range_separator_text"),m("input",{className:"FormControl",type:"number",min:n(),bidi:o}))),m("div",{className:"Form-group Form-controls"},this.submitButton())))),m("div",{className:"TagsContent-footer"},m("p",null,a().translator.trans("flarum-tags.admin.tags.about_tags_text"))))))}onListOnCreate(t){this.$(".TagList").get().map((t=>{$e.create(t,{group:"tags",delay:50,delayOnTouchOnly:!0,touchStartThreshold:5,animation:150,swapThreshold:.65,dragClass:"sortable-dragging",ghostClass:"sortable-placeholder",onSort:t=>this.onSortUpdate(t)})}))}setMinTags(t,e,n){t(n),e(Math.max(n,e()))}onSortUpdate(t){t.from instanceof HTMLOListElement&&t.to instanceof HTMLUListElement&&a().store.getById("tags",t.item.getAttribute("data-id")).pushData({attributes:{position:null,isChild:!1},relationships:{parent:null}});const e=this.$(".TagList--primary > li").map((function(){return{id:$(this).data("id"),children:$(this).find("li").map((function(){return $(this).data("id")})).get()}})).get();e.forEach(((t,e)=>{const n=a().store.getById("tags",t.id);n.pushData({attributes:{position:e,isChild:!1},relationships:{parent:null}}),t.children.forEach(((t,e)=>{a().store.getById("tags",t).pushData({attributes:{position:e,isChild:!0},relationships:{parent:n}})}))})),a().request({url:a().forum.attribute("apiUrl")+"/tags/order",method:"POST",body:{order:e}}),this.forcedRefreshKey++,m.redraw()}}flarum.reg.add("flarum-tags","admin/components/TagsPage",wn);const _n=[...z,(new(R().Admin)).page(wn).permission((()=>({icon:"fas fa-tag",label:a().translator.trans("flarum-tags.admin.permissions.tag_discussions_label"),permission:"discussion.tag"})),"moderate",95).permission((()=>({icon:"fas fa-tags",label:a().translator.trans("flarum-tags.admin.permissions.bypass_tag_counts_label"),permission:"bypassTagCounts"})),"start",89)];a().initializers.add("flarum-tags",(t=>{t.tagList=new L,(0,r.extend)(s().prototype,"oninit",(function(){this.loading=!0})),(0,r.extend)(s().prototype,"oncreate",(function(){a().tagList.load().then((()=>{this.loading=!1,m.redraw()}))})),(0,r.override)(s().prototype,"view",(function(t,e){return this.loading?m(f(),null):t(e)})),(0,r.override)(a(),"getRequiredPermissions",((t,e)=>{const n=e.match(/^tag\d+\./);return n?t(e.substr(n[0].length)).map((t=>n[0]+t)):t(e)})),(0,r.extend)(s().prototype,"scopeItems",(t=>{(0,y.A)(a().store.all("tags")).filter((t=>t.isRestricted())).forEach((e=>t.add("tag"+e.id(),{label:(0,v.A)(e),onremove:()=>e.save({isRestricted:!1}),render:t=>{var n;return"setting"in t?null:"viewForum"===t.permission||"startDiscussion"===t.permission||null!=(n=t.permission)&&n.startsWith("discussion.")&&!1!==t.tagScoped||t.tagScoped?m(c(),{permission:"tag".concat(e.id(),".").concat(t.permission),allowGuest:t.allowGuest}):null}})))})),(0,r.extend)(s().prototype,"scopeControlItems",(t=>{const e=(0,y.A)(a().store.all("tags").filter((t=>!t.isRestricted())));e.length&&t.add("tag",m(d(),{className:"Dropdown--restrictByTag",buttonClassName:"Button Button--text",label:a().translator.trans("flarum-tags.admin.permissions.restrict_by_tag_heading"),icon:"fas fa-plus",caretIcon:null},e.map((t=>m(g(),{icon:!0,onclick:()=>t.save({isRestricted:!0})},[(0,b.A)(t,{className:"Button-icon"})," ",t.name()])))))})),T(),(0,r.extend)(s().prototype,"startItems",(t=>{t.add("allowTagChange",{icon:"fas fa-tag",label:a().translator.trans("flarum-tags.admin.permissions.allow_edit_tags_label"),setting:()=>{const t=parseInt(a().data.settings.allow_tag_change,10);return m(E(),{defaultLabel:t?a().translator.trans("core.admin.permissions_controls.allow_some_minutes_button",{count:t}):a().translator.trans("core.admin.permissions_controls.allow_indefinitely_button"),key:"allow_tag_change",options:[{value:"-1",label:a().translator.trans("core.admin.permissions_controls.allow_indefinitely_button")},{value:"10",label:a().translator.trans("core.admin.permissions_controls.allow_ten_minutes_button")},{value:"reply",label:a().translator.trans("core.admin.permissions_controls.allow_until_reply_button")}]})}},90)})),(0,r.extend)(I().prototype,"customFieldComponents",(function(t){t.add("flarum-tags.select-tags",(t=>m(P,Object.assign({},t,{settingValue:t.bidi}))))}))}))},968:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});var o=n(443),a=n.n(o);function r(t,e,n){void 0===e&&(e={}),void 0===n&&(n={});const o=t&&t.icon(),{useColor:r=!0}=n;return e.className=a()([e.className,"icon text-colored",o?t.icon():"TagIcon"]),t&&r?(e.style=e.style||{},e.style["--color"]=t.color()):t||(e.className+=" untagged"),o?m("i",e):m("span",e)}flarum.reg.add("flarum-tags","common/helpers/tagIcon",r)},339:(t,e,n)=>{"use strict";n.d(e,{A:()=>h});var o=n(414),a=n.n(o),r=n(88),i=n.n(r),s=n(443),l=n.n(s),c=n(296),u=n.n(c),d=n(968);function h(t,e){void 0===e&&(e={}),e.style=e.style||{},e.className="TagLabel "+(e.className||"");const n=a()(e,"link"),o=t?t.name():app.translator.trans("flarum-tags.lib.deleted_tag_text");if(t){const o=t.color();o&&(e.style["--tag-bg"]=o,e.className=l()(e.className,"colored",u()(o))),n&&(e.title=t.description()||"",e.href=app.route("tag",{tags:t.slug()})),t.isChild()&&(e.className+=" TagLabel--child")}else e.className+=" untagged";return m(n?i():"span",e,m("span",{className:"TagLabel-text"},t&&t.icon()&&(0,d.A)(t,{className:"TagLabel-icon"},{useColor:!1}),m("span",{className:"TagLabel-name"},o)))}flarum.reg.add("flarum-tags","common/helpers/tagLabel",h)},85:()=>{},618:(t,e,n)=>{"use strict";function o(t){return t.slice(0).sort(((t,e)=>{const n=t.position(),o=e.position();if(null===n&&null===o)return e.discussionCount()-t.discussionCount();if(null===o)return-1;if(null===n)return 1;const a=t.parent(),r=e.parent();return a===r?n-o:a&&r?a.position()-r.position():a?a===e?1:a.position()-o:r?r===t?-1:n-r.position():0}))}n.d(e,{A:()=>o}),flarum.reg.add("flarum-tags","common/utils/sortTags",o)},950:t=>{"use strict";t.exports=flarum.reg.get("core","common/Component")},954:t=>{"use strict";t.exports=flarum.reg.get("core","common/app")},336:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/Button")},15:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/FormModal")},88:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/Link")},661:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/LoadingIndicator")},607:t=>{"use strict";t.exports=flarum.reg.get("core","common/helpers/highlight")},296:t=>{"use strict";t.exports=flarum.reg.get("core","common/helpers/textContrastClass")},280:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/KeyboardNavigatable")},821:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/Stream")},443:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/classList")},414:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/extract")},233:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/extractText")},805:(t,e,n)=>{"use strict";function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function a(t,e,n){return a=function(t,e){if("object"!=o(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var a=n.call(t,"string");if("object"!=o(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e),(e="symbol"==o(a)?a:a+"")in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t;var a}n.d(e,{A:()=>a})}},o={};function a(t){var e=o[t];if(void 0!==e)return e.exports;var r=o[t]={exports:{}};return n[t](r,r.exports,a),r.exports}a.m=n,a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var n in e)a.o(e,n)&&!a.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},a.f={},a.e=t=>Promise.all(Object.keys(a.f).reduce(((e,n)=>(a.f[n](t,e),e)),[])),a.u=t=>"common/components/TagSelectionModal.js",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t={},e="module.exports:",a.l=(n,o,r,i)=>{if(t[n])t[n].push(o);else{var s,l;if(void 0!==r)for(var c=document.getElementsByTagName("script"),u=0;u{s.onerror=s.onload=null,clearTimeout(h);var a=t[n];if(delete t[n],s.parentNode&&s.parentNode.removeChild(s),a&&a.forEach((t=>t(o))),e)return e(o)},h=setTimeout(m.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=m.bind(null,s.onerror),s.onload=m.bind(null,s.onload),l&&document.head.appendChild(s)}},a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;a.g.importScripts&&(t=a.g.location+"");var e=a.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var n=e.getElementsByTagName("script");if(n.length)for(var o=n.length-1;o>-1&&(!t||!/^http(s?):/.test(t));)t=n[o--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=t})(),a.f.compat=(t,e)=>{const n=a.l;a.l=flarum.reg.loadChunk.bind(flarum.reg,n)},(()=>{var t={884:0};a.f.j=(e,n)=>{var o=a.o(t,e)?t[e]:void 0;if(0!==o)if(o)n.push(o[2]);else{var r=new Promise(((n,a)=>o=t[e]=[n,a]));n.push(o[2]=r);var i=a.p+a.u(e),s=new Error;a.l(i,(n=>{if(a.o(t,e)&&(0!==(o=t[e])&&(t[e]=void 0),o)){var r=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;s.message="Loading chunk "+e+" failed.\n("+r+": "+i+")",s.name="ChunkLoadError",s.type=r,s.request=i,o[1](s)}}),"chunk-"+e,e)}};var e=(e,n)=>{var o,r,[i,s,l]=n,c=0;if(i.some((e=>0!==t[e]))){for(o in s)a.o(s,o)&&(a.m[o]=s[o]);l&&l(a)}for(e&&e(n);c{"use strict";a.r(r),a.d(r,{extend:()=>n.X});var t=a(85),e={};for(const n in t)"default"!==n&&(e[n]=()=>t[n]);a.d(r,e);var n=a(400)})(),module.exports=r})(); +(()=>{var t,e,n={400:(t,e,n)=>{"use strict";n.d(e,{X:()=>_n});const o=flarum.reg.get("core","admin/app");var a=n.n(o);const r=flarum.reg.get("core","common/extend"),i=flarum.reg.get("core","admin/components/PermissionGrid");var s=n.n(i);const l=flarum.reg.get("core","admin/components/PermissionDropdown");var c=n.n(l);const u=flarum.reg.get("core","common/components/Dropdown");var d=n.n(u),h=n(336),g=n.n(h),p=n(661),f=n.n(p),v=n(339),b=n(968),y=n(618);const w=flarum.reg.get("core","admin/components/BasicsPage");var _=n.n(w);function T(){(0,r.extend)(_(),"homePageItems",(t=>{t.add("tags",{path:"/tags",label:app.translator.trans("flarum-tags.admin.basics.tags_label")})}))}const S=flarum.reg.get("core","admin/components/SettingDropdown");var E=n.n(S),D=n(805),C=n(950),x=n.n(C),N=(n(414),n(443)),A=n.n(N);function O(t,e){void 0===e&&(e={});const n=[],{link:o,...a}=e;return a.className=A()("TagsLabel",a.className),t?(0,y.A)(t).forEach((e=>{(e||1===t.length)&&n.push((0,v.A)(e,{link:o}))})):n.push((0,v.A)()),m("span",a,n)}flarum.reg.add("flarum-tags","common/helpers/tagsLabel",O);class P extends(x()){constructor(){super(...arguments),(0,D.A)(this,"tags",[]),(0,D.A)(this,"loaded",!1)}view(){const t=JSON.parse(this.attrs.settingValue()||"[]");return this.loaded||a().tagList.load(["parent"]).then((e=>{this.tags=e.filter((e=>t.includes(e.id()))),this.loaded=!0,m.redraw()})),m("div",{className:"Form-group SelectTagsSettingComponent"},m("label",null,this.attrs.label),this.attrs.help&&m("p",{className:"helpText"},this.attrs.help),this.loaded?m(g(),{className:"Button Button--text",onclick:()=>a().modal.show((()=>n.e(955).then(n.bind(n,671))),{selectedTags:this.tags,onsubmit:t=>{this.tags=t,this.attrs.settingValue(JSON.stringify(t.map((t=>t.id()))))},...this.attrs.options})},this.tags.length?O(this.tags):m("span",{className:"TagLabel untagged"},a().translator.trans("flarum-tags.admin.settings.button_text"))):m(f(),{size:"small",display:"inline"}))}}flarum.reg.add("flarum-tags","admin/components/SelectTagsSettingComponent",P),flarum.reg.addChunkModule("955","671","flarum-tags","common/components/TagSelectionModal"),flarum.reg.addChunkModule("955","671","flarum-tags","forum/components/ToggleButton");const M=flarum.reg.get("core","common/components/FormGroup");var I=n.n(M),k=n(954),F=n.n(k);class L{constructor(){(0,D.A)(this,"loadedIncludes",void 0)}async load(t){if(void 0===t&&(t=[]),!this.loadedIncludes)return this.query(t);const e=t.filter((t=>!this.loadedIncludes.has(t)));return 0===e.length?Promise.resolve(F().store.all("tags")):this.query(e)}async query(t){return void 0===t&&(t=[]),null!=this.loadedIncludes||(this.loadedIncludes=new Set),F().store.find("tags",{include:t.join(",")}).then((e=>{const n=Array.isArray(e)?e:[e];return t.forEach((t=>this.loadedIncludes.add(t))),n}))}}flarum.reg.add("flarum-tags","common/states/TagListState",L);const B=flarum.reg.get("core","common/extenders");var R=n.n(B);const X=flarum.reg.get("core","common/utils/computed");var Y=n.n(X);const j=flarum.reg.get("core","common/Model");var H=n.n(j);class G extends(H()){name(){return H().attribute("name").call(this)}slug(){return H().attribute("slug").call(this)}description(){return H().attribute("description").call(this)}color(){return H().attribute("color").call(this)}backgroundUrl(){return H().attribute("backgroundUrl").call(this)}backgroundMode(){return H().attribute("backgroundMode").call(this)}icon(){return H().attribute("icon").call(this)}position(){return H().attribute("position").call(this)}parent(){return H().hasOne("parent").call(this)}children(){return H().hasMany("children").call(this)}defaultSort(){return H().attribute("defaultSort").call(this)}isChild(){return H().attribute("isChild").call(this)}isHidden(){return H().attribute("isHidden").call(this)}isPrimary(){return H().attribute("isPrimary").call(this)}discussionCount(){return H().attribute("discussionCount").call(this)}lastPostedAt(){return H().attribute("lastPostedAt",H().transformDate).call(this)}lastPostedDiscussion(){return H().hasOne("lastPostedDiscussion").call(this)}isRestricted(){return H().attribute("isRestricted").call(this)}canStartDiscussion(){return H().attribute("canStartDiscussion").call(this)}canAddToDiscussion(){return H().attribute("canAddToDiscussion").call(this)}isPrimaryParent(){return Y()("position","parent",((t,e)=>null!==t&&!1===e)).call(this)}}flarum.reg.add("flarum-tags","common/models/Tag",G);const W=flarum.reg.get("core","common/query/IGambit");class q extends W.KeyValueGambit{constructor(){super(...arguments),(0,D.A)(this,"predicates",!0)}key(){return F().translator.trans("flarum-tags.lib.gambits.discussions.tag.key",{},!0)}hint(){return F().translator.trans("flarum-tags.lib.gambits.discussions.tag.hint",{},!0)}filterKey(){return"tag"}gambitValueToFilterValue(t){return[t]}fromFilter(t,e){let n=[];return Array.isArray(t)?(n=t.map((t=>this.fromFilter(t.toString(),e))),n.join(" ")):"".concat(e?"-":"").concat(this.key(),":").concat(this.filterValueToGambitValue(t))}filterValueToGambitValue(t){return t}}flarum.reg.add("flarum-tags","common/query/discussions/TagGambit",q);const z=[(new(R().Store)).add("tags",G),(new(R().Search)).gambit("discussions",q)];function V(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function U(t){for(var e=1;e"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return!1}return!1}}function ut(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function dt(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&ct(t,e):ct(t,e))||o&&t===n)return t;if(t===n)break}while(t=ut(t))}return null}var mt,ht=/\s+/g;function gt(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(ht," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(ht," ")}}function pt(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in o||-1!==e.indexOf("webkit")||(e="-webkit-"+e),o[e]=n+("string"==typeof n?"":"px")}}function ft(t,e){var n="";if("string"==typeof t)n=t;else do{var o=pt(t,"transform");o&&"none"!==o&&(n=o+" "+n)}while(!e&&(t=t.parentNode));var a=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return a&&new a(n)}function vt(t,e,n){if(t){var o=t.getElementsByTagName(e),a=0,r=o.length;if(n)for(;a=r:a<=r))return o;if(o===bt())break;o=Dt(o,!1)}return!1}function _t(t,e,n,o){for(var a=0,r=0,i=t.children;r2&&void 0!==arguments[2]?arguments[2]:{},o=n.evt,a=function(t,e){if(null==t)return{};var n,o,a=function(t,e){if(null==t)return{};var n,o,a={},r=Object.keys(t);for(o=0;o=0||(a[n]=t[n]);return a}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(a[n]=t[n])}return a}(n,Ft);kt.pluginEvent.bind(Ne)(t,e,U({dragEl:Rt,parentEl:Xt,ghostEl:Yt,rootEl:jt,nextEl:Ht,lastDownEl:Gt,cloneEl:Wt,cloneHidden:qt,dragStarted:ae,putSortable:Jt,activeSortable:Ne.active,originalEvent:o,oldIndex:zt,oldDraggableIndex:Ut,newIndex:Vt,newDraggableIndex:$t,hideGhostForTarget:Ee,unhideGhostForTarget:De,cloneNowHidden:function(){qt=!0},cloneNowShown:function(){qt=!1},dispatchSortableEvent:function(t){Bt({sortable:e,name:t,originalEvent:o})}},a))};function Bt(t){!function(t){var e=t.sortable,n=t.rootEl,o=t.name,a=t.targetEl,r=t.cloneEl,i=t.toEl,s=t.fromEl,l=t.oldIndex,c=t.newIndex,u=t.oldDraggableIndex,d=t.newDraggableIndex,m=t.originalEvent,h=t.putSortable,g=t.extraEventProperties;if(e=e||n&&n[Pt]){var p,f=e.options,v="on"+o.charAt(0).toUpperCase()+o.substr(1);!window.CustomEvent||tt||et?(p=document.createEvent("Event")).initEvent(o,!0,!0):p=new CustomEvent(o,{bubbles:!0,cancelable:!0}),p.to=i||n,p.from=s||n,p.item=a||n,p.clone=r,p.oldIndex=l,p.newIndex=c,p.oldDraggableIndex=u,p.newDraggableIndex=d,p.originalEvent=m,p.pullMode=h?h.lastPutMode:void 0;var b=U(U({},g),kt.getEventProperties(o,e));for(var y in b)p[y]=b[y];n&&n.dispatchEvent(p),f[v]&&f[v].call(e,p)}}(U({putSortable:Jt,cloneEl:Wt,targetEl:Rt,rootEl:jt,oldIndex:zt,oldDraggableIndex:Ut,newIndex:Vt,newDraggableIndex:$t},t))}var Rt,Xt,Yt,jt,Ht,Gt,Wt,qt,zt,Vt,Ut,$t,Kt,Jt,Zt,Qt,te,ee,ne,oe,ae,re,ie,se,le,ce=!1,ue=!1,de=[],me=!1,he=!1,ge=[],pe=!1,fe=[],ve="undefined"!=typeof document,be=at,ye=et||tt?"cssFloat":"float",we=ve&&!rt&&!at&&"draggable"in document.createElement("div"),_e=function(){if(ve){if(tt)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),Te=function(t,e){var n=pt(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),a=_t(t,0,e),r=_t(t,1,e),i=a&&pt(a),s=r&&pt(r),l=i&&parseInt(i.marginLeft)+parseInt(i.marginRight)+yt(a).width,c=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+yt(r).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(a&&i.float&&"none"!==i.float){var u="left"===i.float?"left":"right";return!r||"both"!==s.clear&&s.clear!==u?"horizontal":"vertical"}return a&&("block"===i.display||"flex"===i.display||"table"===i.display||"grid"===i.display||l>=o&&"none"===n[ye]||r&&"none"===n[ye]&&l+c>o)?"vertical":"horizontal"},Se=function(t){function e(t,n){return function(o,a,r,i){var s=o.options.group.name&&a.options.group.name&&o.options.group.name===a.options.group.name;if(null==t&&(n||s))return!0;if(null==t||!1===t)return!1;if(n&&"clone"===t)return t;if("function"==typeof t)return e(t(o,a,r,i),n)(o,a,r,i);var l=(n?o:a).options.group.name;return!0===t||"string"==typeof t&&t===l||t.join&&t.indexOf(l)>-1}}var n={},o=t.group;o&&"object"==K(o)||(o={name:o}),n.name=o.name,n.checkPull=e(o.pull,!0),n.checkPut=e(o.put),n.revertClone=o.revertClone,t.group=n},Ee=function(){!_e&&Yt&&pt(Yt,"display","none")},De=function(){!_e&&Yt&&pt(Yt,"display","")};ve&&!rt&&document.addEventListener("click",(function(t){if(ue)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),ue=!1,!1}),!0);var Ce=function(t){if(Rt){t=t.touches?t.touches[0]:t;var e=(a=t.clientX,r=t.clientY,de.some((function(t){var e=t[Pt].options.emptyInsertThreshold;if(e&&!Tt(t)){var n=yt(t),o=a>=n.left-e&&a<=n.right+e,s=r>=n.top-e&&r<=n.bottom+e;return o&&s?i=t:void 0}})),i);if(e){var n={};for(var o in t)t.hasOwnProperty(o)&&(n[o]=t[o]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[Pt]._onDragOver(n)}}var a,r,i},xe=function(t){Rt&&Rt.parentNode[Pt]._isOutsideThisEl(t.target)};function Ne(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=Z({},e),t[Pt]=this;var n,o,a={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Te(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==Ne.supportPointer&&"PointerEvent"in window&&!ot,emptyInsertThreshold:5};for(var r in kt.initializePlugins(this,t,a),a)!(r in e)&&(e[r]=a[r]);for(var i in Se(e),this)"_"===i.charAt(0)&&"function"==typeof this[i]&&(this[i]=this[i].bind(this));this.nativeDraggable=!e.forceFallback&&we,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?st(t,"pointerdown",this._onTapStart):(st(t,"mousedown",this._onTapStart),st(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(st(t,"dragover",this),st(t,"dragenter",this)),de.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),Z(this,(o=[],{captureAnimationState:function(){o=[],this.options.animation&&[].slice.call(this.el.children).forEach((function(t){if("none"!==pt(t,"display")&&t!==Ne.ghost){o.push({target:t,rect:yt(t)});var e=U({},o[o.length-1].rect);if(t.thisAnimationDuration){var n=ft(t,!0);n&&(e.top-=n.f,e.left-=n.e)}t.fromRect=e}}))},addAnimationState:function(t){o.push(t)},removeAnimationState:function(t){o.splice(function(t,e){for(var n in t)if(t.hasOwnProperty(n))for(var o in e)if(e.hasOwnProperty(o)&&e[o]===t[n][o])return Number(n);return-1}(o,{target:t}),1)},animateAll:function(t){var e=this;if(!this.options.animation)return clearTimeout(n),void("function"==typeof t&&t());var a=!1,r=0;o.forEach((function(t){var n=0,o=t.target,i=o.fromRect,s=yt(o),l=o.prevFromRect,c=o.prevToRect,u=t.rect,d=ft(o,!0);d&&(s.top-=d.f,s.left-=d.e),o.toRect=s,o.thisAnimationDuration&&Ct(l,s)&&!Ct(i,s)&&(u.top-s.top)/(u.left-s.left)==(i.top-s.top)/(i.left-s.left)&&(n=function(t,e,n,o){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))*o.animation}(u,l,c,e.options)),Ct(s,i)||(o.prevFromRect=i,o.prevToRect=s,n||(n=e.options.animation),e.animate(o,u,s,n)),n&&(a=!0,r=Math.max(r,n),clearTimeout(o.animationResetTimer),o.animationResetTimer=setTimeout((function(){o.animationTime=0,o.prevFromRect=null,o.fromRect=null,o.prevToRect=null,o.thisAnimationDuration=null}),n),o.thisAnimationDuration=n)})),clearTimeout(n),a?n=setTimeout((function(){"function"==typeof t&&t()}),r):"function"==typeof t&&t(),o=[]},animate:function(t,e,n,o){if(o){pt(t,"transition",""),pt(t,"transform","");var a=ft(this.el),r=a&&a.a,i=a&&a.d,s=(e.left-n.left)/(r||1),l=(e.top-n.top)/(i||1);t.animatingX=!!s,t.animatingY=!!l,pt(t,"transform","translate3d("+s+"px,"+l+"px,0)"),this.forRepaintDummy=function(t){return t.offsetWidth}(t),pt(t,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),pt(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout((function(){pt(t,"transition",""),pt(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1}),o)}}}))}function Ae(t,e,n,o,a,r,i,s){var l,c,u=t[Pt],d=u.options.onMove;return!window.CustomEvent||tt||et?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=e,l.from=t,l.dragged=n,l.draggedRect=o,l.related=a||e,l.relatedRect=r||yt(e),l.willInsertAfter=s,l.originalEvent=i,t.dispatchEvent(l),d&&(c=d.call(u,l,i)),c}function Oe(t){t.draggable=!1}function Pe(){pe=!1}function Me(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,o=0;n--;)o+=e.charCodeAt(n);return o.toString(36)}function Ie(t){return setTimeout(t,0)}function ke(t){return clearTimeout(t)}Ne.prototype={constructor:Ne,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(re=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,Rt):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,o=this.options,a=o.preventOnFilter,r=t.type,i=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,s=(i||t).target,l=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||s,c=o.filter;if(function(t){fe.length=0;for(var e=t.getElementsByTagName("input"),n=e.length;n--;){var o=e[n];o.checked&&fe.push(o)}}(n),!Rt&&!(/mousedown|pointerdown/.test(r)&&0!==t.button||o.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!ot||!s||"SELECT"!==s.tagName.toUpperCase())&&!((s=dt(s,o.draggable,n,!1))&&s.animated||Gt===s)){if(zt=St(s),Ut=St(s,o.draggable),"function"==typeof c){if(c.call(this,t,s,this))return Bt({sortable:e,rootEl:l,name:"filter",targetEl:s,toEl:n,fromEl:n}),Lt("filter",e,{evt:t}),void(a&&t.cancelable&&t.preventDefault())}else if(c&&(c=c.split(",").some((function(o){if(o=dt(l,o.trim(),n,!1))return Bt({sortable:e,rootEl:o,name:"filter",targetEl:s,fromEl:n,toEl:n}),Lt("filter",e,{evt:t}),!0}))))return void(a&&t.cancelable&&t.preventDefault());o.handle&&!dt(l,o.handle,n,!1)||this._prepareDragStart(t,i,s)}}},_prepareDragStart:function(t,e,n){var o,a=this,r=a.el,i=a.options,s=r.ownerDocument;if(n&&!Rt&&n.parentNode===r){var l=yt(n);if(jt=r,Xt=(Rt=n).parentNode,Ht=Rt.nextSibling,Gt=n,Kt=i.group,Ne.dragged=Rt,Zt={target:Rt,clientX:(e||t).clientX,clientY:(e||t).clientY},ne=Zt.clientX-l.left,oe=Zt.clientY-l.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,Rt.style["will-change"]="all",o=function(){Lt("delayEnded",a,{evt:t}),Ne.eventCanceled?a._onDrop():(a._disableDelayedDragEvents(),!nt&&a.nativeDraggable&&(Rt.draggable=!0),a._triggerDragStart(t,e),Bt({sortable:a,name:"choose",originalEvent:t}),gt(Rt,i.chosenClass,!0))},i.ignore.split(",").forEach((function(t){vt(Rt,t.trim(),Oe)})),st(s,"dragover",Ce),st(s,"mousemove",Ce),st(s,"touchmove",Ce),st(s,"mouseup",a._onDrop),st(s,"touchend",a._onDrop),st(s,"touchcancel",a._onDrop),nt&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Rt.draggable=!0),Lt("delayStart",this,{evt:t}),!i.delay||i.delayOnTouchOnly&&!e||this.nativeDraggable&&(et||tt))o();else{if(Ne.eventCanceled)return void this._onDrop();st(s,"mouseup",a._disableDelayedDrag),st(s,"touchend",a._disableDelayedDrag),st(s,"touchcancel",a._disableDelayedDrag),st(s,"mousemove",a._delayedDragTouchMoveHandler),st(s,"touchmove",a._delayedDragTouchMoveHandler),i.supportPointer&&st(s,"pointermove",a._delayedDragTouchMoveHandler),a._dragStartTimer=setTimeout(o,i.delay)}}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Rt&&Oe(Rt),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;lt(t,"mouseup",this._disableDelayedDrag),lt(t,"touchend",this._disableDelayedDrag),lt(t,"touchcancel",this._disableDelayedDrag),lt(t,"mousemove",this._delayedDragTouchMoveHandler),lt(t,"touchmove",this._delayedDragTouchMoveHandler),lt(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?st(document,"pointermove",this._onTouchMove):st(document,e?"touchmove":"mousemove",this._onTouchMove):(st(Rt,"dragend",this),st(jt,"dragstart",this._onDragStart));try{document.selection?Ie((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){if(ce=!1,jt&&Rt){Lt("dragStarted",this,{evt:e}),this.nativeDraggable&&st(document,"dragover",xe);var n=this.options;!t&>(Rt,n.dragClass,!1),gt(Rt,n.ghostClass,!0),Ne.active=this,t&&this._appendGhost(),Bt({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(Qt){this._lastX=Qt.clientX,this._lastY=Qt.clientY,Ee();for(var t=document.elementFromPoint(Qt.clientX,Qt.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Qt.clientX,Qt.clientY))!==e;)e=t;if(Rt.parentNode[Pt]._isOutsideThisEl(t),e)do{if(e[Pt]&&e[Pt]._onDragOver({clientX:Qt.clientX,clientY:Qt.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break;t=e}while(e=e.parentNode);De()}},_onTouchMove:function(t){if(Zt){var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,a=t.touches?t.touches[0]:t,r=Yt&&ft(Yt,!0),i=Yt&&r&&r.a,s=Yt&&r&&r.d,l=be&&le&&Et(le),c=(a.clientX-Zt.clientX+o.x)/(i||1)+(l?l[0]-ge[0]:0)/(i||1),u=(a.clientY-Zt.clientY+o.y)/(s||1)+(l?l[1]-ge[1]:0)/(s||1);if(!Ne.active&&!ce){if(n&&Math.max(Math.abs(a.clientX-this._lastX),Math.abs(a.clientY-this._lastY))a.right+10||t.clientY>o.bottom&&t.clientX>o.left:t.clientY>a.bottom+10||t.clientX>o.right&&t.clientY>o.top}(t,a,this)&&!p.animated){if(p===Rt)return P(!1);if(p&&r===t.target&&(i=p),i&&(n=yt(i)),!1!==Ae(jt,r,Rt,e,i,n,t,!!i))return O(),p&&p.nextSibling?r.insertBefore(Rt,p.nextSibling):r.appendChild(Rt),Xt=r,M(),P(!0)}else if(p&&function(t,e,n){var o=yt(_t(n.el,0,n.options,!0)),a=Ot(n.el,n.options,Yt);return e?t.clientXu+c*r/2:ld-se)return-ie}else if(l>u+c*(1-a)/2&&ld-c*r/2)?l>u+c/2?1:-1:0}(t,i,n,a,_?1:s.swapThreshold,null==s.invertedSwapThreshold?s.swapThreshold:s.invertedSwapThreshold,he,re===i),0!==v){var D=St(Rt);do{D-=v,y=Xt.children[D]}while(y&&("none"===pt(y,"display")||y===Yt))}if(0===v||y===i)return P(!1);re=i,ie=v;var C=i.nextElementSibling,x=!1,N=Ae(jt,r,Rt,e,i,n,t,x=1===v);if(!1!==N)return 1!==N&&-1!==N||(x=1===N),pe=!0,setTimeout(Pe,30),O(),x&&!C?r.appendChild(Rt):i.parentNode.insertBefore(Rt,x?C:i),S&&Nt(S,0,E-S.scrollTop),Xt=Rt.parentNode,void 0===b||he||(se=Math.abs(b-yt(i)[T])),M(),P(!0)}if(r.contains(Rt))return P(!1)}return!1}function A(s,l){Lt(s,h,U({evt:t,isOwner:u,axis:a?"vertical":"horizontal",revert:o,dragRect:e,targetRect:n,canSort:d,fromSortable:m,target:i,completed:P,onMove:function(n,o){return Ae(jt,r,Rt,e,n,yt(n),t,o)},changed:M},l))}function O(){A("dragOverAnimationCapture"),h.captureAnimationState(),h!==m&&m.captureAnimationState()}function P(e){return A("dragOverCompleted",{insertion:e}),e&&(u?c._hideClone():c._showClone(h),h!==m&&(gt(Rt,Jt?Jt.options.ghostClass:c.options.ghostClass,!1),gt(Rt,s.ghostClass,!0)),Jt!==h&&h!==Ne.active?Jt=h:h===Ne.active&&Jt&&(Jt=null),m===h&&(h._ignoreWhileAnimating=i),h.animateAll((function(){A("dragOverAnimationComplete"),h._ignoreWhileAnimating=null})),h!==m&&(m.animateAll(),m._ignoreWhileAnimating=null)),(i===Rt&&!Rt.animated||i===r&&!i.animated)&&(re=null),s.dragoverBubble||t.rootEl||i===document||(Rt.parentNode[Pt]._isOutsideThisEl(t.target),!e&&Ce(t)),!s.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),g=!0}function M(){Vt=St(Rt),$t=St(Rt,s.draggable),Bt({sortable:h,name:"change",toEl:r,newIndex:Vt,newDraggableIndex:$t,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){lt(document,"mousemove",this._onTouchMove),lt(document,"touchmove",this._onTouchMove),lt(document,"pointermove",this._onTouchMove),lt(document,"dragover",Ce),lt(document,"mousemove",Ce),lt(document,"touchmove",Ce)},_offUpEvents:function(){var t=this.el.ownerDocument;lt(t,"mouseup",this._onDrop),lt(t,"touchend",this._onDrop),lt(t,"pointerup",this._onDrop),lt(t,"touchcancel",this._onDrop),lt(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;Vt=St(Rt),$t=St(Rt,n.draggable),Lt("drop",this,{evt:t}),Xt=Rt&&Rt.parentNode,Vt=St(Rt),$t=St(Rt,n.draggable),Ne.eventCanceled||(ce=!1,he=!1,me=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),ke(this.cloneId),ke(this._dragStartId),this.nativeDraggable&&(lt(document,"drop",this),lt(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),ot&&pt(document.body,"user-select",""),pt(Rt,"transform",""),t&&(ae&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),Yt&&Yt.parentNode&&Yt.parentNode.removeChild(Yt),(jt===Xt||Jt&&"clone"!==Jt.lastPutMode)&&Wt&&Wt.parentNode&&Wt.parentNode.removeChild(Wt),Rt&&(this.nativeDraggable&<(Rt,"dragend",this),Oe(Rt),Rt.style["will-change"]="",ae&&!ce&>(Rt,Jt?Jt.options.ghostClass:this.options.ghostClass,!1),gt(Rt,this.options.chosenClass,!1),Bt({sortable:this,name:"unchoose",toEl:Xt,newIndex:null,newDraggableIndex:null,originalEvent:t}),jt!==Xt?(Vt>=0&&(Bt({rootEl:Xt,name:"add",toEl:Xt,fromEl:jt,originalEvent:t}),Bt({sortable:this,name:"remove",toEl:Xt,originalEvent:t}),Bt({rootEl:Xt,name:"sort",toEl:Xt,fromEl:jt,originalEvent:t}),Bt({sortable:this,name:"sort",toEl:Xt,originalEvent:t})),Jt&&Jt.save()):Vt!==zt&&Vt>=0&&(Bt({sortable:this,name:"update",toEl:Xt,originalEvent:t}),Bt({sortable:this,name:"sort",toEl:Xt,originalEvent:t})),Ne.active&&(null!=Vt&&-1!==Vt||(Vt=zt,$t=Ut),Bt({sortable:this,name:"end",toEl:Xt,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){Lt("nulling",this),jt=Rt=Xt=Yt=Ht=Wt=Gt=qt=Zt=Qt=ae=Vt=$t=zt=Ut=re=ie=Jt=Kt=Ne.dragged=Ne.ghost=Ne.clone=Ne.active=null,fe.forEach((function(t){t.checked=!0})),fe.length=te=ee=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":Rt&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],n=this.el.children,o=0,a=n.length,r=this.options;o{const e=t.target;this.name(e.value),this.slug((0,hn.slug)(e.value))}})),50),t.add("slug",m("div",{className:"Form-group"},m("label",null,a().translator.trans("flarum-tags.admin.edit_tag.slug_label")),m("input",{className:"FormControl",bidi:this.slug})),40),t.add("description",m("div",{className:"Form-group"},m("label",null,a().translator.trans("flarum-tags.admin.edit_tag.description_label")),m("textarea",{className:"FormControl",bidi:this.description})),30),t.add("color",m("div",{className:"Form-group"},m("label",null,a().translator.trans("flarum-tags.admin.edit_tag.color_label")),m(un(),{className:"FormControl",placeholder:"#aaaaaa",bidi:this.color})),20),t.add("icon",m("div",{className:"Form-group"},m("label",null,a().translator.trans("flarum-tags.admin.edit_tag.icon_label")),m("div",{className:"helpText"},a().translator.trans("flarum-tags.admin.edit_tag.icon_text",{a:m("a",{href:a().refs.fontawesome,tabindex:"-1"})})),m("input",{className:"FormControl",placeholder:"fas fa-bolt",bidi:this.icon})),10),t.add("hidden",m("div",{className:"Form-group"},m("div",null,m("label",{className:"checkbox"},m("input",{type:"checkbox",bidi:this.isHidden}),a().translator.trans("flarum-tags.admin.edit_tag.hide_label")))),10),t.add("submit",m("div",{className:"Form-group Form-controls"},m(g(),{type:"submit",className:"Button Button--primary EditTagModal-save",loading:this.loading},a().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)},a().translator.trans("flarum-tags.admin.edit_tag.delete_tag_button"))),-10),t}submitData(){return{name:this.name(),slug:this.slug(),description:this.description(),color:this.color(),icon:this.icon(),isHidden:this.isHidden(),isPrimary:this.isPrimary()}}onsubmit(t){t.preventDefault(),this.loading=!0,this.tag.save(this.submitData()).then((()=>this.hide()),(()=>this.loading=!1))}delete(){if(confirm(vn()(a().translator.trans("flarum-tags.admin.edit_tag.delete_tag_confirmation")))){const t=a().store.all("tags").filter((t=>t.parent()===this.tag));this.tag.delete().then((()=>{t.forEach((t=>t.pushData({attributes:{isChild:!1}}))),m.redraw()})),this.hide()}}}function yn(t){return m("li",{"data-id":t.id(),style:{color:t.color()}},m("div",{className:"TagListItem-info"},(0,b.A)(t),m("span",{className:"TagListItem-name"},t.name()),m(g(),{className:"Button Button--link",icon:"fas fa-pencil-alt",onclick:()=>a().modal.show(bn,{model:t})})),!t.isChild()&&null!==t.position()&&m("ol",{className:"TagListItem-children TagList"},(0,y.A)(a().store.all("tags")).filter((e=>e.parent()===t)).map(yn)))}flarum.reg.add("flarum-tags","admin/components/EditTagModal",bn);class wn extends(Je()){oninit(t){super.oninit(t),this.forcedRefreshKey=0,this.loading=!0,a().tagList.load(["parent"]).then((()=>{this.loading=!1,m.redraw()}))}content(){if(this.loading)return m(f(),null);const 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),o=this.setting("flarum-tags.max_secondary_tags",0),r=(0,y.A)(a().store.all("tags").filter((t=>!t.parent())));return m("div",{className:"TagsContent"},m("div",{className:"TagsContent-list"},m("div",{className:"container",key:this.forcedRefreshKey,oncreate:this.onListOnCreate.bind(this)},m(on(),null,m(rn(),{className:"TagGroup",label:a().translator.trans("flarum-tags.admin.tags.primary_heading")},m("ol",{className:"TagList TagList--primary"},r.filter((t=>null!==t.position()&&!t.isChild())).map(yn)),m(g(),{className:"Button TagList-button",icon:"fas fa-plus",onclick:()=>a().modal.show(bn,{primary:!0})},a().translator.trans("flarum-tags.admin.tags.create_primary_tag_button"))),m(rn(),{className:"TagGroup TagGroup--secondary",label:a().translator.trans("flarum-tags.admin.tags.secondary_heading")},m("ul",{className:"TagList"},r.filter((t=>null===t.position())).sort(((t,e)=>t.name().localeCompare(e.name()))).map(yn)),m(g(),{className:"Button TagList-button",icon:"fas fa-plus",onclick:()=>a().modal.show(bn,{primary:!1})},a().translator.trans("flarum-tags.admin.tags.create_secondary_tag_button"))),m(rn(),{label:a().translator.trans("flarum-tags.admin.tags.settings_heading")},m(en(),null,m("div",{className:"Form-group"},m("label",null,a().translator.trans("flarum-tags.admin.tag_settings.required_primary_heading")),m("div",{className:"helpText"},a().translator.trans("flarum-tags.admin.tag_settings.required_primary_text")),m("div",{className:"TagSettings-rangeInput"},m("input",{className:"FormControl",type:"number",min:"0",value:t(),oninput:Qe()("value",this.setMinTags.bind(this,t,e))}),a().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,a().translator.trans("flarum-tags.admin.tag_settings.required_secondary_heading")),m("div",{className:"helpText"},a().translator.trans("flarum-tags.admin.tag_settings.required_secondary_text")),m("div",{className:"TagSettings-rangeInput"},m("input",{className:"FormControl",type:"number",min:"0",value:n(),oninput:Qe()("value",this.setMinTags.bind(this,n,o))}),a().translator.trans("flarum-tags.admin.tag_settings.range_separator_text"),m("input",{className:"FormControl",type:"number",min:n(),bidi:o}))),m("div",{className:"Form-group Form-controls"},this.submitButton())))),m("div",{className:"TagsContent-footer"},m("p",null,a().translator.trans("flarum-tags.admin.tags.about_tags_text"))))))}onListOnCreate(t){this.$(".TagList").get().map((t=>{$e.create(t,{group:"tags",delay:50,delayOnTouchOnly:!0,touchStartThreshold:5,animation:150,swapThreshold:.65,dragClass:"sortable-dragging",ghostClass:"sortable-placeholder",onSort:t=>this.onSortUpdate(t)})}))}setMinTags(t,e,n){t(n),e(Math.max(n,e()))}onSortUpdate(t){t.from instanceof HTMLOListElement&&t.to instanceof HTMLUListElement&&a().store.getById("tags",t.item.getAttribute("data-id")).pushData({attributes:{position:null,isChild:!1},relationships:{parent:null}});const e=this.$(".TagList--primary > li").map((function(){return{id:$(this).data("id"),children:$(this).find("li").map((function(){return $(this).data("id")})).get()}})).get();e.forEach(((t,e)=>{const n=a().store.getById("tags",t.id);n.pushData({attributes:{position:e,isChild:!1},relationships:{parent:null}}),t.children.forEach(((t,e)=>{a().store.getById("tags",t).pushData({attributes:{position:e,isChild:!0},relationships:{parent:n}})}))})),a().request({url:a().forum.attribute("apiUrl")+"/tags/order",method:"POST",body:{order:e}}),this.forcedRefreshKey++,m.redraw()}}flarum.reg.add("flarum-tags","admin/components/TagsPage",wn);const _n=[...z,(new(R().Admin)).page(wn).permission((()=>({icon:"fas fa-tag",label:a().translator.trans("flarum-tags.admin.permissions.tag_discussions_label"),permission:"discussion.tag"})),"moderate",95).permission((()=>({icon:"fas fa-tags",label:a().translator.trans("flarum-tags.admin.permissions.bypass_tag_counts_label"),permission:"bypassTagCounts"})),"start",89)];a().initializers.add("flarum-tags",(t=>{t.tagList=new L,(0,r.extend)(s().prototype,"oninit",(function(){this.loading=!0})),(0,r.extend)(s().prototype,"oncreate",(function(){a().tagList.load().then((()=>{this.loading=!1,m.redraw()}))})),(0,r.override)(s().prototype,"view",(function(t,e){return this.loading?m(f(),null):t(e)})),(0,r.override)(a(),"getRequiredPermissions",((t,e)=>{const n=e.match(/^tag\d+\./);return n?t(e.substr(n[0].length)).map((t=>n[0]+t)):t(e)})),(0,r.extend)(s().prototype,"scopeItems",(t=>{(0,y.A)(a().store.all("tags")).filter((t=>t.isRestricted())).forEach((e=>t.add("tag"+e.id(),{label:(0,v.A)(e),onremove:()=>e.save({isRestricted:!1}),render:t=>{var n;return"setting"in t?null:"viewForum"===t.permission||"startDiscussion"===t.permission||null!=(n=t.permission)&&n.startsWith("discussion.")&&!1!==t.tagScoped||t.tagScoped?m(c(),{permission:"tag".concat(e.id(),".").concat(t.permission),allowGuest:t.allowGuest}):null}})))})),(0,r.extend)(s().prototype,"scopeControlItems",(t=>{const e=(0,y.A)(a().store.all("tags").filter((t=>!t.isRestricted())));e.length&&t.add("tag",m(d(),{className:"Dropdown--restrictByTag",buttonClassName:"Button Button--text",label:a().translator.trans("flarum-tags.admin.permissions.restrict_by_tag_heading"),icon:"fas fa-plus",caretIcon:null},e.map((t=>m(g(),{icon:!0,onclick:()=>t.save({isRestricted:!0})},[(0,b.A)(t,{className:"Button-icon"})," ",t.name()])))))})),T(),(0,r.extend)(s().prototype,"startItems",(t=>{t.add("allowTagChange",{icon:"fas fa-tag",label:a().translator.trans("flarum-tags.admin.permissions.allow_edit_tags_label"),setting:()=>{const t=parseInt(a().data.settings.allow_tag_change,10);return m(E(),{defaultLabel:t?a().translator.trans("core.admin.permissions_controls.allow_some_minutes_button",{count:t}):a().translator.trans("core.admin.permissions_controls.allow_indefinitely_button"),key:"allow_tag_change",options:[{value:"-1",label:a().translator.trans("core.admin.permissions_controls.allow_indefinitely_button")},{value:"10",label:a().translator.trans("core.admin.permissions_controls.allow_ten_minutes_button")},{value:"reply",label:a().translator.trans("core.admin.permissions_controls.allow_until_reply_button")}]})}},90)})),(0,r.extend)(I().prototype,"customFieldComponents",(function(t){t.add("flarum-tags.select-tags",(t=>m(P,Object.assign({},t,{settingValue:t.bidi}))))}))}))},968:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});var o=n(443),a=n.n(o);function r(t,e,n){void 0===e&&(e={}),void 0===n&&(n={});const o=t&&t.icon(),{useColor:r=!0}=n;return e.className=a()([e.className,"icon text-colored",o?t.icon():"TagIcon"]),t&&r?(e.style=e.style||{},e.style["--color"]=t.color()):t||(e.className+=" untagged"),o?m("i",e):m("span",e)}flarum.reg.add("flarum-tags","common/helpers/tagIcon",r)},339:(t,e,n)=>{"use strict";n.d(e,{A:()=>h});var o=n(414),a=n.n(o),r=n(88),i=n.n(r),s=n(443),l=n.n(s),c=n(296),u=n.n(c),d=n(968);function h(t,e){void 0===e&&(e={}),e.style=e.style||{},e.className="TagLabel "+(e.className||"");const n=a()(e,"link"),o=t?t.name():app.translator.trans("flarum-tags.lib.deleted_tag_text");if(t){const o=t.color();o&&(e.style["--tag-bg"]=o,e.className=l()(e.className,"colored",u()(o))),n&&(e.title=t.description()||"",e.href=app.route("tag",{tags:t.slug()})),t.isChild()&&(e.className+=" TagLabel--child")}else e.className+=" untagged";return m(n?i():"span",e,m("span",{className:"TagLabel-text"},t&&t.icon()&&(0,d.A)(t,{className:"TagLabel-icon"},{useColor:!1}),m("span",{className:"TagLabel-name"},o)))}flarum.reg.add("flarum-tags","common/helpers/tagLabel",h)},85:()=>{},618:(t,e,n)=>{"use strict";function o(t){return t.slice(0).sort(((t,e)=>{const n=t.position(),o=e.position();if(null===n&&null===o)return e.discussionCount()-t.discussionCount();if(null===o)return-1;if(null===n)return 1;const a=t.parent(),r=e.parent();return a===r?n-o:a&&r?a.position()-r.position():a?a===e?1:a.position()-o:r?r===t?-1:n-r.position():0}))}n.d(e,{A:()=>o}),flarum.reg.add("flarum-tags","common/utils/sortTags",o)},950:t=>{"use strict";t.exports=flarum.reg.get("core","common/Component")},954:t=>{"use strict";t.exports=flarum.reg.get("core","common/app")},336:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/Button")},15:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/FormModal")},88:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/Link")},661:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/LoadingIndicator")},607:t=>{"use strict";t.exports=flarum.reg.get("core","common/helpers/highlight")},296:t=>{"use strict";t.exports=flarum.reg.get("core","common/helpers/textContrastClass")},280:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/KeyboardNavigatable")},821:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/Stream")},443:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/classList")},414:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/extract")},233:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/extractText")},805:(t,e,n)=>{"use strict";function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function a(t,e,n){return a=function(t,e){if("object"!=o(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var a=n.call(t,"string");if("object"!=o(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e),(e="symbol"==o(a)?a:a+"")in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t;var a}n.d(e,{A:()=>a})}},o={};function a(t){var e=o[t];if(void 0!==e)return e.exports;var r=o[t]={exports:{}};return n[t](r,r.exports,a),r.exports}a.m=n,a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var n in e)a.o(e,n)&&!a.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},a.f={},a.e=t=>Promise.all(Object.keys(a.f).reduce(((e,n)=>(a.f[n](t,e),e)),[])),a.u=t=>"common/components/TagSelectionModal.js",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t={},e="module.exports:",a.l=(n,o,r,i)=>{if(t[n])t[n].push(o);else{var s,l;if(void 0!==r)for(var c=document.getElementsByTagName("script"),u=0;u{s.onerror=s.onload=null,clearTimeout(h);var a=t[n];if(delete t[n],s.parentNode&&s.parentNode.removeChild(s),a&&a.forEach((t=>t(o))),e)return e(o)},h=setTimeout(m.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=m.bind(null,s.onerror),s.onload=m.bind(null,s.onload),l&&document.head.appendChild(s)}},a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;a.g.importScripts&&(t=a.g.location+"");var e=a.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var n=e.getElementsByTagName("script");if(n.length)for(var o=n.length-1;o>-1&&(!t||!/^http(s?):/.test(t));)t=n[o--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=t})(),a.f.compat=(t,e)=>{const n=a.l;a.l=flarum.reg.loadChunk.bind(flarum.reg,n)},(()=>{var t={884:0};a.f.j=(e,n)=>{var o=a.o(t,e)?t[e]:void 0;if(0!==o)if(o)n.push(o[2]);else{var r=new Promise(((n,a)=>o=t[e]=[n,a]));n.push(o[2]=r);var i=a.p+a.u(e),s=new Error;a.l(i,(n=>{if(a.o(t,e)&&(0!==(o=t[e])&&(t[e]=void 0),o)){var r=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;s.message="Loading chunk "+e+" failed.\n("+r+": "+i+")",s.name="ChunkLoadError",s.type=r,s.request=i,o[1](s)}}),"chunk-"+e,e)}};var e=(e,n)=>{var o,r,[i,s,l]=n,c=0;if(i.some((e=>0!==t[e]))){for(o in s)a.o(s,o)&&(a.m[o]=s[o]);l&&l(a)}for(e&&e(n);c{"use strict";a.r(r),a.d(r,{extend:()=>n.X});var t=a(85),e={};for(const n in t)"default"!==n&&(e[n]=()=>t[n]);a.d(r,e);var n=a(400)})(),module.exports=r})(); //# 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 42e7687c6b..db1c38ed75 100644 --- a/extensions/tags/js/dist/admin.js.map +++ b/extensions/tags/js/dist/admin.js.map @@ -1 +1 @@ -{"version":3,"file":"admin.js","mappings":";UAAIA,EACAC,kDCDJ,MAAM,EAA+BC,OAAOC,IAAIC,IAAI,OAAQ,0BCA5D,MAAM,EAA+BF,OAAOC,IAAIC,IAAI,OAAQ,iBCAtD,EAA+BF,OAAOC,IAAIC,IAAI,OAAQ,gDCA5D,MAAM,EAA+BF,OAAOC,IAAIC,IAAI,OAAQ,oDCA5D,MAAM,EAA+BF,OAAOC,IAAIC,IAAI,OAAQ,0GCA5D,MAAM,EAA+BF,OAAOC,IAAIC,IAAI,OAAQ,4CCE7C,SAAS,KACt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AAYtsB,IAAyB,SAAfA,EAAM4Y,KAAkB,UAAY5Y,EAAM4Y,MAChE2T,EAAUvsB,GAASA,EAAMjC,QAAUiC,EAAMjC,OAAOqa,IACpDiU,EAAMG,QAAU,iBAAmBvC,EAAU,cAAgBqC,EAAY,KAAOC,EAAU,IAC1FF,EAAMpxB,KAAO,iBACboxB,EAAMzT,KAAO0T,EACbD,EAAMI,QAAUF,EAChBL,EAAmB,GAAGG,EACvB,CACD,GAEwC,SAAWpC,EAASA,EAE/D,CACD,EAcF,IAAIyC,EAAuB,CAACC,EAA4B7hB,KACvD,IAGI6e,EAAUM,GAHT2C,EAAUC,EAAaC,GAAWhiB,EAGhB9M,EAAI,EAC3B,GAAG4uB,EAASza,MAAM/Y,GAAgC,IAAxB6yB,EAAgB7yB,KAAa,CACtD,IAAIuwB,KAAYkD,EACZnD,EAAoBP,EAAE0D,EAAalD,KACrCD,EAAoBtxB,EAAEuxB,GAAYkD,EAAYlD,IAG7CmD,GAAsBA,EAAQpD,EAClC,CAEA,IADGiD,GAA4BA,EAA2B7hB,GACrD9M,EAAI4uB,EAAS30B,OAAQ+F,IACzBisB,EAAU2C,EAAS5uB,GAChB0rB,EAAoBP,EAAE8C,EAAiBhC,IAAYgC,EAAgBhC,IACrEgC,EAAgBhC,GAAS,KAE1BgC,EAAgBhC,GAAW,CAC5B,EAIG8C,EAAqBC,KAAiC,2BAAIA,KAAiC,4BAAK,GACpGD,EAAmBh1B,QAAQ20B,EAAqBrhB,KAAK,KAAM,IAC3D0hB,EAAmB70B,KAAOw0B,EAAqBrhB,KAAK,KAAM0hB,EAAmB70B,KAAKmT,KAAK0hB","sources":["webpack://@flarum/tags/webpack/runtime/load script","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/app')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/PermissionGrid')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/PermissionDropdown')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Dropdown')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/BasicsPage')\"","webpack://@flarum/tags/./src/admin/addTagsHomePageOption.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/SettingDropdown')\"","webpack://@flarum/tags/./src/common/helpers/tagsLabel.js","webpack://@flarum/tags/./src/admin/components/SelectTagsSettingComponent.tsx","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/FormGroup')\"","webpack://@flarum/tags/./src/common/states/TagListState.ts","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/extenders')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/computed')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/Model')\"","webpack://@flarum/tags/./src/common/models/Tag.ts","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/query/IGambit')\"","webpack://@flarum/tags/./src/common/query/discussions/TagGambit.ts","webpack://@flarum/tags/./src/common/extend.ts","webpack://@flarum/tags/../../../node_modules/sortablejs/modular/sortable.esm.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/ExtensionPage')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/withAttr')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Form')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/FormSectionGroup')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/FormSection')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/ColorPreviewInput')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/ItemList')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/string')\"","webpack://@flarum/tags/./src/admin/components/EditTagModal.tsx","webpack://@flarum/tags/./src/admin/components/TagsPage.js","webpack://@flarum/tags/./src/admin/extend.tsx","webpack://@flarum/tags/./src/admin/index.ts","webpack://@flarum/tags/./src/admin/addTagsPermissionScope.tsx","webpack://@flarum/tags/./src/admin/addTagChangePermission.js","webpack://@flarum/tags/./src/admin/addTagSelectionSettingComponent.tsx","webpack://@flarum/tags/./src/common/helpers/tagIcon.js","webpack://@flarum/tags/./src/common/helpers/tagLabel.js","webpack://@flarum/tags/./src/common/utils/sortTags.tsx","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/Component')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/app')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Button')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/FormModal')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Link')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/LoadingIndicator')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/helpers/highlight')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/helpers/textContrastClass')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/KeyboardNavigatable')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/Stream')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/classList')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/extract')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/extractText')\"","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@flarum/tags/webpack/bootstrap","webpack://@flarum/tags/webpack/runtime/compat get default export","webpack://@flarum/tags/webpack/runtime/define property getters","webpack://@flarum/tags/webpack/runtime/ensure chunk","webpack://@flarum/tags/webpack/runtime/get javascript chunk filename","webpack://@flarum/tags/webpack/runtime/global","webpack://@flarum/tags/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/tags/webpack/runtime/make namespace object","webpack://@flarum/tags/webpack/runtime/publicPath","webpack://@flarum/tags/webpack/runtime/compat","webpack://@flarum/tags/webpack/runtime/jsonp chunk loading"],"sourcesContent":["var inProgress = {};\nvar dataWebpackPrefix = \"module.exports:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t}\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/PermissionGrid');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/PermissionDropdown');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Dropdown');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/BasicsPage');","import { extend } from 'flarum/common/extend';\nimport BasicsPage from 'flarum/admin/components/BasicsPage';\nexport default function () {\n extend(BasicsPage, 'homePageItems', items => {\n items.add('tags', {\n path: '/tags',\n label: app.translator.trans('flarum-tags.admin.basics.tags_label')\n });\n });\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/SettingDropdown');","import extract from 'flarum/common/utils/extract';\nimport tagLabel from './tagLabel';\nimport sortTags from '../utils/sortTags';\nimport classList from 'flarum/common/utils/classList';\nexport default function tagsLabel(tags, attrs) {\n if (attrs === void 0) {\n attrs = {};\n }\n const children = [];\n const {\n link,\n ...otherAttrs\n } = attrs;\n otherAttrs.className = classList('TagsLabel', otherAttrs.className);\n if (tags) {\n sortTags(tags).forEach(tag => {\n if (tag || tags.length === 1) {\n children.push(tagLabel(tag, {\n link\n }));\n }\n });\n } else {\n children.push(tagLabel());\n }\n return m(\"span\", otherAttrs, children);\n}\nflarum.reg.add('flarum-tags', 'common/helpers/tagsLabel', tagsLabel);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport tagsLabel from '../../common/helpers/tagsLabel';\nexport default class SelectTagsSettingComponent extends Component {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"tags\", []);\n _defineProperty(this, \"loaded\", false);\n }\n view() {\n const value = JSON.parse(this.attrs.settingValue() || '[]');\n if (!this.loaded) {\n app.tagList.load(['parent']).then(tags => {\n this.tags = tags.filter(tag => value.includes(tag.id()));\n this.loaded = true;\n m.redraw();\n });\n }\n return m(\"div\", {\n className: \"Form-group SelectTagsSettingComponent\"\n }, m(\"label\", null, this.attrs.label), this.attrs.help && m(\"p\", {\n className: \"helpText\"\n }, this.attrs.help), !this.loaded ? m(LoadingIndicator, {\n size: \"small\",\n display: \"inline\"\n }) : m(Button, {\n className: \"Button Button--text\",\n onclick: () => app.modal.show(() => import(/* webpackChunkName: 'common/components/TagSelectionModal', webpackMode: 'lazy-once' */ '../../common/components/TagSelectionModal'), {\n selectedTags: this.tags,\n onsubmit: tags => {\n this.tags = tags;\n this.attrs.settingValue(JSON.stringify(tags.map(tag => tag.id())));\n },\n ...this.attrs.options\n })\n }, !!this.tags.length ? tagsLabel(this.tags) : m(\"span\", {\n className: \"TagLabel untagged\"\n }, app.translator.trans('flarum-tags.admin.settings.button_text'))));\n }\n}\nflarum.reg.add('flarum-tags', 'admin/components/SelectTagsSettingComponent', SelectTagsSettingComponent);flarum.reg.addChunkModule('955', '671', 'flarum-tags', 'common/components/TagSelectionModal');\nflarum.reg.addChunkModule('955', '671', 'flarum-tags', 'forum/components/ToggleButton');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/FormGroup');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/common/app';\nexport default class TagListState {\n constructor() {\n _defineProperty(this, \"loadedIncludes\", void 0);\n }\n async load(includes) {\n if (includes === void 0) {\n includes = [];\n }\n if (!this.loadedIncludes) {\n return this.query(includes);\n }\n const unloadedIncludes = includes.filter(include => !this.loadedIncludes.has(include));\n if (unloadedIncludes.length === 0) {\n return Promise.resolve(app.store.all('tags'));\n }\n return this.query(unloadedIncludes);\n }\n async query(includes) {\n var _this$loadedIncludes;\n if (includes === void 0) {\n includes = [];\n }\n (_this$loadedIncludes = this.loadedIncludes) != null ? _this$loadedIncludes : this.loadedIncludes = new Set();\n return app.store.find('tags', {\n include: includes.join(',')\n }).then(val => {\n const tags = Array.isArray(val) ? val : [val];\n includes.forEach(include => this.loadedIncludes.add(include));\n return tags;\n });\n }\n}\nflarum.reg.add('flarum-tags', 'common/states/TagListState', TagListState);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/computed');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Model');","import computed from 'flarum/common/utils/computed';\nimport Model from 'flarum/common/Model';\nexport default class Tag extends Model {\n name() {\n return Model.attribute('name').call(this);\n }\n slug() {\n return Model.attribute('slug').call(this);\n }\n description() {\n return Model.attribute('description').call(this);\n }\n color() {\n return Model.attribute('color').call(this);\n }\n backgroundUrl() {\n return Model.attribute('backgroundUrl').call(this);\n }\n backgroundMode() {\n return Model.attribute('backgroundMode').call(this);\n }\n icon() {\n return Model.attribute('icon').call(this);\n }\n position() {\n return Model.attribute('position').call(this);\n }\n parent() {\n return Model.hasOne('parent').call(this);\n }\n children() {\n return Model.hasMany('children').call(this);\n }\n defaultSort() {\n return Model.attribute('defaultSort').call(this);\n }\n isChild() {\n return Model.attribute('isChild').call(this);\n }\n isHidden() {\n return Model.attribute('isHidden').call(this);\n }\n isPrimary() {\n return Model.attribute('isPrimary').call(this);\n }\n discussionCount() {\n return Model.attribute('discussionCount').call(this);\n }\n lastPostedAt() {\n return Model.attribute('lastPostedAt', Model.transformDate).call(this);\n }\n lastPostedDiscussion() {\n return Model.hasOne('lastPostedDiscussion').call(this);\n }\n isRestricted() {\n return Model.attribute('isRestricted').call(this);\n }\n canStartDiscussion() {\n return Model.attribute('canStartDiscussion').call(this);\n }\n canAddToDiscussion() {\n return Model.attribute('canAddToDiscussion').call(this);\n }\n isPrimaryParent() {\n return computed('position', 'parent', (position, parent) => position !== null && parent === false).call(this);\n }\n}\nflarum.reg.add('flarum-tags', 'common/models/Tag', Tag);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/query/IGambit');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/common/app';\nimport { KeyValueGambit } from 'flarum/common/query/IGambit';\nexport default class TagGambit extends KeyValueGambit {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"predicates\", true);\n }\n key() {\n return app.translator.trans('flarum-tags.lib.gambits.discussions.tag.key', {}, true);\n }\n hint() {\n return app.translator.trans('flarum-tags.lib.gambits.discussions.tag.hint', {}, true);\n }\n filterKey() {\n return 'tag';\n }\n gambitValueToFilterValue(value) {\n return [value];\n }\n fromFilter(value, negate) {\n let gambits = [];\n if (Array.isArray(value)) {\n gambits = value.map(value => this.fromFilter(value.toString(), negate));\n } else {\n return \"\".concat(negate ? '-' : '').concat(this.key(), \":\").concat(this.filterValueToGambitValue(value));\n }\n return gambits.join(' ');\n }\n filterValueToGambitValue(value) {\n return value;\n }\n}\nflarum.reg.add('flarum-tags', 'common/query/discussions/TagGambit', TagGambit);","import Extend from 'flarum/common/extenders';\nimport Tag from './models/Tag';\nimport TagGambit from './query/discussions/TagGambit';\nexport default [new Extend.Store() //\n.add('tags', Tag), new Extend.Search() //\n.gambit('discussions', TagGambit)];","/**!\n * Sortable 1.15.2\n * @author\tRubaXa \n * @author\towenm \n * @license MIT\n */\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n keys.push.apply(keys, symbols);\n }\n return keys;\n}\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n return target;\n}\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n return _typeof(obj);\n}\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = _objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n return target;\n}\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();\n}\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return _arrayLikeToArray(arr);\n}\nfunction _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nvar version = \"1.15.2\";\n\nfunction userAgent(pattern) {\n if (typeof window !== 'undefined' && window.navigator) {\n return !! /*@__PURE__*/navigator.userAgent.match(pattern);\n }\n}\nvar IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\\.|msie|iemobile|Windows Phone)/i);\nvar Edge = userAgent(/Edge/i);\nvar FireFox = userAgent(/firefox/i);\nvar Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);\nvar IOS = userAgent(/iP(ad|od|hone)/i);\nvar ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i);\n\nvar captureMode = {\n capture: false,\n passive: false\n};\nfunction on(el, event, fn) {\n el.addEventListener(event, fn, !IE11OrLess && captureMode);\n}\nfunction off(el, event, fn) {\n el.removeEventListener(event, fn, !IE11OrLess && captureMode);\n}\nfunction matches( /**HTMLElement*/el, /**String*/selector) {\n if (!selector) return;\n selector[0] === '>' && (selector = selector.substring(1));\n if (el) {\n try {\n if (el.matches) {\n return el.matches(selector);\n } else if (el.msMatchesSelector) {\n return el.msMatchesSelector(selector);\n } else if (el.webkitMatchesSelector) {\n return el.webkitMatchesSelector(selector);\n }\n } catch (_) {\n return false;\n }\n }\n return false;\n}\nfunction getParentOrHost(el) {\n return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;\n}\nfunction closest( /**HTMLElement*/el, /**String*/selector, /**HTMLElement*/ctx, includeCTX) {\n if (el) {\n ctx = ctx || document;\n do {\n if (selector != null && (selector[0] === '>' ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) {\n return el;\n }\n if (el === ctx) break;\n /* jshint boss:true */\n } while (el = getParentOrHost(el));\n }\n return null;\n}\nvar R_SPACE = /\\s+/g;\nfunction toggleClass(el, name, state) {\n if (el && name) {\n if (el.classList) {\n el.classList[state ? 'add' : 'remove'](name);\n } else {\n var className = (' ' + el.className + ' ').replace(R_SPACE, ' ').replace(' ' + name + ' ', ' ');\n el.className = (className + (state ? ' ' + name : '')).replace(R_SPACE, ' ');\n }\n }\n}\nfunction css(el, prop, val) {\n var style = el && el.style;\n if (style) {\n if (val === void 0) {\n if (document.defaultView && document.defaultView.getComputedStyle) {\n val = document.defaultView.getComputedStyle(el, '');\n } else if (el.currentStyle) {\n val = el.currentStyle;\n }\n return prop === void 0 ? val : val[prop];\n } else {\n if (!(prop in style) && prop.indexOf('webkit') === -1) {\n prop = '-webkit-' + prop;\n }\n style[prop] = val + (typeof val === 'string' ? '' : 'px');\n }\n }\n}\nfunction matrix(el, selfOnly) {\n var appliedTransforms = '';\n if (typeof el === 'string') {\n appliedTransforms = el;\n } else {\n do {\n var transform = css(el, 'transform');\n if (transform && transform !== 'none') {\n appliedTransforms = transform + ' ' + appliedTransforms;\n }\n /* jshint boss:true */\n } while (!selfOnly && (el = el.parentNode));\n }\n var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;\n /*jshint -W056 */\n return matrixFn && new matrixFn(appliedTransforms);\n}\nfunction find(ctx, tagName, iterator) {\n if (ctx) {\n var list = ctx.getElementsByTagName(tagName),\n i = 0,\n n = list.length;\n if (iterator) {\n for (; i < n; i++) {\n iterator(list[i], i);\n }\n }\n return list;\n }\n return [];\n}\nfunction getWindowScrollingElement() {\n var scrollingElement = document.scrollingElement;\n if (scrollingElement) {\n return scrollingElement;\n } else {\n return document.documentElement;\n }\n}\n\n/**\r\n * Returns the \"bounding client rect\" of given element\r\n * @param {HTMLElement} el The element whose boundingClientRect is wanted\r\n * @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container\r\n * @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr\r\n * @param {[Boolean]} undoScale Whether the container's scale() should be undone\r\n * @param {[HTMLElement]} container The parent the element will be placed in\r\n * @return {Object} The boundingClientRect of el, with specified adjustments\r\n */\nfunction getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {\n if (!el.getBoundingClientRect && el !== window) return;\n var elRect, top, left, bottom, right, height, width;\n if (el !== window && el.parentNode && el !== getWindowScrollingElement()) {\n elRect = el.getBoundingClientRect();\n top = elRect.top;\n left = elRect.left;\n bottom = elRect.bottom;\n right = elRect.right;\n height = elRect.height;\n width = elRect.width;\n } else {\n top = 0;\n left = 0;\n bottom = window.innerHeight;\n right = window.innerWidth;\n height = window.innerHeight;\n width = window.innerWidth;\n }\n if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {\n // Adjust for translate()\n container = container || el.parentNode;\n\n // solves #1123 (see: https://stackoverflow.com/a/37953806/6088312)\n // Not needed on <= IE11\n if (!IE11OrLess) {\n do {\n if (container && container.getBoundingClientRect && (css(container, 'transform') !== 'none' || relativeToNonStaticParent && css(container, 'position') !== 'static')) {\n var containerRect = container.getBoundingClientRect();\n\n // Set relative to edges of padding box of container\n top -= containerRect.top + parseInt(css(container, 'border-top-width'));\n left -= containerRect.left + parseInt(css(container, 'border-left-width'));\n bottom = top + elRect.height;\n right = left + elRect.width;\n break;\n }\n /* jshint boss:true */\n } while (container = container.parentNode);\n }\n }\n if (undoScale && el !== window) {\n // Adjust for scale()\n var elMatrix = matrix(container || el),\n scaleX = elMatrix && elMatrix.a,\n scaleY = elMatrix && elMatrix.d;\n if (elMatrix) {\n top /= scaleY;\n left /= scaleX;\n width /= scaleX;\n height /= scaleY;\n bottom = top + height;\n right = left + width;\n }\n }\n return {\n top: top,\n left: left,\n bottom: bottom,\n right: right,\n width: width,\n height: height\n };\n}\n\n/**\r\n * Checks if a side of an element is scrolled past a side of its parents\r\n * @param {HTMLElement} el The element who's side being scrolled out of view is in question\r\n * @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')\r\n * @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')\r\n * @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element\r\n */\nfunction isScrolledPast(el, elSide, parentSide) {\n var parent = getParentAutoScrollElement(el, true),\n elSideVal = getRect(el)[elSide];\n\n /* jshint boss:true */\n while (parent) {\n var parentSideVal = getRect(parent)[parentSide],\n visible = void 0;\n if (parentSide === 'top' || parentSide === 'left') {\n visible = elSideVal >= parentSideVal;\n } else {\n visible = elSideVal <= parentSideVal;\n }\n if (!visible) return parent;\n if (parent === getWindowScrollingElement()) break;\n parent = getParentAutoScrollElement(parent, false);\n }\n return false;\n}\n\n/**\r\n * Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)\r\n * and non-draggable elements\r\n * @param {HTMLElement} el The parent element\r\n * @param {Number} childNum The index of the child\r\n * @param {Object} options Parent Sortable's options\r\n * @return {HTMLElement} The child at index childNum, or null if not found\r\n */\nfunction getChild(el, childNum, options, includeDragEl) {\n var currentChild = 0,\n i = 0,\n children = el.children;\n while (i < children.length) {\n if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && (includeDragEl || children[i] !== Sortable.dragged) && closest(children[i], options.draggable, el, false)) {\n if (currentChild === childNum) {\n return children[i];\n }\n currentChild++;\n }\n i++;\n }\n return null;\n}\n\n/**\r\n * Gets the last child in the el, ignoring ghostEl or invisible elements (clones)\r\n * @param {HTMLElement} el Parent element\r\n * @param {selector} selector Any other elements that should be ignored\r\n * @return {HTMLElement} The last child, ignoring ghostEl\r\n */\nfunction lastChild(el, selector) {\n var last = el.lastElementChild;\n while (last && (last === Sortable.ghost || css(last, 'display') === 'none' || selector && !matches(last, selector))) {\n last = last.previousElementSibling;\n }\n return last || null;\n}\n\n/**\r\n * Returns the index of an element within its parent for a selected set of\r\n * elements\r\n * @param {HTMLElement} el\r\n * @param {selector} selector\r\n * @return {number}\r\n */\nfunction index(el, selector) {\n var index = 0;\n if (!el || !el.parentNode) {\n return -1;\n }\n\n /* jshint boss:true */\n while (el = el.previousElementSibling) {\n if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== Sortable.clone && (!selector || matches(el, selector))) {\n index++;\n }\n }\n return index;\n}\n\n/**\r\n * Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.\r\n * The value is returned in real pixels.\r\n * @param {HTMLElement} el\r\n * @return {Array} Offsets in the format of [left, top]\r\n */\nfunction getRelativeScrollOffset(el) {\n var offsetLeft = 0,\n offsetTop = 0,\n winScroller = getWindowScrollingElement();\n if (el) {\n do {\n var elMatrix = matrix(el),\n scaleX = elMatrix.a,\n scaleY = elMatrix.d;\n offsetLeft += el.scrollLeft * scaleX;\n offsetTop += el.scrollTop * scaleY;\n } while (el !== winScroller && (el = el.parentNode));\n }\n return [offsetLeft, offsetTop];\n}\n\n/**\r\n * Returns the index of the object within the given array\r\n * @param {Array} arr Array that may or may not hold the object\r\n * @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find\r\n * @return {Number} The index of the object in the array, or -1\r\n */\nfunction indexOfObject(arr, obj) {\n for (var i in arr) {\n if (!arr.hasOwnProperty(i)) continue;\n for (var key in obj) {\n if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);\n }\n }\n return -1;\n}\nfunction getParentAutoScrollElement(el, includeSelf) {\n // skip to window\n if (!el || !el.getBoundingClientRect) return getWindowScrollingElement();\n var elem = el;\n var gotSelf = false;\n do {\n // we don't need to get elem css if it isn't even overflowing in the first place (performance)\n if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {\n var elemCSS = css(elem);\n if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == 'auto' || elemCSS.overflowX == 'scroll') || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == 'auto' || elemCSS.overflowY == 'scroll')) {\n if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement();\n if (gotSelf || includeSelf) return elem;\n gotSelf = true;\n }\n }\n /* jshint boss:true */\n } while (elem = elem.parentNode);\n return getWindowScrollingElement();\n}\nfunction extend(dst, src) {\n if (dst && src) {\n for (var key in src) {\n if (src.hasOwnProperty(key)) {\n dst[key] = src[key];\n }\n }\n }\n return dst;\n}\nfunction isRectEqual(rect1, rect2) {\n return Math.round(rect1.top) === Math.round(rect2.top) && Math.round(rect1.left) === Math.round(rect2.left) && Math.round(rect1.height) === Math.round(rect2.height) && Math.round(rect1.width) === Math.round(rect2.width);\n}\nvar _throttleTimeout;\nfunction throttle(callback, ms) {\n return function () {\n if (!_throttleTimeout) {\n var args = arguments,\n _this = this;\n if (args.length === 1) {\n callback.call(_this, args[0]);\n } else {\n callback.apply(_this, args);\n }\n _throttleTimeout = setTimeout(function () {\n _throttleTimeout = void 0;\n }, ms);\n }\n };\n}\nfunction cancelThrottle() {\n clearTimeout(_throttleTimeout);\n _throttleTimeout = void 0;\n}\nfunction scrollBy(el, x, y) {\n el.scrollLeft += x;\n el.scrollTop += y;\n}\nfunction clone(el) {\n var Polymer = window.Polymer;\n var $ = window.jQuery || window.Zepto;\n if (Polymer && Polymer.dom) {\n return Polymer.dom(el).cloneNode(true);\n } else if ($) {\n return $(el).clone(true)[0];\n } else {\n return el.cloneNode(true);\n }\n}\nfunction setRect(el, rect) {\n css(el, 'position', 'absolute');\n css(el, 'top', rect.top);\n css(el, 'left', rect.left);\n css(el, 'width', rect.width);\n css(el, 'height', rect.height);\n}\nfunction unsetRect(el) {\n css(el, 'position', '');\n css(el, 'top', '');\n css(el, 'left', '');\n css(el, 'width', '');\n css(el, 'height', '');\n}\nfunction getChildContainingRectFromElement(container, options, ghostEl) {\n var rect = {};\n Array.from(container.children).forEach(function (child) {\n var _rect$left, _rect$top, _rect$right, _rect$bottom;\n if (!closest(child, options.draggable, container, false) || child.animated || child === ghostEl) return;\n var childRect = getRect(child);\n rect.left = Math.min((_rect$left = rect.left) !== null && _rect$left !== void 0 ? _rect$left : Infinity, childRect.left);\n rect.top = Math.min((_rect$top = rect.top) !== null && _rect$top !== void 0 ? _rect$top : Infinity, childRect.top);\n rect.right = Math.max((_rect$right = rect.right) !== null && _rect$right !== void 0 ? _rect$right : -Infinity, childRect.right);\n rect.bottom = Math.max((_rect$bottom = rect.bottom) !== null && _rect$bottom !== void 0 ? _rect$bottom : -Infinity, childRect.bottom);\n });\n rect.width = rect.right - rect.left;\n rect.height = rect.bottom - rect.top;\n rect.x = rect.left;\n rect.y = rect.top;\n return rect;\n}\nvar expando = 'Sortable' + new Date().getTime();\n\nfunction AnimationStateManager() {\n var animationStates = [],\n animationCallbackId;\n return {\n captureAnimationState: function captureAnimationState() {\n animationStates = [];\n if (!this.options.animation) return;\n var children = [].slice.call(this.el.children);\n children.forEach(function (child) {\n if (css(child, 'display') === 'none' || child === Sortable.ghost) return;\n animationStates.push({\n target: child,\n rect: getRect(child)\n });\n var fromRect = _objectSpread2({}, animationStates[animationStates.length - 1].rect);\n\n // If animating: compensate for current animation\n if (child.thisAnimationDuration) {\n var childMatrix = matrix(child, true);\n if (childMatrix) {\n fromRect.top -= childMatrix.f;\n fromRect.left -= childMatrix.e;\n }\n }\n child.fromRect = fromRect;\n });\n },\n addAnimationState: function addAnimationState(state) {\n animationStates.push(state);\n },\n removeAnimationState: function removeAnimationState(target) {\n animationStates.splice(indexOfObject(animationStates, {\n target: target\n }), 1);\n },\n animateAll: function animateAll(callback) {\n var _this = this;\n if (!this.options.animation) {\n clearTimeout(animationCallbackId);\n if (typeof callback === 'function') callback();\n return;\n }\n var animating = false,\n animationTime = 0;\n animationStates.forEach(function (state) {\n var time = 0,\n target = state.target,\n fromRect = target.fromRect,\n toRect = getRect(target),\n prevFromRect = target.prevFromRect,\n prevToRect = target.prevToRect,\n animatingRect = state.rect,\n targetMatrix = matrix(target, true);\n if (targetMatrix) {\n // Compensate for current animation\n toRect.top -= targetMatrix.f;\n toRect.left -= targetMatrix.e;\n }\n target.toRect = toRect;\n if (target.thisAnimationDuration) {\n // Could also check if animatingRect is between fromRect and toRect\n if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) &&\n // Make sure animatingRect is on line between toRect & fromRect\n (animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) {\n // If returning to same place as started from animation and on same axis\n time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);\n }\n }\n\n // if fromRect != toRect: animate\n if (!isRectEqual(toRect, fromRect)) {\n target.prevFromRect = fromRect;\n target.prevToRect = toRect;\n if (!time) {\n time = _this.options.animation;\n }\n _this.animate(target, animatingRect, toRect, time);\n }\n if (time) {\n animating = true;\n animationTime = Math.max(animationTime, time);\n clearTimeout(target.animationResetTimer);\n target.animationResetTimer = setTimeout(function () {\n target.animationTime = 0;\n target.prevFromRect = null;\n target.fromRect = null;\n target.prevToRect = null;\n target.thisAnimationDuration = null;\n }, time);\n target.thisAnimationDuration = time;\n }\n });\n clearTimeout(animationCallbackId);\n if (!animating) {\n if (typeof callback === 'function') callback();\n } else {\n animationCallbackId = setTimeout(function () {\n if (typeof callback === 'function') callback();\n }, animationTime);\n }\n animationStates = [];\n },\n animate: function animate(target, currentRect, toRect, duration) {\n if (duration) {\n css(target, 'transition', '');\n css(target, 'transform', '');\n var elMatrix = matrix(this.el),\n scaleX = elMatrix && elMatrix.a,\n scaleY = elMatrix && elMatrix.d,\n translateX = (currentRect.left - toRect.left) / (scaleX || 1),\n translateY = (currentRect.top - toRect.top) / (scaleY || 1);\n target.animatingX = !!translateX;\n target.animatingY = !!translateY;\n css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)');\n this.forRepaintDummy = repaint(target); // repaint\n\n css(target, 'transition', 'transform ' + duration + 'ms' + (this.options.easing ? ' ' + this.options.easing : ''));\n css(target, 'transform', 'translate3d(0,0,0)');\n typeof target.animated === 'number' && clearTimeout(target.animated);\n target.animated = setTimeout(function () {\n css(target, 'transition', '');\n css(target, 'transform', '');\n target.animated = false;\n target.animatingX = false;\n target.animatingY = false;\n }, duration);\n }\n }\n };\n}\nfunction repaint(target) {\n return target.offsetWidth;\n}\nfunction calculateRealTime(animatingRect, fromRect, toRect, options) {\n return Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) / Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2)) * options.animation;\n}\n\nvar plugins = [];\nvar defaults = {\n initializeByDefault: true\n};\nvar PluginManager = {\n mount: function mount(plugin) {\n // Set default static properties\n for (var option in defaults) {\n if (defaults.hasOwnProperty(option) && !(option in plugin)) {\n plugin[option] = defaults[option];\n }\n }\n plugins.forEach(function (p) {\n if (p.pluginName === plugin.pluginName) {\n throw \"Sortable: Cannot mount plugin \".concat(plugin.pluginName, \" more than once\");\n }\n });\n plugins.push(plugin);\n },\n pluginEvent: function pluginEvent(eventName, sortable, evt) {\n var _this = this;\n this.eventCanceled = false;\n evt.cancel = function () {\n _this.eventCanceled = true;\n };\n var eventNameGlobal = eventName + 'Global';\n plugins.forEach(function (plugin) {\n if (!sortable[plugin.pluginName]) return;\n // Fire global events if it exists in this sortable\n if (sortable[plugin.pluginName][eventNameGlobal]) {\n sortable[plugin.pluginName][eventNameGlobal](_objectSpread2({\n sortable: sortable\n }, evt));\n }\n\n // Only fire plugin event if plugin is enabled in this sortable,\n // and plugin has event defined\n if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) {\n sortable[plugin.pluginName][eventName](_objectSpread2({\n sortable: sortable\n }, evt));\n }\n });\n },\n initializePlugins: function initializePlugins(sortable, el, defaults, options) {\n plugins.forEach(function (plugin) {\n var pluginName = plugin.pluginName;\n if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;\n var initialized = new plugin(sortable, el, sortable.options);\n initialized.sortable = sortable;\n initialized.options = sortable.options;\n sortable[pluginName] = initialized;\n\n // Add default options from plugin\n _extends(defaults, initialized.defaults);\n });\n for (var option in sortable.options) {\n if (!sortable.options.hasOwnProperty(option)) continue;\n var modified = this.modifyOption(sortable, option, sortable.options[option]);\n if (typeof modified !== 'undefined') {\n sortable.options[option] = modified;\n }\n }\n },\n getEventProperties: function getEventProperties(name, sortable) {\n var eventProperties = {};\n plugins.forEach(function (plugin) {\n if (typeof plugin.eventProperties !== 'function') return;\n _extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));\n });\n return eventProperties;\n },\n modifyOption: function modifyOption(sortable, name, value) {\n var modifiedValue;\n plugins.forEach(function (plugin) {\n // Plugin must exist on the Sortable\n if (!sortable[plugin.pluginName]) return;\n\n // If static option listener exists for this option, call in the context of the Sortable's instance of this plugin\n if (plugin.optionListeners && typeof plugin.optionListeners[name] === 'function') {\n modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);\n }\n });\n return modifiedValue;\n }\n};\n\nfunction dispatchEvent(_ref) {\n var sortable = _ref.sortable,\n rootEl = _ref.rootEl,\n name = _ref.name,\n targetEl = _ref.targetEl,\n cloneEl = _ref.cloneEl,\n toEl = _ref.toEl,\n fromEl = _ref.fromEl,\n oldIndex = _ref.oldIndex,\n newIndex = _ref.newIndex,\n oldDraggableIndex = _ref.oldDraggableIndex,\n newDraggableIndex = _ref.newDraggableIndex,\n originalEvent = _ref.originalEvent,\n putSortable = _ref.putSortable,\n extraEventProperties = _ref.extraEventProperties;\n sortable = sortable || rootEl && rootEl[expando];\n if (!sortable) return;\n var evt,\n options = sortable.options,\n onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1);\n // Support for new CustomEvent feature\n if (window.CustomEvent && !IE11OrLess && !Edge) {\n evt = new CustomEvent(name, {\n bubbles: true,\n cancelable: true\n });\n } else {\n evt = document.createEvent('Event');\n evt.initEvent(name, true, true);\n }\n evt.to = toEl || rootEl;\n evt.from = fromEl || rootEl;\n evt.item = targetEl || rootEl;\n evt.clone = cloneEl;\n evt.oldIndex = oldIndex;\n evt.newIndex = newIndex;\n evt.oldDraggableIndex = oldDraggableIndex;\n evt.newDraggableIndex = newDraggableIndex;\n evt.originalEvent = originalEvent;\n evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;\n var allEventProperties = _objectSpread2(_objectSpread2({}, extraEventProperties), PluginManager.getEventProperties(name, sortable));\n for (var option in allEventProperties) {\n evt[option] = allEventProperties[option];\n }\n if (rootEl) {\n rootEl.dispatchEvent(evt);\n }\n if (options[onName]) {\n options[onName].call(sortable, evt);\n }\n}\n\nvar _excluded = [\"evt\"];\nvar pluginEvent = function pluginEvent(eventName, sortable) {\n var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},\n originalEvent = _ref.evt,\n data = _objectWithoutProperties(_ref, _excluded);\n PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread2({\n dragEl: dragEl,\n parentEl: parentEl,\n ghostEl: ghostEl,\n rootEl: rootEl,\n nextEl: nextEl,\n lastDownEl: lastDownEl,\n cloneEl: cloneEl,\n cloneHidden: cloneHidden,\n dragStarted: moved,\n putSortable: putSortable,\n activeSortable: Sortable.active,\n originalEvent: originalEvent,\n oldIndex: oldIndex,\n oldDraggableIndex: oldDraggableIndex,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex,\n hideGhostForTarget: _hideGhostForTarget,\n unhideGhostForTarget: _unhideGhostForTarget,\n cloneNowHidden: function cloneNowHidden() {\n cloneHidden = true;\n },\n cloneNowShown: function cloneNowShown() {\n cloneHidden = false;\n },\n dispatchSortableEvent: function dispatchSortableEvent(name) {\n _dispatchEvent({\n sortable: sortable,\n name: name,\n originalEvent: originalEvent\n });\n }\n }, data));\n};\nfunction _dispatchEvent(info) {\n dispatchEvent(_objectSpread2({\n putSortable: putSortable,\n cloneEl: cloneEl,\n targetEl: dragEl,\n rootEl: rootEl,\n oldIndex: oldIndex,\n oldDraggableIndex: oldDraggableIndex,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex\n }, info));\n}\nvar dragEl,\n parentEl,\n ghostEl,\n rootEl,\n nextEl,\n lastDownEl,\n cloneEl,\n cloneHidden,\n oldIndex,\n newIndex,\n oldDraggableIndex,\n newDraggableIndex,\n activeGroup,\n putSortable,\n awaitingDragStarted = false,\n ignoreNextClick = false,\n sortables = [],\n tapEvt,\n touchEvt,\n lastDx,\n lastDy,\n tapDistanceLeft,\n tapDistanceTop,\n moved,\n lastTarget,\n lastDirection,\n pastFirstInvertThresh = false,\n isCircumstantialInvert = false,\n targetMoveDistance,\n // For positioning ghost absolutely\n ghostRelativeParent,\n ghostRelativeParentInitialScroll = [],\n // (left, top)\n\n _silent = false,\n savedInputChecked = [];\n\n/** @const */\nvar documentExists = typeof document !== 'undefined',\n PositionGhostAbsolutely = IOS,\n CSSFloatProperty = Edge || IE11OrLess ? 'cssFloat' : 'float',\n // This will not pass for IE9, because IE9 DnD only works on anchors\n supportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in document.createElement('div'),\n supportCssPointerEvents = function () {\n if (!documentExists) return;\n // false when <= IE11\n if (IE11OrLess) {\n return false;\n }\n var el = document.createElement('x');\n el.style.cssText = 'pointer-events:auto';\n return el.style.pointerEvents === 'auto';\n }(),\n _detectDirection = function _detectDirection(el, options) {\n var elCSS = css(el),\n elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth),\n child1 = getChild(el, 0, options),\n child2 = getChild(el, 1, options),\n firstChildCSS = child1 && css(child1),\n secondChildCSS = child2 && css(child2),\n firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width,\n secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width;\n if (elCSS.display === 'flex') {\n return elCSS.flexDirection === 'column' || elCSS.flexDirection === 'column-reverse' ? 'vertical' : 'horizontal';\n }\n if (elCSS.display === 'grid') {\n return elCSS.gridTemplateColumns.split(' ').length <= 1 ? 'vertical' : 'horizontal';\n }\n if (child1 && firstChildCSS[\"float\"] && firstChildCSS[\"float\"] !== 'none') {\n var touchingSideChild2 = firstChildCSS[\"float\"] === 'left' ? 'left' : 'right';\n return child2 && (secondChildCSS.clear === 'both' || secondChildCSS.clear === touchingSideChild2) ? 'vertical' : 'horizontal';\n }\n return child1 && (firstChildCSS.display === 'block' || firstChildCSS.display === 'flex' || firstChildCSS.display === 'table' || firstChildCSS.display === 'grid' || firstChildWidth >= elWidth && elCSS[CSSFloatProperty] === 'none' || child2 && elCSS[CSSFloatProperty] === 'none' && firstChildWidth + secondChildWidth > elWidth) ? 'vertical' : 'horizontal';\n },\n _dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {\n var dragElS1Opp = vertical ? dragRect.left : dragRect.top,\n dragElS2Opp = vertical ? dragRect.right : dragRect.bottom,\n dragElOppLength = vertical ? dragRect.width : dragRect.height,\n targetS1Opp = vertical ? targetRect.left : targetRect.top,\n targetS2Opp = vertical ? targetRect.right : targetRect.bottom,\n targetOppLength = vertical ? targetRect.width : targetRect.height;\n return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;\n },\n /**\r\n * Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.\r\n * @param {Number} x X position\r\n * @param {Number} y Y position\r\n * @return {HTMLElement} Element of the first found nearest Sortable\r\n */\n _detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {\n var ret;\n sortables.some(function (sortable) {\n var threshold = sortable[expando].options.emptyInsertThreshold;\n if (!threshold || lastChild(sortable)) return;\n var rect = getRect(sortable),\n insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold,\n insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;\n if (insideHorizontally && insideVertically) {\n return ret = sortable;\n }\n });\n return ret;\n },\n _prepareGroup = function _prepareGroup(options) {\n function toFn(value, pull) {\n return function (to, from, dragEl, evt) {\n var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;\n if (value == null && (pull || sameGroup)) {\n // Default pull value\n // Default pull and put value if same group\n return true;\n } else if (value == null || value === false) {\n return false;\n } else if (pull && value === 'clone') {\n return value;\n } else if (typeof value === 'function') {\n return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);\n } else {\n var otherGroup = (pull ? to : from).options.group.name;\n return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;\n }\n };\n }\n var group = {};\n var originalGroup = options.group;\n if (!originalGroup || _typeof(originalGroup) != 'object') {\n originalGroup = {\n name: originalGroup\n };\n }\n group.name = originalGroup.name;\n group.checkPull = toFn(originalGroup.pull, true);\n group.checkPut = toFn(originalGroup.put);\n group.revertClone = originalGroup.revertClone;\n options.group = group;\n },\n _hideGhostForTarget = function _hideGhostForTarget() {\n if (!supportCssPointerEvents && ghostEl) {\n css(ghostEl, 'display', 'none');\n }\n },\n _unhideGhostForTarget = function _unhideGhostForTarget() {\n if (!supportCssPointerEvents && ghostEl) {\n css(ghostEl, 'display', '');\n }\n };\n\n// #1184 fix - Prevent click event on fallback if dragged but item not changed position\nif (documentExists && !ChromeForAndroid) {\n document.addEventListener('click', function (evt) {\n if (ignoreNextClick) {\n evt.preventDefault();\n evt.stopPropagation && evt.stopPropagation();\n evt.stopImmediatePropagation && evt.stopImmediatePropagation();\n ignoreNextClick = false;\n return false;\n }\n }, true);\n}\nvar nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {\n if (dragEl) {\n evt = evt.touches ? evt.touches[0] : evt;\n var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);\n if (nearest) {\n // Create imitation event\n var event = {};\n for (var i in evt) {\n if (evt.hasOwnProperty(i)) {\n event[i] = evt[i];\n }\n }\n event.target = event.rootEl = nearest;\n event.preventDefault = void 0;\n event.stopPropagation = void 0;\n nearest[expando]._onDragOver(event);\n }\n }\n};\nvar _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {\n if (dragEl) {\n dragEl.parentNode[expando]._isOutsideThisEl(evt.target);\n }\n};\n\n/**\r\n * @class Sortable\r\n * @param {HTMLElement} el\r\n * @param {Object} [options]\r\n */\nfunction Sortable(el, options) {\n if (!(el && el.nodeType && el.nodeType === 1)) {\n throw \"Sortable: `el` must be an HTMLElement, not \".concat({}.toString.call(el));\n }\n this.el = el; // root element\n this.options = options = _extends({}, options);\n\n // Export instance\n el[expando] = this;\n var defaults = {\n group: null,\n sort: true,\n disabled: false,\n store: null,\n handle: null,\n draggable: /^[uo]l$/i.test(el.nodeName) ? '>li' : '>*',\n swapThreshold: 1,\n // percentage; 0 <= x <= 1\n invertSwap: false,\n // invert always\n invertedSwapThreshold: null,\n // will be set to same as swapThreshold if default\n removeCloneOnHide: true,\n direction: function direction() {\n return _detectDirection(el, this.options);\n },\n ghostClass: 'sortable-ghost',\n chosenClass: 'sortable-chosen',\n dragClass: 'sortable-drag',\n ignore: 'a, img',\n filter: null,\n preventOnFilter: true,\n animation: 0,\n easing: null,\n setData: function setData(dataTransfer, dragEl) {\n dataTransfer.setData('Text', dragEl.textContent);\n },\n dropBubble: false,\n dragoverBubble: false,\n dataIdAttr: 'data-id',\n delay: 0,\n delayOnTouchOnly: false,\n touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,\n forceFallback: false,\n fallbackClass: 'sortable-fallback',\n fallbackOnBody: false,\n fallbackTolerance: 0,\n fallbackOffset: {\n x: 0,\n y: 0\n },\n supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && !Safari,\n emptyInsertThreshold: 5\n };\n PluginManager.initializePlugins(this, el, defaults);\n\n // Set default options\n for (var name in defaults) {\n !(name in options) && (options[name] = defaults[name]);\n }\n _prepareGroup(options);\n\n // Bind all private methods\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n\n // Setup drag mode\n this.nativeDraggable = options.forceFallback ? false : supportDraggable;\n if (this.nativeDraggable) {\n // Touch start threshold cannot be greater than the native dragstart threshold\n this.options.touchStartThreshold = 1;\n }\n\n // Bind events\n if (options.supportPointer) {\n on(el, 'pointerdown', this._onTapStart);\n } else {\n on(el, 'mousedown', this._onTapStart);\n on(el, 'touchstart', this._onTapStart);\n }\n if (this.nativeDraggable) {\n on(el, 'dragover', this);\n on(el, 'dragenter', this);\n }\n sortables.push(this.el);\n\n // Restore sorting\n options.store && options.store.get && this.sort(options.store.get(this) || []);\n\n // Add animation state manager\n _extends(this, AnimationStateManager());\n}\nSortable.prototype = /** @lends Sortable.prototype */{\n constructor: Sortable,\n _isOutsideThisEl: function _isOutsideThisEl(target) {\n if (!this.el.contains(target) && target !== this.el) {\n lastTarget = null;\n }\n },\n _getDirection: function _getDirection(evt, target) {\n return typeof this.options.direction === 'function' ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction;\n },\n _onTapStart: function _onTapStart( /** Event|TouchEvent */evt) {\n if (!evt.cancelable) return;\n var _this = this,\n el = this.el,\n options = this.options,\n preventOnFilter = options.preventOnFilter,\n type = evt.type,\n touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === 'touch' && evt,\n target = (touch || evt).target,\n originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target,\n filter = options.filter;\n _saveInputCheckedState(el);\n\n // Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.\n if (dragEl) {\n return;\n }\n if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) {\n return; // only left button and enabled\n }\n\n // cancel dnd if original target is content editable\n if (originalTarget.isContentEditable) {\n return;\n }\n\n // Safari ignores further event handling after mousedown\n if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === 'SELECT') {\n return;\n }\n target = closest(target, options.draggable, el, false);\n if (target && target.animated) {\n return;\n }\n if (lastDownEl === target) {\n // Ignoring duplicate `down`\n return;\n }\n\n // Get the index of the dragged element within its parent\n oldIndex = index(target);\n oldDraggableIndex = index(target, options.draggable);\n\n // Check filter\n if (typeof filter === 'function') {\n if (filter.call(this, evt, target, this)) {\n _dispatchEvent({\n sortable: _this,\n rootEl: originalTarget,\n name: 'filter',\n targetEl: target,\n toEl: el,\n fromEl: el\n });\n pluginEvent('filter', _this, {\n evt: evt\n });\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n } else if (filter) {\n filter = filter.split(',').some(function (criteria) {\n criteria = closest(originalTarget, criteria.trim(), el, false);\n if (criteria) {\n _dispatchEvent({\n sortable: _this,\n rootEl: criteria,\n name: 'filter',\n targetEl: target,\n fromEl: el,\n toEl: el\n });\n pluginEvent('filter', _this, {\n evt: evt\n });\n return true;\n }\n });\n if (filter) {\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n }\n if (options.handle && !closest(originalTarget, options.handle, el, false)) {\n return;\n }\n\n // Prepare `dragstart`\n this._prepareDragStart(evt, touch, target);\n },\n _prepareDragStart: function _prepareDragStart( /** Event */evt, /** Touch */touch, /** HTMLElement */target) {\n var _this = this,\n el = _this.el,\n options = _this.options,\n ownerDocument = el.ownerDocument,\n dragStartFn;\n if (target && !dragEl && target.parentNode === el) {\n var dragRect = getRect(target);\n rootEl = el;\n dragEl = target;\n parentEl = dragEl.parentNode;\n nextEl = dragEl.nextSibling;\n lastDownEl = target;\n activeGroup = options.group;\n Sortable.dragged = dragEl;\n tapEvt = {\n target: dragEl,\n clientX: (touch || evt).clientX,\n clientY: (touch || evt).clientY\n };\n tapDistanceLeft = tapEvt.clientX - dragRect.left;\n tapDistanceTop = tapEvt.clientY - dragRect.top;\n this._lastX = (touch || evt).clientX;\n this._lastY = (touch || evt).clientY;\n dragEl.style['will-change'] = 'all';\n dragStartFn = function dragStartFn() {\n pluginEvent('delayEnded', _this, {\n evt: evt\n });\n if (Sortable.eventCanceled) {\n _this._onDrop();\n return;\n }\n // Delayed drag has been triggered\n // we can re-enable the events: touchmove/mousemove\n _this._disableDelayedDragEvents();\n if (!FireFox && _this.nativeDraggable) {\n dragEl.draggable = true;\n }\n\n // Bind the events: dragstart/dragend\n _this._triggerDragStart(evt, touch);\n\n // Drag start event\n _dispatchEvent({\n sortable: _this,\n name: 'choose',\n originalEvent: evt\n });\n\n // Chosen item\n toggleClass(dragEl, options.chosenClass, true);\n };\n\n // Disable \"draggable\"\n options.ignore.split(',').forEach(function (criteria) {\n find(dragEl, criteria.trim(), _disableDraggable);\n });\n on(ownerDocument, 'dragover', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'mousemove', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'mouseup', _this._onDrop);\n on(ownerDocument, 'touchend', _this._onDrop);\n on(ownerDocument, 'touchcancel', _this._onDrop);\n\n // Make dragEl draggable (must be before delay for FireFox)\n if (FireFox && this.nativeDraggable) {\n this.options.touchStartThreshold = 4;\n dragEl.draggable = true;\n }\n pluginEvent('delayStart', this, {\n evt: evt\n });\n\n // Delay is impossible for native DnD in Edge or IE\n if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) {\n if (Sortable.eventCanceled) {\n this._onDrop();\n return;\n }\n // If the user moves the pointer or let go the click or touch\n // before the delay has been reached:\n // disable the delayed drag\n on(ownerDocument, 'mouseup', _this._disableDelayedDrag);\n on(ownerDocument, 'touchend', _this._disableDelayedDrag);\n on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);\n on(ownerDocument, 'mousemove', _this._delayedDragTouchMoveHandler);\n on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler);\n options.supportPointer && on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler);\n _this._dragStartTimer = setTimeout(dragStartFn, options.delay);\n } else {\n dragStartFn();\n }\n }\n },\n _delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler( /** TouchEvent|PointerEvent **/e) {\n var touch = e.touches ? e.touches[0] : e;\n if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) {\n this._disableDelayedDrag();\n }\n },\n _disableDelayedDrag: function _disableDelayedDrag() {\n dragEl && _disableDraggable(dragEl);\n clearTimeout(this._dragStartTimer);\n this._disableDelayedDragEvents();\n },\n _disableDelayedDragEvents: function _disableDelayedDragEvents() {\n var ownerDocument = this.el.ownerDocument;\n off(ownerDocument, 'mouseup', this._disableDelayedDrag);\n off(ownerDocument, 'touchend', this._disableDelayedDrag);\n off(ownerDocument, 'touchcancel', this._disableDelayedDrag);\n off(ownerDocument, 'mousemove', this._delayedDragTouchMoveHandler);\n off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler);\n off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler);\n },\n _triggerDragStart: function _triggerDragStart( /** Event */evt, /** Touch */touch) {\n touch = touch || evt.pointerType == 'touch' && evt;\n if (!this.nativeDraggable || touch) {\n if (this.options.supportPointer) {\n on(document, 'pointermove', this._onTouchMove);\n } else if (touch) {\n on(document, 'touchmove', this._onTouchMove);\n } else {\n on(document, 'mousemove', this._onTouchMove);\n }\n } else {\n on(dragEl, 'dragend', this);\n on(rootEl, 'dragstart', this._onDragStart);\n }\n try {\n if (document.selection) {\n // Timeout neccessary for IE9\n _nextTick(function () {\n document.selection.empty();\n });\n } else {\n window.getSelection().removeAllRanges();\n }\n } catch (err) {}\n },\n _dragStarted: function _dragStarted(fallback, evt) {\n awaitingDragStarted = false;\n if (rootEl && dragEl) {\n pluginEvent('dragStarted', this, {\n evt: evt\n });\n if (this.nativeDraggable) {\n on(document, 'dragover', _checkOutsideTargetEl);\n }\n var options = this.options;\n\n // Apply effect\n !fallback && toggleClass(dragEl, options.dragClass, false);\n toggleClass(dragEl, options.ghostClass, true);\n Sortable.active = this;\n fallback && this._appendGhost();\n\n // Drag start event\n _dispatchEvent({\n sortable: this,\n name: 'start',\n originalEvent: evt\n });\n } else {\n this._nulling();\n }\n },\n _emulateDragOver: function _emulateDragOver() {\n if (touchEvt) {\n this._lastX = touchEvt.clientX;\n this._lastY = touchEvt.clientY;\n _hideGhostForTarget();\n var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n var parent = target;\n while (target && target.shadowRoot) {\n target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n if (target === parent) break;\n parent = target;\n }\n dragEl.parentNode[expando]._isOutsideThisEl(target);\n if (parent) {\n do {\n if (parent[expando]) {\n var inserted = void 0;\n inserted = parent[expando]._onDragOver({\n clientX: touchEvt.clientX,\n clientY: touchEvt.clientY,\n target: target,\n rootEl: parent\n });\n if (inserted && !this.options.dragoverBubble) {\n break;\n }\n }\n target = parent; // store last element\n }\n /* jshint boss:true */ while (parent = parent.parentNode);\n }\n _unhideGhostForTarget();\n }\n },\n _onTouchMove: function _onTouchMove( /**TouchEvent*/evt) {\n if (tapEvt) {\n var options = this.options,\n fallbackTolerance = options.fallbackTolerance,\n fallbackOffset = options.fallbackOffset,\n touch = evt.touches ? evt.touches[0] : evt,\n ghostMatrix = ghostEl && matrix(ghostEl, true),\n scaleX = ghostEl && ghostMatrix && ghostMatrix.a,\n scaleY = ghostEl && ghostMatrix && ghostMatrix.d,\n relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent),\n dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1),\n dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1);\n\n // only set the status to dragging, when we are actually dragging\n if (!Sortable.active && !awaitingDragStarted) {\n if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) {\n return;\n }\n this._onDragStart(evt, true);\n }\n if (ghostEl) {\n if (ghostMatrix) {\n ghostMatrix.e += dx - (lastDx || 0);\n ghostMatrix.f += dy - (lastDy || 0);\n } else {\n ghostMatrix = {\n a: 1,\n b: 0,\n c: 0,\n d: 1,\n e: dx,\n f: dy\n };\n }\n var cssMatrix = \"matrix(\".concat(ghostMatrix.a, \",\").concat(ghostMatrix.b, \",\").concat(ghostMatrix.c, \",\").concat(ghostMatrix.d, \",\").concat(ghostMatrix.e, \",\").concat(ghostMatrix.f, \")\");\n css(ghostEl, 'webkitTransform', cssMatrix);\n css(ghostEl, 'mozTransform', cssMatrix);\n css(ghostEl, 'msTransform', cssMatrix);\n css(ghostEl, 'transform', cssMatrix);\n lastDx = dx;\n lastDy = dy;\n touchEvt = touch;\n }\n evt.cancelable && evt.preventDefault();\n }\n },\n _appendGhost: function _appendGhost() {\n // Bug if using scale(): https://stackoverflow.com/questions/2637058\n // Not being adjusted for\n if (!ghostEl) {\n var container = this.options.fallbackOnBody ? document.body : rootEl,\n rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container),\n options = this.options;\n\n // Position absolutely\n if (PositionGhostAbsolutely) {\n // Get relatively positioned parent\n ghostRelativeParent = container;\n while (css(ghostRelativeParent, 'position') === 'static' && css(ghostRelativeParent, 'transform') === 'none' && ghostRelativeParent !== document) {\n ghostRelativeParent = ghostRelativeParent.parentNode;\n }\n if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) {\n if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement();\n rect.top += ghostRelativeParent.scrollTop;\n rect.left += ghostRelativeParent.scrollLeft;\n } else {\n ghostRelativeParent = getWindowScrollingElement();\n }\n ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent);\n }\n ghostEl = dragEl.cloneNode(true);\n toggleClass(ghostEl, options.ghostClass, false);\n toggleClass(ghostEl, options.fallbackClass, true);\n toggleClass(ghostEl, options.dragClass, true);\n css(ghostEl, 'transition', '');\n css(ghostEl, 'transform', '');\n css(ghostEl, 'box-sizing', 'border-box');\n css(ghostEl, 'margin', 0);\n css(ghostEl, 'top', rect.top);\n css(ghostEl, 'left', rect.left);\n css(ghostEl, 'width', rect.width);\n css(ghostEl, 'height', rect.height);\n css(ghostEl, 'opacity', '0.8');\n css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed');\n css(ghostEl, 'zIndex', '100000');\n css(ghostEl, 'pointerEvents', 'none');\n Sortable.ghost = ghostEl;\n container.appendChild(ghostEl);\n\n // Set transform-origin\n css(ghostEl, 'transform-origin', tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + '% ' + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + '%');\n }\n },\n _onDragStart: function _onDragStart( /**Event*/evt, /**boolean*/fallback) {\n var _this = this;\n var dataTransfer = evt.dataTransfer;\n var options = _this.options;\n pluginEvent('dragStart', this, {\n evt: evt\n });\n if (Sortable.eventCanceled) {\n this._onDrop();\n return;\n }\n pluginEvent('setupClone', this);\n if (!Sortable.eventCanceled) {\n cloneEl = clone(dragEl);\n cloneEl.removeAttribute(\"id\");\n cloneEl.draggable = false;\n cloneEl.style['will-change'] = '';\n this._hideClone();\n toggleClass(cloneEl, this.options.chosenClass, false);\n Sortable.clone = cloneEl;\n }\n\n // #1143: IFrame support workaround\n _this.cloneId = _nextTick(function () {\n pluginEvent('clone', _this);\n if (Sortable.eventCanceled) return;\n if (!_this.options.removeCloneOnHide) {\n rootEl.insertBefore(cloneEl, dragEl);\n }\n _this._hideClone();\n _dispatchEvent({\n sortable: _this,\n name: 'clone'\n });\n });\n !fallback && toggleClass(dragEl, options.dragClass, true);\n\n // Set proper drop events\n if (fallback) {\n ignoreNextClick = true;\n _this._loopId = setInterval(_this._emulateDragOver, 50);\n } else {\n // Undo what was set in _prepareDragStart before drag started\n off(document, 'mouseup', _this._onDrop);\n off(document, 'touchend', _this._onDrop);\n off(document, 'touchcancel', _this._onDrop);\n if (dataTransfer) {\n dataTransfer.effectAllowed = 'move';\n options.setData && options.setData.call(_this, dataTransfer, dragEl);\n }\n on(document, 'drop', _this);\n\n // #1276 fix:\n css(dragEl, 'transform', 'translateZ(0)');\n }\n awaitingDragStarted = true;\n _this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));\n on(document, 'selectstart', _this);\n moved = true;\n if (Safari) {\n css(document.body, 'user-select', 'none');\n }\n },\n // Returns true - if no further action is needed (either inserted or another condition)\n _onDragOver: function _onDragOver( /**Event*/evt) {\n var el = this.el,\n target = evt.target,\n dragRect,\n targetRect,\n revert,\n options = this.options,\n group = options.group,\n activeSortable = Sortable.active,\n isOwner = activeGroup === group,\n canSort = options.sort,\n fromSortable = putSortable || activeSortable,\n vertical,\n _this = this,\n completedFired = false;\n if (_silent) return;\n function dragOverEvent(name, extra) {\n pluginEvent(name, _this, _objectSpread2({\n evt: evt,\n isOwner: isOwner,\n axis: vertical ? 'vertical' : 'horizontal',\n revert: revert,\n dragRect: dragRect,\n targetRect: targetRect,\n canSort: canSort,\n fromSortable: fromSortable,\n target: target,\n completed: completed,\n onMove: function onMove(target, after) {\n return _onMove(rootEl, el, dragEl, dragRect, target, getRect(target), evt, after);\n },\n changed: changed\n }, extra));\n }\n\n // Capture animation state\n function capture() {\n dragOverEvent('dragOverAnimationCapture');\n _this.captureAnimationState();\n if (_this !== fromSortable) {\n fromSortable.captureAnimationState();\n }\n }\n\n // Return invocation when dragEl is inserted (or completed)\n function completed(insertion) {\n dragOverEvent('dragOverCompleted', {\n insertion: insertion\n });\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) {\n activeSortable._hideClone();\n } else {\n activeSortable._showClone(_this);\n }\n if (_this !== fromSortable) {\n // Set ghost class to new sortable's ghost class\n toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);\n toggleClass(dragEl, options.ghostClass, true);\n }\n if (putSortable !== _this && _this !== Sortable.active) {\n putSortable = _this;\n } else if (_this === Sortable.active && putSortable) {\n putSortable = null;\n }\n\n // Animation\n if (fromSortable === _this) {\n _this._ignoreWhileAnimating = target;\n }\n _this.animateAll(function () {\n dragOverEvent('dragOverAnimationComplete');\n _this._ignoreWhileAnimating = null;\n });\n if (_this !== fromSortable) {\n fromSortable.animateAll();\n fromSortable._ignoreWhileAnimating = null;\n }\n }\n\n // Null lastTarget if it is not inside a previously swapped element\n if (target === dragEl && !dragEl.animated || target === el && !target.animated) {\n lastTarget = null;\n }\n\n // no bubbling and not fallback\n if (!options.dragoverBubble && !evt.rootEl && target !== document) {\n dragEl.parentNode[expando]._isOutsideThisEl(evt.target);\n\n // Do not detect for empty insert if already inserted\n !insertion && nearestEmptyInsertDetectEvent(evt);\n }\n !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();\n return completedFired = true;\n }\n\n // Call when dragEl has been inserted\n function changed() {\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n _dispatchEvent({\n sortable: _this,\n name: 'change',\n toEl: el,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex,\n originalEvent: evt\n });\n }\n if (evt.preventDefault !== void 0) {\n evt.cancelable && evt.preventDefault();\n }\n target = closest(target, options.draggable, el, true);\n dragOverEvent('dragOver');\n if (Sortable.eventCanceled) return completedFired;\n if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) {\n return completed(false);\n }\n ignoreNextClick = false;\n if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = parentEl !== rootEl) // Reverting item into the original list\n : putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) {\n vertical = this._getDirection(evt, target) === 'vertical';\n dragRect = getRect(dragEl);\n dragOverEvent('dragOverValid');\n if (Sortable.eventCanceled) return completedFired;\n if (revert) {\n parentEl = rootEl; // actualization\n capture();\n this._hideClone();\n dragOverEvent('revert');\n if (!Sortable.eventCanceled) {\n if (nextEl) {\n rootEl.insertBefore(dragEl, nextEl);\n } else {\n rootEl.appendChild(dragEl);\n }\n }\n return completed(true);\n }\n var elLastChild = lastChild(el, options.draggable);\n if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) {\n // Insert to end of list\n\n // If already at end of list: Do not insert\n if (elLastChild === dragEl) {\n return completed(false);\n }\n\n // if there is a last element, it is the target\n if (elLastChild && el === evt.target) {\n target = elLastChild;\n }\n if (target) {\n targetRect = getRect(target);\n }\n if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) {\n capture();\n if (elLastChild && elLastChild.nextSibling) {\n // the last draggable element is not the last node\n el.insertBefore(dragEl, elLastChild.nextSibling);\n } else {\n el.appendChild(dragEl);\n }\n parentEl = el; // actualization\n\n changed();\n return completed(true);\n }\n } else if (elLastChild && _ghostIsFirst(evt, vertical, this)) {\n // Insert to start of list\n var firstChild = getChild(el, 0, options, true);\n if (firstChild === dragEl) {\n return completed(false);\n }\n target = firstChild;\n targetRect = getRect(target);\n if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, false) !== false) {\n capture();\n el.insertBefore(dragEl, firstChild);\n parentEl = el; // actualization\n\n changed();\n return completed(true);\n }\n } else if (target.parentNode === el) {\n targetRect = getRect(target);\n var direction = 0,\n targetBeforeFirstSwap,\n differentLevel = dragEl.parentNode !== el,\n differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical),\n side1 = vertical ? 'top' : 'left',\n scrolledPastTop = isScrolledPast(target, 'top', 'top') || isScrolledPast(dragEl, 'top', 'top'),\n scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;\n if (lastTarget !== target) {\n targetBeforeFirstSwap = targetRect[side1];\n pastFirstInvertThresh = false;\n isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;\n }\n direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target);\n var sibling;\n if (direction !== 0) {\n // Check if target is beside dragEl in respective direction (ignoring hidden elements)\n var dragIndex = index(dragEl);\n do {\n dragIndex -= direction;\n sibling = parentEl.children[dragIndex];\n } while (sibling && (css(sibling, 'display') === 'none' || sibling === ghostEl));\n }\n // If dragEl is already beside target: Do not insert\n if (direction === 0 || sibling === target) {\n return completed(false);\n }\n lastTarget = target;\n lastDirection = direction;\n var nextSibling = target.nextElementSibling,\n after = false;\n after = direction === 1;\n var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);\n if (moveVector !== false) {\n if (moveVector === 1 || moveVector === -1) {\n after = moveVector === 1;\n }\n _silent = true;\n setTimeout(_unsilent, 30);\n capture();\n if (after && !nextSibling) {\n el.appendChild(dragEl);\n } else {\n target.parentNode.insertBefore(dragEl, after ? nextSibling : target);\n }\n\n // Undo chrome's scroll adjustment (has no effect on other browsers)\n if (scrolledPastTop) {\n scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);\n }\n parentEl = dragEl.parentNode; // actualization\n\n // must be done before animation\n if (targetBeforeFirstSwap !== undefined && !isCircumstantialInvert) {\n targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target)[side1]);\n }\n changed();\n return completed(true);\n }\n }\n if (el.contains(dragEl)) {\n return completed(false);\n }\n }\n return false;\n },\n _ignoreWhileAnimating: null,\n _offMoveEvents: function _offMoveEvents() {\n off(document, 'mousemove', this._onTouchMove);\n off(document, 'touchmove', this._onTouchMove);\n off(document, 'pointermove', this._onTouchMove);\n off(document, 'dragover', nearestEmptyInsertDetectEvent);\n off(document, 'mousemove', nearestEmptyInsertDetectEvent);\n off(document, 'touchmove', nearestEmptyInsertDetectEvent);\n },\n _offUpEvents: function _offUpEvents() {\n var ownerDocument = this.el.ownerDocument;\n off(ownerDocument, 'mouseup', this._onDrop);\n off(ownerDocument, 'touchend', this._onDrop);\n off(ownerDocument, 'pointerup', this._onDrop);\n off(ownerDocument, 'touchcancel', this._onDrop);\n off(document, 'selectstart', this);\n },\n _onDrop: function _onDrop( /**Event*/evt) {\n var el = this.el,\n options = this.options;\n\n // Get the index of the dragged element within its parent\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n pluginEvent('drop', this, {\n evt: evt\n });\n parentEl = dragEl && dragEl.parentNode;\n\n // Get again after plugin event\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n if (Sortable.eventCanceled) {\n this._nulling();\n return;\n }\n awaitingDragStarted = false;\n isCircumstantialInvert = false;\n pastFirstInvertThresh = false;\n clearInterval(this._loopId);\n clearTimeout(this._dragStartTimer);\n _cancelNextTick(this.cloneId);\n _cancelNextTick(this._dragStartId);\n\n // Unbind events\n if (this.nativeDraggable) {\n off(document, 'drop', this);\n off(el, 'dragstart', this._onDragStart);\n }\n this._offMoveEvents();\n this._offUpEvents();\n if (Safari) {\n css(document.body, 'user-select', '');\n }\n css(dragEl, 'transform', '');\n if (evt) {\n if (moved) {\n evt.cancelable && evt.preventDefault();\n !options.dropBubble && evt.stopPropagation();\n }\n ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl);\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {\n // Remove clone(s)\n cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl);\n }\n if (dragEl) {\n if (this.nativeDraggable) {\n off(dragEl, 'dragend', this);\n }\n _disableDraggable(dragEl);\n dragEl.style['will-change'] = '';\n\n // Remove classes\n // ghostClass is added in dragStarted\n if (moved && !awaitingDragStarted) {\n toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false);\n }\n toggleClass(dragEl, this.options.chosenClass, false);\n\n // Drag stop event\n _dispatchEvent({\n sortable: this,\n name: 'unchoose',\n toEl: parentEl,\n newIndex: null,\n newDraggableIndex: null,\n originalEvent: evt\n });\n if (rootEl !== parentEl) {\n if (newIndex >= 0) {\n // Add event\n _dispatchEvent({\n rootEl: parentEl,\n name: 'add',\n toEl: parentEl,\n fromEl: rootEl,\n originalEvent: evt\n });\n\n // Remove event\n _dispatchEvent({\n sortable: this,\n name: 'remove',\n toEl: parentEl,\n originalEvent: evt\n });\n\n // drag from one list and drop into another\n _dispatchEvent({\n rootEl: parentEl,\n name: 'sort',\n toEl: parentEl,\n fromEl: rootEl,\n originalEvent: evt\n });\n _dispatchEvent({\n sortable: this,\n name: 'sort',\n toEl: parentEl,\n originalEvent: evt\n });\n }\n putSortable && putSortable.save();\n } else {\n if (newIndex !== oldIndex) {\n if (newIndex >= 0) {\n // drag & drop within the same list\n _dispatchEvent({\n sortable: this,\n name: 'update',\n toEl: parentEl,\n originalEvent: evt\n });\n _dispatchEvent({\n sortable: this,\n name: 'sort',\n toEl: parentEl,\n originalEvent: evt\n });\n }\n }\n }\n if (Sortable.active) {\n /* jshint eqnull:true */\n if (newIndex == null || newIndex === -1) {\n newIndex = oldIndex;\n newDraggableIndex = oldDraggableIndex;\n }\n _dispatchEvent({\n sortable: this,\n name: 'end',\n toEl: parentEl,\n originalEvent: evt\n });\n\n // Save sorting\n this.save();\n }\n }\n }\n this._nulling();\n },\n _nulling: function _nulling() {\n pluginEvent('nulling', this);\n rootEl = dragEl = parentEl = ghostEl = nextEl = cloneEl = lastDownEl = cloneHidden = tapEvt = touchEvt = moved = newIndex = newDraggableIndex = oldIndex = oldDraggableIndex = lastTarget = lastDirection = putSortable = activeGroup = Sortable.dragged = Sortable.ghost = Sortable.clone = Sortable.active = null;\n savedInputChecked.forEach(function (el) {\n el.checked = true;\n });\n savedInputChecked.length = lastDx = lastDy = 0;\n },\n handleEvent: function handleEvent( /**Event*/evt) {\n switch (evt.type) {\n case 'drop':\n case 'dragend':\n this._onDrop(evt);\n break;\n case 'dragenter':\n case 'dragover':\n if (dragEl) {\n this._onDragOver(evt);\n _globalDragOver(evt);\n }\n break;\n case 'selectstart':\n evt.preventDefault();\n break;\n }\n },\n /**\r\n * Serializes the item into an array of string.\r\n * @returns {String[]}\r\n */\n toArray: function toArray() {\n var order = [],\n el,\n children = this.el.children,\n i = 0,\n n = children.length,\n options = this.options;\n for (; i < n; i++) {\n el = children[i];\n if (closest(el, options.draggable, this.el, false)) {\n order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));\n }\n }\n return order;\n },\n /**\r\n * Sorts the elements according to the array.\r\n * @param {String[]} order order of the items\r\n */\n sort: function sort(order, useAnimation) {\n var items = {},\n rootEl = this.el;\n this.toArray().forEach(function (id, i) {\n var el = rootEl.children[i];\n if (closest(el, this.options.draggable, rootEl, false)) {\n items[id] = el;\n }\n }, this);\n useAnimation && this.captureAnimationState();\n order.forEach(function (id) {\n if (items[id]) {\n rootEl.removeChild(items[id]);\n rootEl.appendChild(items[id]);\n }\n });\n useAnimation && this.animateAll();\n },\n /**\r\n * Save the current sorting\r\n */\n save: function save() {\n var store = this.options.store;\n store && store.set && store.set(this);\n },\n /**\r\n * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.\r\n * @param {HTMLElement} el\r\n * @param {String} [selector] default: `options.draggable`\r\n * @returns {HTMLElement|null}\r\n */\n closest: function closest$1(el, selector) {\n return closest(el, selector || this.options.draggable, this.el, false);\n },\n /**\r\n * Set/get option\r\n * @param {string} name\r\n * @param {*} [value]\r\n * @returns {*}\r\n */\n option: function option(name, value) {\n var options = this.options;\n if (value === void 0) {\n return options[name];\n } else {\n var modifiedValue = PluginManager.modifyOption(this, name, value);\n if (typeof modifiedValue !== 'undefined') {\n options[name] = modifiedValue;\n } else {\n options[name] = value;\n }\n if (name === 'group') {\n _prepareGroup(options);\n }\n }\n },\n /**\r\n * Destroy\r\n */\n destroy: function destroy() {\n pluginEvent('destroy', this);\n var el = this.el;\n el[expando] = null;\n off(el, 'mousedown', this._onTapStart);\n off(el, 'touchstart', this._onTapStart);\n off(el, 'pointerdown', this._onTapStart);\n if (this.nativeDraggable) {\n off(el, 'dragover', this);\n off(el, 'dragenter', this);\n }\n // Remove draggable attributes\n Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) {\n el.removeAttribute('draggable');\n });\n this._onDrop();\n this._disableDelayedDragEvents();\n sortables.splice(sortables.indexOf(this.el), 1);\n this.el = el = null;\n },\n _hideClone: function _hideClone() {\n if (!cloneHidden) {\n pluginEvent('hideClone', this);\n if (Sortable.eventCanceled) return;\n css(cloneEl, 'display', 'none');\n if (this.options.removeCloneOnHide && cloneEl.parentNode) {\n cloneEl.parentNode.removeChild(cloneEl);\n }\n cloneHidden = true;\n }\n },\n _showClone: function _showClone(putSortable) {\n if (putSortable.lastPutMode !== 'clone') {\n this._hideClone();\n return;\n }\n if (cloneHidden) {\n pluginEvent('showClone', this);\n if (Sortable.eventCanceled) return;\n\n // show clone at dragEl or original position\n if (dragEl.parentNode == rootEl && !this.options.group.revertClone) {\n rootEl.insertBefore(cloneEl, dragEl);\n } else if (nextEl) {\n rootEl.insertBefore(cloneEl, nextEl);\n } else {\n rootEl.appendChild(cloneEl);\n }\n if (this.options.group.revertClone) {\n this.animate(dragEl, cloneEl);\n }\n css(cloneEl, 'display', '');\n cloneHidden = false;\n }\n }\n};\nfunction _globalDragOver( /**Event*/evt) {\n if (evt.dataTransfer) {\n evt.dataTransfer.dropEffect = 'move';\n }\n evt.cancelable && evt.preventDefault();\n}\nfunction _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {\n var evt,\n sortable = fromEl[expando],\n onMoveFn = sortable.options.onMove,\n retVal;\n // Support for new CustomEvent feature\n if (window.CustomEvent && !IE11OrLess && !Edge) {\n evt = new CustomEvent('move', {\n bubbles: true,\n cancelable: true\n });\n } else {\n evt = document.createEvent('Event');\n evt.initEvent('move', true, true);\n }\n evt.to = toEl;\n evt.from = fromEl;\n evt.dragged = dragEl;\n evt.draggedRect = dragRect;\n evt.related = targetEl || toEl;\n evt.relatedRect = targetRect || getRect(toEl);\n evt.willInsertAfter = willInsertAfter;\n evt.originalEvent = originalEvent;\n fromEl.dispatchEvent(evt);\n if (onMoveFn) {\n retVal = onMoveFn.call(sortable, evt, originalEvent);\n }\n return retVal;\n}\nfunction _disableDraggable(el) {\n el.draggable = false;\n}\nfunction _unsilent() {\n _silent = false;\n}\nfunction _ghostIsFirst(evt, vertical, sortable) {\n var firstElRect = getRect(getChild(sortable.el, 0, sortable.options, true));\n var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);\n var spacer = 10;\n return vertical ? evt.clientX < childContainingRect.left - spacer || evt.clientY < firstElRect.top && evt.clientX < firstElRect.right : evt.clientY < childContainingRect.top - spacer || evt.clientY < firstElRect.bottom && evt.clientX < firstElRect.left;\n}\nfunction _ghostIsLast(evt, vertical, sortable) {\n var lastElRect = getRect(lastChild(sortable.el, sortable.options.draggable));\n var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);\n var spacer = 10;\n return vertical ? evt.clientX > childContainingRect.right + spacer || evt.clientY > lastElRect.bottom && evt.clientX > lastElRect.left : evt.clientY > childContainingRect.bottom + spacer || evt.clientX > lastElRect.right && evt.clientY > lastElRect.top;\n}\nfunction _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {\n var mouseOnAxis = vertical ? evt.clientY : evt.clientX,\n targetLength = vertical ? targetRect.height : targetRect.width,\n targetS1 = vertical ? targetRect.top : targetRect.left,\n targetS2 = vertical ? targetRect.bottom : targetRect.right,\n invert = false;\n if (!invertSwap) {\n // Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold\n if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) {\n // multiplied only by swapThreshold because mouse will already be inside target by (1 - threshold) * targetLength / 2\n // check if past first invert threshold on side opposite of lastDirection\n if (!pastFirstInvertThresh && (lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) {\n // past first invert threshold, do not restrict inverted threshold to dragEl shadow\n pastFirstInvertThresh = true;\n }\n if (!pastFirstInvertThresh) {\n // dragEl shadow (target move distance shadow)\n if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance // over dragEl shadow\n : mouseOnAxis > targetS2 - targetMoveDistance) {\n return -lastDirection;\n }\n } else {\n invert = true;\n }\n } else {\n // Regular\n if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) {\n return _getInsertDirection(target);\n }\n }\n }\n invert = invert || invertSwap;\n if (invert) {\n // Invert of regular\n if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) {\n return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;\n }\n }\n return 0;\n}\n\n/**\r\n * Gets the direction dragEl must be swapped relative to target in order to make it\r\n * seem that dragEl has been \"inserted\" into that element's position\r\n * @param {HTMLElement} target The target whose position dragEl is being inserted at\r\n * @return {Number} Direction dragEl must be swapped\r\n */\nfunction _getInsertDirection(target) {\n if (index(dragEl) < index(target)) {\n return 1;\n } else {\n return -1;\n }\n}\n\n/**\r\n * Generate id\r\n * @param {HTMLElement} el\r\n * @returns {String}\r\n * @private\r\n */\nfunction _generateId(el) {\n var str = el.tagName + el.className + el.src + el.href + el.textContent,\n i = str.length,\n sum = 0;\n while (i--) {\n sum += str.charCodeAt(i);\n }\n return sum.toString(36);\n}\nfunction _saveInputCheckedState(root) {\n savedInputChecked.length = 0;\n var inputs = root.getElementsByTagName('input');\n var idx = inputs.length;\n while (idx--) {\n var el = inputs[idx];\n el.checked && savedInputChecked.push(el);\n }\n}\nfunction _nextTick(fn) {\n return setTimeout(fn, 0);\n}\nfunction _cancelNextTick(id) {\n return clearTimeout(id);\n}\n\n// Fixed #973:\nif (documentExists) {\n on(document, 'touchmove', function (evt) {\n if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {\n evt.preventDefault();\n }\n });\n}\n\n// Export utils\nSortable.utils = {\n on: on,\n off: off,\n css: css,\n find: find,\n is: function is(el, selector) {\n return !!closest(el, selector, el, false);\n },\n extend: extend,\n throttle: throttle,\n closest: closest,\n toggleClass: toggleClass,\n clone: clone,\n index: index,\n nextTick: _nextTick,\n cancelNextTick: _cancelNextTick,\n detectDirection: _detectDirection,\n getChild: getChild\n};\n\n/**\r\n * Get the Sortable instance of an element\r\n * @param {HTMLElement} element The element\r\n * @return {Sortable|undefined} The instance of Sortable\r\n */\nSortable.get = function (element) {\n return element[expando];\n};\n\n/**\r\n * Mount a plugin to Sortable\r\n * @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted\r\n */\nSortable.mount = function () {\n for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {\n plugins[_key] = arguments[_key];\n }\n if (plugins[0].constructor === Array) plugins = plugins[0];\n plugins.forEach(function (plugin) {\n if (!plugin.prototype || !plugin.prototype.constructor) {\n throw \"Sortable: Mounted plugin must be a constructor function, not \".concat({}.toString.call(plugin));\n }\n if (plugin.utils) Sortable.utils = _objectSpread2(_objectSpread2({}, Sortable.utils), plugin.utils);\n PluginManager.mount(plugin);\n });\n};\n\n/**\r\n * Create sortable instance\r\n * @param {HTMLElement} el\r\n * @param {Object} [options]\r\n */\nSortable.create = function (el, options) {\n return new Sortable(el, options);\n};\n\n// Export\nSortable.version = version;\n\nvar autoScrolls = [],\n scrollEl,\n scrollRootEl,\n scrolling = false,\n lastAutoScrollX,\n lastAutoScrollY,\n touchEvt$1,\n pointerElemChangedInterval;\nfunction AutoScrollPlugin() {\n function AutoScroll() {\n this.defaults = {\n scroll: true,\n forceAutoScrollFallback: false,\n scrollSensitivity: 30,\n scrollSpeed: 10,\n bubbleScroll: true\n };\n\n // Bind all private methods\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n }\n AutoScroll.prototype = {\n dragStarted: function dragStarted(_ref) {\n var originalEvent = _ref.originalEvent;\n if (this.sortable.nativeDraggable) {\n on(document, 'dragover', this._handleAutoScroll);\n } else {\n if (this.options.supportPointer) {\n on(document, 'pointermove', this._handleFallbackAutoScroll);\n } else if (originalEvent.touches) {\n on(document, 'touchmove', this._handleFallbackAutoScroll);\n } else {\n on(document, 'mousemove', this._handleFallbackAutoScroll);\n }\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref2) {\n var originalEvent = _ref2.originalEvent;\n // For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)\n if (!this.options.dragOverBubble && !originalEvent.rootEl) {\n this._handleAutoScroll(originalEvent);\n }\n },\n drop: function drop() {\n if (this.sortable.nativeDraggable) {\n off(document, 'dragover', this._handleAutoScroll);\n } else {\n off(document, 'pointermove', this._handleFallbackAutoScroll);\n off(document, 'touchmove', this._handleFallbackAutoScroll);\n off(document, 'mousemove', this._handleFallbackAutoScroll);\n }\n clearPointerElemChangedInterval();\n clearAutoScrolls();\n cancelThrottle();\n },\n nulling: function nulling() {\n touchEvt$1 = scrollRootEl = scrollEl = scrolling = pointerElemChangedInterval = lastAutoScrollX = lastAutoScrollY = null;\n autoScrolls.length = 0;\n },\n _handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {\n this._handleAutoScroll(evt, true);\n },\n _handleAutoScroll: function _handleAutoScroll(evt, fallback) {\n var _this = this;\n var x = (evt.touches ? evt.touches[0] : evt).clientX,\n y = (evt.touches ? evt.touches[0] : evt).clientY,\n elem = document.elementFromPoint(x, y);\n touchEvt$1 = evt;\n\n // IE does not seem to have native autoscroll,\n // Edge's autoscroll seems too conditional,\n // MACOS Safari does not have autoscroll,\n // Firefox and Chrome are good\n if (fallback || this.options.forceAutoScrollFallback || Edge || IE11OrLess || Safari) {\n autoScroll(evt, this.options, elem, fallback);\n\n // Listener for pointer element change\n var ogElemScroller = getParentAutoScrollElement(elem, true);\n if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) {\n pointerElemChangedInterval && clearPointerElemChangedInterval();\n // Detect for pointer elem change, emulating native DnD behaviour\n pointerElemChangedInterval = setInterval(function () {\n var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true);\n if (newElem !== ogElemScroller) {\n ogElemScroller = newElem;\n clearAutoScrolls();\n }\n autoScroll(evt, _this.options, newElem, fallback);\n }, 10);\n lastAutoScrollX = x;\n lastAutoScrollY = y;\n }\n } else {\n // if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll\n if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) {\n clearAutoScrolls();\n return;\n }\n autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false);\n }\n }\n };\n return _extends(AutoScroll, {\n pluginName: 'scroll',\n initializeByDefault: true\n });\n}\nfunction clearAutoScrolls() {\n autoScrolls.forEach(function (autoScroll) {\n clearInterval(autoScroll.pid);\n });\n autoScrolls = [];\n}\nfunction clearPointerElemChangedInterval() {\n clearInterval(pointerElemChangedInterval);\n}\nvar autoScroll = throttle(function (evt, options, rootEl, isFallback) {\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521\n if (!options.scroll) return;\n var x = (evt.touches ? evt.touches[0] : evt).clientX,\n y = (evt.touches ? evt.touches[0] : evt).clientY,\n sens = options.scrollSensitivity,\n speed = options.scrollSpeed,\n winScroller = getWindowScrollingElement();\n var scrollThisInstance = false,\n scrollCustomFn;\n\n // New scroll root, set scrollEl\n if (scrollRootEl !== rootEl) {\n scrollRootEl = rootEl;\n clearAutoScrolls();\n scrollEl = options.scroll;\n scrollCustomFn = options.scrollFn;\n if (scrollEl === true) {\n scrollEl = getParentAutoScrollElement(rootEl, true);\n }\n }\n var layersOut = 0;\n var currentParent = scrollEl;\n do {\n var el = currentParent,\n rect = getRect(el),\n top = rect.top,\n bottom = rect.bottom,\n left = rect.left,\n right = rect.right,\n width = rect.width,\n height = rect.height,\n canScrollX = void 0,\n canScrollY = void 0,\n scrollWidth = el.scrollWidth,\n scrollHeight = el.scrollHeight,\n elCSS = css(el),\n scrollPosX = el.scrollLeft,\n scrollPosY = el.scrollTop;\n if (el === winScroller) {\n canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll' || elCSS.overflowX === 'visible');\n canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll' || elCSS.overflowY === 'visible');\n } else {\n canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll');\n canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll');\n }\n var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);\n var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);\n if (!autoScrolls[layersOut]) {\n for (var i = 0; i <= layersOut; i++) {\n if (!autoScrolls[i]) {\n autoScrolls[i] = {};\n }\n }\n }\n if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) {\n autoScrolls[layersOut].el = el;\n autoScrolls[layersOut].vx = vx;\n autoScrolls[layersOut].vy = vy;\n clearInterval(autoScrolls[layersOut].pid);\n if (vx != 0 || vy != 0) {\n scrollThisInstance = true;\n /* jshint loopfunc:true */\n autoScrolls[layersOut].pid = setInterval(function () {\n // emulate drag over during autoscroll (fallback), emulating native DnD behaviour\n if (isFallback && this.layer === 0) {\n Sortable.active._onTouchMove(touchEvt$1); // To move ghost if it is positioned absolutely\n }\n var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0;\n var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0;\n if (typeof scrollCustomFn === 'function') {\n if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== 'continue') {\n return;\n }\n }\n scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);\n }.bind({\n layer: layersOut\n }), 24);\n }\n }\n layersOut++;\n } while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false)));\n scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not\n}, 30);\n\nvar drop = function drop(_ref) {\n var originalEvent = _ref.originalEvent,\n putSortable = _ref.putSortable,\n dragEl = _ref.dragEl,\n activeSortable = _ref.activeSortable,\n dispatchSortableEvent = _ref.dispatchSortableEvent,\n hideGhostForTarget = _ref.hideGhostForTarget,\n unhideGhostForTarget = _ref.unhideGhostForTarget;\n if (!originalEvent) return;\n var toSortable = putSortable || activeSortable;\n hideGhostForTarget();\n var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;\n var target = document.elementFromPoint(touch.clientX, touch.clientY);\n unhideGhostForTarget();\n if (toSortable && !toSortable.el.contains(target)) {\n dispatchSortableEvent('spill');\n this.onSpill({\n dragEl: dragEl,\n putSortable: putSortable\n });\n }\n};\nfunction Revert() {}\nRevert.prototype = {\n startIndex: null,\n dragStart: function dragStart(_ref2) {\n var oldDraggableIndex = _ref2.oldDraggableIndex;\n this.startIndex = oldDraggableIndex;\n },\n onSpill: function onSpill(_ref3) {\n var dragEl = _ref3.dragEl,\n putSortable = _ref3.putSortable;\n this.sortable.captureAnimationState();\n if (putSortable) {\n putSortable.captureAnimationState();\n }\n var nextSibling = getChild(this.sortable.el, this.startIndex, this.options);\n if (nextSibling) {\n this.sortable.el.insertBefore(dragEl, nextSibling);\n } else {\n this.sortable.el.appendChild(dragEl);\n }\n this.sortable.animateAll();\n if (putSortable) {\n putSortable.animateAll();\n }\n },\n drop: drop\n};\n_extends(Revert, {\n pluginName: 'revertOnSpill'\n});\nfunction Remove() {}\nRemove.prototype = {\n onSpill: function onSpill(_ref4) {\n var dragEl = _ref4.dragEl,\n putSortable = _ref4.putSortable;\n var parentSortable = putSortable || this.sortable;\n parentSortable.captureAnimationState();\n dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);\n parentSortable.animateAll();\n },\n drop: drop\n};\n_extends(Remove, {\n pluginName: 'removeOnSpill'\n});\n\nvar lastSwapEl;\nfunction SwapPlugin() {\n function Swap() {\n this.defaults = {\n swapClass: 'sortable-swap-highlight'\n };\n }\n Swap.prototype = {\n dragStart: function dragStart(_ref) {\n var dragEl = _ref.dragEl;\n lastSwapEl = dragEl;\n },\n dragOverValid: function dragOverValid(_ref2) {\n var completed = _ref2.completed,\n target = _ref2.target,\n onMove = _ref2.onMove,\n activeSortable = _ref2.activeSortable,\n changed = _ref2.changed,\n cancel = _ref2.cancel;\n if (!activeSortable.options.swap) return;\n var el = this.sortable.el,\n options = this.options;\n if (target && target !== el) {\n var prevSwapEl = lastSwapEl;\n if (onMove(target) !== false) {\n toggleClass(target, options.swapClass, true);\n lastSwapEl = target;\n } else {\n lastSwapEl = null;\n }\n if (prevSwapEl && prevSwapEl !== lastSwapEl) {\n toggleClass(prevSwapEl, options.swapClass, false);\n }\n }\n changed();\n completed(true);\n cancel();\n },\n drop: function drop(_ref3) {\n var activeSortable = _ref3.activeSortable,\n putSortable = _ref3.putSortable,\n dragEl = _ref3.dragEl;\n var toSortable = putSortable || this.sortable;\n var options = this.options;\n lastSwapEl && toggleClass(lastSwapEl, options.swapClass, false);\n if (lastSwapEl && (options.swap || putSortable && putSortable.options.swap)) {\n if (dragEl !== lastSwapEl) {\n toSortable.captureAnimationState();\n if (toSortable !== activeSortable) activeSortable.captureAnimationState();\n swapNodes(dragEl, lastSwapEl);\n toSortable.animateAll();\n if (toSortable !== activeSortable) activeSortable.animateAll();\n }\n }\n },\n nulling: function nulling() {\n lastSwapEl = null;\n }\n };\n return _extends(Swap, {\n pluginName: 'swap',\n eventProperties: function eventProperties() {\n return {\n swapItem: lastSwapEl\n };\n }\n });\n}\nfunction swapNodes(n1, n2) {\n var p1 = n1.parentNode,\n p2 = n2.parentNode,\n i1,\n i2;\n if (!p1 || !p2 || p1.isEqualNode(n2) || p2.isEqualNode(n1)) return;\n i1 = index(n1);\n i2 = index(n2);\n if (p1.isEqualNode(p2) && i1 < i2) {\n i2++;\n }\n p1.insertBefore(n2, p1.children[i1]);\n p2.insertBefore(n1, p2.children[i2]);\n}\n\nvar multiDragElements = [],\n multiDragClones = [],\n lastMultiDragSelect,\n // for selection with modifier key down (SHIFT)\n multiDragSortable,\n initialFolding = false,\n // Initial multi-drag fold when drag started\n folding = false,\n // Folding any other time\n dragStarted = false,\n dragEl$1,\n clonesFromRect,\n clonesHidden;\nfunction MultiDragPlugin() {\n function MultiDrag(sortable) {\n // Bind all private methods\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n if (!sortable.options.avoidImplicitDeselect) {\n if (sortable.options.supportPointer) {\n on(document, 'pointerup', this._deselectMultiDrag);\n } else {\n on(document, 'mouseup', this._deselectMultiDrag);\n on(document, 'touchend', this._deselectMultiDrag);\n }\n }\n on(document, 'keydown', this._checkKeyDown);\n on(document, 'keyup', this._checkKeyUp);\n this.defaults = {\n selectedClass: 'sortable-selected',\n multiDragKey: null,\n avoidImplicitDeselect: false,\n setData: function setData(dataTransfer, dragEl) {\n var data = '';\n if (multiDragElements.length && multiDragSortable === sortable) {\n multiDragElements.forEach(function (multiDragElement, i) {\n data += (!i ? '' : ', ') + multiDragElement.textContent;\n });\n } else {\n data = dragEl.textContent;\n }\n dataTransfer.setData('Text', data);\n }\n };\n }\n MultiDrag.prototype = {\n multiDragKeyDown: false,\n isMultiDrag: false,\n delayStartGlobal: function delayStartGlobal(_ref) {\n var dragged = _ref.dragEl;\n dragEl$1 = dragged;\n },\n delayEnded: function delayEnded() {\n this.isMultiDrag = ~multiDragElements.indexOf(dragEl$1);\n },\n setupClone: function setupClone(_ref2) {\n var sortable = _ref2.sortable,\n cancel = _ref2.cancel;\n if (!this.isMultiDrag) return;\n for (var i = 0; i < multiDragElements.length; i++) {\n multiDragClones.push(clone(multiDragElements[i]));\n multiDragClones[i].sortableIndex = multiDragElements[i].sortableIndex;\n multiDragClones[i].draggable = false;\n multiDragClones[i].style['will-change'] = '';\n toggleClass(multiDragClones[i], this.options.selectedClass, false);\n multiDragElements[i] === dragEl$1 && toggleClass(multiDragClones[i], this.options.chosenClass, false);\n }\n sortable._hideClone();\n cancel();\n },\n clone: function clone(_ref3) {\n var sortable = _ref3.sortable,\n rootEl = _ref3.rootEl,\n dispatchSortableEvent = _ref3.dispatchSortableEvent,\n cancel = _ref3.cancel;\n if (!this.isMultiDrag) return;\n if (!this.options.removeCloneOnHide) {\n if (multiDragElements.length && multiDragSortable === sortable) {\n insertMultiDragClones(true, rootEl);\n dispatchSortableEvent('clone');\n cancel();\n }\n }\n },\n showClone: function showClone(_ref4) {\n var cloneNowShown = _ref4.cloneNowShown,\n rootEl = _ref4.rootEl,\n cancel = _ref4.cancel;\n if (!this.isMultiDrag) return;\n insertMultiDragClones(false, rootEl);\n multiDragClones.forEach(function (clone) {\n css(clone, 'display', '');\n });\n cloneNowShown();\n clonesHidden = false;\n cancel();\n },\n hideClone: function hideClone(_ref5) {\n var _this = this;\n var sortable = _ref5.sortable,\n cloneNowHidden = _ref5.cloneNowHidden,\n cancel = _ref5.cancel;\n if (!this.isMultiDrag) return;\n multiDragClones.forEach(function (clone) {\n css(clone, 'display', 'none');\n if (_this.options.removeCloneOnHide && clone.parentNode) {\n clone.parentNode.removeChild(clone);\n }\n });\n cloneNowHidden();\n clonesHidden = true;\n cancel();\n },\n dragStartGlobal: function dragStartGlobal(_ref6) {\n var sortable = _ref6.sortable;\n if (!this.isMultiDrag && multiDragSortable) {\n multiDragSortable.multiDrag._deselectMultiDrag();\n }\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.sortableIndex = index(multiDragElement);\n });\n\n // Sort multi-drag elements\n multiDragElements = multiDragElements.sort(function (a, b) {\n return a.sortableIndex - b.sortableIndex;\n });\n dragStarted = true;\n },\n dragStarted: function dragStarted(_ref7) {\n var _this2 = this;\n var sortable = _ref7.sortable;\n if (!this.isMultiDrag) return;\n if (this.options.sort) {\n // Capture rects,\n // hide multi drag elements (by positioning them absolute),\n // set multi drag elements rects to dragRect,\n // show multi drag elements,\n // animate to rects,\n // unset rects & remove from DOM\n\n sortable.captureAnimationState();\n if (this.options.animation) {\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n css(multiDragElement, 'position', 'absolute');\n });\n var dragRect = getRect(dragEl$1, false, true, true);\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n setRect(multiDragElement, dragRect);\n });\n folding = true;\n initialFolding = true;\n }\n }\n sortable.animateAll(function () {\n folding = false;\n initialFolding = false;\n if (_this2.options.animation) {\n multiDragElements.forEach(function (multiDragElement) {\n unsetRect(multiDragElement);\n });\n }\n\n // Remove all auxiliary multidrag items from el, if sorting enabled\n if (_this2.options.sort) {\n removeMultiDragElements();\n }\n });\n },\n dragOver: function dragOver(_ref8) {\n var target = _ref8.target,\n completed = _ref8.completed,\n cancel = _ref8.cancel;\n if (folding && ~multiDragElements.indexOf(target)) {\n completed(false);\n cancel();\n }\n },\n revert: function revert(_ref9) {\n var fromSortable = _ref9.fromSortable,\n rootEl = _ref9.rootEl,\n sortable = _ref9.sortable,\n dragRect = _ref9.dragRect;\n if (multiDragElements.length > 1) {\n // Setup unfold animation\n multiDragElements.forEach(function (multiDragElement) {\n sortable.addAnimationState({\n target: multiDragElement,\n rect: folding ? getRect(multiDragElement) : dragRect\n });\n unsetRect(multiDragElement);\n multiDragElement.fromRect = dragRect;\n fromSortable.removeAnimationState(multiDragElement);\n });\n folding = false;\n insertMultiDragElements(!this.options.removeCloneOnHide, rootEl);\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref10) {\n var sortable = _ref10.sortable,\n isOwner = _ref10.isOwner,\n insertion = _ref10.insertion,\n activeSortable = _ref10.activeSortable,\n parentEl = _ref10.parentEl,\n putSortable = _ref10.putSortable;\n var options = this.options;\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) {\n activeSortable._hideClone();\n }\n initialFolding = false;\n // If leaving sort:false root, or already folding - Fold to new location\n if (options.animation && multiDragElements.length > 1 && (folding || !isOwner && !activeSortable.options.sort && !putSortable)) {\n // Fold: Set all multi drag elements's rects to dragEl's rect when multi-drag elements are invisible\n var dragRectAbsolute = getRect(dragEl$1, false, true, true);\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n setRect(multiDragElement, dragRectAbsolute);\n\n // Move element(s) to end of parentEl so that it does not interfere with multi-drag clones insertion if they are inserted\n // while folding, and so that we can capture them again because old sortable will no longer be fromSortable\n parentEl.appendChild(multiDragElement);\n });\n folding = true;\n }\n\n // Clones must be shown (and check to remove multi drags) after folding when interfering multiDragElements are moved out\n if (!isOwner) {\n // Only remove if not folding (folding will remove them anyways)\n if (!folding) {\n removeMultiDragElements();\n }\n if (multiDragElements.length > 1) {\n var clonesHiddenBefore = clonesHidden;\n activeSortable._showClone(sortable);\n\n // Unfold animation for clones if showing from hidden\n if (activeSortable.options.animation && !clonesHidden && clonesHiddenBefore) {\n multiDragClones.forEach(function (clone) {\n activeSortable.addAnimationState({\n target: clone,\n rect: clonesFromRect\n });\n clone.fromRect = clonesFromRect;\n clone.thisAnimationDuration = null;\n });\n }\n } else {\n activeSortable._showClone(sortable);\n }\n }\n }\n },\n dragOverAnimationCapture: function dragOverAnimationCapture(_ref11) {\n var dragRect = _ref11.dragRect,\n isOwner = _ref11.isOwner,\n activeSortable = _ref11.activeSortable;\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n });\n if (activeSortable.options.animation && !isOwner && activeSortable.multiDrag.isMultiDrag) {\n clonesFromRect = _extends({}, dragRect);\n var dragMatrix = matrix(dragEl$1, true);\n clonesFromRect.top -= dragMatrix.f;\n clonesFromRect.left -= dragMatrix.e;\n }\n },\n dragOverAnimationComplete: function dragOverAnimationComplete() {\n if (folding) {\n folding = false;\n removeMultiDragElements();\n }\n },\n drop: function drop(_ref12) {\n var evt = _ref12.originalEvent,\n rootEl = _ref12.rootEl,\n parentEl = _ref12.parentEl,\n sortable = _ref12.sortable,\n dispatchSortableEvent = _ref12.dispatchSortableEvent,\n oldIndex = _ref12.oldIndex,\n putSortable = _ref12.putSortable;\n var toSortable = putSortable || this.sortable;\n if (!evt) return;\n var options = this.options,\n children = parentEl.children;\n\n // Multi-drag selection\n if (!dragStarted) {\n if (options.multiDragKey && !this.multiDragKeyDown) {\n this._deselectMultiDrag();\n }\n toggleClass(dragEl$1, options.selectedClass, !~multiDragElements.indexOf(dragEl$1));\n if (!~multiDragElements.indexOf(dragEl$1)) {\n multiDragElements.push(dragEl$1);\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'select',\n targetEl: dragEl$1,\n originalEvent: evt\n });\n\n // Modifier activated, select from last to dragEl\n if (evt.shiftKey && lastMultiDragSelect && sortable.el.contains(lastMultiDragSelect)) {\n var lastIndex = index(lastMultiDragSelect),\n currentIndex = index(dragEl$1);\n if (~lastIndex && ~currentIndex && lastIndex !== currentIndex) {\n // Must include lastMultiDragSelect (select it), in case modified selection from no selection\n // (but previous selection existed)\n var n, i;\n if (currentIndex > lastIndex) {\n i = lastIndex;\n n = currentIndex;\n } else {\n i = currentIndex;\n n = lastIndex + 1;\n }\n for (; i < n; i++) {\n if (~multiDragElements.indexOf(children[i])) continue;\n toggleClass(children[i], options.selectedClass, true);\n multiDragElements.push(children[i]);\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'select',\n targetEl: children[i],\n originalEvent: evt\n });\n }\n }\n } else {\n lastMultiDragSelect = dragEl$1;\n }\n multiDragSortable = toSortable;\n } else {\n multiDragElements.splice(multiDragElements.indexOf(dragEl$1), 1);\n lastMultiDragSelect = null;\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'deselect',\n targetEl: dragEl$1,\n originalEvent: evt\n });\n }\n }\n\n // Multi-drag drop\n if (dragStarted && this.isMultiDrag) {\n folding = false;\n // Do not \"unfold\" after around dragEl if reverted\n if ((parentEl[expando].options.sort || parentEl !== rootEl) && multiDragElements.length > 1) {\n var dragRect = getRect(dragEl$1),\n multiDragIndex = index(dragEl$1, ':not(.' + this.options.selectedClass + ')');\n if (!initialFolding && options.animation) dragEl$1.thisAnimationDuration = null;\n toSortable.captureAnimationState();\n if (!initialFolding) {\n if (options.animation) {\n dragEl$1.fromRect = dragRect;\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n if (multiDragElement !== dragEl$1) {\n var rect = folding ? getRect(multiDragElement) : dragRect;\n multiDragElement.fromRect = rect;\n\n // Prepare unfold animation\n toSortable.addAnimationState({\n target: multiDragElement,\n rect: rect\n });\n }\n });\n }\n\n // Multi drag elements are not necessarily removed from the DOM on drop, so to reinsert\n // properly they must all be removed\n removeMultiDragElements();\n multiDragElements.forEach(function (multiDragElement) {\n if (children[multiDragIndex]) {\n parentEl.insertBefore(multiDragElement, children[multiDragIndex]);\n } else {\n parentEl.appendChild(multiDragElement);\n }\n multiDragIndex++;\n });\n\n // If initial folding is done, the elements may have changed position because they are now\n // unfolding around dragEl, even though dragEl may not have his index changed, so update event\n // must be fired here as Sortable will not.\n if (oldIndex === index(dragEl$1)) {\n var update = false;\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement.sortableIndex !== index(multiDragElement)) {\n update = true;\n return;\n }\n });\n if (update) {\n dispatchSortableEvent('update');\n dispatchSortableEvent('sort');\n }\n }\n }\n\n // Must be done after capturing individual rects (scroll bar)\n multiDragElements.forEach(function (multiDragElement) {\n unsetRect(multiDragElement);\n });\n toSortable.animateAll();\n }\n multiDragSortable = toSortable;\n }\n\n // Remove clones if necessary\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {\n multiDragClones.forEach(function (clone) {\n clone.parentNode && clone.parentNode.removeChild(clone);\n });\n }\n },\n nullingGlobal: function nullingGlobal() {\n this.isMultiDrag = dragStarted = false;\n multiDragClones.length = 0;\n },\n destroyGlobal: function destroyGlobal() {\n this._deselectMultiDrag();\n off(document, 'pointerup', this._deselectMultiDrag);\n off(document, 'mouseup', this._deselectMultiDrag);\n off(document, 'touchend', this._deselectMultiDrag);\n off(document, 'keydown', this._checkKeyDown);\n off(document, 'keyup', this._checkKeyUp);\n },\n _deselectMultiDrag: function _deselectMultiDrag(evt) {\n if (typeof dragStarted !== \"undefined\" && dragStarted) return;\n\n // Only deselect if selection is in this sortable\n if (multiDragSortable !== this.sortable) return;\n\n // Only deselect if target is not item in this sortable\n if (evt && closest(evt.target, this.options.draggable, this.sortable.el, false)) return;\n\n // Only deselect if left click\n if (evt && evt.button !== 0) return;\n while (multiDragElements.length) {\n var el = multiDragElements[0];\n toggleClass(el, this.options.selectedClass, false);\n multiDragElements.shift();\n dispatchEvent({\n sortable: this.sortable,\n rootEl: this.sortable.el,\n name: 'deselect',\n targetEl: el,\n originalEvent: evt\n });\n }\n },\n _checkKeyDown: function _checkKeyDown(evt) {\n if (evt.key === this.options.multiDragKey) {\n this.multiDragKeyDown = true;\n }\n },\n _checkKeyUp: function _checkKeyUp(evt) {\n if (evt.key === this.options.multiDragKey) {\n this.multiDragKeyDown = false;\n }\n }\n };\n return _extends(MultiDrag, {\n // Static methods & properties\n pluginName: 'multiDrag',\n utils: {\n /**\r\n * Selects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be selected\r\n */\n select: function select(el) {\n var sortable = el.parentNode[expando];\n if (!sortable || !sortable.options.multiDrag || ~multiDragElements.indexOf(el)) return;\n if (multiDragSortable && multiDragSortable !== sortable) {\n multiDragSortable.multiDrag._deselectMultiDrag();\n multiDragSortable = sortable;\n }\n toggleClass(el, sortable.options.selectedClass, true);\n multiDragElements.push(el);\n },\n /**\r\n * Deselects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be deselected\r\n */\n deselect: function deselect(el) {\n var sortable = el.parentNode[expando],\n index = multiDragElements.indexOf(el);\n if (!sortable || !sortable.options.multiDrag || !~index) return;\n toggleClass(el, sortable.options.selectedClass, false);\n multiDragElements.splice(index, 1);\n }\n },\n eventProperties: function eventProperties() {\n var _this3 = this;\n var oldIndicies = [],\n newIndicies = [];\n multiDragElements.forEach(function (multiDragElement) {\n oldIndicies.push({\n multiDragElement: multiDragElement,\n index: multiDragElement.sortableIndex\n });\n\n // multiDragElements will already be sorted if folding\n var newIndex;\n if (folding && multiDragElement !== dragEl$1) {\n newIndex = -1;\n } else if (folding) {\n newIndex = index(multiDragElement, ':not(.' + _this3.options.selectedClass + ')');\n } else {\n newIndex = index(multiDragElement);\n }\n newIndicies.push({\n multiDragElement: multiDragElement,\n index: newIndex\n });\n });\n return {\n items: _toConsumableArray(multiDragElements),\n clones: [].concat(multiDragClones),\n oldIndicies: oldIndicies,\n newIndicies: newIndicies\n };\n },\n optionListeners: {\n multiDragKey: function multiDragKey(key) {\n key = key.toLowerCase();\n if (key === 'ctrl') {\n key = 'Control';\n } else if (key.length > 1) {\n key = key.charAt(0).toUpperCase() + key.substr(1);\n }\n return key;\n }\n }\n });\n}\nfunction insertMultiDragElements(clonesInserted, rootEl) {\n multiDragElements.forEach(function (multiDragElement, i) {\n var target = rootEl.children[multiDragElement.sortableIndex + (clonesInserted ? Number(i) : 0)];\n if (target) {\n rootEl.insertBefore(multiDragElement, target);\n } else {\n rootEl.appendChild(multiDragElement);\n }\n });\n}\n\n/**\r\n * Insert multi-drag clones\r\n * @param {[Boolean]} elementsInserted Whether the multi-drag elements are inserted\r\n * @param {HTMLElement} rootEl\r\n */\nfunction insertMultiDragClones(elementsInserted, rootEl) {\n multiDragClones.forEach(function (clone, i) {\n var target = rootEl.children[clone.sortableIndex + (elementsInserted ? Number(i) : 0)];\n if (target) {\n rootEl.insertBefore(clone, target);\n } else {\n rootEl.appendChild(clone);\n }\n });\n}\nfunction removeMultiDragElements() {\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n multiDragElement.parentNode && multiDragElement.parentNode.removeChild(multiDragElement);\n });\n}\n\nSortable.mount(new AutoScrollPlugin());\nSortable.mount(Remove, Revert);\n\nexport default Sortable;\nexport { MultiDragPlugin as MultiDrag, Sortable, SwapPlugin as Swap };\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/ExtensionPage');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/withAttr');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Form');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/FormSectionGroup');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/FormSection');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/ColorPreviewInput');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/ItemList');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/string');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport FormModal from 'flarum/common/components/FormModal';\nimport Button from 'flarum/common/components/Button';\nimport ColorPreviewInput from 'flarum/common/components/ColorPreviewInput';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport { slug } from 'flarum/common/utils/string';\nimport Stream from 'flarum/common/utils/Stream';\nimport extractText from 'flarum/common/utils/extractText';\nimport Form from 'flarum/common/components/Form';\nimport tagLabel from '../../common/helpers/tagLabel';\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 FormModal {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"tag\", void 0);\n _defineProperty(this, \"name\", void 0);\n _defineProperty(this, \"slug\", void 0);\n _defineProperty(this, \"description\", void 0);\n _defineProperty(this, \"color\", void 0);\n _defineProperty(this, \"icon\", void 0);\n _defineProperty(this, \"isHidden\", void 0);\n _defineProperty(this, \"isPrimary\", void 0);\n }\n oninit(vnode) {\n super.oninit(vnode);\n this.tag = this.attrs.model || app.store.createRecord('tags');\n this.name = Stream(this.tag.name() || '');\n this.slug = Stream(this.tag.slug() || '');\n this.description = Stream(this.tag.description() || '');\n this.color = Stream(this.tag.color() || '');\n this.icon = Stream(this.tag.icon() || '');\n this.isHidden = Stream(this.tag.isHidden() || false);\n this.isPrimary = Stream(this.attrs.primary || false);\n }\n className() {\n return 'EditTagModal Modal--small';\n }\n title() {\n return this.name() ? tagLabel(app.store.createRecord('tags', {\n attributes: this.submitData()\n })) : app.translator.trans('flarum-tags.admin.edit_tag.title');\n }\n content() {\n return m(\"div\", {\n className: \"Modal-body\"\n }, m(Form, null, this.fields().toArray()));\n }\n fields() {\n const items = new ItemList();\n items.add('name', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.edit_tag.name_label')), m(\"input\", {\n className: \"FormControl\",\n placeholder: app.translator.trans('flarum-tags.admin.edit_tag.name_placeholder'),\n value: this.name(),\n oninput: e => {\n const target = e.target;\n this.name(target.value);\n this.slug(slug(target.value));\n }\n })), 50);\n items.add('slug', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.edit_tag.slug_label')), m(\"input\", {\n className: \"FormControl\",\n bidi: this.slug\n })), 40);\n items.add('description', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.edit_tag.description_label')), m(\"textarea\", {\n className: \"FormControl\",\n bidi: this.description\n })), 30);\n items.add('color', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.edit_tag.color_label')), m(ColorPreviewInput, {\n className: \"FormControl\",\n placeholder: \"#aaaaaa\",\n bidi: this.color\n })), 20);\n items.add('icon', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.edit_tag.icon_label')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-tags.admin.edit_tag.icon_text', {\n a: m(\"a\", {\n href: \"https://fontawesome.com/icons?m=free\",\n tabindex: \"-1\"\n })\n })), m(\"input\", {\n className: \"FormControl\",\n placeholder: \"fas fa-bolt\",\n bidi: this.icon\n })), 10);\n items.add('hidden', m(\"div\", {\n className: \"Form-group\"\n }, m(\"div\", null, m(\"label\", {\n className: \"checkbox\"\n }, m(\"input\", {\n type: \"checkbox\",\n bidi: this.isHidden\n }), app.translator.trans('flarum-tags.admin.edit_tag.hide_label')))), 10);\n items.add('submit', m(\"div\", {\n className: \"Form-group Form-controls\"\n }, m(Button, {\n type: \"submit\",\n className: \"Button Button--primary EditTagModal-save\",\n loading: this.loading\n }, app.translator.trans('flarum-tags.admin.edit_tag.submit_button')), this.tag.exists && m(\"button\", {\n type: \"button\",\n className: \"Button EditTagModal-delete\",\n onclick: this.delete.bind(this)\n }, app.translator.trans('flarum-tags.admin.edit_tag.delete_tag_button'))), -10);\n return items;\n }\n submitData() {\n return {\n name: this.name(),\n slug: this.slug(),\n description: this.description(),\n color: this.color(),\n icon: this.icon(),\n isHidden: this.isHidden(),\n isPrimary: this.isPrimary()\n };\n }\n onsubmit(e) {\n e.preventDefault();\n this.loading = true;\n\n // Errors aren't passed to the modal onerror handler here.\n // This is done for better error visibility on smaller screen heights.\n this.tag.save(this.submitData()).then(() => this.hide(), () => this.loading = false);\n }\n delete() {\n if (confirm(extractText(app.translator.trans('flarum-tags.admin.edit_tag.delete_tag_confirmation')))) {\n const children = app.store.all('tags').filter(tag => tag.parent() === this.tag);\n this.tag.delete().then(() => {\n children.forEach(tag => tag.pushData({\n attributes: {\n isChild: false\n }\n }));\n m.redraw();\n });\n this.hide();\n }\n }\n}\nflarum.reg.add('flarum-tags', 'admin/components/EditTagModal', EditTagModal);","import sortable from 'sortablejs';\nimport app from 'flarum/admin/app';\nimport ExtensionPage from 'flarum/admin/components/ExtensionPage';\nimport Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport withAttr from 'flarum/common/utils/withAttr';\nimport Form from 'flarum/common/components/Form';\nimport FormSectionGroup from 'flarum/admin/components/FormSectionGroup';\nimport FormSection from 'flarum/admin/components/FormSection';\nimport EditTagModal from './EditTagModal';\nimport tagIcon from '../../common/helpers/tagIcon';\nimport sortTags from '../../common/utils/sortTags';\nfunction tagItem(tag) {\n return m(\"li\", {\n \"data-id\": tag.id(),\n style: {\n color: tag.color()\n }\n }, m(\"div\", {\n className: \"TagListItem-info\"\n }, tagIcon(tag), m(\"span\", {\n className: \"TagListItem-name\"\n }, tag.name()), m(Button, {\n className: \"Button Button--link\",\n icon: \"fas fa-pencil-alt\",\n onclick: () => app.modal.show(EditTagModal, {\n model: tag\n })\n })), !tag.isChild() && tag.position() !== null && m(\"ol\", {\n className: \"TagListItem-children TagList\"\n }, sortTags(app.store.all('tags')).filter(child => child.parent() === tag).map(tagItem)));\n}\nexport default class TagsPage extends ExtensionPage {\n oninit(vnode) {\n super.oninit(vnode);\n\n // A regular redraw won't work here, because sortable has mucked around\n // with the DOM which will confuse Mithril's diffing algorithm. Instead\n // we force a full reconstruction of the DOM by changing the key, which\n // makes mithril completely re-render the component on redraw.\n this.forcedRefreshKey = 0;\n this.loading = true;\n app.tagList.load(['parent']).then(() => {\n this.loading = false;\n m.redraw();\n });\n }\n content() {\n if (this.loading) {\n return m(LoadingIndicator, null);\n }\n const minPrimaryTags = this.setting('flarum-tags.min_primary_tags', 0);\n const maxPrimaryTags = this.setting('flarum-tags.max_primary_tags', 0);\n const minSecondaryTags = this.setting('flarum-tags.min_secondary_tags', 0);\n const maxSecondaryTags = this.setting('flarum-tags.max_secondary_tags', 0);\n const tags = sortTags(app.store.all('tags').filter(tag => !tag.parent()));\n return m(\"div\", {\n className: \"TagsContent\"\n }, m(\"div\", {\n className: \"TagsContent-list\"\n }, m(\"div\", {\n className: \"container\",\n key: this.forcedRefreshKey,\n oncreate: this.onListOnCreate.bind(this)\n }, m(FormSectionGroup, null, m(FormSection, {\n className: \"TagGroup\",\n label: app.translator.trans('flarum-tags.admin.tags.primary_heading')\n }, m(\"ol\", {\n className: \"TagList TagList--primary\"\n }, tags.filter(tag => tag.position() !== null && !tag.isChild()).map(tagItem)), m(Button, {\n className: \"Button TagList-button\",\n icon: \"fas fa-plus\",\n onclick: () => app.modal.show(EditTagModal, {\n primary: true\n })\n }, app.translator.trans('flarum-tags.admin.tags.create_primary_tag_button'))), m(FormSection, {\n className: \"TagGroup TagGroup--secondary\",\n label: app.translator.trans('flarum-tags.admin.tags.secondary_heading')\n }, m(\"ul\", {\n className: \"TagList\"\n }, tags.filter(tag => tag.position() === null).sort((a, b) => a.name().localeCompare(b.name())).map(tagItem)), m(Button, {\n className: \"Button TagList-button\",\n icon: \"fas fa-plus\",\n onclick: () => app.modal.show(EditTagModal, {\n primary: false\n })\n }, app.translator.trans('flarum-tags.admin.tags.create_secondary_tag_button'))), m(FormSection, {\n label: app.translator.trans('flarum-tags.admin.tags.settings_heading')\n }, m(Form, null, m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.tag_settings.required_primary_heading')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-tags.admin.tag_settings.required_primary_text')), m(\"div\", {\n className: \"TagSettings-rangeInput\"\n }, m(\"input\", {\n className: \"FormControl\",\n type: \"number\",\n min: \"0\",\n value: minPrimaryTags(),\n oninput: withAttr('value', this.setMinTags.bind(this, minPrimaryTags, maxPrimaryTags))\n }), app.translator.trans('flarum-tags.admin.tag_settings.range_separator_text'), m(\"input\", {\n className: \"FormControl\",\n type: \"number\",\n min: minPrimaryTags(),\n bidi: maxPrimaryTags\n }))), m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.tag_settings.required_secondary_heading')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-tags.admin.tag_settings.required_secondary_text')), m(\"div\", {\n className: \"TagSettings-rangeInput\"\n }, m(\"input\", {\n className: \"FormControl\",\n type: \"number\",\n min: \"0\",\n value: minSecondaryTags(),\n oninput: withAttr('value', this.setMinTags.bind(this, minSecondaryTags, maxSecondaryTags))\n }), app.translator.trans('flarum-tags.admin.tag_settings.range_separator_text'), m(\"input\", {\n className: \"FormControl\",\n type: \"number\",\n min: minSecondaryTags(),\n bidi: maxSecondaryTags\n }))), m(\"div\", {\n className: \"Form-group Form-controls\"\n }, this.submitButton())))), m(\"div\", {\n className: \"TagsContent-footer\"\n }, m(\"p\", null, app.translator.trans('flarum-tags.admin.tags.about_tags_text'))))));\n }\n onListOnCreate(vnode) {\n this.$('.TagList').get().map(e => {\n sortable.create(e, {\n group: 'tags',\n delay: 50,\n delayOnTouchOnly: true,\n touchStartThreshold: 5,\n animation: 150,\n swapThreshold: 0.65,\n dragClass: 'sortable-dragging',\n ghostClass: 'sortable-placeholder',\n onSort: e => this.onSortUpdate(e)\n });\n });\n }\n setMinTags(minTags, maxTags, value) {\n minTags(value);\n maxTags(Math.max(value, maxTags()));\n }\n onSortUpdate(e) {\n // If we've moved a tag from 'primary' to 'secondary', then we'll update\n // its attributes in our local store so that when we redraw the change\n // will be made.\n if (e.from instanceof HTMLOListElement && e.to instanceof HTMLUListElement) {\n app.store.getById('tags', e.item.getAttribute('data-id')).pushData({\n attributes: {\n position: null,\n isChild: false\n },\n relationships: {\n parent: null\n }\n });\n }\n\n // Construct an array of primary tag IDs and their children, in the same\n // order that they have been arranged in.\n const order = this.$('.TagList--primary > li').map(function () {\n return {\n id: $(this).data('id'),\n children: $(this).find('li').map(function () {\n return $(this).data('id');\n }).get()\n };\n }).get();\n\n // Now that we have an accurate representation of the order which the\n // primary tags are in, we will update the tag attributes in our local\n // store to reflect this order.\n order.forEach((tag, i) => {\n const parent = app.store.getById('tags', tag.id);\n parent.pushData({\n attributes: {\n position: i,\n isChild: false\n },\n relationships: {\n parent: null\n }\n });\n tag.children.forEach((child, j) => {\n app.store.getById('tags', child).pushData({\n attributes: {\n position: j,\n isChild: true\n },\n relationships: {\n parent\n }\n });\n });\n });\n app.request({\n url: app.forum.attribute('apiUrl') + '/tags/order',\n method: 'POST',\n body: {\n order\n }\n });\n this.forcedRefreshKey++;\n m.redraw();\n }\n}\nflarum.reg.add('flarum-tags', 'admin/components/TagsPage', TagsPage);","import Extend from 'flarum/common/extenders';\nimport commonExtend from '../common/extend';\nimport app from 'flarum/admin/app';\nimport TagsPage from './components/TagsPage';\nexport default [...commonExtend, new Extend.Admin().page(TagsPage).permission(() => ({\n icon: 'fas fa-tag',\n label: app.translator.trans('flarum-tags.admin.permissions.tag_discussions_label'),\n permission: 'discussion.tag'\n}), 'moderate', 95).permission(() => ({\n icon: 'fas fa-tags',\n label: app.translator.trans('flarum-tags.admin.permissions.bypass_tag_counts_label'),\n permission: 'bypassTagCounts'\n}), 'start', 89)];","import app from 'flarum/admin/app';\nimport addTagsPermissionScope from './addTagsPermissionScope';\nimport addTagsHomePageOption from './addTagsHomePageOption';\nimport addTagChangePermission from './addTagChangePermission';\nimport addTagSelectionSettingComponent from './addTagSelectionSettingComponent';\nimport TagListState from '../common/states/TagListState';\nexport { default as extend } from './extend';\napp.initializers.add('flarum-tags', app => {\n app.tagList = new TagListState();\n addTagsPermissionScope();\n addTagsHomePageOption();\n addTagChangePermission();\n addTagSelectionSettingComponent();\n});\nimport './admin';","import app from 'flarum/admin/app';\nimport { extend, override } from 'flarum/common/extend';\nimport PermissionGrid from 'flarum/admin/components/PermissionGrid';\nimport PermissionDropdown from 'flarum/admin/components/PermissionDropdown';\nimport Dropdown from 'flarum/common/components/Dropdown';\nimport Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport tagLabel from '../common/helpers/tagLabel';\nimport tagIcon from '../common/helpers/tagIcon';\nimport sortTags from '../common/utils/sortTags';\nexport default function () {\n extend(PermissionGrid.prototype, 'oninit', function () {\n this.loading = true;\n });\n extend(PermissionGrid.prototype, 'oncreate', function () {\n app.tagList.load().then(() => {\n this.loading = false;\n m.redraw();\n });\n });\n override(PermissionGrid.prototype, 'view', function (original, vnode) {\n if (this.loading) {\n return m(LoadingIndicator, null);\n }\n return original(vnode);\n });\n override(app, 'getRequiredPermissions', (original, permission) => {\n const tagPrefix = permission.match(/^tag\\d+\\./);\n if (tagPrefix) {\n const globalPermission = permission.substr(tagPrefix[0].length);\n const required = original(globalPermission);\n return required.map(required => tagPrefix[0] + required);\n }\n return original(permission);\n });\n extend(PermissionGrid.prototype, 'scopeItems', items => {\n sortTags(app.store.all('tags')).filter(tag => tag.isRestricted()).forEach(tag => items.add('tag' + tag.id(), {\n label: tagLabel(tag),\n onremove: () => tag.save({\n isRestricted: false\n }),\n render: item => {\n var _item$permission;\n if ('setting' in item) return null;\n if (item.permission === 'viewForum' || item.permission === 'startDiscussion' || (_item$permission = item.permission) != null && _item$permission.startsWith('discussion.') && item.tagScoped !== false || item.tagScoped) {\n return m(PermissionDropdown, {\n permission: \"tag\".concat(tag.id(), \".\").concat(item.permission),\n allowGuest: item.allowGuest\n });\n }\n return null;\n }\n }));\n });\n extend(PermissionGrid.prototype, 'scopeControlItems', items => {\n const tags = sortTags(app.store.all('tags').filter(tag => !tag.isRestricted()));\n if (tags.length) {\n items.add('tag', m(Dropdown, {\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 }, tags.map(tag => m(Button, {\n icon: true,\n onclick: () => tag.save({\n isRestricted: true\n })\n }, [tagIcon(tag, {\n className: 'Button-icon'\n }), ' ', tag.name()]))));\n }\n });\n}","import app from 'flarum/admin/app';\nimport { extend } from 'flarum/common/extend';\nimport PermissionGrid from 'flarum/admin/components/PermissionGrid';\nimport SettingDropdown from 'flarum/admin/components/SettingDropdown';\nexport default function () {\n extend(PermissionGrid.prototype, 'startItems', items => {\n items.add('allowTagChange', {\n icon: 'fas fa-tag',\n label: app.translator.trans('flarum-tags.admin.permissions.allow_edit_tags_label'),\n setting: () => {\n const minutes = parseInt(app.data.settings.allow_tag_change, 10);\n return m(SettingDropdown, {\n defaultLabel: minutes ? app.translator.trans('core.admin.permissions_controls.allow_some_minutes_button', {\n count: minutes\n }) : app.translator.trans('core.admin.permissions_controls.allow_indefinitely_button'),\n key: \"allow_tag_change\",\n options: [{\n value: '-1',\n label: app.translator.trans('core.admin.permissions_controls.allow_indefinitely_button')\n }, {\n value: '10',\n label: app.translator.trans('core.admin.permissions_controls.allow_ten_minutes_button')\n }, {\n value: 'reply',\n label: app.translator.trans('core.admin.permissions_controls.allow_until_reply_button')\n }]\n });\n }\n }, 90);\n });\n}","import { extend } from 'flarum/common/extend';\nimport SelectTagsSettingComponent from './components/SelectTagsSettingComponent';\nimport FormGroup from 'flarum/common/components/FormGroup';\nexport default function () {\n extend(FormGroup.prototype, 'customFieldComponents', function (items) {\n items.add('flarum-tags.select-tags', attrs => {\n return m(SelectTagsSettingComponent, Object.assign({}, attrs, {\n settingValue: attrs.bidi\n }));\n });\n });\n}","import classList from 'flarum/common/utils/classList';\nexport default function tagIcon(tag, attrs, settings) {\n if (attrs === void 0) {\n attrs = {};\n }\n if (settings === void 0) {\n settings = {};\n }\n const hasIcon = tag && tag.icon();\n const {\n useColor = true\n } = settings;\n attrs.className = classList([attrs.className, 'icon text-colored', hasIcon ? tag.icon() : 'TagIcon']);\n if (tag && useColor) {\n attrs.style = attrs.style || {};\n attrs.style['--color'] = tag.color();\n } else if (!tag) {\n attrs.className += ' untagged';\n }\n return hasIcon ? m(\"i\", attrs) : m(\"span\", attrs);\n}\nflarum.reg.add('flarum-tags', 'common/helpers/tagIcon', tagIcon);","import extract from 'flarum/common/utils/extract';\nimport Link from 'flarum/common/components/Link';\nimport classList from 'flarum/common/utils/classList';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport tagIcon from './tagIcon';\nexport default function tagLabel(tag, attrs) {\n if (attrs === void 0) {\n attrs = {};\n }\n attrs.style = attrs.style || {};\n attrs.className = 'TagLabel ' + (attrs.className || '');\n const link = extract(attrs, 'link');\n const tagText = tag ? tag.name() : app.translator.trans('flarum-tags.lib.deleted_tag_text');\n if (tag) {\n const color = tag.color();\n if (color) {\n attrs.style['--tag-bg'] = color;\n attrs.className = classList(attrs.className, 'colored', textContrastClass(color));\n }\n if (link) {\n attrs.title = tag.description() || '';\n attrs.href = app.route('tag', {\n tags: tag.slug()\n });\n }\n if (tag.isChild()) {\n attrs.className += ' TagLabel--child';\n }\n } else {\n attrs.className += ' untagged';\n }\n return m(link ? Link : 'span', attrs, m(\"span\", {\n className: \"TagLabel-text\"\n }, tag && tag.icon() && tagIcon(tag, {\n className: 'TagLabel-icon'\n }, {\n useColor: false\n }), m(\"span\", {\n className: \"TagLabel-name\"\n }, tagText)));\n}\nflarum.reg.add('flarum-tags', 'common/helpers/tagLabel', tagLabel);","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) return b.discussionCount() - a.discussionCount();\n\n // If just one is a secondary tag, then the primary tag should\n // come first.\n if (bPos === null) return -1;\n if (aPos === null) return 1;\n\n // If we've made it this far, we know they're both primary tags. So we'll\n // need to see if they have parents.\n const aParent = a.parent();\n const bParent = b.parent();\n\n // If they both have the same parent, then their positions are local,\n // so we can compare them directly.\n if (aParent === bParent) return aPos - bPos;\n // If they are both child tags, then we will compare the positions of their\n // parents.\n else if (aParent && bParent) return aParent.position() - bParent.position();\n // If we are comparing a child tag with its parent, then we let the parent\n // come first. If we are comparing an unrelated parent/child, then we\n // compare both of the parents.\n else if (aParent) return aParent === b ? 1 : aParent.position() - bPos;else if (bParent) return bParent === a ? -1 : aPos - bParent.position();\n return 0;\n });\n}\nflarum.reg.add('flarum-tags', 'common/utils/sortTags', sortTags);","module.exports = flarum.reg.get('core', 'common/Component');","module.exports = flarum.reg.get('core', 'common/app');","module.exports = flarum.reg.get('core', 'common/components/Button');","module.exports = flarum.reg.get('core', 'common/components/FormModal');","module.exports = flarum.reg.get('core', 'common/components/Link');","module.exports = flarum.reg.get('core', 'common/components/LoadingIndicator');","module.exports = flarum.reg.get('core', 'common/helpers/highlight');","module.exports = flarum.reg.get('core', 'common/helpers/textContrastClass');","module.exports = flarum.reg.get('core', 'common/utils/KeyboardNavigatable');","module.exports = flarum.reg.get('core', 'common/utils/Stream');","module.exports = flarum.reg.get('core', 'common/utils/classList');","module.exports = flarum.reg.get('core', 'common/utils/extract');","module.exports = flarum.reg.get('core', 'common/utils/extractText');","export default function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}","import _typeof from \"./typeof.js\";\nexport default function toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + \"common/components/TagSelectionModal\" + \".js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","__webpack_require__.f.compat = (chunkId, promises) => {\n\n\tconst originalLoadChunk = __webpack_require__.l;\n\t__webpack_require__.l = flarum.reg.loadChunk.bind(flarum.reg, originalLoadChunk);\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t884: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkmodule_exports\"] = self[\"webpackChunkmodule_exports\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));"],"names":["inProgress","dataWebpackPrefix","flarum","reg","get","extend","items","add","path","label","app","translator","trans","tagsLabel","tags","attrs","children","link","otherAttrs","className","sortTags","forEach","tag","length","push","tagLabel","m","SelectTagsSettingComponent","constructor","super","arguments","this","view","value","JSON","parse","settingValue","loaded","load","then","filter","includes","id","redraw","help","onclick","show","selectedTags","onsubmit","stringify","map","options","size","display","addChunkModule","TagListState","loadedIncludes","query","unloadedIncludes","include","has","Promise","resolve","all","Set","find","join","val","Array","isArray","Tag","name","call","slug","description","color","backgroundUrl","backgroundMode","icon","position","parent","defaultSort","isChild","isHidden","isPrimary","discussionCount","lastPostedAt","lastPostedDiscussion","isRestricted","canStartDiscussion","canAddToDiscussion","isPrimaryParent","TagGambit","KeyValueGambit","key","hint","filterKey","gambitValueToFilterValue","fromFilter","negate","gambits","toString","concat","filterValueToGambitValue","gambit","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","sym","getOwnPropertyDescriptor","enumerable","apply","_objectSpread2","target","i","source","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_typeof","obj","Symbol","iterator","prototype","configurable","writable","_extends","assign","hasOwnProperty","userAgent","pattern","window","navigator","match","IE11OrLess","Edge","FireFox","Safari","IOS","ChromeForAndroid","captureMode","capture","passive","on","el","event","fn","addEventListener","off","removeEventListener","matches","selector","substring","msMatchesSelector","webkitMatchesSelector","_","getParentOrHost","host","document","nodeType","parentNode","closest","ctx","includeCTX","_throttleTimeout","R_SPACE","toggleClass","state","classList","replace","css","prop","style","defaultView","getComputedStyle","currentStyle","indexOf","matrix","selfOnly","appliedTransforms","transform","matrixFn","DOMMatrix","WebKitCSSMatrix","CSSMatrix","MSCSSMatrix","tagName","list","getElementsByTagName","n","getWindowScrollingElement","scrollingElement","documentElement","getRect","relativeToContainingBlock","relativeToNonStaticParent","undoScale","container","getBoundingClientRect","elRect","top","left","bottom","right","height","width","innerHeight","innerWidth","containerRect","parseInt","elMatrix","scaleX","a","scaleY","d","isScrolledPast","elSide","parentSide","getParentAutoScrollElement","elSideVal","parentSideVal","getChild","childNum","includeDragEl","currentChild","Sortable","ghost","dragged","draggable","lastChild","last","lastElementChild","previousElementSibling","index","nodeName","toUpperCase","clone","getRelativeScrollOffset","offsetLeft","offsetTop","winScroller","scrollLeft","scrollTop","includeSelf","elem","gotSelf","clientWidth","scrollWidth","clientHeight","scrollHeight","elemCSS","overflowX","overflowY","body","isRectEqual","rect1","rect2","Math","round","throttle","callback","ms","args","setTimeout","scrollBy","x","y","Polymer","$","jQuery","Zepto","dom","cloneNode","getChildContainingRectFromElement","ghostEl","rect","from","child","_rect$left","_rect$top","_rect$right","_rect$bottom","animated","childRect","min","Infinity","max","expando","Date","getTime","plugins","defaults","initializeByDefault","PluginManager","mount","plugin","option","p","pluginName","pluginEvent","eventName","sortable","evt","_this","eventCanceled","cancel","eventNameGlobal","initializePlugins","initialized","modified","modifyOption","getEventProperties","eventProperties","modifiedValue","optionListeners","_excluded","_ref","undefined","originalEvent","data","excluded","sourceKeys","_objectWithoutPropertiesLoose","sourceSymbolKeys","propertyIsEnumerable","_objectWithoutProperties","bind","dragEl","parentEl","rootEl","nextEl","lastDownEl","cloneEl","cloneHidden","dragStarted","moved","putSortable","activeSortable","active","oldIndex","oldDraggableIndex","newIndex","newDraggableIndex","hideGhostForTarget","_hideGhostForTarget","unhideGhostForTarget","_unhideGhostForTarget","cloneNowHidden","cloneNowShown","dispatchSortableEvent","_dispatchEvent","info","targetEl","toEl","fromEl","extraEventProperties","onName","charAt","substr","CustomEvent","createEvent","initEvent","bubbles","cancelable","to","item","pullMode","lastPutMode","allEventProperties","dispatchEvent","activeGroup","tapEvt","touchEvt","lastDx","lastDy","tapDistanceLeft","tapDistanceTop","lastTarget","lastDirection","targetMoveDistance","ghostRelativeParent","awaitingDragStarted","ignoreNextClick","sortables","pastFirstInvertThresh","isCircumstantialInvert","ghostRelativeParentInitialScroll","_silent","savedInputChecked","documentExists","PositionGhostAbsolutely","CSSFloatProperty","supportDraggable","createElement","supportCssPointerEvents","cssText","pointerEvents","_detectDirection","elCSS","elWidth","paddingLeft","paddingRight","borderLeftWidth","borderRightWidth","child1","child2","firstChildCSS","secondChildCSS","firstChildWidth","marginLeft","marginRight","secondChildWidth","flexDirection","gridTemplateColumns","split","touchingSideChild2","clear","_prepareGroup","toFn","pull","sameGroup","group","otherGroup","originalGroup","checkPull","checkPut","put","revertClone","preventDefault","stopPropagation","stopImmediatePropagation","nearestEmptyInsertDetectEvent","touches","nearest","clientX","clientY","some","threshold","emptyInsertThreshold","insideHorizontally","insideVertically","ret","_onDragOver","_checkOutsideTargetEl","_isOutsideThisEl","animationCallbackId","animationStates","sort","disabled","store","handle","test","swapThreshold","invertSwap","invertedSwapThreshold","removeCloneOnHide","direction","ghostClass","chosenClass","dragClass","ignore","preventOnFilter","animation","easing","setData","dataTransfer","textContent","dropBubble","dragoverBubble","dataIdAttr","delay","delayOnTouchOnly","touchStartThreshold","Number","devicePixelRatio","forceFallback","fallbackClass","fallbackOnBody","fallbackTolerance","fallbackOffset","supportPointer","nativeDraggable","_onTapStart","captureAnimationState","slice","fromRect","thisAnimationDuration","childMatrix","f","e","addAnimationState","removeAnimationState","splice","arr","indexOfObject","animateAll","clearTimeout","animating","animationTime","time","toRect","prevFromRect","prevToRect","animatingRect","targetMatrix","sqrt","pow","calculateRealTime","animate","animationResetTimer","currentRect","duration","translateX","translateY","animatingX","animatingY","forRepaintDummy","offsetWidth","repaint","_onMove","dragRect","targetRect","willInsertAfter","retVal","onMoveFn","onMove","draggedRect","related","relatedRect","_disableDraggable","_unsilent","_generateId","str","src","href","sum","charCodeAt","_nextTick","_cancelNextTick","contains","_getDirection","type","touch","pointerType","originalTarget","shadowRoot","composedPath","root","inputs","idx","checked","_saveInputCheckedState","button","isContentEditable","criteria","trim","_prepareDragStart","dragStartFn","ownerDocument","nextSibling","_lastX","_lastY","_onDrop","_disableDelayedDragEvents","_triggerDragStart","_disableDelayedDrag","_delayedDragTouchMoveHandler","_dragStartTimer","abs","floor","_onTouchMove","_onDragStart","selection","empty","getSelection","removeAllRanges","err","_dragStarted","fallback","_appendGhost","_nulling","_emulateDragOver","elementFromPoint","ghostMatrix","relativeScrollOffset","dx","dy","b","c","cssMatrix","appendChild","removeAttribute","_hideClone","cloneId","insertBefore","_loopId","setInterval","effectAllowed","_dragStartId","revert","vertical","isOwner","canSort","fromSortable","completedFired","dragOverEvent","_ignoreWhileAnimating","completed","elLastChild","lastElRect","childContainingRect","_ghostIsLast","changed","firstElRect","_ghostIsFirst","firstChild","targetBeforeFirstSwap","sibling","differentLevel","differentRowCol","dragElS1Opp","dragElS2Opp","dragElOppLength","targetS1Opp","targetS2Opp","targetOppLength","_dragElInRowColumn","side1","scrolledPastTop","scrollBefore","isLastTarget","mouseOnAxis","targetLength","targetS1","targetS2","invert","_getInsertDirection","_getSwapDirection","dragIndex","nextElementSibling","after","moveVector","extra","axis","insertion","_showClone","_offMoveEvents","_offUpEvents","clearInterval","removeChild","save","handleEvent","dropEffect","_globalDragOver","toArray","order","getAttribute","useAnimation","set","destroy","querySelectorAll","utils","is","dst","nextTick","cancelNextTick","detectDirection","element","_len","_key","create","version","scrollEl","scrollRootEl","lastAutoScrollX","lastAutoScrollY","touchEvt$1","pointerElemChangedInterval","autoScrolls","scrolling","clearAutoScrolls","autoScroll","pid","clearPointerElemChangedInterval","isFallback","scroll","scrollCustomFn","sens","scrollSensitivity","speed","scrollSpeed","scrollThisInstance","scrollFn","layersOut","currentParent","canScrollX","canScrollY","scrollPosX","scrollPosY","vx","vy","layer","scrollOffsetY","scrollOffsetX","bubbleScroll","drop","toSortable","changedTouches","onSpill","Revert","Remove","startIndex","dragStart","_ref2","_ref3","_ref4","parentSortable","AutoScroll","forceAutoScrollFallback","_handleAutoScroll","_handleFallbackAutoScroll","dragOverCompleted","dragOverBubble","nulling","ogElemScroller","newElem","EditTagModal","oninit","vnode","model","createRecord","primary","title","attributes","submitData","content","fields","placeholder","oninput","bidi","tabindex","loading","exists","delete","hide","confirm","pushData","tagItem","tagIcon","TagsPage","forcedRefreshKey","minPrimaryTags","setting","maxPrimaryTags","minSecondaryTags","maxSecondaryTags","oncreate","onListOnCreate","localeCompare","setMinTags","submitButton","onSort","onSortUpdate","minTags","maxTags","HTMLOListElement","HTMLUListElement","getById","relationships","j","url","attribute","method","page","permission","tagList","override","original","tagPrefix","required","onremove","render","_item$permission","startsWith","tagScoped","allowGuest","buttonClassName","caretIcon","addTagsHomePageOption","minutes","settings","allow_tag_change","defaultLabel","count","hasIcon","useColor","tagText","route","aPos","bPos","aParent","bParent","module","exports","o","t","r","toPrimitive","TypeError","String","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","__esModule","definition","chunkId","reduce","promises","u","g","globalThis","Function","l","done","script","needAttach","scripts","s","charset","timeout","nc","setAttribute","onScriptComplete","prev","onerror","onload","doneFns","head","toStringTag","scriptUrl","importScripts","location","currentScript","Error","compat","originalLoadChunk","loadChunk","installedChunks","installedChunkData","promise","reject","error","errorType","realSrc","message","request","webpackJsonpCallback","parentChunkLoadingFunction","chunkIds","moreModules","runtime","chunkLoadingGlobal","self"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"admin.js","mappings":";UAAIA,EACAC,kDCDJ,MAAM,EAA+BC,OAAOC,IAAIC,IAAI,OAAQ,0BCA5D,MAAM,EAA+BF,OAAOC,IAAIC,IAAI,OAAQ,iBCAtD,EAA+BF,OAAOC,IAAIC,IAAI,OAAQ,gDCA5D,MAAM,EAA+BF,OAAOC,IAAIC,IAAI,OAAQ,oDCA5D,MAAM,EAA+BF,OAAOC,IAAIC,IAAI,OAAQ,0GCA5D,MAAM,EAA+BF,OAAOC,IAAIC,IAAI,OAAQ,4CCE7C,SAAS,KACtB,IAAAC,QAAO,IAAY,iBAAiBC,IAClCA,EAAMC,IAAI,OAAQ,CAChBC,KAAM,QACNC,MAAOC,IAAIC,WAAWC,MAAM,wCAC5B,GAEN,CCTA,MAAM,EAA+B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MG,QAAU,iBAAmBvC,EAAU,cAAgBqC,EAAY,KAAOC,EAAU,IAC1FF,EAAMrxB,KAAO,iBACbqxB,EAAM1T,KAAO2T,EACbD,EAAMI,QAAUF,EAChBL,EAAmB,GAAGG,EACvB,CACD,GAEwC,SAAWpC,EAASA,EAE/D,CACD,EAcF,IAAIyC,EAAuB,CAACC,EAA4B9hB,KACvD,IAGI8e,EAAUM,GAHT2C,EAAUC,EAAaC,GAAWjiB,EAGhB9M,EAAI,EAC3B,GAAG6uB,EAAS1a,MAAM/Y,GAAgC,IAAxB8yB,EAAgB9yB,KAAa,CACtD,IAAIwwB,KAAYkD,EACZnD,EAAoBP,EAAE0D,EAAalD,KACrCD,EAAoBvxB,EAAEwxB,GAAYkD,EAAYlD,IAG7CmD,GAAsBA,EAAQpD,EAClC,CAEA,IADGiD,GAA4BA,EAA2B9hB,GACrD9M,EAAI6uB,EAAS50B,OAAQ+F,IACzBksB,EAAU2C,EAAS7uB,GAChB2rB,EAAoBP,EAAE8C,EAAiBhC,IAAYgC,EAAgBhC,IACrEgC,EAAgBhC,GAAS,KAE1BgC,EAAgBhC,GAAW,CAC5B,EAIG8C,EAAqBC,KAAiC,2BAAIA,KAAiC,4BAAK,GACpGD,EAAmBj1B,QAAQ40B,EAAqBthB,KAAK,KAAM,IAC3D2hB,EAAmB90B,KAAOy0B,EAAqBthB,KAAK,KAAM2hB,EAAmB90B,KAAKmT,KAAK2hB","sources":["webpack://@flarum/tags/webpack/runtime/load script","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/app')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/PermissionGrid')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/PermissionDropdown')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Dropdown')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/BasicsPage')\"","webpack://@flarum/tags/./src/admin/addTagsHomePageOption.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/SettingDropdown')\"","webpack://@flarum/tags/./src/common/helpers/tagsLabel.js","webpack://@flarum/tags/./src/admin/components/SelectTagsSettingComponent.tsx","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/FormGroup')\"","webpack://@flarum/tags/./src/common/states/TagListState.ts","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/extenders')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/computed')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/Model')\"","webpack://@flarum/tags/./src/common/models/Tag.ts","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/query/IGambit')\"","webpack://@flarum/tags/./src/common/query/discussions/TagGambit.ts","webpack://@flarum/tags/./src/common/extend.ts","webpack://@flarum/tags/../../../node_modules/sortablejs/modular/sortable.esm.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/ExtensionPage')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/withAttr')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Form')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/FormSectionGroup')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/FormSection')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/ColorPreviewInput')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/ItemList')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/string')\"","webpack://@flarum/tags/./src/admin/components/EditTagModal.tsx","webpack://@flarum/tags/./src/admin/components/TagsPage.js","webpack://@flarum/tags/./src/admin/extend.tsx","webpack://@flarum/tags/./src/admin/index.ts","webpack://@flarum/tags/./src/admin/addTagsPermissionScope.tsx","webpack://@flarum/tags/./src/admin/addTagChangePermission.js","webpack://@flarum/tags/./src/admin/addTagSelectionSettingComponent.tsx","webpack://@flarum/tags/./src/common/helpers/tagIcon.js","webpack://@flarum/tags/./src/common/helpers/tagLabel.js","webpack://@flarum/tags/./src/common/utils/sortTags.tsx","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/Component')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/app')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Button')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/FormModal')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Link')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/LoadingIndicator')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/helpers/highlight')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/helpers/textContrastClass')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/KeyboardNavigatable')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/Stream')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/classList')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/extract')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/extractText')\"","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@flarum/tags/webpack/bootstrap","webpack://@flarum/tags/webpack/runtime/compat get default export","webpack://@flarum/tags/webpack/runtime/define property getters","webpack://@flarum/tags/webpack/runtime/ensure chunk","webpack://@flarum/tags/webpack/runtime/get javascript chunk filename","webpack://@flarum/tags/webpack/runtime/global","webpack://@flarum/tags/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/tags/webpack/runtime/make namespace object","webpack://@flarum/tags/webpack/runtime/publicPath","webpack://@flarum/tags/webpack/runtime/compat","webpack://@flarum/tags/webpack/runtime/jsonp chunk loading"],"sourcesContent":["var inProgress = {};\nvar dataWebpackPrefix = \"module.exports:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t}\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/PermissionGrid');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/PermissionDropdown');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Dropdown');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/BasicsPage');","import { extend } from 'flarum/common/extend';\nimport BasicsPage from 'flarum/admin/components/BasicsPage';\nexport default function () {\n extend(BasicsPage, 'homePageItems', items => {\n items.add('tags', {\n path: '/tags',\n label: app.translator.trans('flarum-tags.admin.basics.tags_label')\n });\n });\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/SettingDropdown');","import extract from 'flarum/common/utils/extract';\nimport tagLabel from './tagLabel';\nimport sortTags from '../utils/sortTags';\nimport classList from 'flarum/common/utils/classList';\nexport default function tagsLabel(tags, attrs) {\n if (attrs === void 0) {\n attrs = {};\n }\n const children = [];\n const {\n link,\n ...otherAttrs\n } = attrs;\n otherAttrs.className = classList('TagsLabel', otherAttrs.className);\n if (tags) {\n sortTags(tags).forEach(tag => {\n if (tag || tags.length === 1) {\n children.push(tagLabel(tag, {\n link\n }));\n }\n });\n } else {\n children.push(tagLabel());\n }\n return m(\"span\", otherAttrs, children);\n}\nflarum.reg.add('flarum-tags', 'common/helpers/tagsLabel', tagsLabel);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport tagsLabel from '../../common/helpers/tagsLabel';\nexport default class SelectTagsSettingComponent extends Component {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"tags\", []);\n _defineProperty(this, \"loaded\", false);\n }\n view() {\n const value = JSON.parse(this.attrs.settingValue() || '[]');\n if (!this.loaded) {\n app.tagList.load(['parent']).then(tags => {\n this.tags = tags.filter(tag => value.includes(tag.id()));\n this.loaded = true;\n m.redraw();\n });\n }\n return m(\"div\", {\n className: \"Form-group SelectTagsSettingComponent\"\n }, m(\"label\", null, this.attrs.label), this.attrs.help && m(\"p\", {\n className: \"helpText\"\n }, this.attrs.help), !this.loaded ? m(LoadingIndicator, {\n size: \"small\",\n display: \"inline\"\n }) : m(Button, {\n className: \"Button Button--text\",\n onclick: () => app.modal.show(() => import(/* webpackChunkName: 'common/components/TagSelectionModal', webpackMode: 'lazy-once' */ '../../common/components/TagSelectionModal'), {\n selectedTags: this.tags,\n onsubmit: tags => {\n this.tags = tags;\n this.attrs.settingValue(JSON.stringify(tags.map(tag => tag.id())));\n },\n ...this.attrs.options\n })\n }, !!this.tags.length ? tagsLabel(this.tags) : m(\"span\", {\n className: \"TagLabel untagged\"\n }, app.translator.trans('flarum-tags.admin.settings.button_text'))));\n }\n}\nflarum.reg.add('flarum-tags', 'admin/components/SelectTagsSettingComponent', SelectTagsSettingComponent);flarum.reg.addChunkModule('955', '671', 'flarum-tags', 'common/components/TagSelectionModal');\nflarum.reg.addChunkModule('955', '671', 'flarum-tags', 'forum/components/ToggleButton');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/FormGroup');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/common/app';\nexport default class TagListState {\n constructor() {\n _defineProperty(this, \"loadedIncludes\", void 0);\n }\n async load(includes) {\n if (includes === void 0) {\n includes = [];\n }\n if (!this.loadedIncludes) {\n return this.query(includes);\n }\n const unloadedIncludes = includes.filter(include => !this.loadedIncludes.has(include));\n if (unloadedIncludes.length === 0) {\n return Promise.resolve(app.store.all('tags'));\n }\n return this.query(unloadedIncludes);\n }\n async query(includes) {\n var _this$loadedIncludes;\n if (includes === void 0) {\n includes = [];\n }\n (_this$loadedIncludes = this.loadedIncludes) != null ? _this$loadedIncludes : this.loadedIncludes = new Set();\n return app.store.find('tags', {\n include: includes.join(',')\n }).then(val => {\n const tags = Array.isArray(val) ? val : [val];\n includes.forEach(include => this.loadedIncludes.add(include));\n return tags;\n });\n }\n}\nflarum.reg.add('flarum-tags', 'common/states/TagListState', TagListState);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/computed');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Model');","import computed from 'flarum/common/utils/computed';\nimport Model from 'flarum/common/Model';\nexport default class Tag extends Model {\n name() {\n return Model.attribute('name').call(this);\n }\n slug() {\n return Model.attribute('slug').call(this);\n }\n description() {\n return Model.attribute('description').call(this);\n }\n color() {\n return Model.attribute('color').call(this);\n }\n backgroundUrl() {\n return Model.attribute('backgroundUrl').call(this);\n }\n backgroundMode() {\n return Model.attribute('backgroundMode').call(this);\n }\n icon() {\n return Model.attribute('icon').call(this);\n }\n position() {\n return Model.attribute('position').call(this);\n }\n parent() {\n return Model.hasOne('parent').call(this);\n }\n children() {\n return Model.hasMany('children').call(this);\n }\n defaultSort() {\n return Model.attribute('defaultSort').call(this);\n }\n isChild() {\n return Model.attribute('isChild').call(this);\n }\n isHidden() {\n return Model.attribute('isHidden').call(this);\n }\n isPrimary() {\n return Model.attribute('isPrimary').call(this);\n }\n discussionCount() {\n return Model.attribute('discussionCount').call(this);\n }\n lastPostedAt() {\n return Model.attribute('lastPostedAt', Model.transformDate).call(this);\n }\n lastPostedDiscussion() {\n return Model.hasOne('lastPostedDiscussion').call(this);\n }\n isRestricted() {\n return Model.attribute('isRestricted').call(this);\n }\n canStartDiscussion() {\n return Model.attribute('canStartDiscussion').call(this);\n }\n canAddToDiscussion() {\n return Model.attribute('canAddToDiscussion').call(this);\n }\n isPrimaryParent() {\n return computed('position', 'parent', (position, parent) => position !== null && parent === false).call(this);\n }\n}\nflarum.reg.add('flarum-tags', 'common/models/Tag', Tag);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/query/IGambit');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/common/app';\nimport { KeyValueGambit } from 'flarum/common/query/IGambit';\nexport default class TagGambit extends KeyValueGambit {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"predicates\", true);\n }\n key() {\n return app.translator.trans('flarum-tags.lib.gambits.discussions.tag.key', {}, true);\n }\n hint() {\n return app.translator.trans('flarum-tags.lib.gambits.discussions.tag.hint', {}, true);\n }\n filterKey() {\n return 'tag';\n }\n gambitValueToFilterValue(value) {\n return [value];\n }\n fromFilter(value, negate) {\n let gambits = [];\n if (Array.isArray(value)) {\n gambits = value.map(value => this.fromFilter(value.toString(), negate));\n } else {\n return \"\".concat(negate ? '-' : '').concat(this.key(), \":\").concat(this.filterValueToGambitValue(value));\n }\n return gambits.join(' ');\n }\n filterValueToGambitValue(value) {\n return value;\n }\n}\nflarum.reg.add('flarum-tags', 'common/query/discussions/TagGambit', TagGambit);","import Extend from 'flarum/common/extenders';\nimport Tag from './models/Tag';\nimport TagGambit from './query/discussions/TagGambit';\nexport default [new Extend.Store() //\n.add('tags', Tag), new Extend.Search() //\n.gambit('discussions', TagGambit)];","/**!\n * Sortable 1.15.2\n * @author\tRubaXa \n * @author\towenm \n * @license MIT\n */\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n keys.push.apply(keys, symbols);\n }\n return keys;\n}\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n return target;\n}\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n return _typeof(obj);\n}\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = _objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n return target;\n}\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();\n}\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return _arrayLikeToArray(arr);\n}\nfunction _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nvar version = \"1.15.2\";\n\nfunction userAgent(pattern) {\n if (typeof window !== 'undefined' && window.navigator) {\n return !! /*@__PURE__*/navigator.userAgent.match(pattern);\n }\n}\nvar IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\\.|msie|iemobile|Windows Phone)/i);\nvar Edge = userAgent(/Edge/i);\nvar FireFox = userAgent(/firefox/i);\nvar Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);\nvar IOS = userAgent(/iP(ad|od|hone)/i);\nvar ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i);\n\nvar captureMode = {\n capture: false,\n passive: false\n};\nfunction on(el, event, fn) {\n el.addEventListener(event, fn, !IE11OrLess && captureMode);\n}\nfunction off(el, event, fn) {\n el.removeEventListener(event, fn, !IE11OrLess && captureMode);\n}\nfunction matches( /**HTMLElement*/el, /**String*/selector) {\n if (!selector) return;\n selector[0] === '>' && (selector = selector.substring(1));\n if (el) {\n try {\n if (el.matches) {\n return el.matches(selector);\n } else if (el.msMatchesSelector) {\n return el.msMatchesSelector(selector);\n } else if (el.webkitMatchesSelector) {\n return el.webkitMatchesSelector(selector);\n }\n } catch (_) {\n return false;\n }\n }\n return false;\n}\nfunction getParentOrHost(el) {\n return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;\n}\nfunction closest( /**HTMLElement*/el, /**String*/selector, /**HTMLElement*/ctx, includeCTX) {\n if (el) {\n ctx = ctx || document;\n do {\n if (selector != null && (selector[0] === '>' ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) {\n return el;\n }\n if (el === ctx) break;\n /* jshint boss:true */\n } while (el = getParentOrHost(el));\n }\n return null;\n}\nvar R_SPACE = /\\s+/g;\nfunction toggleClass(el, name, state) {\n if (el && name) {\n if (el.classList) {\n el.classList[state ? 'add' : 'remove'](name);\n } else {\n var className = (' ' + el.className + ' ').replace(R_SPACE, ' ').replace(' ' + name + ' ', ' ');\n el.className = (className + (state ? ' ' + name : '')).replace(R_SPACE, ' ');\n }\n }\n}\nfunction css(el, prop, val) {\n var style = el && el.style;\n if (style) {\n if (val === void 0) {\n if (document.defaultView && document.defaultView.getComputedStyle) {\n val = document.defaultView.getComputedStyle(el, '');\n } else if (el.currentStyle) {\n val = el.currentStyle;\n }\n return prop === void 0 ? val : val[prop];\n } else {\n if (!(prop in style) && prop.indexOf('webkit') === -1) {\n prop = '-webkit-' + prop;\n }\n style[prop] = val + (typeof val === 'string' ? '' : 'px');\n }\n }\n}\nfunction matrix(el, selfOnly) {\n var appliedTransforms = '';\n if (typeof el === 'string') {\n appliedTransforms = el;\n } else {\n do {\n var transform = css(el, 'transform');\n if (transform && transform !== 'none') {\n appliedTransforms = transform + ' ' + appliedTransforms;\n }\n /* jshint boss:true */\n } while (!selfOnly && (el = el.parentNode));\n }\n var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;\n /*jshint -W056 */\n return matrixFn && new matrixFn(appliedTransforms);\n}\nfunction find(ctx, tagName, iterator) {\n if (ctx) {\n var list = ctx.getElementsByTagName(tagName),\n i = 0,\n n = list.length;\n if (iterator) {\n for (; i < n; i++) {\n iterator(list[i], i);\n }\n }\n return list;\n }\n return [];\n}\nfunction getWindowScrollingElement() {\n var scrollingElement = document.scrollingElement;\n if (scrollingElement) {\n return scrollingElement;\n } else {\n return document.documentElement;\n }\n}\n\n/**\r\n * Returns the \"bounding client rect\" of given element\r\n * @param {HTMLElement} el The element whose boundingClientRect is wanted\r\n * @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container\r\n * @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr\r\n * @param {[Boolean]} undoScale Whether the container's scale() should be undone\r\n * @param {[HTMLElement]} container The parent the element will be placed in\r\n * @return {Object} The boundingClientRect of el, with specified adjustments\r\n */\nfunction getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {\n if (!el.getBoundingClientRect && el !== window) return;\n var elRect, top, left, bottom, right, height, width;\n if (el !== window && el.parentNode && el !== getWindowScrollingElement()) {\n elRect = el.getBoundingClientRect();\n top = elRect.top;\n left = elRect.left;\n bottom = elRect.bottom;\n right = elRect.right;\n height = elRect.height;\n width = elRect.width;\n } else {\n top = 0;\n left = 0;\n bottom = window.innerHeight;\n right = window.innerWidth;\n height = window.innerHeight;\n width = window.innerWidth;\n }\n if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {\n // Adjust for translate()\n container = container || el.parentNode;\n\n // solves #1123 (see: https://stackoverflow.com/a/37953806/6088312)\n // Not needed on <= IE11\n if (!IE11OrLess) {\n do {\n if (container && container.getBoundingClientRect && (css(container, 'transform') !== 'none' || relativeToNonStaticParent && css(container, 'position') !== 'static')) {\n var containerRect = container.getBoundingClientRect();\n\n // Set relative to edges of padding box of container\n top -= containerRect.top + parseInt(css(container, 'border-top-width'));\n left -= containerRect.left + parseInt(css(container, 'border-left-width'));\n bottom = top + elRect.height;\n right = left + elRect.width;\n break;\n }\n /* jshint boss:true */\n } while (container = container.parentNode);\n }\n }\n if (undoScale && el !== window) {\n // Adjust for scale()\n var elMatrix = matrix(container || el),\n scaleX = elMatrix && elMatrix.a,\n scaleY = elMatrix && elMatrix.d;\n if (elMatrix) {\n top /= scaleY;\n left /= scaleX;\n width /= scaleX;\n height /= scaleY;\n bottom = top + height;\n right = left + width;\n }\n }\n return {\n top: top,\n left: left,\n bottom: bottom,\n right: right,\n width: width,\n height: height\n };\n}\n\n/**\r\n * Checks if a side of an element is scrolled past a side of its parents\r\n * @param {HTMLElement} el The element who's side being scrolled out of view is in question\r\n * @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')\r\n * @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')\r\n * @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element\r\n */\nfunction isScrolledPast(el, elSide, parentSide) {\n var parent = getParentAutoScrollElement(el, true),\n elSideVal = getRect(el)[elSide];\n\n /* jshint boss:true */\n while (parent) {\n var parentSideVal = getRect(parent)[parentSide],\n visible = void 0;\n if (parentSide === 'top' || parentSide === 'left') {\n visible = elSideVal >= parentSideVal;\n } else {\n visible = elSideVal <= parentSideVal;\n }\n if (!visible) return parent;\n if (parent === getWindowScrollingElement()) break;\n parent = getParentAutoScrollElement(parent, false);\n }\n return false;\n}\n\n/**\r\n * Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)\r\n * and non-draggable elements\r\n * @param {HTMLElement} el The parent element\r\n * @param {Number} childNum The index of the child\r\n * @param {Object} options Parent Sortable's options\r\n * @return {HTMLElement} The child at index childNum, or null if not found\r\n */\nfunction getChild(el, childNum, options, includeDragEl) {\n var currentChild = 0,\n i = 0,\n children = el.children;\n while (i < children.length) {\n if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && (includeDragEl || children[i] !== Sortable.dragged) && closest(children[i], options.draggable, el, false)) {\n if (currentChild === childNum) {\n return children[i];\n }\n currentChild++;\n }\n i++;\n }\n return null;\n}\n\n/**\r\n * Gets the last child in the el, ignoring ghostEl or invisible elements (clones)\r\n * @param {HTMLElement} el Parent element\r\n * @param {selector} selector Any other elements that should be ignored\r\n * @return {HTMLElement} The last child, ignoring ghostEl\r\n */\nfunction lastChild(el, selector) {\n var last = el.lastElementChild;\n while (last && (last === Sortable.ghost || css(last, 'display') === 'none' || selector && !matches(last, selector))) {\n last = last.previousElementSibling;\n }\n return last || null;\n}\n\n/**\r\n * Returns the index of an element within its parent for a selected set of\r\n * elements\r\n * @param {HTMLElement} el\r\n * @param {selector} selector\r\n * @return {number}\r\n */\nfunction index(el, selector) {\n var index = 0;\n if (!el || !el.parentNode) {\n return -1;\n }\n\n /* jshint boss:true */\n while (el = el.previousElementSibling) {\n if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== Sortable.clone && (!selector || matches(el, selector))) {\n index++;\n }\n }\n return index;\n}\n\n/**\r\n * Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.\r\n * The value is returned in real pixels.\r\n * @param {HTMLElement} el\r\n * @return {Array} Offsets in the format of [left, top]\r\n */\nfunction getRelativeScrollOffset(el) {\n var offsetLeft = 0,\n offsetTop = 0,\n winScroller = getWindowScrollingElement();\n if (el) {\n do {\n var elMatrix = matrix(el),\n scaleX = elMatrix.a,\n scaleY = elMatrix.d;\n offsetLeft += el.scrollLeft * scaleX;\n offsetTop += el.scrollTop * scaleY;\n } while (el !== winScroller && (el = el.parentNode));\n }\n return [offsetLeft, offsetTop];\n}\n\n/**\r\n * Returns the index of the object within the given array\r\n * @param {Array} arr Array that may or may not hold the object\r\n * @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find\r\n * @return {Number} The index of the object in the array, or -1\r\n */\nfunction indexOfObject(arr, obj) {\n for (var i in arr) {\n if (!arr.hasOwnProperty(i)) continue;\n for (var key in obj) {\n if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);\n }\n }\n return -1;\n}\nfunction getParentAutoScrollElement(el, includeSelf) {\n // skip to window\n if (!el || !el.getBoundingClientRect) return getWindowScrollingElement();\n var elem = el;\n var gotSelf = false;\n do {\n // we don't need to get elem css if it isn't even overflowing in the first place (performance)\n if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {\n var elemCSS = css(elem);\n if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == 'auto' || elemCSS.overflowX == 'scroll') || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == 'auto' || elemCSS.overflowY == 'scroll')) {\n if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement();\n if (gotSelf || includeSelf) return elem;\n gotSelf = true;\n }\n }\n /* jshint boss:true */\n } while (elem = elem.parentNode);\n return getWindowScrollingElement();\n}\nfunction extend(dst, src) {\n if (dst && src) {\n for (var key in src) {\n if (src.hasOwnProperty(key)) {\n dst[key] = src[key];\n }\n }\n }\n return dst;\n}\nfunction isRectEqual(rect1, rect2) {\n return Math.round(rect1.top) === Math.round(rect2.top) && Math.round(rect1.left) === Math.round(rect2.left) && Math.round(rect1.height) === Math.round(rect2.height) && Math.round(rect1.width) === Math.round(rect2.width);\n}\nvar _throttleTimeout;\nfunction throttle(callback, ms) {\n return function () {\n if (!_throttleTimeout) {\n var args = arguments,\n _this = this;\n if (args.length === 1) {\n callback.call(_this, args[0]);\n } else {\n callback.apply(_this, args);\n }\n _throttleTimeout = setTimeout(function () {\n _throttleTimeout = void 0;\n }, ms);\n }\n };\n}\nfunction cancelThrottle() {\n clearTimeout(_throttleTimeout);\n _throttleTimeout = void 0;\n}\nfunction scrollBy(el, x, y) {\n el.scrollLeft += x;\n el.scrollTop += y;\n}\nfunction clone(el) {\n var Polymer = window.Polymer;\n var $ = window.jQuery || window.Zepto;\n if (Polymer && Polymer.dom) {\n return Polymer.dom(el).cloneNode(true);\n } else if ($) {\n return $(el).clone(true)[0];\n } else {\n return el.cloneNode(true);\n }\n}\nfunction setRect(el, rect) {\n css(el, 'position', 'absolute');\n css(el, 'top', rect.top);\n css(el, 'left', rect.left);\n css(el, 'width', rect.width);\n css(el, 'height', rect.height);\n}\nfunction unsetRect(el) {\n css(el, 'position', '');\n css(el, 'top', '');\n css(el, 'left', '');\n css(el, 'width', '');\n css(el, 'height', '');\n}\nfunction getChildContainingRectFromElement(container, options, ghostEl) {\n var rect = {};\n Array.from(container.children).forEach(function (child) {\n var _rect$left, _rect$top, _rect$right, _rect$bottom;\n if (!closest(child, options.draggable, container, false) || child.animated || child === ghostEl) return;\n var childRect = getRect(child);\n rect.left = Math.min((_rect$left = rect.left) !== null && _rect$left !== void 0 ? _rect$left : Infinity, childRect.left);\n rect.top = Math.min((_rect$top = rect.top) !== null && _rect$top !== void 0 ? _rect$top : Infinity, childRect.top);\n rect.right = Math.max((_rect$right = rect.right) !== null && _rect$right !== void 0 ? _rect$right : -Infinity, childRect.right);\n rect.bottom = Math.max((_rect$bottom = rect.bottom) !== null && _rect$bottom !== void 0 ? _rect$bottom : -Infinity, childRect.bottom);\n });\n rect.width = rect.right - rect.left;\n rect.height = rect.bottom - rect.top;\n rect.x = rect.left;\n rect.y = rect.top;\n return rect;\n}\nvar expando = 'Sortable' + new Date().getTime();\n\nfunction AnimationStateManager() {\n var animationStates = [],\n animationCallbackId;\n return {\n captureAnimationState: function captureAnimationState() {\n animationStates = [];\n if (!this.options.animation) return;\n var children = [].slice.call(this.el.children);\n children.forEach(function (child) {\n if (css(child, 'display') === 'none' || child === Sortable.ghost) return;\n animationStates.push({\n target: child,\n rect: getRect(child)\n });\n var fromRect = _objectSpread2({}, animationStates[animationStates.length - 1].rect);\n\n // If animating: compensate for current animation\n if (child.thisAnimationDuration) {\n var childMatrix = matrix(child, true);\n if (childMatrix) {\n fromRect.top -= childMatrix.f;\n fromRect.left -= childMatrix.e;\n }\n }\n child.fromRect = fromRect;\n });\n },\n addAnimationState: function addAnimationState(state) {\n animationStates.push(state);\n },\n removeAnimationState: function removeAnimationState(target) {\n animationStates.splice(indexOfObject(animationStates, {\n target: target\n }), 1);\n },\n animateAll: function animateAll(callback) {\n var _this = this;\n if (!this.options.animation) {\n clearTimeout(animationCallbackId);\n if (typeof callback === 'function') callback();\n return;\n }\n var animating = false,\n animationTime = 0;\n animationStates.forEach(function (state) {\n var time = 0,\n target = state.target,\n fromRect = target.fromRect,\n toRect = getRect(target),\n prevFromRect = target.prevFromRect,\n prevToRect = target.prevToRect,\n animatingRect = state.rect,\n targetMatrix = matrix(target, true);\n if (targetMatrix) {\n // Compensate for current animation\n toRect.top -= targetMatrix.f;\n toRect.left -= targetMatrix.e;\n }\n target.toRect = toRect;\n if (target.thisAnimationDuration) {\n // Could also check if animatingRect is between fromRect and toRect\n if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) &&\n // Make sure animatingRect is on line between toRect & fromRect\n (animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) {\n // If returning to same place as started from animation and on same axis\n time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);\n }\n }\n\n // if fromRect != toRect: animate\n if (!isRectEqual(toRect, fromRect)) {\n target.prevFromRect = fromRect;\n target.prevToRect = toRect;\n if (!time) {\n time = _this.options.animation;\n }\n _this.animate(target, animatingRect, toRect, time);\n }\n if (time) {\n animating = true;\n animationTime = Math.max(animationTime, time);\n clearTimeout(target.animationResetTimer);\n target.animationResetTimer = setTimeout(function () {\n target.animationTime = 0;\n target.prevFromRect = null;\n target.fromRect = null;\n target.prevToRect = null;\n target.thisAnimationDuration = null;\n }, time);\n target.thisAnimationDuration = time;\n }\n });\n clearTimeout(animationCallbackId);\n if (!animating) {\n if (typeof callback === 'function') callback();\n } else {\n animationCallbackId = setTimeout(function () {\n if (typeof callback === 'function') callback();\n }, animationTime);\n }\n animationStates = [];\n },\n animate: function animate(target, currentRect, toRect, duration) {\n if (duration) {\n css(target, 'transition', '');\n css(target, 'transform', '');\n var elMatrix = matrix(this.el),\n scaleX = elMatrix && elMatrix.a,\n scaleY = elMatrix && elMatrix.d,\n translateX = (currentRect.left - toRect.left) / (scaleX || 1),\n translateY = (currentRect.top - toRect.top) / (scaleY || 1);\n target.animatingX = !!translateX;\n target.animatingY = !!translateY;\n css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)');\n this.forRepaintDummy = repaint(target); // repaint\n\n css(target, 'transition', 'transform ' + duration + 'ms' + (this.options.easing ? ' ' + this.options.easing : ''));\n css(target, 'transform', 'translate3d(0,0,0)');\n typeof target.animated === 'number' && clearTimeout(target.animated);\n target.animated = setTimeout(function () {\n css(target, 'transition', '');\n css(target, 'transform', '');\n target.animated = false;\n target.animatingX = false;\n target.animatingY = false;\n }, duration);\n }\n }\n };\n}\nfunction repaint(target) {\n return target.offsetWidth;\n}\nfunction calculateRealTime(animatingRect, fromRect, toRect, options) {\n return Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) / Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2)) * options.animation;\n}\n\nvar plugins = [];\nvar defaults = {\n initializeByDefault: true\n};\nvar PluginManager = {\n mount: function mount(plugin) {\n // Set default static properties\n for (var option in defaults) {\n if (defaults.hasOwnProperty(option) && !(option in plugin)) {\n plugin[option] = defaults[option];\n }\n }\n plugins.forEach(function (p) {\n if (p.pluginName === plugin.pluginName) {\n throw \"Sortable: Cannot mount plugin \".concat(plugin.pluginName, \" more than once\");\n }\n });\n plugins.push(plugin);\n },\n pluginEvent: function pluginEvent(eventName, sortable, evt) {\n var _this = this;\n this.eventCanceled = false;\n evt.cancel = function () {\n _this.eventCanceled = true;\n };\n var eventNameGlobal = eventName + 'Global';\n plugins.forEach(function (plugin) {\n if (!sortable[plugin.pluginName]) return;\n // Fire global events if it exists in this sortable\n if (sortable[plugin.pluginName][eventNameGlobal]) {\n sortable[plugin.pluginName][eventNameGlobal](_objectSpread2({\n sortable: sortable\n }, evt));\n }\n\n // Only fire plugin event if plugin is enabled in this sortable,\n // and plugin has event defined\n if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) {\n sortable[plugin.pluginName][eventName](_objectSpread2({\n sortable: sortable\n }, evt));\n }\n });\n },\n initializePlugins: function initializePlugins(sortable, el, defaults, options) {\n plugins.forEach(function (plugin) {\n var pluginName = plugin.pluginName;\n if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;\n var initialized = new plugin(sortable, el, sortable.options);\n initialized.sortable = sortable;\n initialized.options = sortable.options;\n sortable[pluginName] = initialized;\n\n // Add default options from plugin\n _extends(defaults, initialized.defaults);\n });\n for (var option in sortable.options) {\n if (!sortable.options.hasOwnProperty(option)) continue;\n var modified = this.modifyOption(sortable, option, sortable.options[option]);\n if (typeof modified !== 'undefined') {\n sortable.options[option] = modified;\n }\n }\n },\n getEventProperties: function getEventProperties(name, sortable) {\n var eventProperties = {};\n plugins.forEach(function (plugin) {\n if (typeof plugin.eventProperties !== 'function') return;\n _extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));\n });\n return eventProperties;\n },\n modifyOption: function modifyOption(sortable, name, value) {\n var modifiedValue;\n plugins.forEach(function (plugin) {\n // Plugin must exist on the Sortable\n if (!sortable[plugin.pluginName]) return;\n\n // If static option listener exists for this option, call in the context of the Sortable's instance of this plugin\n if (plugin.optionListeners && typeof plugin.optionListeners[name] === 'function') {\n modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);\n }\n });\n return modifiedValue;\n }\n};\n\nfunction dispatchEvent(_ref) {\n var sortable = _ref.sortable,\n rootEl = _ref.rootEl,\n name = _ref.name,\n targetEl = _ref.targetEl,\n cloneEl = _ref.cloneEl,\n toEl = _ref.toEl,\n fromEl = _ref.fromEl,\n oldIndex = _ref.oldIndex,\n newIndex = _ref.newIndex,\n oldDraggableIndex = _ref.oldDraggableIndex,\n newDraggableIndex = _ref.newDraggableIndex,\n originalEvent = _ref.originalEvent,\n putSortable = _ref.putSortable,\n extraEventProperties = _ref.extraEventProperties;\n sortable = sortable || rootEl && rootEl[expando];\n if (!sortable) return;\n var evt,\n options = sortable.options,\n onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1);\n // Support for new CustomEvent feature\n if (window.CustomEvent && !IE11OrLess && !Edge) {\n evt = new CustomEvent(name, {\n bubbles: true,\n cancelable: true\n });\n } else {\n evt = document.createEvent('Event');\n evt.initEvent(name, true, true);\n }\n evt.to = toEl || rootEl;\n evt.from = fromEl || rootEl;\n evt.item = targetEl || rootEl;\n evt.clone = cloneEl;\n evt.oldIndex = oldIndex;\n evt.newIndex = newIndex;\n evt.oldDraggableIndex = oldDraggableIndex;\n evt.newDraggableIndex = newDraggableIndex;\n evt.originalEvent = originalEvent;\n evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;\n var allEventProperties = _objectSpread2(_objectSpread2({}, extraEventProperties), PluginManager.getEventProperties(name, sortable));\n for (var option in allEventProperties) {\n evt[option] = allEventProperties[option];\n }\n if (rootEl) {\n rootEl.dispatchEvent(evt);\n }\n if (options[onName]) {\n options[onName].call(sortable, evt);\n }\n}\n\nvar _excluded = [\"evt\"];\nvar pluginEvent = function pluginEvent(eventName, sortable) {\n var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},\n originalEvent = _ref.evt,\n data = _objectWithoutProperties(_ref, _excluded);\n PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread2({\n dragEl: dragEl,\n parentEl: parentEl,\n ghostEl: ghostEl,\n rootEl: rootEl,\n nextEl: nextEl,\n lastDownEl: lastDownEl,\n cloneEl: cloneEl,\n cloneHidden: cloneHidden,\n dragStarted: moved,\n putSortable: putSortable,\n activeSortable: Sortable.active,\n originalEvent: originalEvent,\n oldIndex: oldIndex,\n oldDraggableIndex: oldDraggableIndex,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex,\n hideGhostForTarget: _hideGhostForTarget,\n unhideGhostForTarget: _unhideGhostForTarget,\n cloneNowHidden: function cloneNowHidden() {\n cloneHidden = true;\n },\n cloneNowShown: function cloneNowShown() {\n cloneHidden = false;\n },\n dispatchSortableEvent: function dispatchSortableEvent(name) {\n _dispatchEvent({\n sortable: sortable,\n name: name,\n originalEvent: originalEvent\n });\n }\n }, data));\n};\nfunction _dispatchEvent(info) {\n dispatchEvent(_objectSpread2({\n putSortable: putSortable,\n cloneEl: cloneEl,\n targetEl: dragEl,\n rootEl: rootEl,\n oldIndex: oldIndex,\n oldDraggableIndex: oldDraggableIndex,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex\n }, info));\n}\nvar dragEl,\n parentEl,\n ghostEl,\n rootEl,\n nextEl,\n lastDownEl,\n cloneEl,\n cloneHidden,\n oldIndex,\n newIndex,\n oldDraggableIndex,\n newDraggableIndex,\n activeGroup,\n putSortable,\n awaitingDragStarted = false,\n ignoreNextClick = false,\n sortables = [],\n tapEvt,\n touchEvt,\n lastDx,\n lastDy,\n tapDistanceLeft,\n tapDistanceTop,\n moved,\n lastTarget,\n lastDirection,\n pastFirstInvertThresh = false,\n isCircumstantialInvert = false,\n targetMoveDistance,\n // For positioning ghost absolutely\n ghostRelativeParent,\n ghostRelativeParentInitialScroll = [],\n // (left, top)\n\n _silent = false,\n savedInputChecked = [];\n\n/** @const */\nvar documentExists = typeof document !== 'undefined',\n PositionGhostAbsolutely = IOS,\n CSSFloatProperty = Edge || IE11OrLess ? 'cssFloat' : 'float',\n // This will not pass for IE9, because IE9 DnD only works on anchors\n supportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in document.createElement('div'),\n supportCssPointerEvents = function () {\n if (!documentExists) return;\n // false when <= IE11\n if (IE11OrLess) {\n return false;\n }\n var el = document.createElement('x');\n el.style.cssText = 'pointer-events:auto';\n return el.style.pointerEvents === 'auto';\n }(),\n _detectDirection = function _detectDirection(el, options) {\n var elCSS = css(el),\n elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth),\n child1 = getChild(el, 0, options),\n child2 = getChild(el, 1, options),\n firstChildCSS = child1 && css(child1),\n secondChildCSS = child2 && css(child2),\n firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width,\n secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width;\n if (elCSS.display === 'flex') {\n return elCSS.flexDirection === 'column' || elCSS.flexDirection === 'column-reverse' ? 'vertical' : 'horizontal';\n }\n if (elCSS.display === 'grid') {\n return elCSS.gridTemplateColumns.split(' ').length <= 1 ? 'vertical' : 'horizontal';\n }\n if (child1 && firstChildCSS[\"float\"] && firstChildCSS[\"float\"] !== 'none') {\n var touchingSideChild2 = firstChildCSS[\"float\"] === 'left' ? 'left' : 'right';\n return child2 && (secondChildCSS.clear === 'both' || secondChildCSS.clear === touchingSideChild2) ? 'vertical' : 'horizontal';\n }\n return child1 && (firstChildCSS.display === 'block' || firstChildCSS.display === 'flex' || firstChildCSS.display === 'table' || firstChildCSS.display === 'grid' || firstChildWidth >= elWidth && elCSS[CSSFloatProperty] === 'none' || child2 && elCSS[CSSFloatProperty] === 'none' && firstChildWidth + secondChildWidth > elWidth) ? 'vertical' : 'horizontal';\n },\n _dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {\n var dragElS1Opp = vertical ? dragRect.left : dragRect.top,\n dragElS2Opp = vertical ? dragRect.right : dragRect.bottom,\n dragElOppLength = vertical ? dragRect.width : dragRect.height,\n targetS1Opp = vertical ? targetRect.left : targetRect.top,\n targetS2Opp = vertical ? targetRect.right : targetRect.bottom,\n targetOppLength = vertical ? targetRect.width : targetRect.height;\n return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;\n },\n /**\r\n * Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.\r\n * @param {Number} x X position\r\n * @param {Number} y Y position\r\n * @return {HTMLElement} Element of the first found nearest Sortable\r\n */\n _detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {\n var ret;\n sortables.some(function (sortable) {\n var threshold = sortable[expando].options.emptyInsertThreshold;\n if (!threshold || lastChild(sortable)) return;\n var rect = getRect(sortable),\n insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold,\n insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;\n if (insideHorizontally && insideVertically) {\n return ret = sortable;\n }\n });\n return ret;\n },\n _prepareGroup = function _prepareGroup(options) {\n function toFn(value, pull) {\n return function (to, from, dragEl, evt) {\n var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;\n if (value == null && (pull || sameGroup)) {\n // Default pull value\n // Default pull and put value if same group\n return true;\n } else if (value == null || value === false) {\n return false;\n } else if (pull && value === 'clone') {\n return value;\n } else if (typeof value === 'function') {\n return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);\n } else {\n var otherGroup = (pull ? to : from).options.group.name;\n return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;\n }\n };\n }\n var group = {};\n var originalGroup = options.group;\n if (!originalGroup || _typeof(originalGroup) != 'object') {\n originalGroup = {\n name: originalGroup\n };\n }\n group.name = originalGroup.name;\n group.checkPull = toFn(originalGroup.pull, true);\n group.checkPut = toFn(originalGroup.put);\n group.revertClone = originalGroup.revertClone;\n options.group = group;\n },\n _hideGhostForTarget = function _hideGhostForTarget() {\n if (!supportCssPointerEvents && ghostEl) {\n css(ghostEl, 'display', 'none');\n }\n },\n _unhideGhostForTarget = function _unhideGhostForTarget() {\n if (!supportCssPointerEvents && ghostEl) {\n css(ghostEl, 'display', '');\n }\n };\n\n// #1184 fix - Prevent click event on fallback if dragged but item not changed position\nif (documentExists && !ChromeForAndroid) {\n document.addEventListener('click', function (evt) {\n if (ignoreNextClick) {\n evt.preventDefault();\n evt.stopPropagation && evt.stopPropagation();\n evt.stopImmediatePropagation && evt.stopImmediatePropagation();\n ignoreNextClick = false;\n return false;\n }\n }, true);\n}\nvar nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {\n if (dragEl) {\n evt = evt.touches ? evt.touches[0] : evt;\n var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);\n if (nearest) {\n // Create imitation event\n var event = {};\n for (var i in evt) {\n if (evt.hasOwnProperty(i)) {\n event[i] = evt[i];\n }\n }\n event.target = event.rootEl = nearest;\n event.preventDefault = void 0;\n event.stopPropagation = void 0;\n nearest[expando]._onDragOver(event);\n }\n }\n};\nvar _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {\n if (dragEl) {\n dragEl.parentNode[expando]._isOutsideThisEl(evt.target);\n }\n};\n\n/**\r\n * @class Sortable\r\n * @param {HTMLElement} el\r\n * @param {Object} [options]\r\n */\nfunction Sortable(el, options) {\n if (!(el && el.nodeType && el.nodeType === 1)) {\n throw \"Sortable: `el` must be an HTMLElement, not \".concat({}.toString.call(el));\n }\n this.el = el; // root element\n this.options = options = _extends({}, options);\n\n // Export instance\n el[expando] = this;\n var defaults = {\n group: null,\n sort: true,\n disabled: false,\n store: null,\n handle: null,\n draggable: /^[uo]l$/i.test(el.nodeName) ? '>li' : '>*',\n swapThreshold: 1,\n // percentage; 0 <= x <= 1\n invertSwap: false,\n // invert always\n invertedSwapThreshold: null,\n // will be set to same as swapThreshold if default\n removeCloneOnHide: true,\n direction: function direction() {\n return _detectDirection(el, this.options);\n },\n ghostClass: 'sortable-ghost',\n chosenClass: 'sortable-chosen',\n dragClass: 'sortable-drag',\n ignore: 'a, img',\n filter: null,\n preventOnFilter: true,\n animation: 0,\n easing: null,\n setData: function setData(dataTransfer, dragEl) {\n dataTransfer.setData('Text', dragEl.textContent);\n },\n dropBubble: false,\n dragoverBubble: false,\n dataIdAttr: 'data-id',\n delay: 0,\n delayOnTouchOnly: false,\n touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,\n forceFallback: false,\n fallbackClass: 'sortable-fallback',\n fallbackOnBody: false,\n fallbackTolerance: 0,\n fallbackOffset: {\n x: 0,\n y: 0\n },\n supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && !Safari,\n emptyInsertThreshold: 5\n };\n PluginManager.initializePlugins(this, el, defaults);\n\n // Set default options\n for (var name in defaults) {\n !(name in options) && (options[name] = defaults[name]);\n }\n _prepareGroup(options);\n\n // Bind all private methods\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n\n // Setup drag mode\n this.nativeDraggable = options.forceFallback ? false : supportDraggable;\n if (this.nativeDraggable) {\n // Touch start threshold cannot be greater than the native dragstart threshold\n this.options.touchStartThreshold = 1;\n }\n\n // Bind events\n if (options.supportPointer) {\n on(el, 'pointerdown', this._onTapStart);\n } else {\n on(el, 'mousedown', this._onTapStart);\n on(el, 'touchstart', this._onTapStart);\n }\n if (this.nativeDraggable) {\n on(el, 'dragover', this);\n on(el, 'dragenter', this);\n }\n sortables.push(this.el);\n\n // Restore sorting\n options.store && options.store.get && this.sort(options.store.get(this) || []);\n\n // Add animation state manager\n _extends(this, AnimationStateManager());\n}\nSortable.prototype = /** @lends Sortable.prototype */{\n constructor: Sortable,\n _isOutsideThisEl: function _isOutsideThisEl(target) {\n if (!this.el.contains(target) && target !== this.el) {\n lastTarget = null;\n }\n },\n _getDirection: function _getDirection(evt, target) {\n return typeof this.options.direction === 'function' ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction;\n },\n _onTapStart: function _onTapStart( /** Event|TouchEvent */evt) {\n if (!evt.cancelable) return;\n var _this = this,\n el = this.el,\n options = this.options,\n preventOnFilter = options.preventOnFilter,\n type = evt.type,\n touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === 'touch' && evt,\n target = (touch || evt).target,\n originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target,\n filter = options.filter;\n _saveInputCheckedState(el);\n\n // Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.\n if (dragEl) {\n return;\n }\n if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) {\n return; // only left button and enabled\n }\n\n // cancel dnd if original target is content editable\n if (originalTarget.isContentEditable) {\n return;\n }\n\n // Safari ignores further event handling after mousedown\n if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === 'SELECT') {\n return;\n }\n target = closest(target, options.draggable, el, false);\n if (target && target.animated) {\n return;\n }\n if (lastDownEl === target) {\n // Ignoring duplicate `down`\n return;\n }\n\n // Get the index of the dragged element within its parent\n oldIndex = index(target);\n oldDraggableIndex = index(target, options.draggable);\n\n // Check filter\n if (typeof filter === 'function') {\n if (filter.call(this, evt, target, this)) {\n _dispatchEvent({\n sortable: _this,\n rootEl: originalTarget,\n name: 'filter',\n targetEl: target,\n toEl: el,\n fromEl: el\n });\n pluginEvent('filter', _this, {\n evt: evt\n });\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n } else if (filter) {\n filter = filter.split(',').some(function (criteria) {\n criteria = closest(originalTarget, criteria.trim(), el, false);\n if (criteria) {\n _dispatchEvent({\n sortable: _this,\n rootEl: criteria,\n name: 'filter',\n targetEl: target,\n fromEl: el,\n toEl: el\n });\n pluginEvent('filter', _this, {\n evt: evt\n });\n return true;\n }\n });\n if (filter) {\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n }\n if (options.handle && !closest(originalTarget, options.handle, el, false)) {\n return;\n }\n\n // Prepare `dragstart`\n this._prepareDragStart(evt, touch, target);\n },\n _prepareDragStart: function _prepareDragStart( /** Event */evt, /** Touch */touch, /** HTMLElement */target) {\n var _this = this,\n el = _this.el,\n options = _this.options,\n ownerDocument = el.ownerDocument,\n dragStartFn;\n if (target && !dragEl && target.parentNode === el) {\n var dragRect = getRect(target);\n rootEl = el;\n dragEl = target;\n parentEl = dragEl.parentNode;\n nextEl = dragEl.nextSibling;\n lastDownEl = target;\n activeGroup = options.group;\n Sortable.dragged = dragEl;\n tapEvt = {\n target: dragEl,\n clientX: (touch || evt).clientX,\n clientY: (touch || evt).clientY\n };\n tapDistanceLeft = tapEvt.clientX - dragRect.left;\n tapDistanceTop = tapEvt.clientY - dragRect.top;\n this._lastX = (touch || evt).clientX;\n this._lastY = (touch || evt).clientY;\n dragEl.style['will-change'] = 'all';\n dragStartFn = function dragStartFn() {\n pluginEvent('delayEnded', _this, {\n evt: evt\n });\n if (Sortable.eventCanceled) {\n _this._onDrop();\n return;\n }\n // Delayed drag has been triggered\n // we can re-enable the events: touchmove/mousemove\n _this._disableDelayedDragEvents();\n if (!FireFox && _this.nativeDraggable) {\n dragEl.draggable = true;\n }\n\n // Bind the events: dragstart/dragend\n _this._triggerDragStart(evt, touch);\n\n // Drag start event\n _dispatchEvent({\n sortable: _this,\n name: 'choose',\n originalEvent: evt\n });\n\n // Chosen item\n toggleClass(dragEl, options.chosenClass, true);\n };\n\n // Disable \"draggable\"\n options.ignore.split(',').forEach(function (criteria) {\n find(dragEl, criteria.trim(), _disableDraggable);\n });\n on(ownerDocument, 'dragover', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'mousemove', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'mouseup', _this._onDrop);\n on(ownerDocument, 'touchend', _this._onDrop);\n on(ownerDocument, 'touchcancel', _this._onDrop);\n\n // Make dragEl draggable (must be before delay for FireFox)\n if (FireFox && this.nativeDraggable) {\n this.options.touchStartThreshold = 4;\n dragEl.draggable = true;\n }\n pluginEvent('delayStart', this, {\n evt: evt\n });\n\n // Delay is impossible for native DnD in Edge or IE\n if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) {\n if (Sortable.eventCanceled) {\n this._onDrop();\n return;\n }\n // If the user moves the pointer or let go the click or touch\n // before the delay has been reached:\n // disable the delayed drag\n on(ownerDocument, 'mouseup', _this._disableDelayedDrag);\n on(ownerDocument, 'touchend', _this._disableDelayedDrag);\n on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);\n on(ownerDocument, 'mousemove', _this._delayedDragTouchMoveHandler);\n on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler);\n options.supportPointer && on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler);\n _this._dragStartTimer = setTimeout(dragStartFn, options.delay);\n } else {\n dragStartFn();\n }\n }\n },\n _delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler( /** TouchEvent|PointerEvent **/e) {\n var touch = e.touches ? e.touches[0] : e;\n if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) {\n this._disableDelayedDrag();\n }\n },\n _disableDelayedDrag: function _disableDelayedDrag() {\n dragEl && _disableDraggable(dragEl);\n clearTimeout(this._dragStartTimer);\n this._disableDelayedDragEvents();\n },\n _disableDelayedDragEvents: function _disableDelayedDragEvents() {\n var ownerDocument = this.el.ownerDocument;\n off(ownerDocument, 'mouseup', this._disableDelayedDrag);\n off(ownerDocument, 'touchend', this._disableDelayedDrag);\n off(ownerDocument, 'touchcancel', this._disableDelayedDrag);\n off(ownerDocument, 'mousemove', this._delayedDragTouchMoveHandler);\n off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler);\n off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler);\n },\n _triggerDragStart: function _triggerDragStart( /** Event */evt, /** Touch */touch) {\n touch = touch || evt.pointerType == 'touch' && evt;\n if (!this.nativeDraggable || touch) {\n if (this.options.supportPointer) {\n on(document, 'pointermove', this._onTouchMove);\n } else if (touch) {\n on(document, 'touchmove', this._onTouchMove);\n } else {\n on(document, 'mousemove', this._onTouchMove);\n }\n } else {\n on(dragEl, 'dragend', this);\n on(rootEl, 'dragstart', this._onDragStart);\n }\n try {\n if (document.selection) {\n // Timeout neccessary for IE9\n _nextTick(function () {\n document.selection.empty();\n });\n } else {\n window.getSelection().removeAllRanges();\n }\n } catch (err) {}\n },\n _dragStarted: function _dragStarted(fallback, evt) {\n awaitingDragStarted = false;\n if (rootEl && dragEl) {\n pluginEvent('dragStarted', this, {\n evt: evt\n });\n if (this.nativeDraggable) {\n on(document, 'dragover', _checkOutsideTargetEl);\n }\n var options = this.options;\n\n // Apply effect\n !fallback && toggleClass(dragEl, options.dragClass, false);\n toggleClass(dragEl, options.ghostClass, true);\n Sortable.active = this;\n fallback && this._appendGhost();\n\n // Drag start event\n _dispatchEvent({\n sortable: this,\n name: 'start',\n originalEvent: evt\n });\n } else {\n this._nulling();\n }\n },\n _emulateDragOver: function _emulateDragOver() {\n if (touchEvt) {\n this._lastX = touchEvt.clientX;\n this._lastY = touchEvt.clientY;\n _hideGhostForTarget();\n var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n var parent = target;\n while (target && target.shadowRoot) {\n target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n if (target === parent) break;\n parent = target;\n }\n dragEl.parentNode[expando]._isOutsideThisEl(target);\n if (parent) {\n do {\n if (parent[expando]) {\n var inserted = void 0;\n inserted = parent[expando]._onDragOver({\n clientX: touchEvt.clientX,\n clientY: touchEvt.clientY,\n target: target,\n rootEl: parent\n });\n if (inserted && !this.options.dragoverBubble) {\n break;\n }\n }\n target = parent; // store last element\n }\n /* jshint boss:true */ while (parent = parent.parentNode);\n }\n _unhideGhostForTarget();\n }\n },\n _onTouchMove: function _onTouchMove( /**TouchEvent*/evt) {\n if (tapEvt) {\n var options = this.options,\n fallbackTolerance = options.fallbackTolerance,\n fallbackOffset = options.fallbackOffset,\n touch = evt.touches ? evt.touches[0] : evt,\n ghostMatrix = ghostEl && matrix(ghostEl, true),\n scaleX = ghostEl && ghostMatrix && ghostMatrix.a,\n scaleY = ghostEl && ghostMatrix && ghostMatrix.d,\n relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent),\n dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1),\n dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1);\n\n // only set the status to dragging, when we are actually dragging\n if (!Sortable.active && !awaitingDragStarted) {\n if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) {\n return;\n }\n this._onDragStart(evt, true);\n }\n if (ghostEl) {\n if (ghostMatrix) {\n ghostMatrix.e += dx - (lastDx || 0);\n ghostMatrix.f += dy - (lastDy || 0);\n } else {\n ghostMatrix = {\n a: 1,\n b: 0,\n c: 0,\n d: 1,\n e: dx,\n f: dy\n };\n }\n var cssMatrix = \"matrix(\".concat(ghostMatrix.a, \",\").concat(ghostMatrix.b, \",\").concat(ghostMatrix.c, \",\").concat(ghostMatrix.d, \",\").concat(ghostMatrix.e, \",\").concat(ghostMatrix.f, \")\");\n css(ghostEl, 'webkitTransform', cssMatrix);\n css(ghostEl, 'mozTransform', cssMatrix);\n css(ghostEl, 'msTransform', cssMatrix);\n css(ghostEl, 'transform', cssMatrix);\n lastDx = dx;\n lastDy = dy;\n touchEvt = touch;\n }\n evt.cancelable && evt.preventDefault();\n }\n },\n _appendGhost: function _appendGhost() {\n // Bug if using scale(): https://stackoverflow.com/questions/2637058\n // Not being adjusted for\n if (!ghostEl) {\n var container = this.options.fallbackOnBody ? document.body : rootEl,\n rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container),\n options = this.options;\n\n // Position absolutely\n if (PositionGhostAbsolutely) {\n // Get relatively positioned parent\n ghostRelativeParent = container;\n while (css(ghostRelativeParent, 'position') === 'static' && css(ghostRelativeParent, 'transform') === 'none' && ghostRelativeParent !== document) {\n ghostRelativeParent = ghostRelativeParent.parentNode;\n }\n if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) {\n if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement();\n rect.top += ghostRelativeParent.scrollTop;\n rect.left += ghostRelativeParent.scrollLeft;\n } else {\n ghostRelativeParent = getWindowScrollingElement();\n }\n ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent);\n }\n ghostEl = dragEl.cloneNode(true);\n toggleClass(ghostEl, options.ghostClass, false);\n toggleClass(ghostEl, options.fallbackClass, true);\n toggleClass(ghostEl, options.dragClass, true);\n css(ghostEl, 'transition', '');\n css(ghostEl, 'transform', '');\n css(ghostEl, 'box-sizing', 'border-box');\n css(ghostEl, 'margin', 0);\n css(ghostEl, 'top', rect.top);\n css(ghostEl, 'left', rect.left);\n css(ghostEl, 'width', rect.width);\n css(ghostEl, 'height', rect.height);\n css(ghostEl, 'opacity', '0.8');\n css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed');\n css(ghostEl, 'zIndex', '100000');\n css(ghostEl, 'pointerEvents', 'none');\n Sortable.ghost = ghostEl;\n container.appendChild(ghostEl);\n\n // Set transform-origin\n css(ghostEl, 'transform-origin', tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + '% ' + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + '%');\n }\n },\n _onDragStart: function _onDragStart( /**Event*/evt, /**boolean*/fallback) {\n var _this = this;\n var dataTransfer = evt.dataTransfer;\n var options = _this.options;\n pluginEvent('dragStart', this, {\n evt: evt\n });\n if (Sortable.eventCanceled) {\n this._onDrop();\n return;\n }\n pluginEvent('setupClone', this);\n if (!Sortable.eventCanceled) {\n cloneEl = clone(dragEl);\n cloneEl.removeAttribute(\"id\");\n cloneEl.draggable = false;\n cloneEl.style['will-change'] = '';\n this._hideClone();\n toggleClass(cloneEl, this.options.chosenClass, false);\n Sortable.clone = cloneEl;\n }\n\n // #1143: IFrame support workaround\n _this.cloneId = _nextTick(function () {\n pluginEvent('clone', _this);\n if (Sortable.eventCanceled) return;\n if (!_this.options.removeCloneOnHide) {\n rootEl.insertBefore(cloneEl, dragEl);\n }\n _this._hideClone();\n _dispatchEvent({\n sortable: _this,\n name: 'clone'\n });\n });\n !fallback && toggleClass(dragEl, options.dragClass, true);\n\n // Set proper drop events\n if (fallback) {\n ignoreNextClick = true;\n _this._loopId = setInterval(_this._emulateDragOver, 50);\n } else {\n // Undo what was set in _prepareDragStart before drag started\n off(document, 'mouseup', _this._onDrop);\n off(document, 'touchend', _this._onDrop);\n off(document, 'touchcancel', _this._onDrop);\n if (dataTransfer) {\n dataTransfer.effectAllowed = 'move';\n options.setData && options.setData.call(_this, dataTransfer, dragEl);\n }\n on(document, 'drop', _this);\n\n // #1276 fix:\n css(dragEl, 'transform', 'translateZ(0)');\n }\n awaitingDragStarted = true;\n _this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));\n on(document, 'selectstart', _this);\n moved = true;\n if (Safari) {\n css(document.body, 'user-select', 'none');\n }\n },\n // Returns true - if no further action is needed (either inserted or another condition)\n _onDragOver: function _onDragOver( /**Event*/evt) {\n var el = this.el,\n target = evt.target,\n dragRect,\n targetRect,\n revert,\n options = this.options,\n group = options.group,\n activeSortable = Sortable.active,\n isOwner = activeGroup === group,\n canSort = options.sort,\n fromSortable = putSortable || activeSortable,\n vertical,\n _this = this,\n completedFired = false;\n if (_silent) return;\n function dragOverEvent(name, extra) {\n pluginEvent(name, _this, _objectSpread2({\n evt: evt,\n isOwner: isOwner,\n axis: vertical ? 'vertical' : 'horizontal',\n revert: revert,\n dragRect: dragRect,\n targetRect: targetRect,\n canSort: canSort,\n fromSortable: fromSortable,\n target: target,\n completed: completed,\n onMove: function onMove(target, after) {\n return _onMove(rootEl, el, dragEl, dragRect, target, getRect(target), evt, after);\n },\n changed: changed\n }, extra));\n }\n\n // Capture animation state\n function capture() {\n dragOverEvent('dragOverAnimationCapture');\n _this.captureAnimationState();\n if (_this !== fromSortable) {\n fromSortable.captureAnimationState();\n }\n }\n\n // Return invocation when dragEl is inserted (or completed)\n function completed(insertion) {\n dragOverEvent('dragOverCompleted', {\n insertion: insertion\n });\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) {\n activeSortable._hideClone();\n } else {\n activeSortable._showClone(_this);\n }\n if (_this !== fromSortable) {\n // Set ghost class to new sortable's ghost class\n toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);\n toggleClass(dragEl, options.ghostClass, true);\n }\n if (putSortable !== _this && _this !== Sortable.active) {\n putSortable = _this;\n } else if (_this === Sortable.active && putSortable) {\n putSortable = null;\n }\n\n // Animation\n if (fromSortable === _this) {\n _this._ignoreWhileAnimating = target;\n }\n _this.animateAll(function () {\n dragOverEvent('dragOverAnimationComplete');\n _this._ignoreWhileAnimating = null;\n });\n if (_this !== fromSortable) {\n fromSortable.animateAll();\n fromSortable._ignoreWhileAnimating = null;\n }\n }\n\n // Null lastTarget if it is not inside a previously swapped element\n if (target === dragEl && !dragEl.animated || target === el && !target.animated) {\n lastTarget = null;\n }\n\n // no bubbling and not fallback\n if (!options.dragoverBubble && !evt.rootEl && target !== document) {\n dragEl.parentNode[expando]._isOutsideThisEl(evt.target);\n\n // Do not detect for empty insert if already inserted\n !insertion && nearestEmptyInsertDetectEvent(evt);\n }\n !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();\n return completedFired = true;\n }\n\n // Call when dragEl has been inserted\n function changed() {\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n _dispatchEvent({\n sortable: _this,\n name: 'change',\n toEl: el,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex,\n originalEvent: evt\n });\n }\n if (evt.preventDefault !== void 0) {\n evt.cancelable && evt.preventDefault();\n }\n target = closest(target, options.draggable, el, true);\n dragOverEvent('dragOver');\n if (Sortable.eventCanceled) return completedFired;\n if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) {\n return completed(false);\n }\n ignoreNextClick = false;\n if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = parentEl !== rootEl) // Reverting item into the original list\n : putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) {\n vertical = this._getDirection(evt, target) === 'vertical';\n dragRect = getRect(dragEl);\n dragOverEvent('dragOverValid');\n if (Sortable.eventCanceled) return completedFired;\n if (revert) {\n parentEl = rootEl; // actualization\n capture();\n this._hideClone();\n dragOverEvent('revert');\n if (!Sortable.eventCanceled) {\n if (nextEl) {\n rootEl.insertBefore(dragEl, nextEl);\n } else {\n rootEl.appendChild(dragEl);\n }\n }\n return completed(true);\n }\n var elLastChild = lastChild(el, options.draggable);\n if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) {\n // Insert to end of list\n\n // If already at end of list: Do not insert\n if (elLastChild === dragEl) {\n return completed(false);\n }\n\n // if there is a last element, it is the target\n if (elLastChild && el === evt.target) {\n target = elLastChild;\n }\n if (target) {\n targetRect = getRect(target);\n }\n if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) {\n capture();\n if (elLastChild && elLastChild.nextSibling) {\n // the last draggable element is not the last node\n el.insertBefore(dragEl, elLastChild.nextSibling);\n } else {\n el.appendChild(dragEl);\n }\n parentEl = el; // actualization\n\n changed();\n return completed(true);\n }\n } else if (elLastChild && _ghostIsFirst(evt, vertical, this)) {\n // Insert to start of list\n var firstChild = getChild(el, 0, options, true);\n if (firstChild === dragEl) {\n return completed(false);\n }\n target = firstChild;\n targetRect = getRect(target);\n if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, false) !== false) {\n capture();\n el.insertBefore(dragEl, firstChild);\n parentEl = el; // actualization\n\n changed();\n return completed(true);\n }\n } else if (target.parentNode === el) {\n targetRect = getRect(target);\n var direction = 0,\n targetBeforeFirstSwap,\n differentLevel = dragEl.parentNode !== el,\n differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical),\n side1 = vertical ? 'top' : 'left',\n scrolledPastTop = isScrolledPast(target, 'top', 'top') || isScrolledPast(dragEl, 'top', 'top'),\n scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;\n if (lastTarget !== target) {\n targetBeforeFirstSwap = targetRect[side1];\n pastFirstInvertThresh = false;\n isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;\n }\n direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target);\n var sibling;\n if (direction !== 0) {\n // Check if target is beside dragEl in respective direction (ignoring hidden elements)\n var dragIndex = index(dragEl);\n do {\n dragIndex -= direction;\n sibling = parentEl.children[dragIndex];\n } while (sibling && (css(sibling, 'display') === 'none' || sibling === ghostEl));\n }\n // If dragEl is already beside target: Do not insert\n if (direction === 0 || sibling === target) {\n return completed(false);\n }\n lastTarget = target;\n lastDirection = direction;\n var nextSibling = target.nextElementSibling,\n after = false;\n after = direction === 1;\n var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);\n if (moveVector !== false) {\n if (moveVector === 1 || moveVector === -1) {\n after = moveVector === 1;\n }\n _silent = true;\n setTimeout(_unsilent, 30);\n capture();\n if (after && !nextSibling) {\n el.appendChild(dragEl);\n } else {\n target.parentNode.insertBefore(dragEl, after ? nextSibling : target);\n }\n\n // Undo chrome's scroll adjustment (has no effect on other browsers)\n if (scrolledPastTop) {\n scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);\n }\n parentEl = dragEl.parentNode; // actualization\n\n // must be done before animation\n if (targetBeforeFirstSwap !== undefined && !isCircumstantialInvert) {\n targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target)[side1]);\n }\n changed();\n return completed(true);\n }\n }\n if (el.contains(dragEl)) {\n return completed(false);\n }\n }\n return false;\n },\n _ignoreWhileAnimating: null,\n _offMoveEvents: function _offMoveEvents() {\n off(document, 'mousemove', this._onTouchMove);\n off(document, 'touchmove', this._onTouchMove);\n off(document, 'pointermove', this._onTouchMove);\n off(document, 'dragover', nearestEmptyInsertDetectEvent);\n off(document, 'mousemove', nearestEmptyInsertDetectEvent);\n off(document, 'touchmove', nearestEmptyInsertDetectEvent);\n },\n _offUpEvents: function _offUpEvents() {\n var ownerDocument = this.el.ownerDocument;\n off(ownerDocument, 'mouseup', this._onDrop);\n off(ownerDocument, 'touchend', this._onDrop);\n off(ownerDocument, 'pointerup', this._onDrop);\n off(ownerDocument, 'touchcancel', this._onDrop);\n off(document, 'selectstart', this);\n },\n _onDrop: function _onDrop( /**Event*/evt) {\n var el = this.el,\n options = this.options;\n\n // Get the index of the dragged element within its parent\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n pluginEvent('drop', this, {\n evt: evt\n });\n parentEl = dragEl && dragEl.parentNode;\n\n // Get again after plugin event\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n if (Sortable.eventCanceled) {\n this._nulling();\n return;\n }\n awaitingDragStarted = false;\n isCircumstantialInvert = false;\n pastFirstInvertThresh = false;\n clearInterval(this._loopId);\n clearTimeout(this._dragStartTimer);\n _cancelNextTick(this.cloneId);\n _cancelNextTick(this._dragStartId);\n\n // Unbind events\n if (this.nativeDraggable) {\n off(document, 'drop', this);\n off(el, 'dragstart', this._onDragStart);\n }\n this._offMoveEvents();\n this._offUpEvents();\n if (Safari) {\n css(document.body, 'user-select', '');\n }\n css(dragEl, 'transform', '');\n if (evt) {\n if (moved) {\n evt.cancelable && evt.preventDefault();\n !options.dropBubble && evt.stopPropagation();\n }\n ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl);\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {\n // Remove clone(s)\n cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl);\n }\n if (dragEl) {\n if (this.nativeDraggable) {\n off(dragEl, 'dragend', this);\n }\n _disableDraggable(dragEl);\n dragEl.style['will-change'] = '';\n\n // Remove classes\n // ghostClass is added in dragStarted\n if (moved && !awaitingDragStarted) {\n toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false);\n }\n toggleClass(dragEl, this.options.chosenClass, false);\n\n // Drag stop event\n _dispatchEvent({\n sortable: this,\n name: 'unchoose',\n toEl: parentEl,\n newIndex: null,\n newDraggableIndex: null,\n originalEvent: evt\n });\n if (rootEl !== parentEl) {\n if (newIndex >= 0) {\n // Add event\n _dispatchEvent({\n rootEl: parentEl,\n name: 'add',\n toEl: parentEl,\n fromEl: rootEl,\n originalEvent: evt\n });\n\n // Remove event\n _dispatchEvent({\n sortable: this,\n name: 'remove',\n toEl: parentEl,\n originalEvent: evt\n });\n\n // drag from one list and drop into another\n _dispatchEvent({\n rootEl: parentEl,\n name: 'sort',\n toEl: parentEl,\n fromEl: rootEl,\n originalEvent: evt\n });\n _dispatchEvent({\n sortable: this,\n name: 'sort',\n toEl: parentEl,\n originalEvent: evt\n });\n }\n putSortable && putSortable.save();\n } else {\n if (newIndex !== oldIndex) {\n if (newIndex >= 0) {\n // drag & drop within the same list\n _dispatchEvent({\n sortable: this,\n name: 'update',\n toEl: parentEl,\n originalEvent: evt\n });\n _dispatchEvent({\n sortable: this,\n name: 'sort',\n toEl: parentEl,\n originalEvent: evt\n });\n }\n }\n }\n if (Sortable.active) {\n /* jshint eqnull:true */\n if (newIndex == null || newIndex === -1) {\n newIndex = oldIndex;\n newDraggableIndex = oldDraggableIndex;\n }\n _dispatchEvent({\n sortable: this,\n name: 'end',\n toEl: parentEl,\n originalEvent: evt\n });\n\n // Save sorting\n this.save();\n }\n }\n }\n this._nulling();\n },\n _nulling: function _nulling() {\n pluginEvent('nulling', this);\n rootEl = dragEl = parentEl = ghostEl = nextEl = cloneEl = lastDownEl = cloneHidden = tapEvt = touchEvt = moved = newIndex = newDraggableIndex = oldIndex = oldDraggableIndex = lastTarget = lastDirection = putSortable = activeGroup = Sortable.dragged = Sortable.ghost = Sortable.clone = Sortable.active = null;\n savedInputChecked.forEach(function (el) {\n el.checked = true;\n });\n savedInputChecked.length = lastDx = lastDy = 0;\n },\n handleEvent: function handleEvent( /**Event*/evt) {\n switch (evt.type) {\n case 'drop':\n case 'dragend':\n this._onDrop(evt);\n break;\n case 'dragenter':\n case 'dragover':\n if (dragEl) {\n this._onDragOver(evt);\n _globalDragOver(evt);\n }\n break;\n case 'selectstart':\n evt.preventDefault();\n break;\n }\n },\n /**\r\n * Serializes the item into an array of string.\r\n * @returns {String[]}\r\n */\n toArray: function toArray() {\n var order = [],\n el,\n children = this.el.children,\n i = 0,\n n = children.length,\n options = this.options;\n for (; i < n; i++) {\n el = children[i];\n if (closest(el, options.draggable, this.el, false)) {\n order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));\n }\n }\n return order;\n },\n /**\r\n * Sorts the elements according to the array.\r\n * @param {String[]} order order of the items\r\n */\n sort: function sort(order, useAnimation) {\n var items = {},\n rootEl = this.el;\n this.toArray().forEach(function (id, i) {\n var el = rootEl.children[i];\n if (closest(el, this.options.draggable, rootEl, false)) {\n items[id] = el;\n }\n }, this);\n useAnimation && this.captureAnimationState();\n order.forEach(function (id) {\n if (items[id]) {\n rootEl.removeChild(items[id]);\n rootEl.appendChild(items[id]);\n }\n });\n useAnimation && this.animateAll();\n },\n /**\r\n * Save the current sorting\r\n */\n save: function save() {\n var store = this.options.store;\n store && store.set && store.set(this);\n },\n /**\r\n * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.\r\n * @param {HTMLElement} el\r\n * @param {String} [selector] default: `options.draggable`\r\n * @returns {HTMLElement|null}\r\n */\n closest: function closest$1(el, selector) {\n return closest(el, selector || this.options.draggable, this.el, false);\n },\n /**\r\n * Set/get option\r\n * @param {string} name\r\n * @param {*} [value]\r\n * @returns {*}\r\n */\n option: function option(name, value) {\n var options = this.options;\n if (value === void 0) {\n return options[name];\n } else {\n var modifiedValue = PluginManager.modifyOption(this, name, value);\n if (typeof modifiedValue !== 'undefined') {\n options[name] = modifiedValue;\n } else {\n options[name] = value;\n }\n if (name === 'group') {\n _prepareGroup(options);\n }\n }\n },\n /**\r\n * Destroy\r\n */\n destroy: function destroy() {\n pluginEvent('destroy', this);\n var el = this.el;\n el[expando] = null;\n off(el, 'mousedown', this._onTapStart);\n off(el, 'touchstart', this._onTapStart);\n off(el, 'pointerdown', this._onTapStart);\n if (this.nativeDraggable) {\n off(el, 'dragover', this);\n off(el, 'dragenter', this);\n }\n // Remove draggable attributes\n Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) {\n el.removeAttribute('draggable');\n });\n this._onDrop();\n this._disableDelayedDragEvents();\n sortables.splice(sortables.indexOf(this.el), 1);\n this.el = el = null;\n },\n _hideClone: function _hideClone() {\n if (!cloneHidden) {\n pluginEvent('hideClone', this);\n if (Sortable.eventCanceled) return;\n css(cloneEl, 'display', 'none');\n if (this.options.removeCloneOnHide && cloneEl.parentNode) {\n cloneEl.parentNode.removeChild(cloneEl);\n }\n cloneHidden = true;\n }\n },\n _showClone: function _showClone(putSortable) {\n if (putSortable.lastPutMode !== 'clone') {\n this._hideClone();\n return;\n }\n if (cloneHidden) {\n pluginEvent('showClone', this);\n if (Sortable.eventCanceled) return;\n\n // show clone at dragEl or original position\n if (dragEl.parentNode == rootEl && !this.options.group.revertClone) {\n rootEl.insertBefore(cloneEl, dragEl);\n } else if (nextEl) {\n rootEl.insertBefore(cloneEl, nextEl);\n } else {\n rootEl.appendChild(cloneEl);\n }\n if (this.options.group.revertClone) {\n this.animate(dragEl, cloneEl);\n }\n css(cloneEl, 'display', '');\n cloneHidden = false;\n }\n }\n};\nfunction _globalDragOver( /**Event*/evt) {\n if (evt.dataTransfer) {\n evt.dataTransfer.dropEffect = 'move';\n }\n evt.cancelable && evt.preventDefault();\n}\nfunction _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {\n var evt,\n sortable = fromEl[expando],\n onMoveFn = sortable.options.onMove,\n retVal;\n // Support for new CustomEvent feature\n if (window.CustomEvent && !IE11OrLess && !Edge) {\n evt = new CustomEvent('move', {\n bubbles: true,\n cancelable: true\n });\n } else {\n evt = document.createEvent('Event');\n evt.initEvent('move', true, true);\n }\n evt.to = toEl;\n evt.from = fromEl;\n evt.dragged = dragEl;\n evt.draggedRect = dragRect;\n evt.related = targetEl || toEl;\n evt.relatedRect = targetRect || getRect(toEl);\n evt.willInsertAfter = willInsertAfter;\n evt.originalEvent = originalEvent;\n fromEl.dispatchEvent(evt);\n if (onMoveFn) {\n retVal = onMoveFn.call(sortable, evt, originalEvent);\n }\n return retVal;\n}\nfunction _disableDraggable(el) {\n el.draggable = false;\n}\nfunction _unsilent() {\n _silent = false;\n}\nfunction _ghostIsFirst(evt, vertical, sortable) {\n var firstElRect = getRect(getChild(sortable.el, 0, sortable.options, true));\n var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);\n var spacer = 10;\n return vertical ? evt.clientX < childContainingRect.left - spacer || evt.clientY < firstElRect.top && evt.clientX < firstElRect.right : evt.clientY < childContainingRect.top - spacer || evt.clientY < firstElRect.bottom && evt.clientX < firstElRect.left;\n}\nfunction _ghostIsLast(evt, vertical, sortable) {\n var lastElRect = getRect(lastChild(sortable.el, sortable.options.draggable));\n var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);\n var spacer = 10;\n return vertical ? evt.clientX > childContainingRect.right + spacer || evt.clientY > lastElRect.bottom && evt.clientX > lastElRect.left : evt.clientY > childContainingRect.bottom + spacer || evt.clientX > lastElRect.right && evt.clientY > lastElRect.top;\n}\nfunction _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {\n var mouseOnAxis = vertical ? evt.clientY : evt.clientX,\n targetLength = vertical ? targetRect.height : targetRect.width,\n targetS1 = vertical ? targetRect.top : targetRect.left,\n targetS2 = vertical ? targetRect.bottom : targetRect.right,\n invert = false;\n if (!invertSwap) {\n // Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold\n if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) {\n // multiplied only by swapThreshold because mouse will already be inside target by (1 - threshold) * targetLength / 2\n // check if past first invert threshold on side opposite of lastDirection\n if (!pastFirstInvertThresh && (lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) {\n // past first invert threshold, do not restrict inverted threshold to dragEl shadow\n pastFirstInvertThresh = true;\n }\n if (!pastFirstInvertThresh) {\n // dragEl shadow (target move distance shadow)\n if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance // over dragEl shadow\n : mouseOnAxis > targetS2 - targetMoveDistance) {\n return -lastDirection;\n }\n } else {\n invert = true;\n }\n } else {\n // Regular\n if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) {\n return _getInsertDirection(target);\n }\n }\n }\n invert = invert || invertSwap;\n if (invert) {\n // Invert of regular\n if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) {\n return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;\n }\n }\n return 0;\n}\n\n/**\r\n * Gets the direction dragEl must be swapped relative to target in order to make it\r\n * seem that dragEl has been \"inserted\" into that element's position\r\n * @param {HTMLElement} target The target whose position dragEl is being inserted at\r\n * @return {Number} Direction dragEl must be swapped\r\n */\nfunction _getInsertDirection(target) {\n if (index(dragEl) < index(target)) {\n return 1;\n } else {\n return -1;\n }\n}\n\n/**\r\n * Generate id\r\n * @param {HTMLElement} el\r\n * @returns {String}\r\n * @private\r\n */\nfunction _generateId(el) {\n var str = el.tagName + el.className + el.src + el.href + el.textContent,\n i = str.length,\n sum = 0;\n while (i--) {\n sum += str.charCodeAt(i);\n }\n return sum.toString(36);\n}\nfunction _saveInputCheckedState(root) {\n savedInputChecked.length = 0;\n var inputs = root.getElementsByTagName('input');\n var idx = inputs.length;\n while (idx--) {\n var el = inputs[idx];\n el.checked && savedInputChecked.push(el);\n }\n}\nfunction _nextTick(fn) {\n return setTimeout(fn, 0);\n}\nfunction _cancelNextTick(id) {\n return clearTimeout(id);\n}\n\n// Fixed #973:\nif (documentExists) {\n on(document, 'touchmove', function (evt) {\n if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {\n evt.preventDefault();\n }\n });\n}\n\n// Export utils\nSortable.utils = {\n on: on,\n off: off,\n css: css,\n find: find,\n is: function is(el, selector) {\n return !!closest(el, selector, el, false);\n },\n extend: extend,\n throttle: throttle,\n closest: closest,\n toggleClass: toggleClass,\n clone: clone,\n index: index,\n nextTick: _nextTick,\n cancelNextTick: _cancelNextTick,\n detectDirection: _detectDirection,\n getChild: getChild\n};\n\n/**\r\n * Get the Sortable instance of an element\r\n * @param {HTMLElement} element The element\r\n * @return {Sortable|undefined} The instance of Sortable\r\n */\nSortable.get = function (element) {\n return element[expando];\n};\n\n/**\r\n * Mount a plugin to Sortable\r\n * @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted\r\n */\nSortable.mount = function () {\n for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {\n plugins[_key] = arguments[_key];\n }\n if (plugins[0].constructor === Array) plugins = plugins[0];\n plugins.forEach(function (plugin) {\n if (!plugin.prototype || !plugin.prototype.constructor) {\n throw \"Sortable: Mounted plugin must be a constructor function, not \".concat({}.toString.call(plugin));\n }\n if (plugin.utils) Sortable.utils = _objectSpread2(_objectSpread2({}, Sortable.utils), plugin.utils);\n PluginManager.mount(plugin);\n });\n};\n\n/**\r\n * Create sortable instance\r\n * @param {HTMLElement} el\r\n * @param {Object} [options]\r\n */\nSortable.create = function (el, options) {\n return new Sortable(el, options);\n};\n\n// Export\nSortable.version = version;\n\nvar autoScrolls = [],\n scrollEl,\n scrollRootEl,\n scrolling = false,\n lastAutoScrollX,\n lastAutoScrollY,\n touchEvt$1,\n pointerElemChangedInterval;\nfunction AutoScrollPlugin() {\n function AutoScroll() {\n this.defaults = {\n scroll: true,\n forceAutoScrollFallback: false,\n scrollSensitivity: 30,\n scrollSpeed: 10,\n bubbleScroll: true\n };\n\n // Bind all private methods\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n }\n AutoScroll.prototype = {\n dragStarted: function dragStarted(_ref) {\n var originalEvent = _ref.originalEvent;\n if (this.sortable.nativeDraggable) {\n on(document, 'dragover', this._handleAutoScroll);\n } else {\n if (this.options.supportPointer) {\n on(document, 'pointermove', this._handleFallbackAutoScroll);\n } else if (originalEvent.touches) {\n on(document, 'touchmove', this._handleFallbackAutoScroll);\n } else {\n on(document, 'mousemove', this._handleFallbackAutoScroll);\n }\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref2) {\n var originalEvent = _ref2.originalEvent;\n // For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)\n if (!this.options.dragOverBubble && !originalEvent.rootEl) {\n this._handleAutoScroll(originalEvent);\n }\n },\n drop: function drop() {\n if (this.sortable.nativeDraggable) {\n off(document, 'dragover', this._handleAutoScroll);\n } else {\n off(document, 'pointermove', this._handleFallbackAutoScroll);\n off(document, 'touchmove', this._handleFallbackAutoScroll);\n off(document, 'mousemove', this._handleFallbackAutoScroll);\n }\n clearPointerElemChangedInterval();\n clearAutoScrolls();\n cancelThrottle();\n },\n nulling: function nulling() {\n touchEvt$1 = scrollRootEl = scrollEl = scrolling = pointerElemChangedInterval = lastAutoScrollX = lastAutoScrollY = null;\n autoScrolls.length = 0;\n },\n _handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {\n this._handleAutoScroll(evt, true);\n },\n _handleAutoScroll: function _handleAutoScroll(evt, fallback) {\n var _this = this;\n var x = (evt.touches ? evt.touches[0] : evt).clientX,\n y = (evt.touches ? evt.touches[0] : evt).clientY,\n elem = document.elementFromPoint(x, y);\n touchEvt$1 = evt;\n\n // IE does not seem to have native autoscroll,\n // Edge's autoscroll seems too conditional,\n // MACOS Safari does not have autoscroll,\n // Firefox and Chrome are good\n if (fallback || this.options.forceAutoScrollFallback || Edge || IE11OrLess || Safari) {\n autoScroll(evt, this.options, elem, fallback);\n\n // Listener for pointer element change\n var ogElemScroller = getParentAutoScrollElement(elem, true);\n if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) {\n pointerElemChangedInterval && clearPointerElemChangedInterval();\n // Detect for pointer elem change, emulating native DnD behaviour\n pointerElemChangedInterval = setInterval(function () {\n var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true);\n if (newElem !== ogElemScroller) {\n ogElemScroller = newElem;\n clearAutoScrolls();\n }\n autoScroll(evt, _this.options, newElem, fallback);\n }, 10);\n lastAutoScrollX = x;\n lastAutoScrollY = y;\n }\n } else {\n // if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll\n if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) {\n clearAutoScrolls();\n return;\n }\n autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false);\n }\n }\n };\n return _extends(AutoScroll, {\n pluginName: 'scroll',\n initializeByDefault: true\n });\n}\nfunction clearAutoScrolls() {\n autoScrolls.forEach(function (autoScroll) {\n clearInterval(autoScroll.pid);\n });\n autoScrolls = [];\n}\nfunction clearPointerElemChangedInterval() {\n clearInterval(pointerElemChangedInterval);\n}\nvar autoScroll = throttle(function (evt, options, rootEl, isFallback) {\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521\n if (!options.scroll) return;\n var x = (evt.touches ? evt.touches[0] : evt).clientX,\n y = (evt.touches ? evt.touches[0] : evt).clientY,\n sens = options.scrollSensitivity,\n speed = options.scrollSpeed,\n winScroller = getWindowScrollingElement();\n var scrollThisInstance = false,\n scrollCustomFn;\n\n // New scroll root, set scrollEl\n if (scrollRootEl !== rootEl) {\n scrollRootEl = rootEl;\n clearAutoScrolls();\n scrollEl = options.scroll;\n scrollCustomFn = options.scrollFn;\n if (scrollEl === true) {\n scrollEl = getParentAutoScrollElement(rootEl, true);\n }\n }\n var layersOut = 0;\n var currentParent = scrollEl;\n do {\n var el = currentParent,\n rect = getRect(el),\n top = rect.top,\n bottom = rect.bottom,\n left = rect.left,\n right = rect.right,\n width = rect.width,\n height = rect.height,\n canScrollX = void 0,\n canScrollY = void 0,\n scrollWidth = el.scrollWidth,\n scrollHeight = el.scrollHeight,\n elCSS = css(el),\n scrollPosX = el.scrollLeft,\n scrollPosY = el.scrollTop;\n if (el === winScroller) {\n canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll' || elCSS.overflowX === 'visible');\n canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll' || elCSS.overflowY === 'visible');\n } else {\n canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll');\n canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll');\n }\n var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);\n var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);\n if (!autoScrolls[layersOut]) {\n for (var i = 0; i <= layersOut; i++) {\n if (!autoScrolls[i]) {\n autoScrolls[i] = {};\n }\n }\n }\n if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) {\n autoScrolls[layersOut].el = el;\n autoScrolls[layersOut].vx = vx;\n autoScrolls[layersOut].vy = vy;\n clearInterval(autoScrolls[layersOut].pid);\n if (vx != 0 || vy != 0) {\n scrollThisInstance = true;\n /* jshint loopfunc:true */\n autoScrolls[layersOut].pid = setInterval(function () {\n // emulate drag over during autoscroll (fallback), emulating native DnD behaviour\n if (isFallback && this.layer === 0) {\n Sortable.active._onTouchMove(touchEvt$1); // To move ghost if it is positioned absolutely\n }\n var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0;\n var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0;\n if (typeof scrollCustomFn === 'function') {\n if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== 'continue') {\n return;\n }\n }\n scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);\n }.bind({\n layer: layersOut\n }), 24);\n }\n }\n layersOut++;\n } while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false)));\n scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not\n}, 30);\n\nvar drop = function drop(_ref) {\n var originalEvent = _ref.originalEvent,\n putSortable = _ref.putSortable,\n dragEl = _ref.dragEl,\n activeSortable = _ref.activeSortable,\n dispatchSortableEvent = _ref.dispatchSortableEvent,\n hideGhostForTarget = _ref.hideGhostForTarget,\n unhideGhostForTarget = _ref.unhideGhostForTarget;\n if (!originalEvent) return;\n var toSortable = putSortable || activeSortable;\n hideGhostForTarget();\n var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;\n var target = document.elementFromPoint(touch.clientX, touch.clientY);\n unhideGhostForTarget();\n if (toSortable && !toSortable.el.contains(target)) {\n dispatchSortableEvent('spill');\n this.onSpill({\n dragEl: dragEl,\n putSortable: putSortable\n });\n }\n};\nfunction Revert() {}\nRevert.prototype = {\n startIndex: null,\n dragStart: function dragStart(_ref2) {\n var oldDraggableIndex = _ref2.oldDraggableIndex;\n this.startIndex = oldDraggableIndex;\n },\n onSpill: function onSpill(_ref3) {\n var dragEl = _ref3.dragEl,\n putSortable = _ref3.putSortable;\n this.sortable.captureAnimationState();\n if (putSortable) {\n putSortable.captureAnimationState();\n }\n var nextSibling = getChild(this.sortable.el, this.startIndex, this.options);\n if (nextSibling) {\n this.sortable.el.insertBefore(dragEl, nextSibling);\n } else {\n this.sortable.el.appendChild(dragEl);\n }\n this.sortable.animateAll();\n if (putSortable) {\n putSortable.animateAll();\n }\n },\n drop: drop\n};\n_extends(Revert, {\n pluginName: 'revertOnSpill'\n});\nfunction Remove() {}\nRemove.prototype = {\n onSpill: function onSpill(_ref4) {\n var dragEl = _ref4.dragEl,\n putSortable = _ref4.putSortable;\n var parentSortable = putSortable || this.sortable;\n parentSortable.captureAnimationState();\n dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);\n parentSortable.animateAll();\n },\n drop: drop\n};\n_extends(Remove, {\n pluginName: 'removeOnSpill'\n});\n\nvar lastSwapEl;\nfunction SwapPlugin() {\n function Swap() {\n this.defaults = {\n swapClass: 'sortable-swap-highlight'\n };\n }\n Swap.prototype = {\n dragStart: function dragStart(_ref) {\n var dragEl = _ref.dragEl;\n lastSwapEl = dragEl;\n },\n dragOverValid: function dragOverValid(_ref2) {\n var completed = _ref2.completed,\n target = _ref2.target,\n onMove = _ref2.onMove,\n activeSortable = _ref2.activeSortable,\n changed = _ref2.changed,\n cancel = _ref2.cancel;\n if (!activeSortable.options.swap) return;\n var el = this.sortable.el,\n options = this.options;\n if (target && target !== el) {\n var prevSwapEl = lastSwapEl;\n if (onMove(target) !== false) {\n toggleClass(target, options.swapClass, true);\n lastSwapEl = target;\n } else {\n lastSwapEl = null;\n }\n if (prevSwapEl && prevSwapEl !== lastSwapEl) {\n toggleClass(prevSwapEl, options.swapClass, false);\n }\n }\n changed();\n completed(true);\n cancel();\n },\n drop: function drop(_ref3) {\n var activeSortable = _ref3.activeSortable,\n putSortable = _ref3.putSortable,\n dragEl = _ref3.dragEl;\n var toSortable = putSortable || this.sortable;\n var options = this.options;\n lastSwapEl && toggleClass(lastSwapEl, options.swapClass, false);\n if (lastSwapEl && (options.swap || putSortable && putSortable.options.swap)) {\n if (dragEl !== lastSwapEl) {\n toSortable.captureAnimationState();\n if (toSortable !== activeSortable) activeSortable.captureAnimationState();\n swapNodes(dragEl, lastSwapEl);\n toSortable.animateAll();\n if (toSortable !== activeSortable) activeSortable.animateAll();\n }\n }\n },\n nulling: function nulling() {\n lastSwapEl = null;\n }\n };\n return _extends(Swap, {\n pluginName: 'swap',\n eventProperties: function eventProperties() {\n return {\n swapItem: lastSwapEl\n };\n }\n });\n}\nfunction swapNodes(n1, n2) {\n var p1 = n1.parentNode,\n p2 = n2.parentNode,\n i1,\n i2;\n if (!p1 || !p2 || p1.isEqualNode(n2) || p2.isEqualNode(n1)) return;\n i1 = index(n1);\n i2 = index(n2);\n if (p1.isEqualNode(p2) && i1 < i2) {\n i2++;\n }\n p1.insertBefore(n2, p1.children[i1]);\n p2.insertBefore(n1, p2.children[i2]);\n}\n\nvar multiDragElements = [],\n multiDragClones = [],\n lastMultiDragSelect,\n // for selection with modifier key down (SHIFT)\n multiDragSortable,\n initialFolding = false,\n // Initial multi-drag fold when drag started\n folding = false,\n // Folding any other time\n dragStarted = false,\n dragEl$1,\n clonesFromRect,\n clonesHidden;\nfunction MultiDragPlugin() {\n function MultiDrag(sortable) {\n // Bind all private methods\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n if (!sortable.options.avoidImplicitDeselect) {\n if (sortable.options.supportPointer) {\n on(document, 'pointerup', this._deselectMultiDrag);\n } else {\n on(document, 'mouseup', this._deselectMultiDrag);\n on(document, 'touchend', this._deselectMultiDrag);\n }\n }\n on(document, 'keydown', this._checkKeyDown);\n on(document, 'keyup', this._checkKeyUp);\n this.defaults = {\n selectedClass: 'sortable-selected',\n multiDragKey: null,\n avoidImplicitDeselect: false,\n setData: function setData(dataTransfer, dragEl) {\n var data = '';\n if (multiDragElements.length && multiDragSortable === sortable) {\n multiDragElements.forEach(function (multiDragElement, i) {\n data += (!i ? '' : ', ') + multiDragElement.textContent;\n });\n } else {\n data = dragEl.textContent;\n }\n dataTransfer.setData('Text', data);\n }\n };\n }\n MultiDrag.prototype = {\n multiDragKeyDown: false,\n isMultiDrag: false,\n delayStartGlobal: function delayStartGlobal(_ref) {\n var dragged = _ref.dragEl;\n dragEl$1 = dragged;\n },\n delayEnded: function delayEnded() {\n this.isMultiDrag = ~multiDragElements.indexOf(dragEl$1);\n },\n setupClone: function setupClone(_ref2) {\n var sortable = _ref2.sortable,\n cancel = _ref2.cancel;\n if (!this.isMultiDrag) return;\n for (var i = 0; i < multiDragElements.length; i++) {\n multiDragClones.push(clone(multiDragElements[i]));\n multiDragClones[i].sortableIndex = multiDragElements[i].sortableIndex;\n multiDragClones[i].draggable = false;\n multiDragClones[i].style['will-change'] = '';\n toggleClass(multiDragClones[i], this.options.selectedClass, false);\n multiDragElements[i] === dragEl$1 && toggleClass(multiDragClones[i], this.options.chosenClass, false);\n }\n sortable._hideClone();\n cancel();\n },\n clone: function clone(_ref3) {\n var sortable = _ref3.sortable,\n rootEl = _ref3.rootEl,\n dispatchSortableEvent = _ref3.dispatchSortableEvent,\n cancel = _ref3.cancel;\n if (!this.isMultiDrag) return;\n if (!this.options.removeCloneOnHide) {\n if (multiDragElements.length && multiDragSortable === sortable) {\n insertMultiDragClones(true, rootEl);\n dispatchSortableEvent('clone');\n cancel();\n }\n }\n },\n showClone: function showClone(_ref4) {\n var cloneNowShown = _ref4.cloneNowShown,\n rootEl = _ref4.rootEl,\n cancel = _ref4.cancel;\n if (!this.isMultiDrag) return;\n insertMultiDragClones(false, rootEl);\n multiDragClones.forEach(function (clone) {\n css(clone, 'display', '');\n });\n cloneNowShown();\n clonesHidden = false;\n cancel();\n },\n hideClone: function hideClone(_ref5) {\n var _this = this;\n var sortable = _ref5.sortable,\n cloneNowHidden = _ref5.cloneNowHidden,\n cancel = _ref5.cancel;\n if (!this.isMultiDrag) return;\n multiDragClones.forEach(function (clone) {\n css(clone, 'display', 'none');\n if (_this.options.removeCloneOnHide && clone.parentNode) {\n clone.parentNode.removeChild(clone);\n }\n });\n cloneNowHidden();\n clonesHidden = true;\n cancel();\n },\n dragStartGlobal: function dragStartGlobal(_ref6) {\n var sortable = _ref6.sortable;\n if (!this.isMultiDrag && multiDragSortable) {\n multiDragSortable.multiDrag._deselectMultiDrag();\n }\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.sortableIndex = index(multiDragElement);\n });\n\n // Sort multi-drag elements\n multiDragElements = multiDragElements.sort(function (a, b) {\n return a.sortableIndex - b.sortableIndex;\n });\n dragStarted = true;\n },\n dragStarted: function dragStarted(_ref7) {\n var _this2 = this;\n var sortable = _ref7.sortable;\n if (!this.isMultiDrag) return;\n if (this.options.sort) {\n // Capture rects,\n // hide multi drag elements (by positioning them absolute),\n // set multi drag elements rects to dragRect,\n // show multi drag elements,\n // animate to rects,\n // unset rects & remove from DOM\n\n sortable.captureAnimationState();\n if (this.options.animation) {\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n css(multiDragElement, 'position', 'absolute');\n });\n var dragRect = getRect(dragEl$1, false, true, true);\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n setRect(multiDragElement, dragRect);\n });\n folding = true;\n initialFolding = true;\n }\n }\n sortable.animateAll(function () {\n folding = false;\n initialFolding = false;\n if (_this2.options.animation) {\n multiDragElements.forEach(function (multiDragElement) {\n unsetRect(multiDragElement);\n });\n }\n\n // Remove all auxiliary multidrag items from el, if sorting enabled\n if (_this2.options.sort) {\n removeMultiDragElements();\n }\n });\n },\n dragOver: function dragOver(_ref8) {\n var target = _ref8.target,\n completed = _ref8.completed,\n cancel = _ref8.cancel;\n if (folding && ~multiDragElements.indexOf(target)) {\n completed(false);\n cancel();\n }\n },\n revert: function revert(_ref9) {\n var fromSortable = _ref9.fromSortable,\n rootEl = _ref9.rootEl,\n sortable = _ref9.sortable,\n dragRect = _ref9.dragRect;\n if (multiDragElements.length > 1) {\n // Setup unfold animation\n multiDragElements.forEach(function (multiDragElement) {\n sortable.addAnimationState({\n target: multiDragElement,\n rect: folding ? getRect(multiDragElement) : dragRect\n });\n unsetRect(multiDragElement);\n multiDragElement.fromRect = dragRect;\n fromSortable.removeAnimationState(multiDragElement);\n });\n folding = false;\n insertMultiDragElements(!this.options.removeCloneOnHide, rootEl);\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref10) {\n var sortable = _ref10.sortable,\n isOwner = _ref10.isOwner,\n insertion = _ref10.insertion,\n activeSortable = _ref10.activeSortable,\n parentEl = _ref10.parentEl,\n putSortable = _ref10.putSortable;\n var options = this.options;\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) {\n activeSortable._hideClone();\n }\n initialFolding = false;\n // If leaving sort:false root, or already folding - Fold to new location\n if (options.animation && multiDragElements.length > 1 && (folding || !isOwner && !activeSortable.options.sort && !putSortable)) {\n // Fold: Set all multi drag elements's rects to dragEl's rect when multi-drag elements are invisible\n var dragRectAbsolute = getRect(dragEl$1, false, true, true);\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n setRect(multiDragElement, dragRectAbsolute);\n\n // Move element(s) to end of parentEl so that it does not interfere with multi-drag clones insertion if they are inserted\n // while folding, and so that we can capture them again because old sortable will no longer be fromSortable\n parentEl.appendChild(multiDragElement);\n });\n folding = true;\n }\n\n // Clones must be shown (and check to remove multi drags) after folding when interfering multiDragElements are moved out\n if (!isOwner) {\n // Only remove if not folding (folding will remove them anyways)\n if (!folding) {\n removeMultiDragElements();\n }\n if (multiDragElements.length > 1) {\n var clonesHiddenBefore = clonesHidden;\n activeSortable._showClone(sortable);\n\n // Unfold animation for clones if showing from hidden\n if (activeSortable.options.animation && !clonesHidden && clonesHiddenBefore) {\n multiDragClones.forEach(function (clone) {\n activeSortable.addAnimationState({\n target: clone,\n rect: clonesFromRect\n });\n clone.fromRect = clonesFromRect;\n clone.thisAnimationDuration = null;\n });\n }\n } else {\n activeSortable._showClone(sortable);\n }\n }\n }\n },\n dragOverAnimationCapture: function dragOverAnimationCapture(_ref11) {\n var dragRect = _ref11.dragRect,\n isOwner = _ref11.isOwner,\n activeSortable = _ref11.activeSortable;\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n });\n if (activeSortable.options.animation && !isOwner && activeSortable.multiDrag.isMultiDrag) {\n clonesFromRect = _extends({}, dragRect);\n var dragMatrix = matrix(dragEl$1, true);\n clonesFromRect.top -= dragMatrix.f;\n clonesFromRect.left -= dragMatrix.e;\n }\n },\n dragOverAnimationComplete: function dragOverAnimationComplete() {\n if (folding) {\n folding = false;\n removeMultiDragElements();\n }\n },\n drop: function drop(_ref12) {\n var evt = _ref12.originalEvent,\n rootEl = _ref12.rootEl,\n parentEl = _ref12.parentEl,\n sortable = _ref12.sortable,\n dispatchSortableEvent = _ref12.dispatchSortableEvent,\n oldIndex = _ref12.oldIndex,\n putSortable = _ref12.putSortable;\n var toSortable = putSortable || this.sortable;\n if (!evt) return;\n var options = this.options,\n children = parentEl.children;\n\n // Multi-drag selection\n if (!dragStarted) {\n if (options.multiDragKey && !this.multiDragKeyDown) {\n this._deselectMultiDrag();\n }\n toggleClass(dragEl$1, options.selectedClass, !~multiDragElements.indexOf(dragEl$1));\n if (!~multiDragElements.indexOf(dragEl$1)) {\n multiDragElements.push(dragEl$1);\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'select',\n targetEl: dragEl$1,\n originalEvent: evt\n });\n\n // Modifier activated, select from last to dragEl\n if (evt.shiftKey && lastMultiDragSelect && sortable.el.contains(lastMultiDragSelect)) {\n var lastIndex = index(lastMultiDragSelect),\n currentIndex = index(dragEl$1);\n if (~lastIndex && ~currentIndex && lastIndex !== currentIndex) {\n // Must include lastMultiDragSelect (select it), in case modified selection from no selection\n // (but previous selection existed)\n var n, i;\n if (currentIndex > lastIndex) {\n i = lastIndex;\n n = currentIndex;\n } else {\n i = currentIndex;\n n = lastIndex + 1;\n }\n for (; i < n; i++) {\n if (~multiDragElements.indexOf(children[i])) continue;\n toggleClass(children[i], options.selectedClass, true);\n multiDragElements.push(children[i]);\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'select',\n targetEl: children[i],\n originalEvent: evt\n });\n }\n }\n } else {\n lastMultiDragSelect = dragEl$1;\n }\n multiDragSortable = toSortable;\n } else {\n multiDragElements.splice(multiDragElements.indexOf(dragEl$1), 1);\n lastMultiDragSelect = null;\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'deselect',\n targetEl: dragEl$1,\n originalEvent: evt\n });\n }\n }\n\n // Multi-drag drop\n if (dragStarted && this.isMultiDrag) {\n folding = false;\n // Do not \"unfold\" after around dragEl if reverted\n if ((parentEl[expando].options.sort || parentEl !== rootEl) && multiDragElements.length > 1) {\n var dragRect = getRect(dragEl$1),\n multiDragIndex = index(dragEl$1, ':not(.' + this.options.selectedClass + ')');\n if (!initialFolding && options.animation) dragEl$1.thisAnimationDuration = null;\n toSortable.captureAnimationState();\n if (!initialFolding) {\n if (options.animation) {\n dragEl$1.fromRect = dragRect;\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n if (multiDragElement !== dragEl$1) {\n var rect = folding ? getRect(multiDragElement) : dragRect;\n multiDragElement.fromRect = rect;\n\n // Prepare unfold animation\n toSortable.addAnimationState({\n target: multiDragElement,\n rect: rect\n });\n }\n });\n }\n\n // Multi drag elements are not necessarily removed from the DOM on drop, so to reinsert\n // properly they must all be removed\n removeMultiDragElements();\n multiDragElements.forEach(function (multiDragElement) {\n if (children[multiDragIndex]) {\n parentEl.insertBefore(multiDragElement, children[multiDragIndex]);\n } else {\n parentEl.appendChild(multiDragElement);\n }\n multiDragIndex++;\n });\n\n // If initial folding is done, the elements may have changed position because they are now\n // unfolding around dragEl, even though dragEl may not have his index changed, so update event\n // must be fired here as Sortable will not.\n if (oldIndex === index(dragEl$1)) {\n var update = false;\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement.sortableIndex !== index(multiDragElement)) {\n update = true;\n return;\n }\n });\n if (update) {\n dispatchSortableEvent('update');\n dispatchSortableEvent('sort');\n }\n }\n }\n\n // Must be done after capturing individual rects (scroll bar)\n multiDragElements.forEach(function (multiDragElement) {\n unsetRect(multiDragElement);\n });\n toSortable.animateAll();\n }\n multiDragSortable = toSortable;\n }\n\n // Remove clones if necessary\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {\n multiDragClones.forEach(function (clone) {\n clone.parentNode && clone.parentNode.removeChild(clone);\n });\n }\n },\n nullingGlobal: function nullingGlobal() {\n this.isMultiDrag = dragStarted = false;\n multiDragClones.length = 0;\n },\n destroyGlobal: function destroyGlobal() {\n this._deselectMultiDrag();\n off(document, 'pointerup', this._deselectMultiDrag);\n off(document, 'mouseup', this._deselectMultiDrag);\n off(document, 'touchend', this._deselectMultiDrag);\n off(document, 'keydown', this._checkKeyDown);\n off(document, 'keyup', this._checkKeyUp);\n },\n _deselectMultiDrag: function _deselectMultiDrag(evt) {\n if (typeof dragStarted !== \"undefined\" && dragStarted) return;\n\n // Only deselect if selection is in this sortable\n if (multiDragSortable !== this.sortable) return;\n\n // Only deselect if target is not item in this sortable\n if (evt && closest(evt.target, this.options.draggable, this.sortable.el, false)) return;\n\n // Only deselect if left click\n if (evt && evt.button !== 0) return;\n while (multiDragElements.length) {\n var el = multiDragElements[0];\n toggleClass(el, this.options.selectedClass, false);\n multiDragElements.shift();\n dispatchEvent({\n sortable: this.sortable,\n rootEl: this.sortable.el,\n name: 'deselect',\n targetEl: el,\n originalEvent: evt\n });\n }\n },\n _checkKeyDown: function _checkKeyDown(evt) {\n if (evt.key === this.options.multiDragKey) {\n this.multiDragKeyDown = true;\n }\n },\n _checkKeyUp: function _checkKeyUp(evt) {\n if (evt.key === this.options.multiDragKey) {\n this.multiDragKeyDown = false;\n }\n }\n };\n return _extends(MultiDrag, {\n // Static methods & properties\n pluginName: 'multiDrag',\n utils: {\n /**\r\n * Selects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be selected\r\n */\n select: function select(el) {\n var sortable = el.parentNode[expando];\n if (!sortable || !sortable.options.multiDrag || ~multiDragElements.indexOf(el)) return;\n if (multiDragSortable && multiDragSortable !== sortable) {\n multiDragSortable.multiDrag._deselectMultiDrag();\n multiDragSortable = sortable;\n }\n toggleClass(el, sortable.options.selectedClass, true);\n multiDragElements.push(el);\n },\n /**\r\n * Deselects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be deselected\r\n */\n deselect: function deselect(el) {\n var sortable = el.parentNode[expando],\n index = multiDragElements.indexOf(el);\n if (!sortable || !sortable.options.multiDrag || !~index) return;\n toggleClass(el, sortable.options.selectedClass, false);\n multiDragElements.splice(index, 1);\n }\n },\n eventProperties: function eventProperties() {\n var _this3 = this;\n var oldIndicies = [],\n newIndicies = [];\n multiDragElements.forEach(function (multiDragElement) {\n oldIndicies.push({\n multiDragElement: multiDragElement,\n index: multiDragElement.sortableIndex\n });\n\n // multiDragElements will already be sorted if folding\n var newIndex;\n if (folding && multiDragElement !== dragEl$1) {\n newIndex = -1;\n } else if (folding) {\n newIndex = index(multiDragElement, ':not(.' + _this3.options.selectedClass + ')');\n } else {\n newIndex = index(multiDragElement);\n }\n newIndicies.push({\n multiDragElement: multiDragElement,\n index: newIndex\n });\n });\n return {\n items: _toConsumableArray(multiDragElements),\n clones: [].concat(multiDragClones),\n oldIndicies: oldIndicies,\n newIndicies: newIndicies\n };\n },\n optionListeners: {\n multiDragKey: function multiDragKey(key) {\n key = key.toLowerCase();\n if (key === 'ctrl') {\n key = 'Control';\n } else if (key.length > 1) {\n key = key.charAt(0).toUpperCase() + key.substr(1);\n }\n return key;\n }\n }\n });\n}\nfunction insertMultiDragElements(clonesInserted, rootEl) {\n multiDragElements.forEach(function (multiDragElement, i) {\n var target = rootEl.children[multiDragElement.sortableIndex + (clonesInserted ? Number(i) : 0)];\n if (target) {\n rootEl.insertBefore(multiDragElement, target);\n } else {\n rootEl.appendChild(multiDragElement);\n }\n });\n}\n\n/**\r\n * Insert multi-drag clones\r\n * @param {[Boolean]} elementsInserted Whether the multi-drag elements are inserted\r\n * @param {HTMLElement} rootEl\r\n */\nfunction insertMultiDragClones(elementsInserted, rootEl) {\n multiDragClones.forEach(function (clone, i) {\n var target = rootEl.children[clone.sortableIndex + (elementsInserted ? Number(i) : 0)];\n if (target) {\n rootEl.insertBefore(clone, target);\n } else {\n rootEl.appendChild(clone);\n }\n });\n}\nfunction removeMultiDragElements() {\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n multiDragElement.parentNode && multiDragElement.parentNode.removeChild(multiDragElement);\n });\n}\n\nSortable.mount(new AutoScrollPlugin());\nSortable.mount(Remove, Revert);\n\nexport default Sortable;\nexport { MultiDragPlugin as MultiDrag, Sortable, SwapPlugin as Swap };\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/ExtensionPage');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/withAttr');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Form');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/FormSectionGroup');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/FormSection');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/ColorPreviewInput');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/ItemList');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/string');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport FormModal from 'flarum/common/components/FormModal';\nimport Button from 'flarum/common/components/Button';\nimport ColorPreviewInput from 'flarum/common/components/ColorPreviewInput';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport { slug } from 'flarum/common/utils/string';\nimport Stream from 'flarum/common/utils/Stream';\nimport extractText from 'flarum/common/utils/extractText';\nimport Form from 'flarum/common/components/Form';\nimport tagLabel from '../../common/helpers/tagLabel';\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 FormModal {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"tag\", void 0);\n _defineProperty(this, \"name\", void 0);\n _defineProperty(this, \"slug\", void 0);\n _defineProperty(this, \"description\", void 0);\n _defineProperty(this, \"color\", void 0);\n _defineProperty(this, \"icon\", void 0);\n _defineProperty(this, \"isHidden\", void 0);\n _defineProperty(this, \"isPrimary\", void 0);\n }\n oninit(vnode) {\n super.oninit(vnode);\n this.tag = this.attrs.model || app.store.createRecord('tags');\n this.name = Stream(this.tag.name() || '');\n this.slug = Stream(this.tag.slug() || '');\n this.description = Stream(this.tag.description() || '');\n this.color = Stream(this.tag.color() || '');\n this.icon = Stream(this.tag.icon() || '');\n this.isHidden = Stream(this.tag.isHidden() || false);\n this.isPrimary = Stream(this.attrs.primary || false);\n }\n className() {\n return 'EditTagModal Modal--small';\n }\n title() {\n return this.name() ? tagLabel(app.store.createRecord('tags', {\n attributes: this.submitData()\n })) : app.translator.trans('flarum-tags.admin.edit_tag.title');\n }\n content() {\n return m(\"div\", {\n className: \"Modal-body\"\n }, m(Form, null, this.fields().toArray()));\n }\n fields() {\n const items = new ItemList();\n items.add('name', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.edit_tag.name_label')), m(\"input\", {\n className: \"FormControl\",\n placeholder: app.translator.trans('flarum-tags.admin.edit_tag.name_placeholder'),\n value: this.name(),\n oninput: e => {\n const target = e.target;\n this.name(target.value);\n this.slug(slug(target.value));\n }\n })), 50);\n items.add('slug', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.edit_tag.slug_label')), m(\"input\", {\n className: \"FormControl\",\n bidi: this.slug\n })), 40);\n items.add('description', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.edit_tag.description_label')), m(\"textarea\", {\n className: \"FormControl\",\n bidi: this.description\n })), 30);\n items.add('color', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.edit_tag.color_label')), m(ColorPreviewInput, {\n className: \"FormControl\",\n placeholder: \"#aaaaaa\",\n bidi: this.color\n })), 20);\n items.add('icon', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.edit_tag.icon_label')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-tags.admin.edit_tag.icon_text', {\n a: m(\"a\", {\n href: app.refs.fontawesome,\n tabindex: \"-1\"\n })\n })), m(\"input\", {\n className: \"FormControl\",\n placeholder: \"fas fa-bolt\",\n bidi: this.icon\n })), 10);\n items.add('hidden', m(\"div\", {\n className: \"Form-group\"\n }, m(\"div\", null, m(\"label\", {\n className: \"checkbox\"\n }, m(\"input\", {\n type: \"checkbox\",\n bidi: this.isHidden\n }), app.translator.trans('flarum-tags.admin.edit_tag.hide_label')))), 10);\n items.add('submit', m(\"div\", {\n className: \"Form-group Form-controls\"\n }, m(Button, {\n type: \"submit\",\n className: \"Button Button--primary EditTagModal-save\",\n loading: this.loading\n }, app.translator.trans('flarum-tags.admin.edit_tag.submit_button')), this.tag.exists && m(\"button\", {\n type: \"button\",\n className: \"Button EditTagModal-delete\",\n onclick: this.delete.bind(this)\n }, app.translator.trans('flarum-tags.admin.edit_tag.delete_tag_button'))), -10);\n return items;\n }\n submitData() {\n return {\n name: this.name(),\n slug: this.slug(),\n description: this.description(),\n color: this.color(),\n icon: this.icon(),\n isHidden: this.isHidden(),\n isPrimary: this.isPrimary()\n };\n }\n onsubmit(e) {\n e.preventDefault();\n this.loading = true;\n\n // Errors aren't passed to the modal onerror handler here.\n // This is done for better error visibility on smaller screen heights.\n this.tag.save(this.submitData()).then(() => this.hide(), () => this.loading = false);\n }\n delete() {\n if (confirm(extractText(app.translator.trans('flarum-tags.admin.edit_tag.delete_tag_confirmation')))) {\n const children = app.store.all('tags').filter(tag => tag.parent() === this.tag);\n this.tag.delete().then(() => {\n children.forEach(tag => tag.pushData({\n attributes: {\n isChild: false\n }\n }));\n m.redraw();\n });\n this.hide();\n }\n }\n}\nflarum.reg.add('flarum-tags', 'admin/components/EditTagModal', EditTagModal);","import sortable from 'sortablejs';\nimport app from 'flarum/admin/app';\nimport ExtensionPage from 'flarum/admin/components/ExtensionPage';\nimport Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport withAttr from 'flarum/common/utils/withAttr';\nimport Form from 'flarum/common/components/Form';\nimport FormSectionGroup from 'flarum/admin/components/FormSectionGroup';\nimport FormSection from 'flarum/admin/components/FormSection';\nimport EditTagModal from './EditTagModal';\nimport tagIcon from '../../common/helpers/tagIcon';\nimport sortTags from '../../common/utils/sortTags';\nfunction tagItem(tag) {\n return m(\"li\", {\n \"data-id\": tag.id(),\n style: {\n color: tag.color()\n }\n }, m(\"div\", {\n className: \"TagListItem-info\"\n }, tagIcon(tag), m(\"span\", {\n className: \"TagListItem-name\"\n }, tag.name()), m(Button, {\n className: \"Button Button--link\",\n icon: \"fas fa-pencil-alt\",\n onclick: () => app.modal.show(EditTagModal, {\n model: tag\n })\n })), !tag.isChild() && tag.position() !== null && m(\"ol\", {\n className: \"TagListItem-children TagList\"\n }, sortTags(app.store.all('tags')).filter(child => child.parent() === tag).map(tagItem)));\n}\nexport default class TagsPage extends ExtensionPage {\n oninit(vnode) {\n super.oninit(vnode);\n\n // A regular redraw won't work here, because sortable has mucked around\n // with the DOM which will confuse Mithril's diffing algorithm. Instead\n // we force a full reconstruction of the DOM by changing the key, which\n // makes mithril completely re-render the component on redraw.\n this.forcedRefreshKey = 0;\n this.loading = true;\n app.tagList.load(['parent']).then(() => {\n this.loading = false;\n m.redraw();\n });\n }\n content() {\n if (this.loading) {\n return m(LoadingIndicator, null);\n }\n const minPrimaryTags = this.setting('flarum-tags.min_primary_tags', 0);\n const maxPrimaryTags = this.setting('flarum-tags.max_primary_tags', 0);\n const minSecondaryTags = this.setting('flarum-tags.min_secondary_tags', 0);\n const maxSecondaryTags = this.setting('flarum-tags.max_secondary_tags', 0);\n const tags = sortTags(app.store.all('tags').filter(tag => !tag.parent()));\n return m(\"div\", {\n className: \"TagsContent\"\n }, m(\"div\", {\n className: \"TagsContent-list\"\n }, m(\"div\", {\n className: \"container\",\n key: this.forcedRefreshKey,\n oncreate: this.onListOnCreate.bind(this)\n }, m(FormSectionGroup, null, m(FormSection, {\n className: \"TagGroup\",\n label: app.translator.trans('flarum-tags.admin.tags.primary_heading')\n }, m(\"ol\", {\n className: \"TagList TagList--primary\"\n }, tags.filter(tag => tag.position() !== null && !tag.isChild()).map(tagItem)), m(Button, {\n className: \"Button TagList-button\",\n icon: \"fas fa-plus\",\n onclick: () => app.modal.show(EditTagModal, {\n primary: true\n })\n }, app.translator.trans('flarum-tags.admin.tags.create_primary_tag_button'))), m(FormSection, {\n className: \"TagGroup TagGroup--secondary\",\n label: app.translator.trans('flarum-tags.admin.tags.secondary_heading')\n }, m(\"ul\", {\n className: \"TagList\"\n }, tags.filter(tag => tag.position() === null).sort((a, b) => a.name().localeCompare(b.name())).map(tagItem)), m(Button, {\n className: \"Button TagList-button\",\n icon: \"fas fa-plus\",\n onclick: () => app.modal.show(EditTagModal, {\n primary: false\n })\n }, app.translator.trans('flarum-tags.admin.tags.create_secondary_tag_button'))), m(FormSection, {\n label: app.translator.trans('flarum-tags.admin.tags.settings_heading')\n }, m(Form, null, m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.tag_settings.required_primary_heading')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-tags.admin.tag_settings.required_primary_text')), m(\"div\", {\n className: \"TagSettings-rangeInput\"\n }, m(\"input\", {\n className: \"FormControl\",\n type: \"number\",\n min: \"0\",\n value: minPrimaryTags(),\n oninput: withAttr('value', this.setMinTags.bind(this, minPrimaryTags, maxPrimaryTags))\n }), app.translator.trans('flarum-tags.admin.tag_settings.range_separator_text'), m(\"input\", {\n className: \"FormControl\",\n type: \"number\",\n min: minPrimaryTags(),\n bidi: maxPrimaryTags\n }))), m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.tag_settings.required_secondary_heading')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-tags.admin.tag_settings.required_secondary_text')), m(\"div\", {\n className: \"TagSettings-rangeInput\"\n }, m(\"input\", {\n className: \"FormControl\",\n type: \"number\",\n min: \"0\",\n value: minSecondaryTags(),\n oninput: withAttr('value', this.setMinTags.bind(this, minSecondaryTags, maxSecondaryTags))\n }), app.translator.trans('flarum-tags.admin.tag_settings.range_separator_text'), m(\"input\", {\n className: \"FormControl\",\n type: \"number\",\n min: minSecondaryTags(),\n bidi: maxSecondaryTags\n }))), m(\"div\", {\n className: \"Form-group Form-controls\"\n }, this.submitButton())))), m(\"div\", {\n className: \"TagsContent-footer\"\n }, m(\"p\", null, app.translator.trans('flarum-tags.admin.tags.about_tags_text'))))));\n }\n onListOnCreate(vnode) {\n this.$('.TagList').get().map(e => {\n sortable.create(e, {\n group: 'tags',\n delay: 50,\n delayOnTouchOnly: true,\n touchStartThreshold: 5,\n animation: 150,\n swapThreshold: 0.65,\n dragClass: 'sortable-dragging',\n ghostClass: 'sortable-placeholder',\n onSort: e => this.onSortUpdate(e)\n });\n });\n }\n setMinTags(minTags, maxTags, value) {\n minTags(value);\n maxTags(Math.max(value, maxTags()));\n }\n onSortUpdate(e) {\n // If we've moved a tag from 'primary' to 'secondary', then we'll update\n // its attributes in our local store so that when we redraw the change\n // will be made.\n if (e.from instanceof HTMLOListElement && e.to instanceof HTMLUListElement) {\n app.store.getById('tags', e.item.getAttribute('data-id')).pushData({\n attributes: {\n position: null,\n isChild: false\n },\n relationships: {\n parent: null\n }\n });\n }\n\n // Construct an array of primary tag IDs and their children, in the same\n // order that they have been arranged in.\n const order = this.$('.TagList--primary > li').map(function () {\n return {\n id: $(this).data('id'),\n children: $(this).find('li').map(function () {\n return $(this).data('id');\n }).get()\n };\n }).get();\n\n // Now that we have an accurate representation of the order which the\n // primary tags are in, we will update the tag attributes in our local\n // store to reflect this order.\n order.forEach((tag, i) => {\n const parent = app.store.getById('tags', tag.id);\n parent.pushData({\n attributes: {\n position: i,\n isChild: false\n },\n relationships: {\n parent: null\n }\n });\n tag.children.forEach((child, j) => {\n app.store.getById('tags', child).pushData({\n attributes: {\n position: j,\n isChild: true\n },\n relationships: {\n parent\n }\n });\n });\n });\n app.request({\n url: app.forum.attribute('apiUrl') + '/tags/order',\n method: 'POST',\n body: {\n order\n }\n });\n this.forcedRefreshKey++;\n m.redraw();\n }\n}\nflarum.reg.add('flarum-tags', 'admin/components/TagsPage', TagsPage);","import Extend from 'flarum/common/extenders';\nimport commonExtend from '../common/extend';\nimport app from 'flarum/admin/app';\nimport TagsPage from './components/TagsPage';\nexport default [...commonExtend, new Extend.Admin().page(TagsPage).permission(() => ({\n icon: 'fas fa-tag',\n label: app.translator.trans('flarum-tags.admin.permissions.tag_discussions_label'),\n permission: 'discussion.tag'\n}), 'moderate', 95).permission(() => ({\n icon: 'fas fa-tags',\n label: app.translator.trans('flarum-tags.admin.permissions.bypass_tag_counts_label'),\n permission: 'bypassTagCounts'\n}), 'start', 89)];","import app from 'flarum/admin/app';\nimport addTagsPermissionScope from './addTagsPermissionScope';\nimport addTagsHomePageOption from './addTagsHomePageOption';\nimport addTagChangePermission from './addTagChangePermission';\nimport addTagSelectionSettingComponent from './addTagSelectionSettingComponent';\nimport TagListState from '../common/states/TagListState';\nexport { default as extend } from './extend';\napp.initializers.add('flarum-tags', app => {\n app.tagList = new TagListState();\n addTagsPermissionScope();\n addTagsHomePageOption();\n addTagChangePermission();\n addTagSelectionSettingComponent();\n});\nimport './admin';","import app from 'flarum/admin/app';\nimport { extend, override } from 'flarum/common/extend';\nimport PermissionGrid from 'flarum/admin/components/PermissionGrid';\nimport PermissionDropdown from 'flarum/admin/components/PermissionDropdown';\nimport Dropdown from 'flarum/common/components/Dropdown';\nimport Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport tagLabel from '../common/helpers/tagLabel';\nimport tagIcon from '../common/helpers/tagIcon';\nimport sortTags from '../common/utils/sortTags';\nexport default function () {\n extend(PermissionGrid.prototype, 'oninit', function () {\n this.loading = true;\n });\n extend(PermissionGrid.prototype, 'oncreate', function () {\n app.tagList.load().then(() => {\n this.loading = false;\n m.redraw();\n });\n });\n override(PermissionGrid.prototype, 'view', function (original, vnode) {\n if (this.loading) {\n return m(LoadingIndicator, null);\n }\n return original(vnode);\n });\n override(app, 'getRequiredPermissions', (original, permission) => {\n const tagPrefix = permission.match(/^tag\\d+\\./);\n if (tagPrefix) {\n const globalPermission = permission.substr(tagPrefix[0].length);\n const required = original(globalPermission);\n return required.map(required => tagPrefix[0] + required);\n }\n return original(permission);\n });\n extend(PermissionGrid.prototype, 'scopeItems', items => {\n sortTags(app.store.all('tags')).filter(tag => tag.isRestricted()).forEach(tag => items.add('tag' + tag.id(), {\n label: tagLabel(tag),\n onremove: () => tag.save({\n isRestricted: false\n }),\n render: item => {\n var _item$permission;\n if ('setting' in item) return null;\n if (item.permission === 'viewForum' || item.permission === 'startDiscussion' || (_item$permission = item.permission) != null && _item$permission.startsWith('discussion.') && item.tagScoped !== false || item.tagScoped) {\n return m(PermissionDropdown, {\n permission: \"tag\".concat(tag.id(), \".\").concat(item.permission),\n allowGuest: item.allowGuest\n });\n }\n return null;\n }\n }));\n });\n extend(PermissionGrid.prototype, 'scopeControlItems', items => {\n const tags = sortTags(app.store.all('tags').filter(tag => !tag.isRestricted()));\n if (tags.length) {\n items.add('tag', m(Dropdown, {\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 }, tags.map(tag => m(Button, {\n icon: true,\n onclick: () => tag.save({\n isRestricted: true\n })\n }, [tagIcon(tag, {\n className: 'Button-icon'\n }), ' ', tag.name()]))));\n }\n });\n}","import app from 'flarum/admin/app';\nimport { extend } from 'flarum/common/extend';\nimport PermissionGrid from 'flarum/admin/components/PermissionGrid';\nimport SettingDropdown from 'flarum/admin/components/SettingDropdown';\nexport default function () {\n extend(PermissionGrid.prototype, 'startItems', items => {\n items.add('allowTagChange', {\n icon: 'fas fa-tag',\n label: app.translator.trans('flarum-tags.admin.permissions.allow_edit_tags_label'),\n setting: () => {\n const minutes = parseInt(app.data.settings.allow_tag_change, 10);\n return m(SettingDropdown, {\n defaultLabel: minutes ? app.translator.trans('core.admin.permissions_controls.allow_some_minutes_button', {\n count: minutes\n }) : app.translator.trans('core.admin.permissions_controls.allow_indefinitely_button'),\n key: \"allow_tag_change\",\n options: [{\n value: '-1',\n label: app.translator.trans('core.admin.permissions_controls.allow_indefinitely_button')\n }, {\n value: '10',\n label: app.translator.trans('core.admin.permissions_controls.allow_ten_minutes_button')\n }, {\n value: 'reply',\n label: app.translator.trans('core.admin.permissions_controls.allow_until_reply_button')\n }]\n });\n }\n }, 90);\n });\n}","import { extend } from 'flarum/common/extend';\nimport SelectTagsSettingComponent from './components/SelectTagsSettingComponent';\nimport FormGroup from 'flarum/common/components/FormGroup';\nexport default function () {\n extend(FormGroup.prototype, 'customFieldComponents', function (items) {\n items.add('flarum-tags.select-tags', attrs => {\n return m(SelectTagsSettingComponent, Object.assign({}, attrs, {\n settingValue: attrs.bidi\n }));\n });\n });\n}","import classList from 'flarum/common/utils/classList';\nexport default function tagIcon(tag, attrs, settings) {\n if (attrs === void 0) {\n attrs = {};\n }\n if (settings === void 0) {\n settings = {};\n }\n const hasIcon = tag && tag.icon();\n const {\n useColor = true\n } = settings;\n attrs.className = classList([attrs.className, 'icon text-colored', hasIcon ? tag.icon() : 'TagIcon']);\n if (tag && useColor) {\n attrs.style = attrs.style || {};\n attrs.style['--color'] = tag.color();\n } else if (!tag) {\n attrs.className += ' untagged';\n }\n return hasIcon ? m(\"i\", attrs) : m(\"span\", attrs);\n}\nflarum.reg.add('flarum-tags', 'common/helpers/tagIcon', tagIcon);","import extract from 'flarum/common/utils/extract';\nimport Link from 'flarum/common/components/Link';\nimport classList from 'flarum/common/utils/classList';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport tagIcon from './tagIcon';\nexport default function tagLabel(tag, attrs) {\n if (attrs === void 0) {\n attrs = {};\n }\n attrs.style = attrs.style || {};\n attrs.className = 'TagLabel ' + (attrs.className || '');\n const link = extract(attrs, 'link');\n const tagText = tag ? tag.name() : app.translator.trans('flarum-tags.lib.deleted_tag_text');\n if (tag) {\n const color = tag.color();\n if (color) {\n attrs.style['--tag-bg'] = color;\n attrs.className = classList(attrs.className, 'colored', textContrastClass(color));\n }\n if (link) {\n attrs.title = tag.description() || '';\n attrs.href = app.route('tag', {\n tags: tag.slug()\n });\n }\n if (tag.isChild()) {\n attrs.className += ' TagLabel--child';\n }\n } else {\n attrs.className += ' untagged';\n }\n return m(link ? Link : 'span', attrs, m(\"span\", {\n className: \"TagLabel-text\"\n }, tag && tag.icon() && tagIcon(tag, {\n className: 'TagLabel-icon'\n }, {\n useColor: false\n }), m(\"span\", {\n className: \"TagLabel-name\"\n }, tagText)));\n}\nflarum.reg.add('flarum-tags', 'common/helpers/tagLabel', tagLabel);","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) return b.discussionCount() - a.discussionCount();\n\n // If just one is a secondary tag, then the primary tag should\n // come first.\n if (bPos === null) return -1;\n if (aPos === null) return 1;\n\n // If we've made it this far, we know they're both primary tags. So we'll\n // need to see if they have parents.\n const aParent = a.parent();\n const bParent = b.parent();\n\n // If they both have the same parent, then their positions are local,\n // so we can compare them directly.\n if (aParent === bParent) return aPos - bPos;\n // If they are both child tags, then we will compare the positions of their\n // parents.\n else if (aParent && bParent) return aParent.position() - bParent.position();\n // If we are comparing a child tag with its parent, then we let the parent\n // come first. If we are comparing an unrelated parent/child, then we\n // compare both of the parents.\n else if (aParent) return aParent === b ? 1 : aParent.position() - bPos;else if (bParent) return bParent === a ? -1 : aPos - bParent.position();\n return 0;\n });\n}\nflarum.reg.add('flarum-tags', 'common/utils/sortTags', sortTags);","module.exports = flarum.reg.get('core', 'common/Component');","module.exports = flarum.reg.get('core', 'common/app');","module.exports = flarum.reg.get('core', 'common/components/Button');","module.exports = flarum.reg.get('core', 'common/components/FormModal');","module.exports = flarum.reg.get('core', 'common/components/Link');","module.exports = flarum.reg.get('core', 'common/components/LoadingIndicator');","module.exports = flarum.reg.get('core', 'common/helpers/highlight');","module.exports = flarum.reg.get('core', 'common/helpers/textContrastClass');","module.exports = flarum.reg.get('core', 'common/utils/KeyboardNavigatable');","module.exports = flarum.reg.get('core', 'common/utils/Stream');","module.exports = flarum.reg.get('core', 'common/utils/classList');","module.exports = flarum.reg.get('core', 'common/utils/extract');","module.exports = flarum.reg.get('core', 'common/utils/extractText');","export default function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}","import _typeof from \"./typeof.js\";\nexport default function toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + \"common/components/TagSelectionModal\" + \".js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","__webpack_require__.f.compat = (chunkId, promises) => {\n\n\tconst originalLoadChunk = __webpack_require__.l;\n\t__webpack_require__.l = flarum.reg.loadChunk.bind(flarum.reg, originalLoadChunk);\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t884: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkmodule_exports\"] = self[\"webpackChunkmodule_exports\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));"],"names":["inProgress","dataWebpackPrefix","flarum","reg","get","extend","items","add","path","label","app","translator","trans","tagsLabel","tags","attrs","children","link","otherAttrs","className","sortTags","forEach","tag","length","push","tagLabel","m","SelectTagsSettingComponent","constructor","super","arguments","this","view","value","JSON","parse","settingValue","loaded","load","then","filter","includes","id","redraw","help","onclick","show","selectedTags","onsubmit","stringify","map","options","size","display","addChunkModule","TagListState","loadedIncludes","query","unloadedIncludes","include","has","Promise","resolve","all","Set","find","join","val","Array","isArray","Tag","name","call","slug","description","color","backgroundUrl","backgroundMode","icon","position","parent","defaultSort","isChild","isHidden","isPrimary","discussionCount","lastPostedAt","lastPostedDiscussion","isRestricted","canStartDiscussion","canAddToDiscussion","isPrimaryParent","TagGambit","KeyValueGambit","key","hint","filterKey","gambitValueToFilterValue","fromFilter","negate","gambits","toString","concat","filterValueToGambitValue","gambit","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","sym","getOwnPropertyDescriptor","enumerable","apply","_objectSpread2","target","i","source","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_typeof","obj","Symbol","iterator","prototype","configurable","writable","_extends","assign","hasOwnProperty","userAgent","pattern","window","navigator","match","IE11OrLess","Edge","FireFox","Safari","IOS","ChromeForAndroid","captureMode","capture","passive","on","el","event","fn","addEventListener","off","removeEventListener","matches","selector","substring","msMatchesSelector","webkitMatchesSelector","_","getParentOrHost","host","document","nodeType","parentNode","closest","ctx","includeCTX","_throttleTimeout","R_SPACE","toggleClass","state","classList","replace","css","prop","style","defaultView","getComputedStyle","currentStyle","indexOf","matrix","selfOnly","appliedTransforms","transform","matrixFn","DOMMatrix","WebKitCSSMatrix","CSSMatrix","MSCSSMatrix","tagName","list","getElementsByTagName","n","getWindowScrollingElement","scrollingElement","documentElement","getRect","relativeToContainingBlock","relativeToNonStaticParent","undoScale","container","getBoundingClientRect","elRect","top","left","bottom","right","height","width","innerHeight","innerWidth","containerRect","parseInt","elMatrix","scaleX","a","scaleY","d","isScrolledPast","elSide","parentSide","getParentAutoScrollElement","elSideVal","parentSideVal","getChild","childNum","includeDragEl","currentChild","Sortable","ghost","dragged","draggable","lastChild","last","lastElementChild","previousElementSibling","index","nodeName","toUpperCase","clone","getRelativeScrollOffset","offsetLeft","offsetTop","winScroller","scrollLeft","scrollTop","includeSelf","elem","gotSelf","clientWidth","scrollWidth","clientHeight","scrollHeight","elemCSS","overflowX","overflowY","body","isRectEqual","rect1","rect2","Math","round","throttle","callback","ms","args","setTimeout","scrollBy","x","y","Polymer","$","jQuery","Zepto","dom","cloneNode","getChildContainingRectFromElement","ghostEl","rect","from","child","_rect$left","_rect$top","_rect$right","_rect$bottom","animated","childRect","min","Infinity","max","expando","Date","getTime","plugins","defaults","initializeByDefault","PluginManager","mount","plugin","option","p","pluginName","pluginEvent","eventName","sortable","evt","_this","eventCanceled","cancel","eventNameGlobal","initializePlugins","initialized","modified","modifyOption","getEventProperties","eventProperties","modifiedValue","optionListeners","_excluded","_ref","undefined","originalEvent","data","excluded","sourceKeys","_objectWithoutPropertiesLoose","sourceSymbolKeys","propertyIsEnumerable","_objectWithoutProperties","bind","dragEl","parentEl","rootEl","nextEl","lastDownEl","cloneEl","cloneHidden","dragStarted","moved","putSortable","activeSortable","active","oldIndex","oldDraggableIndex","newIndex","newDraggableIndex","hideGhostForTarget","_hideGhostForTarget","unhideGhostForTarget","_unhideGhostForTarget","cloneNowHidden","cloneNowShown","dispatchSortableEvent","_dispatchEvent","info","targetEl","toEl","fromEl","extraEventProperties","onName","charAt","substr","CustomEvent","createEvent","initEvent","bubbles","cancelable","to","item","pullMode","lastPutMode","allEventProperties","dispatchEvent","activeGroup","tapEvt","touchEvt","lastDx","lastDy","tapDistanceLeft","tapDistanceTop","lastTarget","lastDirection","targetMoveDistance","ghostRelativeParent","awaitingDragStarted","ignoreNextClick","sortables","pastFirstInvertThresh","isCircumstantialInvert","ghostRelativeParentInitialScroll","_silent","savedInputChecked","documentExists","PositionGhostAbsolutely","CSSFloatProperty","supportDraggable","createElement","supportCssPointerEvents","cssText","pointerEvents","_detectDirection","elCSS","elWidth","paddingLeft","paddingRight","borderLeftWidth","borderRightWidth","child1","child2","firstChildCSS","secondChildCSS","firstChildWidth","marginLeft","marginRight","secondChildWidth","flexDirection","gridTemplateColumns","split","touchingSideChild2","clear","_prepareGroup","toFn","pull","sameGroup","group","otherGroup","originalGroup","checkPull","checkPut","put","revertClone","preventDefault","stopPropagation","stopImmediatePropagation","nearestEmptyInsertDetectEvent","touches","nearest","clientX","clientY","some","threshold","emptyInsertThreshold","insideHorizontally","insideVertically","ret","_onDragOver","_checkOutsideTargetEl","_isOutsideThisEl","animationCallbackId","animationStates","sort","disabled","store","handle","test","swapThreshold","invertSwap","invertedSwapThreshold","removeCloneOnHide","direction","ghostClass","chosenClass","dragClass","ignore","preventOnFilter","animation","easing","setData","dataTransfer","textContent","dropBubble","dragoverBubble","dataIdAttr","delay","delayOnTouchOnly","touchStartThreshold","Number","devicePixelRatio","forceFallback","fallbackClass","fallbackOnBody","fallbackTolerance","fallbackOffset","supportPointer","nativeDraggable","_onTapStart","captureAnimationState","slice","fromRect","thisAnimationDuration","childMatrix","f","e","addAnimationState","removeAnimationState","splice","arr","indexOfObject","animateAll","clearTimeout","animating","animationTime","time","toRect","prevFromRect","prevToRect","animatingRect","targetMatrix","sqrt","pow","calculateRealTime","animate","animationResetTimer","currentRect","duration","translateX","translateY","animatingX","animatingY","forRepaintDummy","offsetWidth","repaint","_onMove","dragRect","targetRect","willInsertAfter","retVal","onMoveFn","onMove","draggedRect","related","relatedRect","_disableDraggable","_unsilent","_generateId","str","src","href","sum","charCodeAt","_nextTick","_cancelNextTick","contains","_getDirection","type","touch","pointerType","originalTarget","shadowRoot","composedPath","root","inputs","idx","checked","_saveInputCheckedState","button","isContentEditable","criteria","trim","_prepareDragStart","dragStartFn","ownerDocument","nextSibling","_lastX","_lastY","_onDrop","_disableDelayedDragEvents","_triggerDragStart","_disableDelayedDrag","_delayedDragTouchMoveHandler","_dragStartTimer","abs","floor","_onTouchMove","_onDragStart","selection","empty","getSelection","removeAllRanges","err","_dragStarted","fallback","_appendGhost","_nulling","_emulateDragOver","elementFromPoint","ghostMatrix","relativeScrollOffset","dx","dy","b","c","cssMatrix","appendChild","removeAttribute","_hideClone","cloneId","insertBefore","_loopId","setInterval","effectAllowed","_dragStartId","revert","vertical","isOwner","canSort","fromSortable","completedFired","dragOverEvent","_ignoreWhileAnimating","completed","elLastChild","lastElRect","childContainingRect","_ghostIsLast","changed","firstElRect","_ghostIsFirst","firstChild","targetBeforeFirstSwap","sibling","differentLevel","differentRowCol","dragElS1Opp","dragElS2Opp","dragElOppLength","targetS1Opp","targetS2Opp","targetOppLength","_dragElInRowColumn","side1","scrolledPastTop","scrollBefore","isLastTarget","mouseOnAxis","targetLength","targetS1","targetS2","invert","_getInsertDirection","_getSwapDirection","dragIndex","nextElementSibling","after","moveVector","extra","axis","insertion","_showClone","_offMoveEvents","_offUpEvents","clearInterval","removeChild","save","handleEvent","dropEffect","_globalDragOver","toArray","order","getAttribute","useAnimation","set","destroy","querySelectorAll","utils","is","dst","nextTick","cancelNextTick","detectDirection","element","_len","_key","create","version","scrollEl","scrollRootEl","lastAutoScrollX","lastAutoScrollY","touchEvt$1","pointerElemChangedInterval","autoScrolls","scrolling","clearAutoScrolls","autoScroll","pid","clearPointerElemChangedInterval","isFallback","scroll","scrollCustomFn","sens","scrollSensitivity","speed","scrollSpeed","scrollThisInstance","scrollFn","layersOut","currentParent","canScrollX","canScrollY","scrollPosX","scrollPosY","vx","vy","layer","scrollOffsetY","scrollOffsetX","bubbleScroll","drop","toSortable","changedTouches","onSpill","Revert","Remove","startIndex","dragStart","_ref2","_ref3","_ref4","parentSortable","AutoScroll","forceAutoScrollFallback","_handleAutoScroll","_handleFallbackAutoScroll","dragOverCompleted","dragOverBubble","nulling","ogElemScroller","newElem","EditTagModal","oninit","vnode","model","createRecord","primary","title","attributes","submitData","content","fields","placeholder","oninput","bidi","fontawesome","tabindex","loading","exists","delete","hide","confirm","pushData","tagItem","tagIcon","TagsPage","forcedRefreshKey","minPrimaryTags","setting","maxPrimaryTags","minSecondaryTags","maxSecondaryTags","oncreate","onListOnCreate","localeCompare","setMinTags","submitButton","onSort","onSortUpdate","minTags","maxTags","HTMLOListElement","HTMLUListElement","getById","relationships","j","url","attribute","method","page","permission","tagList","override","original","tagPrefix","required","onremove","render","_item$permission","startsWith","tagScoped","allowGuest","buttonClassName","caretIcon","addTagsHomePageOption","minutes","settings","allow_tag_change","defaultLabel","count","hasIcon","useColor","tagText","route","aPos","bPos","aParent","bParent","module","exports","o","t","r","toPrimitive","TypeError","String","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","__esModule","definition","chunkId","reduce","promises","u","g","globalThis","Function","l","done","script","needAttach","scripts","s","charset","timeout","nc","setAttribute","onScriptComplete","prev","onerror","onload","doneFns","head","toStringTag","scriptUrl","importScripts","location","currentScript","Error","compat","originalLoadChunk","loadChunk","installedChunks","installedChunkData","promise","reject","error","errorType","realSrc","message","request","webpackJsonpCallback","parentChunkLoadingFunction","chunkIds","moreModules","runtime","chunkLoadingGlobal","self"],"sourceRoot":""} \ No newline at end of file diff --git a/framework/core/js/dist-typings/common/Application.d.ts b/framework/core/js/dist-typings/common/Application.d.ts index 6197af90b7..f9414004d4 100644 --- a/framework/core/js/dist-typings/common/Application.d.ts +++ b/framework/core/js/dist-typings/common/Application.d.ts @@ -192,6 +192,7 @@ export default class Application { pane: any; data: ApplicationData; allowUserColorScheme: boolean; + refs: Record; private _title; private _titleCount; private set title(value); diff --git a/framework/core/js/dist/admin.js b/framework/core/js/dist/admin.js index 3758437d87..5147df89fd 100644 --- a/framework/core/js/dist/admin.js +++ b/framework/core/js/dist/admin.js @@ -1,3 +1,3 @@ /*! For license information please see admin.js.LICENSE.txt */ -(()=>{var t,e,n={5710:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(8805);class s{constructor(){(0,r.A)(this,"element",void 0),(0,r.A)(this,"attrs",void 0),(0,r.A)(this,"state",void 0)}oninit(t){this.setAttrs(t.attrs)}oncreate(t){this.element=t.dom}onbeforeupdate(t){this.setAttrs(t.attrs)}onupdate(t){}onbeforeremove(t){}onremove(t){}$(t){const e=$(this.element);return t?e.find(t):e}static component(t,e){void 0===t&&(t={}),void 0===e&&(e=null);const n={...t};return m(this,n,e)}setAttrs(t){if(void 0===t&&(t={}),this.constructor.initAttrs(t),t){if("children"in t)throw new Error("[".concat(this.constructor.name,'] The "children" attribute of attrs should never be used. Either pass children in as the vnode children or rename the attribute'));if("tag"in t)throw new Error("[".concat(this.constructor.name,'] You cannot use the "tag" attribute name with Mithril 2.'))}this.attrs=t}static initAttrs(t){}}flarum.reg.add("core","common/Component",s)},5420:(t,e,n)=>{"use strict";n.d(e,{A:()=>i});var r=n(8805),s=n(5114);class i{constructor(t,e){void 0===t&&(t={}),void 0===e&&(e=s.A.store),(0,r.A)(this,"data",{}),(0,r.A)(this,"freshness",new Date),(0,r.A)(this,"exists",!1),(0,r.A)(this,"store",void 0),this.data=t,this.store=e}id(){return"id"in this.data?this.data.id:void 0}attribute(t){var e;return null==(e=this.data)||null==(e=e.attributes)?void 0:e[t]}pushData(t){if("id"in t&&(this.data.id=t.id),"type"in t&&(this.data.type=t.type),"attributes"in t){var e;(e=this.data).attributes||(e.attributes={});for(const e in t.attributes){const n=t.attributes[e];n&&n instanceof i&&delete t.attributes[e]}Object.assign(this.data.attributes,t.attributes)}if("relationships"in t){var n;const e=null!=(n=this.data.relationships)?n:{};for(const n in t.relationships){const r=t.relationships[n];if(null===r){delete e[n],delete t.relationships[n];continue}let s;s=r instanceof i?{data:i.getIdentifier(r)}:r instanceof Array?{data:r.map(i.getIdentifier)}:r,t.relationships[n]=s,e[n]=s}this.data.relationships=e}return this.freshness=new Date,this}pushAttributes(t){this.pushData({attributes:t})}save(t,e){void 0===e&&(e={});const n={type:this.data.type,attributes:t};if("id"in this.data&&(n.id=this.data.id),t.relationships){n.relationships={};for(const e in t.relationships){const r=t.relationships[e];null!==r&&(n.relationships[e]={data:r instanceof Array?r.map(i.getIdentifier):i.getIdentifier(r)})}delete t.relationships}const r=this.copyData();this.pushData(n);const a={data:n,meta:e.meta||void 0};return s.A.request({method:this.exists?"PATCH":"POST",url:s.A.forum.attribute("apiUrl")+this.apiEndpoint(),body:a,...e}).then((t=>this.store.pushPayload(t)),(t=>{throw this.pushData(r),m.redraw(),t}))}delete(t,e){return void 0===t&&(t={}),void 0===e&&(e={}),this.exists?s.A.request({method:"DELETE",url:s.A.forum.attribute("apiUrl")+this.apiEndpoint(),body:t,...e}).then((()=>{this.exists=!1,this.store.remove(this)})):Promise.resolve()}apiEndpoint(){return"/"+this.data.type+("id"in this.data?"/"+this.data.id:"")}copyData(){return JSON.parse(JSON.stringify(this.data))}rawRelationship(t){var e;return null==(e=this.data.relationships)||null==(e=e[t])?void 0:e.data}static attribute(t,e){return function(){return e?e(this.attribute(t)):this.attribute(t)}}static hasOne(t){return function(){var e;const n=null==(e=this.data.relationships)||null==(e=e[t])?void 0:e.data;if(n&&n instanceof Array)throw new Error("Relationship ".concat(t," on model ").concat(this.data.type," is plural, so the hasOne method cannot be used to access it."));return!!n&&this.store.getById(n.type,n.id)}}static hasMany(t){return function(){var e;const n=null==(e=this.data.relationships)||null==(e=e[t])?void 0:e.data;if(n&&!(n instanceof Array))throw new Error("Relationship ".concat(t," on model ").concat(this.data.type," is singular, so the hasMany method cannot be used to access it."));return!!n&&n.map((t=>this.store.getById(t.type,t.id)))}}static transformDate(t){return null!=t?new Date(t):t}static getIdentifier(t){return t&&t.data&&"id"in t.data?{type:t.data.type,id:t.data.id}:null}}flarum.reg.add("core","common/Model",i)},3920:(t,e,n)=>{"use strict";n.d(e,{A:()=>p});var r=n(8805),s=n(5114),i=n(8631);class a extends i.px{key(){return s.A.translator.trans("core.lib.gambits.discussions.author.key",{},!0)}hint(){return s.A.translator.trans("core.lib.gambits.discussions.author.hint",{},!0)}filterKey(){return"author"}}flarum.reg.add("core","common/query/discussions/AuthorGambit",a);class o extends i.px{key(){return s.A.translator.trans("core.lib.gambits.discussions.created.key",{},!0)}hint(){return s.A.translator.trans("core.lib.gambits.discussions.created.hint",{},!0)}valuePattern(){return"(\\d{4}\\-\\d\\d\\-\\d\\d(?:\\.\\.(\\d{4}\\-\\d\\d\\-\\d\\d))?)"}filterKey(){return"created"}}flarum.reg.add("core","common/query/discussions/CreatedGambit",o);class l extends i.pm{key(){return s.A.translator.trans("core.lib.gambits.discussions.hidden.key",{},!0)}filterKey(){return"hidden"}enabled(){return!!s.A.session.user}}flarum.reg.add("core","common/query/discussions/HiddenGambit",l);class c extends i.pm{key(){return s.A.translator.trans("core.lib.gambits.discussions.unread.key",{},!0)}filterKey(){return"unread"}enabled(){return!!s.A.session.user}}flarum.reg.add("core","common/query/discussions/UnreadGambit",c);class u extends i.px{key(){return s.A.translator.trans("core.lib.gambits.users.email.key",{},!0)}hint(){return s.A.translator.trans("core.lib.gambits.users.email.hint",{},!0)}filterKey(){return"email"}enabled(){return!(!s.A.session.user||!s.A.forum.attribute("canEditUserCredentials"))}}flarum.reg.add("core","common/query/users/EmailGambit",u);class d extends i.px{key(){return s.A.translator.trans("core.lib.gambits.users.group.key",{},!0)}hint(){return s.A.translator.trans("core.lib.gambits.users.group.hint",{},!0)}filterKey(){return"group"}}flarum.reg.add("core","common/query/users/GroupGambit",d);class h extends i.px{key(){return s.A.translator.trans("core.lib.gambits.posts.discussion.key",{},!0)}hint(){return s.A.translator.trans("core.lib.gambits.posts.discussion.hint",{},!0)}filterKey(){return"discussion"}}flarum.reg.add("core","common/query/discussions/DiscussionGambit",h);class m{constructor(){(0,r.A)(this,"gambits",{discussions:[a,o,l,c],posts:[a,h],users:[u,d]})}apply(t,e){return e.q=this.match(t,e.q,((t,n,r)=>{const s=t.toFilter(n,r);Object.keys(s).forEach((n=>{n in e&&t.predicates&&Array.isArray(s[n])?e[n]=e[n].concat(s[n]):e[n]=s[n]}))})),e}match(t,e,n){const r=this.for(t).filter((t=>t.enabled()));if(0===r.length)return e;const s=e.split(" ");for(const t of r)for(const r of s){const s=new RegExp("^(-?)".concat(t.pattern(),"$"),"i");let i=r.match(s);if(i){const s="-"===i[1];i.splice(1,1),n(t,i,s,r),e=e.replace(r,"")}}return e.trim().replace(/\s+/g," ")}from(t,e,n){const r=this.for(t);return 0===r.length||Object.keys(n).forEach((t=>{for(const s of r){const r="-"===t[0];r&&(t=t.substring(1)),s.filterKey()===t&&(e+=" ".concat(s.fromFilter(n[t],r)))}})),e}for(t){return(this.gambits[t]||[]).map((t=>new t))}}flarum.reg.add("core","common/GambitManager",m);class p{constructor(t){(0,r.A)(this,"state",void 0),(0,r.A)(this,"gambits",new m),this.state=t}}(0,r.A)(p,"MIN_SEARCH_LEN",3),flarum.reg.add("core","common/SearchManager",p)},5114:(t,e,n)=>{"use strict";n.d(e,{A:()=>i});const r=window,s=new Proxy({},{get:(t,e)=>Reflect.get(r.app,e,r.app),set:(t,e,n)=>Reflect.set(r.app,e,n,r.app)}),i=s;flarum.reg.add("core","common/app",s)},9924:(t,e,n)=>{"use strict";n.d(e,{A:()=>u});var r=n(5710),s=n(7880),i=n(5673),a=n(4586),o=n(4268),l=n(5114),c=n(7479);class u extends r.A{view(t){const e=Object.assign({},this.attrs),n=(0,a.A)(e,"type");e.className=(0,o.A)("Alert","Alert--".concat(n),e.className);const r=(0,a.A)(e,"title"),u=(0,a.A)(e,"icon"),d=(0,a.A)(e,"content")||t.children,h=(0,a.A)(e,"controls")||[],p=(0,a.A)(e,"dismissible"),f=(0,a.A)(e,"ondismiss"),g=[];return(p||void 0===p)&&g.push(m(s.A,{"aria-label":l.A.translator.trans("core.lib.alert.dismiss_a11y_label"),icon:"fas fa-times",className:"Button Button--link Button--icon Alert-dismiss",onclick:f})),m("div",e,m("div",{className:(0,o.A)("Alert-container",e.containerClassName)},!!r&&m("div",{className:"Alert-title"},!!u&&m("span",{className:"Alert-title-icon"},m(c.A,{name:u})),m("span",{className:"Alert-title-text"},r)),m("span",{className:"Alert-body"},d),m("ul",{className:"Alert-controls"},(0,i.A)(h.concat(g)))))}}flarum.reg.add("core","common/components/Alert",u)},367:(t,e,n)=>{"use strict";n.d(e,{A:()=>l});var r=n(4391),s=n(5710),i=n(4268),a=n(3288),o=n(7479);class l extends s.A{view(){const{type:t,icon:e,label:n,color:s,style:l={},...c}=this.attrs,u=(0,i.A)("Badge",[t&&"Badge--".concat(t)],c.className,(0,a.A)(s)),d=e?m(o.A,{name:e,className:"Badge-icon"}):m.trust(" "),h={...l};window.testing||(h["--badge-bg"]=s);const p={...c,className:u,style:h},f=m("div",p,d);return n?m(r.A,{text:n},f):f}}flarum.reg.add("core","common/components/Badge",l)},7880:(t,e,n)=>{"use strict";n.d(e,{A:()=>u});var r=n(5710),s=n(5114);function i(){s.A.forum.attribute("debug")&&console.warn(...arguments)}flarum.reg.add("core","common/helpers/fireDebugWarning",i);var a=n(4268),o=n(117),l=n(43),c=n(7479);class u extends r.A{view(t){let{type:e,"aria-label":n,icon:r,disabled:s,loading:i,className:l,class:c,...u}=this.attrs;e||(e="button"),"object"==typeof n&&(n=(0,o.A)(n)),(s||i)&&delete u.onclick,l=(0,a.A)(c,l,{hasIcon:r,disabled:s||i,loading:i});const d={disabled:s,className:l,type:e,"aria-label":n,...u};return m("button",d,this.getButtonContent(t.children))}oncreate(t){var e,n;super.oncreate(t);const{"aria-label":r}=this.attrs;this.view!==u.prototype.view||r||(0,o.A)(t.children)||null!=(e=this.element)&&null!=(n=e.getAttribute)&&n.call(e,"aria-label")||i('[Flarum Accessibility Warning] Button has no content and no accessible label. This means that screen-readers will not be able to interpret its meaning and just read "Button". Consider providing accessible text via the `aria-label` attribute. https://web.dev/button-name',this.element)}getButtonContent(t){const e=this.attrs.icon;return[e&&m(c.A,{name:e,className:"Button-icon"}),t&&m("span",{className:"Button-label"},t),this.attrs.loading&&m(l.A,{size:"small",display:"inline"})]}}flarum.reg.add("core","common/components/Button",u)},374:(t,e,n)=>{"use strict";n.d(e,{A:()=>i});var r=n(5710),s=n(4268);class i extends r.A{view(t){const{label:e,description:n,className:r,...i}=t.attrs;return m("div",Object.assign({className:(0,s.A)("Form",r)},i),(e||n)&&m("div",{className:"Form-header"},e&&m("label",null,e),n&&m("p",{className:"helpText"},n)),m("div",{className:"Form-body"},t.children))}}flarum.reg.add("core","common/components/Form",i)},2855:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(2849);class s extends r.A{wrapper(t){return m("form",{onsubmit:this.onsubmit.bind(this)},t)}onsubmit(t){}onready(){this.$().find("input, select, textarea").first().trigger("focus").trigger("select")}onerror(t){var e;this.alertAttrs=t.alert,m.redraw(),422===t.status&&null!=(e=t.response)&&e.errors?this.$("form [name="+t.response.errors[0].source.pointer.replace("/data/attributes/","")+"]").trigger("select"):this.onready()}}flarum.reg.add("core","common/components/FormModal",s)},3550:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(367);class s extends r.A{static initAttrs(t){super.initAttrs(t),t.group&&(t.icon=t.group.icon()||"",t.color=t.group.color()||"",t.label=void 0===t.label?t.group.nameSingular():t.label,t.type="group--"+t.group.id(),delete t.group)}}flarum.reg.add("core","common/components/GroupBadge",s)},7479:(t,e,n)=>{"use strict";n.d(e,{A:()=>i});var r=n(4268),s=n(5710);class i extends s.A{view(t){const{name:e,...n}=t.attrs;return n.className=(0,r.A)("icon",e,n.className),m("i",Object.assign({"aria-hidden":"true"},n))}}flarum.reg.add("core","common/components/Icon",i)},4164:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(5710),s=n(7479),i=n(4268);class a extends r.A{view(t){const{icon:e,className:n,...r}=t.attrs;return m("div",Object.assign({className:(0,i.A)("InfoTile",n)},r),this.icon(),m("div",{className:"InfoTile-text"},t.children))}icon(){return this.attrs.iconElement?this.attrs.iconElement:this.attrs.icon?m(s.A,{name:(0,i.A)(this.attrs.icon,"InfoTile-icon")}):null}}flarum.reg.add("core","common/components/InfoTile",a)},7882:(t,e,n)=>{"use strict";n.d(e,{A:()=>c});var r=n(5114),s=n(5710),i=n(7479),a=n(43),o=n(4268),l=n(7880);class c extends s.A{oninit(t){super.oninit(t)}view(t){var e,n;const{className:s,...c}=this.attrs.inputAttrs||{},u=this.attrs.value||(null==(e=(n=this.attrs).stream)?void 0:e.call(n))||"";return m("div",{className:(0,o.A)("Input",this.attrs.className,{"Input--withPrefix":this.attrs.prefixIcon,"Input--withClear":this.attrs.clearable})},this.attrs.prefixIcon&&m(i.A,{name:(0,o.A)(this.attrs.prefixIcon,"Input-prefix-icon")}),this.input({inputClassName:s,value:u,inputAttrs:c}),this.attrs.loading&&m(a.A,{size:"small",display:"inline",containerClassName:"Button Button--icon Button--link"}),this.attrs.clearable&&u&&!this.attrs.loading&&m(l.A,{className:"Input-clear Button Button--icon Button--link",onclick:this.clear.bind(this),"aria-label":this.attrs.clearLabel||r.A.translator.trans("core.lib.input.clear_button"),type:"button",icon:"fas fa-times-circle"}))}input(t){let{inputClassName:e,value:n,inputAttrs:r}=t;const s={className:(0,o.A)("FormControl",e),type:this.attrs.type||"text",value:n,oninput:t=>{var e;return null==(e=this.onchange)?void 0:e.call(this,t.target.value)},"aria-label":this.attrs.ariaLabel,placeholder:this.attrs.placeholder,readonly:this.attrs.readonly||void 0,disabled:this.attrs.disabled||void 0,...r};return this.attrs.renderInput?this.attrs.renderInput(s):m("input",s)}onchange(t){var e,n;this.attrs.stream?this.attrs.stream(t):null==(e=(n=this.attrs).onchange)||e.call(n,t)}clear(){this.onchange("")}}flarum.reg.add("core","common/components/Input",c)},43:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(5114),s=n(5710),i=n(4268);class a extends s.A{view(){const{display:t="block",size:e="medium",containerClassName:n,className:s,...a}=this.attrs,o=(0,i.A)("LoadingIndicator",s),l=(0,i.A)("LoadingIndicator-container","unset"!==t&&"LoadingIndicator-container--".concat(t),e&&"LoadingIndicator-container--".concat(e),n);return m("div",Object.assign({"aria-label":r.A.translator.trans("core.lib.loading_indicator.accessible_label"),role:"status"},a.containerAttrs,{"data-size":e,className:l}),m("div",Object.assign({"aria-hidden":"true",className:o},a)))}}flarum.reg.add("core","common/components/LoadingIndicator",a)},2849:(t,e,n)=>{"use strict";n.d(e,{A:()=>c});var r=n(8805),s=n(5114),i=n(5710),a=n(9924),o=n(7880),l=n(4268);class c extends i.A{constructor(){super(...arguments),(0,r.A)(this,"loading",!1),(0,r.A)(this,"alertAttrs",null)}static get dismissibleOptions(){return{viaCloseButton:this.isDismissibleViaCloseButton,viaEscKey:this.isDismissibleViaEscKey,viaBackdropClick:this.isDismissibleViaBackdropClick}}oncreate(t){super.oncreate(t),this.attrs.animateShow((()=>this.onready()))}onbeforeremove(t){if(super.onbeforeremove(t),!this.attrs.state.modal)return new Promise((t=>setTimeout(t,300)))}view(){return this.alertAttrs&&(this.alertAttrs.dismissible=!1),m("div",{className:(0,l.A)("Modal modal-dialog fade",this.className())},m("div",{className:"Modal-content"},this.dismissibleOptions.viaCloseButton&&m("div",{className:"Modal-close App-backControl"},m(o.A,{icon:"fas fa-times",onclick:()=>this.hide(),className:"Button Button--icon Button--link","aria-label":s.A.translator.trans("core.lib.modal.close")})),this.wrapper(this.inner())))}wrapper(t){return m("[",null,t)}inner(){return m("[",null,m("div",{className:"Modal-header"},m("h3",{className:"App-titleControl App-titleControl--text"},this.title())),!!this.alertAttrs&&m("div",{className:"Modal-alert"},m(a.A,this.alertAttrs)),this.content())}onready(){}hide(){this.attrs.animateHide()}loaded(){this.loading=!1,m.redraw()}get dismissibleOptions(){return this.constructor.dismissibleOptions}}(0,r.A)(c,"isDismissibleViaCloseButton",!0),(0,r.A)(c,"isDismissibleViaEscKey",!0),(0,r.A)(c,"isDismissibleViaBackdropClick",!0),flarum.reg.add("core","common/components/Modal",c)},4391:(t,e,n)=>{"use strict";n.d(e,{A:()=>o});var r=n(8805),s=n(5710),i=n(4268),a=n(117);class o extends s.A{constructor(){super(...arguments),(0,r.A)(this,"firstChild",null),(0,r.A)(this,"childDomNode",null),(0,r.A)(this,"oldText",""),(0,r.A)(this,"oldVisibility",void 0),(0,r.A)(this,"shouldRecreateTooltip",!1),(0,r.A)(this,"shouldChangeTooltipVisibility",!1)}view(t){const e=t.children,{text:n,tooltipVisible:r,showOnFocus:s=!0,position:i="top",ignoreTitleWarning:a=!1,html:o=!1,delay:l=0,...c}=this.attrs;this.attrs.title&&!a&&console.warn("`title` attribute was passed to Tooltip component. Was this intentional? Tooltip content should be passed to the `text` attr instead.");const u=this.getRealText();if(u!==this.oldText&&(this.oldText=u,this.shouldRecreateTooltip=!0),r!==this.oldVisibility&&(this.oldVisibility=this.attrs.tooltipVisible,this.shouldChangeTooltipVisibility=!0),void 0===e)throw new Error("Tooltip component was provided with no direct child DOM element. Tooltips must contain a single direct DOM node to attach to.");if(1!==e.length)throw new Error("Tooltip component was either passed more than one or no child node.\n\nPlease wrap multiple children in another element, such as a
or .");const d=e[0];if("object"!=typeof d||Array.isArray(d)||null===d)throw new Error("Tooltip component was provided with no direct child DOM element. Tooltips must contain a single direct DOM node to attach to.");if("string"==typeof d.tag&&["#","[","<"].includes(d.tag))throw new Error('Tooltip component with provided with a vnode with tag "'.concat(d.tag,'". This is not a DOM element, so is not a valid child element. Please wrap this vnode in another element, such as a
or .'));return this.firstChild=d,e}oncreate(t){super.oncreate(t),this.checkDomNodeChanged(),this.recreateTooltip()}onupdate(t){super.onupdate(t),this.checkDomNodeChanged(),this.recreateTooltip()}recreateTooltip(){this.shouldRecreateTooltip&&null!==this.childDomNode&&($(this.childDomNode).tooltip("destroy","DANGEROUS_tooltip_jquery_fn_deprecation_exempt"),this.createTooltip(),this.shouldRecreateTooltip=!1),this.shouldChangeTooltipVisibility&&(this.shouldChangeTooltipVisibility=!1,this.updateVisibility())}updateVisibility(){null!==this.childDomNode&&(!0===this.attrs.tooltipVisible?$(this.childDomNode).tooltip("show","DANGEROUS_tooltip_jquery_fn_deprecation_exempt"):!1===this.attrs.tooltipVisible&&$(this.childDomNode).tooltip("hide","DANGEROUS_tooltip_jquery_fn_deprecation_exempt"))}createTooltip(){if(null===this.childDomNode)return;const{showOnFocus:t=!0,position:e="top",delay:n,html:r=!1,tooltipVisible:s,text:a}=this.attrs,o="boolean"==typeof s?"manual":(0,i.A)("hover",[t&&"focus"]),l=this.getRealText();this.childDomNode.setAttribute("title",l),this.childDomNode.setAttribute("aria-label",l),$(this.childDomNode).tooltip({html:r,delay:n,placement:e,trigger:o},"DANGEROUS_tooltip_jquery_fn_deprecation_exempt")}getRealText(){const{text:t}=this.attrs;return Array.isArray(t)?(0,a.A)(t):t}checkDomNodeChanged(){const t=this.firstChild.dom;t&&!t.isSameNode(this.childDomNode)&&(this.childDomNode=t,this.shouldRecreateTooltip=!0)}}flarum.reg.add("core","common/components/Tooltip",o)},5673:(t,e,n)=>{"use strict";n.d(e,{A:()=>o});var r=n(646),s=n(4268);function i(t){return"object"==typeof t&&null!==t&&"tag"in t}function a(t){return i(t)&&t.tag===r.A}function o(t,e,n){void 0===e&&(e="li"),void 0===n&&(n={});const r=e;return function(t){const e=[];let n;return t.filter(Boolean).forEach(((r,s)=>{(!a(r)||n&&!a(n)&&s!==t.length-1)&&(n=r,e.push(r))})),e}(t instanceof Array?t:[t]).map((t=>{var e;const a=[t.itemName&&"item-".concat(t.itemName)];if(i(t)&&t.tag.isListItem)return t.attrs=t.attrs||{},t.attrs.key=t.attrs.key||t.itemName,t.key=t.attrs.key,t;var o,l,c;i(t)&&(a.push((null==(o=t.attrs)?void 0:o.itemClassName)||t.itemClassName),null!=(l=(c=t.tag).isActive)&&l.call(c,t.attrs)&&a.push("active"));const u=i(t)&&(null==t||null==(e=t.attrs)?void 0:e.key)||t.itemName;return m(r,Object.assign({className:(0,s.A)(a),key:u},n),t)}))}flarum.reg.add("core","common/helpers/listItems",o)},3288:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(2967);function s(t){return t?(0,r.A)(t)?"text-contrast--light":"text-contrast--dark":"text-contrast--unchanged"}flarum.reg.add("core","common/helpers/textContrastClass",s)},4583:(t,e,n)=>{"use strict";n.d(e,{A:()=>i});var r=n(8805),s=n(5420);class i extends s.A{nameSingular(){return s.A.attribute("nameSingular").call(this)}namePlural(){return s.A.attribute("namePlural").call(this)}color(){return s.A.attribute("color").call(this)}icon(){return s.A.attribute("icon").call(this)}isHidden(){return s.A.attribute("isHidden").call(this)}}(0,r.A)(i,"ADMINISTRATOR_ID","1"),(0,r.A)(i,"GUEST_ID","2"),(0,r.A)(i,"MEMBER_ID","3"),flarum.reg.add("core","common/models/Group",i)},8631:(t,e,n)=>{"use strict";n.d(e,{$Q:()=>i,pm:()=>a,px:()=>o});var r=n(8805),s=n(5114);let i=function(t){return t.KeyValue="key:value",t.Grouped="grouped",t}({});class a{constructor(){(0,r.A)(this,"type",i.Grouped),(0,r.A)(this,"predicates",!1)}pattern(){const t=s.A.translator.trans("core.lib.gambits.boolean_key",{},!0);let e=this.key();return Array.isArray(e)&&(e=e.join("|")),"".concat(t,":(").concat(e,")")}toFilter(t,e){const n=(e?"-":"")+this.filterKey();return{[n]:!0}}fromFilter(t,e){const n=s.A.translator.trans("core.lib.gambits.boolean_key",{},!0),r=this.key();return"".concat(e?"-":"").concat(n,":").concat(r)}suggestion(){return{group:s.A.translator.trans("core.lib.gambits.boolean_key",{},!0),key:this.key()}}enabled(){return!0}}class o{constructor(){(0,r.A)(this,"type",i.KeyValue),(0,r.A)(this,"predicates",!1)}valuePattern(){return"(.+)"}gambitValueToFilterValue(t){return t}filterValueToGambitValue(t){return Array.isArray(t)?t.join(","):t.toString()}pattern(){const t=this.key();return"".concat(t,":")+this.valuePattern()}toFilter(t,e){const n=(e?"-":"")+this.filterKey();return{[n]:this.gambitValueToFilterValue(t[1])}}fromFilter(t,e){return"".concat(e?"-":"").concat(this.key(),":").concat(this.filterValueToGambitValue(t))}suggestion(){return{key:this.key(),hint:this.hint()}}enabled(){return!0}}flarum.reg.add("core","common/query/IGambit",{GambitType:i,BooleanGambit:a,KeyValueGambit:o})},5992:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(8805);class s{constructor(t){(0,r.A)(this,"symbol",void 0),(0,r.A)(this,"relativeStart",0),(0,r.A)(this,"absoluteStart",0),this.symbol=t}check(t,e,n){void 0===n&&(n=null),this.absoluteStart=0;for(let s=t.length-1;s>=0;s--){var r;const i=t.substr(s,1);if(n&&(null==(r=n)||!r.test(i)))return null;if(this.symbol){const t="string"==typeof this.symbol?t=>t===this.symbol:this.symbol;if(!t(i))continue}if(0===s||/\s/.test(t.substr(s-1,1)))return this.relativeStart=s+(this.symbol?1:0),this.absoluteStart=e-t.length+s+(this.symbol?1:0),{symbol:this.symbol&&i,relativeStart:this.relativeStart,absoluteStart:this.absoluteStart,typed:t.substring(this.relativeStart).toLowerCase()}}return null}}flarum.reg.add("core","common/utils/AutocompleteReader",s)},6500:(t,e,n)=>{"use strict";n.d(e,{A:()=>l});var r=n(8805),s=n(5114),i=n(8631),a=n(5992),o=n(7880);class l{constructor(t,e,n,s){this.resource=t,this.jqueryInput=e,this.onchange=n,this.afterSuggest=s,(0,r.A)(this,"query","")}suggestions(t){const e=s.A.search.gambits.for(this.resource).filter((t=>t.enabled()));this.query=t;const n=e.filter((t=>t.type===i.$Q.Grouped)),r=e.filter((t=>t.type!==i.$Q.Grouped)),o=[];for(const t of n)o.includes(t.suggestion().group)||o.push(t.suggestion().group);const l=[];for(const t of o)l.push({type:i.$Q.Grouped,suggestion:()=>({group:t,key:n.filter((e=>e.suggestion().group===t)).map((t=>{const e=t.suggestion().key;return e instanceof Array?e.join(", "):e})).join(", ")}),pattern:()=>"",filterKey:()=>"",toFilter:()=>[],fromFilter:()=>"",predicates:!1,enabled:()=>!0});const c=new a.A(null),u=this.jqueryInput().prop("selectionStart")||t.length,d=t.slice(0,u),h=c.check(d,u,/\S+$/);let m=(null==h?void 0:h.typed)||"";const p=m.startsWith("-");if(p&&(m=m.slice(1)),m.endsWith(":")){const t=m.replace(/:$/,"")||null,e=m.split(":").pop()||"";if(t){const r=this.specificGambitSuggestions(t,e,o,n,h);if(r)return r}}return[...l,...r].filter((t=>!h||new RegExp(m).test(t.type===i.$Q.Grouped?t.suggestion().group:t.suggestion().key))).map((t=>{const e=t.suggestion(),n=t.type===i.$Q.Grouped?e.group:e.key,r=t.type===i.$Q.Grouped?e.key:e.hint;return this.gambitSuggestion(n,r,(t=>{var e;return this.suggest((t?"-":"")+n+":",m||"",(null!=(e=null==h?void 0:h.relativeStart)?e:u)+Number(p))}))}))}specificGambitSuggestions(t,e,n,r,s){return n.includes(t)?r.filter((e=>e.suggestion().group===t)).flatMap((t=>t.suggestion().key instanceof Array?t.suggestion().key:[t.suggestion().key])).filter((t=>!e||t.toLowerCase().startsWith(e))).map((t=>this.gambitSuggestion(t,null,(()=>this.suggest(t,e,s.relativeStart+s.typed.length))))):null}gambitSuggestion(t,e,n){return m("li",null,m("span",{className:"Dropdown-item GambitsAutocomplete-gambit"},m("button",{type:"button",className:"Button--ua-reset",onclick:()=>n()},m("span",{className:"GambitsAutocomplete-gambit-key"},t,!!e&&":"),!!e&&m("span",{className:"GambitsAutocomplete-gambit-value"},e)),!!e&&m("span",{className:"GambitsAutocomplete-gambit-actions"},m(o.A,{class:"Button Button--icon",onclick:()=>n(),icon:"fas fa-plus","aria-label":s.A.translator.trans("core.forum.search.gambit_plus_button_a11y_label")}),m(o.A,{class:"Button Button--icon",onclick:()=>n(!0),icon:"fas fa-minus","aria-label":s.A.translator.trans("core.forum.search.gambit_minus_button_a11y_label")}))))}suggest(t,e,n){const r=this.jqueryInput(),s=this.query,i=s.slice(0,n)+t+s.slice(n+e.length);this.onchange(i),r[0].focus(),setTimeout((()=>{r[0].setSelectionRange(n+t.length,n+t.length),m.redraw()}),50),this.afterSuggest(i)}}flarum.reg.add("core","common/utils/GambitsAutocomplete",l)},6064:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(8805),s=n(9648);class i{constructor(t,e){(0,r.A)(this,"content",void 0),(0,r.A)(this,"priority",void 0),this.content=t,this.priority=e}}class a{constructor(){(0,r.A)(this,"_items",{})}isEmpty(){return 0===Object.keys(this._items).length}has(t){return Object.keys(this._items).includes(t)}get(t){return this._items[t].content}getPriority(t){return this._items[t].priority}add(t,e,n){return void 0===n&&(n=0),this._items[t]=new i(e,n),this}setContent(t,e){if(!this.has(t))throw new Error("[ItemList] Cannot set content of Item. Key `".concat(t,"` is not present."));return null!==e&&(this._items[t].content=e),this}setPriority(t,e){if(!this.has(t))throw new Error("[ItemList] Cannot set priority of Item. Key `".concat(t,"` is not present."));return this._items[t].priority=e,this}remove(t){return delete this._items[t],this}merge(t){return Object.keys(t._items).forEach((e=>{const n=t._items[e];n instanceof i&&(this._items[e]=n)})),this}toArray(t){return void 0===t&&(t=!1),Object.keys(this._items).map(((e,n)=>{const r=this._items[e];return!t||(0,s.A)(r.content)?{...r,content:this.createItemContentProxy((0,s.A)(r.content)?r.content:Object(r.content),e)}:{...r}})).sort(((t,e)=>e.priority-t.priority)).map((t=>t.content))}toObject(){return Object.keys(this._items).reduce(((t,e)=>{const n={content:this.get(e),itemName:e,priority:this.getPriority(e)};return t[e]=n,t}),{})}createItemContentProxy(t,e){return new Proxy(t,{get:(t,n,r)=>"itemName"===n?e:Reflect.get(t,n,r),set(t,n,r,s){if(null!==e&&"itemName"===n)throw new Error("`itemName` property is read-only");return Reflect.set(t,n,r,s)}})}}flarum.reg.add("core","common/utils/ItemList",a)},6732:(t,e,n)=>{"use strict";n.d(e,{A:()=>i});var r=n(8805),s=function(t){return t[t.Enter=13]="Enter",t[t.Escape=27]="Escape",t[t.Space=32]="Space",t[t.ArrowUp=38]="ArrowUp",t[t.ArrowDown=40]="ArrowDown",t[t.ArrowLeft=37]="ArrowLeft",t[t.ArrowRight=39]="ArrowRight",t[t.Tab=9]="Tab",t[t.Backspace=8]="Backspace",t}(s||{});class i{constructor(){(0,r.A)(this,"callbacks",new Map),(0,r.A)(this,"whenCallback",(t=>!0))}onUp(t){return this.onDirection(t,s.ArrowUp)}onDown(t){return this.onDirection(t,s.ArrowDown)}onLeft(t){return this.onDirection(t,s.ArrowLeft)}onRight(t){return this.onDirection(t,s.ArrowRight)}onDirection(t,e){return this.callbacks.set(e,(e=>{e.preventDefault(),t(e)})),this}onSelect(t,e){void 0===e&&(e=!1);const n=e=>{e.preventDefault(),t(e)};return e||this.callbacks.set(s.Tab,n),this.callbacks.set(s.Enter,n),this}onTab(t){return this.callbacks.set(9,(e=>{e.preventDefault(),t(e)})),this}onCancel(t){return this.callbacks.set(s.Escape,(e=>{e.stopPropagation(),e.preventDefault(),t(e)})),this}onRemove(t){return this.callbacks.set(s.Backspace,(e=>{e instanceof KeyboardEvent&&e.target instanceof HTMLInputElement&&0===e.target.selectionStart&&0===e.target.selectionEnd&&(t(e),e.preventDefault())})),this}when(t){return this.whenCallback=t,this}bindTo(t){t[0].addEventListener("keydown",this.navigate.bind(this))}navigate(t){if(!this.whenCallback(t))return;const e=this.callbacks.get(t.which);e&&e(t)}}flarum.reg.add("core","common/utils/KeyboardNavigatable",i)},4311:(t,e,n)=>{"use strict";n.d(e,{A:()=>i});var r=n(5263),s=n.n(r);const i=s();flarum.reg.add("core","common/utils/Stream",s())},2202:()=>{Array.prototype.flat||(Array.prototype.flat=function t(e){return(null!=e?e:1)>0?Array.prototype.reduce.call(this,((n,r)=>n.concat(Array.isArray(r)?t.call(r,e-1):r)),[]):[...this]})},4268:(t,e,n)=>{"use strict";function r(t){var e,n,s="";if("string"==typeof t||"number"==typeof t)s+=t;else if("object"==typeof t)if(Array.isArray(t))for(e=0;ei});const s=function(){for(var t,e,n=0,s="";n{"use strict";function r(t,e){const n=t[e];return delete t[e],n}n.d(e,{A:()=>r}),flarum.reg.add("core","common/utils/extract",r)},117:(t,e,n)=>{"use strict";function r(t){return t instanceof Array?t.map((t=>r(t))).join(""):"object"==typeof t&&null!==t?r(t.children):String(t)}n.d(e,{A:()=>r}),flarum.reg.add("core","common/utils/extractText",r)},2967:(t,e,n)=>{"use strict";function r(t){if(!t||t.length<4)return!1;let e=t.replace("#","");return 3===e.length&&(e=e.split("").map((t=>t.repeat(2))).join("")),(299*parseInt(e.slice(0,2),16)+587*parseInt(e.slice(2,4),16)+114*parseInt(e.slice(4,6),16))/1e3<(parseInt(getComputedStyle(document.body).getPropertyValue("--yiq-threshold").trim())||128)}n.d(e,{A:()=>r}),flarum.reg.add("core","common/utils/isDark",r)},9648:(t,e,n)=>{"use strict";function r(t){const e=typeof t;return"function"===e||"object"===e&&!!t}n.d(e,{A:()=>r}),flarum.reg.add("core","common/utils/isObject",r)},1592:()=>{!function(t){"use strict";var e=function(n,r){this.options=t.extend({},e.DEFAULTS,r);var s=this.options.target===e.DEFAULTS.target?t(this.options.target):t(document).find(this.options.target);this.$target=s.on("scroll.bs.affix.data-api",t.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",t.proxy(this.checkPositionWithEventLoop,this)),this.$element=t(n),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};function n(n){return this.each((function(){var r=t(this),s=r.data("bs.affix"),i="object"==typeof n&&n;s||r.data("bs.affix",s=new e(this,i)),"string"==typeof n&&s[n]()}))}e.VERSION="3.4.1",e.RESET="affix affix-top affix-bottom",e.DEFAULTS={offset:0,target:window},e.prototype.getState=function(t,e,n,r){var s=this.$target.scrollTop(),i=this.$element.offset(),a=this.$target.height();if(null!=n&&"top"==this.affixed)return s=t-r&&"bottom"},e.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(e.RESET).addClass("affix");var t=this.$target.scrollTop(),n=this.$element.offset();return this.pinnedOffset=n.top-t},e.prototype.checkPositionWithEventLoop=function(){setTimeout(t.proxy(this.checkPosition,this),1)},e.prototype.checkPosition=function(){if(this.$element.is(":visible")){var n=this.$element.height(),r=this.options.offset,s=r.top,i=r.bottom,a=Math.max(t(document).height(),t(document.body).height());"object"!=typeof r&&(i=s=r),"function"==typeof s&&(s=r.top(this.$element)),"function"==typeof i&&(i=r.bottom(this.$element));var o=this.getState(a,n,s,i);if(this.affixed!=o){null!=this.unpin&&this.$element.css("top","");var l="affix"+(o?"-"+o:""),c=t.Event(l+".bs.affix");if(this.$element.trigger(c),c.isDefaultPrevented())return;this.affixed=o,this.unpin="bottom"==o?this.getPinnedOffset():null,this.$element.removeClass(e.RESET).addClass(l).trigger(l.replace("affix","affixed")+".bs.affix")}"bottom"==o&&this.$element.offset({top:a-n-i})}};var r=t.fn.affix;t.fn.affix=n,t.fn.affix.Constructor=e,t.fn.affix.noConflict=function(){return t.fn.affix=r,this},t(window).on("load",(function(){t('[data-spy="affix"]').each((function(){var e=t(this),r=e.data();r.offset=r.offset||{},null!=r.offsetBottom&&(r.offset.bottom=r.offsetBottom),null!=r.offsetTop&&(r.offset.top=r.offsetTop),n.call(e,r)}))}))}(jQuery)},5941:()=>{!function(t){"use strict";var e='[data-toggle="dropdown"]',n=function(e){t(e).on("click.bs.dropdown",this.toggle)};function r(e){var n=e.attr("data-target");n||(n=(n=e.attr("href"))&&/#[A-Za-z]/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,""));var r="#"!==n?t(document).find(n):null;return r&&r.length?r:e.parent()}function s(n){n&&3===n.which||(t(".dropdown-backdrop").remove(),t(e).each((function(){var e=t(this),s=r(e),i={relatedTarget:this};s.hasClass("open")&&(n&&"click"==n.type&&/input|textarea/i.test(n.target.tagName)&&t.contains(s[0],n.target)||(s.trigger(n=t.Event("hide.bs.dropdown",i)),n.isDefaultPrevented()||(e.attr("aria-expanded","false"),s.removeClass("open").trigger(t.Event("hidden.bs.dropdown",i)))))})))}n.VERSION="3.4.1",n.prototype.toggle=function(e){var n=t(this);if(!n.is(".disabled, :disabled")){var i=r(n),a=i.hasClass("open");if(s(),!a){"ontouchstart"in document.documentElement&&!i.closest(".navbar-nav").length&&t(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(t(this)).on("click",s);var o={relatedTarget:this};if(i.trigger(e=t.Event("show.bs.dropdown",o)),e.isDefaultPrevented())return;n.trigger("focus").attr("aria-expanded","true"),i.toggleClass("open").trigger(t.Event("shown.bs.dropdown",o))}return!1}},n.prototype.keydown=function(n){if(/(38|40|27|32)/.test(n.which)&&!/input|textarea/i.test(n.target.tagName)){var s=t(this);if(n.preventDefault(),n.stopPropagation(),!s.is(".disabled, :disabled")){var i=r(s),a=i.hasClass("open");if(!a&&27!=n.which||a&&27==n.which)return 27==n.which&&i.find(e).trigger("focus"),s.trigger("click");var o=i.find(".dropdown-menu li:not(.disabled):visible a");if(o.length){var l=o.index(n.target);38==n.which&&l>0&&l--,40==n.which&&l{!function(t){"use strict";var e=["sanitize","whiteList","sanitizeFn"],n=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],r=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi,s=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;function i(e,i){var a=e.nodeName.toLowerCase();if(-1!==t.inArray(a,i))return-1===t.inArray(a,n)||Boolean(e.nodeValue.match(r)||e.nodeValue.match(s));for(var o=t(i).filter((function(t,e){return e instanceof RegExp})),l=0,c=o.length;l
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0},sanitize:!0,sanitizeFn:null,whiteList:{"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]}},o.prototype.init=function(e,n,r){if(this.enabled=!0,this.type=e,this.$element=t(n),this.options=this.getOptions(r),this.$viewport=this.options.viewport&&t(document).find(t.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var s=this.options.trigger.split(" "),i=s.length;i--;){var a=s[i];if("click"==a)this.$element.on("click."+this.type,this.options.selector,t.proxy(this.toggle,this));else if("manual"!=a){var o="hover"==a?"mouseenter":"focusin",l="hover"==a?"mouseleave":"focusout";this.$element.on(o+"."+this.type,this.options.selector,t.proxy(this.enter,this)),this.$element.on(l+"."+this.type,this.options.selector,t.proxy(this.leave,this))}}this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},o.prototype.getDefaults=function(){return o.DEFAULTS},o.prototype.getOptions=function(n){var r=this.$element.data();for(var s in r)r.hasOwnProperty(s)&&-1!==t.inArray(s,e)&&delete r[s];return(n=t.extend({},this.getDefaults(),r,n)).delay&&"number"==typeof n.delay&&(n.delay={show:n.delay,hide:n.delay}),n.sanitize&&(n.template=a(n.template,n.whiteList,n.sanitizeFn)),n},o.prototype.getDelegateOptions=function(){var e={},n=this.getDefaults();return this._options&&t.each(this._options,(function(t,r){n[t]!=r&&(e[t]=r)})),e},o.prototype.enter=function(e){var n=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);if(n||(n=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,n)),e instanceof t.Event&&(n.inState["focusin"==e.type?"focus":"hover"]=!0),n.tip().hasClass("in")||"in"==n.hoverState)n.hoverState="in";else{if(clearTimeout(n.timeout),n.hoverState="in",!n.options.delay||!n.options.delay.show)return n.show();n.timeout=setTimeout((function(){"in"==n.hoverState&&n.show()}),n.options.delay.show)}},o.prototype.isInStateTrue=function(){for(var t in this.inState)if(this.inState[t])return!0;return!1},o.prototype.leave=function(e){var n=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);if(n||(n=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,n)),e instanceof t.Event&&(n.inState["focusout"==e.type?"focus":"hover"]=!1),!n.isInStateTrue()){if(clearTimeout(n.timeout),n.hoverState="out",!n.options.delay||!n.options.delay.hide)return n.hide();n.timeout=setTimeout((function(){"out"==n.hoverState&&n.hide()}),n.options.delay.hide)}},o.prototype.show=function(){var e=t.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(e);var n=t.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(e.isDefaultPrevented()||!n)return;var r=this,s=this.tip(),i=this.getUID(this.type);this.setContent(),s.attr("id",i),this.$element.attr("aria-describedby",i),this.options.animation&&s.addClass("fade");var a="function"==typeof this.options.placement?this.options.placement.call(this,s[0],this.$element[0]):this.options.placement,l=/\s?auto?\s?/i,c=l.test(a);c&&(a=a.replace(l,"")||"top"),s.detach().css({top:0,left:0,display:"block"}).addClass(a).data("bs."+this.type,this),this.options.container?s.appendTo(t(document).find(this.options.container)):s.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var u=this.getPosition(),d=s[0].offsetWidth,h=s[0].offsetHeight;if(c){var m=a,p=this.getPosition(this.$viewport);a="bottom"==a&&u.bottom+h>p.bottom?"top":"top"==a&&u.top-hp.width?"left":"left"==a&&u.left-da.top+a.height&&(s.top=a.top+a.height-l)}else{var c=e.left-i,u=e.left+i+n;ca.right&&(s.left=a.left+a.width-u)}return s},o.prototype.getTitle=function(){var t=this.$element,e=this.options;return t.attr("data-original-title")||("function"==typeof e.title?e.title.call(t[0]):e.title)},o.prototype.getUID=function(t){do{t+=~~(1e6*Math.random())}while(document.getElementById(t));return t},o.prototype.tip=function(){if(!this.$tip&&(this.$tip=t(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},o.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},o.prototype.enable=function(){this.enabled=!0},o.prototype.disable=function(){this.enabled=!1},o.prototype.toggleEnabled=function(){this.enabled=!this.enabled},o.prototype.toggle=function(e){var n=this;e&&((n=t(e.currentTarget).data("bs."+this.type))||(n=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,n))),e?(n.inState.click=!n.inState.click,n.isInStateTrue()?n.enter(n):n.leave(n)):n.tip().hasClass("in")?n.leave(n):n.enter(n)},o.prototype.destroy=function(){var t=this;clearTimeout(this.timeout),this.hide((function(){t.$element.off("."+t.type).removeData("bs."+t.type),t.$tip&&t.$tip.detach(),t.$tip=null,t.$arrow=null,t.$viewport=null,t.$element=null}))},o.prototype.sanitizeHtml=function(t){return a(t,this.options.whiteList,this.options.sanitizeFn)};var l=t.fn.tooltip;t.fn.tooltip=function(e){return this.each((function(){var n=t(this),r=n.data("bs.tooltip"),s="object"==typeof e&&e;!r&&/destroy|hide/.test(e)||(r||n.data("bs.tooltip",r=new o(this,s)),"string"==typeof e&&r[e]())}))},t.fn.tooltip.Constructor=o,t.fn.tooltip.noConflict=function(){return t.fn.tooltip=l,this}}(jQuery)},3387:()=>{!function(t){"use strict";t.fn.emulateTransitionEnd=function(e){var n=!1,r=this;return t(this).one("bsTransitionEnd",(function(){n=!0})),setTimeout((function(){n||t(r).trigger(t.support.transition.end)}),e),this},t((function(){t.support.transition=function(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var n in e)if(void 0!==t.style[n])return{end:e[n]};return!1}(),t.support.transition&&(t.event.special.bsTransitionEnd={bindType:t.support.transition.end,delegateType:t.support.transition.end,handle:function(e){if(t(e.target).is(this))return e.handleObj.handler.apply(this,arguments)}})}))}(jQuery)},7514:t=>{var e=function(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),document.body.appendChild(this.canvas),this.width=this.canvas.width=t.width,this.height=this.canvas.height=t.height,this.context.drawImage(t,0,0,this.width,this.height)};e.prototype.clear=function(){this.context.clearRect(0,0,this.width,this.height)},e.prototype.update=function(t){this.context.putImageData(t,0,0)},e.prototype.getPixelCount=function(){return this.width*this.height},e.prototype.getImageData=function(){return this.context.getImageData(0,0,this.width,this.height)},e.prototype.removeCanvas=function(){this.canvas.parentNode.removeChild(this.canvas)};var n=function(){};if(n.prototype.getColor=function(t,e){return this.getPalette(t,5,e)[0]},n.prototype.getPalette=function(t,n,r){void 0===n&&(n=10),(void 0===r||1>r)&&(r=10);for(var i,a,o,l,c=new e(t),u=c.getImageData().data,d=c.getPixelCount(),h=[],m=0;d>m;m+=r)a=u[0+(i=4*m)],o=u[i+1],l=u[i+2],u[i+3]>=125&&(a>250&&o>250&&l>250||h.push([a,o,l]));var p=s.quantize(h,n),f=p?p.palette():null;return c.removeCanvas(),f},!r)var r={map:function(t,e){var n={};return e?t.map((function(t,r){return n.index=r,e.call(n,t)})):t.slice()},naturalOrder:function(t,e){return e>t?-1:t>e?1:0},sum:function(t,e){var n={};return t.reduce(e?function(t,r,s){return n.index=s,t+e.call(n,r)}:function(t,e){return t+e},0)},max:function(t,e){return Math.max.apply(null,e?r.map(t,e):t)}};var s=function(){function t(t,e,n){return(t<<2*l)+(e<>c,s=e[1]>>c,i=e[2]>>c,n=t(r,s,i),a[n]=(a[n]||0)+1})),a}function a(t,e){var r,s,i,a=1e6,o=0,l=1e6,u=0,d=1e6,h=0;return t.forEach((function(t){r=t[0]>>c,s=t[1]>>c,i=t[2]>>c,a>r?a=r:r>o&&(o=r),l>s?l=s:s>u&&(u=s),d>i?d=i:i>h&&(h=i)})),new n(a,o,l,u,d,h,e)}function o(e,n){if(n.count()){var s=n.r2-n.r1+1,i=n.g2-n.g1+1,a=n.b2-n.b1+1,o=r.max([s,i,a]);if(1==n.count())return[n.copy()];var l,c,u,d,h=0,m=[],p=[];if(o==s)for(l=n.r1;l<=n.r2;l++){for(d=0,c=n.g1;c<=n.g2;c++)for(u=n.b1;u<=n.b2;u++)d+=e[t(l,c,u)]||0;h+=d,m[l]=h}else if(o==i)for(l=n.g1;l<=n.g2;l++){for(d=0,c=n.r1;c<=n.r2;c++)for(u=n.b1;u<=n.b2;u++)d+=e[t(c,l,u)]||0;h+=d,m[l]=h}else for(l=n.b1;l<=n.b2;l++){for(d=0,c=n.r1;c<=n.r2;c++)for(u=n.g1;u<=n.g2;u++)d+=e[t(c,u,l)]||0;h+=d,m[l]=h}return m.forEach((function(t,e){p[e]=h-t})),function(t){var e,r,s,i,a,o=t+"1",c=t+"2",u=0;for(l=n[o];l<=n[c];l++)if(m[l]>h/2){for(s=n.copy(),i=n.copy(),e=l-n[o],a=(r=n[c]-l)>=e?Math.min(n[c]-1,~~(l+r/2)):Math.max(n[o],~~(l-1-e/2));!m[a];)a++;for(u=p[a];!u&&m[a-1];)u=p[--a];return s[c]=a,i[o]=s[c]+1,[s,i]}}(o==s?"r":o==i?"g":"b")}}var l=5,c=8-l;return n.prototype={volume:function(t){var e=this;return(!e._volume||t)&&(e._volume=(e.r2-e.r1+1)*(e.g2-e.g1+1)*(e.b2-e.b1+1)),e._volume},count:function(e){var n=this,r=n.histo;if(!n._count_set||e){var s,i,a,o=0;for(s=n.r1;s<=n.r2;s++)for(i=n.g1;i<=n.g2;i++)for(a=n.b1;a<=n.b2;a++)index=t(s,i,a),o+=r[index]||0;n._count=o,n._count_set=!0}return n._count},copy:function(){var t=this;return new n(t.r1,t.r2,t.g1,t.g2,t.b1,t.b2,t.histo)},avg:function(e){var n=this,r=n.histo;if(!n._avg||e){var s,i,a,o,c=0,u=1<<8-l,d=0,h=0,m=0;for(i=n.r1;i<=n.r2;i++)for(a=n.g1;a<=n.g2;a++)for(o=n.b1;o<=n.b2;o++)c+=s=r[t(i,a,o)]||0,d+=s*(i+.5)*u,h+=s*(a+.5)*u,m+=s*(o+.5)*u;n._avg=c?[~~(d/c),~~(h/c),~~(m/c)]:[~~(u*(n.r1+n.r2+1)/2),~~(u*(n.g1+n.g2+1)/2),~~(u*(n.b1+n.b2+1)/2)]}return n._avg},contains:function(t){var e=this,n=t[0]>>c;return gval=t[1]>>c,bval=t[2]>>c,n>=e.r1&&n<=e.r2&&gval>=e.g1&&gval<=e.g2&&bval>=e.b1&&bval<=e.b2}},s.prototype={push:function(t){this.vboxes.push({vbox:t,color:t.avg()})},palette:function(){return this.vboxes.map((function(t){return t.color}))},size:function(){return this.vboxes.size()},map:function(t){for(var e=this.vboxes,n=0;n(n=Math.sqrt(Math.pow(t[0]-s.peek(i).color[0],2)+Math.pow(t[1]-s.peek(i).color[1],2)+Math.pow(t[2]-s.peek(i).color[2],2)))||void 0===e)&&(e=n,r=s.peek(i).color);return r},forcebw:function(){var t=this.vboxes;t.sort((function(t,e){return r.naturalOrder(r.sum(t.color),r.sum(e.color))}));var e=t[0].color;e[0]<5&&e[1]<5&&e[2]<5&&(t[0].color=[0,0,0]);var n=t.length-1,s=t[n].color;s[0]>251&&s[1]>251&&s[2]>251&&(t[n].color=[255,255,255])}},{quantize:function(t,n){function l(t,e){for(var n,r=1,s=0;1e3>s;)if((n=t.pop()).count()){var i=o(c,n),a=i[0],l=i[1];if(!a)return;if(t.push(a),l&&(t.push(l),r++),r>=e)return;if(s++>1e3)return}else t.push(n),s++}if(!t.length||2>n||n>256)return!1;var c=i(t);c.forEach((function(){}));var u=a(t,c),d=new e((function(t,e){return r.naturalOrder(t.count(),e.count())}));d.push(u),l(d,.75*n);for(var h=new e((function(t,e){return r.naturalOrder(t.count()*t.volume(),e.count()*e.volume())}));d.size();)h.push(d.pop());l(h,n-h.size());for(var m=new s;h.size();)m.push(h.pop());return m}}}();t.exports=n},1720:function(t){t.exports=function(){"use strict";var t=6e4,e=36e5,n="millisecond",r="second",s="minute",i="hour",a="day",o="week",l="month",c="quarter",u="year",d="date",h="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,f={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},g=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:g,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),s=n%60;return(e<=0?"+":"-")+g(r,2,"0")+":"+g(s,2,"0")},m:function t(e,n){if(e.date()1)return t(a[0])}else{var o=e.name;y[o]=e,s=o}return!r&&s&&(b=s),s||!r&&b},_=function(t,e){if(A(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new S(n)},N=v;N.l=x,N.i=A,N.w=function(t,e){return _(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var S=function(){function f(t){this.$L=x(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[w]=!0}var g=f.prototype;return g.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(N.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(m);if(r){var s=r[2]-1||0,i=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],s,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)):new Date(r[1],s,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)}}return new Date(e)}(t),this.init()},g.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},g.$utils=function(){return N},g.isValid=function(){return!(this.$d.toString()===h)},g.isSame=function(t,e){var n=_(t);return this.startOf(e)<=n&&n<=this.endOf(e)},g.isAfter=function(t,e){return _(t)0,g<=f.r||!f.r){g<=1&&p>0&&(f=h[p-1]);var v=d[f.l];o&&(g=o(""+g)),c="string"==typeof v?v.replace("%d",g):v(g,r,f.l,u);break}}if(r)return c;var b=u?d.future:d.past;return"function"==typeof b?b(c):b.replace("%s",c)},r.to=function(t,e){return i(t,e,this,!0)},r.from=function(t,e){return i(t,e,this)};var a=function(t){return t.$u?n.utc():n()};r.toNow=function(t){return this.to(a(this),t)},r.fromNow=function(t){return this.from(a(this),t)}}}()},5187:(t,e,n)=>{"use strict";t.exports=function(){if("object"==typeof globalThis)return globalThis;var t;try{t=this||new Function("return this")()}catch(t){if("object"==typeof window)return window;if("object"==typeof self)return self;if(void 0!==n.g)return n.g}return t}()},2894:function(){!function(t){function e(e){if("string"==typeof e.data&&(e.data={keys:e.data}),e.data&&e.data.keys&&"string"==typeof e.data.keys){var n=e.handler,r=e.data.keys.toLowerCase().split(" ");e.handler=function(e){if(this===e.target||!(t.hotkeys.options.filterInputAcceptingElements&&t.hotkeys.textInputTypes.test(e.target.nodeName)||t.hotkeys.options.filterContentEditable&&t(e.target).attr("contenteditable")||t.hotkeys.options.filterTextInputs&&t.inArray(e.target.type,t.hotkeys.textAcceptingInputTypes)>-1)){var s="keypress"!==e.type&&t.hotkeys.specialKeys[e.which],i=String.fromCharCode(e.which).toLowerCase(),a="",o={};t.each(["alt","ctrl","shift"],(function(t,n){e[n+"Key"]&&s!==n&&(a+=n+"+")})),e.metaKey&&!e.ctrlKey&&"meta"!==s&&(a+="meta+"),e.metaKey&&"meta"!==s&&a.indexOf("alt+ctrl+shift+")>-1&&(a=a.replace("alt+ctrl+shift+","hyper+")),s?o[a+s]=!0:(o[a+i]=!0,o[a+t.hotkeys.shiftNums[i]]=!0,"shift+"===a&&(o[t.hotkeys.shiftNums[i]]=!0));for(var l=0,c=r.length;l","/":"?","\\":"|"},textAcceptingInputTypes:["text","password","number","email","url","range","date","month","week","time","datetime","datetime-local","search","color","tel"],textInputTypes:/textarea|input|select/i,options:{filterInputAcceptingElements:!0,filterTextInputs:!0,filterContentEditable:!0}},t.each(["keydown","keyup","keypress"],(function(){t.event.special[this]={add:e}}))}(jQuery||this.jQuery||window.jQuery)},1963:function(t,e){var n;!function(e,n){"use strict";"object"==typeof t.exports?t.exports=e.document?n(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return n(t)}:n(e)}("undefined"!=typeof window?window:this,(function(r,s){"use strict";var i=[],a=Object.getPrototypeOf,o=i.slice,l=i.flat?function(t){return i.flat.call(t)}:function(t){return i.concat.apply([],t)},c=i.push,u=i.indexOf,d={},h=d.toString,m=d.hasOwnProperty,p=m.toString,f=p.call(Object),g={},v=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType&&"function"!=typeof t.item},b=function(t){return null!=t&&t===t.window},y=r.document,w={type:!0,src:!0,nonce:!0,noModule:!0};function A(t,e,n){var r,s,i=(n=n||y).createElement("script");if(i.text=t,e)for(r in w)(s=e[r]||e.getAttribute&&e.getAttribute(r))&&i.setAttribute(r,s);n.head.appendChild(i).parentNode.removeChild(i)}function x(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?d[h.call(t)]||"object":typeof t}var _="3.7.1",N=/HTML$/i,S=function(t,e){return new S.fn.init(t,e)};function E(t){var e=!!t&&"length"in t&&t.length,n=x(t);return!v(t)&&!b(t)&&("array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t)}function k(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}S.fn=S.prototype={jquery:_,constructor:S,length:0,toArray:function(){return o.call(this)},get:function(t){return null==t?o.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=S.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return S.each(this,t)},map:function(t){return this.pushStack(S.map(this,(function(e,n){return t.call(e,n,e)})))},slice:function(){return this.pushStack(o.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,(function(t,e){return(e+1)%2})))},odd:function(){return this.pushStack(S.grep(this,(function(t,e){return e%2})))},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n+~]|"+D+")"+D+"*"),H=new RegExp(D+"|>"),q=new RegExp(B),U=new RegExp("^"+M+"$"),G={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+B),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+D+"*(even|odd|(([+-]|)(\\d*)n|)"+D+"*(?:([+-]|)"+D+"*(\\d+)|))"+D+"*\\)|)","i"),bool:new RegExp("^(?:"+E+")$","i"),needsContext:new RegExp("^"+D+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+D+"*((?:-\\d)?\\d*)"+D+"*\\)|)(?=[^-]|$)","i")},z=/^(?:input|select|textarea|button)$/i,W=/^h\d$/i,V=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,K=/[+~]/,Y=new RegExp("\\\\[\\da-fA-F]{1,6}"+D+"?|\\\\([^\\r\\n\\f])","g"),Q=function(t,e){var n="0x"+t.slice(1)-65536;return e||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},J=function(){lt()},X=ht((function(t){return!0===t.disabled&&k(t,"fieldset")}),{dir:"parentNode",next:"legend"});try{f.apply(i=o.call(L.childNodes),L.childNodes),i[L.childNodes.length].nodeType}catch(t){f={apply:function(t,e){j.apply(t,o.call(e))},call:function(t){j.apply(t,o.call(arguments,1))}}}function Z(t,e,n,r){var s,i,a,o,c,u,m,p=e&&e.ownerDocument,b=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==b&&9!==b&&11!==b)return n;if(!r&&(lt(e),e=e||l,d)){if(11!==b&&(c=V.exec(t)))if(s=c[1]){if(9===b){if(!(a=e.getElementById(s)))return n;if(a.id===s)return f.call(n,a),n}else if(p&&(a=p.getElementById(s))&&Z.contains(e,a)&&a.id===s)return f.call(n,a),n}else{if(c[2])return f.apply(n,e.getElementsByTagName(t)),n;if((s=c[3])&&e.getElementsByClassName)return f.apply(n,e.getElementsByClassName(s)),n}if(!(_[t+" "]||h&&h.test(t))){if(m=t,p=e,1===b&&(H.test(t)||F.test(t))){for((p=K.test(t)&&ot(e.parentNode)||e)==e&&g.scope||((o=e.getAttribute("id"))?o=S.escapeSelector(o):e.setAttribute("id",o=v)),i=(u=ut(t)).length;i--;)u[i]=(o?"#"+o:":scope")+" "+dt(u[i]);m=u.join(",")}try{return f.apply(n,p.querySelectorAll(m)),n}catch(e){_(t,!0)}finally{o===v&&e.removeAttribute("id")}}}return bt(t.replace(O,"$1"),e,n,r)}function tt(){var t=[];return function n(r,s){return t.push(r+" ")>e.cacheLength&&delete n[t.shift()],n[r+" "]=s}}function et(t){return t[v]=!0,t}function nt(t){var e=l.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function rt(t){return function(e){return k(e,"input")&&e.type===t}}function st(t){return function(e){return(k(e,"input")||k(e,"button"))&&e.type===t}}function it(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&X(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function at(t){return et((function(e){return e=+e,et((function(n,r){for(var s,i=t([],n.length,e),a=i.length;a--;)n[s=i[a]]&&(n[s]=!(r[s]=n[s]))}))}))}function ot(t){return t&&void 0!==t.getElementsByTagName&&t}function lt(t){var n,r=t?t.ownerDocument||t:L;return r!=l&&9===r.nodeType&&r.documentElement?(c=(l=r).documentElement,d=!S.isXMLDoc(l),p=c.matches||c.webkitMatchesSelector||c.msMatchesSelector,c.msMatchesSelector&&L!=l&&(n=l.defaultView)&&n.top!==n&&n.addEventListener("unload",J),g.getById=nt((function(t){return c.appendChild(t).id=S.expando,!l.getElementsByName||!l.getElementsByName(S.expando).length})),g.disconnectedMatch=nt((function(t){return p.call(t,"*")})),g.scope=nt((function(){return l.querySelectorAll(":scope")})),g.cssHas=nt((function(){try{return l.querySelector(":has(*,:jqfake)"),!1}catch(t){return!0}})),g.getById?(e.filter.ID=function(t){var e=t.replace(Y,Q);return function(t){return t.getAttribute("id")===e}},e.find.ID=function(t,e){if(void 0!==e.getElementById&&d){var n=e.getElementById(t);return n?[n]:[]}}):(e.filter.ID=function(t){var e=t.replace(Y,Q);return function(t){var n=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},e.find.ID=function(t,e){if(void 0!==e.getElementById&&d){var n,r,s,i=e.getElementById(t);if(i){if((n=i.getAttributeNode("id"))&&n.value===t)return[i];for(s=e.getElementsByName(t),r=0;i=s[r++];)if((n=i.getAttributeNode("id"))&&n.value===t)return[i]}return[]}}),e.find.TAG=function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):e.querySelectorAll(t)},e.find.CLASS=function(t,e){if(void 0!==e.getElementsByClassName&&d)return e.getElementsByClassName(t)},h=[],nt((function(t){var e;c.appendChild(t).innerHTML="",t.querySelectorAll("[selected]").length||h.push("\\["+D+"*(?:value|"+E+")"),t.querySelectorAll("[id~="+v+"-]").length||h.push("~="),t.querySelectorAll("a#"+v+"+*").length||h.push(".#.+[+~]"),t.querySelectorAll(":checked").length||h.push(":checked"),(e=l.createElement("input")).setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),c.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&h.push(":enabled",":disabled"),(e=l.createElement("input")).setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||h.push("\\["+D+"*name"+D+"*="+D+"*(?:''|\"\")")})),g.cssHas||h.push(":has"),h=h.length&&new RegExp(h.join("|")),N=function(t,e){if(t===e)return a=!0,0;var n=!t.compareDocumentPosition-!e.compareDocumentPosition;return n||(1&(n=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!g.sortDetached&&e.compareDocumentPosition(t)===n?t===l||t.ownerDocument==L&&Z.contains(L,t)?-1:e===l||e.ownerDocument==L&&Z.contains(L,e)?1:s?u.call(s,t)-u.call(s,e):0:4&n?-1:1)},l):l}for(t in Z.matches=function(t,e){return Z(t,null,null,e)},Z.matchesSelector=function(t,e){if(lt(t),d&&!_[e+" "]&&(!h||!h.test(e)))try{var n=p.call(t,e);if(n||g.disconnectedMatch||t.document&&11!==t.document.nodeType)return n}catch(t){_(e,!0)}return Z(e,l,null,[t]).length>0},Z.contains=function(t,e){return(t.ownerDocument||t)!=l&<(t),S.contains(t,e)},Z.attr=function(t,n){(t.ownerDocument||t)!=l&<(t);var r=e.attrHandle[n.toLowerCase()],s=r&&m.call(e.attrHandle,n.toLowerCase())?r(t,n,!d):void 0;return void 0!==s?s:t.getAttribute(n)},Z.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},S.uniqueSort=function(t){var e,n=[],r=0,i=0;if(a=!g.sortStable,s=!g.sortStable&&o.call(t,0),C.call(t,N),a){for(;e=t[i++];)e===t[i]&&(r=n.push(i));for(;r--;)P.call(t,n[r],1)}return s=null,t},S.fn.uniqueSort=function(){return this.pushStack(S.uniqueSort(o.apply(this)))},e=S.expr={cacheLength:50,createPseudo:et,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(Y,Q),t[3]=(t[3]||t[4]||t[5]||"").replace(Y,Q),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||Z.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&Z.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return G.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&q.test(n)&&(e=ut(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(Y,Q).toLowerCase();return"*"===t?function(){return!0}:function(t){return k(t,e)}},CLASS:function(t){var e=w[t+" "];return e||(e=new RegExp("(^|"+D+")"+t+"("+D+"|$)"))&&w(t,(function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(r){var s=Z.attr(r,t);return null==s?"!="===e:!e||(s+="","="===e?s===n:"!="===e?s!==n:"^="===e?n&&0===s.indexOf(n):"*="===e?n&&s.indexOf(n)>-1:"$="===e?n&&s.slice(-n.length)===n:"~="===e?(" "+s.replace(R," ")+" ").indexOf(n)>-1:"|="===e&&(s===n||s.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,r,s){var i="nth"!==t.slice(0,3),a="last"!==t.slice(-4),o="of-type"===e;return 1===r&&0===s?function(t){return!!t.parentNode}:function(e,n,l){var c,u,d,h,m,p=i!==a?"nextSibling":"previousSibling",f=e.parentNode,g=o&&e.nodeName.toLowerCase(),y=!l&&!o,w=!1;if(f){if(i){for(;p;){for(d=e;d=d[p];)if(o?k(d,g):1===d.nodeType)return!1;m=p="only"===t&&!m&&"nextSibling"}return!0}if(m=[a?f.firstChild:f.lastChild],a&&y){for(w=(h=(c=(u=f[v]||(f[v]={}))[t]||[])[0]===b&&c[1])&&c[2],d=h&&f.childNodes[h];d=++h&&d&&d[p]||(w=h=0)||m.pop();)if(1===d.nodeType&&++w&&d===e){u[t]=[b,h,w];break}}else if(y&&(w=h=(c=(u=e[v]||(e[v]={}))[t]||[])[0]===b&&c[1]),!1===w)for(;(d=++h&&d&&d[p]||(w=h=0)||m.pop())&&(!(o?k(d,g):1===d.nodeType)||!++w||(y&&((u=d[v]||(d[v]={}))[t]=[b,w]),d!==e)););return(w-=s)===r||w%r==0&&w/r>=0}}},PSEUDO:function(t,n){var r,s=e.pseudos[t]||e.setFilters[t.toLowerCase()]||Z.error("unsupported pseudo: "+t);return s[v]?s(n):s.length>1?(r=[t,t,"",n],e.setFilters.hasOwnProperty(t.toLowerCase())?et((function(t,e){for(var r,i=s(t,n),a=i.length;a--;)t[r=u.call(t,i[a])]=!(e[r]=i[a])})):function(t){return s(t,0,r)}):s}},pseudos:{not:et((function(t){var e=[],n=[],r=vt(t.replace(O,"$1"));return r[v]?et((function(t,e,n,s){for(var i,a=r(t,null,s,[]),o=t.length;o--;)(i=a[o])&&(t[o]=!(e[o]=i))})):function(t,s,i){return e[0]=t,r(e,null,i,n),e[0]=null,!n.pop()}})),has:et((function(t){return function(e){return Z(t,e).length>0}})),contains:et((function(t){return t=t.replace(Y,Q),function(e){return(e.textContent||S.text(e)).indexOf(t)>-1}})),lang:et((function(t){return U.test(t||"")||Z.error("unsupported lang: "+t),t=t.replace(Y,Q).toLowerCase(),function(e){var n;do{if(n=d?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(t){var e=r.location&&r.location.hash;return e&&e.slice(1)===t.id},root:function(t){return t===c},focus:function(t){return t===function(){try{return l.activeElement}catch(t){}}()&&l.hasFocus()&&!!(t.type||t.href||~t.tabIndex)},enabled:it(!1),disabled:it(!0),checked:function(t){return k(t,"input")&&!!t.checked||k(t,"option")&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!e.pseudos.empty(t)},header:function(t){return W.test(t.nodeName)},input:function(t){return z.test(t.nodeName)},button:function(t){return k(t,"input")&&"button"===t.type||k(t,"button")},text:function(t){var e;return k(t,"input")&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:at((function(){return[0]})),last:at((function(t,e){return[e-1]})),eq:at((function(t,e,n){return[n<0?n+e:n]})),even:at((function(t,e){for(var n=0;ne?e:n;--r>=0;)t.push(r);return t})),gt:at((function(t,e,n){for(var r=n<0?n+e:n;++r1?function(e,n,r){for(var s=t.length;s--;)if(!t[s](e,n,r))return!1;return!0}:t[0]}function pt(t,e,n,r,s){for(var i,a=[],o=0,l=t.length,c=null!=e;o-1&&(i[c]=!(a[c]=h))}}else m=pt(m===a?m.splice(v,m.length):m),s?s(null,a,m,l):f.apply(a,m)}))}function gt(t){for(var r,s,i,a=t.length,o=e.relative[t[0].type],l=o||e.relative[" "],c=o?1:0,d=ht((function(t){return t===r}),l,!0),h=ht((function(t){return u.call(r,t)>-1}),l,!0),m=[function(t,e,s){var i=!o&&(s||e!=n)||((r=e).nodeType?d(t,e,s):h(t,e,s));return r=null,i}];c1&&mt(m),c>1&&dt(t.slice(0,c-1).concat({value:" "===t[c-2].type?"*":""})).replace(O,"$1"),s,c0,i=t.length>0,a=function(a,o,c,u,h){var m,p,g,v=0,y="0",w=a&&[],A=[],x=n,_=a||i&&e.find.TAG("*",h),N=b+=null==x?1:Math.random()||.1,E=_.length;for(h&&(n=o==l||o||h);y!==E&&null!=(m=_[y]);y++){if(i&&m){for(p=0,o||m.ownerDocument==l||(lt(m),c=!d);g=t[p++];)if(g(m,o||l,c)){f.call(u,m);break}h&&(b=N)}s&&((m=!g&&m)&&v--,a&&w.push(m))}if(v+=y,s&&y!==v){for(p=0;g=r[p++];)g(w,A,o,c);if(a){if(v>0)for(;y--;)w[y]||A[y]||(A[y]=T.call(u));A=pt(A)}f.apply(u,A),h&&!a&&A.length>0&&v+r.length>1&&S.uniqueSort(u)}return h&&(b=N,n=x),w};return s?et(a):a}(a,i)),o.selector=t}return o}function bt(t,n,r,s){var i,a,o,l,c,u="function"==typeof t&&t,h=!s&&ut(t=u.selector||t);if(r=r||[],1===h.length){if((a=h[0]=h[0].slice(0)).length>2&&"ID"===(o=a[0]).type&&9===n.nodeType&&d&&e.relative[a[1].type]){if(!(n=(e.find.ID(o.matches[0].replace(Y,Q),n)||[])[0]))return r;u&&(n=n.parentNode),t=t.slice(a.shift().value.length)}for(i=G.needsContext.test(t)?0:a.length;i--&&(o=a[i],!e.relative[l=o.type]);)if((c=e.find[l])&&(s=c(o.matches[0].replace(Y,Q),K.test(a[0].type)&&ot(n.parentNode)||n))){if(a.splice(i,1),!(t=s.length&&dt(a)))return f.apply(r,s),r;break}}return(u||vt(t,h))(s,n,!d,r,!n||K.test(t)&&ot(n.parentNode)||n),r}ct.prototype=e.filters=e.pseudos,e.setFilters=new ct,g.sortStable=v.split("").sort(N).join("")===v,lt(),g.sortDetached=nt((function(t){return 1&t.compareDocumentPosition(l.createElement("fieldset"))})),S.find=Z,S.expr[":"]=S.expr.pseudos,S.unique=S.uniqueSort,Z.compile=vt,Z.select=bt,Z.setDocument=lt,Z.tokenize=ut,Z.escape=S.escapeSelector,Z.getText=S.text,Z.isXML=S.isXMLDoc,Z.selectors=S.expr,Z.support=S.support,Z.uniqueSort=S.uniqueSort}();var B=function(t,e,n){for(var r=[],s=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(s&&S(t).is(n))break;r.push(t)}return r},R=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},$=S.expr.match.needsContext,F=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function H(t,e,n){return v(e)?S.grep(t,(function(t,r){return!!e.call(t,r,t)!==n})):e.nodeType?S.grep(t,(function(t){return t===e!==n})):"string"!=typeof e?S.grep(t,(function(t){return u.call(e,t)>-1!==n})):S.filter(e,t,n)}S.filter=function(t,e,n){var r=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===r.nodeType?S.find.matchesSelector(r,t)?[r]:[]:S.find.matches(t,S.grep(e,(function(t){return 1===t.nodeType})))},S.fn.extend({find:function(t){var e,n,r=this.length,s=this;if("string"!=typeof t)return this.pushStack(S(t).filter((function(){for(e=0;e1?S.uniqueSort(n):n},filter:function(t){return this.pushStack(H(this,t||[],!1))},not:function(t){return this.pushStack(H(this,t||[],!0))},is:function(t){return!!H(this,"string"==typeof t&&$.test(t)?S(t):t||[],!1).length}});var q,U=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(t,e,n){var r,s;if(!t)return this;if(n=n||q,"string"==typeof t){if(!(r="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:U.exec(t))||!r[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(r[1]){if(e=e instanceof S?e[0]:e,S.merge(this,S.parseHTML(r[1],e&&e.nodeType?e.ownerDocument||e:y,!0)),F.test(r[1])&&S.isPlainObject(e))for(r in e)v(this[r])?this[r](e[r]):this.attr(r,e[r]);return this}return(s=y.getElementById(r[2]))&&(this[0]=s,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):v(t)?void 0!==n.ready?n.ready(t):t(S):S.makeArray(t,this)}).prototype=S.fn,q=S(y);var G=/^(?:parents|prev(?:Until|All))/,z={children:!0,contents:!0,next:!0,prev:!0};function W(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}S.fn.extend({has:function(t){var e=S(t,this),n=e.length;return this.filter((function(){for(var t=0;t-1:1===n.nodeType&&S.find.matchesSelector(n,t))){i.push(n);break}return this.pushStack(i.length>1?S.uniqueSort(i):i)},index:function(t){return t?"string"==typeof t?u.call(S(t),this[0]):u.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),S.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return B(t,"parentNode")},parentsUntil:function(t,e,n){return B(t,"parentNode",n)},next:function(t){return W(t,"nextSibling")},prev:function(t){return W(t,"previousSibling")},nextAll:function(t){return B(t,"nextSibling")},prevAll:function(t){return B(t,"previousSibling")},nextUntil:function(t,e,n){return B(t,"nextSibling",n)},prevUntil:function(t,e,n){return B(t,"previousSibling",n)},siblings:function(t){return R((t.parentNode||{}).firstChild,t)},children:function(t){return R(t.firstChild)},contents:function(t){return null!=t.contentDocument&&a(t.contentDocument)?t.contentDocument:(k(t,"template")&&(t=t.content||t),S.merge([],t.childNodes))}},(function(t,e){S.fn[t]=function(n,r){var s=S.map(this,e,n);return"Until"!==t.slice(-5)&&(r=n),r&&"string"==typeof r&&(s=S.filter(r,s)),this.length>1&&(z[t]||S.uniqueSort(s),G.test(t)&&s.reverse()),this.pushStack(s)}}));var V=/[^\x20\t\r\n\f]+/g;function K(t){return t}function Y(t){throw t}function Q(t,e,n,r){var s;try{t&&v(s=t.promise)?s.call(t).done(e).fail(n):t&&v(s=t.then)?s.call(t,e,n):e.apply(void 0,[t].slice(r))}catch(t){n.apply(void 0,[t])}}S.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return S.each(t.match(V)||[],(function(t,n){e[n]=!0})),e}(t):S.extend({},t);var e,n,r,s,i=[],a=[],o=-1,l=function(){for(s=s||t.once,r=e=!0;a.length;o=-1)for(n=a.shift();++o-1;)i.splice(n,1),n<=o&&o--})),this},has:function(t){return t?S.inArray(t,i)>-1:i.length>0},empty:function(){return i&&(i=[]),this},disable:function(){return s=a=[],i=n="",this},disabled:function(){return!i},lock:function(){return s=a=[],n||e||(i=n=""),this},locked:function(){return!!s},fireWith:function(t,n){return s||(n=[t,(n=n||[]).slice?n.slice():n],a.push(n),e||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},S.extend({Deferred:function(t){var e=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],n="pending",s={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},catch:function(t){return s.then(null,t)},pipe:function(){var t=arguments;return S.Deferred((function(n){S.each(e,(function(e,r){var s=v(t[r[4]])&&t[r[4]];i[r[1]]((function(){var t=s&&s.apply(this,arguments);t&&v(t.promise)?t.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,s?[t]:arguments)}))})),t=null})).promise()},then:function(t,n,s){var i=0;function a(t,e,n,s){return function(){var o=this,l=arguments,c=function(){var r,c;if(!(t=i&&(n!==Y&&(o=void 0,l=[r]),e.rejectWith(o,l))}};t?u():(S.Deferred.getErrorHook?u.error=S.Deferred.getErrorHook():S.Deferred.getStackHook&&(u.error=S.Deferred.getStackHook()),r.setTimeout(u))}}return S.Deferred((function(r){e[0][3].add(a(0,r,v(s)?s:K,r.notifyWith)),e[1][3].add(a(0,r,v(t)?t:K)),e[2][3].add(a(0,r,v(n)?n:Y))})).promise()},promise:function(t){return null!=t?S.extend(t,s):s}},i={};return S.each(e,(function(t,r){var a=r[2],o=r[5];s[r[1]]=a.add,o&&a.add((function(){n=o}),e[3-t][2].disable,e[3-t][3].disable,e[0][2].lock,e[0][3].lock),a.add(r[3].fire),i[r[0]]=function(){return i[r[0]+"With"](this===i?void 0:this,arguments),this},i[r[0]+"With"]=a.fireWith})),s.promise(i),t&&t.call(i,i),i},when:function(t){var e=arguments.length,n=e,r=Array(n),s=o.call(arguments),i=S.Deferred(),a=function(t){return function(n){r[t]=this,s[t]=arguments.length>1?o.call(arguments):n,--e||i.resolveWith(r,s)}};if(e<=1&&(Q(t,i.done(a(n)).resolve,i.reject,!e),"pending"===i.state()||v(s[n]&&s[n].then)))return i.then();for(;n--;)Q(s[n],a(n),i.reject);return i.promise()}});var J=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(t,e){r.console&&r.console.warn&&t&&J.test(t.name)&&r.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},S.readyException=function(t){r.setTimeout((function(){throw t}))};var X=S.Deferred();function Z(){y.removeEventListener("DOMContentLoaded",Z),r.removeEventListener("load",Z),S.ready()}S.fn.ready=function(t){return X.then(t).catch((function(t){S.readyException(t)})),this},S.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--S.readyWait:S.isReady)||(S.isReady=!0,!0!==t&&--S.readyWait>0||X.resolveWith(y,[S]))}}),S.ready.then=X.then,"complete"===y.readyState||"loading"!==y.readyState&&!y.documentElement.doScroll?r.setTimeout(S.ready):(y.addEventListener("DOMContentLoaded",Z),r.addEventListener("load",Z));var tt=function(t,e,n,r,s,i,a){var o=0,l=t.length,c=null==n;if("object"===x(n))for(o in s=!0,n)tt(t,e,o,n[o],!0,i,a);else if(void 0!==r&&(s=!0,v(r)||(a=!0),c&&(a?(e.call(t,r),e=null):(c=e,e=function(t,e,n){return c.call(S(t),n)})),e))for(;o1,null,!0)},removeData:function(t){return this.each((function(){lt.remove(this,t)}))}}),S.extend({queue:function(t,e,n){var r;if(t)return e=(e||"fx")+"queue",r=ot.get(t,e),n&&(!r||Array.isArray(n)?r=ot.access(t,e,S.makeArray(n)):r.push(n)),r||[]},dequeue:function(t,e){e=e||"fx";var n=S.queue(t,e),r=n.length,s=n.shift(),i=S._queueHooks(t,e);"inprogress"===s&&(s=n.shift(),r--),s&&("fx"===e&&n.unshift("inprogress"),delete i.stop,s.call(t,(function(){S.dequeue(t,e)}),i)),!r&&i&&i.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return ot.get(t,n)||ot.access(t,n,{empty:S.Callbacks("once memory").add((function(){ot.remove(t,[e+"queue",n])}))})}}),S.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length\x20\t\r\n\f]*)/i,kt=/^$|^module$|\/(?:java|ecma)script/i;_t=y.createDocumentFragment().appendChild(y.createElement("div")),(Nt=y.createElement("input")).setAttribute("type","radio"),Nt.setAttribute("checked","checked"),Nt.setAttribute("name","t"),_t.appendChild(Nt),g.checkClone=_t.cloneNode(!0).cloneNode(!0).lastChild.checked,_t.innerHTML="",g.noCloneChecked=!!_t.cloneNode(!0).lastChild.defaultValue,_t.innerHTML="",g.option=!!_t.lastChild;var Tt={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function Ct(t,e){var n;return n=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&k(t,e)?S.merge([t],n):n}function Pt(t,e){for(var n=0,r=t.length;n",""]);var Dt=/<|&#?\w+;/;function Ot(t,e,n,r,s){for(var i,a,o,l,c,u,d=e.createDocumentFragment(),h=[],m=0,p=t.length;m-1)s&&s.push(i);else if(c=gt(i),a=Ct(d.appendChild(i),"script"),c&&Pt(a),n)for(u=0;i=a[u++];)kt.test(i.type||"")&&n.push(i);return d}var Mt=/^([^.]*)(?:\.(.+)|)/;function It(){return!0}function Lt(){return!1}function jt(t,e,n,r,s,i){var a,o;if("object"==typeof e){for(o in"string"!=typeof n&&(r=r||n,n=void 0),e)jt(t,o,n,r,e[o],i);return t}if(null==r&&null==s?(s=n,r=n=void 0):null==s&&("string"==typeof n?(s=r,r=void 0):(s=r,r=n,n=void 0)),!1===s)s=Lt;else if(!s)return t;return 1===i&&(a=s,s=function(t){return S().off(t),a.apply(this,arguments)},s.guid=a.guid||(a.guid=S.guid++)),t.each((function(){S.event.add(this,e,s,r,n)}))}function Bt(t,e,n){n?(ot.set(t,e,!1),S.event.add(t,e,{namespace:!1,handler:function(t){var n,r=ot.get(this,e);if(1&t.isTrigger&&this[e]){if(r)(S.event.special[e]||{}).delegateType&&t.stopPropagation();else if(r=o.call(arguments),ot.set(this,e,r),this[e](),n=ot.get(this,e),ot.set(this,e,!1),r!==n)return t.stopImmediatePropagation(),t.preventDefault(),n}else r&&(ot.set(this,e,S.event.trigger(r[0],r.slice(1),this)),t.stopPropagation(),t.isImmediatePropagationStopped=It)}})):void 0===ot.get(t,e)&&S.event.add(t,e,It)}S.event={global:{},add:function(t,e,n,r,s){var i,a,o,l,c,u,d,h,m,p,f,g=ot.get(t);if(it(t))for(n.handler&&(n=(i=n).handler,s=i.selector),s&&S.find.matchesSelector(ft,s),n.guid||(n.guid=S.guid++),(l=g.events)||(l=g.events=Object.create(null)),(a=g.handle)||(a=g.handle=function(e){return void 0!==S&&S.event.triggered!==e.type?S.event.dispatch.apply(t,arguments):void 0}),c=(e=(e||"").match(V)||[""]).length;c--;)m=f=(o=Mt.exec(e[c])||[])[1],p=(o[2]||"").split(".").sort(),m&&(d=S.event.special[m]||{},m=(s?d.delegateType:d.bindType)||m,d=S.event.special[m]||{},u=S.extend({type:m,origType:f,data:r,handler:n,guid:n.guid,selector:s,needsContext:s&&S.expr.match.needsContext.test(s),namespace:p.join(".")},i),(h=l[m])||((h=l[m]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(t,r,p,a)||t.addEventListener&&t.addEventListener(m,a)),d.add&&(d.add.call(t,u),u.handler.guid||(u.handler.guid=n.guid)),s?h.splice(h.delegateCount++,0,u):h.push(u),S.event.global[m]=!0)},remove:function(t,e,n,r,s){var i,a,o,l,c,u,d,h,m,p,f,g=ot.hasData(t)&&ot.get(t);if(g&&(l=g.events)){for(c=(e=(e||"").match(V)||[""]).length;c--;)if(m=f=(o=Mt.exec(e[c])||[])[1],p=(o[2]||"").split(".").sort(),m){for(d=S.event.special[m]||{},h=l[m=(r?d.delegateType:d.bindType)||m]||[],o=o[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=i=h.length;i--;)u=h[i],!s&&f!==u.origType||n&&n.guid!==u.guid||o&&!o.test(u.namespace)||r&&r!==u.selector&&("**"!==r||!u.selector)||(h.splice(i,1),u.selector&&h.delegateCount--,d.remove&&d.remove.call(t,u));a&&!h.length&&(d.teardown&&!1!==d.teardown.call(t,p,g.handle)||S.removeEvent(t,m,g.handle),delete l[m])}else for(m in l)S.event.remove(t,m+e[c],n,r,!0);S.isEmptyObject(l)&&ot.remove(t,"handle events")}},dispatch:function(t){var e,n,r,s,i,a,o=new Array(arguments.length),l=S.event.fix(t),c=(ot.get(this,"events")||Object.create(null))[l.type]||[],u=S.event.special[l.type]||{};for(o[0]=l,e=1;e=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==t.type||!0!==c.disabled)){for(i=[],a={},n=0;n-1:S.find(s,this,null,[c]).length),a[s]&&i.push(r);i.length&&o.push({elem:c,handlers:i})}return c=this,l\s*$/g;function Ht(t,e){return k(t,"table")&&k(11!==e.nodeType?e:e.firstChild,"tr")&&S(t).children("tbody")[0]||t}function qt(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Ut(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Gt(t,e){var n,r,s,i,a,o;if(1===e.nodeType){if(ot.hasData(t)&&(o=ot.get(t).events))for(s in ot.remove(e,"handle events"),o)for(n=0,r=o[s].length;n1&&"string"==typeof p&&!g.checkClone&&$t.test(p))return t.each((function(s){var i=t.eq(s);f&&(e[0]=p.call(this,s,i.html())),Wt(i,e,n,r)}));if(h&&(i=(s=Ot(e,t[0].ownerDocument,!1,t,r)).firstChild,1===s.childNodes.length&&(s=i),i||r)){for(o=(a=S.map(Ct(s,"script"),qt)).length;d0&&Pt(a,!l&&Ct(t,"script")),o},cleanData:function(t){for(var e,n,r,s=S.event.special,i=0;void 0!==(n=t[i]);i++)if(it(n)){if(e=n[ot.expando]){if(e.events)for(r in e.events)s[r]?S.event.remove(n,r):S.removeEvent(n,r,e.handle);n[ot.expando]=void 0}n[lt.expando]&&(n[lt.expando]=void 0)}}}),S.fn.extend({detach:function(t){return Vt(this,t,!0)},remove:function(t){return Vt(this,t)},text:function(t){return tt(this,(function(t){return void 0===t?S.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)}))}),null,t,arguments.length)},append:function(){return Wt(this,arguments,(function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Ht(this,t).appendChild(t)}))},prepend:function(){return Wt(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=Ht(this,t);e.insertBefore(t,e.firstChild)}}))},before:function(){return Wt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this)}))},after:function(){return Wt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)}))},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(S.cleanData(Ct(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return S.clone(this,t,e)}))},html:function(t){return tt(this,(function(t){var e=this[0]||{},n=0,r=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!Rt.test(t)&&!Tt[(Et.exec(t)||["",""])[1].toLowerCase()]){t=S.htmlPrefilter(t);try{for(;n=0&&(l+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-i-l-o-.5))||0),l+c}function ue(t,e,n){var r=Qt(t),s=(!g.boxSizingReliable()||n)&&"border-box"===S.css(t,"boxSizing",!1,r),i=s,a=Zt(t,e,r),o="offset"+e[0].toUpperCase()+e.slice(1);if(Kt.test(a)){if(!n)return a;a="auto"}return(!g.boxSizingReliable()&&s||!g.reliableTrDimensions()&&k(t,"tr")||"auto"===a||!parseFloat(a)&&"inline"===S.css(t,"display",!1,r))&&t.getClientRects().length&&(s="border-box"===S.css(t,"boxSizing",!1,r),(i=o in t)&&(a=t[o])),(a=parseFloat(a)||0)+ce(t,e,n||(s?"border":"content"),i,r,a)+"px"}function de(t,e,n,r,s){return new de.prototype.init(t,e,n,r,s)}S.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=Zt(t,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(t,e,n,r){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var s,i,a,o=st(e),l=Yt.test(e),c=t.style;if(l||(e=se(o)),a=S.cssHooks[e]||S.cssHooks[o],void 0===n)return a&&"get"in a&&void 0!==(s=a.get(t,!1,r))?s:c[e];"string"==(i=typeof n)&&(s=mt.exec(n))&&s[1]&&(n=yt(t,e,s),i="number"),null!=n&&n==n&&("number"!==i||l||(n+=s&&s[3]||(S.cssNumber[o]?"":"px")),g.clearCloneStyle||""!==n||0!==e.indexOf("background")||(c[e]="inherit"),a&&"set"in a&&void 0===(n=a.set(t,n,r))||(l?c.setProperty(e,n):c[e]=n))}},css:function(t,e,n,r){var s,i,a,o=st(e);return Yt.test(e)||(e=se(o)),(a=S.cssHooks[e]||S.cssHooks[o])&&"get"in a&&(s=a.get(t,!0,n)),void 0===s&&(s=Zt(t,e,r)),"normal"===s&&e in oe&&(s=oe[e]),""===n||n?(i=parseFloat(s),!0===n||isFinite(i)?i||0:s):s}}),S.each(["height","width"],(function(t,e){S.cssHooks[e]={get:function(t,n,r){if(n)return!ie.test(S.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?ue(t,e,r):Jt(t,ae,(function(){return ue(t,e,r)}))},set:function(t,n,r){var s,i=Qt(t),a=!g.scrollboxSize()&&"absolute"===i.position,o=(a||r)&&"border-box"===S.css(t,"boxSizing",!1,i),l=r?ce(t,e,r,o,i):0;return o&&a&&(l-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(i[e])-ce(t,e,"border",!1,i)-.5)),l&&(s=mt.exec(n))&&"px"!==(s[3]||"px")&&(t.style[e]=n,n=S.css(t,e)),le(0,n,l)}}})),S.cssHooks.marginLeft=te(g.reliableMarginLeft,(function(t,e){if(e)return(parseFloat(Zt(t,"marginLeft"))||t.getBoundingClientRect().left-Jt(t,{marginLeft:0},(function(){return t.getBoundingClientRect().left})))+"px"})),S.each({margin:"",padding:"",border:"Width"},(function(t,e){S.cssHooks[t+e]={expand:function(n){for(var r=0,s={},i="string"==typeof n?n.split(" "):[n];r<4;r++)s[t+pt[r]+e]=i[r]||i[r-2]||i[0];return s}},"margin"!==t&&(S.cssHooks[t+e].set=le)})),S.fn.extend({css:function(t,e){return tt(this,(function(t,e,n){var r,s,i={},a=0;if(Array.isArray(e)){for(r=Qt(t),s=e.length;a1)}}),S.Tween=de,de.prototype={constructor:de,init:function(t,e,n,r,s,i){this.elem=t,this.prop=n,this.easing=s||S.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=r,this.unit=i||(S.cssNumber[n]?"":"px")},cur:function(){var t=de.propHooks[this.prop];return t&&t.get?t.get(this):de.propHooks._default.get(this)},run:function(t){var e,n=de.propHooks[this.prop];return this.options.duration?this.pos=e=S.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):de.propHooks._default.set(this),this}},de.prototype.init.prototype=de.prototype,de.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=S.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){S.fx.step[t.prop]?S.fx.step[t.prop](t):1!==t.elem.nodeType||!S.cssHooks[t.prop]&&null==t.elem.style[se(t.prop)]?t.elem[t.prop]=t.now:S.style(t.elem,t.prop,t.now+t.unit)}}},de.propHooks.scrollTop=de.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},S.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},S.fx=de.prototype.init,S.fx.step={};var he,me,pe=/^(?:toggle|show|hide)$/,fe=/queueHooks$/;function ge(){me&&(!1===y.hidden&&r.requestAnimationFrame?r.requestAnimationFrame(ge):r.setTimeout(ge,S.fx.interval),S.fx.tick())}function ve(){return r.setTimeout((function(){he=void 0})),he=Date.now()}function be(t,e){var n,r=0,s={height:t};for(e=e?1:0;r<4;r+=2-e)s["margin"+(n=pt[r])]=s["padding"+n]=t;return e&&(s.opacity=s.width=t),s}function ye(t,e,n){for(var r,s=(we.tweeners[e]||[]).concat(we.tweeners["*"]),i=0,a=s.length;i1)},removeAttr:function(t){return this.each((function(){S.removeAttr(this,t)}))}}),S.extend({attr:function(t,e,n){var r,s,i=t.nodeType;if(3!==i&&8!==i&&2!==i)return void 0===t.getAttribute?S.prop(t,e,n):(1===i&&S.isXMLDoc(t)||(s=S.attrHooks[e.toLowerCase()]||(S.expr.match.bool.test(e)?Ae:void 0)),void 0!==n?null===n?void S.removeAttr(t,e):s&&"set"in s&&void 0!==(r=s.set(t,n,e))?r:(t.setAttribute(e,n+""),n):s&&"get"in s&&null!==(r=s.get(t,e))?r:null==(r=S.find.attr(t,e))?void 0:r)},attrHooks:{type:{set:function(t,e){if(!g.radioValue&&"radio"===e&&k(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,r=0,s=e&&e.match(V);if(s&&1===t.nodeType)for(;n=s[r++];)t.removeAttribute(n)}}),Ae={set:function(t,e,n){return!1===e?S.removeAttr(t,n):t.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),(function(t,e){var n=xe[e]||S.find.attr;xe[e]=function(t,e,r){var s,i,a=e.toLowerCase();return r||(i=xe[a],xe[a]=s,s=null!=n(t,e,r)?a:null,xe[a]=i),s}}));var _e=/^(?:input|select|textarea|button)$/i,Ne=/^(?:a|area)$/i;function Se(t){return(t.match(V)||[]).join(" ")}function Ee(t){return t.getAttribute&&t.getAttribute("class")||""}function ke(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(V)||[]}S.fn.extend({prop:function(t,e){return tt(this,S.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each((function(){delete this[S.propFix[t]||t]}))}}),S.extend({prop:function(t,e,n){var r,s,i=t.nodeType;if(3!==i&&8!==i&&2!==i)return 1===i&&S.isXMLDoc(t)||(e=S.propFix[e]||e,s=S.propHooks[e]),void 0!==n?s&&"set"in s&&void 0!==(r=s.set(t,n,e))?r:t[e]=n:s&&"get"in s&&null!==(r=s.get(t,e))?r:t[e]},propHooks:{tabIndex:{get:function(t){var e=S.find.attr(t,"tabindex");return e?parseInt(e,10):_e.test(t.nodeName)||Ne.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),g.optSelected||(S.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){S.propFix[this.toLowerCase()]=this})),S.fn.extend({addClass:function(t){var e,n,r,s,i,a;return v(t)?this.each((function(e){S(this).addClass(t.call(this,e,Ee(this)))})):(e=ke(t)).length?this.each((function(){if(r=Ee(this),n=1===this.nodeType&&" "+Se(r)+" "){for(i=0;i-1;)n=n.replace(" "+s+" "," ");a=Se(n),r!==a&&this.setAttribute("class",a)}})):this:this.attr("class","")},toggleClass:function(t,e){var n,r,s,i,a=typeof t,o="string"===a||Array.isArray(t);return v(t)?this.each((function(n){S(this).toggleClass(t.call(this,n,Ee(this),e),e)})):"boolean"==typeof e&&o?e?this.addClass(t):this.removeClass(t):(n=ke(t),this.each((function(){if(o)for(i=S(this),s=0;s-1)return!0;return!1}});var Te=/\r/g;S.fn.extend({val:function(t){var e,n,r,s=this[0];return arguments.length?(r=v(t),this.each((function(n){var s;1===this.nodeType&&(null==(s=r?t.call(this,n,S(this).val()):t)?s="":"number"==typeof s?s+="":Array.isArray(s)&&(s=S.map(s,(function(t){return null==t?"":t+""}))),(e=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,s,"value")||(this.value=s))}))):s?(e=S.valHooks[s.type]||S.valHooks[s.nodeName.toLowerCase()])&&"get"in e&&void 0!==(n=e.get(s,"value"))?n:"string"==typeof(n=s.value)?n.replace(Te,""):null==n?"":n:void 0}}),S.extend({valHooks:{option:{get:function(t){var e=S.find.attr(t,"value");return null!=e?e:Se(S.text(t))}},select:{get:function(t){var e,n,r,s=t.options,i=t.selectedIndex,a="select-one"===t.type,o=a?null:[],l=a?i+1:s.length;for(r=i<0?l:a?i:0;r-1)&&(n=!0);return n||(t.selectedIndex=-1),i}}}}),S.each(["radio","checkbox"],(function(){S.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=S.inArray(S(t).val(),e)>-1}},g.checkOn||(S.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})}));var Ce=r.location,Pe={guid:Date.now()},De=/\?/;S.parseXML=function(t){var e,n;if(!t||"string"!=typeof t)return null;try{e=(new r.DOMParser).parseFromString(t,"text/xml")}catch(t){}return n=e&&e.getElementsByTagName("parsererror")[0],e&&!n||S.error("Invalid XML: "+(n?S.map(n.childNodes,(function(t){return t.textContent})).join("\n"):t)),e};var Oe=/^(?:focusinfocus|focusoutblur)$/,Me=function(t){t.stopPropagation()};S.extend(S.event,{trigger:function(t,e,n,s){var i,a,o,l,c,u,d,h,p=[n||y],f=m.call(t,"type")?t.type:t,g=m.call(t,"namespace")?t.namespace.split("."):[];if(a=h=o=n=n||y,3!==n.nodeType&&8!==n.nodeType&&!Oe.test(f+S.event.triggered)&&(f.indexOf(".")>-1&&(g=f.split("."),f=g.shift(),g.sort()),c=f.indexOf(":")<0&&"on"+f,(t=t[S.expando]?t:new S.Event(f,"object"==typeof t&&t)).isTrigger=s?2:3,t.namespace=g.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=n),e=null==e?[t]:S.makeArray(e,[t]),d=S.event.special[f]||{},s||!d.trigger||!1!==d.trigger.apply(n,e))){if(!s&&!d.noBubble&&!b(n)){for(l=d.delegateType||f,Oe.test(l+f)||(a=a.parentNode);a;a=a.parentNode)p.push(a),o=a;o===(n.ownerDocument||y)&&p.push(o.defaultView||o.parentWindow||r)}for(i=0;(a=p[i++])&&!t.isPropagationStopped();)h=a,t.type=i>1?l:d.bindType||f,(u=(ot.get(a,"events")||Object.create(null))[t.type]&&ot.get(a,"handle"))&&u.apply(a,e),(u=c&&a[c])&&u.apply&&it(a)&&(t.result=u.apply(a,e),!1===t.result&&t.preventDefault());return t.type=f,s||t.isDefaultPrevented()||d._default&&!1!==d._default.apply(p.pop(),e)||!it(n)||c&&v(n[f])&&!b(n)&&((o=n[c])&&(n[c]=null),S.event.triggered=f,t.isPropagationStopped()&&h.addEventListener(f,Me),n[f](),t.isPropagationStopped()&&h.removeEventListener(f,Me),S.event.triggered=void 0,o&&(n[c]=o)),t.result}},simulate:function(t,e,n){var r=S.extend(new S.Event,n,{type:t,isSimulated:!0});S.event.trigger(r,null,e)}}),S.fn.extend({trigger:function(t,e){return this.each((function(){S.event.trigger(t,e,this)}))},triggerHandler:function(t,e){var n=this[0];if(n)return S.event.trigger(t,e,n,!0)}});var Ie=/\[\]$/,Le=/\r?\n/g,je=/^(?:submit|button|image|reset|file)$/i,Be=/^(?:input|select|textarea|keygen)/i;function Re(t,e,n,r){var s;if(Array.isArray(e))S.each(e,(function(e,s){n||Ie.test(t)?r(t,s):Re(t+"["+("object"==typeof s&&null!=s?e:"")+"]",s,n,r)}));else if(n||"object"!==x(e))r(t,e);else for(s in e)Re(t+"["+s+"]",e[s],n,r)}S.param=function(t,e){var n,r=[],s=function(t,e){var n=v(e)?e():e;r[r.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!S.isPlainObject(t))S.each(t,(function(){s(this.name,this.value)}));else for(n in t)Re(n,t[n],e,s);return r.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var t=S.prop(this,"elements");return t?S.makeArray(t):this})).filter((function(){var t=this.type;return this.name&&!S(this).is(":disabled")&&Be.test(this.nodeName)&&!je.test(t)&&(this.checked||!St.test(t))})).map((function(t,e){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,(function(t){return{name:e.name,value:t.replace(Le,"\r\n")}})):{name:e.name,value:n.replace(Le,"\r\n")}})).get()}});var $e=/%20/g,Fe=/#.*$/,He=/([?&])_=[^&]*/,qe=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ue=/^(?:GET|HEAD)$/,Ge=/^\/\//,ze={},We={},Ve="*/".concat("*"),Ke=y.createElement("a");function Ye(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var r,s=0,i=e.toLowerCase().match(V)||[];if(v(n))for(;r=i[s++];)"+"===r[0]?(r=r.slice(1)||"*",(t[r]=t[r]||[]).unshift(n)):(t[r]=t[r]||[]).push(n)}}function Qe(t,e,n,r){var s={},i=t===We;function a(o){var l;return s[o]=!0,S.each(t[o]||[],(function(t,o){var c=o(e,n,r);return"string"!=typeof c||i||s[c]?i?!(l=c):void 0:(e.dataTypes.unshift(c),a(c),!1)})),l}return a(e.dataTypes[0])||!s["*"]&&a("*")}function Je(t,e){var n,r,s=S.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((s[n]?t:r||(r={}))[n]=e[n]);return r&&S.extend(!0,t,r),t}Ke.href=Ce.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ce.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Ce.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Ve,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Je(Je(t,S.ajaxSettings),e):Je(S.ajaxSettings,t)},ajaxPrefilter:Ye(ze),ajaxTransport:Ye(We),ajax:function(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var n,s,i,a,o,l,c,u,d,h,m=S.ajaxSetup({},e),p=m.context||m,f=m.context&&(p.nodeType||p.jquery)?S(p):S.event,g=S.Deferred(),v=S.Callbacks("once memory"),b=m.statusCode||{},w={},A={},x="canceled",_={readyState:0,getResponseHeader:function(t){var e;if(c){if(!a)for(a={};e=qe.exec(i);)a[e[1].toLowerCase()+" "]=(a[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=a[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return c?i:null},setRequestHeader:function(t,e){return null==c&&(t=A[t.toLowerCase()]=A[t.toLowerCase()]||t,w[t]=e),this},overrideMimeType:function(t){return null==c&&(m.mimeType=t),this},statusCode:function(t){var e;if(t)if(c)_.always(t[_.status]);else for(e in t)b[e]=[b[e],t[e]];return this},abort:function(t){var e=t||x;return n&&n.abort(e),N(0,e),this}};if(g.promise(_),m.url=((t||m.url||Ce.href)+"").replace(Ge,Ce.protocol+"//"),m.type=e.method||e.type||m.method||m.type,m.dataTypes=(m.dataType||"*").toLowerCase().match(V)||[""],null==m.crossDomain){l=y.createElement("a");try{l.href=m.url,l.href=l.href,m.crossDomain=Ke.protocol+"//"+Ke.host!=l.protocol+"//"+l.host}catch(t){m.crossDomain=!0}}if(m.data&&m.processData&&"string"!=typeof m.data&&(m.data=S.param(m.data,m.traditional)),Qe(ze,m,e,_),c)return _;for(d in(u=S.event&&m.global)&&0==S.active++&&S.event.trigger("ajaxStart"),m.type=m.type.toUpperCase(),m.hasContent=!Ue.test(m.type),s=m.url.replace(Fe,""),m.hasContent?m.data&&m.processData&&0===(m.contentType||"").indexOf("application/x-www-form-urlencoded")&&(m.data=m.data.replace($e,"+")):(h=m.url.slice(s.length),m.data&&(m.processData||"string"==typeof m.data)&&(s+=(De.test(s)?"&":"?")+m.data,delete m.data),!1===m.cache&&(s=s.replace(He,"$1"),h=(De.test(s)?"&":"?")+"_="+Pe.guid+++h),m.url=s+h),m.ifModified&&(S.lastModified[s]&&_.setRequestHeader("If-Modified-Since",S.lastModified[s]),S.etag[s]&&_.setRequestHeader("If-None-Match",S.etag[s])),(m.data&&m.hasContent&&!1!==m.contentType||e.contentType)&&_.setRequestHeader("Content-Type",m.contentType),_.setRequestHeader("Accept",m.dataTypes[0]&&m.accepts[m.dataTypes[0]]?m.accepts[m.dataTypes[0]]+("*"!==m.dataTypes[0]?", "+Ve+"; q=0.01":""):m.accepts["*"]),m.headers)_.setRequestHeader(d,m.headers[d]);if(m.beforeSend&&(!1===m.beforeSend.call(p,_,m)||c))return _.abort();if(x="abort",v.add(m.complete),_.done(m.success),_.fail(m.error),n=Qe(We,m,e,_)){if(_.readyState=1,u&&f.trigger("ajaxSend",[_,m]),c)return _;m.async&&m.timeout>0&&(o=r.setTimeout((function(){_.abort("timeout")}),m.timeout));try{c=!1,n.send(w,N)}catch(t){if(c)throw t;N(-1,t)}}else N(-1,"No Transport");function N(t,e,a,l){var d,h,y,w,A,x=e;c||(c=!0,o&&r.clearTimeout(o),n=void 0,i=l||"",_.readyState=t>0?4:0,d=t>=200&&t<300||304===t,a&&(w=function(t,e,n){for(var r,s,i,a,o=t.contents,l=t.dataTypes;"*"===l[0];)l.shift(),void 0===r&&(r=t.mimeType||e.getResponseHeader("Content-Type"));if(r)for(s in o)if(o[s]&&o[s].test(r)){l.unshift(s);break}if(l[0]in n)i=l[0];else{for(s in n){if(!l[0]||t.converters[s+" "+l[0]]){i=s;break}a||(a=s)}i=i||a}if(i)return i!==l[0]&&l.unshift(i),n[i]}(m,_,a)),!d&&S.inArray("script",m.dataTypes)>-1&&S.inArray("json",m.dataTypes)<0&&(m.converters["text script"]=function(){}),w=function(t,e,n,r){var s,i,a,o,l,c={},u=t.dataTypes.slice();if(u[1])for(a in t.converters)c[a.toLowerCase()]=t.converters[a];for(i=u.shift();i;)if(t.responseFields[i]&&(n[t.responseFields[i]]=e),!l&&r&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),l=i,i=u.shift())if("*"===i)i=l;else if("*"!==l&&l!==i){if(!(a=c[l+" "+i]||c["* "+i]))for(s in c)if((o=s.split(" "))[1]===i&&(a=c[l+" "+o[0]]||c["* "+o[0]])){!0===a?a=c[s]:!0!==c[s]&&(i=o[0],u.unshift(o[1]));break}if(!0!==a)if(a&&t.throws)e=a(e);else try{e=a(e)}catch(t){return{state:"parsererror",error:a?t:"No conversion from "+l+" to "+i}}}return{state:"success",data:e}}(m,w,_,d),d?(m.ifModified&&((A=_.getResponseHeader("Last-Modified"))&&(S.lastModified[s]=A),(A=_.getResponseHeader("etag"))&&(S.etag[s]=A)),204===t||"HEAD"===m.type?x="nocontent":304===t?x="notmodified":(x=w.state,h=w.data,d=!(y=w.error))):(y=x,!t&&x||(x="error",t<0&&(t=0))),_.status=t,_.statusText=(e||x)+"",d?g.resolveWith(p,[h,x,_]):g.rejectWith(p,[_,x,y]),_.statusCode(b),b=void 0,u&&f.trigger(d?"ajaxSuccess":"ajaxError",[_,m,d?h:y]),v.fireWith(p,[_,x]),u&&(f.trigger("ajaxComplete",[_,m]),--S.active||S.event.trigger("ajaxStop")))}return _},getJSON:function(t,e,n){return S.get(t,e,n,"json")},getScript:function(t,e){return S.get(t,void 0,e,"script")}}),S.each(["get","post"],(function(t,e){S[e]=function(t,n,r,s){return v(n)&&(s=s||r,r=n,n=void 0),S.ajax(S.extend({url:t,type:e,dataType:s,data:n,success:r},S.isPlainObject(t)&&t))}})),S.ajaxPrefilter((function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")})),S._evalUrl=function(t,e,n){return S.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){S.globalEval(t,e,n)}})},S.fn.extend({wrapAll:function(t){var e;return this[0]&&(v(t)&&(t=t.call(this[0])),e=S(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t})).append(this)),this},wrapInner:function(t){return v(t)?this.each((function(e){S(this).wrapInner(t.call(this,e))})):this.each((function(){var e=S(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)}))},wrap:function(t){var e=v(t);return this.each((function(n){S(this).wrapAll(e?t.call(this,n):t)}))},unwrap:function(t){return this.parent(t).not("body").each((function(){S(this).replaceWith(this.childNodes)})),this}}),S.expr.pseudos.hidden=function(t){return!S.expr.pseudos.visible(t)},S.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new r.XMLHttpRequest}catch(t){}};var Xe={0:200,1223:204},Ze=S.ajaxSettings.xhr();g.cors=!!Ze&&"withCredentials"in Ze,g.ajax=Ze=!!Ze,S.ajaxTransport((function(t){var e,n;if(g.cors||Ze&&!t.crossDomain)return{send:function(s,i){var a,o=t.xhr();if(o.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)o[a]=t.xhrFields[a];for(a in t.mimeType&&o.overrideMimeType&&o.overrideMimeType(t.mimeType),t.crossDomain||s["X-Requested-With"]||(s["X-Requested-With"]="XMLHttpRequest"),s)o.setRequestHeader(a,s[a]);e=function(t){return function(){e&&(e=n=o.onload=o.onerror=o.onabort=o.ontimeout=o.onreadystatechange=null,"abort"===t?o.abort():"error"===t?"number"!=typeof o.status?i(0,"error"):i(o.status,o.statusText):i(Xe[o.status]||o.status,o.statusText,"text"!==(o.responseType||"text")||"string"!=typeof o.responseText?{binary:o.response}:{text:o.responseText},o.getAllResponseHeaders()))}},o.onload=e(),n=o.onerror=o.ontimeout=e("error"),void 0!==o.onabort?o.onabort=n:o.onreadystatechange=function(){4===o.readyState&&r.setTimeout((function(){e&&n()}))},e=e("abort");try{o.send(t.hasContent&&t.data||null)}catch(t){if(e)throw t}},abort:function(){e&&e()}}})),S.ajaxPrefilter((function(t){t.crossDomain&&(t.contents.script=!1)})),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return S.globalEval(t),t}}}),S.ajaxPrefilter("script",(function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")})),S.ajaxTransport("script",(function(t){var e,n;if(t.crossDomain||t.scriptAttrs)return{send:function(r,s){e=S("