@brightspot/ui 5.4.1 → 5.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- /*! For license information please see v4.ba601ff96a3370471a41.js.LICENSE.txt */
2
- (()=>{var __webpack_modules__={42247(e,t,o){var n={"./af":88468,"./af.js":88468,"./ar":43504,"./ar-dz":56553,"./ar-dz.js":56553,"./ar-kw":32889,"./ar-kw.js":32889,"./ar-ly":41222,"./ar-ly.js":41222,"./ar-ma":75865,"./ar-ma.js":75865,"./ar-ps":96404,"./ar-ps.js":96404,"./ar-sa":80299,"./ar-sa.js":80299,"./ar-tn":77293,"./ar-tn.js":77293,"./ar.js":43504,"./az":86936,"./az.js":86936,"./be":67226,"./be.js":67226,"./bg":1548,"./bg.js":1548,"./bm":98450,"./bm.js":98450,"./bn":62829,"./bn-bd":10070,"./bn-bd.js":10070,"./bn.js":62829,"./bo":94532,"./bo.js":94532,"./br":15201,"./br.js":15201,"./bs":67912,"./bs.js":67912,"./ca":42209,"./ca.js":42209,"./cs":30055,"./cs.js":30055,"./cv":38938,"./cv.js":38938,"./cy":93417,"./cy.js":93417,"./da":34888,"./da.js":34888,"./de":5020,"./de-at":17876,"./de-at.js":17876,"./de-ch":10526,"./de-ch.js":10526,"./de.js":5020,"./dv":79851,"./dv.js":79851,"./el":65518,"./el.js":65518,"./en-au":62585,"./en-au.js":62585,"./en-ca":98459,"./en-ca.js":98459,"./en-gb":31408,"./en-gb.js":31408,"./en-ie":30577,"./en-ie.js":30577,"./en-il":56496,"./en-il.js":56496,"./en-in":82222,"./en-in.js":82222,"./en-nz":19291,"./en-nz.js":19291,"./en-sg":55313,"./en-sg.js":55313,"./eo":78473,"./eo.js":78473,"./es":43685,"./es-do":58683,"./es-do.js":58683,"./es-mx":20831,"./es-mx.js":20831,"./es-us":45264,"./es-us.js":45264,"./es.js":43685,"./et":49862,"./et.js":49862,"./eu":61399,"./eu.js":61399,"./fa":40434,"./fa.js":40434,"./fi":37242,"./fi.js":37242,"./fil":20648,"./fil.js":20648,"./fo":4248,"./fo.js":4248,"./fr":38461,"./fr-ca":43064,"./fr-ca.js":43064,"./fr-ch":76937,"./fr-ch.js":76937,"./fr.js":38461,"./fy":79818,"./fy.js":79818,"./ga":85309,"./ga.js":85309,"./gd":44352,"./gd.js":44352,"./gl":47368,"./gl.js":47368,"./gom-deva":89099,"./gom-deva.js":89099,"./gom-latn":62498,"./gom-latn.js":62498,"./gu":67881,"./gu.js":67881,"./he":39616,"./he.js":39616,"./hi":93980,"./hi.js":93980,"./hr":99875,"./hr.js":99875,"./hu":27792,"./hu.js":27792,"./hy-am":97925,"./hy-am.js":97925,"./id":34730,"./id.js":34730,"./is":11953,"./is.js":11953,"./it":19002,"./it-ch":83820,"./it-ch.js":83820,"./it.js":19002,"./ja":19518,"./ja.js":19518,"./jv":15501,"./jv.js":15501,"./ka":78665,"./ka.js":78665,"./kk":15303,"./kk.js":15303,"./km":50037,"./km.js":50037,"./kn":24186,"./kn.js":24186,"./ko":8779,"./ko.js":8779,"./ku":12221,"./ku-kmr":28876,"./ku-kmr.js":28876,"./ku.js":12221,"./ky":27457,"./ky.js":27457,"./lb":4095,"./lb.js":4095,"./lo":19450,"./lo.js":19450,"./lt":85373,"./lt.js":85373,"./lv":60819,"./lv.js":60819,"./me":84879,"./me.js":84879,"./mi":68603,"./mi.js":68603,"./mk":9413,"./mk.js":9413,"./ml":92646,"./ml.js":92646,"./mn":24904,"./mn.js":24904,"./mr":21060,"./mr.js":21060,"./ms":83437,"./ms-my":59158,"./ms-my.js":59158,"./ms.js":83437,"./mt":59886,"./mt.js":59886,"./my":75755,"./my.js":75755,"./nb":2741,"./nb.js":2741,"./ne":40470,"./ne.js":40470,"./nl":11743,"./nl-be":58657,"./nl-be.js":58657,"./nl.js":11743,"./nn":35817,"./nn.js":35817,"./oc-lnc":31561,"./oc-lnc.js":31561,"./pa-in":30402,"./pa-in.js":30402,"./pl":50713,"./pl.js":50713,"./pt":82033,"./pt-br":4e3,"./pt-br.js":4e3,"./pt.js":82033,"./ro":5748,"./ro.js":5748,"./ru":48218,"./ru.js":48218,"./sd":84172,"./sd.js":84172,"./se":31957,"./se.js":31957,"./si":65033,"./si.js":65033,"./sk":40959,"./sk.js":40959,"./sl":21604,"./sl.js":21604,"./sq":9473,"./sq.js":9473,"./sr":38438,"./sr-cyrl":28167,"./sr-cyrl.js":28167,"./sr.js":38438,"./ss":54455,"./ss.js":54455,"./sv":64906,"./sv.js":64906,"./sw":73595,"./sw.js":73595,"./ta":52024,"./ta.js":52024,"./te":51916,"./te.js":51916,"./tet":93798,"./tet.js":93798,"./tg":1370,"./tg.js":1370,"./th":2249,"./th.js":2249,"./tk":89294,"./tk.js":89294,"./tl-ph":88204,"./tl-ph.js":88204,"./tlh":14065,"./tlh.js":14065,"./tr":96855,"./tr.js":96855,"./tzl":33419,"./tzl.js":33419,"./tzm":61050,"./tzm-latn":62490,"./tzm-latn.js":62490,"./tzm.js":61050,"./ug-cn":18719,"./ug-cn.js":18719,"./uk":49437,"./uk.js":49437,"./ur":51148,"./ur.js":51148,"./uz":88580,"./uz-latn":50276,"./uz-latn.js":50276,"./uz.js":88580,"./vi":32202,"./vi.js":32202,"./x-pseudo":44782,"./x-pseudo.js":44782,"./yo":80589,"./yo.js":80589,"./zh-cn":36641,"./zh-cn.js":36641,"./zh-hk":30933,"./zh-hk.js":30933,"./zh-mo":78582,"./zh-mo.js":78582,"./zh-tw":88525,"./zh-tw.js":88525};function i(e){var t=r(e);return o(t)}function r(e){if(!o.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}i.keys=function(){return Object.keys(n)},i.resolve=r,e.exports=i,i.id=42247},66808(e,t,o){"use strict";var n=o(1439),i=o.n(n),r=o(56155);const a=window.BRIGHTSPOT?.web?.pagePaths["com.psddev.analytics.ui.AnalyticsDataToolPage"];class s{constructor(e){this.element=void 0,this.contentId=void 0,this.analyticsUrl=void 0,this.isLoaded=!1,this.cache={},this.currentPeriod="hours",this.loadingElement=void 0,this.contentElement=void 0,this.errorElement=void 0,this.periodSelector=void 0,this.element=e,this.contentId=e.dataset.contentId||"",this.analyticsUrl=a,this.loadingElement=e.querySelector(".AnalyticsWidget-loading"),this.contentElement=e.querySelector(".AnalyticsWidget-content"),this.errorElement=e.querySelector(".AnalyticsWidget-error"),this.periodSelector=e.querySelector(".AnalyticsWidget-periodSelector"),this.init()}init(){i()(this.element).closest("[data-tab]").on("tabbedShow",()=>{const e=this.element.closest("[data-tab]");this.isLoaded||e?.classList.contains("TC-unselected")||this.loadAnalyticsData()}),this.periodSelector&&this.periodSelector.addEventListener("change",e=>{const t=e.target;null!==t&&t instanceof HTMLSelectElement&&(this.currentPeriod=t.value,this.loadAnalyticsData())})}async loadAnalyticsData(){const e=this.currentPeriod;if(this.cache[e])this.displayData(this.cache[e]);else{if(!this.analyticsUrl)return console.error("Analytics data endpoint not found in pagePaths"),void this.showError();this.showLoading();try{const t=await fetch(`${this.analyticsUrl}?id=${this.contentId}&period=${e}`);if(!t.ok)throw new Error(`HTTP ${t.status}: ${t.statusText}`);const o=await t.json();if("error"in o)throw new Error(o.error);this.cache[e]=o,this.displayData(o),this.isLoaded=!0}catch(e){console.error("Failed to load analytics data:",e),this.showError()}}}showLoading(){this.loadingElement&&(this.loadingElement.hidden=!1),this.contentElement&&(this.contentElement.hidden=!0),this.errorElement&&(this.errorElement.hidden=!0)}showError(){this.loadingElement&&(this.loadingElement.hidden=!0),this.contentElement&&(this.contentElement.hidden=!0),this.errorElement&&(this.errorElement.hidden=!1)}displayData(e){if(this.loadingElement&&(this.loadingElement.hidden=!0),this.errorElement&&(this.errorElement.hidden=!0),this.contentElement&&(this.contentElement.hidden=!1),!this.contentElement)return;this.contentElement.innerHTML="";const t=document.createElement("div");t.className=`numbersPeriod numbersPeriod-${e.periodLabel}`,t.addEventListener("highchart-loaded",()=>{t.classList.add("chart-loaded")}),e.chartData&&(t.innerHTML=e.chartData),this.contentElement.appendChild(t)}}(0,r.A)(".AnalyticsWidget",e=>{new s(e)})},40482(e,t,o){"use strict";o(67219),o(44764);var n={},i="function"==typeof Map?new Map:null,r="swap",a="move",s="layoutStart",c="layoutEnd",p="layoutAbort",b="remove",M="hideStart",d="filter",l="sort",z="move",u="send",O="beforeSend",A="receive",f="beforeReceive",h="dragReleaseEnd",m="ontouchstart"in window,q=!!window.PointerEvent,_=!!window.navigator.msPointerEnabled;function W(){this._events={},this._queue=[],this._counter=0,this._clearOnEmit=!1}W.prototype.on=function(e,t){if(!this._events||!e||!t)return this;var o=this._events[e];return o||(o=this._events[e]=[]),o.push(t),this},W.prototype.off=function(e,t){if(!this._events||!e||!t)return this;var o,n=this._events[e];if(!n||!n.length)return this;for(;-1!==(o=n.indexOf(t));)n.splice(o,1);return this},W.prototype.clear=function(e){if(!this._events||!e)return this;var t=this._events[e];return t&&(t.length=0,delete this._events[e]),this},W.prototype.emit=function(e){if(!this._events||!e)return this._clearOnEmit=!1,this;var t=this._events[e];if(!t||!t.length)return this._clearOnEmit=!1,this;var o,n=this._queue,i=n.length,r=arguments.length-1;r>3&&((o=[]).push.apply(o,arguments),o.shift()),n.push.apply(n,t),this._clearOnEmit&&(t.length=0,this._clearOnEmit=!1),++this._counter;for(var a=i,s=n.length;a<s;a++)if(0===r?n[a]():1===r?n[a](arguments[1]):2===r?n[a](arguments[1],arguments[2]):3===r?n[a](arguments[1],arguments[2],arguments[3]):n[a].apply(null,o),!this._events)return this;return--this._counter,this._counter||(n.length=0),this},W.prototype.burst=function(){return this._events?(this._clearOnEmit=!0,this.emit.apply(this,arguments),this):this},W.prototype.countListeners=function(e){if(!this._events)return 0;var t=this._events[e];return t?t.length:0},W.prototype.destroy=function(){return this._events?(this._queue.length=this._counter=0,this._events=null,this):this};var g=q?"pointerout":_?"MSPointerOut":"";function y(e){g&&(this._dragger=e,this._timeout=null,this._outEvent=null,this._isActive=!1,this._addBehaviour=this._addBehaviour.bind(this),this._removeBehaviour=this._removeBehaviour.bind(this),this._onTimeout=this._onTimeout.bind(this),this._resetData=this._resetData.bind(this),this._onStart=this._onStart.bind(this),this._onOut=this._onOut.bind(this),this._dragger.on("start",this._onStart))}y.prototype._addBehaviour=function(){this._isActive||(this._isActive=!0,this._dragger.on("move",this._resetData),this._dragger.on("cancel",this._removeBehaviour),this._dragger.on("end",this._removeBehaviour),window.addEventListener(g,this._onOut))},y.prototype._removeBehaviour=function(){this._isActive&&(this._dragger.off("move",this._resetData),this._dragger.off("cancel",this._removeBehaviour),this._dragger.off("end",this._removeBehaviour),window.removeEventListener(g,this._onOut),this._resetData(),this._isActive=!1)},y.prototype._resetData=function(){window.clearTimeout(this._timeout),this._timeout=null,this._outEvent=null},y.prototype._onStart=function(e){"mouse"!==e.pointerType&&this._addBehaviour()},y.prototype._onOut=function(e){this._dragger._getTrackedTouch(e)&&(this._resetData(),this._outEvent=e,this._timeout=window.setTimeout(this._onTimeout,100))},y.prototype._onTimeout=function(){var e=this._outEvent;this._resetData(),this._dragger.isActive()&&this._dragger._onCancel(e)},y.prototype.destroy=function(){g&&(this._dragger.off("start",this._onStart),this._removeBehaviour())};var v=["","webkit","moz","ms","o","Webkit","Moz","MS","O"],L={};function w(e,t){var o=L[t]||"";if(o)return o;for(var n=t[0].toUpperCase()+t.slice(1),i=0;i<v.length;){if((o=v[i]?v[i]+n:t)in e)return L[t]=o,o;++i}return""}function R(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassive",null,t),window.removeEventListener("testPassive",null,t)}catch(e){}return e}var k=window.navigator.userAgent.toLowerCase(),T=k.indexOf("edge")>-1,S=k.indexOf("trident")>-1,E=k.indexOf("firefox")>-1,N=k.indexOf("android")>-1,B=!!R()&&{passive:!0},C="touchAction",D=w(document.documentElement.style,C);function x(e,t){this._element=e,this._emitter=new W,this._isDestroyed=!1,this._cssProps={},this._touchAction="",this._isActive=!1,this._pointerId=null,this._startTime=0,this._startX=0,this._startY=0,this._currentX=0,this._currentY=0,this._onStart=this._onStart.bind(this),this._onMove=this._onMove.bind(this),this._onCancel=this._onCancel.bind(this),this._onEnd=this._onEnd.bind(this),this._edgeHack=null,(T||S)&&(q||_)&&(this._edgeHack=new y(this)),this.setCssProps(t),this._touchAction||this.setTouchAction("auto"),e.addEventListener("dragstart",x._preventDefault,!1),e.addEventListener(x._inputEvents.start,this._onStart,B)}x._pointerEvents={start:"pointerdown",move:"pointermove",cancel:"pointercancel",end:"pointerup"},x._msPointerEvents={start:"MSPointerDown",move:"MSPointerMove",cancel:"MSPointerCancel",end:"MSPointerUp"},x._touchEvents={start:"touchstart",move:"touchmove",cancel:"touchcancel",end:"touchend"},x._mouseEvents={start:"mousedown",move:"mousemove",cancel:"",end:"mouseup"},x._inputEvents=m?x._touchEvents:q?x._pointerEvents:_?x._msPointerEvents:x._mouseEvents,x._emitter=new W,x._emitterEvents={start:"start",move:"move",end:"end",cancel:"cancel"},x._activeInstances=[],x._preventDefault=function(e){e.preventDefault&&!1!==e.cancelable&&e.preventDefault()},x._activateInstance=function(e){x._activeInstances.indexOf(e)>-1||(x._activeInstances.push(e),x._emitter.on(x._emitterEvents.move,e._onMove),x._emitter.on(x._emitterEvents.cancel,e._onCancel),x._emitter.on(x._emitterEvents.end,e._onEnd),1===x._activeInstances.length&&x._bindListeners())},x._deactivateInstance=function(e){var t=x._activeInstances.indexOf(e);-1!==t&&(x._activeInstances.splice(t,1),x._emitter.off(x._emitterEvents.move,e._onMove),x._emitter.off(x._emitterEvents.cancel,e._onCancel),x._emitter.off(x._emitterEvents.end,e._onEnd),x._activeInstances.length||x._unbindListeners())},x._bindListeners=function(){window.addEventListener(x._inputEvents.move,x._onMove,B),window.addEventListener(x._inputEvents.end,x._onEnd,B),x._inputEvents.cancel&&window.addEventListener(x._inputEvents.cancel,x._onCancel,B)},x._unbindListeners=function(){window.removeEventListener(x._inputEvents.move,x._onMove,B),window.removeEventListener(x._inputEvents.end,x._onEnd,B),x._inputEvents.cancel&&window.removeEventListener(x._inputEvents.cancel,x._onCancel,B)},x._getEventPointerId=function(e){return"number"==typeof e.pointerId?e.pointerId:e.changedTouches?e.changedTouches[0]?e.changedTouches[0].identifier:null:1},x._getTouchById=function(e,t){if("number"==typeof e.pointerId)return e.pointerId===t?e:null;if(e.changedTouches){for(var o=0;o<e.changedTouches.length;o++)if(e.changedTouches[o].identifier===t)return e.changedTouches[o];return null}return e},x._onMove=function(e){x._emitter.emit(x._emitterEvents.move,e)},x._onCancel=function(e){x._emitter.emit(x._emitterEvents.cancel,e)},x._onEnd=function(e){x._emitter.emit(x._emitterEvents.end,e)},x.prototype._reset=function(){this._pointerId=null,this._startTime=0,this._startX=0,this._startY=0,this._currentX=0,this._currentY=0,this._isActive=!1,x._deactivateInstance(this)},x.prototype._createEvent=function(e,t){var o=this._getTrackedTouch(t);return{type:e,srcEvent:t,distance:this.getDistance(),deltaX:this.getDeltaX(),deltaY:this.getDeltaY(),deltaTime:e===x._emitterEvents.start?0:this.getDeltaTime(),isFirst:e===x._emitterEvents.start,isFinal:e===x._emitterEvents.end||e===x._emitterEvents.cancel,pointerType:t.pointerType||(t.touches?"touch":"mouse"),identifier:this._pointerId,screenX:o.screenX,screenY:o.screenY,clientX:o.clientX,clientY:o.clientY,pageX:o.pageX,pageY:o.pageY,target:o.target}},x.prototype._emit=function(e,t){this._emitter.emit(e,this._createEvent(e,t))},x.prototype._getTrackedTouch=function(e){return null===this._pointerId?null:x._getTouchById(e,this._pointerId)},x.prototype._onStart=function(e){if(!this._isDestroyed&&null===this._pointerId&&(this._pointerId=x._getEventPointerId(e),null!==this._pointerId)){var t=this._getTrackedTouch(e);this._startX=this._currentX=t.clientX,this._startY=this._currentY=t.clientY,this._startTime=Date.now(),this._isActive=!0,this._emit(x._emitterEvents.start,e),this._isActive&&x._activateInstance(this)}},x.prototype._onMove=function(e){var t=this._getTrackedTouch(e);t&&(this._currentX=t.clientX,this._currentY=t.clientY,this._emit(x._emitterEvents.move,e))},x.prototype._onCancel=function(e){this._getTrackedTouch(e)&&(this._emit(x._emitterEvents.cancel,e),this._reset())},x.prototype._onEnd=function(e){this._getTrackedTouch(e)&&(this._emit(x._emitterEvents.end,e),this._reset())},x.prototype.isActive=function(){return this._isActive},x.prototype.setTouchAction=function(e){this._touchAction=e,D&&(this._cssProps[D]="",this._element.style[D]=e),m&&(this._element.removeEventListener(x._touchEvents.start,x._preventDefault,!0),(this._element.style[D]!==e||E&&N)&&this._element.addEventListener(x._touchEvents.start,x._preventDefault,!0))},x.prototype.setCssProps=function(e){if(e){var t,o,n=this._cssProps,i=this._element;for(t in n)i.style[t]=n[t],delete n[t];for(t in e)e[t]&&(t!==C?(o=w(i.style,t))&&(n[o]="",i.style[o]=e[t]):this.setTouchAction(e[t]))}},x.prototype.getDeltaX=function(){return this._currentX-this._startX},x.prototype.getDeltaY=function(){return this._currentY-this._startY},x.prototype.getDistance=function(){var e=this.getDeltaX(),t=this.getDeltaY();return Math.sqrt(e*e+t*t)},x.prototype.getDeltaTime=function(){return this._startTime?Date.now()-this._startTime:0},x.prototype.on=function(e,t){this._emitter.on(e,t)},x.prototype.off=function(e,t){this._emitter.off(e,t)},x.prototype.destroy=function(){if(!this._isDestroyed){var e=this._element;for(var t in this._edgeHack&&this._edgeHack.destroy(),this._reset(),this._emitter.destroy(),e.removeEventListener(x._inputEvents.start,this._onStart,B),e.removeEventListener("dragstart",x._preventDefault,!1),e.removeEventListener(x._touchEvents.start,x._preventDefault,!0),this._cssProps)e.style[t]=this._cssProps[t],delete this._cssProps[t];this._element=null,this._isDestroyed=!0}};var X=1e3/60,Y=(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(e){return this.setTimeout(function(){e(Date.now())},X)}).bind(window);function P(e){this._nextStep=null,this._lanes=[],this._stepQueue=[],this._stepCallbacks={},this._step=this._step.bind(this);for(var t=0;t<e;t++)this._lanes.push(new I)}function I(){this.queue=[],this.indices={},this.callbacks={}}P.prototype._step=function(e){var t,o,n,i,r,a,s=this._lanes,c=this._stepQueue,p=this._stepCallbacks;for(this._nextStep=null,t=0;t<s.length;t++){for(i=s[t].queue,r=s[t].callbacks,a=s[t].indices,o=0;o<i.length;o++)(n=i[o])&&(c.push(n),p[n]=r[n],delete r[n],delete a[n]);i.length=0}for(t=0;t<c.length;t++)p[n=c[t]]&&p[n](e),delete p[n];c.length=0},P.prototype.add=function(e,t,o){this._lanes[e].add(t,o),this._nextStep||(this._nextStep=Y(this._step))},P.prototype.remove=function(e,t){this._lanes[e].remove(t)},I.prototype.add=function(e,t){var o=this.indices[e];void 0!==o&&(this.queue[o]=void 0),this.queue.push(e),this.callbacks[e]=t,this.indices[e]=this.queue.length-1},I.prototype.remove=function(e){var t=this.indices[e];void 0!==t&&(this.queue[t]=void 0,delete this.callbacks[e],delete this.indices[e])};var H="layoutRead",j="layoutWrite",F="visibilityRead",G="visibilityWrite",$="dragStartRead",U="dragStartWrite",V="dragMoveRead",J="dragMoveWrite",K="dragScrollRead",Q="dragScrollWrite",Z="dragSortRead",ee="placeholderLayoutRead",te="placeholderLayoutWrite",oe="placeholderResizeWrite",ne="autoScrollRead",ie="autoScrollWrite",re="debounceRead",ae=new P(3);function se(e){ae.remove(0,H+e),ae.remove(2,j+e)}function ce(e){ae.remove(0,F+e),ae.remove(2,G+e)}function pe(e){ae.remove(0,$+e),ae.remove(2,U+e)}function be(e){ae.remove(0,V+e),ae.remove(2,J+e)}function Me(e){ae.remove(0,K+e),ae.remove(2,Q+e)}function de(e,t){ae.add(1,Z+e,t)}function le(e){ae.remove(0,ee+e),ae.remove(2,te+e)}function ze(e,t){ae.add(0,ne,e),ae.add(2,ie,t)}function ue(e){return"function"==typeof e}var Oe="function"==typeof WeakMap?new WeakMap:null;function Ae(e,t){var o=Oe&&Oe.get(e);return o||(o=window.getComputedStyle(e,null),Oe&&Oe.set(e,o)),o.getPropertyValue(t)}function fe(e,t){return parseFloat(Ae(e,t))||0}var he,me=document.documentElement,qe=document.body,_e={value:0,offset:0};function We(e){return e===window||e===me||e===qe?window:e}function ge(e){return e===window?e.pageXOffset:e.scrollLeft}function ye(e){return e===window?e.pageYOffset:e.scrollTop}function ve(e){return e===window?me.scrollWidth-me.clientWidth:e.scrollWidth-e.clientWidth}function Le(e){return e===window?me.scrollHeight-me.clientHeight:e.scrollHeight-e.clientHeight}function we(e,t){if(t=t||{},e===window)t.width=me.clientWidth,t.height=me.clientHeight,t.left=0,t.right=t.width,t.top=0,t.bottom=t.height;else{var o=e.getBoundingClientRect(),n=e.clientLeft||fe(e,"border-left-width"),i=e.clientTop||fe(e,"border-top-width");t.width=e.clientWidth,t.height=e.clientHeight,t.left=o.left+n,t.right=t.left+t.width,t.top=o.top+i,t.bottom=t.top+t.height}return t}function Re(e){return e._drag._getGrid()._settings.dragAutoScroll}function ke(e){e._drag&&e._drag._prepareScroll()}function Te(e){if(e._drag&&e._isActive){var t=e._drag;t._scrollDiffX=t._scrollDiffY=0,e._setTranslate(t._left,t._top)}}function Se(e,t,o,n){return _e.value=Math.min(n/2,e),_e.offset=Math.max(0,o+2*_e.value+n*t-n)/2,_e}function Ee(){this.reset()}function Ne(){this.element=null,this.requestX=null,this.requestY=null,this.scrollLeft=0,this.scrollTop=0}function Be(e,t){this.pool=[],this.createItem=e,this.releaseItem=t}function Ce(e,t){var o=function(e,t){return function(e,t){return!(e.left+e.width<=t.left||t.left+t.width<=e.left||e.top+e.height<=t.top||t.top+t.height<=e.top)}(e,t)?(Math.min(e.left+e.width,t.left+t.width)-Math.max(e.left,t.left))*(Math.min(e.top+e.height,t.top+t.height)-Math.max(e.top,t.top)):0}(e,t);return o?o/(Math.min(e.width,t.width)*Math.min(e.height,t.height))*100:0}Ee.prototype.reset=function(){this.isActive&&this.onStop(),this.item=null,this.element=null,this.isActive=!1,this.isEnding=!1,this.direction=null,this.value=null,this.maxValue=0,this.threshold=0,this.distance=0,this.speed=0,this.duration=0,this.action=null},Ee.prototype.hasReachedEnd=function(){return 4&this.direction?this.value>=this.maxValue:this.value<=0},Ee.prototype.computeCurrentScrollValue=function(){return null===this.value?1&this.direction?ge(this.element):ye(this.element):Math.max(0,Math.min(this.value,this.maxValue))},Ee.prototype.computeNextScrollValue=function(e){var t=this.speed*(e/1e3),o=4&this.direction?this.value+t:this.value-t;return Math.max(0,Math.min(o,this.maxValue))},Ee.prototype.computeSpeed=(he={direction:null,threshold:0,distance:0,value:0,maxValue:0,deltaTime:0,duration:0,isEnding:!1},function(e){var t=this.item,o=Re(t).speed;return ue(o)?(he.direction=this.direction,he.threshold=this.threshold,he.distance=this.distance,he.value=this.value,he.maxValue=this.maxValue,he.duration=this.duration,he.speed=this.speed,he.deltaTime=e,he.isEnding=this.isEnding,o(t,this.element,he)):o}),Ee.prototype.tick=function(e){return this.isActive||(this.isActive=!0,this.onStart()),this.value=this.computeCurrentScrollValue(),this.speed=this.computeSpeed(e),this.value=this.computeNextScrollValue(e),this.duration+=e,this.value},Ee.prototype.onStart=function(){var e=this.item,t=Re(e).onStart;ue(t)&&t(e,this.element,this.direction)},Ee.prototype.onStop=function(){var e=this.item,t=Re(e).onStop;ue(t)&&t(e,this.element,this.direction),e._drag&&e._drag.sort()},Ne.prototype.reset=function(){this.requestX&&(this.requestX.action=null),this.requestY&&(this.requestY.action=null),this.element=null,this.requestX=null,this.requestY=null,this.scrollLeft=0,this.scrollTop=0},Ne.prototype.addRequest=function(e){1&e.direction?(this.removeRequest(this.requestX),this.requestX=e):(this.removeRequest(this.requestY),this.requestY=e),e.action=this},Ne.prototype.removeRequest=function(e){e&&(this.requestX===e?(this.requestX=null,e.action=null):this.requestY===e&&(this.requestY=null,e.action=null))},Ne.prototype.computeScrollValues=function(){this.scrollLeft=this.requestX?this.requestX.value:ge(this.element),this.scrollTop=this.requestY?this.requestY.value:ye(this.element)},Ne.prototype.scroll=function(){var e=this.element;e&&(e.scrollTo?e.scrollTo(this.scrollLeft,this.scrollTop):(e.scrollLeft=this.scrollLeft,e.scrollTop=this.scrollTop))},Be.prototype.pick=function(){return this.pool.pop()||this.createItem()},Be.prototype.release=function(e){this.releaseItem(e),-1===this.pool.indexOf(e)&&this.pool.push(e)},Be.prototype.reset=function(){this.pool.length=0};var De={width:0,height:0,left:0,right:0,top:0,bottom:0},xe={width:0,height:0,left:0,right:0,top:0,bottom:0};function Xe(){this._isDestroyed=!1,this._isTicking=!1,this._tickTime=0,this._tickDeltaTime=0,this._items=[],this._actions=[],this._requests={},this._requests[1]={},this._requests[2]={},this._requestOverlapCheck={},this._dragPositions={},this._dragDirections={},this._overlapCheckInterval=150,this._requestPool=new Be(function(){return new Ee},function(e){e.reset()}),this._actionPool=new Be(function(){return new Ne},function(e){e.reset()}),this._readTick=this._readTick.bind(this),this._writeTick=this._writeTick.bind(this)}Xe.AXIS_X=1,Xe.AXIS_Y=2,Xe.FORWARD=4,Xe.BACKWARD=8,Xe.LEFT=9,Xe.RIGHT=5,Xe.UP=10,Xe.DOWN=6,Xe.smoothSpeed=function(e,t,o){return function(n,i,r){var a=0;if(!r.isEnding)if(r.threshold>0){var s=r.threshold-Math.max(0,r.distance);a=e/r.threshold*s}else a=e;var c=r.speed,p=a;return c===a?p:c<a?(p=c+t*(r.deltaTime/1e3),Math.min(a,p)):(p=c-o*(r.deltaTime/1e3),Math.max(a,p))}},Xe.pointerHandle=function(e){var t={left:0,top:0,width:0,height:0},o=e||1;return function(e,n,i,r,a,s,c){return t.left=s-.5*o,t.top=c-.5*o,t.width=o,t.height=o,t}},Xe.prototype._readTick=function(e){this._isDestroyed||(e&&this._tickTime?(this._tickDeltaTime=e-this._tickTime,this._tickTime=e,this._updateRequests(),this._updateActions()):(this._tickTime=e,this._tickDeltaTime=0))},Xe.prototype._writeTick=function(){this._isDestroyed||(this._applyActions(),ze(this._readTick,this._writeTick))},Xe.prototype._startTicking=function(){this._isTicking=!0,ze(this._readTick,this._writeTick)},Xe.prototype._stopTicking=function(){this._isTicking=!1,this._tickTime=0,this._tickDeltaTime=0,ae.remove(0,ne),ae.remove(2,ie)},Xe.prototype._getItemHandleRect=function(e,t,o){var n=e._drag;if(t){var i=n._dragMoveEvent||n._dragStartEvent,r=t(e,n._clientX,n._clientY,e._width,e._height,i.clientX,i.clientY);o.left=r.left,o.top=r.top,o.width=r.width,o.height=r.height}else o.left=n._clientX,o.top=n._clientY,o.width=e._width,o.height=e._height;return o.right=o.left+o.width,o.bottom=o.top+o.height,o},Xe.prototype._requestItemScroll=function(e,t,o,n,i,r,a){var s=this._requests[t],c=s[e._id];c?c.element===o&&c.direction===n||c.reset():c=this._requestPool.pick(),c.item=e,c.element=o,c.direction=n,c.threshold=i,c.distance=r,c.maxValue=a,s[e._id]=c},Xe.prototype._cancelItemScroll=function(e,t){var o=this._requests[t],n=o[e._id];n&&(n.action&&n.action.removeRequest(n),this._requestPool.release(n),delete o[e._id])},Xe.prototype._checkItemOverlap=function(e,t,o){var n=Re(e),i=ue(n.targets)?n.targets(e):n.targets,r=n.threshold,a=n.safeZone;if(!i||!i.length)return t&&this._cancelItemScroll(e,1),void(o&&this._cancelItemScroll(e,2));var s=this._dragDirections[e._id],c=s[0],p=s[1];if(!c&&!p)return t&&this._cancelItemScroll(e,1),void(o&&this._cancelItemScroll(e,2));for(var b=this._getItemHandleRect(e,n.handle,De),M=xe,d=null,l=null,z=!0,u=!0,O=0,A=0,f=null,h=null,m=0,q=0,_=0,W=null,g=-1/0,y=0,v=0,L=null,w=0,R=0,k=null,T=-1/0,S=0,E=0,N=null,B=0,C=0,D=0;D<i.length;D++)d=i[D],z=t&&c&&2!==d.axis,u=o&&p&&1!==d.axis,A=d.priority||0,(!z||A<g)&&(!u||A<T)||(l=We(d.element||d),q=z?ve(l):-1,_=u?Le(l):-1,(q||_)&&((O=Ce(b,M=we(l,M)))<=0||(z&&A>=g&&q>0&&(A>g||O>v)&&(h=null,f=Se("number"==typeof d.threshold?d.threshold:r,a,b.width,M.width),5===c?(m=M.right+f.offset-b.right)<=f.value&&ge(l)<q&&(h=5):9===c&&(m=b.left-(M.left-f.offset))<=f.value&&ge(l)>0&&(h=9),null!==h&&(W=l,g=A,y=f.value,v=O,L=h,w=m,R=q)),u&&A>=T&&_>0&&(A>T||O>E)&&(h=null,f=Se("number"==typeof d.threshold?d.threshold:r,a,b.height,M.height),6===p?(m=M.bottom+f.offset-b.bottom)<=f.value&&ye(l)<_&&(h=6):10===p&&(m=b.top-(M.top-f.offset))<=f.value&&ye(l)>0&&(h=10),null!==h&&(k=l,T=A,S=f.value,E=O,N=h,B=m,C=_)))));t&&(W?this._requestItemScroll(e,1,W,L,y,w,R):this._cancelItemScroll(e,1)),o&&(k?this._requestItemScroll(e,2,k,N,S,B,C):this._cancelItemScroll(e,2))},Xe.prototype._updateScrollRequest=function(e){for(var t=e.item,o=Re(t),n=ue(o.targets)?o.targets(t):o.targets,i=n&&n.length||0,r=o.threshold,a=o.safeZone,s=this._getItemHandleRect(t,o.handle,De),c=xe,p=null,b=null,M=!1,d=null,l=null,z=null,u=null,O=null,A=0;A<i;A++)if((b=We((p=n[A]).element||p))===e.element){if(M=!!(1&e.direction)){if(2===p.axis)continue}else if(1===p.axis)continue;if((u=M?ve(b):Le(b))<=0)break;if(Ce(s,c=we(b,c))<=0)break;if(d=Se("number"==typeof p.threshold?p.threshold:r,a,M?s.width:s.height,M?c.width:c.height),(l=9===e.direction?s.left-(c.left-d.offset):5===e.direction?c.right+d.offset-s.right:10===e.direction?s.top-(c.top-d.offset):c.bottom+d.offset-s.bottom)>d.value)break;if(z=M?ge(b):ye(b),O=4&e.direction?z>=u:z<=0)break;return e.maxValue=u,e.threshold=d.value,e.distance=l,e.isEnding=!1,!0}return!0===o.smoothStop&&e.speed>0?(null===O&&(O=e.hasReachedEnd()),e.isEnding=!O):e.isEnding=!1,e.isEnding},Xe.prototype._updateRequests=function(){for(var e,t,o,n,i,r,a,s=this._items,c=this._requests[1],p=this._requests[2],b=0;b<s.length;b++)e=s[b],i=(n=this._requestOverlapCheck[e._id])>0&&this._tickTime-n>this._overlapCheckInterval,r=!0,(t=c[e._id])&&t.isActive&&(r=!this._updateScrollRequest(t))&&(i=!0,this._cancelItemScroll(e,1)),a=!0,(o=p[e._id])&&o.isActive&&(a=!this._updateScrollRequest(o))&&(i=!0,this._cancelItemScroll(e,2)),i&&(this._requestOverlapCheck[e._id]=0,this._checkItemOverlap(e,r,a))},Xe.prototype._requestAction=function(e,t){for(var o=this._actions,n=1===t,i=null,r=0;r<o.length;r++){if(i=o[r],e.element===i.element){if(n?i.requestX:i.requestY)return void this._cancelItemScroll(e.item,t);break}i=null}i||(i=this._actionPool.pick()),i.element=e.element,i.addRequest(e),e.tick(this._tickDeltaTime),o.push(i)},Xe.prototype._updateActions=function(){var e,t,o,n,i=this._items,r=this._requests,a=this._actions;for(n=0;n<i.length;n++)e=i[n]._id,t=r[1][e],o=r[2][e],t&&this._requestAction(t,1),o&&this._requestAction(o,2);for(n=0;n<a.length;n++)a[n].computeScrollValues()},Xe.prototype._applyActions=function(){var e,t=this._actions,o=this._items;if(t.length){for(e=0;e<t.length;e++)t[e].scroll(),this._actionPool.release(t[e]);for(t.length=0,e=0;e<o.length;e++)ke(o[e]);for(e=0;e<o.length;e++)Te(o[e])}},Xe.prototype._updateDragDirection=function(e){var t=this._dragPositions[e._id],o=this._dragDirections[e._id],n=e._drag._left,i=e._drag._top;if(t.length){var r=t[0],a=t[1];o[0]=n>r?5:n<r?9:o[0]||0,o[1]=i>a?6:i<a?10:o[1]||0}t[0]=n,t[1]=i},Xe.prototype.addItem=function(e){this._isDestroyed||-1===this._items.indexOf(e)&&(this._items.push(e),this._requestOverlapCheck[e._id]=this._tickTime,this._dragDirections[e._id]=[0,0],this._dragPositions[e._id]=[],this._isTicking||this._startTicking())},Xe.prototype.updateItem=function(e){this._isDestroyed||this._dragDirections[e._id]&&(this._updateDragDirection(e),this._requestOverlapCheck[e._id]||(this._requestOverlapCheck[e._id]=this._tickTime))},Xe.prototype.removeItem=function(e){if(!this._isDestroyed){var t=this._items.indexOf(e);if(-1!==t){var o=e._id;this._requests[1][o]&&(this._cancelItemScroll(e,1),delete this._requests[1][o]),this._requests[2][o]&&(this._cancelItemScroll(e,2),delete this._requests[2][o]),delete this._requestOverlapCheck[o],delete this._dragPositions[o],delete this._dragDirections[o],this._items.splice(t,1),this._isTicking&&!this._items.length&&this._stopTicking()}}},Xe.prototype.isItemScrollingX=function(e){var t=this._requests[1][e._id];return!(!t||!t.isActive)},Xe.prototype.isItemScrollingY=function(e){var t=this._requests[2][e._id];return!(!t||!t.isActive)},Xe.prototype.isItemScrolling=function(e){return this.isItemScrollingX(e)||this.isItemScrollingY(e)},Xe.prototype.destroy=function(){if(!this._isDestroyed){for(var e=this._items.slice(0),t=0;t<e.length;t++)this.removeItem(e[t]);this._actions.length=0,this._requestPool.reset(),this._actionPool.reset(),this._isDestroyed=!0}};var Ye=window.Element.prototype,Pe=Ye.matches||Ye.matchesSelector||Ye.webkitMatchesSelector||Ye.mozMatchesSelector||Ye.msMatchesSelector||Ye.oMatchesSelector||function(){return!1};function Ie(e,t){return Pe.call(e,t)}function He(e,t){t&&(e.classList?e.classList.add(t):Ie(e,"."+t)||(e.className+=" "+t))}var je=[];function Fe(e,t,o){var n="number"==typeof o?o:-1;n<0&&(n=e.length-n+1),e.splice.apply(e,je.concat(n,0,t)),je.length=0}function Ge(e,t,o){var n=Math.max(0,e.length-1+(o||0));return t>n?n:t<0?Math.max(n+t+1,0):t}function $e(e,t,o){if(!(e.length<2)){var n=Ge(e,t),i=Ge(e,o);n!==i&&e.splice(i,0,e.splice(n,1)[0])}}function Ue(e,t,o){if(!(e.length<2)){var n,i=Ge(e,t),r=Ge(e,o);i!==r&&(n=e[i],e[i]=e[r],e[r]=n)}}var Ve=w(document.documentElement.style,"transform")||"transform",Je=/([A-Z])/g,Ke=/^(webkit-|moz-|ms-|o-)/,Qe=/^(-m-s-)/;function Ze(e){var t=e.replace(Je,"-$1").toLowerCase();return(t=t.replace(Ke,"-$1")).replace(Qe,"-ms-")}var et=Ze(Ve);function tt(e){var t=Ae(e,et);if(!t||"none"===t)return!1;var o=Ae(e,"display");return"inline"!==o&&"none"!==o}function ot(e){for(var t=document,o=e||t;o&&o!==t&&"static"===Ae(o,"position")&&!tt(o);)o=o.parentElement||t;return o}var nt={},it={},rt={};function at(e,t){var o,n=t||{};return n.left=0,n.top=0,e===document||(n.left=window.pageXOffset||0,n.top=window.pageYOffset||0,e.self===window.self||(o=e.getBoundingClientRect(),n.left+=o.left,n.top+=o.top,n.left+=fe(e,"border-left-width"),n.top+=fe(e,"border-top-width"))),n}function st(e,t,o){return rt.left=0,rt.top=0,e===t||o&&(e=ot(e))===(t=ot(t))||(at(e,nt),at(t,it),rt.left=it.left-nt.left,rt.top=it.top-nt.top),rt}function ct(e){return"auto"===e||"scroll"===e||"overlay"===e}function pt(e){return ct(Ae(e,"overflow"))||ct(Ae(e,"overflow-x"))||ct(Ae(e,"overflow-y"))}function bt(e,t){for(t=t||[];e&&e!==document;)e.getRootNode&&e instanceof DocumentFragment?e=e.getRootNode().host:(pt(e)&&t.push(e),e=e.parentNode);return t.push(window),t}var Mt={},dt=/^matrix3d/,lt=/([^,]*,){4}/,zt=/([^,]*,){12}/,ut=/[^,]*,/;function Ot(e){Mt.x=0,Mt.y=0;var t=Ae(e,et);if(!t||"none"===t)return Mt;var o=dt.test(t),n=t.replace(o?zt:lt,""),i=n.replace(ut,"");return Mt.x=parseFloat(n)||0,Mt.y=parseFloat(i)||0,Mt}function At(e,t){t&&(e.classList?e.classList.remove(t):Ie(e,"."+t)&&(e.className=(" "+e.className+" ").replace(" "+t+" "," ").trim()))}var ft,ht,mt,qt,_t=/^(iPad|iPhone|iPod)/.test(window.navigator.platform)||/^Mac/.test(window.navigator.platform)&&window.navigator.maxTouchPoints>1,Wt=!!R()&&{passive:!0};function gt(e){var t=e._element,o=e.getGrid(),n=o._settings;this._item=e,this._gridId=o._id,this._isDestroyed=!1,this._isMigrating=!1,this._startPredicate=ue(n.dragStartPredicate)?n.dragStartPredicate:gt.defaultStartPredicate,this._startPredicateState=0,this._startPredicateResult=void 0,this._isSortNeeded=!1,this._sortTimer=void 0,this._blockedSortIndex=null,this._sortX1=0,this._sortX2=0,this._sortY1=0,this._sortY2=0,this._reset(),this._preStartCheck=this._preStartCheck.bind(this),this._preEndCheck=this._preEndCheck.bind(this),this._onScroll=this._onScroll.bind(this),this._prepareStart=this._prepareStart.bind(this),this._applyStart=this._applyStart.bind(this),this._prepareMove=this._prepareMove.bind(this),this._applyMove=this._applyMove.bind(this),this._prepareScroll=this._prepareScroll.bind(this),this._applyScroll=this._applyScroll.bind(this),this._handleSort=this._handleSort.bind(this),this._handleSortDelayed=this._handleSortDelayed.bind(this),this._handle=n.dragHandle&&t.querySelector(n.dragHandle)||t,this._dragger=new x(this._handle,n.dragCssProps),this._dragger.on("start",this._preStartCheck),this._dragger.on("move",this._preStartCheck),this._dragger.on("cancel",this._preEndCheck),this._dragger.on("end",this._preEndCheck)}function yt(e,t){var o,n,i={};if(Array.isArray(t))for(n=0;n<t.length;n++)i[o=t[n]]=Ae(e,Ze(o));else for(o in t)i[o]=Ae(e,Ze(o));return i}gt.autoScroller=new Xe,gt.defaultStartPredicate=function(e,t,o){var n=e._drag;if(t.isFirst&&t.srcEvent.button)return!1;if(!_t&&t.isFirst&&!0===t.srcEvent.isTrusted&&!1===t.srcEvent.defaultPrevented&&!1===t.srcEvent.cancelable)return!1;if(!t.isFinal){var i=n._startPredicateData;if(!i){var r=o||n._getGrid()._settings.dragStartPredicate||{};n._startPredicateData=i={distance:Math.max(r.distance,0)||0,delay:Math.max(r.delay,0)||0}}return i.delay&&(i.event=t,i.delayTimer||(i.delayTimer=window.setTimeout(function(){i.delay=0,n._resolveStartPredicate(i.event)&&(n._forceResolveStartPredicate(i.event),n._resetStartPredicate())},i.delay))),n._resolveStartPredicate(t)}n._finishStartPredicate(t)},gt.defaultSortPredicate=(ft={},ht={},mt={},qt=[],function(e,t){var o=e._drag,n=o._getGrid(),i=t&&"number"==typeof t.threshold?t.threshold:50,s=t&&t.action===r?r:a,c=t&&t.migrateAction===r?r:a;i=Math.min(Math.max(i,1),100),ft.width=e._width,ft.height=e._height,ft.left=o._clientX,ft.top=o._clientY;var p=function(e,t,o){var n,i,r,a,s,c,p,b,M,d,l=null,z=t._settings.dragSort,u=-1;if(!0===z?(qt[0]=t,i=qt):ue(z)&&(i=z.call(t,e)),!i||!Array.isArray(i)||!i.length)return l;for(d=0;d<i.length;d++)if(!(r=i[d])._isDestroyed){for(r._updateBoundingRect(),c=Math.max(0,r._left),p=Math.max(0,r._top),b=Math.min(window.innerWidth,r._right),M=Math.min(window.innerHeight,r._bottom),a=r._element.parentNode;a&&a!==document&&a!==document.documentElement&&a!==document.body;)if(a.getRootNode&&a instanceof DocumentFragment)a=a.getRootNode().host;else{if("visible"!==Ae(a,"overflow")&&(s=a.getBoundingClientRect(),c=Math.max(c,s.left),p=Math.max(p,s.top),b=Math.min(b,s.right),M=Math.min(M,s.bottom)),"fixed"===Ae(a,"position"))break;a=a.parentNode}c>=b||p>=M||(ht.left=c,ht.top=p,ht.width=b-c,ht.height=M-p,(n=Ce(ft,ht))>o&&n>u&&(u=n,l=r))}return qt.length=0,l}(e,n,i);if(!p)return null;var b,M,d,l=e.getGrid()!==p,z=0,u=0,O=0,A=-1,f=!1;for(p===n?(ft.left=o._gridX+e._marginLeft,ft.top=o._gridY+e._marginTop):(p._updateBorders(1,0,1,0),z=p._left+p._borderLeft,u=p._top+p._borderTop),d=0;d<p._items.length;d++)(b=p._items[d])._isActive&&b!==e&&(f=!0,ht.width=b._width,ht.height=b._height,ht.left=b._left+b._marginLeft+z,ht.top=b._top+b._marginTop+u,(M=Ce(ft,ht))>O&&(A=d,O=M));return l&&O<i&&(A=f?A:0,O=i),O>=i?(mt.grid=p,mt.index=A,mt.action=l?c:s,mt):null}),gt.prototype.stop=function(){if(this._isActive)if(this._isMigrating)this._finishMigration();else{var e=this._item,t=e._id;if(gt.autoScroller.removeItem(e),pe(t),be(t),Me(t),this._cancelSort(),this._isStarted){this._unbindScrollListeners();var o=e._element,n=this._getGrid(),i=n._settings.itemDraggingClass;o.parentNode!==n._element&&(n._element.appendChild(o),e._setTranslate(this._gridX,this._gridY),i&&o.clientWidth),At(o,i)}this._reset()}},gt.prototype.sort=function(e){var t=this._item;this._isActive&&t._isActive&&this._dragMoveEvent&&(!0===e?this._handleSort():de(t._id,this._handleSort))},gt.prototype.destroy=function(){this._isDestroyed||(this.stop(),this._dragger.destroy(),gt.autoScroller.removeItem(this._item),this._isDestroyed=!0)},gt.prototype._getGrid=function(){return n[this._gridId]||null},gt.prototype._reset=function(){this._isActive=!1,this._isStarted=!1,this._container=null,this._containingBlock=null,this._dragStartEvent=null,this._dragMoveEvent=null,this._dragPrevMoveEvent=null,this._scrollEvent=null,this._scrollers=[],this._left=0,this._top=0,this._gridX=0,this._gridY=0,this._clientX=0,this._clientY=0,this._scrollDiffX=0,this._scrollDiffY=0,this._moveDiffX=0,this._moveDiffY=0,this._containerDiffX=0,this._containerDiffY=0},gt.prototype._bindScrollListeners=function(){var e,t,o=this._getGrid()._element,n=this._container,i=this._scrollers;if(i.length=0,bt(this._item._element.parentNode,i),n!==o)for(bt(o,e=[]),t=0;t<e.length;t++)i.indexOf(e[t])<0&&i.push(e[t]);for(t=0;t<i.length;t++)i[t].addEventListener("scroll",this._onScroll,Wt)},gt.prototype._unbindScrollListeners=function(){var e,t=this._scrollers;for(e=0;e<t.length;e++)t[e].removeEventListener("scroll",this._onScroll,Wt);t.length=0},gt.prototype._resolveStartPredicate=function(e){var t=this._startPredicateData;if(!(e.distance<t.distance||t.delay))return this._resetStartPredicate(),!0},gt.prototype._forceResolveStartPredicate=function(e){this._isDestroyed||1!==this._startPredicateState||(this._startPredicateState=2,this._onStart(e))},gt.prototype._finishStartPredicate=function(e){var t=this._item._element,o=Math.abs(e.deltaX)<2&&Math.abs(e.deltaY)<2&&e.deltaTime<200;this._resetStartPredicate(),o&&function(e){if("a"===e.tagName.toLowerCase()){var t=e.getAttribute("href");if(t){var o=e.getAttribute("target");o&&"_self"!==o?window.open(t,o):window.location.href=t}}}(t)},gt.prototype._resetHeuristics=function(e,t){this._blockedSortIndex=null,this._sortX1=this._sortX2=e,this._sortY1=this._sortY2=t},gt.prototype._checkHeuristics=function(e,t){var o=this._getGrid()._settings.dragSortHeuristics,n=o.minDragDistance;if(n<=0)return this._blockedSortIndex=null,!0;var i=e-this._sortX2,r=t-this._sortY2,a=n>3&&o.minBounceBackAngle>0;if(a||(this._blockedSortIndex=null),Math.abs(i)>n||Math.abs(r)>n){if(a){var s=Math.atan2(i,r),c=Math.atan2(this._sortX2-this._sortX1,this._sortY2-this._sortY1),p=Math.atan2(Math.sin(s-c),Math.cos(s-c));Math.abs(p)>o.minBounceBackAngle&&(this._blockedSortIndex=null)}return this._sortX1=this._sortX2,this._sortY1=this._sortY2,this._sortX2=e,this._sortY2=t,!0}return!1},gt.prototype._resetStartPredicate=function(){var e=this._startPredicateData;e&&(e.delayTimer&&(e.delayTimer=window.clearTimeout(e.delayTimer)),this._startPredicateData=null)},gt.prototype._handleSort=function(){if(this._isActive){var e=this._getGrid()._settings;if(!e.dragSort||!e.dragAutoScroll.sortDuringScroll&&gt.autoScroller.isItemScrolling(this._item))return this._sortX1=this._sortX2=this._gridX,this._sortY1=this._sortY2=this._gridY,this._isSortNeeded=!0,void(void 0!==this._sortTimer&&(this._sortTimer=window.clearTimeout(this._sortTimer)));var t=this._checkHeuristics(this._gridX,this._gridY);if(this._isSortNeeded||t){var o=e.dragSortHeuristics.sortInterval;o<=0||this._isSortNeeded?(this._isSortNeeded=!1,void 0!==this._sortTimer&&(this._sortTimer=window.clearTimeout(this._sortTimer)),this._checkOverlap()):void 0===this._sortTimer&&(this._sortTimer=window.setTimeout(this._handleSortDelayed,o))}}},gt.prototype._handleSortDelayed=function(){this._isSortNeeded=!0,this._sortTimer=void 0,de(this._item._id,this._handleSort)},gt.prototype._cancelSort=function(){var e;this._isSortNeeded=!1,void 0!==this._sortTimer&&(this._sortTimer=window.clearTimeout(this._sortTimer)),e=this._item._id,ae.remove(1,Z+e)},gt.prototype._finishSort=function(){var e=this._getGrid()._settings.dragSort&&(this._isSortNeeded||void 0!==this._sortTimer);this._cancelSort(),e&&this._checkOverlap()},gt.prototype._checkOverlap=function(){if(this._isActive){var e,t,o,n,i,s,c,p,b=this._item,M=this._getGrid()._settings;(e=ue(M.dragSortPredicate)?M.dragSortPredicate(b,this._dragMoveEvent):gt.defaultSortPredicate(b,M.dragSortPredicate))&&"number"==typeof e.index&&(c=e.action===r?r:a,p=(t=b.getGrid())!==(n=e.grid||t),o=t._items.indexOf(b),i=Ge(n._items,e.index,p&&c===a?1:0),(p||i!==this._blockedSortIndex)&&(p?(this._blockedSortIndex=null,s=n._items[i],t._hasListeners(O)&&t._emit(O,{item:b,fromGrid:t,fromIndex:o,toGrid:n,toIndex:i}),n._hasListeners(f)&&n._emit(f,{item:b,fromGrid:t,fromIndex:o,toGrid:n,toIndex:i}),b._gridId=n._id,this._isMigrating=b._gridId!==this._gridId,t._items.splice(o,1),Fe(n._items,b,i),b._sortData=null,t._hasListeners(u)&&t._emit(u,{item:b,fromGrid:t,fromIndex:o,toGrid:n,toIndex:i}),n._hasListeners(A)&&n._emit(A,{item:b,fromGrid:t,fromIndex:o,toGrid:n,toIndex:i}),c===r&&s&&s.isActive()&&n._items.indexOf(s)>-1&&n.send(s,t,o,{appendTo:this._container||document.body,layoutSender:!1,layoutReceiver:!1}),t.layout(),n.layout()):o!==i&&(this._blockedSortIndex=o,(c===r?Ue:$e)(t._items,o,i),t._hasListeners(z)&&t._emit(z,{item:b,fromIndex:o,toIndex:i,action:c}),t.layout())))}},gt.prototype._finishMigration=function(){var e,t,o=this._item,n=o._dragRelease,i=o._element,r=o._isActive,a=o.getGrid(),s=a._element,c=a._settings,p=c.dragContainer||s,b=this._getGrid()._settings,M=i.parentNode,d=r?b.itemVisibleClass:b.itemHiddenClass,l=r?c.itemVisibleClass:c.itemHiddenClass;this._isMigrating=!1,this.destroy(),b.itemClass!==c.itemClass&&(At(i,b.itemClass),He(i,c.itemClass)),d!==l&&(At(i,d),He(i,l)),p!==M&&(p.appendChild(i),t=st(M,p,!0),(e=Ot(i)).x-=t.left,e.y-=t.top),o._refreshDimensions(),t=st(p,s,!0),n._containerDiffX=t.left,n._containerDiffY=t.top,o._drag=c.dragEnabled?new gt(o):null,p!==M&&o._setTranslate(e.x,e.y),o._visibility.setStyles(r?c.visibleStyles:c.hiddenStyles),n.start()},gt.prototype._preStartCheck=function(e){0===this._startPredicateState&&(this._startPredicateState=1),1===this._startPredicateState?(this._startPredicateResult=this._startPredicate(this._item,e),!0===this._startPredicateResult?(this._startPredicateState=2,this._onStart(e)):!1===this._startPredicateResult&&(this._resetStartPredicate(e),this._dragger._reset(),this._startPredicateState=0)):2===this._startPredicateState&&this._isActive&&this._onMove(e)},gt.prototype._preEndCheck=function(e){var t=2===this._startPredicateState;this._startPredicate(this._item,e),this._startPredicateState=0,t&&this._isActive&&(this._isStarted?this._onEnd(e):this.stop())},gt.prototype._onStart=function(e){var t,o,n,i=this._item;i._isActive&&(this._isActive=!0,this._dragStartEvent=e,gt.autoScroller.addItem(i),t=i._id,o=this._prepareStart,n=this._applyStart,ae.add(0,$+t,o),ae.add(2,U+t,n))},gt.prototype._prepareStart=function(){if(this._isActive){var e=this._item;if(e._isActive){var t=e._element,o=this._getGrid(),n=o._settings,i=o._element,r=n.dragContainer||i,a=ot(r),s=Ot(t),c=t.getBoundingClientRect(),p=r!==i;if(this._container=r,this._containingBlock=a,this._clientX=c.left,this._clientY=c.top,this._left=this._gridX=s.x,this._top=this._gridY=s.y,this._scrollDiffX=this._scrollDiffY=0,this._moveDiffX=this._moveDiffY=0,this._resetHeuristics(this._gridX,this._gridY),p){var b=st(a,i);this._containerDiffX=b.left,this._containerDiffY=b.top}}}},gt.prototype._applyStart=function(){if(this._isActive){var e=this._item;if(e._isActive){var t=this._getGrid(),o=e._element,n=e._dragRelease,i=e._migrate,r=this._container!==t._element;e.isPositioning()&&e._layout.stop(!0,this._left,this._top),i._isActive&&(this._left-=i._containerDiffX,this._top-=i._containerDiffY,this._gridX-=i._containerDiffX,this._gridY-=i._containerDiffY,i.stop(!0,this._left,this._top)),e.isReleasing()&&n._reset(),t._settings.dragPlaceholder.enabled&&e._dragPlaceholder.create(),this._isStarted=!0,t._emit("dragInit",e,this._dragStartEvent),r&&(o.parentNode===this._container?(this._gridX-=this._containerDiffX,this._gridY-=this._containerDiffY):(this._left+=this._containerDiffX,this._top+=this._containerDiffY,this._container.appendChild(o),e._setTranslate(this._left,this._top))),He(o,t._settings.itemDraggingClass),this._bindScrollListeners(),t._emit("dragStart",e,this._dragStartEvent)}}},gt.prototype._onMove=function(e){var t,o,n,i=this._item;i._isActive?(this._dragMoveEvent=e,t=i._id,o=this._prepareMove,n=this._applyMove,ae.add(0,V+t,o),ae.add(2,J+t,n),de(i._id,this._handleSort)):this.stop()},gt.prototype._prepareMove=function(){if(this._isActive&&this._item._isActive){var e=this._getGrid()._settings.dragAxis,t=this._dragMoveEvent,o=this._dragPrevMoveEvent||this._dragStartEvent||t;if("y"!==e){var n=t.clientX-o.clientX;this._left=this._left-this._moveDiffX+n,this._gridX=this._gridX-this._moveDiffX+n,this._clientX=this._clientX-this._moveDiffX+n,this._moveDiffX=n}if("x"!==e){var i=t.clientY-o.clientY;this._top=this._top-this._moveDiffY+i,this._gridY=this._gridY-this._moveDiffY+i,this._clientY=this._clientY-this._moveDiffY+i,this._moveDiffY=i}this._dragPrevMoveEvent=t}},gt.prototype._applyMove=function(){if(this._isActive){var e=this._item;e._isActive&&(this._moveDiffX=this._moveDiffY=0,e._setTranslate(this._left,this._top),this._getGrid()._emit("dragMove",e,this._dragMoveEvent),gt.autoScroller.updateItem(e))}},gt.prototype._onScroll=function(e){var t,o,n,i=this._item;i._isActive?(this._scrollEvent=e,t=i._id,o=this._prepareScroll,n=this._applyScroll,ae.add(0,K+t,o),ae.add(2,Q+t,n),de(i._id,this._handleSort)):this.stop()},gt.prototype._prepareScroll=function(){if(this._isActive){var e=this._item;if(e._isActive){var t=e._element,o=this._getGrid()._element,n=t.getBoundingClientRect();if(this._container!==o){var i=st(this._containingBlock,o);this._containerDiffX=i.left,this._containerDiffY=i.top}var r=this._clientX-this._moveDiffX-n.left;this._left=this._left-this._scrollDiffX+r,this._scrollDiffX=r;var a=this._clientY-this._moveDiffY-n.top;this._top=this._top-this._scrollDiffY+a,this._scrollDiffY=a,this._gridX=this._left-this._containerDiffX,this._gridY=this._top-this._containerDiffY}}},gt.prototype._applyScroll=function(){if(this._isActive){var e=this._item;e._isActive&&(this._scrollDiffX=this._scrollDiffY=0,e._setTranslate(this._left,this._top),this._getGrid()._emit("dragScroll",e,this._scrollEvent))}},gt.prototype._onEnd=function(e){var t=this._item,o=t._element,n=this._getGrid(),i=n._settings,r=t._dragRelease;t._isActive?(pe(t._id),be(t._id),Me(t._id),this._finishSort(),this._unbindScrollListeners(),r._containerDiffX=this._containerDiffX,r._containerDiffY=this._containerDiffY,this._reset(),At(o,i.itemDraggingClass),gt.autoScroller.removeItem(t),n._emit("dragEnd",t,e),this._isMigrating?this._finishMigration():r.start()):this.stop()};var vt=/^(webkit|moz|ms|o|Webkit|Moz|MS|O)(?=[A-Z])/,Lt={};function wt(e){var t=Lt[e];return t||((t=e.replace(vt,""))!==e&&(t=t[0].toLowerCase()+t.slice(1)),Lt[e]=t,t)}function Rt(e,t){for(var o in t)e.style[o]=t[o]}var kt,Tt,St=!(!Element||!ue(Element.prototype.animate)),Et=!!(Element&&(kt=Element.prototype.animate,Tt=window.Symbol,kt&&ue(Tt)&&ue(Tt.toString)&&Tt(kt).toString().indexOf("[native code]")>-1));function Nt(e){this._element=e,this._animation=null,this._duration=0,this._easing="",this._callback=null,this._props=[],this._values=[],this._isDestroyed=!1,this._onFinish=this._onFinish.bind(this)}function Bt(e,t){var o={};for(var n in e)o[t?n:wt(n)]=e[n];return o}function Ct(e,t){return"translateX("+e+"px) translateY("+t+"px)"}function Dt(e){this._item=e,this._animation=new Nt,this._element=null,this._className="",this._didMigrate=!1,this._resetAfterLayout=!1,this._left=0,this._top=0,this._transX=0,this._transY=0,this._nextTransX=0,this._nextTransY=0,this._setupAnimation=this._setupAnimation.bind(this),this._startAnimation=this._startAnimation.bind(this),this._updateDimensions=this._updateDimensions.bind(this),this._onLayoutStart=this._onLayoutStart.bind(this),this._onLayoutEnd=this._onLayoutEnd.bind(this),this._onReleaseEnd=this._onReleaseEnd.bind(this),this._onMigrate=this._onMigrate.bind(this),this._onHide=this._onHide.bind(this)}function xt(e){this._item=e,this._isActive=!1,this._isDestroyed=!1,this._isPositioningStarted=!1,this._containerDiffX=0,this._containerDiffY=0}function Xt(e){var t=e._element,o=t.style;this._item=e,this._isActive=!1,this._isDestroyed=!1,this._isInterrupted=!1,this._currentStyles={},this._targetStyles={},this._nextLeft=0,this._nextTop=0,this._offsetLeft=0,this._offsetTop=0,this._skipNextAnimation=!1,this._animOptions={onFinish:this._finish.bind(this),duration:0,easing:0},o.left="0px",o.top="0px",e._setTranslate(0,0),this._animation=new Nt(t),this._queue="layout-"+e._id,this._setupAnimation=this._setupAnimation.bind(this),this._startAnimation=this._startAnimation.bind(this)}function Yt(e){this._item=e,this._isActive=!1,this._isDestroyed=!1,this._container=!1,this._containerDiffX=0,this._containerDiffY=0}function Pt(e){var t=e._isActive,o=e._element,n=o.children[0],i=e.getGrid()._settings;if(!n)throw new Error("No valid child element found within item element.");this._item=e,this._isDestroyed=!1,this._isHidden=!t,this._isHiding=!1,this._isShowing=!1,this._childElement=n,this._currentStyleProps=[],this._animation=new Nt(n),this._queue="visibility-"+e._id,this._finishShow=this._finishShow.bind(this),this._finishHide=this._finishHide.bind(this),o.style.display=t?"":"none",He(o,t?i.itemVisibleClass:i.itemHiddenClass),this.setStyles(t?i.visibleStyles:i.hiddenStyles)}Nt.prototype.start=function(e,t,o){if(!this._isDestroyed){var n=this._element,i=o||{};if(!St)return Rt(n,t),this._callback=ue(i.onFinish)?i.onFinish:null,void this._onFinish();var r,a,s,c=this._animation,p=this._props,b=this._values,M=i.duration||300,d=i.easing||"ease",l=!1;if(c&&(a=0,M===this._duration&&d===this._easing||(l=!0),!l)){for(r in t)if(++a,-1===(s=p.indexOf(r))||t[r]!==b[s]){l=!0;break}a!==p.length&&(l=!0)}if(l&&c.cancel(),this._callback=ue(i.onFinish)?i.onFinish:null,!c||l){for(r in p.length=b.length=0,t)p.push(r),b.push(t[r]);this._duration=M,this._easing=d,this._animation=n.animate([Bt(e,Et),Bt(t,Et)],{duration:M,easing:d}),this._animation.onfinish=this._onFinish,Rt(n,t)}}},Nt.prototype.stop=function(){!this._isDestroyed&&this._animation&&(this._animation.cancel(),this._animation=this._callback=null,this._props.length=this._values.length=0)},Nt.prototype.getCurrentStyles=function(){return yt(element,currentProps)},Nt.prototype.isAnimating=function(){return!!this._animation},Nt.prototype.destroy=function(){this._isDestroyed||(this.stop(),this._element=null,this._isDestroyed=!0)},Nt.prototype._onFinish=function(){var e=this._callback;this._animation=this._callback=null,this._props.length=this._values.length=0,e&&e()},Dt.prototype._updateDimensions=function(){this.isActive()&&Rt(this._element,{width:this._item._width+"px",height:this._item._height+"px"})},Dt.prototype._onLayoutStart=function(e,t){var o=this._item;if(-1!==e.indexOf(o)){var n=o._left,i=o._top,r=this._left,a=this._top;if(this._left=n,this._top=i,t||this._didMigrate||r!==n||a!==i){var s,c,p,b=n+o._marginLeft,M=i+o._marginTop,d=o.getGrid();if(t||!(d._settings.layoutDuration>0)||this._didMigrate)return le(o._id),this._element.style[Ve]=Ct(b,M),this._animation.stop(),void(this._didMigrate&&(d.getElement().appendChild(this._element),this._didMigrate=!1));this._nextTransX=b,this._nextTransY=M,s=o._id,c=this._setupAnimation,p=this._startAnimation,ae.add(0,ee+s,c),ae.add(2,te+s,p)}}else this.reset()},Dt.prototype._setupAnimation=function(){if(this.isActive()){var e=Ot(this._element);this._transX=e.x,this._transY=e.y}},Dt.prototype._startAnimation=function(){if(this.isActive()){var e=this._animation,t=this._transX,o=this._transY,n=this._nextTransX,i=this._nextTransY;if(t!==n||o!==i){var r=this._item.getGrid()._settings,a={},s={};a[Ve]=Ct(t,o),s[Ve]=Ct(n,i),e.start(a,s,{duration:r.layoutDuration,easing:r.layoutEasing,onFinish:this._onLayoutEnd})}else e.isAnimating()&&(this._element.style[Ve]=Ct(n,i),e.stop())}},Dt.prototype._onLayoutEnd=function(){this._resetAfterLayout&&this.reset()},Dt.prototype._onReleaseEnd=function(e){if(e._id===this._item._id){if(!this._animation.isAnimating())return void this.reset();this._resetAfterLayout=!0}},Dt.prototype._onMigrate=function(e){if(e.item===this._item){var t=this._item.getGrid(),o=e.toGrid;t.off(h,this._onReleaseEnd),t.off(s,this._onLayoutStart),t.off(O,this._onMigrate),t.off(M,this._onHide),o.on(h,this._onReleaseEnd),o.on(s,this._onLayoutStart),o.on(O,this._onMigrate),o.on(M,this._onHide),this._didMigrate=!0}},Dt.prototype._onHide=function(e){e.indexOf(this._item)>-1&&this.reset()},Dt.prototype.create=function(){if(this.isActive())this._resetAfterLayout=!1;else{var e,t=this._item,o=t.getGrid(),n=o._settings,i=this._animation;this._left=t._left,this._top=t._top,e=ue(n.dragPlaceholder.createElement)?n.dragPlaceholder.createElement(t):document.createElement("div"),this._element=e,i._element=e,this._className=n.itemPlaceholderClass||"",this._className&&He(e,this._className),Rt(e,{position:"absolute",left:"0px",top:"0px",width:t._width+"px",height:t._height+"px"}),e.style[Ve]=Ct(t._left+t._marginLeft,t._top+t._marginTop),o.on(s,this._onLayoutStart),o.on(h,this._onReleaseEnd),o.on(O,this._onMigrate),o.on(M,this._onHide),ue(n.dragPlaceholder.onCreate)&&n.dragPlaceholder.onCreate(t,e),o.getElement().appendChild(e)}},Dt.prototype.reset=function(){if(this.isActive()){var e,t=this._element,o=this._item,n=o.getGrid(),i=n._settings,r=this._animation;this._resetAfterLayout=!1,le(o._id),e=o._id,ae.remove(2,oe+e),r.stop(),r._element=null,n.off(h,this._onReleaseEnd),n.off(s,this._onLayoutStart),n.off(O,this._onMigrate),n.off(M,this._onHide),this._className&&(At(t,this._className),this._className=""),t.parentNode.removeChild(t),this._element=null,ue(i.dragPlaceholder.onRemove)&&i.dragPlaceholder.onRemove(o,t)}},Dt.prototype.isActive=function(){return!!this._element},Dt.prototype.getElement=function(){return this._element},Dt.prototype.updateDimensions=function(){var e,t;this.isActive()&&(e=this._item._id,t=this._updateDimensions,ae.add(2,oe+e,t))},Dt.prototype.destroy=function(){this.reset(),this._animation.destroy(),this._item=this._animation=null},xt.prototype.start=function(){if(!this._isDestroyed&&!this._isActive){var e=this._item,t=e.getGrid(),o=t._settings;this._isActive=!0,He(e._element,o.itemReleasingClass),o.dragRelease.useDragContainer||this._placeToGrid(),t._emit("dragReleaseStart",e),t._nextLayoutData||e._layout.start(!1)}},xt.prototype.stop=function(e,t,o){if(!this._isDestroyed&&this._isActive){var n=this._item,i=n.getGrid();e||void 0!==t&&void 0!==o||(t=n._left,o=n._top);var r=this._placeToGrid(t,o);this._reset(r),e||i._emit(h,n)}},xt.prototype.isJustReleased=function(){return this._isActive&&!1===this._isPositioningStarted},xt.prototype.destroy=function(){this._isDestroyed||(this.stop(!0),this._item=null,this._isDestroyed=!0)},xt.prototype._placeToGrid=function(e,t){if(!this._isDestroyed){var o=this._item,n=o._element,i=o.getGrid()._element,r=!1;if(n.parentNode!==i){if(void 0===e||void 0===t){var a=Ot(n);e=a.x-this._containerDiffX,t=a.y-this._containerDiffY}i.appendChild(n),o._setTranslate(e,t),r=!0}return this._containerDiffX=0,this._containerDiffY=0,r}},xt.prototype._reset=function(e){if(!this._isDestroyed){var t=this._item,o=t.getGrid()._settings.itemReleasingClass;this._isActive=!1,this._isPositioningStarted=!1,this._containerDiffX=0,this._containerDiffY=0,o&&(e&&t._element.clientWidth,At(t._element,o))}},Xt.prototype.start=function(e,t){if(!this._isDestroyed){var o,n,i,r=this._item,a=r._dragRelease,s=r.getGrid()._settings,c=this._isActive,p=a.isJustReleased(),b=p?s.dragRelease.duration:s.layoutDuration,M=p?s.dragRelease.easing:s.layoutEasing,d=!e&&!this._skipNextAnimation&&b>0;if(c&&(se(r._id),r._emitter.burst(this._queue,!0,r)),p&&(a._isPositioningStarted=!0),ue(t)&&r._emitter.on(this._queue,t),this._skipNextAnimation=!1,!d)return this._updateOffsets(),r._setTranslate(this._nextLeft,this._nextTop),this._animation.stop(),void this._finish();this._animation.isAnimating()&&(this._animation._animation.onfinish=null),this._isActive=!0,this._animOptions.easing=M,this._animOptions.duration=b,this._isInterrupted=c,o=r._id,n=this._setupAnimation,i=this._startAnimation,ae.add(0,H+o,n),ae.add(2,j+o,i)}},Xt.prototype.stop=function(e,t,o){if(!this._isDestroyed&&this._isActive){var n=this._item;if(se(n._id),this._animation.isAnimating()){if(void 0===t||void 0===o){var i=Ot(n._element);t=i.x,o=i.y}n._setTranslate(t,o),this._animation.stop()}At(n._element,n.getGrid()._settings.itemPositioningClass),this._isActive=!1,e&&n._emitter.burst(this._queue,!0,n)}},Xt.prototype.destroy=function(){if(!this._isDestroyed){var e=this._item._element.style;this.stop(!0,0,0),this._item._emitter.clear(this._queue),this._animation.destroy(),e[Ve]="",e.left="",e.top="",this._item=null,this._currentStyles=null,this._targetStyles=null,this._animOptions=null,this._isDestroyed=!0}},Xt.prototype._updateOffsets=function(){if(!this._isDestroyed){var e=this._item,t=e._migrate,o=e._dragRelease;this._offsetLeft=o._isActive?o._containerDiffX:t._isActive?t._containerDiffX:0,this._offsetTop=o._isActive?o._containerDiffY:t._isActive?t._containerDiffY:0,this._nextLeft=this._item._left+this._offsetLeft,this._nextTop=this._item._top+this._offsetTop}},Xt.prototype._finish=function(){if(!this._isDestroyed){var e=this._item,t=e._migrate,o=e._dragRelease;e._tX=this._nextLeft,e._tY=this._nextTop,this._isActive&&(this._isActive=!1,At(e._element,e.getGrid()._settings.itemPositioningClass)),o._isActive&&o.stop(),t._isActive&&t.stop(),e._emitter.burst(this._queue,!1,e)}},Xt.prototype._setupAnimation=function(){var e=this._item;if(void 0===e._tX||void 0===e._tY){var t=Ot(e._element);e._tX=t.x,e._tY=t.y}},Xt.prototype._startAnimation=function(){var e=this._item,t=e.getGrid()._settings,o=this._animOptions.duration<=0;this._updateOffsets();var n=Math.abs(e._left-(e._tX-this._offsetLeft)),i=Math.abs(e._top-(e._tY-this._offsetTop));if(o||n<2&&i<2)return(n||i||this._isInterrupted)&&e._setTranslate(this._nextLeft,this._nextTop),this._animation.stop(),void this._finish();this._isInterrupted||He(e._element,t.itemPositioningClass),this._currentStyles[Ve]=Ct(e._tX,e._tY),this._targetStyles[Ve]=Ct(this._nextLeft,this._nextTop),e._tX=e._tY=void 0,this._animation.start(this._currentStyles,this._targetStyles,this._animOptions)},Yt.prototype.start=function(e,t,o){if(!this._isDestroyed){var n,i,r,a,s,c,p,b,M,d,l=this._item,z=l._element,h=l.isActive(),m=l.isVisible(),q=l.getGrid(),_=q._settings,W=e._settings,g=e._element,y=e._items,v=q._items.indexOf(l),L=o||document.body;if("number"==typeof t)n=Ge(y,t,1);else{if(!(i=e.getItem(t)))return;n=y.indexOf(i)}(l.isPositioning()||this._isActive||l.isReleasing())&&(p=(c=Ot(z)).x,b=c.y),l.isPositioning()&&l._layout.stop(!0,p,b),this._isActive&&(p-=this._containerDiffX,b-=this._containerDiffY,this.stop(!0,p,b)),l.isReleasing()&&(p-=l._dragRelease._containerDiffX,b-=l._dragRelease._containerDiffY,l._dragRelease.stop(!0,p,b)),l._visibility.stop(!0),l._drag&&l._drag.destroy(),q._hasListeners(O)&&q._emit(O,{item:l,fromGrid:q,fromIndex:v,toGrid:e,toIndex:n}),e._hasListeners(f)&&e._emit(f,{item:l,fromGrid:q,fromIndex:v,toGrid:e,toIndex:n}),_.itemClass!==W.itemClass&&(At(z,_.itemClass),He(z,W.itemClass)),(M=m?_.itemVisibleClass:_.itemHiddenClass)!==(d=m?W.itemVisibleClass:W.itemHiddenClass)&&(At(z,M),He(z,d)),q._items.splice(v,1),Fe(y,l,n),l._gridId=e._id,h?L!==(r=z.parentNode)&&(L.appendChild(z),a=st(L,r,!0),c||(p=(c=Ot(z)).x,b=c.y),l._setTranslate(p+a.left,b+a.top)):g.appendChild(z),l._visibility.setStyles(m?W.visibleStyles:W.hiddenStyles),h&&(s=st(L,g,!0)),l._refreshDimensions(),l._sortData=null,l._drag=W.dragEnabled?new gt(l):null,h?(this._isActive=!0,this._container=L,this._containerDiffX=s.left,this._containerDiffY=s.top):(this._isActive=!1,this._container=null,this._containerDiffX=0,this._containerDiffY=0),q._hasListeners(u)&&q._emit(u,{item:l,fromGrid:q,fromIndex:v,toGrid:e,toIndex:n}),e._hasListeners(A)&&e._emit(A,{item:l,fromGrid:q,fromIndex:v,toGrid:e,toIndex:n})}},Yt.prototype.stop=function(e,t,o){if(!this._isDestroyed&&this._isActive){var n,i=this._item,r=i._element,a=i.getGrid()._element;this._container!==a&&(void 0!==t&&void 0!==o||(e?(t=(n=Ot(r)).x-this._containerDiffX,o=n.y-this._containerDiffY):(t=i._left,o=i._top)),a.appendChild(r),i._setTranslate(t,o)),this._isActive=!1,this._container=null,this._containerDiffX=0,this._containerDiffY=0}},Yt.prototype.destroy=function(){this._isDestroyed||(this.stop(!0),this._item=null,this._isDestroyed=!0)},Pt.prototype.show=function(e,t){if(!this._isDestroyed){var o=this._item,n=o._element,i=ue(t)?t:null,r=o.getGrid()._settings;this._isShowing||this._isHidden?!this._isShowing||e?(this._isShowing||(o._emitter.burst(this._queue,!0,o),At(n,r.itemHiddenClass),He(n,r.itemVisibleClass),this._isHiding||(n.style.display="")),i&&o._emitter.on(this._queue,i),this._isShowing=!0,this._isHiding=this._isHidden=!1,this._startAnimation(!0,e,this._finishShow)):i&&o._emitter.on(this._queue,i):i&&i(!1,o)}},Pt.prototype.hide=function(e,t){if(!this._isDestroyed){var o=this._item,n=o._element,i=ue(t)?t:null,r=o.getGrid()._settings;this._isHiding||!this._isHidden?!this._isHiding||e?(this._isHiding||(o._emitter.burst(this._queue,!0,o),He(n,r.itemHiddenClass),At(n,r.itemVisibleClass)),i&&o._emitter.on(this._queue,i),this._isHidden=this._isHiding=!0,this._isShowing=!1,this._startAnimation(!1,e,this._finishHide)):i&&o._emitter.on(this._queue,i):i&&i(!1,o)}},Pt.prototype.stop=function(e){if(!this._isDestroyed&&(this._isHiding||this._isShowing)){var t=this._item;ce(t._id),this._animation.stop(),e&&t._emitter.burst(this._queue,!0,t)}},Pt.prototype.setStyles=function(e){var t=this._childElement,o=this._currentStyleProps;for(var n in this._removeCurrentStyles(),e)o.push(n),t.style[n]=e[n]},Pt.prototype.destroy=function(){if(!this._isDestroyed){var e=this._item,t=e._element,o=e.getGrid()._settings;this.stop(!0),e._emitter.clear(this._queue),this._animation.destroy(),this._removeCurrentStyles(),At(t,o.itemVisibleClass),At(t,o.itemHiddenClass),t.style.display="",this._isHiding=this._isShowing=!1,this._isDestroyed=this._isHidden=!0}},Pt.prototype._startAnimation=function(e,t,o){if(!this._isDestroyed){var n,i=this._item,r=this._animation,a=this._childElement,s=i.getGrid()._settings,c=e?s.visibleStyles:s.hiddenStyles,p=e?s.showDuration:s.hideDuration,b=e?s.showEasing:s.hideEasing,M=t||p<=0;if(c){if(ce(i._id),M)return Rt(a,c),r.stop(),void(o&&o());var d,l,z;r.isAnimating()&&(r._animation.onfinish=null),d=i._id,l=function(){n=yt(a,c)},z=function(){r.start(n,c,{duration:p,easing:b,onFinish:o})},ae.add(0,F+d,l),ae.add(2,G+d,z)}else o&&o()}},Pt.prototype._finishShow=function(){this._isHidden||(this._isShowing=!1,this._item._emitter.burst(this._queue,!1,this._item))},Pt.prototype._finishHide=function(){if(this._isHidden){var e=this._item;this._isHiding=!1,e._layout.stop(!0,0,0),e._element.style.display="none",e._emitter.burst(this._queue,!1,e)}},Pt.prototype._removeCurrentStyles=function(){for(var e=this._childElement,t=this._currentStyleProps,o=0;o<t.length;o++)e.style[t[o]]="";t.length=0};var It=0;function Ht(){return++It}function jt(e,t,o){var n=e._settings;if(i){if(i.has(t))throw new Error("You can only create one Muuri Item per element!");i.set(t,this)}this._id=Ht(),this._gridId=e._id,this._element=t,this._isDestroyed=!1,this._left=0,this._top=0,this._width=0,this._height=0,this._marginLeft=0,this._marginRight=0,this._marginTop=0,this._marginBottom=0,this._tX=void 0,this._tY=void 0,this._sortData=null,this._emitter=new W,t.parentNode!==e._element&&e._element.appendChild(t),He(t,n.itemClass),"boolean"!=typeof o&&(o="none"!==Ae(t,"display")),this._isActive=o,this._visibility=new Pt(this),this._layout=new Xt(this),this._migrate=new Yt(this),this._drag=n.dragEnabled?new gt(this):null,this._dragRelease=new xt(this),this._dragPlaceholder=new Dt(this)}function Ft(e){var t,o,n,i,r,a=.001,s=.5;function c(e){return((1e3*e+.5|0)/10|0)/100}function p(){this.currentRects=[],this.nextRects=[],this.rectTarget={},this.rectStore=[],this.slotSizes=[],this.rectId=0,this.slotIndex=-1,this.slotData={left:0,top:0,width:0,height:0},this.sortRectsLeftTop=this.sortRectsLeftTop.bind(this),this.sortRectsTopLeft=this.sortRectsTopLeft.bind(this)}if(p.prototype.computeLayout=function(e,t){var o,n,i,r,a,s,p=e.items,b=e.slots,M=!!(1&t),d=!!(2&t),l=!!(4&t),z=!!(8&t),u=!!(16&t),O="number"==typeof p[0];if(!p.length)return e;for(n=O?2:1,o=0;o<p.length;o+=n)O?(r=p[o],a=p[o+1]):(r=(i=p[o])._width+i._marginLeft+i._marginRight,a=i._height+i._marginTop+i._marginBottom),u&&(r=c(r),a=c(a)),s=this.computeNextSlot(e,r,a,M,d),d?s.left+s.width>e.width&&(e.width=s.left+s.width):s.top+s.height>e.height&&(e.height=s.top+s.height),b[++this.slotIndex]=s.left,b[++this.slotIndex]=s.top,(l||z)&&this.slotSizes.push(s.width,s.height);if(l)for(o=0;o<b.length;o+=2)b[o]=e.width-(b[o]+this.slotSizes[o]);if(z)for(o=1;o<b.length;o+=2)b[o]=e.height-(b[o]+this.slotSizes[o]);return this.slotSizes.length=0,this.currentRects.length=0,this.nextRects.length=0,this.rectStore.length=0,this.rectId=0,this.slotIndex=-1,e},p.prototype.computeNextSlot=function(e,t,o,n,i){var r,c,p,b,M,d=this.slotData,l=this.currentRects,z=this.nextRects,u=!1;for(z.length=0,d.left=null,d.top=null,d.width=t,d.height=o,b=0;b<l.length;b++)if((c=l[b])&&(r=this.getRect(c),d.width<=r.width+a&&d.height<=r.height+a)){d.left=r.left,d.top=r.top;break}if(null===d.left&&(i?(d.left=e.width,d.top=0):(d.left=0,d.top=e.height),n||(u=!0)),!i&&d.top+d.height>e.height+a&&(d.left>s&&z.push(this.addRect(0,e.height,d.left,1/0)),d.left+d.width<e.width-s&&z.push(this.addRect(d.left+d.width,e.height,e.width-d.left-d.width,1/0)),e.height=d.top+d.height),i&&d.left+d.width>e.width+a&&(d.top>s&&z.push(this.addRect(e.width,0,1/0,d.top)),d.top+d.height<e.height-s&&z.push(this.addRect(e.width,d.top+d.height,1/0,e.height-d.top-d.height)),e.width=d.left+d.width),!u)for(n&&(b=0);b<l.length;b++)if(c=l[b])for(r=this.getRect(c),p=this.splitRect(r,d),M=0;M<p.length;M++)c=p[M],r=this.getRect(c),(i?r.left+a<e.width-a:r.top+a<e.height-a)&&z.push(c);return z.length>1&&this.purgeRects(z).sort(i?this.sortRectsLeftTop:this.sortRectsTopLeft),this.currentRects=z,this.nextRects=l,d},p.prototype.addRect=function(e,t,o,n){var i=++this.rectId;return this.rectStore[i]=e||0,this.rectStore[++this.rectId]=t||0,this.rectStore[++this.rectId]=o||0,this.rectStore[++this.rectId]=n||0,i},p.prototype.getRect=function(e,t){return t||(t=this.rectTarget),t.left=this.rectStore[e]||0,t.top=this.rectStore[++e]||0,t.width=this.rectStore[++e]||0,t.height=this.rectStore[++e]||0,t},p.prototype.splitRect=(t=[],o=0,n=0,function(e,i){return t.length=0,e.left+e.width<=i.left+a||i.left+i.width<=e.left+a||e.top+e.height<=i.top+a||i.top+i.height<=e.top+a?(t.push(this.addRect(e.left,e.top,e.width,e.height)),t):((o=i.left-e.left)>=s&&t.push(this.addRect(e.left,e.top,o,e.height)),(o=e.left+e.width-(i.left+i.width))>=s&&t.push(this.addRect(i.left+i.width,e.top,o,e.height)),(n=i.top-e.top)>=s&&t.push(this.addRect(e.left,e.top,e.width,n)),(n=e.top+e.height-(i.top+i.height))>=s&&t.push(this.addRect(e.left,i.top+i.height,e.width,n)),t)}),p.prototype.isRectAWithinRectB=function(e,t){return e.left+a>=t.left&&e.top+a>=t.top&&e.left+e.width-a<=t.left+t.width&&e.top+e.height-a<=t.top+t.height},p.prototype.purgeRects=(i={},r={},function(e){for(var t,o=e.length;o--;)if(t=e.length,e[o])for(this.getRect(e[o],i);t--;)if(e[t]&&o!==t&&(this.getRect(e[t],r),this.isRectAWithinRectB(i,r))){e[o]=0;break}return e}),p.prototype.sortRectsTopLeft=function(){var e={},t={};return function(o,n){return this.getRect(o,e),this.getRect(n,t),e.top<t.top&&e.top+a<t.top?-1:e.top>t.top&&e.top-a>t.top?1:e.left<t.left&&e.left+a<t.left?-1:e.left>t.left&&e.left-a>t.left?1:0}}(),p.prototype.sortRectsLeftTop=function(){var e={},t={};return function(o,n){return this.getRect(o,e),this.getRect(n,t),e.left<t.left&&e.left+a<t.left?-1:e.left>t.left&&e.left-a<t.left?1:e.top<t.top&&e.top+a<t.top?-1:e.top>t.top&&e.top-a>t.top?1:0}}(),e){var b=new p;self.onmessage=function(e){var t=new Float32Array(e.data),o=t.subarray(4,t.length),n=new Float32Array(o.length),i=t[3],r={items:o,slots:n,width:t[1],height:t[2]};b.computeLayout(r,i),t[1]=r.width,t[2]=r.height,t.set(r.slots,4),postMessage(t.buffer,[t.buffer])}}return p}jt.prototype.getGrid=function(){return n[this._gridId]},jt.prototype.getElement=function(){return this._element},jt.prototype.getWidth=function(){return this._width},jt.prototype.getHeight=function(){return this._height},jt.prototype.getMargin=function(){return{left:this._marginLeft,right:this._marginRight,top:this._marginTop,bottom:this._marginBottom}},jt.prototype.getPosition=function(){return{left:this._left,top:this._top}},jt.prototype.isActive=function(){return this._isActive},jt.prototype.isVisible=function(){return!!this._visibility&&!this._visibility._isHidden},jt.prototype.isShowing=function(){return!(!this._visibility||!this._visibility._isShowing)},jt.prototype.isHiding=function(){return!(!this._visibility||!this._visibility._isHiding)},jt.prototype.isPositioning=function(){return!(!this._layout||!this._layout._isActive)},jt.prototype.isDragging=function(){return!(!this._drag||!this._drag._isActive)},jt.prototype.isReleasing=function(){return!(!this._dragRelease||!this._dragRelease._isActive)},jt.prototype.isDestroyed=function(){return this._isDestroyed},jt.prototype._refreshDimensions=function(e){if(!(this._isDestroyed||!0!==e&&this._visibility._isHidden)){var t=this._element,o=this._dragPlaceholder,n=t.getBoundingClientRect();this._width=n.width,this._height=n.height,this._marginLeft=Math.max(0,fe(t,"margin-left")),this._marginRight=Math.max(0,fe(t,"margin-right")),this._marginTop=Math.max(0,fe(t,"margin-top")),this._marginBottom=Math.max(0,fe(t,"margin-bottom")),o&&o.updateDimensions()}},jt.prototype._refreshSortData=function(){if(!this._isDestroyed){var e,t=this._sortData={},o=this.getGrid()._settings.sortData;for(e in o)t[e]=o[e](this,this._element)}},jt.prototype._addToLayout=function(e,t){!0!==this._isActive&&(this._isActive=!0,this._left=e||0,this._top=t||0)},jt.prototype._removeFromLayout=function(){!1!==this._isActive&&(this._isActive=!1,this._left=0,this._top=0)},jt.prototype._canSkipLayout=function(e,t){return this._left===e&&this._top===t&&!this._migrate._isActive&&!this._layout._skipNextAnimation&&!this._dragRelease.isJustReleased()},jt.prototype._setTranslate=function(e,t){return(this._tX!==e||this._tY!==t)&&(this._tX=e,this._tY=t,this._element.style[Ve]=Ct(e,t),!0)},jt.prototype._destroy=function(e){if(!this._isDestroyed){var t=this._element,o=this.getGrid()._settings;this._dragPlaceholder.destroy(),this._dragRelease.destroy(),this._migrate.destroy(),this._layout.destroy(),this._visibility.destroy(),this._drag&&this._drag.destroy(),this._emitter.destroy(),At(t,o.itemClass),e&&t.parentNode.removeChild(t),i&&i.delete(t),this._isActive=!1,this._isDestroyed=!0}};var Gt=Ft(),$t=null,Ut=[];function Vt(e,t){if(this._options=0,this._processor=null,this._layoutQueue=[],this._layouts={},this._layoutCallbacks={},this._layoutWorkers={},this._layoutWorkerData={},this._workers=[],this._onWorkerMessage=this._onWorkerMessage.bind(this),this.setOptions(t),(e="number"==typeof e?Math.max(0,e):0)&&window.Worker&&window.URL&&window.Blob)try{this._workers=function(e,t){var o=[];if(e>0){$t||($t=URL.createObjectURL(new Blob(["("+Ft.toString()+")(true)"],{type:"application/javascript"})));for(var n,i=0;i<e;i++)n=new Worker($t),t&&(n.onmessage=t),o.push(n),Ut.push(n)}return o}(e,this._onWorkerMessage)}catch(e){this._processor=new Gt}else this._processor=new Gt}Vt.prototype._sendToWorker=function(){if(this._layoutQueue.length&&this._workers.length){var e=this._layoutQueue.shift(),t=this._workers.pop(),o=this._layoutWorkerData[e];delete this._layoutWorkerData[e],this._layoutWorkers[e]=t,t.postMessage(o.buffer,[o.buffer])}},Vt.prototype._onWorkerMessage=function(e){var t=new Float32Array(e.data),o=t[0],n=this._layouts[o],i=this._layoutCallbacks[o],r=this._layoutWorkers[o];n&&delete this._layouts[o],i&&delete this._layoutCallbacks[o],r&&delete this._layoutWorkers[o],n&&i&&(n.width=t[1],n.height=t[2],n.slots=t.subarray(4,t.length),this._finalizeLayout(n),i(n)),r&&(this._workers.push(r),this._sendToWorker())},Vt.prototype._finalizeLayout=function(e){var t=e._grid,o=2&e._settings,n="border-box"===t._boxSizing;return delete e._grid,delete e._settings,e.styles={},o?e.styles.width=(n?e.width+t._borderLeft+t._borderRight:e.width)+"px":e.styles.height=(n?e.height+t._borderTop+t._borderBottom:e.height)+"px",e},Vt.prototype.setOptions=function(e){var t,o,n,i,r;e&&(t="boolean"==typeof e.fillGaps?e.fillGaps?1:0:1&this._options,o="boolean"==typeof e.horizontal?e.horizontal?2:0:2&this._options,n="boolean"==typeof e.alignRight?e.alignRight?4:0:4&this._options,i="boolean"==typeof e.alignBottom?e.alignBottom?8:0:8&this._options,r="boolean"==typeof e.rounding?e.rounding?16:0:16&this._options,this._options=t|o|n|i|r)},Vt.prototype.createLayout=function(e,t,o,n,i,r){if(this._layouts[t])throw new Error("A layout with the provided id is currently being processed.");var a=2&this._options,s={id:t,items:o,slots:null,width:a?0:n,height:a?i:0,_grid:e,_settings:this._options};if(!o.length)return s.slots=[],this._finalizeLayout(s),void r(s);if(this._processor)return s.slots=window.Float32Array?new Float32Array(2*o.length):new Array(2*o.length),this._processor.computeLayout(s,s._settings),this._finalizeLayout(s),void r(s);var c,p,b,M=new Float32Array(4+2*o.length);for(M[0]=t,M[1]=s.width,M[2]=s.height,M[3]=s._settings,c=0,p=3;c<o.length;c++)b=o[c],M[++p]=b._width+b._marginLeft+b._marginRight,M[++p]=b._height+b._marginTop+b._marginBottom;return this._layoutQueue.push(t),this._layouts[t]=s,this._layoutCallbacks[t]=r,this._layoutWorkerData[t]=M,this._sendToWorker(),this.cancelLayout.bind(this,t)},Vt.prototype.cancelLayout=function(e){if(this._layouts[e]&&(delete this._layouts[e],delete this._layoutCallbacks[e],this._layoutWorkerData[e])){delete this._layoutWorkerData[e];var t=this._layoutQueue.indexOf(e);t>-1&&this._layoutQueue.splice(t,1)}},Vt.prototype.destroy=function(){for(var e in this._layoutWorkers)this._workers.push(this._layoutWorkers[e]);!function(e){for(var t,o,n=0;n<e.length;n++)(t=e[n]).onmessage=null,t.onerror=null,t.onmessageerror=null,t.terminate(),(o=Ut.indexOf(t))>-1&&Ut.splice(o,1);$t&&!Ut.length&&(URL.revokeObjectURL($t),$t=null)}(this._workers),this._workers.length=0,this._layoutQueue.length=0,this._layouts={},this._layoutCallbacks={},this._layoutWorkers={},this._layoutWorkerData={}};var Jt=0;function Kt(e){var t=Object.prototype.toString.call(e);return"[object HTMLCollection]"===t||"[object NodeList]"===t}var Qt=Object.prototype.toString;function Zt(e){return"object"==typeof e&&"[object Object]"===Qt.call(e)}function eo(){}var to,oo="number",no="string",io="instant",ro=0;function ao(e,t){if(typeof e===no&&(e=document.querySelector(e)),!(e.getRootNode?e.getRootNode({composed:!0})===document:document.body.contains(e))||e===document.documentElement)throw new Error("Container element must be an existing DOM element.");var o,i,r=function(e,t){var o=so({},e);return t&&(o=so(o,t)),t&&t.visibleStyles?o.visibleStyles=t.visibleStyles:e&&e.visibleStyles&&(o.visibleStyles=e.visibleStyles),t&&t.hiddenStyles?o.hiddenStyles=t.hiddenStyles:e&&e.hiddenStyles&&(o.hiddenStyles=e.hiddenStyles),o}(ao.defaultOptions,t);r.visibleStyles=co(r.visibleStyles),r.hiddenStyles=co(r.hiddenStyles),ue(r.dragSort)||(r.dragSort=!!r.dragSort),this._id=Ht(),this._element=e,this._settings=r,this._isDestroyed=!1,this._items=[],this._layout={id:0,items:[],slots:[]},this._isLayoutFinished=!0,this._nextLayoutData=null,this._emitter=new W,this._onLayoutDataReceived=this._onLayoutDataReceived.bind(this),n[this._id]=this,He(e,r.containerClass),o=this,typeof(i=r.layoutOnResize)!==oo&&(i=!0===i?0:-1),i>=0&&(o._resizeHandler=function(e,t){var o=++Jt,n=0,i=0,r=!1,a=function(t){r||(i&&(n-=t-i),i=t,n>0?function(e,t){ae.add(0,re+e,t)}(o,a):(n=i=0,e()))};return function(s){if(!r){if(!(t<=0))return!0===s?(r=!0,n=i=0,a=void 0,void function(e){ae.remove(0,re+e)}(o)):void(n<=0?(n=t,a(0)):n=t);!0!==s&&e()}}}(function(){o.refreshItems().layout()},i),window.addEventListener("resize",o._resizeHandler)),this.add(function(e,t){if("*"===t)return e.children;if(typeof t===no){for(var o=[],n=e.children,i=0;i<n.length;i++)Ie(n[i],t)&&o.push(n[i]);return o}return Array.isArray(t)||Kt(t)?t:[]}(e,r.items),{layout:!1}),r.layoutOnInit&&this.layout(!0)}function so(e,t){var o,n,i,r=Object.keys(t),a=r.length;for(i=0;i<a;i++)o=Zt(t[n=r[i]]),Zt(e[n])&&o?e[n]=so(so({},e[n]),t[n]):o?e[n]=so({},t[n]):Array.isArray(t[n])?e[n]=t[n].slice(0):e[n]=t[n];return e}function co(e){var t,o,n={},i=document.documentElement.style;for(t in e)e[t]&&(o=w(i,t))&&(n[o]=e[t]);return n}function po(e){for(var t={},o=0;o<e.length;o++)t[e[o]._id]=o;return t}function bo(e,t,o){return e[t._id]-e[o._id]}ao.Item=jt,ao.ItemLayout=Xt,ao.ItemVisibility=Pt,ao.ItemMigrate=Yt,ao.ItemDrag=gt,ao.ItemDragRelease=xt,ao.ItemDragPlaceholder=Dt,ao.Emitter=W,ao.Animator=Nt,ao.Dragger=x,ao.Packer=Vt,ao.AutoScroller=Xe,ao.defaultPacker=new Vt(2),ao.defaultOptions={items:"*",showDuration:300,showEasing:"ease",hideDuration:300,hideEasing:"ease",visibleStyles:{opacity:"1",transform:"scale(1)"},hiddenStyles:{opacity:"0",transform:"scale(0.5)"},layout:{fillGaps:!1,horizontal:!1,alignRight:!1,alignBottom:!1,rounding:!1},layoutOnResize:150,layoutOnInit:!0,layoutDuration:300,layoutEasing:"ease",sortData:null,dragEnabled:!1,dragContainer:null,dragHandle:null,dragStartPredicate:{distance:0,delay:0},dragAxis:"xy",dragSort:!0,dragSortHeuristics:{sortInterval:100,minDragDistance:10,minBounceBackAngle:1},dragSortPredicate:{threshold:50,action:a,migrateAction:a},dragRelease:{duration:300,easing:"ease",useDragContainer:!0},dragCssProps:{touchAction:"none",userSelect:"none",userDrag:"none",tapHighlightColor:"rgba(0, 0, 0, 0)",touchCallout:"none",contentZooming:"none"},dragPlaceholder:{enabled:!1,createElement:null,onCreate:null,onRemove:null},dragAutoScroll:{targets:[],handle:null,threshold:50,safeZone:.2,speed:Xe.smoothSpeed(1e3,2e3,2500),sortDuringScroll:!0,smoothStop:!1,onStart:null,onStop:null},containerClass:"muuri",itemClass:"muuri-item",itemVisibleClass:"muuri-item-shown",itemHiddenClass:"muuri-item-hidden",itemPositioningClass:"muuri-item-positioning",itemDraggingClass:"muuri-item-dragging",itemReleasingClass:"muuri-item-releasing",itemPlaceholderClass:"muuri-item-placeholder"},ao.prototype.on=function(e,t){return this._emitter.on(e,t),this},ao.prototype.off=function(e,t){return this._emitter.off(e,t),this},ao.prototype.getElement=function(){return this._element},ao.prototype.getItem=function(e){if(this._isDestroyed||!e&&0!==e)return null;if(typeof e===oo)return this._items[e>-1?e:this._items.length+e]||null;if(e instanceof jt)return e._gridId===this._id?e:null;if(i){var t=i.get(e);return t&&t._gridId===this._id?t:null}for(var o=0;o<this._items.length;o++)if(this._items[o]._element===e)return this._items[o];return null},ao.prototype.getItems=function(e){if(this._isDestroyed||void 0===e)return this._items.slice(0);var t,o,n=[];if(Array.isArray(e)||Kt(e))for(t=0;t<e.length;t++)(o=this.getItem(e[t]))&&n.push(o);else(o=this.getItem(e))&&n.push(o);return n},ao.prototype.refreshItems=function(e,t){if(this._isDestroyed)return this;var o,n,i,r,a=e||this._items;if(!0===t)for(r=[],o=0;o<a.length;o++)(n=a[o]).isVisible()||n.isHiding()||((i=n.getElement().style).visibility="hidden",i.display="",r.push(i));for(o=0;o<a.length;o++)a[o]._refreshDimensions(t);if(!0===t){for(o=0;o<r.length;o++)(i=r[o]).visibility="",i.display="none";r.length=0}return this},ao.prototype.refreshSortData=function(e){if(this._isDestroyed)return this;for(var t=e||this._items,o=0;o<t.length;o++)t[o]._refreshSortData();return this},ao.prototype.synchronize=function(){if(this._isDestroyed)return this;var e,t,o=this._items;if(!o.length)return this;for(var n=0;n<o.length;n++)(t=o[n]._element).parentNode===this._element&&(e=e||document.createDocumentFragment()).appendChild(t);return e?(this._element.appendChild(e),this._emit("synchronize"),this):this},ao.prototype.layout=function(e,t){if(this._isDestroyed)return this;var o=this._nextLayoutData;o&&ue(o.cancel)&&o.cancel();var n=ro=ro%16777216+1;this._nextLayoutData={id:n,instant:e,onFinish:t,cancel:null};for(var i=this._items,r=[],a=0;a<i.length;a++)i[a]._isActive&&r.push(i[a]);this._refreshDimensions();var s,c=this._width-this._borderLeft-this._borderRight,p=this._height-this._borderTop-this._borderBottom,b=this._settings.layout;return ue(b)?s=b(this,n,r,c,p,this._onLayoutDataReceived):(ao.defaultPacker.setOptions(b),s=ao.defaultPacker.createLayout(this,n,r,c,p,this._onLayoutDataReceived)),ue(s)&&this._nextLayoutData&&this._nextLayoutData.id===n&&(this._nextLayoutData.cancel=s),this},ao.prototype.add=function(e,t){if(this._isDestroyed||!e)return[];var o,n=Kt(o=e)?Array.prototype.slice.call(o):Array.prototype.concat(o);if(!n.length)return n;var i,r,a,s,c=t||{},p=c.layout?c.layout:void 0===c.layout,b=this._items,M=!1;for(s=0;s<n.length;s++)(r=n[s]).parentNode!==this._element&&(i=i||document.createDocumentFragment()).appendChild(r);for(i&&this._element.appendChild(i),s=0;s<n.length;s++)r=n[s],(a=n[s]=new jt(this,r,c.active))._isActive&&(M=!0,a._layout._skipNextAnimation=!0);for(s=0;s<n.length;s++)(a=n[s])._refreshDimensions(),a._refreshSortData();return Fe(b,n,c.index),this._hasListeners("add")&&this._emit("add",n.slice(0)),M&&p&&this.layout(p===io,ue(p)?p:void 0),n},ao.prototype.remove=function(e,t){if(this._isDestroyed||!e.length)return[];var o,n,i,r=t||{},a=r.layout?r.layout:void 0===r.layout,s=!1,c=this.getItems(),p=[],M=[];for(i=0;i<e.length;i++)(n=e[i])._isDestroyed||-1!==(o=this._items.indexOf(n))&&(n._isActive&&(s=!0),p.push(n),M.push(c.indexOf(n)),n._destroy(r.removeElements),this._items.splice(o,1));return this._hasListeners(b)&&this._emit(b,p.slice(0),M),s&&a&&this.layout(a===io,ue(a)?a:void 0),p},ao.prototype.show=function(e,t){return!this._isDestroyed&&e.length&&this._setItemsVisibility(e,!0,t),this},ao.prototype.hide=function(e,t){return!this._isDestroyed&&e.length&&this._setItemsVisibility(e,!1,t),this},ao.prototype.filter=function(e,t){if(this._isDestroyed||!this._items.length)return this;var o,n,i=[],r=[],a=typeof e===no,s=ue(e),c=t||{},p=!0===c.instant,b=c.syncWithLayout,M=c.layout?c.layout:void 0===c.layout,l=ue(c.onFinish)?c.onFinish:null,z=-1,u=eo;if(l&&(u=function(){++z&&l(i.slice(0),r.slice(0))}),s||a)for(n=0;n<this._items.length;n++)o=this._items[n],(s?e(o):Ie(o._element,e))?i.push(o):r.push(o);return i.length?this.show(i,{instant:p,syncWithLayout:b,onFinish:u,layout:!1}):u(),r.length?this.hide(r,{instant:p,syncWithLayout:b,onFinish:u,layout:!1}):u(),(i.length||r.length)&&(this._hasListeners(d)&&this._emit(d,i.slice(0),r.slice(0)),M&&this.layout(M===io,ue(M)?M:void 0)),this},ao.prototype.sort=function(){var e,t,o,n;function i(i,r){for(var a,s,c,p,b=0,M=0;M<e.length;M++)if(a=e[M][0],s=e[M][1],c=(i._sortData?i:i._refreshSortData())._sortData[a],p=(r._sortData?r:r._refreshSortData())._sortData[a],b="desc"===s||!s&&t?p<c?-1:p>c?1:0:c<p?-1:c>p?1:0)return b;return b||(n||(n=po(o)),b=t?bo(n,r,i):bo(n,i,r)),b}function r(i,r){var a=t?-e(i,r):e(i,r);return a||(n||(n=po(o)),a=t?bo(n,r,i):bo(n,i,r)),a}return function(a,s){if(this._isDestroyed||this._items.length<2)return this;var c=this._items,p=s||{},b=p.layout?p.layout:void 0===p.layout;if(t=!!p.descending,o=c.slice(0),n=null,ue(a))e=a,c.sort(r);else if(typeof a===no)e=a.trim().split(" ").filter(function(e){return e}).map(function(e){return e.split(":")}),c.sort(i);else{if(!Array.isArray(a))throw e=t=o=n=null,new Error("Invalid comparer argument provided.");c.length=0,c.push.apply(c,a)}return this._hasListeners(l)&&this._emit(l,c.slice(0),o),b&&this.layout(b===io,ue(b)?b:void 0),e=t=o=n=null,this}}(),ao.prototype.move=function(e,t,o){if(this._isDestroyed||this._items.length<2)return this;var n,i,s=this._items,c=o||{},p=c.layout?c.layout:void 0===c.layout,b=c.action===r,M=b?r:a,d=this.getItem(e),l=this.getItem(t);return d&&l&&d!==l&&(n=s.indexOf(d),i=s.indexOf(l),b?Ue(s,n,i):$e(s,n,i),this._hasListeners(z)&&this._emit(z,{item:d,fromIndex:n,toIndex:i,action:M}),p&&this.layout(p===io,ue(p)?p:void 0)),this},ao.prototype.send=function(e,t,o,n){if(this._isDestroyed||t._isDestroyed||this===t)return this;if(!(e=this.getItem(e)))return this;var i=n||{},r=i.appendTo||document.body,a=i.layoutSender?i.layoutSender:void 0===i.layoutSender,s=i.layoutReceiver?i.layoutReceiver:void 0===i.layoutReceiver;return e._migrate.start(t,o,r),e._migrate._isActive&&e._isActive&&(a&&this.layout(a===io,ue(a)?a:void 0),s&&t.layout(s===io,ue(s)?s:void 0)),this},ao.prototype.destroy=function(e){if(this._isDestroyed)return this;var t,o,i,r=this._element,a=this._items.slice(0),s=this._layout&&this._layout.styles||{};for((i=this)._resizeHandler&&(i._resizeHandler(!0),window.removeEventListener("resize",i._resizeHandler),i._resizeHandler=null),t=0;t<a.length;t++)a[t]._destroy(e);for(o in this._items.length=0,At(r,this._settings.containerClass),s)r.style[o]="";return this._emit("destroy"),this._emitter.destroy(),delete n[this._id],this._isDestroyed=!0,this},ao.prototype._emit=function(){this._isDestroyed||this._emitter.emit.apply(this._emitter,arguments)},ao.prototype._hasListeners=function(e){return!this._isDestroyed&&this._emitter.countListeners(e)>0},ao.prototype._updateBoundingRect=function(){var e=this._element.getBoundingClientRect();this._width=e.width,this._height=e.height,this._left=e.left,this._top=e.top,this._right=e.right,this._bottom=e.bottom},ao.prototype._updateBorders=function(e,t,o,n){var i=this._element;e&&(this._borderLeft=fe(i,"border-left-width")),t&&(this._borderRight=fe(i,"border-right-width")),o&&(this._borderTop=fe(i,"border-top-width")),n&&(this._borderBottom=fe(i,"border-bottom-width"))},ao.prototype._refreshDimensions=function(){this._updateBoundingRect(),this._updateBorders(1,1,1,1),this._boxSizing=Ae(this._element,"box-sizing")},ao.prototype._onLayoutDataReceived=(to=[],function(e){if(!this._isDestroyed&&this._nextLayoutData&&this._nextLayoutData.id===e.id){var t,o,n,i,r=this,a=this._nextLayoutData.instant,b=this._nextLayoutData.onFinish,M=e.items.length,d=M;for(this._nextLayoutData=null,!this._isLayoutFinished&&this._hasListeners(p)&&this._emit(p,this._layout.items.slice(0)),this._layout=e,to.length=0,i=0;i<M;i++)(t=e.items[i])?(o=e.slots[2*i],n=e.slots[2*i+1],t._canSkipLayout(o,n)?--d:(t._left=o,t._top=n,t.isActive()&&!t.isDragging()?to.push(t):--d)):--d;if(e.styles&&Rt(this._element,e.styles),!this._hasListeners(s)||(this._emit(s,e.items.slice(0),!0===a),this._layout.id===e.id)){var l=function(){if(!(--d>0)){var t=r._layout.id!==e.id,o=ue(a)?a:b;t||(r._isLayoutFinished=!0),ue(o)&&o(e.items.slice(0),t),!t&&r._hasListeners(c)&&r._emit(c,e.items.slice(0))}};if(!to.length)return l(),this;for(this._isLayoutFinished=!1,i=0;i<to.length&&this._layout.id===e.id;i++)to[i]._layout.start(!0===a,l);return this._layout.id===e.id&&(to.length=0),this}}}),ao.prototype._setItemsVisibility=function(e,t,o){var n,i,r=this,a=e.slice(0),c=o||{},p=!0===c.instant,b=c.onFinish,d=c.layout?c.layout:void 0===c.layout,l=a.length,z=t?"showStart":M,u=t?"showEnd":"hideEnd",O=t?"show":"hide",A=!1,f=[],h=[];if(l){for(i=0;i<a.length;i++)n=a[i],(t&&!n._isActive||!t&&n._isActive)&&(A=!0),n._layout._skipNextAnimation=!(!t||n._isActive),t&&n._visibility._isHidden&&h.push(n),t?n._addToLayout():n._removeFromLayout();h.length&&(this.refreshItems(h,!0),h.length=0),A&&!1!==c.syncWithLayout?this.on(s,m):m(),A&&d&&this.layout(d===io,ue(d)?d:void 0)}else ue(b)&&b(a);function m(){for(A&&!1!==c.syncWithLayout&&r.off(s,m),r._hasListeners(z)&&r._emit(z,a.slice(0)),i=0;i<a.length;i++)a[i]._gridId===r._id?a[i]._visibility[O](p,function(e,t){e||f.push(t),--l<1&&(ue(b)&&b(f.slice(0)),r._hasListeners(u)&&r._emit(u,f.slice(0)))}):--l<1&&(ue(b)&&b(f.slice(0)),r._hasListeners(u)&&r._emit(u,f.slice(0)))}};const Mo=ao;var lo=o(88903),zo=o(38745),uo=o(56155);const Oo=[];let Ao,fo;const ho=()=>{let e=document.querySelector(".SearchResult-dragContainer");return e||(e=(0,zo.A)("div",{className:"SearchResult-dragContainer"}),document.body.appendChild(e)),e},mo=()=>{const e=fo.querySelector(":scope .SearchResult-board"),t=()=>{if(e){const n=e.lastChild;if(n instanceof Element){const i=n.classList.contains("frame")?e.querySelector(".SearchResult-board-column:nth-last-child(-n+2)"):e.lastChild;i instanceof Element&&o.observe(i),Ao.off("layoutEnd",t);const r=e.closest(".Popup");r instanceof HTMLDivElement&&document.body.style.setProperty("--BoardContainer-zIndex",(parseInt(r.style.zIndex)+1).toString())}}},o=new IntersectionObserver(e=>{for(const t of e){const{isIntersecting:e,target:n}=t;if(e&&!n.classList.contains("frame")){o.unobserve(n);const e=fo.querySelector(":scope button.moreColumns-button");e&&e.click()}}},{root:fo,rootMargin:"25px",threshold:.75});Ao.on("layoutEnd",t)},qo=(e,t)=>{const o=t.parentNode;if(o instanceof HTMLDivElement){const n=new IntersectionObserver(e=>{for(const t of e){const{isIntersecting:e,target:i}=t;if(e){n.unobserve(i);const e=o?.querySelector(":scope button.moreCards-button");e&&e.click()}}},{root:o,rootMargin:"25px",threshold:.75}),i=()=>{const o=t.lastChild;o instanceof Element&&(n.observe(o),e.off("layoutEnd",i))};e.on("layoutEnd",i)}};let _o,Wo,go;(0,uo.A)(".is-muuri .SearchResult-boardContainer",e=>{fo=e;const t=e.querySelector(":scope div.SearchResult-board");if(!t)return;Ao=new Mo(t,{items:".SearchResult-board-column",layoutDuration:300,layoutEasing:"cubic-bezier(0.625, 0.225, 0.100, 0.890)",layout:(e,t,o,n,i,r)=>(Mo.defaultPacker.setOptions({horizontal:!0}),Mo.defaultPacker.createLayout(e,t,o,n,i,e=>{delete e.styles,r(e)})),dragEnabled:!1,dragAxis:"x",dragSortHeuristics:{sortInterval:0},dragHandle:".BoardView-title",dragRelease:{duration:300,easing:"cubic-bezier(0.625, 0.225, 0.100, 0.890)",useDragContainer:!1},dragAutoScroll:{targets:[{element:fo,axis:Mo.AutoScroller.AXIS_X}]}});const o=fo.querySelector(".SearchResult-board-errors");(0,uo.A)(".SearchResult-board-errors-close",e=>{e.onclick=()=>{o&&(o.innerHTML="")}}),mo()}),(0,uo.A)(".SearchResult-items .SearchResult-boardContainer",e=>{const t=e.closest(".SearchResult-items");t?.classList.add("is-muuri")}),(0,uo.A)("ol.BoardView-list",e=>{const t=e.closest(".SearchResult-board"),o=!!t?.hasAttribute("data-dragEnabled"),n=new Mo(e,{items:".BoardView-card",showDuration:300,showEasing:"ease",hideDuration:300,hideEasing:"ease",layoutDuration:300,layoutEasing:"cubic-bezier(0.625, 0.225, 0.100, 0.890)",dragEnabled:o,dragSort:()=>Oo.filter(e=>t?.contains(e.getElement())),dragContainer:ho(),dragRelease:{duration:300,easing:"cubic-bezier(0.625, 0.225, 0.100, 0.890)",useDragContainer:!0},dragStartPredicate:(e,t)=>{const o=t.target,n=e.getElement();return!("A"===o.tagName||o.className.includes("ContentSummary-info")||n&&n.hasAttribute("data-archived"))},dragPlaceholder:{enabled:!0,createElement:e=>{const t=e.getElement();return t?.cloneNode(!0)}},dragAutoScroll:{targets:e=>[window,{element:fo,priority:1,axis:Mo.AutoScroller.AXIS_X},{element:e.getGrid()?.getElement().parentNode,priority:1,axis:Mo.AutoScroller.AXIS_Y}],sortDuringScroll:!1}});let i;new MutationObserver(e=>{for(const t of e){const e=t.target;if("childList"===t.type&&e instanceof HTMLElement){new ResizeObserver((t,o)=>{n.refreshItems().layout(),o.unobserve(e)}).observe(e)}}}).observe(e,{childList:!0,subtree:!0}),n.on("dragReleaseEnd",e=>{if(i===e){const t=e.getElement();t instanceof HTMLElement&&t.classList.add("is-saving"),r(e);let o=null,i=null;if(_o){const e=_o.getElement().closest(".SearchResult-board-column");o=e?.querySelector(".BoardView-title")}if(n){const e=n.getElement().closest(".SearchResult-board-column");i=e?.querySelector(".BoardView-title")}if(o instanceof HTMLElement){const e=o.dataset.count;e&&(o.dataset.count=(parseInt(e)-1).toString())}if(i instanceof HTMLElement){const e=i.dataset.count;e&&(i.dataset.count=(parseInt(e)+1).toString())}}i=null,Wo=0}),n.on("dragStart",e=>{const t=e.getGrid();if(t instanceof Mo){_o=t,Wo=n.getItems().indexOf(e);const o=n.getElement();if(o){const e=o.closest(".SearchResult-board-column"),t=e?.getAttribute("data-boardFieldValue");t&&(go=t)}const i=e.getElement();i&&(i.style.width=e.getWidth()+"px",i.style.height=e.getHeight()+"px")}}),n.on("dragMove",e=>{n===_o&&null!==Wo&&n.move(e,Wo,{layout:"instant"})}),n.on("layoutStart",()=>{Ao&&Ao.refreshItems().layout()}),n.on("receive",e=>{i=e.item});const r=async e=>{const t=e.getElement(),o=t?.getAttribute("data-objectId"),i=document.querySelector('li[data-objectId="'+o+'"]');let r,a,s;if(i){const e=i.closest(".SearchResult-board");e&&(r=e.getAttribute("data-boardField"),s=e.getAttribute("data-search"))}if(t){const e=t.closest(".SearchResult-board-column");a=e?.getAttribute("data-boardFieldValue")}const c=new Headers,p=lo.A.get("bsp.csrf");p&&c.append("Brightspot-CSRF",p);const b=new FormData;o&&b.append("objectId",o),r&&b.append("boardField",r),a&&b.append("boardFieldValue",a),s&&b.append("search",s),b.append("previousBoardFieldValue",go);const M=await fetch(window.CONTEXT_PATH+"board/fieldUpdate",{method:"post",credentials:"include",headers:c,body:b}),d=await M.text();if(M.ok){const t=n.getItems().indexOf(e);n.remove([e],{removeElements:!0});const o=document.createElement("template");o.innerHTML=d;const i=o.content.firstChild;i instanceof HTMLElement&&n.add(i,{index:t})}else if(d){n.send(e,_o,Wo);const t=document.querySelector(".SearchResult-board-errors");t&&(t.innerHTML=d)}};qo(n,e),Oo.push(n)}),window.addEventListener("brightspot-frame-load",e=>{const t=e.target;if(t instanceof HTMLElement)if(t.classList.contains("BoardResults")){const e=[...t.querySelectorAll("li.BoardView-card")],o=t.closest(".BoardView-listContainer"),n=o?.querySelector("ol.BoardView-list");Oo.forEach(t=>{t instanceof Object&&t.getElement()===n&&(qo(t,n),t.add(e))})}else t.classList.contains("BoardResults-Horiz")&&(mo(),Ao.add([...t.querySelectorAll("div.SearchResult-board-column")]))})},94473(e,t,o){"use strict";(0,o(56155).A)(".Page .Page-broadcastAlert",e=>{const t=e.querySelector(".pagination");if(!t)return;const o=t.querySelector(".pagination-count");if(!o)return;const n=e.querySelectorAll(".Page-broadcastAlert-messages > *");if(!n)return;const i=t.querySelector(".previous");if(!i)return;const r=i.querySelector(":scope > a");if(!r)return;const a=t.querySelector(".next");if(!a)return;const s=a.querySelector(":scope > a");if(!s)return;const c=n.length;for(let e=1;e<c;e++)n[e].hidden=!0;let p=0;const b=()=>{o.textContent=`${p+1} / ${c}`};b();const M=e=>{n[p].hidden=!0,p+=e?1:-1,n[p].hidden=!1,b();const t=0===p;i.classList.toggle("is-disabled",t),r.tabIndex=t?-1:0;const o=p===c-1;a.classList.toggle("is-disabled",o),s.tabIndex=o?-1:0};i.addEventListener("click",e=>{e.preventDefault(),p>0&&M(!1)}),a.addEventListener("click",e=>{e.preventDefault(),p<c-1&&M(!0)})})},34409(e,t,o){"use strict";var n=o(56155),i=o(38745),r=o(88903),a=o(99022),s=o(30473);(0,n.A)(".BulkWorkflow-button",e=>{let t=null;e.addEventListener("keydown",t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e.click())}),e.addEventListener("click",async o=>{o.preventDefault(),o.stopPropagation();const n=o.target;let c;if(n instanceof HTMLElement&&(c=n.getAttribute("action-url")),!c)return;if(!t){const e=new Headers,o=r.A.get("bsp.csrf");o&&e.append("Brightspot-CSRF",o);const n=await fetch(c,{headers:e}),a=await n.text();t=(0,i.A)("div",{className:"BulkWorkflow",innerHTML:a,role:"dialog","aria-modal":"true"}),document.body.appendChild(t),t.addEventListener("keydown",e=>{if("Escape"===e.key){e.stopPropagation();const o=t?.querySelector(".closeButton");o&&o.click()}})}e.closest(".Popup")&&(t.style.zIndex=(0,s.default)().toString()),a.A.toggle(e,t,()=>{const o=e.classList.toggle("is-open");return t?.classList.toggle("is-open"),o&&requestAnimationFrame(()=>{const e=t?.querySelector(".closeButton");e&&e.focus()}),o});const p=t.querySelector(".closeButton");p?.addEventListener("click",()=>{const o=a.A.toggles.get(e);o&&o.closeListener&&window.removeEventListener("click",o.closeListener,!0),e.classList.remove("is-open"),t?.classList.remove("is-open"),t?.remove(),t=null;const n=e.closest(".SearchResult")?.querySelector(".SearchResult-actions-toggle");n&&n.focus()})})})},70660(e,t,o){"use strict";o.d(t,{A:()=>q}),o(44764),o(84978),o(13722),o(25809),o(91672);var n=o(29171),i=o(17319),r=o(76904),a=o(80133),s=o(31400);function c(){c=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach(function(o){t.forEach(function(t){t.kind===o&&"own"===t.placement&&this.defineClassElement(e,t)},this)},this)},initializeClassElements:function(e,t){var o=e.prototype;["method","field"].forEach(function(n){t.forEach(function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var r="static"===i?e:o;this.defineClassElement(r,t)}},this)},this)},defineClassElement:function(e,t){var o=t.descriptor;if("field"===t.kind){var n=t.initializer;o={enumerable:o.enumerable,writable:o.writable,configurable:o.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,o)},decorateClass:function(e,t){var o=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach(function(e){this.addElementPlacement(e,i)},this),e.forEach(function(e){if(!M(e))return o.push(e);var t=this.decorateElement(e,i);o.push(t.element),o.push.apply(o,t.extras),n.push.apply(n,t.finishers)},this),!t)return{elements:o,finishers:n};var r=this.decorateConstructor(o,t);return n.push.apply(n,r.finishers),r.finishers=n,r},addElementPlacement:function(e,t,o){var n=t[e.placement];if(!o&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var o=[],n=[],i=e.decorators,r=i.length-1;r>=0;r--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[r])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var p=c.extras;if(p){for(var b=0;b<p.length;b++)this.addElementPlacement(p[b],t);o.push.apply(o,p)}}return{element:e,finishers:n,extras:o}},decorateConstructor:function(e,t){for(var o=[],n=t.length-1;n>=0;n--){var i=this.fromClassDescriptor(e),r=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==r.finisher&&o.push(r.finisher),void 0!==r.elements){e=r.elements;for(var a=0;a<e.length-1;a++)for(var s=a+1;s<e.length;s++)if(e[a].key===e[s].key&&e[a].placement===e[s].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers:o}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var o={}.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?u(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map(function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t},this);var t},toElementDescriptor:function(e){var t=e.kind+"";if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var o=z(e.key),n=e.placement+"";if("static"!==n&&"prototype"!==n&&"own"!==n)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+n+'"');var i=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var r={kind:t,key:o,placement:n,descriptor:Object.assign({},i)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(i,"get","The property descriptor of a field descriptor"),this.disallowProperty(i,"set","The property descriptor of a field descriptor"),this.disallowProperty(i,"value","The property descriptor of a field descriptor"),r.initializer=e.initializer),r},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:l(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=e.kind+"";if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var o=l(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:o}},runClassFinishers:function(e,t){for(var o=0;o<t.length;o++){var n=(0,t[o])(e);if(void 0!==n){if("function"!=typeof n)throw new TypeError("Finishers must return a constructor.");e=n}}return e},disallowProperty:function(e,t,o){if(void 0!==e[t])throw new TypeError(o+" can't have a ."+t+" property.")}};return e}function p(e){var t,o=z(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var n={kind:"field"===e.kind?"field":"method",key:o,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(n.decorators=e.decorators),"field"===e.kind&&(n.initializer=e.value),n}function b(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function M(e){return e.decorators&&e.decorators.length}function d(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function l(e,t){var o=e[t];if(void 0!==o&&"function"!=typeof o)throw new TypeError("Expected '"+t+"' to be a function");return o}function z(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var o=t.call(e,"string");if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=Array(t);o<t;o++)n[o]=e[o];return n}function O(){return O="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,o){var n=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=A(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:o):i.value}},O.apply(null,arguments)}function A(e){return A=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},A(e)}const f=window.localStorage,h=window.BRIGHTSPOT?.ui.tooltips.collapse,m=window.BRIGHTSPOT?.ui.tooltips.expand;let q=(_=[(0,i.EM)("btu-cig-cluster")],W=(0,r.j)((0,a.m)(n.WF)),g=c(),y=function(e,t){class o extends t{constructor(...t){super(...t),e(this)}}return{F:o,d:[{kind:"field",key:"_collapsed",value:()=>!0},{kind:"field",decorators:[(0,i.MZ)({type:String,reflect:!0,attribute:"cluster-title"})],key:"clusterTitle",value:void 0},{kind:"field",decorators:[(0,i.MZ)({type:String})],key:"tab",value:void 0},{kind:"set",decorators:[(0,i.MZ)()],key:"collapsed",value:function(e){this._collapsed=e;const t=this.closest(".CIG"),o=t?.dataset.type,n=this.clusterTitle?.trim(),i=`BSP.ContentEdit.clusterExpanded.${o}.${n}`;o&&n&&(e?f.removeItem(i):f.setItem(i,"1")),this._collapsed?this.states.delete("btu-expanded"):this.states.add("btu-expanded"),this.requestUpdate()}},{kind:"get",key:"collapsed",value:function(){return this._collapsed}},{kind:"method",key:"_toggleRowVisibility",value:function(e){this.querySelectorAll(":scope > :not(.CIG-title)").forEach(t=>{t.childNodes.length&&(t.toggleAttribute("hidden",e),t.classList.toggle("TC-unselected",e))})}},{kind:"method",key:"connectedCallback",value:function(){var e,t,n,i,r;(e=o,t="connectedCallback",n=this,r=O(A(1&(i=3)?e.prototype:e),t,n),2&i&&"function"==typeof r?function(e){return r.apply(n,e)}:r)([]);const a=this.closest(".CIG"),s=a?.dataset.type,c=`BSP.ContentEdit.clusterExpanded.${s}.${this.clusterTitle}`;this.collapsed=!f.getItem(c)}},{kind:"method",key:"createRenderRoot",value:function(){return this}},{kind:"method",key:"firstUpdated",value:function(){this.emit("btu-cig-cluster-ready");const e=this.querySelector(".CIG-title"),t=this.firstChild;t instanceof Element&&!t.classList.contains("CIG-title")&&e&&this.insertBefore(e,t),this.dataset.tab=this.tab;const o=Array.from(this.querySelectorAll(".CIG-row")).filter(e=>e.childNodes.length);this.toggleAttribute("hidden",!o.length),Array.from(this.querySelectorAll(".CIG-row")).filter(e=>!e.childNodes.length).forEach(e=>e.toggleAttribute("hidden",!0)),this.querySelectorAll(".CIG-row > .Message.is-error").length>0?this.states.add("btu-error"):this.states.delete("btu-error")}},{kind:"method",key:"render",value:function(){return this._toggleRowVisibility(this.collapsed),n.qy`<h2 class="CIG-title" data-tab=${this.tab}>
1
+ /*! For license information please see v4.6fa2ceb9bc8a86731790.js.LICENSE.txt */
2
+ (()=>{var __webpack_modules__={42247(e,t,o){var n={"./af":88468,"./af.js":88468,"./ar":43504,"./ar-dz":56553,"./ar-dz.js":56553,"./ar-kw":32889,"./ar-kw.js":32889,"./ar-ly":41222,"./ar-ly.js":41222,"./ar-ma":75865,"./ar-ma.js":75865,"./ar-ps":96404,"./ar-ps.js":96404,"./ar-sa":80299,"./ar-sa.js":80299,"./ar-tn":77293,"./ar-tn.js":77293,"./ar.js":43504,"./az":86936,"./az.js":86936,"./be":67226,"./be.js":67226,"./bg":1548,"./bg.js":1548,"./bm":98450,"./bm.js":98450,"./bn":62829,"./bn-bd":10070,"./bn-bd.js":10070,"./bn.js":62829,"./bo":94532,"./bo.js":94532,"./br":15201,"./br.js":15201,"./bs":67912,"./bs.js":67912,"./ca":42209,"./ca.js":42209,"./cs":30055,"./cs.js":30055,"./cv":38938,"./cv.js":38938,"./cy":93417,"./cy.js":93417,"./da":34888,"./da.js":34888,"./de":5020,"./de-at":17876,"./de-at.js":17876,"./de-ch":10526,"./de-ch.js":10526,"./de.js":5020,"./dv":79851,"./dv.js":79851,"./el":65518,"./el.js":65518,"./en-au":62585,"./en-au.js":62585,"./en-ca":98459,"./en-ca.js":98459,"./en-gb":31408,"./en-gb.js":31408,"./en-ie":30577,"./en-ie.js":30577,"./en-il":56496,"./en-il.js":56496,"./en-in":82222,"./en-in.js":82222,"./en-nz":19291,"./en-nz.js":19291,"./en-sg":55313,"./en-sg.js":55313,"./eo":78473,"./eo.js":78473,"./es":43685,"./es-do":58683,"./es-do.js":58683,"./es-mx":20831,"./es-mx.js":20831,"./es-us":45264,"./es-us.js":45264,"./es.js":43685,"./et":49862,"./et.js":49862,"./eu":61399,"./eu.js":61399,"./fa":40434,"./fa.js":40434,"./fi":37242,"./fi.js":37242,"./fil":20648,"./fil.js":20648,"./fo":4248,"./fo.js":4248,"./fr":38461,"./fr-ca":43064,"./fr-ca.js":43064,"./fr-ch":76937,"./fr-ch.js":76937,"./fr.js":38461,"./fy":79818,"./fy.js":79818,"./ga":85309,"./ga.js":85309,"./gd":44352,"./gd.js":44352,"./gl":47368,"./gl.js":47368,"./gom-deva":89099,"./gom-deva.js":89099,"./gom-latn":62498,"./gom-latn.js":62498,"./gu":67881,"./gu.js":67881,"./he":39616,"./he.js":39616,"./hi":93980,"./hi.js":93980,"./hr":99875,"./hr.js":99875,"./hu":27792,"./hu.js":27792,"./hy-am":97925,"./hy-am.js":97925,"./id":34730,"./id.js":34730,"./is":11953,"./is.js":11953,"./it":19002,"./it-ch":83820,"./it-ch.js":83820,"./it.js":19002,"./ja":19518,"./ja.js":19518,"./jv":15501,"./jv.js":15501,"./ka":78665,"./ka.js":78665,"./kk":15303,"./kk.js":15303,"./km":50037,"./km.js":50037,"./kn":24186,"./kn.js":24186,"./ko":8779,"./ko.js":8779,"./ku":12221,"./ku-kmr":28876,"./ku-kmr.js":28876,"./ku.js":12221,"./ky":27457,"./ky.js":27457,"./lb":4095,"./lb.js":4095,"./lo":19450,"./lo.js":19450,"./lt":85373,"./lt.js":85373,"./lv":60819,"./lv.js":60819,"./me":84879,"./me.js":84879,"./mi":68603,"./mi.js":68603,"./mk":9413,"./mk.js":9413,"./ml":92646,"./ml.js":92646,"./mn":24904,"./mn.js":24904,"./mr":21060,"./mr.js":21060,"./ms":83437,"./ms-my":59158,"./ms-my.js":59158,"./ms.js":83437,"./mt":59886,"./mt.js":59886,"./my":75755,"./my.js":75755,"./nb":2741,"./nb.js":2741,"./ne":40470,"./ne.js":40470,"./nl":11743,"./nl-be":58657,"./nl-be.js":58657,"./nl.js":11743,"./nn":35817,"./nn.js":35817,"./oc-lnc":31561,"./oc-lnc.js":31561,"./pa-in":30402,"./pa-in.js":30402,"./pl":50713,"./pl.js":50713,"./pt":82033,"./pt-br":4e3,"./pt-br.js":4e3,"./pt.js":82033,"./ro":5748,"./ro.js":5748,"./ru":48218,"./ru.js":48218,"./sd":84172,"./sd.js":84172,"./se":31957,"./se.js":31957,"./si":65033,"./si.js":65033,"./sk":40959,"./sk.js":40959,"./sl":21604,"./sl.js":21604,"./sq":9473,"./sq.js":9473,"./sr":38438,"./sr-cyrl":28167,"./sr-cyrl.js":28167,"./sr.js":38438,"./ss":54455,"./ss.js":54455,"./sv":64906,"./sv.js":64906,"./sw":73595,"./sw.js":73595,"./ta":52024,"./ta.js":52024,"./te":51916,"./te.js":51916,"./tet":93798,"./tet.js":93798,"./tg":1370,"./tg.js":1370,"./th":2249,"./th.js":2249,"./tk":89294,"./tk.js":89294,"./tl-ph":88204,"./tl-ph.js":88204,"./tlh":14065,"./tlh.js":14065,"./tr":96855,"./tr.js":96855,"./tzl":33419,"./tzl.js":33419,"./tzm":61050,"./tzm-latn":62490,"./tzm-latn.js":62490,"./tzm.js":61050,"./ug-cn":18719,"./ug-cn.js":18719,"./uk":49437,"./uk.js":49437,"./ur":51148,"./ur.js":51148,"./uz":88580,"./uz-latn":50276,"./uz-latn.js":50276,"./uz.js":88580,"./vi":32202,"./vi.js":32202,"./x-pseudo":44782,"./x-pseudo.js":44782,"./yo":80589,"./yo.js":80589,"./zh-cn":36641,"./zh-cn.js":36641,"./zh-hk":30933,"./zh-hk.js":30933,"./zh-mo":78582,"./zh-mo.js":78582,"./zh-tw":88525,"./zh-tw.js":88525};function i(e){var t=r(e);return o(t)}function r(e){if(!o.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}i.keys=function(){return Object.keys(n)},i.resolve=r,e.exports=i,i.id=42247},66808(e,t,o){"use strict";var n=o(1439),i=o.n(n),r=o(56155);const a=window.BRIGHTSPOT?.web?.pagePaths?.["com.psddev.analytics.ui.AnalyticsDataToolPage"];class s{constructor(e){this.element=void 0,this.contentId=void 0,this.analyticsUrl=void 0,this.isLoaded=!1,this.cache={},this.currentPeriod="hours",this.loadingElement=void 0,this.contentElement=void 0,this.errorElement=void 0,this.periodSelector=void 0,this.element=e,this.contentId=e.dataset.contentId||"",this.analyticsUrl=a,this.loadingElement=e.querySelector(".AnalyticsWidget-loading"),this.contentElement=e.querySelector(".AnalyticsWidget-content"),this.errorElement=e.querySelector(".AnalyticsWidget-error"),this.periodSelector=e.querySelector(".AnalyticsWidget-periodSelector"),this.init()}init(){i()(this.element).closest("[data-tab]").on("tabbedShow",()=>{const e=this.element.closest("[data-tab]");this.isLoaded||e?.classList.contains("TC-unselected")||this.loadAnalyticsData()}),this.periodSelector&&this.periodSelector.addEventListener("change",e=>{const t=e.target;null!==t&&t instanceof HTMLSelectElement&&(this.currentPeriod=t.value,this.loadAnalyticsData())})}async loadAnalyticsData(){const e=this.currentPeriod;if(this.cache[e])this.displayData(this.cache[e]);else{if(!this.analyticsUrl)return console.error("Analytics data endpoint not found in pagePaths"),void this.showError();this.showLoading();try{const t=await fetch(`${this.analyticsUrl}?id=${this.contentId}&period=${e}`);if(!t.ok)throw new Error(`HTTP ${t.status}: ${t.statusText}`);const o=await t.json();if("error"in o)throw new Error(o.error);this.cache[e]=o,this.displayData(o),this.isLoaded=!0}catch(e){console.error("Failed to load analytics data:",e),this.showError()}}}showLoading(){this.loadingElement&&(this.loadingElement.hidden=!1),this.contentElement&&(this.contentElement.hidden=!0),this.errorElement&&(this.errorElement.hidden=!0)}showError(){this.loadingElement&&(this.loadingElement.hidden=!0),this.contentElement&&(this.contentElement.hidden=!0),this.errorElement&&(this.errorElement.hidden=!1)}displayData(e){if(this.loadingElement&&(this.loadingElement.hidden=!0),this.errorElement&&(this.errorElement.hidden=!0),this.contentElement&&(this.contentElement.hidden=!1),!this.contentElement)return;this.contentElement.innerHTML="";const t=document.createElement("div");t.className=`numbersPeriod numbersPeriod-${e.periodLabel}`,t.addEventListener("highchart-loaded",()=>{t.classList.add("chart-loaded")}),e.chartData&&(t.innerHTML=e.chartData),this.contentElement.appendChild(t)}}(0,r.A)(".AnalyticsWidget",e=>{new s(e)})},40482(e,t,o){"use strict";o(67219),o(44764);var n={},i="function"==typeof Map?new Map:null,r="swap",a="move",s="layoutStart",c="layoutEnd",p="layoutAbort",b="remove",M="hideStart",d="filter",l="sort",z="move",u="send",O="beforeSend",A="receive",f="beforeReceive",h="dragReleaseEnd",m="ontouchstart"in window,q=!!window.PointerEvent,_=!!window.navigator.msPointerEnabled;function W(){this._events={},this._queue=[],this._counter=0,this._clearOnEmit=!1}W.prototype.on=function(e,t){if(!this._events||!e||!t)return this;var o=this._events[e];return o||(o=this._events[e]=[]),o.push(t),this},W.prototype.off=function(e,t){if(!this._events||!e||!t)return this;var o,n=this._events[e];if(!n||!n.length)return this;for(;-1!==(o=n.indexOf(t));)n.splice(o,1);return this},W.prototype.clear=function(e){if(!this._events||!e)return this;var t=this._events[e];return t&&(t.length=0,delete this._events[e]),this},W.prototype.emit=function(e){if(!this._events||!e)return this._clearOnEmit=!1,this;var t=this._events[e];if(!t||!t.length)return this._clearOnEmit=!1,this;var o,n=this._queue,i=n.length,r=arguments.length-1;r>3&&((o=[]).push.apply(o,arguments),o.shift()),n.push.apply(n,t),this._clearOnEmit&&(t.length=0,this._clearOnEmit=!1),++this._counter;for(var a=i,s=n.length;a<s;a++)if(0===r?n[a]():1===r?n[a](arguments[1]):2===r?n[a](arguments[1],arguments[2]):3===r?n[a](arguments[1],arguments[2],arguments[3]):n[a].apply(null,o),!this._events)return this;return--this._counter,this._counter||(n.length=0),this},W.prototype.burst=function(){return this._events?(this._clearOnEmit=!0,this.emit.apply(this,arguments),this):this},W.prototype.countListeners=function(e){if(!this._events)return 0;var t=this._events[e];return t?t.length:0},W.prototype.destroy=function(){return this._events?(this._queue.length=this._counter=0,this._events=null,this):this};var g=q?"pointerout":_?"MSPointerOut":"";function y(e){g&&(this._dragger=e,this._timeout=null,this._outEvent=null,this._isActive=!1,this._addBehaviour=this._addBehaviour.bind(this),this._removeBehaviour=this._removeBehaviour.bind(this),this._onTimeout=this._onTimeout.bind(this),this._resetData=this._resetData.bind(this),this._onStart=this._onStart.bind(this),this._onOut=this._onOut.bind(this),this._dragger.on("start",this._onStart))}y.prototype._addBehaviour=function(){this._isActive||(this._isActive=!0,this._dragger.on("move",this._resetData),this._dragger.on("cancel",this._removeBehaviour),this._dragger.on("end",this._removeBehaviour),window.addEventListener(g,this._onOut))},y.prototype._removeBehaviour=function(){this._isActive&&(this._dragger.off("move",this._resetData),this._dragger.off("cancel",this._removeBehaviour),this._dragger.off("end",this._removeBehaviour),window.removeEventListener(g,this._onOut),this._resetData(),this._isActive=!1)},y.prototype._resetData=function(){window.clearTimeout(this._timeout),this._timeout=null,this._outEvent=null},y.prototype._onStart=function(e){"mouse"!==e.pointerType&&this._addBehaviour()},y.prototype._onOut=function(e){this._dragger._getTrackedTouch(e)&&(this._resetData(),this._outEvent=e,this._timeout=window.setTimeout(this._onTimeout,100))},y.prototype._onTimeout=function(){var e=this._outEvent;this._resetData(),this._dragger.isActive()&&this._dragger._onCancel(e)},y.prototype.destroy=function(){g&&(this._dragger.off("start",this._onStart),this._removeBehaviour())};var v=["","webkit","moz","ms","o","Webkit","Moz","MS","O"],L={};function w(e,t){var o=L[t]||"";if(o)return o;for(var n=t[0].toUpperCase()+t.slice(1),i=0;i<v.length;){if((o=v[i]?v[i]+n:t)in e)return L[t]=o,o;++i}return""}function R(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassive",null,t),window.removeEventListener("testPassive",null,t)}catch(e){}return e}var k=window.navigator.userAgent.toLowerCase(),T=k.indexOf("edge")>-1,S=k.indexOf("trident")>-1,E=k.indexOf("firefox")>-1,N=k.indexOf("android")>-1,B=!!R()&&{passive:!0},C="touchAction",D=w(document.documentElement.style,C);function x(e,t){this._element=e,this._emitter=new W,this._isDestroyed=!1,this._cssProps={},this._touchAction="",this._isActive=!1,this._pointerId=null,this._startTime=0,this._startX=0,this._startY=0,this._currentX=0,this._currentY=0,this._onStart=this._onStart.bind(this),this._onMove=this._onMove.bind(this),this._onCancel=this._onCancel.bind(this),this._onEnd=this._onEnd.bind(this),this._edgeHack=null,(T||S)&&(q||_)&&(this._edgeHack=new y(this)),this.setCssProps(t),this._touchAction||this.setTouchAction("auto"),e.addEventListener("dragstart",x._preventDefault,!1),e.addEventListener(x._inputEvents.start,this._onStart,B)}x._pointerEvents={start:"pointerdown",move:"pointermove",cancel:"pointercancel",end:"pointerup"},x._msPointerEvents={start:"MSPointerDown",move:"MSPointerMove",cancel:"MSPointerCancel",end:"MSPointerUp"},x._touchEvents={start:"touchstart",move:"touchmove",cancel:"touchcancel",end:"touchend"},x._mouseEvents={start:"mousedown",move:"mousemove",cancel:"",end:"mouseup"},x._inputEvents=m?x._touchEvents:q?x._pointerEvents:_?x._msPointerEvents:x._mouseEvents,x._emitter=new W,x._emitterEvents={start:"start",move:"move",end:"end",cancel:"cancel"},x._activeInstances=[],x._preventDefault=function(e){e.preventDefault&&!1!==e.cancelable&&e.preventDefault()},x._activateInstance=function(e){x._activeInstances.indexOf(e)>-1||(x._activeInstances.push(e),x._emitter.on(x._emitterEvents.move,e._onMove),x._emitter.on(x._emitterEvents.cancel,e._onCancel),x._emitter.on(x._emitterEvents.end,e._onEnd),1===x._activeInstances.length&&x._bindListeners())},x._deactivateInstance=function(e){var t=x._activeInstances.indexOf(e);-1!==t&&(x._activeInstances.splice(t,1),x._emitter.off(x._emitterEvents.move,e._onMove),x._emitter.off(x._emitterEvents.cancel,e._onCancel),x._emitter.off(x._emitterEvents.end,e._onEnd),x._activeInstances.length||x._unbindListeners())},x._bindListeners=function(){window.addEventListener(x._inputEvents.move,x._onMove,B),window.addEventListener(x._inputEvents.end,x._onEnd,B),x._inputEvents.cancel&&window.addEventListener(x._inputEvents.cancel,x._onCancel,B)},x._unbindListeners=function(){window.removeEventListener(x._inputEvents.move,x._onMove,B),window.removeEventListener(x._inputEvents.end,x._onEnd,B),x._inputEvents.cancel&&window.removeEventListener(x._inputEvents.cancel,x._onCancel,B)},x._getEventPointerId=function(e){return"number"==typeof e.pointerId?e.pointerId:e.changedTouches?e.changedTouches[0]?e.changedTouches[0].identifier:null:1},x._getTouchById=function(e,t){if("number"==typeof e.pointerId)return e.pointerId===t?e:null;if(e.changedTouches){for(var o=0;o<e.changedTouches.length;o++)if(e.changedTouches[o].identifier===t)return e.changedTouches[o];return null}return e},x._onMove=function(e){x._emitter.emit(x._emitterEvents.move,e)},x._onCancel=function(e){x._emitter.emit(x._emitterEvents.cancel,e)},x._onEnd=function(e){x._emitter.emit(x._emitterEvents.end,e)},x.prototype._reset=function(){this._pointerId=null,this._startTime=0,this._startX=0,this._startY=0,this._currentX=0,this._currentY=0,this._isActive=!1,x._deactivateInstance(this)},x.prototype._createEvent=function(e,t){var o=this._getTrackedTouch(t);return{type:e,srcEvent:t,distance:this.getDistance(),deltaX:this.getDeltaX(),deltaY:this.getDeltaY(),deltaTime:e===x._emitterEvents.start?0:this.getDeltaTime(),isFirst:e===x._emitterEvents.start,isFinal:e===x._emitterEvents.end||e===x._emitterEvents.cancel,pointerType:t.pointerType||(t.touches?"touch":"mouse"),identifier:this._pointerId,screenX:o.screenX,screenY:o.screenY,clientX:o.clientX,clientY:o.clientY,pageX:o.pageX,pageY:o.pageY,target:o.target}},x.prototype._emit=function(e,t){this._emitter.emit(e,this._createEvent(e,t))},x.prototype._getTrackedTouch=function(e){return null===this._pointerId?null:x._getTouchById(e,this._pointerId)},x.prototype._onStart=function(e){if(!this._isDestroyed&&null===this._pointerId&&(this._pointerId=x._getEventPointerId(e),null!==this._pointerId)){var t=this._getTrackedTouch(e);this._startX=this._currentX=t.clientX,this._startY=this._currentY=t.clientY,this._startTime=Date.now(),this._isActive=!0,this._emit(x._emitterEvents.start,e),this._isActive&&x._activateInstance(this)}},x.prototype._onMove=function(e){var t=this._getTrackedTouch(e);t&&(this._currentX=t.clientX,this._currentY=t.clientY,this._emit(x._emitterEvents.move,e))},x.prototype._onCancel=function(e){this._getTrackedTouch(e)&&(this._emit(x._emitterEvents.cancel,e),this._reset())},x.prototype._onEnd=function(e){this._getTrackedTouch(e)&&(this._emit(x._emitterEvents.end,e),this._reset())},x.prototype.isActive=function(){return this._isActive},x.prototype.setTouchAction=function(e){this._touchAction=e,D&&(this._cssProps[D]="",this._element.style[D]=e),m&&(this._element.removeEventListener(x._touchEvents.start,x._preventDefault,!0),(this._element.style[D]!==e||E&&N)&&this._element.addEventListener(x._touchEvents.start,x._preventDefault,!0))},x.prototype.setCssProps=function(e){if(e){var t,o,n=this._cssProps,i=this._element;for(t in n)i.style[t]=n[t],delete n[t];for(t in e)e[t]&&(t!==C?(o=w(i.style,t))&&(n[o]="",i.style[o]=e[t]):this.setTouchAction(e[t]))}},x.prototype.getDeltaX=function(){return this._currentX-this._startX},x.prototype.getDeltaY=function(){return this._currentY-this._startY},x.prototype.getDistance=function(){var e=this.getDeltaX(),t=this.getDeltaY();return Math.sqrt(e*e+t*t)},x.prototype.getDeltaTime=function(){return this._startTime?Date.now()-this._startTime:0},x.prototype.on=function(e,t){this._emitter.on(e,t)},x.prototype.off=function(e,t){this._emitter.off(e,t)},x.prototype.destroy=function(){if(!this._isDestroyed){var e=this._element;for(var t in this._edgeHack&&this._edgeHack.destroy(),this._reset(),this._emitter.destroy(),e.removeEventListener(x._inputEvents.start,this._onStart,B),e.removeEventListener("dragstart",x._preventDefault,!1),e.removeEventListener(x._touchEvents.start,x._preventDefault,!0),this._cssProps)e.style[t]=this._cssProps[t],delete this._cssProps[t];this._element=null,this._isDestroyed=!0}};var X=1e3/60,Y=(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(e){return this.setTimeout(function(){e(Date.now())},X)}).bind(window);function P(e){this._nextStep=null,this._lanes=[],this._stepQueue=[],this._stepCallbacks={},this._step=this._step.bind(this);for(var t=0;t<e;t++)this._lanes.push(new I)}function I(){this.queue=[],this.indices={},this.callbacks={}}P.prototype._step=function(e){var t,o,n,i,r,a,s=this._lanes,c=this._stepQueue,p=this._stepCallbacks;for(this._nextStep=null,t=0;t<s.length;t++){for(i=s[t].queue,r=s[t].callbacks,a=s[t].indices,o=0;o<i.length;o++)(n=i[o])&&(c.push(n),p[n]=r[n],delete r[n],delete a[n]);i.length=0}for(t=0;t<c.length;t++)p[n=c[t]]&&p[n](e),delete p[n];c.length=0},P.prototype.add=function(e,t,o){this._lanes[e].add(t,o),this._nextStep||(this._nextStep=Y(this._step))},P.prototype.remove=function(e,t){this._lanes[e].remove(t)},I.prototype.add=function(e,t){var o=this.indices[e];void 0!==o&&(this.queue[o]=void 0),this.queue.push(e),this.callbacks[e]=t,this.indices[e]=this.queue.length-1},I.prototype.remove=function(e){var t=this.indices[e];void 0!==t&&(this.queue[t]=void 0,delete this.callbacks[e],delete this.indices[e])};var H="layoutRead",j="layoutWrite",F="visibilityRead",G="visibilityWrite",$="dragStartRead",U="dragStartWrite",V="dragMoveRead",J="dragMoveWrite",K="dragScrollRead",Q="dragScrollWrite",Z="dragSortRead",ee="placeholderLayoutRead",te="placeholderLayoutWrite",oe="placeholderResizeWrite",ne="autoScrollRead",ie="autoScrollWrite",re="debounceRead",ae=new P(3);function se(e){ae.remove(0,H+e),ae.remove(2,j+e)}function ce(e){ae.remove(0,F+e),ae.remove(2,G+e)}function pe(e){ae.remove(0,$+e),ae.remove(2,U+e)}function be(e){ae.remove(0,V+e),ae.remove(2,J+e)}function Me(e){ae.remove(0,K+e),ae.remove(2,Q+e)}function de(e,t){ae.add(1,Z+e,t)}function le(e){ae.remove(0,ee+e),ae.remove(2,te+e)}function ze(e,t){ae.add(0,ne,e),ae.add(2,ie,t)}function ue(e){return"function"==typeof e}var Oe="function"==typeof WeakMap?new WeakMap:null;function Ae(e,t){var o=Oe&&Oe.get(e);return o||(o=window.getComputedStyle(e,null),Oe&&Oe.set(e,o)),o.getPropertyValue(t)}function fe(e,t){return parseFloat(Ae(e,t))||0}var he,me=document.documentElement,qe=document.body,_e={value:0,offset:0};function We(e){return e===window||e===me||e===qe?window:e}function ge(e){return e===window?e.pageXOffset:e.scrollLeft}function ye(e){return e===window?e.pageYOffset:e.scrollTop}function ve(e){return e===window?me.scrollWidth-me.clientWidth:e.scrollWidth-e.clientWidth}function Le(e){return e===window?me.scrollHeight-me.clientHeight:e.scrollHeight-e.clientHeight}function we(e,t){if(t=t||{},e===window)t.width=me.clientWidth,t.height=me.clientHeight,t.left=0,t.right=t.width,t.top=0,t.bottom=t.height;else{var o=e.getBoundingClientRect(),n=e.clientLeft||fe(e,"border-left-width"),i=e.clientTop||fe(e,"border-top-width");t.width=e.clientWidth,t.height=e.clientHeight,t.left=o.left+n,t.right=t.left+t.width,t.top=o.top+i,t.bottom=t.top+t.height}return t}function Re(e){return e._drag._getGrid()._settings.dragAutoScroll}function ke(e){e._drag&&e._drag._prepareScroll()}function Te(e){if(e._drag&&e._isActive){var t=e._drag;t._scrollDiffX=t._scrollDiffY=0,e._setTranslate(t._left,t._top)}}function Se(e,t,o,n){return _e.value=Math.min(n/2,e),_e.offset=Math.max(0,o+2*_e.value+n*t-n)/2,_e}function Ee(){this.reset()}function Ne(){this.element=null,this.requestX=null,this.requestY=null,this.scrollLeft=0,this.scrollTop=0}function Be(e,t){this.pool=[],this.createItem=e,this.releaseItem=t}function Ce(e,t){var o=function(e,t){return function(e,t){return!(e.left+e.width<=t.left||t.left+t.width<=e.left||e.top+e.height<=t.top||t.top+t.height<=e.top)}(e,t)?(Math.min(e.left+e.width,t.left+t.width)-Math.max(e.left,t.left))*(Math.min(e.top+e.height,t.top+t.height)-Math.max(e.top,t.top)):0}(e,t);return o?o/(Math.min(e.width,t.width)*Math.min(e.height,t.height))*100:0}Ee.prototype.reset=function(){this.isActive&&this.onStop(),this.item=null,this.element=null,this.isActive=!1,this.isEnding=!1,this.direction=null,this.value=null,this.maxValue=0,this.threshold=0,this.distance=0,this.speed=0,this.duration=0,this.action=null},Ee.prototype.hasReachedEnd=function(){return 4&this.direction?this.value>=this.maxValue:this.value<=0},Ee.prototype.computeCurrentScrollValue=function(){return null===this.value?1&this.direction?ge(this.element):ye(this.element):Math.max(0,Math.min(this.value,this.maxValue))},Ee.prototype.computeNextScrollValue=function(e){var t=this.speed*(e/1e3),o=4&this.direction?this.value+t:this.value-t;return Math.max(0,Math.min(o,this.maxValue))},Ee.prototype.computeSpeed=(he={direction:null,threshold:0,distance:0,value:0,maxValue:0,deltaTime:0,duration:0,isEnding:!1},function(e){var t=this.item,o=Re(t).speed;return ue(o)?(he.direction=this.direction,he.threshold=this.threshold,he.distance=this.distance,he.value=this.value,he.maxValue=this.maxValue,he.duration=this.duration,he.speed=this.speed,he.deltaTime=e,he.isEnding=this.isEnding,o(t,this.element,he)):o}),Ee.prototype.tick=function(e){return this.isActive||(this.isActive=!0,this.onStart()),this.value=this.computeCurrentScrollValue(),this.speed=this.computeSpeed(e),this.value=this.computeNextScrollValue(e),this.duration+=e,this.value},Ee.prototype.onStart=function(){var e=this.item,t=Re(e).onStart;ue(t)&&t(e,this.element,this.direction)},Ee.prototype.onStop=function(){var e=this.item,t=Re(e).onStop;ue(t)&&t(e,this.element,this.direction),e._drag&&e._drag.sort()},Ne.prototype.reset=function(){this.requestX&&(this.requestX.action=null),this.requestY&&(this.requestY.action=null),this.element=null,this.requestX=null,this.requestY=null,this.scrollLeft=0,this.scrollTop=0},Ne.prototype.addRequest=function(e){1&e.direction?(this.removeRequest(this.requestX),this.requestX=e):(this.removeRequest(this.requestY),this.requestY=e),e.action=this},Ne.prototype.removeRequest=function(e){e&&(this.requestX===e?(this.requestX=null,e.action=null):this.requestY===e&&(this.requestY=null,e.action=null))},Ne.prototype.computeScrollValues=function(){this.scrollLeft=this.requestX?this.requestX.value:ge(this.element),this.scrollTop=this.requestY?this.requestY.value:ye(this.element)},Ne.prototype.scroll=function(){var e=this.element;e&&(e.scrollTo?e.scrollTo(this.scrollLeft,this.scrollTop):(e.scrollLeft=this.scrollLeft,e.scrollTop=this.scrollTop))},Be.prototype.pick=function(){return this.pool.pop()||this.createItem()},Be.prototype.release=function(e){this.releaseItem(e),-1===this.pool.indexOf(e)&&this.pool.push(e)},Be.prototype.reset=function(){this.pool.length=0};var De={width:0,height:0,left:0,right:0,top:0,bottom:0},xe={width:0,height:0,left:0,right:0,top:0,bottom:0};function Xe(){this._isDestroyed=!1,this._isTicking=!1,this._tickTime=0,this._tickDeltaTime=0,this._items=[],this._actions=[],this._requests={},this._requests[1]={},this._requests[2]={},this._requestOverlapCheck={},this._dragPositions={},this._dragDirections={},this._overlapCheckInterval=150,this._requestPool=new Be(function(){return new Ee},function(e){e.reset()}),this._actionPool=new Be(function(){return new Ne},function(e){e.reset()}),this._readTick=this._readTick.bind(this),this._writeTick=this._writeTick.bind(this)}Xe.AXIS_X=1,Xe.AXIS_Y=2,Xe.FORWARD=4,Xe.BACKWARD=8,Xe.LEFT=9,Xe.RIGHT=5,Xe.UP=10,Xe.DOWN=6,Xe.smoothSpeed=function(e,t,o){return function(n,i,r){var a=0;if(!r.isEnding)if(r.threshold>0){var s=r.threshold-Math.max(0,r.distance);a=e/r.threshold*s}else a=e;var c=r.speed,p=a;return c===a?p:c<a?(p=c+t*(r.deltaTime/1e3),Math.min(a,p)):(p=c-o*(r.deltaTime/1e3),Math.max(a,p))}},Xe.pointerHandle=function(e){var t={left:0,top:0,width:0,height:0},o=e||1;return function(e,n,i,r,a,s,c){return t.left=s-.5*o,t.top=c-.5*o,t.width=o,t.height=o,t}},Xe.prototype._readTick=function(e){this._isDestroyed||(e&&this._tickTime?(this._tickDeltaTime=e-this._tickTime,this._tickTime=e,this._updateRequests(),this._updateActions()):(this._tickTime=e,this._tickDeltaTime=0))},Xe.prototype._writeTick=function(){this._isDestroyed||(this._applyActions(),ze(this._readTick,this._writeTick))},Xe.prototype._startTicking=function(){this._isTicking=!0,ze(this._readTick,this._writeTick)},Xe.prototype._stopTicking=function(){this._isTicking=!1,this._tickTime=0,this._tickDeltaTime=0,ae.remove(0,ne),ae.remove(2,ie)},Xe.prototype._getItemHandleRect=function(e,t,o){var n=e._drag;if(t){var i=n._dragMoveEvent||n._dragStartEvent,r=t(e,n._clientX,n._clientY,e._width,e._height,i.clientX,i.clientY);o.left=r.left,o.top=r.top,o.width=r.width,o.height=r.height}else o.left=n._clientX,o.top=n._clientY,o.width=e._width,o.height=e._height;return o.right=o.left+o.width,o.bottom=o.top+o.height,o},Xe.prototype._requestItemScroll=function(e,t,o,n,i,r,a){var s=this._requests[t],c=s[e._id];c?c.element===o&&c.direction===n||c.reset():c=this._requestPool.pick(),c.item=e,c.element=o,c.direction=n,c.threshold=i,c.distance=r,c.maxValue=a,s[e._id]=c},Xe.prototype._cancelItemScroll=function(e,t){var o=this._requests[t],n=o[e._id];n&&(n.action&&n.action.removeRequest(n),this._requestPool.release(n),delete o[e._id])},Xe.prototype._checkItemOverlap=function(e,t,o){var n=Re(e),i=ue(n.targets)?n.targets(e):n.targets,r=n.threshold,a=n.safeZone;if(!i||!i.length)return t&&this._cancelItemScroll(e,1),void(o&&this._cancelItemScroll(e,2));var s=this._dragDirections[e._id],c=s[0],p=s[1];if(!c&&!p)return t&&this._cancelItemScroll(e,1),void(o&&this._cancelItemScroll(e,2));for(var b=this._getItemHandleRect(e,n.handle,De),M=xe,d=null,l=null,z=!0,u=!0,O=0,A=0,f=null,h=null,m=0,q=0,_=0,W=null,g=-1/0,y=0,v=0,L=null,w=0,R=0,k=null,T=-1/0,S=0,E=0,N=null,B=0,C=0,D=0;D<i.length;D++)d=i[D],z=t&&c&&2!==d.axis,u=o&&p&&1!==d.axis,A=d.priority||0,(!z||A<g)&&(!u||A<T)||(l=We(d.element||d),q=z?ve(l):-1,_=u?Le(l):-1,(q||_)&&((O=Ce(b,M=we(l,M)))<=0||(z&&A>=g&&q>0&&(A>g||O>v)&&(h=null,f=Se("number"==typeof d.threshold?d.threshold:r,a,b.width,M.width),5===c?(m=M.right+f.offset-b.right)<=f.value&&ge(l)<q&&(h=5):9===c&&(m=b.left-(M.left-f.offset))<=f.value&&ge(l)>0&&(h=9),null!==h&&(W=l,g=A,y=f.value,v=O,L=h,w=m,R=q)),u&&A>=T&&_>0&&(A>T||O>E)&&(h=null,f=Se("number"==typeof d.threshold?d.threshold:r,a,b.height,M.height),6===p?(m=M.bottom+f.offset-b.bottom)<=f.value&&ye(l)<_&&(h=6):10===p&&(m=b.top-(M.top-f.offset))<=f.value&&ye(l)>0&&(h=10),null!==h&&(k=l,T=A,S=f.value,E=O,N=h,B=m,C=_)))));t&&(W?this._requestItemScroll(e,1,W,L,y,w,R):this._cancelItemScroll(e,1)),o&&(k?this._requestItemScroll(e,2,k,N,S,B,C):this._cancelItemScroll(e,2))},Xe.prototype._updateScrollRequest=function(e){for(var t=e.item,o=Re(t),n=ue(o.targets)?o.targets(t):o.targets,i=n&&n.length||0,r=o.threshold,a=o.safeZone,s=this._getItemHandleRect(t,o.handle,De),c=xe,p=null,b=null,M=!1,d=null,l=null,z=null,u=null,O=null,A=0;A<i;A++)if((b=We((p=n[A]).element||p))===e.element){if(M=!!(1&e.direction)){if(2===p.axis)continue}else if(1===p.axis)continue;if((u=M?ve(b):Le(b))<=0)break;if(Ce(s,c=we(b,c))<=0)break;if(d=Se("number"==typeof p.threshold?p.threshold:r,a,M?s.width:s.height,M?c.width:c.height),(l=9===e.direction?s.left-(c.left-d.offset):5===e.direction?c.right+d.offset-s.right:10===e.direction?s.top-(c.top-d.offset):c.bottom+d.offset-s.bottom)>d.value)break;if(z=M?ge(b):ye(b),O=4&e.direction?z>=u:z<=0)break;return e.maxValue=u,e.threshold=d.value,e.distance=l,e.isEnding=!1,!0}return!0===o.smoothStop&&e.speed>0?(null===O&&(O=e.hasReachedEnd()),e.isEnding=!O):e.isEnding=!1,e.isEnding},Xe.prototype._updateRequests=function(){for(var e,t,o,n,i,r,a,s=this._items,c=this._requests[1],p=this._requests[2],b=0;b<s.length;b++)e=s[b],i=(n=this._requestOverlapCheck[e._id])>0&&this._tickTime-n>this._overlapCheckInterval,r=!0,(t=c[e._id])&&t.isActive&&(r=!this._updateScrollRequest(t))&&(i=!0,this._cancelItemScroll(e,1)),a=!0,(o=p[e._id])&&o.isActive&&(a=!this._updateScrollRequest(o))&&(i=!0,this._cancelItemScroll(e,2)),i&&(this._requestOverlapCheck[e._id]=0,this._checkItemOverlap(e,r,a))},Xe.prototype._requestAction=function(e,t){for(var o=this._actions,n=1===t,i=null,r=0;r<o.length;r++){if(i=o[r],e.element===i.element){if(n?i.requestX:i.requestY)return void this._cancelItemScroll(e.item,t);break}i=null}i||(i=this._actionPool.pick()),i.element=e.element,i.addRequest(e),e.tick(this._tickDeltaTime),o.push(i)},Xe.prototype._updateActions=function(){var e,t,o,n,i=this._items,r=this._requests,a=this._actions;for(n=0;n<i.length;n++)e=i[n]._id,t=r[1][e],o=r[2][e],t&&this._requestAction(t,1),o&&this._requestAction(o,2);for(n=0;n<a.length;n++)a[n].computeScrollValues()},Xe.prototype._applyActions=function(){var e,t=this._actions,o=this._items;if(t.length){for(e=0;e<t.length;e++)t[e].scroll(),this._actionPool.release(t[e]);for(t.length=0,e=0;e<o.length;e++)ke(o[e]);for(e=0;e<o.length;e++)Te(o[e])}},Xe.prototype._updateDragDirection=function(e){var t=this._dragPositions[e._id],o=this._dragDirections[e._id],n=e._drag._left,i=e._drag._top;if(t.length){var r=t[0],a=t[1];o[0]=n>r?5:n<r?9:o[0]||0,o[1]=i>a?6:i<a?10:o[1]||0}t[0]=n,t[1]=i},Xe.prototype.addItem=function(e){this._isDestroyed||-1===this._items.indexOf(e)&&(this._items.push(e),this._requestOverlapCheck[e._id]=this._tickTime,this._dragDirections[e._id]=[0,0],this._dragPositions[e._id]=[],this._isTicking||this._startTicking())},Xe.prototype.updateItem=function(e){this._isDestroyed||this._dragDirections[e._id]&&(this._updateDragDirection(e),this._requestOverlapCheck[e._id]||(this._requestOverlapCheck[e._id]=this._tickTime))},Xe.prototype.removeItem=function(e){if(!this._isDestroyed){var t=this._items.indexOf(e);if(-1!==t){var o=e._id;this._requests[1][o]&&(this._cancelItemScroll(e,1),delete this._requests[1][o]),this._requests[2][o]&&(this._cancelItemScroll(e,2),delete this._requests[2][o]),delete this._requestOverlapCheck[o],delete this._dragPositions[o],delete this._dragDirections[o],this._items.splice(t,1),this._isTicking&&!this._items.length&&this._stopTicking()}}},Xe.prototype.isItemScrollingX=function(e){var t=this._requests[1][e._id];return!(!t||!t.isActive)},Xe.prototype.isItemScrollingY=function(e){var t=this._requests[2][e._id];return!(!t||!t.isActive)},Xe.prototype.isItemScrolling=function(e){return this.isItemScrollingX(e)||this.isItemScrollingY(e)},Xe.prototype.destroy=function(){if(!this._isDestroyed){for(var e=this._items.slice(0),t=0;t<e.length;t++)this.removeItem(e[t]);this._actions.length=0,this._requestPool.reset(),this._actionPool.reset(),this._isDestroyed=!0}};var Ye=window.Element.prototype,Pe=Ye.matches||Ye.matchesSelector||Ye.webkitMatchesSelector||Ye.mozMatchesSelector||Ye.msMatchesSelector||Ye.oMatchesSelector||function(){return!1};function Ie(e,t){return Pe.call(e,t)}function He(e,t){t&&(e.classList?e.classList.add(t):Ie(e,"."+t)||(e.className+=" "+t))}var je=[];function Fe(e,t,o){var n="number"==typeof o?o:-1;n<0&&(n=e.length-n+1),e.splice.apply(e,je.concat(n,0,t)),je.length=0}function Ge(e,t,o){var n=Math.max(0,e.length-1+(o||0));return t>n?n:t<0?Math.max(n+t+1,0):t}function $e(e,t,o){if(!(e.length<2)){var n=Ge(e,t),i=Ge(e,o);n!==i&&e.splice(i,0,e.splice(n,1)[0])}}function Ue(e,t,o){if(!(e.length<2)){var n,i=Ge(e,t),r=Ge(e,o);i!==r&&(n=e[i],e[i]=e[r],e[r]=n)}}var Ve=w(document.documentElement.style,"transform")||"transform",Je=/([A-Z])/g,Ke=/^(webkit-|moz-|ms-|o-)/,Qe=/^(-m-s-)/;function Ze(e){var t=e.replace(Je,"-$1").toLowerCase();return(t=t.replace(Ke,"-$1")).replace(Qe,"-ms-")}var et=Ze(Ve);function tt(e){var t=Ae(e,et);if(!t||"none"===t)return!1;var o=Ae(e,"display");return"inline"!==o&&"none"!==o}function ot(e){for(var t=document,o=e||t;o&&o!==t&&"static"===Ae(o,"position")&&!tt(o);)o=o.parentElement||t;return o}var nt={},it={},rt={};function at(e,t){var o,n=t||{};return n.left=0,n.top=0,e===document||(n.left=window.pageXOffset||0,n.top=window.pageYOffset||0,e.self===window.self||(o=e.getBoundingClientRect(),n.left+=o.left,n.top+=o.top,n.left+=fe(e,"border-left-width"),n.top+=fe(e,"border-top-width"))),n}function st(e,t,o){return rt.left=0,rt.top=0,e===t||o&&(e=ot(e))===(t=ot(t))||(at(e,nt),at(t,it),rt.left=it.left-nt.left,rt.top=it.top-nt.top),rt}function ct(e){return"auto"===e||"scroll"===e||"overlay"===e}function pt(e){return ct(Ae(e,"overflow"))||ct(Ae(e,"overflow-x"))||ct(Ae(e,"overflow-y"))}function bt(e,t){for(t=t||[];e&&e!==document;)e.getRootNode&&e instanceof DocumentFragment?e=e.getRootNode().host:(pt(e)&&t.push(e),e=e.parentNode);return t.push(window),t}var Mt={},dt=/^matrix3d/,lt=/([^,]*,){4}/,zt=/([^,]*,){12}/,ut=/[^,]*,/;function Ot(e){Mt.x=0,Mt.y=0;var t=Ae(e,et);if(!t||"none"===t)return Mt;var o=dt.test(t),n=t.replace(o?zt:lt,""),i=n.replace(ut,"");return Mt.x=parseFloat(n)||0,Mt.y=parseFloat(i)||0,Mt}function At(e,t){t&&(e.classList?e.classList.remove(t):Ie(e,"."+t)&&(e.className=(" "+e.className+" ").replace(" "+t+" "," ").trim()))}var ft,ht,mt,qt,_t=/^(iPad|iPhone|iPod)/.test(window.navigator.platform)||/^Mac/.test(window.navigator.platform)&&window.navigator.maxTouchPoints>1,Wt=!!R()&&{passive:!0};function gt(e){var t=e._element,o=e.getGrid(),n=o._settings;this._item=e,this._gridId=o._id,this._isDestroyed=!1,this._isMigrating=!1,this._startPredicate=ue(n.dragStartPredicate)?n.dragStartPredicate:gt.defaultStartPredicate,this._startPredicateState=0,this._startPredicateResult=void 0,this._isSortNeeded=!1,this._sortTimer=void 0,this._blockedSortIndex=null,this._sortX1=0,this._sortX2=0,this._sortY1=0,this._sortY2=0,this._reset(),this._preStartCheck=this._preStartCheck.bind(this),this._preEndCheck=this._preEndCheck.bind(this),this._onScroll=this._onScroll.bind(this),this._prepareStart=this._prepareStart.bind(this),this._applyStart=this._applyStart.bind(this),this._prepareMove=this._prepareMove.bind(this),this._applyMove=this._applyMove.bind(this),this._prepareScroll=this._prepareScroll.bind(this),this._applyScroll=this._applyScroll.bind(this),this._handleSort=this._handleSort.bind(this),this._handleSortDelayed=this._handleSortDelayed.bind(this),this._handle=n.dragHandle&&t.querySelector(n.dragHandle)||t,this._dragger=new x(this._handle,n.dragCssProps),this._dragger.on("start",this._preStartCheck),this._dragger.on("move",this._preStartCheck),this._dragger.on("cancel",this._preEndCheck),this._dragger.on("end",this._preEndCheck)}function yt(e,t){var o,n,i={};if(Array.isArray(t))for(n=0;n<t.length;n++)i[o=t[n]]=Ae(e,Ze(o));else for(o in t)i[o]=Ae(e,Ze(o));return i}gt.autoScroller=new Xe,gt.defaultStartPredicate=function(e,t,o){var n=e._drag;if(t.isFirst&&t.srcEvent.button)return!1;if(!_t&&t.isFirst&&!0===t.srcEvent.isTrusted&&!1===t.srcEvent.defaultPrevented&&!1===t.srcEvent.cancelable)return!1;if(!t.isFinal){var i=n._startPredicateData;if(!i){var r=o||n._getGrid()._settings.dragStartPredicate||{};n._startPredicateData=i={distance:Math.max(r.distance,0)||0,delay:Math.max(r.delay,0)||0}}return i.delay&&(i.event=t,i.delayTimer||(i.delayTimer=window.setTimeout(function(){i.delay=0,n._resolveStartPredicate(i.event)&&(n._forceResolveStartPredicate(i.event),n._resetStartPredicate())},i.delay))),n._resolveStartPredicate(t)}n._finishStartPredicate(t)},gt.defaultSortPredicate=(ft={},ht={},mt={},qt=[],function(e,t){var o=e._drag,n=o._getGrid(),i=t&&"number"==typeof t.threshold?t.threshold:50,s=t&&t.action===r?r:a,c=t&&t.migrateAction===r?r:a;i=Math.min(Math.max(i,1),100),ft.width=e._width,ft.height=e._height,ft.left=o._clientX,ft.top=o._clientY;var p=function(e,t,o){var n,i,r,a,s,c,p,b,M,d,l=null,z=t._settings.dragSort,u=-1;if(!0===z?(qt[0]=t,i=qt):ue(z)&&(i=z.call(t,e)),!i||!Array.isArray(i)||!i.length)return l;for(d=0;d<i.length;d++)if(!(r=i[d])._isDestroyed){for(r._updateBoundingRect(),c=Math.max(0,r._left),p=Math.max(0,r._top),b=Math.min(window.innerWidth,r._right),M=Math.min(window.innerHeight,r._bottom),a=r._element.parentNode;a&&a!==document&&a!==document.documentElement&&a!==document.body;)if(a.getRootNode&&a instanceof DocumentFragment)a=a.getRootNode().host;else{if("visible"!==Ae(a,"overflow")&&(s=a.getBoundingClientRect(),c=Math.max(c,s.left),p=Math.max(p,s.top),b=Math.min(b,s.right),M=Math.min(M,s.bottom)),"fixed"===Ae(a,"position"))break;a=a.parentNode}c>=b||p>=M||(ht.left=c,ht.top=p,ht.width=b-c,ht.height=M-p,(n=Ce(ft,ht))>o&&n>u&&(u=n,l=r))}return qt.length=0,l}(e,n,i);if(!p)return null;var b,M,d,l=e.getGrid()!==p,z=0,u=0,O=0,A=-1,f=!1;for(p===n?(ft.left=o._gridX+e._marginLeft,ft.top=o._gridY+e._marginTop):(p._updateBorders(1,0,1,0),z=p._left+p._borderLeft,u=p._top+p._borderTop),d=0;d<p._items.length;d++)(b=p._items[d])._isActive&&b!==e&&(f=!0,ht.width=b._width,ht.height=b._height,ht.left=b._left+b._marginLeft+z,ht.top=b._top+b._marginTop+u,(M=Ce(ft,ht))>O&&(A=d,O=M));return l&&O<i&&(A=f?A:0,O=i),O>=i?(mt.grid=p,mt.index=A,mt.action=l?c:s,mt):null}),gt.prototype.stop=function(){if(this._isActive)if(this._isMigrating)this._finishMigration();else{var e=this._item,t=e._id;if(gt.autoScroller.removeItem(e),pe(t),be(t),Me(t),this._cancelSort(),this._isStarted){this._unbindScrollListeners();var o=e._element,n=this._getGrid(),i=n._settings.itemDraggingClass;o.parentNode!==n._element&&(n._element.appendChild(o),e._setTranslate(this._gridX,this._gridY),i&&o.clientWidth),At(o,i)}this._reset()}},gt.prototype.sort=function(e){var t=this._item;this._isActive&&t._isActive&&this._dragMoveEvent&&(!0===e?this._handleSort():de(t._id,this._handleSort))},gt.prototype.destroy=function(){this._isDestroyed||(this.stop(),this._dragger.destroy(),gt.autoScroller.removeItem(this._item),this._isDestroyed=!0)},gt.prototype._getGrid=function(){return n[this._gridId]||null},gt.prototype._reset=function(){this._isActive=!1,this._isStarted=!1,this._container=null,this._containingBlock=null,this._dragStartEvent=null,this._dragMoveEvent=null,this._dragPrevMoveEvent=null,this._scrollEvent=null,this._scrollers=[],this._left=0,this._top=0,this._gridX=0,this._gridY=0,this._clientX=0,this._clientY=0,this._scrollDiffX=0,this._scrollDiffY=0,this._moveDiffX=0,this._moveDiffY=0,this._containerDiffX=0,this._containerDiffY=0},gt.prototype._bindScrollListeners=function(){var e,t,o=this._getGrid()._element,n=this._container,i=this._scrollers;if(i.length=0,bt(this._item._element.parentNode,i),n!==o)for(bt(o,e=[]),t=0;t<e.length;t++)i.indexOf(e[t])<0&&i.push(e[t]);for(t=0;t<i.length;t++)i[t].addEventListener("scroll",this._onScroll,Wt)},gt.prototype._unbindScrollListeners=function(){var e,t=this._scrollers;for(e=0;e<t.length;e++)t[e].removeEventListener("scroll",this._onScroll,Wt);t.length=0},gt.prototype._resolveStartPredicate=function(e){var t=this._startPredicateData;if(!(e.distance<t.distance||t.delay))return this._resetStartPredicate(),!0},gt.prototype._forceResolveStartPredicate=function(e){this._isDestroyed||1!==this._startPredicateState||(this._startPredicateState=2,this._onStart(e))},gt.prototype._finishStartPredicate=function(e){var t=this._item._element,o=Math.abs(e.deltaX)<2&&Math.abs(e.deltaY)<2&&e.deltaTime<200;this._resetStartPredicate(),o&&function(e){if("a"===e.tagName.toLowerCase()){var t=e.getAttribute("href");if(t){var o=e.getAttribute("target");o&&"_self"!==o?window.open(t,o):window.location.href=t}}}(t)},gt.prototype._resetHeuristics=function(e,t){this._blockedSortIndex=null,this._sortX1=this._sortX2=e,this._sortY1=this._sortY2=t},gt.prototype._checkHeuristics=function(e,t){var o=this._getGrid()._settings.dragSortHeuristics,n=o.minDragDistance;if(n<=0)return this._blockedSortIndex=null,!0;var i=e-this._sortX2,r=t-this._sortY2,a=n>3&&o.minBounceBackAngle>0;if(a||(this._blockedSortIndex=null),Math.abs(i)>n||Math.abs(r)>n){if(a){var s=Math.atan2(i,r),c=Math.atan2(this._sortX2-this._sortX1,this._sortY2-this._sortY1),p=Math.atan2(Math.sin(s-c),Math.cos(s-c));Math.abs(p)>o.minBounceBackAngle&&(this._blockedSortIndex=null)}return this._sortX1=this._sortX2,this._sortY1=this._sortY2,this._sortX2=e,this._sortY2=t,!0}return!1},gt.prototype._resetStartPredicate=function(){var e=this._startPredicateData;e&&(e.delayTimer&&(e.delayTimer=window.clearTimeout(e.delayTimer)),this._startPredicateData=null)},gt.prototype._handleSort=function(){if(this._isActive){var e=this._getGrid()._settings;if(!e.dragSort||!e.dragAutoScroll.sortDuringScroll&&gt.autoScroller.isItemScrolling(this._item))return this._sortX1=this._sortX2=this._gridX,this._sortY1=this._sortY2=this._gridY,this._isSortNeeded=!0,void(void 0!==this._sortTimer&&(this._sortTimer=window.clearTimeout(this._sortTimer)));var t=this._checkHeuristics(this._gridX,this._gridY);if(this._isSortNeeded||t){var o=e.dragSortHeuristics.sortInterval;o<=0||this._isSortNeeded?(this._isSortNeeded=!1,void 0!==this._sortTimer&&(this._sortTimer=window.clearTimeout(this._sortTimer)),this._checkOverlap()):void 0===this._sortTimer&&(this._sortTimer=window.setTimeout(this._handleSortDelayed,o))}}},gt.prototype._handleSortDelayed=function(){this._isSortNeeded=!0,this._sortTimer=void 0,de(this._item._id,this._handleSort)},gt.prototype._cancelSort=function(){var e;this._isSortNeeded=!1,void 0!==this._sortTimer&&(this._sortTimer=window.clearTimeout(this._sortTimer)),e=this._item._id,ae.remove(1,Z+e)},gt.prototype._finishSort=function(){var e=this._getGrid()._settings.dragSort&&(this._isSortNeeded||void 0!==this._sortTimer);this._cancelSort(),e&&this._checkOverlap()},gt.prototype._checkOverlap=function(){if(this._isActive){var e,t,o,n,i,s,c,p,b=this._item,M=this._getGrid()._settings;(e=ue(M.dragSortPredicate)?M.dragSortPredicate(b,this._dragMoveEvent):gt.defaultSortPredicate(b,M.dragSortPredicate))&&"number"==typeof e.index&&(c=e.action===r?r:a,p=(t=b.getGrid())!==(n=e.grid||t),o=t._items.indexOf(b),i=Ge(n._items,e.index,p&&c===a?1:0),(p||i!==this._blockedSortIndex)&&(p?(this._blockedSortIndex=null,s=n._items[i],t._hasListeners(O)&&t._emit(O,{item:b,fromGrid:t,fromIndex:o,toGrid:n,toIndex:i}),n._hasListeners(f)&&n._emit(f,{item:b,fromGrid:t,fromIndex:o,toGrid:n,toIndex:i}),b._gridId=n._id,this._isMigrating=b._gridId!==this._gridId,t._items.splice(o,1),Fe(n._items,b,i),b._sortData=null,t._hasListeners(u)&&t._emit(u,{item:b,fromGrid:t,fromIndex:o,toGrid:n,toIndex:i}),n._hasListeners(A)&&n._emit(A,{item:b,fromGrid:t,fromIndex:o,toGrid:n,toIndex:i}),c===r&&s&&s.isActive()&&n._items.indexOf(s)>-1&&n.send(s,t,o,{appendTo:this._container||document.body,layoutSender:!1,layoutReceiver:!1}),t.layout(),n.layout()):o!==i&&(this._blockedSortIndex=o,(c===r?Ue:$e)(t._items,o,i),t._hasListeners(z)&&t._emit(z,{item:b,fromIndex:o,toIndex:i,action:c}),t.layout())))}},gt.prototype._finishMigration=function(){var e,t,o=this._item,n=o._dragRelease,i=o._element,r=o._isActive,a=o.getGrid(),s=a._element,c=a._settings,p=c.dragContainer||s,b=this._getGrid()._settings,M=i.parentNode,d=r?b.itemVisibleClass:b.itemHiddenClass,l=r?c.itemVisibleClass:c.itemHiddenClass;this._isMigrating=!1,this.destroy(),b.itemClass!==c.itemClass&&(At(i,b.itemClass),He(i,c.itemClass)),d!==l&&(At(i,d),He(i,l)),p!==M&&(p.appendChild(i),t=st(M,p,!0),(e=Ot(i)).x-=t.left,e.y-=t.top),o._refreshDimensions(),t=st(p,s,!0),n._containerDiffX=t.left,n._containerDiffY=t.top,o._drag=c.dragEnabled?new gt(o):null,p!==M&&o._setTranslate(e.x,e.y),o._visibility.setStyles(r?c.visibleStyles:c.hiddenStyles),n.start()},gt.prototype._preStartCheck=function(e){0===this._startPredicateState&&(this._startPredicateState=1),1===this._startPredicateState?(this._startPredicateResult=this._startPredicate(this._item,e),!0===this._startPredicateResult?(this._startPredicateState=2,this._onStart(e)):!1===this._startPredicateResult&&(this._resetStartPredicate(e),this._dragger._reset(),this._startPredicateState=0)):2===this._startPredicateState&&this._isActive&&this._onMove(e)},gt.prototype._preEndCheck=function(e){var t=2===this._startPredicateState;this._startPredicate(this._item,e),this._startPredicateState=0,t&&this._isActive&&(this._isStarted?this._onEnd(e):this.stop())},gt.prototype._onStart=function(e){var t,o,n,i=this._item;i._isActive&&(this._isActive=!0,this._dragStartEvent=e,gt.autoScroller.addItem(i),t=i._id,o=this._prepareStart,n=this._applyStart,ae.add(0,$+t,o),ae.add(2,U+t,n))},gt.prototype._prepareStart=function(){if(this._isActive){var e=this._item;if(e._isActive){var t=e._element,o=this._getGrid(),n=o._settings,i=o._element,r=n.dragContainer||i,a=ot(r),s=Ot(t),c=t.getBoundingClientRect(),p=r!==i;if(this._container=r,this._containingBlock=a,this._clientX=c.left,this._clientY=c.top,this._left=this._gridX=s.x,this._top=this._gridY=s.y,this._scrollDiffX=this._scrollDiffY=0,this._moveDiffX=this._moveDiffY=0,this._resetHeuristics(this._gridX,this._gridY),p){var b=st(a,i);this._containerDiffX=b.left,this._containerDiffY=b.top}}}},gt.prototype._applyStart=function(){if(this._isActive){var e=this._item;if(e._isActive){var t=this._getGrid(),o=e._element,n=e._dragRelease,i=e._migrate,r=this._container!==t._element;e.isPositioning()&&e._layout.stop(!0,this._left,this._top),i._isActive&&(this._left-=i._containerDiffX,this._top-=i._containerDiffY,this._gridX-=i._containerDiffX,this._gridY-=i._containerDiffY,i.stop(!0,this._left,this._top)),e.isReleasing()&&n._reset(),t._settings.dragPlaceholder.enabled&&e._dragPlaceholder.create(),this._isStarted=!0,t._emit("dragInit",e,this._dragStartEvent),r&&(o.parentNode===this._container?(this._gridX-=this._containerDiffX,this._gridY-=this._containerDiffY):(this._left+=this._containerDiffX,this._top+=this._containerDiffY,this._container.appendChild(o),e._setTranslate(this._left,this._top))),He(o,t._settings.itemDraggingClass),this._bindScrollListeners(),t._emit("dragStart",e,this._dragStartEvent)}}},gt.prototype._onMove=function(e){var t,o,n,i=this._item;i._isActive?(this._dragMoveEvent=e,t=i._id,o=this._prepareMove,n=this._applyMove,ae.add(0,V+t,o),ae.add(2,J+t,n),de(i._id,this._handleSort)):this.stop()},gt.prototype._prepareMove=function(){if(this._isActive&&this._item._isActive){var e=this._getGrid()._settings.dragAxis,t=this._dragMoveEvent,o=this._dragPrevMoveEvent||this._dragStartEvent||t;if("y"!==e){var n=t.clientX-o.clientX;this._left=this._left-this._moveDiffX+n,this._gridX=this._gridX-this._moveDiffX+n,this._clientX=this._clientX-this._moveDiffX+n,this._moveDiffX=n}if("x"!==e){var i=t.clientY-o.clientY;this._top=this._top-this._moveDiffY+i,this._gridY=this._gridY-this._moveDiffY+i,this._clientY=this._clientY-this._moveDiffY+i,this._moveDiffY=i}this._dragPrevMoveEvent=t}},gt.prototype._applyMove=function(){if(this._isActive){var e=this._item;e._isActive&&(this._moveDiffX=this._moveDiffY=0,e._setTranslate(this._left,this._top),this._getGrid()._emit("dragMove",e,this._dragMoveEvent),gt.autoScroller.updateItem(e))}},gt.prototype._onScroll=function(e){var t,o,n,i=this._item;i._isActive?(this._scrollEvent=e,t=i._id,o=this._prepareScroll,n=this._applyScroll,ae.add(0,K+t,o),ae.add(2,Q+t,n),de(i._id,this._handleSort)):this.stop()},gt.prototype._prepareScroll=function(){if(this._isActive){var e=this._item;if(e._isActive){var t=e._element,o=this._getGrid()._element,n=t.getBoundingClientRect();if(this._container!==o){var i=st(this._containingBlock,o);this._containerDiffX=i.left,this._containerDiffY=i.top}var r=this._clientX-this._moveDiffX-n.left;this._left=this._left-this._scrollDiffX+r,this._scrollDiffX=r;var a=this._clientY-this._moveDiffY-n.top;this._top=this._top-this._scrollDiffY+a,this._scrollDiffY=a,this._gridX=this._left-this._containerDiffX,this._gridY=this._top-this._containerDiffY}}},gt.prototype._applyScroll=function(){if(this._isActive){var e=this._item;e._isActive&&(this._scrollDiffX=this._scrollDiffY=0,e._setTranslate(this._left,this._top),this._getGrid()._emit("dragScroll",e,this._scrollEvent))}},gt.prototype._onEnd=function(e){var t=this._item,o=t._element,n=this._getGrid(),i=n._settings,r=t._dragRelease;t._isActive?(pe(t._id),be(t._id),Me(t._id),this._finishSort(),this._unbindScrollListeners(),r._containerDiffX=this._containerDiffX,r._containerDiffY=this._containerDiffY,this._reset(),At(o,i.itemDraggingClass),gt.autoScroller.removeItem(t),n._emit("dragEnd",t,e),this._isMigrating?this._finishMigration():r.start()):this.stop()};var vt=/^(webkit|moz|ms|o|Webkit|Moz|MS|O)(?=[A-Z])/,Lt={};function wt(e){var t=Lt[e];return t||((t=e.replace(vt,""))!==e&&(t=t[0].toLowerCase()+t.slice(1)),Lt[e]=t,t)}function Rt(e,t){for(var o in t)e.style[o]=t[o]}var kt,Tt,St=!(!Element||!ue(Element.prototype.animate)),Et=!!(Element&&(kt=Element.prototype.animate,Tt=window.Symbol,kt&&ue(Tt)&&ue(Tt.toString)&&Tt(kt).toString().indexOf("[native code]")>-1));function Nt(e){this._element=e,this._animation=null,this._duration=0,this._easing="",this._callback=null,this._props=[],this._values=[],this._isDestroyed=!1,this._onFinish=this._onFinish.bind(this)}function Bt(e,t){var o={};for(var n in e)o[t?n:wt(n)]=e[n];return o}function Ct(e,t){return"translateX("+e+"px) translateY("+t+"px)"}function Dt(e){this._item=e,this._animation=new Nt,this._element=null,this._className="",this._didMigrate=!1,this._resetAfterLayout=!1,this._left=0,this._top=0,this._transX=0,this._transY=0,this._nextTransX=0,this._nextTransY=0,this._setupAnimation=this._setupAnimation.bind(this),this._startAnimation=this._startAnimation.bind(this),this._updateDimensions=this._updateDimensions.bind(this),this._onLayoutStart=this._onLayoutStart.bind(this),this._onLayoutEnd=this._onLayoutEnd.bind(this),this._onReleaseEnd=this._onReleaseEnd.bind(this),this._onMigrate=this._onMigrate.bind(this),this._onHide=this._onHide.bind(this)}function xt(e){this._item=e,this._isActive=!1,this._isDestroyed=!1,this._isPositioningStarted=!1,this._containerDiffX=0,this._containerDiffY=0}function Xt(e){var t=e._element,o=t.style;this._item=e,this._isActive=!1,this._isDestroyed=!1,this._isInterrupted=!1,this._currentStyles={},this._targetStyles={},this._nextLeft=0,this._nextTop=0,this._offsetLeft=0,this._offsetTop=0,this._skipNextAnimation=!1,this._animOptions={onFinish:this._finish.bind(this),duration:0,easing:0},o.left="0px",o.top="0px",e._setTranslate(0,0),this._animation=new Nt(t),this._queue="layout-"+e._id,this._setupAnimation=this._setupAnimation.bind(this),this._startAnimation=this._startAnimation.bind(this)}function Yt(e){this._item=e,this._isActive=!1,this._isDestroyed=!1,this._container=!1,this._containerDiffX=0,this._containerDiffY=0}function Pt(e){var t=e._isActive,o=e._element,n=o.children[0],i=e.getGrid()._settings;if(!n)throw new Error("No valid child element found within item element.");this._item=e,this._isDestroyed=!1,this._isHidden=!t,this._isHiding=!1,this._isShowing=!1,this._childElement=n,this._currentStyleProps=[],this._animation=new Nt(n),this._queue="visibility-"+e._id,this._finishShow=this._finishShow.bind(this),this._finishHide=this._finishHide.bind(this),o.style.display=t?"":"none",He(o,t?i.itemVisibleClass:i.itemHiddenClass),this.setStyles(t?i.visibleStyles:i.hiddenStyles)}Nt.prototype.start=function(e,t,o){if(!this._isDestroyed){var n=this._element,i=o||{};if(!St)return Rt(n,t),this._callback=ue(i.onFinish)?i.onFinish:null,void this._onFinish();var r,a,s,c=this._animation,p=this._props,b=this._values,M=i.duration||300,d=i.easing||"ease",l=!1;if(c&&(a=0,M===this._duration&&d===this._easing||(l=!0),!l)){for(r in t)if(++a,-1===(s=p.indexOf(r))||t[r]!==b[s]){l=!0;break}a!==p.length&&(l=!0)}if(l&&c.cancel(),this._callback=ue(i.onFinish)?i.onFinish:null,!c||l){for(r in p.length=b.length=0,t)p.push(r),b.push(t[r]);this._duration=M,this._easing=d,this._animation=n.animate([Bt(e,Et),Bt(t,Et)],{duration:M,easing:d}),this._animation.onfinish=this._onFinish,Rt(n,t)}}},Nt.prototype.stop=function(){!this._isDestroyed&&this._animation&&(this._animation.cancel(),this._animation=this._callback=null,this._props.length=this._values.length=0)},Nt.prototype.getCurrentStyles=function(){return yt(element,currentProps)},Nt.prototype.isAnimating=function(){return!!this._animation},Nt.prototype.destroy=function(){this._isDestroyed||(this.stop(),this._element=null,this._isDestroyed=!0)},Nt.prototype._onFinish=function(){var e=this._callback;this._animation=this._callback=null,this._props.length=this._values.length=0,e&&e()},Dt.prototype._updateDimensions=function(){this.isActive()&&Rt(this._element,{width:this._item._width+"px",height:this._item._height+"px"})},Dt.prototype._onLayoutStart=function(e,t){var o=this._item;if(-1!==e.indexOf(o)){var n=o._left,i=o._top,r=this._left,a=this._top;if(this._left=n,this._top=i,t||this._didMigrate||r!==n||a!==i){var s,c,p,b=n+o._marginLeft,M=i+o._marginTop,d=o.getGrid();if(t||!(d._settings.layoutDuration>0)||this._didMigrate)return le(o._id),this._element.style[Ve]=Ct(b,M),this._animation.stop(),void(this._didMigrate&&(d.getElement().appendChild(this._element),this._didMigrate=!1));this._nextTransX=b,this._nextTransY=M,s=o._id,c=this._setupAnimation,p=this._startAnimation,ae.add(0,ee+s,c),ae.add(2,te+s,p)}}else this.reset()},Dt.prototype._setupAnimation=function(){if(this.isActive()){var e=Ot(this._element);this._transX=e.x,this._transY=e.y}},Dt.prototype._startAnimation=function(){if(this.isActive()){var e=this._animation,t=this._transX,o=this._transY,n=this._nextTransX,i=this._nextTransY;if(t!==n||o!==i){var r=this._item.getGrid()._settings,a={},s={};a[Ve]=Ct(t,o),s[Ve]=Ct(n,i),e.start(a,s,{duration:r.layoutDuration,easing:r.layoutEasing,onFinish:this._onLayoutEnd})}else e.isAnimating()&&(this._element.style[Ve]=Ct(n,i),e.stop())}},Dt.prototype._onLayoutEnd=function(){this._resetAfterLayout&&this.reset()},Dt.prototype._onReleaseEnd=function(e){if(e._id===this._item._id){if(!this._animation.isAnimating())return void this.reset();this._resetAfterLayout=!0}},Dt.prototype._onMigrate=function(e){if(e.item===this._item){var t=this._item.getGrid(),o=e.toGrid;t.off(h,this._onReleaseEnd),t.off(s,this._onLayoutStart),t.off(O,this._onMigrate),t.off(M,this._onHide),o.on(h,this._onReleaseEnd),o.on(s,this._onLayoutStart),o.on(O,this._onMigrate),o.on(M,this._onHide),this._didMigrate=!0}},Dt.prototype._onHide=function(e){e.indexOf(this._item)>-1&&this.reset()},Dt.prototype.create=function(){if(this.isActive())this._resetAfterLayout=!1;else{var e,t=this._item,o=t.getGrid(),n=o._settings,i=this._animation;this._left=t._left,this._top=t._top,e=ue(n.dragPlaceholder.createElement)?n.dragPlaceholder.createElement(t):document.createElement("div"),this._element=e,i._element=e,this._className=n.itemPlaceholderClass||"",this._className&&He(e,this._className),Rt(e,{position:"absolute",left:"0px",top:"0px",width:t._width+"px",height:t._height+"px"}),e.style[Ve]=Ct(t._left+t._marginLeft,t._top+t._marginTop),o.on(s,this._onLayoutStart),o.on(h,this._onReleaseEnd),o.on(O,this._onMigrate),o.on(M,this._onHide),ue(n.dragPlaceholder.onCreate)&&n.dragPlaceholder.onCreate(t,e),o.getElement().appendChild(e)}},Dt.prototype.reset=function(){if(this.isActive()){var e,t=this._element,o=this._item,n=o.getGrid(),i=n._settings,r=this._animation;this._resetAfterLayout=!1,le(o._id),e=o._id,ae.remove(2,oe+e),r.stop(),r._element=null,n.off(h,this._onReleaseEnd),n.off(s,this._onLayoutStart),n.off(O,this._onMigrate),n.off(M,this._onHide),this._className&&(At(t,this._className),this._className=""),t.parentNode.removeChild(t),this._element=null,ue(i.dragPlaceholder.onRemove)&&i.dragPlaceholder.onRemove(o,t)}},Dt.prototype.isActive=function(){return!!this._element},Dt.prototype.getElement=function(){return this._element},Dt.prototype.updateDimensions=function(){var e,t;this.isActive()&&(e=this._item._id,t=this._updateDimensions,ae.add(2,oe+e,t))},Dt.prototype.destroy=function(){this.reset(),this._animation.destroy(),this._item=this._animation=null},xt.prototype.start=function(){if(!this._isDestroyed&&!this._isActive){var e=this._item,t=e.getGrid(),o=t._settings;this._isActive=!0,He(e._element,o.itemReleasingClass),o.dragRelease.useDragContainer||this._placeToGrid(),t._emit("dragReleaseStart",e),t._nextLayoutData||e._layout.start(!1)}},xt.prototype.stop=function(e,t,o){if(!this._isDestroyed&&this._isActive){var n=this._item,i=n.getGrid();e||void 0!==t&&void 0!==o||(t=n._left,o=n._top);var r=this._placeToGrid(t,o);this._reset(r),e||i._emit(h,n)}},xt.prototype.isJustReleased=function(){return this._isActive&&!1===this._isPositioningStarted},xt.prototype.destroy=function(){this._isDestroyed||(this.stop(!0),this._item=null,this._isDestroyed=!0)},xt.prototype._placeToGrid=function(e,t){if(!this._isDestroyed){var o=this._item,n=o._element,i=o.getGrid()._element,r=!1;if(n.parentNode!==i){if(void 0===e||void 0===t){var a=Ot(n);e=a.x-this._containerDiffX,t=a.y-this._containerDiffY}i.appendChild(n),o._setTranslate(e,t),r=!0}return this._containerDiffX=0,this._containerDiffY=0,r}},xt.prototype._reset=function(e){if(!this._isDestroyed){var t=this._item,o=t.getGrid()._settings.itemReleasingClass;this._isActive=!1,this._isPositioningStarted=!1,this._containerDiffX=0,this._containerDiffY=0,o&&(e&&t._element.clientWidth,At(t._element,o))}},Xt.prototype.start=function(e,t){if(!this._isDestroyed){var o,n,i,r=this._item,a=r._dragRelease,s=r.getGrid()._settings,c=this._isActive,p=a.isJustReleased(),b=p?s.dragRelease.duration:s.layoutDuration,M=p?s.dragRelease.easing:s.layoutEasing,d=!e&&!this._skipNextAnimation&&b>0;if(c&&(se(r._id),r._emitter.burst(this._queue,!0,r)),p&&(a._isPositioningStarted=!0),ue(t)&&r._emitter.on(this._queue,t),this._skipNextAnimation=!1,!d)return this._updateOffsets(),r._setTranslate(this._nextLeft,this._nextTop),this._animation.stop(),void this._finish();this._animation.isAnimating()&&(this._animation._animation.onfinish=null),this._isActive=!0,this._animOptions.easing=M,this._animOptions.duration=b,this._isInterrupted=c,o=r._id,n=this._setupAnimation,i=this._startAnimation,ae.add(0,H+o,n),ae.add(2,j+o,i)}},Xt.prototype.stop=function(e,t,o){if(!this._isDestroyed&&this._isActive){var n=this._item;if(se(n._id),this._animation.isAnimating()){if(void 0===t||void 0===o){var i=Ot(n._element);t=i.x,o=i.y}n._setTranslate(t,o),this._animation.stop()}At(n._element,n.getGrid()._settings.itemPositioningClass),this._isActive=!1,e&&n._emitter.burst(this._queue,!0,n)}},Xt.prototype.destroy=function(){if(!this._isDestroyed){var e=this._item._element.style;this.stop(!0,0,0),this._item._emitter.clear(this._queue),this._animation.destroy(),e[Ve]="",e.left="",e.top="",this._item=null,this._currentStyles=null,this._targetStyles=null,this._animOptions=null,this._isDestroyed=!0}},Xt.prototype._updateOffsets=function(){if(!this._isDestroyed){var e=this._item,t=e._migrate,o=e._dragRelease;this._offsetLeft=o._isActive?o._containerDiffX:t._isActive?t._containerDiffX:0,this._offsetTop=o._isActive?o._containerDiffY:t._isActive?t._containerDiffY:0,this._nextLeft=this._item._left+this._offsetLeft,this._nextTop=this._item._top+this._offsetTop}},Xt.prototype._finish=function(){if(!this._isDestroyed){var e=this._item,t=e._migrate,o=e._dragRelease;e._tX=this._nextLeft,e._tY=this._nextTop,this._isActive&&(this._isActive=!1,At(e._element,e.getGrid()._settings.itemPositioningClass)),o._isActive&&o.stop(),t._isActive&&t.stop(),e._emitter.burst(this._queue,!1,e)}},Xt.prototype._setupAnimation=function(){var e=this._item;if(void 0===e._tX||void 0===e._tY){var t=Ot(e._element);e._tX=t.x,e._tY=t.y}},Xt.prototype._startAnimation=function(){var e=this._item,t=e.getGrid()._settings,o=this._animOptions.duration<=0;this._updateOffsets();var n=Math.abs(e._left-(e._tX-this._offsetLeft)),i=Math.abs(e._top-(e._tY-this._offsetTop));if(o||n<2&&i<2)return(n||i||this._isInterrupted)&&e._setTranslate(this._nextLeft,this._nextTop),this._animation.stop(),void this._finish();this._isInterrupted||He(e._element,t.itemPositioningClass),this._currentStyles[Ve]=Ct(e._tX,e._tY),this._targetStyles[Ve]=Ct(this._nextLeft,this._nextTop),e._tX=e._tY=void 0,this._animation.start(this._currentStyles,this._targetStyles,this._animOptions)},Yt.prototype.start=function(e,t,o){if(!this._isDestroyed){var n,i,r,a,s,c,p,b,M,d,l=this._item,z=l._element,h=l.isActive(),m=l.isVisible(),q=l.getGrid(),_=q._settings,W=e._settings,g=e._element,y=e._items,v=q._items.indexOf(l),L=o||document.body;if("number"==typeof t)n=Ge(y,t,1);else{if(!(i=e.getItem(t)))return;n=y.indexOf(i)}(l.isPositioning()||this._isActive||l.isReleasing())&&(p=(c=Ot(z)).x,b=c.y),l.isPositioning()&&l._layout.stop(!0,p,b),this._isActive&&(p-=this._containerDiffX,b-=this._containerDiffY,this.stop(!0,p,b)),l.isReleasing()&&(p-=l._dragRelease._containerDiffX,b-=l._dragRelease._containerDiffY,l._dragRelease.stop(!0,p,b)),l._visibility.stop(!0),l._drag&&l._drag.destroy(),q._hasListeners(O)&&q._emit(O,{item:l,fromGrid:q,fromIndex:v,toGrid:e,toIndex:n}),e._hasListeners(f)&&e._emit(f,{item:l,fromGrid:q,fromIndex:v,toGrid:e,toIndex:n}),_.itemClass!==W.itemClass&&(At(z,_.itemClass),He(z,W.itemClass)),(M=m?_.itemVisibleClass:_.itemHiddenClass)!==(d=m?W.itemVisibleClass:W.itemHiddenClass)&&(At(z,M),He(z,d)),q._items.splice(v,1),Fe(y,l,n),l._gridId=e._id,h?L!==(r=z.parentNode)&&(L.appendChild(z),a=st(L,r,!0),c||(p=(c=Ot(z)).x,b=c.y),l._setTranslate(p+a.left,b+a.top)):g.appendChild(z),l._visibility.setStyles(m?W.visibleStyles:W.hiddenStyles),h&&(s=st(L,g,!0)),l._refreshDimensions(),l._sortData=null,l._drag=W.dragEnabled?new gt(l):null,h?(this._isActive=!0,this._container=L,this._containerDiffX=s.left,this._containerDiffY=s.top):(this._isActive=!1,this._container=null,this._containerDiffX=0,this._containerDiffY=0),q._hasListeners(u)&&q._emit(u,{item:l,fromGrid:q,fromIndex:v,toGrid:e,toIndex:n}),e._hasListeners(A)&&e._emit(A,{item:l,fromGrid:q,fromIndex:v,toGrid:e,toIndex:n})}},Yt.prototype.stop=function(e,t,o){if(!this._isDestroyed&&this._isActive){var n,i=this._item,r=i._element,a=i.getGrid()._element;this._container!==a&&(void 0!==t&&void 0!==o||(e?(t=(n=Ot(r)).x-this._containerDiffX,o=n.y-this._containerDiffY):(t=i._left,o=i._top)),a.appendChild(r),i._setTranslate(t,o)),this._isActive=!1,this._container=null,this._containerDiffX=0,this._containerDiffY=0}},Yt.prototype.destroy=function(){this._isDestroyed||(this.stop(!0),this._item=null,this._isDestroyed=!0)},Pt.prototype.show=function(e,t){if(!this._isDestroyed){var o=this._item,n=o._element,i=ue(t)?t:null,r=o.getGrid()._settings;this._isShowing||this._isHidden?!this._isShowing||e?(this._isShowing||(o._emitter.burst(this._queue,!0,o),At(n,r.itemHiddenClass),He(n,r.itemVisibleClass),this._isHiding||(n.style.display="")),i&&o._emitter.on(this._queue,i),this._isShowing=!0,this._isHiding=this._isHidden=!1,this._startAnimation(!0,e,this._finishShow)):i&&o._emitter.on(this._queue,i):i&&i(!1,o)}},Pt.prototype.hide=function(e,t){if(!this._isDestroyed){var o=this._item,n=o._element,i=ue(t)?t:null,r=o.getGrid()._settings;this._isHiding||!this._isHidden?!this._isHiding||e?(this._isHiding||(o._emitter.burst(this._queue,!0,o),He(n,r.itemHiddenClass),At(n,r.itemVisibleClass)),i&&o._emitter.on(this._queue,i),this._isHidden=this._isHiding=!0,this._isShowing=!1,this._startAnimation(!1,e,this._finishHide)):i&&o._emitter.on(this._queue,i):i&&i(!1,o)}},Pt.prototype.stop=function(e){if(!this._isDestroyed&&(this._isHiding||this._isShowing)){var t=this._item;ce(t._id),this._animation.stop(),e&&t._emitter.burst(this._queue,!0,t)}},Pt.prototype.setStyles=function(e){var t=this._childElement,o=this._currentStyleProps;for(var n in this._removeCurrentStyles(),e)o.push(n),t.style[n]=e[n]},Pt.prototype.destroy=function(){if(!this._isDestroyed){var e=this._item,t=e._element,o=e.getGrid()._settings;this.stop(!0),e._emitter.clear(this._queue),this._animation.destroy(),this._removeCurrentStyles(),At(t,o.itemVisibleClass),At(t,o.itemHiddenClass),t.style.display="",this._isHiding=this._isShowing=!1,this._isDestroyed=this._isHidden=!0}},Pt.prototype._startAnimation=function(e,t,o){if(!this._isDestroyed){var n,i=this._item,r=this._animation,a=this._childElement,s=i.getGrid()._settings,c=e?s.visibleStyles:s.hiddenStyles,p=e?s.showDuration:s.hideDuration,b=e?s.showEasing:s.hideEasing,M=t||p<=0;if(c){if(ce(i._id),M)return Rt(a,c),r.stop(),void(o&&o());var d,l,z;r.isAnimating()&&(r._animation.onfinish=null),d=i._id,l=function(){n=yt(a,c)},z=function(){r.start(n,c,{duration:p,easing:b,onFinish:o})},ae.add(0,F+d,l),ae.add(2,G+d,z)}else o&&o()}},Pt.prototype._finishShow=function(){this._isHidden||(this._isShowing=!1,this._item._emitter.burst(this._queue,!1,this._item))},Pt.prototype._finishHide=function(){if(this._isHidden){var e=this._item;this._isHiding=!1,e._layout.stop(!0,0,0),e._element.style.display="none",e._emitter.burst(this._queue,!1,e)}},Pt.prototype._removeCurrentStyles=function(){for(var e=this._childElement,t=this._currentStyleProps,o=0;o<t.length;o++)e.style[t[o]]="";t.length=0};var It=0;function Ht(){return++It}function jt(e,t,o){var n=e._settings;if(i){if(i.has(t))throw new Error("You can only create one Muuri Item per element!");i.set(t,this)}this._id=Ht(),this._gridId=e._id,this._element=t,this._isDestroyed=!1,this._left=0,this._top=0,this._width=0,this._height=0,this._marginLeft=0,this._marginRight=0,this._marginTop=0,this._marginBottom=0,this._tX=void 0,this._tY=void 0,this._sortData=null,this._emitter=new W,t.parentNode!==e._element&&e._element.appendChild(t),He(t,n.itemClass),"boolean"!=typeof o&&(o="none"!==Ae(t,"display")),this._isActive=o,this._visibility=new Pt(this),this._layout=new Xt(this),this._migrate=new Yt(this),this._drag=n.dragEnabled?new gt(this):null,this._dragRelease=new xt(this),this._dragPlaceholder=new Dt(this)}function Ft(e){var t,o,n,i,r,a=.001,s=.5;function c(e){return((1e3*e+.5|0)/10|0)/100}function p(){this.currentRects=[],this.nextRects=[],this.rectTarget={},this.rectStore=[],this.slotSizes=[],this.rectId=0,this.slotIndex=-1,this.slotData={left:0,top:0,width:0,height:0},this.sortRectsLeftTop=this.sortRectsLeftTop.bind(this),this.sortRectsTopLeft=this.sortRectsTopLeft.bind(this)}if(p.prototype.computeLayout=function(e,t){var o,n,i,r,a,s,p=e.items,b=e.slots,M=!!(1&t),d=!!(2&t),l=!!(4&t),z=!!(8&t),u=!!(16&t),O="number"==typeof p[0];if(!p.length)return e;for(n=O?2:1,o=0;o<p.length;o+=n)O?(r=p[o],a=p[o+1]):(r=(i=p[o])._width+i._marginLeft+i._marginRight,a=i._height+i._marginTop+i._marginBottom),u&&(r=c(r),a=c(a)),s=this.computeNextSlot(e,r,a,M,d),d?s.left+s.width>e.width&&(e.width=s.left+s.width):s.top+s.height>e.height&&(e.height=s.top+s.height),b[++this.slotIndex]=s.left,b[++this.slotIndex]=s.top,(l||z)&&this.slotSizes.push(s.width,s.height);if(l)for(o=0;o<b.length;o+=2)b[o]=e.width-(b[o]+this.slotSizes[o]);if(z)for(o=1;o<b.length;o+=2)b[o]=e.height-(b[o]+this.slotSizes[o]);return this.slotSizes.length=0,this.currentRects.length=0,this.nextRects.length=0,this.rectStore.length=0,this.rectId=0,this.slotIndex=-1,e},p.prototype.computeNextSlot=function(e,t,o,n,i){var r,c,p,b,M,d=this.slotData,l=this.currentRects,z=this.nextRects,u=!1;for(z.length=0,d.left=null,d.top=null,d.width=t,d.height=o,b=0;b<l.length;b++)if((c=l[b])&&(r=this.getRect(c),d.width<=r.width+a&&d.height<=r.height+a)){d.left=r.left,d.top=r.top;break}if(null===d.left&&(i?(d.left=e.width,d.top=0):(d.left=0,d.top=e.height),n||(u=!0)),!i&&d.top+d.height>e.height+a&&(d.left>s&&z.push(this.addRect(0,e.height,d.left,1/0)),d.left+d.width<e.width-s&&z.push(this.addRect(d.left+d.width,e.height,e.width-d.left-d.width,1/0)),e.height=d.top+d.height),i&&d.left+d.width>e.width+a&&(d.top>s&&z.push(this.addRect(e.width,0,1/0,d.top)),d.top+d.height<e.height-s&&z.push(this.addRect(e.width,d.top+d.height,1/0,e.height-d.top-d.height)),e.width=d.left+d.width),!u)for(n&&(b=0);b<l.length;b++)if(c=l[b])for(r=this.getRect(c),p=this.splitRect(r,d),M=0;M<p.length;M++)c=p[M],r=this.getRect(c),(i?r.left+a<e.width-a:r.top+a<e.height-a)&&z.push(c);return z.length>1&&this.purgeRects(z).sort(i?this.sortRectsLeftTop:this.sortRectsTopLeft),this.currentRects=z,this.nextRects=l,d},p.prototype.addRect=function(e,t,o,n){var i=++this.rectId;return this.rectStore[i]=e||0,this.rectStore[++this.rectId]=t||0,this.rectStore[++this.rectId]=o||0,this.rectStore[++this.rectId]=n||0,i},p.prototype.getRect=function(e,t){return t||(t=this.rectTarget),t.left=this.rectStore[e]||0,t.top=this.rectStore[++e]||0,t.width=this.rectStore[++e]||0,t.height=this.rectStore[++e]||0,t},p.prototype.splitRect=(t=[],o=0,n=0,function(e,i){return t.length=0,e.left+e.width<=i.left+a||i.left+i.width<=e.left+a||e.top+e.height<=i.top+a||i.top+i.height<=e.top+a?(t.push(this.addRect(e.left,e.top,e.width,e.height)),t):((o=i.left-e.left)>=s&&t.push(this.addRect(e.left,e.top,o,e.height)),(o=e.left+e.width-(i.left+i.width))>=s&&t.push(this.addRect(i.left+i.width,e.top,o,e.height)),(n=i.top-e.top)>=s&&t.push(this.addRect(e.left,e.top,e.width,n)),(n=e.top+e.height-(i.top+i.height))>=s&&t.push(this.addRect(e.left,i.top+i.height,e.width,n)),t)}),p.prototype.isRectAWithinRectB=function(e,t){return e.left+a>=t.left&&e.top+a>=t.top&&e.left+e.width-a<=t.left+t.width&&e.top+e.height-a<=t.top+t.height},p.prototype.purgeRects=(i={},r={},function(e){for(var t,o=e.length;o--;)if(t=e.length,e[o])for(this.getRect(e[o],i);t--;)if(e[t]&&o!==t&&(this.getRect(e[t],r),this.isRectAWithinRectB(i,r))){e[o]=0;break}return e}),p.prototype.sortRectsTopLeft=function(){var e={},t={};return function(o,n){return this.getRect(o,e),this.getRect(n,t),e.top<t.top&&e.top+a<t.top?-1:e.top>t.top&&e.top-a>t.top?1:e.left<t.left&&e.left+a<t.left?-1:e.left>t.left&&e.left-a>t.left?1:0}}(),p.prototype.sortRectsLeftTop=function(){var e={},t={};return function(o,n){return this.getRect(o,e),this.getRect(n,t),e.left<t.left&&e.left+a<t.left?-1:e.left>t.left&&e.left-a<t.left?1:e.top<t.top&&e.top+a<t.top?-1:e.top>t.top&&e.top-a>t.top?1:0}}(),e){var b=new p;self.onmessage=function(e){var t=new Float32Array(e.data),o=t.subarray(4,t.length),n=new Float32Array(o.length),i=t[3],r={items:o,slots:n,width:t[1],height:t[2]};b.computeLayout(r,i),t[1]=r.width,t[2]=r.height,t.set(r.slots,4),postMessage(t.buffer,[t.buffer])}}return p}jt.prototype.getGrid=function(){return n[this._gridId]},jt.prototype.getElement=function(){return this._element},jt.prototype.getWidth=function(){return this._width},jt.prototype.getHeight=function(){return this._height},jt.prototype.getMargin=function(){return{left:this._marginLeft,right:this._marginRight,top:this._marginTop,bottom:this._marginBottom}},jt.prototype.getPosition=function(){return{left:this._left,top:this._top}},jt.prototype.isActive=function(){return this._isActive},jt.prototype.isVisible=function(){return!!this._visibility&&!this._visibility._isHidden},jt.prototype.isShowing=function(){return!(!this._visibility||!this._visibility._isShowing)},jt.prototype.isHiding=function(){return!(!this._visibility||!this._visibility._isHiding)},jt.prototype.isPositioning=function(){return!(!this._layout||!this._layout._isActive)},jt.prototype.isDragging=function(){return!(!this._drag||!this._drag._isActive)},jt.prototype.isReleasing=function(){return!(!this._dragRelease||!this._dragRelease._isActive)},jt.prototype.isDestroyed=function(){return this._isDestroyed},jt.prototype._refreshDimensions=function(e){if(!(this._isDestroyed||!0!==e&&this._visibility._isHidden)){var t=this._element,o=this._dragPlaceholder,n=t.getBoundingClientRect();this._width=n.width,this._height=n.height,this._marginLeft=Math.max(0,fe(t,"margin-left")),this._marginRight=Math.max(0,fe(t,"margin-right")),this._marginTop=Math.max(0,fe(t,"margin-top")),this._marginBottom=Math.max(0,fe(t,"margin-bottom")),o&&o.updateDimensions()}},jt.prototype._refreshSortData=function(){if(!this._isDestroyed){var e,t=this._sortData={},o=this.getGrid()._settings.sortData;for(e in o)t[e]=o[e](this,this._element)}},jt.prototype._addToLayout=function(e,t){!0!==this._isActive&&(this._isActive=!0,this._left=e||0,this._top=t||0)},jt.prototype._removeFromLayout=function(){!1!==this._isActive&&(this._isActive=!1,this._left=0,this._top=0)},jt.prototype._canSkipLayout=function(e,t){return this._left===e&&this._top===t&&!this._migrate._isActive&&!this._layout._skipNextAnimation&&!this._dragRelease.isJustReleased()},jt.prototype._setTranslate=function(e,t){return(this._tX!==e||this._tY!==t)&&(this._tX=e,this._tY=t,this._element.style[Ve]=Ct(e,t),!0)},jt.prototype._destroy=function(e){if(!this._isDestroyed){var t=this._element,o=this.getGrid()._settings;this._dragPlaceholder.destroy(),this._dragRelease.destroy(),this._migrate.destroy(),this._layout.destroy(),this._visibility.destroy(),this._drag&&this._drag.destroy(),this._emitter.destroy(),At(t,o.itemClass),e&&t.parentNode.removeChild(t),i&&i.delete(t),this._isActive=!1,this._isDestroyed=!0}};var Gt=Ft(),$t=null,Ut=[];function Vt(e,t){if(this._options=0,this._processor=null,this._layoutQueue=[],this._layouts={},this._layoutCallbacks={},this._layoutWorkers={},this._layoutWorkerData={},this._workers=[],this._onWorkerMessage=this._onWorkerMessage.bind(this),this.setOptions(t),(e="number"==typeof e?Math.max(0,e):0)&&window.Worker&&window.URL&&window.Blob)try{this._workers=function(e,t){var o=[];if(e>0){$t||($t=URL.createObjectURL(new Blob(["("+Ft.toString()+")(true)"],{type:"application/javascript"})));for(var n,i=0;i<e;i++)n=new Worker($t),t&&(n.onmessage=t),o.push(n),Ut.push(n)}return o}(e,this._onWorkerMessage)}catch(e){this._processor=new Gt}else this._processor=new Gt}Vt.prototype._sendToWorker=function(){if(this._layoutQueue.length&&this._workers.length){var e=this._layoutQueue.shift(),t=this._workers.pop(),o=this._layoutWorkerData[e];delete this._layoutWorkerData[e],this._layoutWorkers[e]=t,t.postMessage(o.buffer,[o.buffer])}},Vt.prototype._onWorkerMessage=function(e){var t=new Float32Array(e.data),o=t[0],n=this._layouts[o],i=this._layoutCallbacks[o],r=this._layoutWorkers[o];n&&delete this._layouts[o],i&&delete this._layoutCallbacks[o],r&&delete this._layoutWorkers[o],n&&i&&(n.width=t[1],n.height=t[2],n.slots=t.subarray(4,t.length),this._finalizeLayout(n),i(n)),r&&(this._workers.push(r),this._sendToWorker())},Vt.prototype._finalizeLayout=function(e){var t=e._grid,o=2&e._settings,n="border-box"===t._boxSizing;return delete e._grid,delete e._settings,e.styles={},o?e.styles.width=(n?e.width+t._borderLeft+t._borderRight:e.width)+"px":e.styles.height=(n?e.height+t._borderTop+t._borderBottom:e.height)+"px",e},Vt.prototype.setOptions=function(e){var t,o,n,i,r;e&&(t="boolean"==typeof e.fillGaps?e.fillGaps?1:0:1&this._options,o="boolean"==typeof e.horizontal?e.horizontal?2:0:2&this._options,n="boolean"==typeof e.alignRight?e.alignRight?4:0:4&this._options,i="boolean"==typeof e.alignBottom?e.alignBottom?8:0:8&this._options,r="boolean"==typeof e.rounding?e.rounding?16:0:16&this._options,this._options=t|o|n|i|r)},Vt.prototype.createLayout=function(e,t,o,n,i,r){if(this._layouts[t])throw new Error("A layout with the provided id is currently being processed.");var a=2&this._options,s={id:t,items:o,slots:null,width:a?0:n,height:a?i:0,_grid:e,_settings:this._options};if(!o.length)return s.slots=[],this._finalizeLayout(s),void r(s);if(this._processor)return s.slots=window.Float32Array?new Float32Array(2*o.length):new Array(2*o.length),this._processor.computeLayout(s,s._settings),this._finalizeLayout(s),void r(s);var c,p,b,M=new Float32Array(4+2*o.length);for(M[0]=t,M[1]=s.width,M[2]=s.height,M[3]=s._settings,c=0,p=3;c<o.length;c++)b=o[c],M[++p]=b._width+b._marginLeft+b._marginRight,M[++p]=b._height+b._marginTop+b._marginBottom;return this._layoutQueue.push(t),this._layouts[t]=s,this._layoutCallbacks[t]=r,this._layoutWorkerData[t]=M,this._sendToWorker(),this.cancelLayout.bind(this,t)},Vt.prototype.cancelLayout=function(e){if(this._layouts[e]&&(delete this._layouts[e],delete this._layoutCallbacks[e],this._layoutWorkerData[e])){delete this._layoutWorkerData[e];var t=this._layoutQueue.indexOf(e);t>-1&&this._layoutQueue.splice(t,1)}},Vt.prototype.destroy=function(){for(var e in this._layoutWorkers)this._workers.push(this._layoutWorkers[e]);!function(e){for(var t,o,n=0;n<e.length;n++)(t=e[n]).onmessage=null,t.onerror=null,t.onmessageerror=null,t.terminate(),(o=Ut.indexOf(t))>-1&&Ut.splice(o,1);$t&&!Ut.length&&(URL.revokeObjectURL($t),$t=null)}(this._workers),this._workers.length=0,this._layoutQueue.length=0,this._layouts={},this._layoutCallbacks={},this._layoutWorkers={},this._layoutWorkerData={}};var Jt=0;function Kt(e){var t=Object.prototype.toString.call(e);return"[object HTMLCollection]"===t||"[object NodeList]"===t}var Qt=Object.prototype.toString;function Zt(e){return"object"==typeof e&&"[object Object]"===Qt.call(e)}function eo(){}var to,oo="number",no="string",io="instant",ro=0;function ao(e,t){if(typeof e===no&&(e=document.querySelector(e)),!(e.getRootNode?e.getRootNode({composed:!0})===document:document.body.contains(e))||e===document.documentElement)throw new Error("Container element must be an existing DOM element.");var o,i,r=function(e,t){var o=so({},e);return t&&(o=so(o,t)),t&&t.visibleStyles?o.visibleStyles=t.visibleStyles:e&&e.visibleStyles&&(o.visibleStyles=e.visibleStyles),t&&t.hiddenStyles?o.hiddenStyles=t.hiddenStyles:e&&e.hiddenStyles&&(o.hiddenStyles=e.hiddenStyles),o}(ao.defaultOptions,t);r.visibleStyles=co(r.visibleStyles),r.hiddenStyles=co(r.hiddenStyles),ue(r.dragSort)||(r.dragSort=!!r.dragSort),this._id=Ht(),this._element=e,this._settings=r,this._isDestroyed=!1,this._items=[],this._layout={id:0,items:[],slots:[]},this._isLayoutFinished=!0,this._nextLayoutData=null,this._emitter=new W,this._onLayoutDataReceived=this._onLayoutDataReceived.bind(this),n[this._id]=this,He(e,r.containerClass),o=this,typeof(i=r.layoutOnResize)!==oo&&(i=!0===i?0:-1),i>=0&&(o._resizeHandler=function(e,t){var o=++Jt,n=0,i=0,r=!1,a=function(t){r||(i&&(n-=t-i),i=t,n>0?function(e,t){ae.add(0,re+e,t)}(o,a):(n=i=0,e()))};return function(s){if(!r){if(!(t<=0))return!0===s?(r=!0,n=i=0,a=void 0,void function(e){ae.remove(0,re+e)}(o)):void(n<=0?(n=t,a(0)):n=t);!0!==s&&e()}}}(function(){o.refreshItems().layout()},i),window.addEventListener("resize",o._resizeHandler)),this.add(function(e,t){if("*"===t)return e.children;if(typeof t===no){for(var o=[],n=e.children,i=0;i<n.length;i++)Ie(n[i],t)&&o.push(n[i]);return o}return Array.isArray(t)||Kt(t)?t:[]}(e,r.items),{layout:!1}),r.layoutOnInit&&this.layout(!0)}function so(e,t){var o,n,i,r=Object.keys(t),a=r.length;for(i=0;i<a;i++)o=Zt(t[n=r[i]]),Zt(e[n])&&o?e[n]=so(so({},e[n]),t[n]):o?e[n]=so({},t[n]):Array.isArray(t[n])?e[n]=t[n].slice(0):e[n]=t[n];return e}function co(e){var t,o,n={},i=document.documentElement.style;for(t in e)e[t]&&(o=w(i,t))&&(n[o]=e[t]);return n}function po(e){for(var t={},o=0;o<e.length;o++)t[e[o]._id]=o;return t}function bo(e,t,o){return e[t._id]-e[o._id]}ao.Item=jt,ao.ItemLayout=Xt,ao.ItemVisibility=Pt,ao.ItemMigrate=Yt,ao.ItemDrag=gt,ao.ItemDragRelease=xt,ao.ItemDragPlaceholder=Dt,ao.Emitter=W,ao.Animator=Nt,ao.Dragger=x,ao.Packer=Vt,ao.AutoScroller=Xe,ao.defaultPacker=new Vt(2),ao.defaultOptions={items:"*",showDuration:300,showEasing:"ease",hideDuration:300,hideEasing:"ease",visibleStyles:{opacity:"1",transform:"scale(1)"},hiddenStyles:{opacity:"0",transform:"scale(0.5)"},layout:{fillGaps:!1,horizontal:!1,alignRight:!1,alignBottom:!1,rounding:!1},layoutOnResize:150,layoutOnInit:!0,layoutDuration:300,layoutEasing:"ease",sortData:null,dragEnabled:!1,dragContainer:null,dragHandle:null,dragStartPredicate:{distance:0,delay:0},dragAxis:"xy",dragSort:!0,dragSortHeuristics:{sortInterval:100,minDragDistance:10,minBounceBackAngle:1},dragSortPredicate:{threshold:50,action:a,migrateAction:a},dragRelease:{duration:300,easing:"ease",useDragContainer:!0},dragCssProps:{touchAction:"none",userSelect:"none",userDrag:"none",tapHighlightColor:"rgba(0, 0, 0, 0)",touchCallout:"none",contentZooming:"none"},dragPlaceholder:{enabled:!1,createElement:null,onCreate:null,onRemove:null},dragAutoScroll:{targets:[],handle:null,threshold:50,safeZone:.2,speed:Xe.smoothSpeed(1e3,2e3,2500),sortDuringScroll:!0,smoothStop:!1,onStart:null,onStop:null},containerClass:"muuri",itemClass:"muuri-item",itemVisibleClass:"muuri-item-shown",itemHiddenClass:"muuri-item-hidden",itemPositioningClass:"muuri-item-positioning",itemDraggingClass:"muuri-item-dragging",itemReleasingClass:"muuri-item-releasing",itemPlaceholderClass:"muuri-item-placeholder"},ao.prototype.on=function(e,t){return this._emitter.on(e,t),this},ao.prototype.off=function(e,t){return this._emitter.off(e,t),this},ao.prototype.getElement=function(){return this._element},ao.prototype.getItem=function(e){if(this._isDestroyed||!e&&0!==e)return null;if(typeof e===oo)return this._items[e>-1?e:this._items.length+e]||null;if(e instanceof jt)return e._gridId===this._id?e:null;if(i){var t=i.get(e);return t&&t._gridId===this._id?t:null}for(var o=0;o<this._items.length;o++)if(this._items[o]._element===e)return this._items[o];return null},ao.prototype.getItems=function(e){if(this._isDestroyed||void 0===e)return this._items.slice(0);var t,o,n=[];if(Array.isArray(e)||Kt(e))for(t=0;t<e.length;t++)(o=this.getItem(e[t]))&&n.push(o);else(o=this.getItem(e))&&n.push(o);return n},ao.prototype.refreshItems=function(e,t){if(this._isDestroyed)return this;var o,n,i,r,a=e||this._items;if(!0===t)for(r=[],o=0;o<a.length;o++)(n=a[o]).isVisible()||n.isHiding()||((i=n.getElement().style).visibility="hidden",i.display="",r.push(i));for(o=0;o<a.length;o++)a[o]._refreshDimensions(t);if(!0===t){for(o=0;o<r.length;o++)(i=r[o]).visibility="",i.display="none";r.length=0}return this},ao.prototype.refreshSortData=function(e){if(this._isDestroyed)return this;for(var t=e||this._items,o=0;o<t.length;o++)t[o]._refreshSortData();return this},ao.prototype.synchronize=function(){if(this._isDestroyed)return this;var e,t,o=this._items;if(!o.length)return this;for(var n=0;n<o.length;n++)(t=o[n]._element).parentNode===this._element&&(e=e||document.createDocumentFragment()).appendChild(t);return e?(this._element.appendChild(e),this._emit("synchronize"),this):this},ao.prototype.layout=function(e,t){if(this._isDestroyed)return this;var o=this._nextLayoutData;o&&ue(o.cancel)&&o.cancel();var n=ro=ro%16777216+1;this._nextLayoutData={id:n,instant:e,onFinish:t,cancel:null};for(var i=this._items,r=[],a=0;a<i.length;a++)i[a]._isActive&&r.push(i[a]);this._refreshDimensions();var s,c=this._width-this._borderLeft-this._borderRight,p=this._height-this._borderTop-this._borderBottom,b=this._settings.layout;return ue(b)?s=b(this,n,r,c,p,this._onLayoutDataReceived):(ao.defaultPacker.setOptions(b),s=ao.defaultPacker.createLayout(this,n,r,c,p,this._onLayoutDataReceived)),ue(s)&&this._nextLayoutData&&this._nextLayoutData.id===n&&(this._nextLayoutData.cancel=s),this},ao.prototype.add=function(e,t){if(this._isDestroyed||!e)return[];var o,n=Kt(o=e)?Array.prototype.slice.call(o):Array.prototype.concat(o);if(!n.length)return n;var i,r,a,s,c=t||{},p=c.layout?c.layout:void 0===c.layout,b=this._items,M=!1;for(s=0;s<n.length;s++)(r=n[s]).parentNode!==this._element&&(i=i||document.createDocumentFragment()).appendChild(r);for(i&&this._element.appendChild(i),s=0;s<n.length;s++)r=n[s],(a=n[s]=new jt(this,r,c.active))._isActive&&(M=!0,a._layout._skipNextAnimation=!0);for(s=0;s<n.length;s++)(a=n[s])._refreshDimensions(),a._refreshSortData();return Fe(b,n,c.index),this._hasListeners("add")&&this._emit("add",n.slice(0)),M&&p&&this.layout(p===io,ue(p)?p:void 0),n},ao.prototype.remove=function(e,t){if(this._isDestroyed||!e.length)return[];var o,n,i,r=t||{},a=r.layout?r.layout:void 0===r.layout,s=!1,c=this.getItems(),p=[],M=[];for(i=0;i<e.length;i++)(n=e[i])._isDestroyed||-1!==(o=this._items.indexOf(n))&&(n._isActive&&(s=!0),p.push(n),M.push(c.indexOf(n)),n._destroy(r.removeElements),this._items.splice(o,1));return this._hasListeners(b)&&this._emit(b,p.slice(0),M),s&&a&&this.layout(a===io,ue(a)?a:void 0),p},ao.prototype.show=function(e,t){return!this._isDestroyed&&e.length&&this._setItemsVisibility(e,!0,t),this},ao.prototype.hide=function(e,t){return!this._isDestroyed&&e.length&&this._setItemsVisibility(e,!1,t),this},ao.prototype.filter=function(e,t){if(this._isDestroyed||!this._items.length)return this;var o,n,i=[],r=[],a=typeof e===no,s=ue(e),c=t||{},p=!0===c.instant,b=c.syncWithLayout,M=c.layout?c.layout:void 0===c.layout,l=ue(c.onFinish)?c.onFinish:null,z=-1,u=eo;if(l&&(u=function(){++z&&l(i.slice(0),r.slice(0))}),s||a)for(n=0;n<this._items.length;n++)o=this._items[n],(s?e(o):Ie(o._element,e))?i.push(o):r.push(o);return i.length?this.show(i,{instant:p,syncWithLayout:b,onFinish:u,layout:!1}):u(),r.length?this.hide(r,{instant:p,syncWithLayout:b,onFinish:u,layout:!1}):u(),(i.length||r.length)&&(this._hasListeners(d)&&this._emit(d,i.slice(0),r.slice(0)),M&&this.layout(M===io,ue(M)?M:void 0)),this},ao.prototype.sort=function(){var e,t,o,n;function i(i,r){for(var a,s,c,p,b=0,M=0;M<e.length;M++)if(a=e[M][0],s=e[M][1],c=(i._sortData?i:i._refreshSortData())._sortData[a],p=(r._sortData?r:r._refreshSortData())._sortData[a],b="desc"===s||!s&&t?p<c?-1:p>c?1:0:c<p?-1:c>p?1:0)return b;return b||(n||(n=po(o)),b=t?bo(n,r,i):bo(n,i,r)),b}function r(i,r){var a=t?-e(i,r):e(i,r);return a||(n||(n=po(o)),a=t?bo(n,r,i):bo(n,i,r)),a}return function(a,s){if(this._isDestroyed||this._items.length<2)return this;var c=this._items,p=s||{},b=p.layout?p.layout:void 0===p.layout;if(t=!!p.descending,o=c.slice(0),n=null,ue(a))e=a,c.sort(r);else if(typeof a===no)e=a.trim().split(" ").filter(function(e){return e}).map(function(e){return e.split(":")}),c.sort(i);else{if(!Array.isArray(a))throw e=t=o=n=null,new Error("Invalid comparer argument provided.");c.length=0,c.push.apply(c,a)}return this._hasListeners(l)&&this._emit(l,c.slice(0),o),b&&this.layout(b===io,ue(b)?b:void 0),e=t=o=n=null,this}}(),ao.prototype.move=function(e,t,o){if(this._isDestroyed||this._items.length<2)return this;var n,i,s=this._items,c=o||{},p=c.layout?c.layout:void 0===c.layout,b=c.action===r,M=b?r:a,d=this.getItem(e),l=this.getItem(t);return d&&l&&d!==l&&(n=s.indexOf(d),i=s.indexOf(l),b?Ue(s,n,i):$e(s,n,i),this._hasListeners(z)&&this._emit(z,{item:d,fromIndex:n,toIndex:i,action:M}),p&&this.layout(p===io,ue(p)?p:void 0)),this},ao.prototype.send=function(e,t,o,n){if(this._isDestroyed||t._isDestroyed||this===t)return this;if(!(e=this.getItem(e)))return this;var i=n||{},r=i.appendTo||document.body,a=i.layoutSender?i.layoutSender:void 0===i.layoutSender,s=i.layoutReceiver?i.layoutReceiver:void 0===i.layoutReceiver;return e._migrate.start(t,o,r),e._migrate._isActive&&e._isActive&&(a&&this.layout(a===io,ue(a)?a:void 0),s&&t.layout(s===io,ue(s)?s:void 0)),this},ao.prototype.destroy=function(e){if(this._isDestroyed)return this;var t,o,i,r=this._element,a=this._items.slice(0),s=this._layout&&this._layout.styles||{};for((i=this)._resizeHandler&&(i._resizeHandler(!0),window.removeEventListener("resize",i._resizeHandler),i._resizeHandler=null),t=0;t<a.length;t++)a[t]._destroy(e);for(o in this._items.length=0,At(r,this._settings.containerClass),s)r.style[o]="";return this._emit("destroy"),this._emitter.destroy(),delete n[this._id],this._isDestroyed=!0,this},ao.prototype._emit=function(){this._isDestroyed||this._emitter.emit.apply(this._emitter,arguments)},ao.prototype._hasListeners=function(e){return!this._isDestroyed&&this._emitter.countListeners(e)>0},ao.prototype._updateBoundingRect=function(){var e=this._element.getBoundingClientRect();this._width=e.width,this._height=e.height,this._left=e.left,this._top=e.top,this._right=e.right,this._bottom=e.bottom},ao.prototype._updateBorders=function(e,t,o,n){var i=this._element;e&&(this._borderLeft=fe(i,"border-left-width")),t&&(this._borderRight=fe(i,"border-right-width")),o&&(this._borderTop=fe(i,"border-top-width")),n&&(this._borderBottom=fe(i,"border-bottom-width"))},ao.prototype._refreshDimensions=function(){this._updateBoundingRect(),this._updateBorders(1,1,1,1),this._boxSizing=Ae(this._element,"box-sizing")},ao.prototype._onLayoutDataReceived=(to=[],function(e){if(!this._isDestroyed&&this._nextLayoutData&&this._nextLayoutData.id===e.id){var t,o,n,i,r=this,a=this._nextLayoutData.instant,b=this._nextLayoutData.onFinish,M=e.items.length,d=M;for(this._nextLayoutData=null,!this._isLayoutFinished&&this._hasListeners(p)&&this._emit(p,this._layout.items.slice(0)),this._layout=e,to.length=0,i=0;i<M;i++)(t=e.items[i])?(o=e.slots[2*i],n=e.slots[2*i+1],t._canSkipLayout(o,n)?--d:(t._left=o,t._top=n,t.isActive()&&!t.isDragging()?to.push(t):--d)):--d;if(e.styles&&Rt(this._element,e.styles),!this._hasListeners(s)||(this._emit(s,e.items.slice(0),!0===a),this._layout.id===e.id)){var l=function(){if(!(--d>0)){var t=r._layout.id!==e.id,o=ue(a)?a:b;t||(r._isLayoutFinished=!0),ue(o)&&o(e.items.slice(0),t),!t&&r._hasListeners(c)&&r._emit(c,e.items.slice(0))}};if(!to.length)return l(),this;for(this._isLayoutFinished=!1,i=0;i<to.length&&this._layout.id===e.id;i++)to[i]._layout.start(!0===a,l);return this._layout.id===e.id&&(to.length=0),this}}}),ao.prototype._setItemsVisibility=function(e,t,o){var n,i,r=this,a=e.slice(0),c=o||{},p=!0===c.instant,b=c.onFinish,d=c.layout?c.layout:void 0===c.layout,l=a.length,z=t?"showStart":M,u=t?"showEnd":"hideEnd",O=t?"show":"hide",A=!1,f=[],h=[];if(l){for(i=0;i<a.length;i++)n=a[i],(t&&!n._isActive||!t&&n._isActive)&&(A=!0),n._layout._skipNextAnimation=!(!t||n._isActive),t&&n._visibility._isHidden&&h.push(n),t?n._addToLayout():n._removeFromLayout();h.length&&(this.refreshItems(h,!0),h.length=0),A&&!1!==c.syncWithLayout?this.on(s,m):m(),A&&d&&this.layout(d===io,ue(d)?d:void 0)}else ue(b)&&b(a);function m(){for(A&&!1!==c.syncWithLayout&&r.off(s,m),r._hasListeners(z)&&r._emit(z,a.slice(0)),i=0;i<a.length;i++)a[i]._gridId===r._id?a[i]._visibility[O](p,function(e,t){e||f.push(t),--l<1&&(ue(b)&&b(f.slice(0)),r._hasListeners(u)&&r._emit(u,f.slice(0)))}):--l<1&&(ue(b)&&b(f.slice(0)),r._hasListeners(u)&&r._emit(u,f.slice(0)))}};const Mo=ao;var lo=o(88903),zo=o(38745),uo=o(56155);const Oo=[];let Ao,fo;const ho=()=>{let e=document.querySelector(".SearchResult-dragContainer");return e||(e=(0,zo.A)("div",{className:"SearchResult-dragContainer"}),document.body.appendChild(e)),e},mo=()=>{const e=fo.querySelector(":scope .SearchResult-board"),t=()=>{if(e){const n=e.lastChild;if(n instanceof Element){const i=n.classList.contains("frame")?e.querySelector(".SearchResult-board-column:nth-last-child(-n+2)"):e.lastChild;i instanceof Element&&o.observe(i),Ao.off("layoutEnd",t);const r=e.closest(".Popup");r instanceof HTMLDivElement&&document.body.style.setProperty("--BoardContainer-zIndex",(parseInt(r.style.zIndex)+1).toString())}}},o=new IntersectionObserver(e=>{for(const t of e){const{isIntersecting:e,target:n}=t;if(e&&!n.classList.contains("frame")){o.unobserve(n);const e=fo.querySelector(":scope button.moreColumns-button");e&&e.click()}}},{root:fo,rootMargin:"25px",threshold:.75});Ao.on("layoutEnd",t)},qo=(e,t)=>{const o=t.parentNode;if(o instanceof HTMLDivElement){const n=new IntersectionObserver(e=>{for(const t of e){const{isIntersecting:e,target:i}=t;if(e){n.unobserve(i);const e=o?.querySelector(":scope button.moreCards-button");e&&e.click()}}},{root:o,rootMargin:"25px",threshold:.75}),i=()=>{const o=t.lastChild;o instanceof Element&&(n.observe(o),e.off("layoutEnd",i))};e.on("layoutEnd",i)}};let _o,Wo,go;(0,uo.A)(".is-muuri .SearchResult-boardContainer",e=>{fo=e;const t=e.querySelector(":scope div.SearchResult-board");if(!t)return;Ao=new Mo(t,{items:".SearchResult-board-column",layoutDuration:300,layoutEasing:"cubic-bezier(0.625, 0.225, 0.100, 0.890)",layout:(e,t,o,n,i,r)=>(Mo.defaultPacker.setOptions({horizontal:!0}),Mo.defaultPacker.createLayout(e,t,o,n,i,e=>{delete e.styles,r(e)})),dragEnabled:!1,dragAxis:"x",dragSortHeuristics:{sortInterval:0},dragHandle:".BoardView-title",dragRelease:{duration:300,easing:"cubic-bezier(0.625, 0.225, 0.100, 0.890)",useDragContainer:!1},dragAutoScroll:{targets:[{element:fo,axis:Mo.AutoScroller.AXIS_X}]}});const o=fo.querySelector(".SearchResult-board-errors");(0,uo.A)(".SearchResult-board-errors-close",e=>{e.onclick=()=>{o&&(o.innerHTML="")}}),mo()}),(0,uo.A)(".SearchResult-items .SearchResult-boardContainer",e=>{const t=e.closest(".SearchResult-items");t?.classList.add("is-muuri")}),(0,uo.A)("ol.BoardView-list",e=>{const t=e.closest(".SearchResult-board"),o=!!t?.hasAttribute("data-dragEnabled"),n=new Mo(e,{items:".BoardView-card",showDuration:300,showEasing:"ease",hideDuration:300,hideEasing:"ease",layoutDuration:300,layoutEasing:"cubic-bezier(0.625, 0.225, 0.100, 0.890)",dragEnabled:o,dragSort:()=>Oo.filter(e=>t?.contains(e.getElement())),dragContainer:ho(),dragRelease:{duration:300,easing:"cubic-bezier(0.625, 0.225, 0.100, 0.890)",useDragContainer:!0},dragStartPredicate:(e,t)=>{const o=t.target,n=e.getElement();return!("A"===o.tagName||o.className.includes("ContentSummary-info")||n&&n.hasAttribute("data-archived"))},dragPlaceholder:{enabled:!0,createElement:e=>{const t=e.getElement();return t?.cloneNode(!0)}},dragAutoScroll:{targets:e=>[window,{element:fo,priority:1,axis:Mo.AutoScroller.AXIS_X},{element:e.getGrid()?.getElement().parentNode,priority:1,axis:Mo.AutoScroller.AXIS_Y}],sortDuringScroll:!1}});let i;new MutationObserver(e=>{for(const t of e){const e=t.target;if("childList"===t.type&&e instanceof HTMLElement){new ResizeObserver((t,o)=>{n.refreshItems().layout(),o.unobserve(e)}).observe(e)}}}).observe(e,{childList:!0,subtree:!0}),n.on("dragReleaseEnd",e=>{if(i===e){const t=e.getElement();t instanceof HTMLElement&&t.classList.add("is-saving"),r(e);let o=null,i=null;if(_o){const e=_o.getElement().closest(".SearchResult-board-column");o=e?.querySelector(".BoardView-title")}if(n){const e=n.getElement().closest(".SearchResult-board-column");i=e?.querySelector(".BoardView-title")}if(o instanceof HTMLElement){const e=o.dataset.count;e&&(o.dataset.count=(parseInt(e)-1).toString())}if(i instanceof HTMLElement){const e=i.dataset.count;e&&(i.dataset.count=(parseInt(e)+1).toString())}}i=null,Wo=0}),n.on("dragStart",e=>{const t=e.getGrid();if(t instanceof Mo){_o=t,Wo=n.getItems().indexOf(e);const o=n.getElement();if(o){const e=o.closest(".SearchResult-board-column"),t=e?.getAttribute("data-boardFieldValue");t&&(go=t)}const i=e.getElement();i&&(i.style.width=e.getWidth()+"px",i.style.height=e.getHeight()+"px")}}),n.on("dragMove",e=>{n===_o&&null!==Wo&&n.move(e,Wo,{layout:"instant"})}),n.on("layoutStart",()=>{Ao&&Ao.refreshItems().layout()}),n.on("receive",e=>{i=e.item});const r=async e=>{const t=e.getElement(),o=t?.getAttribute("data-objectId"),i=document.querySelector('li[data-objectId="'+o+'"]');let r,a,s;if(i){const e=i.closest(".SearchResult-board");e&&(r=e.getAttribute("data-boardField"),s=e.getAttribute("data-search"))}if(t){const e=t.closest(".SearchResult-board-column");a=e?.getAttribute("data-boardFieldValue")}const c=new Headers,p=lo.A.get("bsp.csrf");p&&c.append("Brightspot-CSRF",p);const b=new FormData;o&&b.append("objectId",o),r&&b.append("boardField",r),a&&b.append("boardFieldValue",a),s&&b.append("search",s),b.append("previousBoardFieldValue",go);const M=await fetch(window.CONTEXT_PATH+"board/fieldUpdate",{method:"post",credentials:"include",headers:c,body:b}),d=await M.text();if(M.ok){const t=n.getItems().indexOf(e);n.remove([e],{removeElements:!0});const o=document.createElement("template");o.innerHTML=d;const i=o.content.firstChild;i instanceof HTMLElement&&n.add(i,{index:t})}else if(d){n.send(e,_o,Wo);const t=document.querySelector(".SearchResult-board-errors");t&&(t.innerHTML=d)}};qo(n,e),Oo.push(n)}),window.addEventListener("brightspot-frame-load",e=>{const t=e.target;if(t instanceof HTMLElement)if(t.classList.contains("BoardResults")){const e=[...t.querySelectorAll("li.BoardView-card")],o=t.closest(".BoardView-listContainer"),n=o?.querySelector("ol.BoardView-list");Oo.forEach(t=>{t instanceof Object&&t.getElement()===n&&(qo(t,n),t.add(e))})}else t.classList.contains("BoardResults-Horiz")&&(mo(),Ao.add([...t.querySelectorAll("div.SearchResult-board-column")]))})},94473(e,t,o){"use strict";(0,o(56155).A)(".Page .Page-broadcastAlert",e=>{const t=e.querySelector(".pagination");if(!t)return;const o=t.querySelector(".pagination-count");if(!o)return;const n=e.querySelectorAll(".Page-broadcastAlert-messages > *");if(!n)return;const i=t.querySelector(".previous");if(!i)return;const r=i.querySelector(":scope > a");if(!r)return;const a=t.querySelector(".next");if(!a)return;const s=a.querySelector(":scope > a");if(!s)return;const c=n.length;for(let e=1;e<c;e++)n[e].hidden=!0;let p=0;const b=()=>{o.textContent=`${p+1} / ${c}`};b();const M=e=>{n[p].hidden=!0,p+=e?1:-1,n[p].hidden=!1,b();const t=0===p;i.classList.toggle("is-disabled",t),r.tabIndex=t?-1:0;const o=p===c-1;a.classList.toggle("is-disabled",o),s.tabIndex=o?-1:0};i.addEventListener("click",e=>{e.preventDefault(),p>0&&M(!1)}),a.addEventListener("click",e=>{e.preventDefault(),p<c-1&&M(!0)})})},34409(e,t,o){"use strict";var n=o(56155),i=o(38745),r=o(88903),a=o(99022),s=o(30473);(0,n.A)(".BulkWorkflow-button",e=>{let t=null;e.addEventListener("keydown",t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e.click())}),e.addEventListener("click",async o=>{o.preventDefault(),o.stopPropagation();const n=o.target;let c;if(n instanceof HTMLElement&&(c=n.getAttribute("action-url")),!c)return;if(!t){const e=new Headers,o=r.A.get("bsp.csrf");o&&e.append("Brightspot-CSRF",o);const n=await fetch(c,{headers:e}),a=await n.text();t=(0,i.A)("div",{className:"BulkWorkflow",innerHTML:a,role:"dialog","aria-modal":"true"}),document.body.appendChild(t),t.addEventListener("keydown",e=>{if("Escape"===e.key){e.stopPropagation();const o=t?.querySelector(".closeButton");o&&o.click()}})}e.closest(".Popup")&&(t.style.zIndex=(0,s.default)().toString()),a.A.toggle(e,t,()=>{const o=e.classList.toggle("is-open");return t?.classList.toggle("is-open"),o&&requestAnimationFrame(()=>{const e=t?.querySelector(".closeButton");e&&e.focus()}),o});const p=t.querySelector(".closeButton");p?.addEventListener("click",()=>{const o=a.A.toggles.get(e);o&&o.closeListener&&window.removeEventListener("click",o.closeListener,!0),e.classList.remove("is-open"),t?.classList.remove("is-open"),t?.remove(),t=null;const n=e.closest(".SearchResult")?.querySelector(".SearchResult-actions-toggle");n&&n.focus()})})})},70660(e,t,o){"use strict";o.d(t,{A:()=>q}),o(44764),o(84978),o(13722),o(25809),o(91672);var n=o(29171),i=o(17319),r=o(76904),a=o(80133),s=o(31400);function c(){c=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach(function(o){t.forEach(function(t){t.kind===o&&"own"===t.placement&&this.defineClassElement(e,t)},this)},this)},initializeClassElements:function(e,t){var o=e.prototype;["method","field"].forEach(function(n){t.forEach(function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var r="static"===i?e:o;this.defineClassElement(r,t)}},this)},this)},defineClassElement:function(e,t){var o=t.descriptor;if("field"===t.kind){var n=t.initializer;o={enumerable:o.enumerable,writable:o.writable,configurable:o.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,o)},decorateClass:function(e,t){var o=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach(function(e){this.addElementPlacement(e,i)},this),e.forEach(function(e){if(!M(e))return o.push(e);var t=this.decorateElement(e,i);o.push(t.element),o.push.apply(o,t.extras),n.push.apply(n,t.finishers)},this),!t)return{elements:o,finishers:n};var r=this.decorateConstructor(o,t);return n.push.apply(n,r.finishers),r.finishers=n,r},addElementPlacement:function(e,t,o){var n=t[e.placement];if(!o&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var o=[],n=[],i=e.decorators,r=i.length-1;r>=0;r--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[r])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var p=c.extras;if(p){for(var b=0;b<p.length;b++)this.addElementPlacement(p[b],t);o.push.apply(o,p)}}return{element:e,finishers:n,extras:o}},decorateConstructor:function(e,t){for(var o=[],n=t.length-1;n>=0;n--){var i=this.fromClassDescriptor(e),r=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==r.finisher&&o.push(r.finisher),void 0!==r.elements){e=r.elements;for(var a=0;a<e.length-1;a++)for(var s=a+1;s<e.length;s++)if(e[a].key===e[s].key&&e[a].placement===e[s].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers:o}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var o={}.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?u(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map(function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t},this);var t},toElementDescriptor:function(e){var t=e.kind+"";if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var o=z(e.key),n=e.placement+"";if("static"!==n&&"prototype"!==n&&"own"!==n)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+n+'"');var i=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var r={kind:t,key:o,placement:n,descriptor:Object.assign({},i)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(i,"get","The property descriptor of a field descriptor"),this.disallowProperty(i,"set","The property descriptor of a field descriptor"),this.disallowProperty(i,"value","The property descriptor of a field descriptor"),r.initializer=e.initializer),r},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:l(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=e.kind+"";if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var o=l(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:o}},runClassFinishers:function(e,t){for(var o=0;o<t.length;o++){var n=(0,t[o])(e);if(void 0!==n){if("function"!=typeof n)throw new TypeError("Finishers must return a constructor.");e=n}}return e},disallowProperty:function(e,t,o){if(void 0!==e[t])throw new TypeError(o+" can't have a ."+t+" property.")}};return e}function p(e){var t,o=z(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var n={kind:"field"===e.kind?"field":"method",key:o,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(n.decorators=e.decorators),"field"===e.kind&&(n.initializer=e.value),n}function b(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function M(e){return e.decorators&&e.decorators.length}function d(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function l(e,t){var o=e[t];if(void 0!==o&&"function"!=typeof o)throw new TypeError("Expected '"+t+"' to be a function");return o}function z(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var o=t.call(e,"string");if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=Array(t);o<t;o++)n[o]=e[o];return n}function O(){return O="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,o){var n=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=A(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:o):i.value}},O.apply(null,arguments)}function A(e){return A=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},A(e)}const f=window.localStorage,h=window.BRIGHTSPOT?.ui.tooltips.collapse,m=window.BRIGHTSPOT?.ui.tooltips.expand;let q=(_=[(0,i.EM)("btu-cig-cluster")],W=(0,r.j)((0,a.m)(n.WF)),g=c(),y=function(e,t){class o extends t{constructor(...t){super(...t),e(this)}}return{F:o,d:[{kind:"field",key:"_collapsed",value:()=>!0},{kind:"field",decorators:[(0,i.MZ)({type:String,reflect:!0,attribute:"cluster-title"})],key:"clusterTitle",value:void 0},{kind:"field",decorators:[(0,i.MZ)({type:String})],key:"tab",value:void 0},{kind:"set",decorators:[(0,i.MZ)()],key:"collapsed",value:function(e){this._collapsed=e;const t=this.closest(".CIG"),o=t?.dataset.type,n=this.clusterTitle?.trim(),i=`BSP.ContentEdit.clusterExpanded.${o}.${n}`;o&&n&&(e?f.removeItem(i):f.setItem(i,"1")),this._collapsed?this.states.delete("btu-expanded"):this.states.add("btu-expanded"),this.requestUpdate()}},{kind:"get",key:"collapsed",value:function(){return this._collapsed}},{kind:"method",key:"_toggleRowVisibility",value:function(e){this.querySelectorAll(":scope > :not(.CIG-title)").forEach(t=>{t.childNodes.length&&(t.toggleAttribute("hidden",e),t.classList.toggle("TC-unselected",e))})}},{kind:"method",key:"connectedCallback",value:function(){var e,t,n,i,r;(e=o,t="connectedCallback",n=this,r=O(A(1&(i=3)?e.prototype:e),t,n),2&i&&"function"==typeof r?function(e){return r.apply(n,e)}:r)([]);const a=this.closest(".CIG"),s=a?.dataset.type,c=`BSP.ContentEdit.clusterExpanded.${s}.${this.clusterTitle}`;this.collapsed=!f.getItem(c)}},{kind:"method",key:"createRenderRoot",value:function(){return this}},{kind:"method",key:"firstUpdated",value:function(){this.emit("btu-cig-cluster-ready");const e=this.querySelector(".CIG-title"),t=this.firstChild;t instanceof Element&&!t.classList.contains("CIG-title")&&e&&this.insertBefore(e,t),this.dataset.tab=this.tab;const o=Array.from(this.querySelectorAll(".CIG-row")).filter(e=>e.childNodes.length);this.toggleAttribute("hidden",!o.length),Array.from(this.querySelectorAll(".CIG-row")).filter(e=>!e.childNodes.length).forEach(e=>e.toggleAttribute("hidden",!0)),this.querySelectorAll(".CIG-row > .Message.is-error").length>0?this.states.add("btu-error"):this.states.delete("btu-error")}},{kind:"method",key:"render",value:function(){return this._toggleRowVisibility(this.collapsed),n.qy`<h2 class="CIG-title" data-tab=${this.tab}>
3
3
  <button
4
4
  type="button"
5
5
  title="${this.collapsed?m:h}"