@contributte/datagrid 0.0.0-20260106-a85ee92 → 0.0.0-20260106-7d36e11

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.
@@ -118,7 +118,8 @@ export class NajaAjax<C extends Naja = Naja, G extends Datagrid = Datagrid> exte
118
118
  }
119
119
 
120
120
  async request<D = {}, P = DatagridPayload>(args: RequestParams<D>): Promise<P> {
121
- return await this.client.makeRequest(args.method, args.url, args.data) as P;
121
+ const options = { history: false, ...args.options };
122
+ return await this.client.makeRequest(args.method, args.url, args.data ?? null, options) as P;
122
123
  }
123
124
 
124
125
  async submitForm<E extends HTMLFormElement = HTMLFormElement, P = Payload>(element: E): Promise<P> {
@@ -7,7 +7,8 @@ export interface BaseRequestParams {
7
7
  }
8
8
 
9
9
  export interface RequestParams<D = any> extends BaseRequestParams {
10
- data: D;
10
+ data?: D;
11
+ options?: Record<string, any>;
11
12
  }
12
13
 
13
14
  export interface DatagridPayload {
@@ -10,7 +10,7 @@ const t=t=>{"loading"===document.readyState?document.addEventListener("DOMConten
10
10
  * @author RubaXa <trash@rubaxa.org>
11
11
  * @author owenm <owen23355@gmail.com>
12
12
  * @license MIT
13
- */function fe(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,n)}return i}function ge(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?fe(Object(i),!0).forEach(function(e){ve(t,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):fe(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}function me(t){return me="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},me(t)}function ve(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function be(){return be=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},be.apply(this,arguments)}function ye(t,e){if(null==t)return{};var i,n,r=function(t,e){if(null==t)return{};var i,n,r={},s=Object.keys(t);for(n=0;n<s.length;n++)i=s[n],e.indexOf(i)>=0||(r[i]=t[i]);return r}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(n=0;n<s.length;n++)i=s[n],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(t,i)&&(r[i]=t[i])}return r}function _e(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var we=_e(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Ee=_e(/Edge/i),Ae=_e(/firefox/i),Se=_e(/safari/i)&&!_e(/chrome/i)&&!_e(/android/i),ke=_e(/iP(ad|od|hone)/i),Ce=_e(/chrome/i)&&_e(/android/i),Oe={capture:!1,passive:!1};function De(t,e,i){t.addEventListener(e,i,!we&&Oe)}function xe(t,e,i){t.removeEventListener(e,i,!we&&Oe)}function Te(t,e){if(e){if(">"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return!1}return!1}}function Le(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function Ie(t,e,i,n){if(t){i=i||document;do{if(null!=e&&(">"===e[0]?t.parentNode===i&&Te(t,e):Te(t,e))||n&&t===i)return t;if(t===i)break}while(t=Le(t))}return null}var Me,Fe=/\s+/g;function Ne(t,e,i){if(t&&e)if(t.classList)t.classList[i?"add":"remove"](e);else{var n=(" "+t.className+" ").replace(Fe," ").replace(" "+e+" "," ");t.className=(n+(i?" "+e:"")).replace(Fe," ")}}function je(t,e,i){var n=t&&t.style;if(n){if(void 0===i)return document.defaultView&&document.defaultView.getComputedStyle?i=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(i=t.currentStyle),void 0===e?i:i[e];e in n||-1!==e.indexOf("webkit")||(e="-webkit-"+e),n[e]=i+("string"==typeof i?"":"px")}}function Pe(t,e){var i="";if("string"==typeof t)i=t;else do{var n=je(t,"transform");n&&"none"!==n&&(i=n+" "+i)}while(!e&&(t=t.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(i)}function $e(t,e,i){if(t){var n=t.getElementsByTagName(e),r=0,s=n.length;if(i)for(;r<s;r++)i(n[r],r);return n}return[]}function He(){var t=document.scrollingElement;return t||document.documentElement}function qe(t,e,i,n,r){if(t.getBoundingClientRect||t===window){var s,o,a,l,c,d,u;if(t!==window&&t.parentNode&&t!==He()?(o=(s=t.getBoundingClientRect()).top,a=s.left,l=s.bottom,c=s.right,d=s.height,u=s.width):(o=0,a=0,l=window.innerHeight,c=window.innerWidth,d=window.innerHeight,u=window.innerWidth),(e||i)&&t!==window&&(r=r||t.parentNode,!we))do{if(r&&r.getBoundingClientRect&&("none"!==je(r,"transform")||i&&"static"!==je(r,"position"))){var h=r.getBoundingClientRect();o-=h.top+parseInt(je(r,"border-top-width")),a-=h.left+parseInt(je(r,"border-left-width")),l=o+s.height,c=a+s.width;break}}while(r=r.parentNode);if(n&&t!==window){var p=Pe(r||t),f=p&&p.a,g=p&&p.d;p&&(l=(o/=g)+(d/=g),c=(a/=f)+(u/=f))}return{top:o,left:a,bottom:l,right:c,width:u,height:d}}}function Re(t,e,i){for(var n=Ye(t,!0),r=qe(t)[e];n;){if(!(r>=qe(n)[i]))return n;if(n===He())break;n=Ye(n,!1)}return!1}function Be(t,e,i,n){for(var r=0,s=0,o=t.children;s<o.length;){if("none"!==o[s].style.display&&o[s]!==Qi.ghost&&(n||o[s]!==Qi.dragged)&&Ie(o[s],i.draggable,t,!1)){if(r===e)return o[s];r++}s++}return null}function Ve(t,e){for(var i=t.lastElementChild;i&&(i===Qi.ghost||"none"===je(i,"display")||e&&!Te(i,e));)i=i.previousElementSibling;return i||null}function ze(t,e){var i=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)"TEMPLATE"===t.nodeName.toUpperCase()||t===Qi.clone||e&&!Te(t,e)||i++;return i}function We(t){var e=0,i=0,n=He();if(t)do{var r=Pe(t),s=r.a,o=r.d;e+=t.scrollLeft*s,i+=t.scrollTop*o}while(t!==n&&(t=t.parentNode));return[e,i]}function Ye(t,e){if(!t||!t.getBoundingClientRect)return He();var i=t,n=!1;do{if(i.clientWidth<i.scrollWidth||i.clientHeight<i.scrollHeight){var r=je(i);if(i.clientWidth<i.scrollWidth&&("auto"==r.overflowX||"scroll"==r.overflowX)||i.clientHeight<i.scrollHeight&&("auto"==r.overflowY||"scroll"==r.overflowY)){if(!i.getBoundingClientRect||i===document.body)return He();if(n||e)return i;n=!0}}}while(i=i.parentNode);return He()}function Ke(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}function Ue(t,e){return function(){if(!Me){var i=arguments;1===i.length?t.call(this,i[0]):t.apply(this,i),Me=setTimeout(function(){Me=void 0},e)}}}function Xe(t,e,i){t.scrollLeft+=e,t.scrollTop+=i}function Qe(t){var e=window.Polymer,$=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):$?$(t).clone(!0)[0]:t.cloneNode(!0)}function Ge(t,e,i){var n={};return Array.from(t.children).forEach(function(r){var s,o,a,l;if(Ie(r,e.draggable,t,!1)&&!r.animated&&r!==i){var c=qe(r);n.left=Math.min(null!==(s=n.left)&&void 0!==s?s:1/0,c.left),n.top=Math.min(null!==(o=n.top)&&void 0!==o?o:1/0,c.top),n.right=Math.max(null!==(a=n.right)&&void 0!==a?a:-1/0,c.right),n.bottom=Math.max(null!==(l=n.bottom)&&void 0!==l?l:-1/0,c.bottom)}}),n.width=n.right-n.left,n.height=n.bottom-n.top,n.x=n.left,n.y=n.top,n}var Je="Sortable"+(new Date).getTime();function Ze(){var t,e=[];return{captureAnimationState:function(){(e=[],this.options.animation)&&[].slice.call(this.el.children).forEach(function(t){if("none"!==je(t,"display")&&t!==Qi.ghost){e.push({target:t,rect:qe(t)});var i=ge({},e[e.length-1].rect);if(t.thisAnimationDuration){var n=Pe(t,!0);n&&(i.top-=n.f,i.left-=n.e)}t.fromRect=i}})},addAnimationState:function(t){e.push(t)},removeAnimationState:function(t){e.splice(function(t,e){for(var i in t)if(t.hasOwnProperty(i))for(var n in e)if(e.hasOwnProperty(n)&&e[n]===t[i][n])return Number(i);return-1}(e,{target:t}),1)},animateAll:function(i){var n=this;if(!this.options.animation)return clearTimeout(t),void("function"==typeof i&&i());var r=!1,s=0;e.forEach(function(t){var e=0,i=t.target,o=i.fromRect,a=qe(i),l=i.prevFromRect,c=i.prevToRect,d=t.rect,u=Pe(i,!0);u&&(a.top-=u.f,a.left-=u.e),i.toRect=a,i.thisAnimationDuration&&Ke(l,a)&&!Ke(o,a)&&(d.top-a.top)/(d.left-a.left)===(o.top-a.top)/(o.left-a.left)&&(e=function(t,e,i,n){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-i.top,2)+Math.pow(e.left-i.left,2))*n.animation}(d,l,c,n.options)),Ke(a,o)||(i.prevFromRect=o,i.prevToRect=a,e||(e=n.options.animation),n.animate(i,d,a,e)),e&&(r=!0,s=Math.max(s,e),clearTimeout(i.animationResetTimer),i.animationResetTimer=setTimeout(function(){i.animationTime=0,i.prevFromRect=null,i.fromRect=null,i.prevToRect=null,i.thisAnimationDuration=null},e),i.thisAnimationDuration=e)}),clearTimeout(t),r?t=setTimeout(function(){"function"==typeof i&&i()},s):"function"==typeof i&&i(),e=[]},animate:function(t,e,i,n){if(n){je(t,"transition",""),je(t,"transform","");var r=Pe(this.el),s=r&&r.a,o=r&&r.d,a=(e.left-i.left)/(s||1),l=(e.top-i.top)/(o||1);t.animatingX=!!a,t.animatingY=!!l,je(t,"transform","translate3d("+a+"px,"+l+"px,0)"),this.forRepaintDummy=function(t){return t.offsetWidth}(t),je(t,"transition","transform "+n+"ms"+(this.options.easing?" "+this.options.easing:"")),je(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout(function(){je(t,"transition",""),je(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1},n)}}}}var ti=[],ei={initializeByDefault:!0},ii={mount:function(t){for(var e in ei)ei.hasOwnProperty(e)&&!(e in t)&&(t[e]=ei[e]);ti.forEach(function(e){if(e.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),ti.push(t)},pluginEvent:function(t,e,i){var n=this;this.eventCanceled=!1,i.cancel=function(){n.eventCanceled=!0};var r=t+"Global";ti.forEach(function(n){e[n.pluginName]&&(e[n.pluginName][r]&&e[n.pluginName][r](ge({sortable:e},i)),e.options[n.pluginName]&&e[n.pluginName][t]&&e[n.pluginName][t](ge({sortable:e},i)))})},initializePlugins:function(t,e,i,n){for(var r in ti.forEach(function(n){var r=n.pluginName;if(t.options[r]||n.initializeByDefault){var s=new n(t,e,t.options);s.sortable=t,s.options=t.options,t[r]=s,be(i,s.defaults)}}),t.options)if(t.options.hasOwnProperty(r)){var s=this.modifyOption(t,r,t.options[r]);void 0!==s&&(t.options[r]=s)}},getEventProperties:function(t,e){var i={};return ti.forEach(function(n){"function"==typeof n.eventProperties&&be(i,n.eventProperties.call(e[n.pluginName],t))}),i},modifyOption:function(t,e,i){var n;return ti.forEach(function(r){t[r.pluginName]&&r.optionListeners&&"function"==typeof r.optionListeners[e]&&(n=r.optionListeners[e].call(t[r.pluginName],i))}),n}};var ni=["evt"],ri=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=i.evt,r=ye(i,ni);ii.pluginEvent.bind(Qi)(t,e,ge({dragEl:oi,parentEl:ai,ghostEl:li,rootEl:ci,nextEl:di,lastDownEl:ui,cloneEl:hi,cloneHidden:pi,dragStarted:Ci,putSortable:yi,activeSortable:Qi.active,originalEvent:n,oldIndex:fi,oldDraggableIndex:mi,newIndex:gi,newDraggableIndex:vi,hideGhostForTarget:Yi,unhideGhostForTarget:Ki,cloneNowHidden:function(){pi=!0},cloneNowShown:function(){pi=!1},dispatchSortableEvent:function(t){si({sortable:e,name:t,originalEvent:n})}},r))};function si(t){!function(t){var e=t.sortable,i=t.rootEl,n=t.name,r=t.targetEl,s=t.cloneEl,o=t.toEl,a=t.fromEl,l=t.oldIndex,c=t.newIndex,d=t.oldDraggableIndex,u=t.newDraggableIndex,h=t.originalEvent,p=t.putSortable,f=t.extraEventProperties;if(e=e||i&&i[Je]){var g,m=e.options,v="on"+n.charAt(0).toUpperCase()+n.substr(1);!window.CustomEvent||we||Ee?(g=document.createEvent("Event")).initEvent(n,!0,!0):g=new CustomEvent(n,{bubbles:!0,cancelable:!0}),g.to=o||i,g.from=a||i,g.item=r||i,g.clone=s,g.oldIndex=l,g.newIndex=c,g.oldDraggableIndex=d,g.newDraggableIndex=u,g.originalEvent=h,g.pullMode=p?p.lastPutMode:void 0;var b=ge(ge({},f),ii.getEventProperties(n,e));for(var y in b)g[y]=b[y];i&&i.dispatchEvent(g),m[v]&&m[v].call(e,g)}}(ge({putSortable:yi,cloneEl:hi,targetEl:oi,rootEl:ci,oldIndex:fi,oldDraggableIndex:mi,newIndex:gi,newDraggableIndex:vi},t))}var oi,ai,li,ci,di,ui,hi,pi,fi,gi,mi,vi,bi,yi,_i,wi,Ei,Ai,Si,ki,Ci,Oi,Di,xi,Ti,Li=!1,Ii=!1,Mi=[],Fi=!1,Ni=!1,ji=[],Pi=!1,$i=[],Hi="undefined"!=typeof document,qi=ke,Ri=Ee||we?"cssFloat":"float",Bi=Hi&&!Ce&&!ke&&"draggable"in document.createElement("div"),Vi=function(){if(Hi){if(we)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),zi=function(t,e){var i=je(t),n=parseInt(i.width)-parseInt(i.paddingLeft)-parseInt(i.paddingRight)-parseInt(i.borderLeftWidth)-parseInt(i.borderRightWidth),r=Be(t,0,e),s=Be(t,1,e),o=r&&je(r),a=s&&je(s),l=o&&parseInt(o.marginLeft)+parseInt(o.marginRight)+qe(r).width,c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+qe(s).width;if("flex"===i.display)return"column"===i.flexDirection||"column-reverse"===i.flexDirection?"vertical":"horizontal";if("grid"===i.display)return i.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&o.float&&"none"!==o.float){var d="left"===o.float?"left":"right";return!s||"both"!==a.clear&&a.clear!==d?"horizontal":"vertical"}return r&&("block"===o.display||"flex"===o.display||"table"===o.display||"grid"===o.display||l>=n&&"none"===i[Ri]||s&&"none"===i[Ri]&&l+c>n)?"vertical":"horizontal"},Wi=function(t){function e(t,i){return function(n,r,s,o){var a=n.options.group.name&&r.options.group.name&&n.options.group.name===r.options.group.name;if(null==t&&(i||a))return!0;if(null==t||!1===t)return!1;if(i&&"clone"===t)return t;if("function"==typeof t)return e(t(n,r,s,o),i)(n,r,s,o);var l=(i?n:r).options.group.name;return!0===t||"string"==typeof t&&t===l||t.join&&t.indexOf(l)>-1}}var i={},n=t.group;n&&"object"==me(n)||(n={name:n}),i.name=n.name,i.checkPull=e(n.pull,!0),i.checkPut=e(n.put),i.revertClone=n.revertClone,t.group=i},Yi=function(){!Vi&&li&&je(li,"display","none")},Ki=function(){!Vi&&li&&je(li,"display","")};Hi&&!Ce&&document.addEventListener("click",function(t){if(Ii)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Ii=!1,!1},!0);var Ui=function(t){if(oi){t=t.touches?t.touches[0]:t;var e=(r=t.clientX,s=t.clientY,Mi.some(function(t){var e=t[Je].options.emptyInsertThreshold;if(e&&!Ve(t)){var i=qe(t),n=r>=i.left-e&&r<=i.right+e,a=s>=i.top-e&&s<=i.bottom+e;return n&&a?o=t:void 0}}),o);if(e){var i={};for(var n in t)t.hasOwnProperty(n)&&(i[n]=t[n]);i.target=i.rootEl=e,i.preventDefault=void 0,i.stopPropagation=void 0,e[Je]._onDragOver(i)}}var r,s,o},Xi=function(t){oi&&oi.parentNode[Je]._isOutsideThisEl(t.target)};function Qi(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=be({},e),t[Je]=this;var i={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return zi(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==Qi.supportPointer&&"PointerEvent"in window&&(!Se||ke),emptyInsertThreshold:5};for(var n in ii.initializePlugins(this,t,i),i)!(n in e)&&(e[n]=i[n]);for(var r in Wi(e),this)"_"===r.charAt(0)&&"function"==typeof this[r]&&(this[r]=this[r].bind(this));this.nativeDraggable=!e.forceFallback&&Bi,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?De(t,"pointerdown",this._onTapStart):(De(t,"mousedown",this._onTapStart),De(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(De(t,"dragover",this),De(t,"dragenter",this)),Mi.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),be(this,Ze())}function Gi(t,e,i,n,r,s,o,a){var l,c,d=t[Je],u=d.options.onMove;return!window.CustomEvent||we||Ee?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=e,l.from=t,l.dragged=i,l.draggedRect=n,l.related=r||e,l.relatedRect=s||qe(e),l.willInsertAfter=a,l.originalEvent=o,t.dispatchEvent(l),u&&(c=u.call(d,l,o)),c}function Ji(t){t.draggable=!1}function Zi(){Pi=!1}function tn(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,i=e.length,n=0;i--;)n+=e.charCodeAt(i);return n.toString(36)}function en(t){return setTimeout(t,0)}function nn(t){return clearTimeout(t)}Qi.prototype={constructor:Qi,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(Oi=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,oi):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,i=this.el,n=this.options,r=n.preventOnFilter,s=t.type,o=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,a=(o||t).target,l=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||a,c=n.filter;if(function(t){$i.length=0;var e=t.getElementsByTagName("input"),i=e.length;for(;i--;){var n=e[i];n.checked&&$i.push(n)}}(i),!oi&&!(/mousedown|pointerdown/.test(s)&&0!==t.button||n.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!Se||!a||"SELECT"!==a.tagName.toUpperCase())&&!((a=Ie(a,n.draggable,i,!1))&&a.animated||ui===a)){if(fi=ze(a),mi=ze(a,n.draggable),"function"==typeof c){if(c.call(this,t,a,this))return si({sortable:e,rootEl:l,name:"filter",targetEl:a,toEl:i,fromEl:i}),ri("filter",e,{evt:t}),void(r&&t.preventDefault())}else if(c&&(c=c.split(",").some(function(n){if(n=Ie(l,n.trim(),i,!1))return si({sortable:e,rootEl:n,name:"filter",targetEl:a,fromEl:i,toEl:i}),ri("filter",e,{evt:t}),!0})))return void(r&&t.preventDefault());n.handle&&!Ie(l,n.handle,i,!1)||this._prepareDragStart(t,o,a)}}},_prepareDragStart:function(t,e,i){var n,r=this,s=r.el,o=r.options,a=s.ownerDocument;if(i&&!oi&&i.parentNode===s){var l=qe(i);if(ci=s,ai=(oi=i).parentNode,di=oi.nextSibling,ui=i,bi=o.group,Qi.dragged=oi,_i={target:oi,clientX:(e||t).clientX,clientY:(e||t).clientY},Si=_i.clientX-l.left,ki=_i.clientY-l.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,oi.style["will-change"]="all",n=function(){ri("delayEnded",r,{evt:t}),Qi.eventCanceled?r._onDrop():(r._disableDelayedDragEvents(),!Ae&&r.nativeDraggable&&(oi.draggable=!0),r._triggerDragStart(t,e),si({sortable:r,name:"choose",originalEvent:t}),Ne(oi,o.chosenClass,!0))},o.ignore.split(",").forEach(function(t){$e(oi,t.trim(),Ji)}),De(a,"dragover",Ui),De(a,"mousemove",Ui),De(a,"touchmove",Ui),o.supportPointer?(De(a,"pointerup",r._onDrop),!this.nativeDraggable&&De(a,"pointercancel",r._onDrop)):(De(a,"mouseup",r._onDrop),De(a,"touchend",r._onDrop),De(a,"touchcancel",r._onDrop)),Ae&&this.nativeDraggable&&(this.options.touchStartThreshold=4,oi.draggable=!0),ri("delayStart",this,{evt:t}),!o.delay||o.delayOnTouchOnly&&!e||this.nativeDraggable&&(Ee||we))n();else{if(Qi.eventCanceled)return void this._onDrop();o.supportPointer?(De(a,"pointerup",r._disableDelayedDrag),De(a,"pointercancel",r._disableDelayedDrag)):(De(a,"mouseup",r._disableDelayedDrag),De(a,"touchend",r._disableDelayedDrag),De(a,"touchcancel",r._disableDelayedDrag)),De(a,"mousemove",r._delayedDragTouchMoveHandler),De(a,"touchmove",r._delayedDragTouchMoveHandler),o.supportPointer&&De(a,"pointermove",r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(n,o.delay)}}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){oi&&Ji(oi),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;xe(t,"mouseup",this._disableDelayedDrag),xe(t,"touchend",this._disableDelayedDrag),xe(t,"touchcancel",this._disableDelayedDrag),xe(t,"pointerup",this._disableDelayedDrag),xe(t,"pointercancel",this._disableDelayedDrag),xe(t,"mousemove",this._delayedDragTouchMoveHandler),xe(t,"touchmove",this._delayedDragTouchMoveHandler),xe(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?De(document,"pointermove",this._onTouchMove):De(document,e?"touchmove":"mousemove",this._onTouchMove):(De(oi,"dragend",this),De(ci,"dragstart",this._onDragStart));try{document.selection?en(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){if(Li=!1,ci&&oi){ri("dragStarted",this,{evt:e}),this.nativeDraggable&&De(document,"dragover",Xi);var i=this.options;!t&&Ne(oi,i.dragClass,!1),Ne(oi,i.ghostClass,!0),Qi.active=this,t&&this._appendGhost(),si({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(wi){this._lastX=wi.clientX,this._lastY=wi.clientY,Yi();for(var t=document.elementFromPoint(wi.clientX,wi.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(wi.clientX,wi.clientY))!==e;)e=t;if(oi.parentNode[Je]._isOutsideThisEl(t),e)do{if(e[Je]){if(e[Je]._onDragOver({clientX:wi.clientX,clientY:wi.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}t=e}while(e=Le(e));Ki()}},_onTouchMove:function(t){if(_i){var e=this.options,i=e.fallbackTolerance,n=e.fallbackOffset,r=t.touches?t.touches[0]:t,s=li&&Pe(li,!0),o=li&&s&&s.a,a=li&&s&&s.d,l=qi&&Ti&&We(Ti),c=(r.clientX-_i.clientX+n.x)/(o||1)+(l?l[0]-ji[0]:0)/(o||1),d=(r.clientY-_i.clientY+n.y)/(a||1)+(l?l[1]-ji[1]:0)/(a||1);if(!Qi.active&&!Li){if(i&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))<i)return;this._onDragStart(t,!0)}if(li){s?(s.e+=c-(Ei||0),s.f+=d-(Ai||0)):s={a:1,b:0,c:0,d:1,e:c,f:d};var u="matrix(".concat(s.a,",").concat(s.b,",").concat(s.c,",").concat(s.d,",").concat(s.e,",").concat(s.f,")");je(li,"webkitTransform",u),je(li,"mozTransform",u),je(li,"msTransform",u),je(li,"transform",u),Ei=c,Ai=d,wi=r}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!li){var t=this.options.fallbackOnBody?document.body:ci,e=qe(oi,!0,qi,!0,t),i=this.options;if(qi){for(Ti=t;"static"===je(Ti,"position")&&"none"===je(Ti,"transform")&&Ti!==document;)Ti=Ti.parentNode;Ti!==document.body&&Ti!==document.documentElement?(Ti===document&&(Ti=He()),e.top+=Ti.scrollTop,e.left+=Ti.scrollLeft):Ti=He(),ji=We(Ti)}Ne(li=oi.cloneNode(!0),i.ghostClass,!1),Ne(li,i.fallbackClass,!0),Ne(li,i.dragClass,!0),je(li,"transition",""),je(li,"transform",""),je(li,"box-sizing","border-box"),je(li,"margin",0),je(li,"top",e.top),je(li,"left",e.left),je(li,"width",e.width),je(li,"height",e.height),je(li,"opacity","0.8"),je(li,"position",qi?"absolute":"fixed"),je(li,"zIndex","100000"),je(li,"pointerEvents","none"),Qi.ghost=li,t.appendChild(li),je(li,"transform-origin",Si/parseInt(li.style.width)*100+"% "+ki/parseInt(li.style.height)*100+"%")}},_onDragStart:function(t,e){var i=this,n=t.dataTransfer,r=i.options;ri("dragStart",this,{evt:t}),Qi.eventCanceled?this._onDrop():(ri("setupClone",this),Qi.eventCanceled||((hi=Qe(oi)).removeAttribute("id"),hi.draggable=!1,hi.style["will-change"]="",this._hideClone(),Ne(hi,this.options.chosenClass,!1),Qi.clone=hi),i.cloneId=en(function(){ri("clone",i),Qi.eventCanceled||(i.options.removeCloneOnHide||ci.insertBefore(hi,oi),i._hideClone(),si({sortable:i,name:"clone"}))}),!e&&Ne(oi,r.dragClass,!0),e?(Ii=!0,i._loopId=setInterval(i._emulateDragOver,50)):(xe(document,"mouseup",i._onDrop),xe(document,"touchend",i._onDrop),xe(document,"touchcancel",i._onDrop),n&&(n.effectAllowed="move",r.setData&&r.setData.call(i,n,oi)),De(document,"drop",i),je(oi,"transform","translateZ(0)")),Li=!0,i._dragStartId=en(i._dragStarted.bind(i,e,t)),De(document,"selectstart",i),Ci=!0,window.getSelection().removeAllRanges(),Se&&je(document.body,"user-select","none"))},_onDragOver:function(t){var e,i,n,r,s=this.el,o=t.target,a=this.options,l=a.group,c=Qi.active,d=bi===l,u=a.sort,h=yi||c,p=this,f=!1;if(!Pi){if(void 0!==t.preventDefault&&t.cancelable&&t.preventDefault(),o=Ie(o,a.draggable,s,!0),x("dragOver"),Qi.eventCanceled)return f;if(oi.contains(t.target)||o.animated&&o.animatingX&&o.animatingY||p._ignoreWhileAnimating===o)return L(!1);if(Ii=!1,c&&!a.disabled&&(d?u||(n=ai!==ci):yi===this||(this.lastPutMode=bi.checkPull(this,c,oi,t))&&l.checkPut(this,c,oi,t))){if(r="vertical"===this._getDirection(t,o),e=qe(oi),x("dragOverValid"),Qi.eventCanceled)return f;if(n)return ai=ci,T(),this._hideClone(),x("revert"),Qi.eventCanceled||(di?ci.insertBefore(oi,di):ci.appendChild(oi)),L(!0);var g=Ve(s,a.draggable);if(!g||function(t,e,i){var n=qe(Ve(i.el,i.options.draggable)),r=Ge(i.el,i.options,li),s=10;return e?t.clientX>r.right+s||t.clientY>n.bottom&&t.clientX>n.left:t.clientY>r.bottom+s||t.clientX>n.right&&t.clientY>n.top}(t,r,this)&&!g.animated){if(g===oi)return L(!1);if(g&&s===t.target&&(o=g),o&&(i=qe(o)),!1!==Gi(ci,s,oi,e,o,i,t,!!o))return T(),g&&g.nextSibling?s.insertBefore(oi,g.nextSibling):s.appendChild(oi),ai=s,I(),L(!0)}else if(g&&function(t,e,i){var n=qe(Be(i.el,0,i.options,!0)),r=Ge(i.el,i.options,li),s=10;return e?t.clientX<r.left-s||t.clientY<n.top&&t.clientX<n.right:t.clientY<r.top-s||t.clientY<n.bottom&&t.clientX<n.left}(t,r,this)){var m=Be(s,0,a,!0);if(m===oi)return L(!1);if(i=qe(o=m),!1!==Gi(ci,s,oi,e,o,i,t,!1))return T(),s.insertBefore(oi,m),ai=s,I(),L(!0)}else if(o.parentNode===s){i=qe(o);var v,b,y,_=oi.parentNode!==s,w=!function(t,e,i){var n=i?t.left:t.top,r=i?t.right:t.bottom,s=i?t.width:t.height,o=i?e.left:e.top,a=i?e.right:e.bottom,l=i?e.width:e.height;return n===o||r===a||n+s/2===o+l/2}(oi.animated&&oi.toRect||e,o.animated&&o.toRect||i,r),E=r?"top":"left",A=Re(o,"top","top")||Re(oi,"top","top"),S=A?A.scrollTop:void 0;if(Oi!==o&&(b=i[E],Fi=!1,Ni=!w&&a.invertSwap||_),v=function(t,e,i,n,r,s,o,a){var l=n?t.clientY:t.clientX,c=n?i.height:i.width,d=n?i.top:i.left,u=n?i.bottom:i.right,h=!1;if(!o)if(a&&xi<c*r){if(!Fi&&(1===Di?l>d+c*s/2:l<u-c*s/2)&&(Fi=!0),Fi)h=!0;else if(1===Di?l<d+xi:l>u-xi)return-Di}else if(l>d+c*(1-r)/2&&l<u-c*(1-r)/2)return function(t){return ze(oi)<ze(t)?1:-1}(e);if((h=h||o)&&(l<d+c*s/2||l>u-c*s/2))return l>d+c/2?1:-1;return 0}(t,o,i,r,w?1:a.swapThreshold,null==a.invertedSwapThreshold?a.swapThreshold:a.invertedSwapThreshold,Ni,Oi===o),0!==v){var k=ze(oi);do{k-=v,y=ai.children[k]}while(y&&("none"===je(y,"display")||y===li))}if(0===v||y===o)return L(!1);Oi=o,Di=v;var C=o.nextElementSibling,O=!1,D=Gi(ci,s,oi,e,o,i,t,O=1===v);if(!1!==D)return 1!==D&&-1!==D||(O=1===D),Pi=!0,setTimeout(Zi,30),T(),O&&!C?s.appendChild(oi):o.parentNode.insertBefore(oi,O?C:o),A&&Xe(A,0,S-A.scrollTop),ai=oi.parentNode,void 0===b||Ni||(xi=Math.abs(b-qe(o)[E])),I(),L(!0)}if(s.contains(oi))return L(!1)}return!1}function x(a,l){ri(a,p,ge({evt:t,isOwner:d,axis:r?"vertical":"horizontal",revert:n,dragRect:e,targetRect:i,canSort:u,fromSortable:h,target:o,completed:L,onMove:function(i,n){return Gi(ci,s,oi,e,i,qe(i),t,n)},changed:I},l))}function T(){x("dragOverAnimationCapture"),p.captureAnimationState(),p!==h&&h.captureAnimationState()}function L(e){return x("dragOverCompleted",{insertion:e}),e&&(d?c._hideClone():c._showClone(p),p!==h&&(Ne(oi,yi?yi.options.ghostClass:c.options.ghostClass,!1),Ne(oi,a.ghostClass,!0)),yi!==p&&p!==Qi.active?yi=p:p===Qi.active&&yi&&(yi=null),h===p&&(p._ignoreWhileAnimating=o),p.animateAll(function(){x("dragOverAnimationComplete"),p._ignoreWhileAnimating=null}),p!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(o===oi&&!oi.animated||o===s&&!o.animated)&&(Oi=null),a.dragoverBubble||t.rootEl||o===document||(oi.parentNode[Je]._isOutsideThisEl(t.target),!e&&Ui(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),f=!0}function I(){gi=ze(oi),vi=ze(oi,a.draggable),si({sortable:p,name:"change",toEl:s,newIndex:gi,newDraggableIndex:vi,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){xe(document,"mousemove",this._onTouchMove),xe(document,"touchmove",this._onTouchMove),xe(document,"pointermove",this._onTouchMove),xe(document,"dragover",Ui),xe(document,"mousemove",Ui),xe(document,"touchmove",Ui)},_offUpEvents:function(){var t=this.el.ownerDocument;xe(t,"mouseup",this._onDrop),xe(t,"touchend",this._onDrop),xe(t,"pointerup",this._onDrop),xe(t,"pointercancel",this._onDrop),xe(t,"touchcancel",this._onDrop),xe(document,"selectstart",this)},_onDrop:function(t){var e=this.el,i=this.options;gi=ze(oi),vi=ze(oi,i.draggable),ri("drop",this,{evt:t}),ai=oi&&oi.parentNode,gi=ze(oi),vi=ze(oi,i.draggable),Qi.eventCanceled||(Li=!1,Ni=!1,Fi=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),nn(this.cloneId),nn(this._dragStartId),this.nativeDraggable&&(xe(document,"drop",this),xe(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Se&&je(document.body,"user-select",""),je(oi,"transform",""),t&&(Ci&&(t.cancelable&&t.preventDefault(),!i.dropBubble&&t.stopPropagation()),li&&li.parentNode&&li.parentNode.removeChild(li),(ci===ai||yi&&"clone"!==yi.lastPutMode)&&hi&&hi.parentNode&&hi.parentNode.removeChild(hi),oi&&(this.nativeDraggable&&xe(oi,"dragend",this),Ji(oi),oi.style["will-change"]="",Ci&&!Li&&Ne(oi,yi?yi.options.ghostClass:this.options.ghostClass,!1),Ne(oi,this.options.chosenClass,!1),si({sortable:this,name:"unchoose",toEl:ai,newIndex:null,newDraggableIndex:null,originalEvent:t}),ci!==ai?(gi>=0&&(si({rootEl:ai,name:"add",toEl:ai,fromEl:ci,originalEvent:t}),si({sortable:this,name:"remove",toEl:ai,originalEvent:t}),si({rootEl:ai,name:"sort",toEl:ai,fromEl:ci,originalEvent:t}),si({sortable:this,name:"sort",toEl:ai,originalEvent:t})),yi&&yi.save()):gi!==fi&&gi>=0&&(si({sortable:this,name:"update",toEl:ai,originalEvent:t}),si({sortable:this,name:"sort",toEl:ai,originalEvent:t})),Qi.active&&(null!=gi&&-1!==gi||(gi=fi,vi=mi),si({sortable:this,name:"end",toEl:ai,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){ri("nulling",this),ci=oi=ai=li=di=hi=ui=pi=_i=wi=Ci=gi=vi=fi=mi=Oi=Di=yi=bi=Qi.dragged=Qi.ghost=Qi.clone=Qi.active=null,$i.forEach(function(t){t.checked=!0}),$i.length=Ei=Ai=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":oi&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move");t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],i=this.el.children,n=0,r=i.length,s=this.options;n<r;n++)Ie(t=i[n],s.draggable,this.el,!1)&&e.push(t.getAttribute(s.dataIdAttr)||tn(t));return e},sort:function(t,e){var i={},n=this.el;this.toArray().forEach(function(t,e){var r=n.children[e];Ie(r,this.options.draggable,n,!1)&&(i[t]=r)},this),e&&this.captureAnimationState(),t.forEach(function(t){i[t]&&(n.removeChild(i[t]),n.appendChild(i[t]))}),e&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,e){return Ie(t,e||this.options.draggable,this.el,!1)},option:function(t,e){var i=this.options;if(void 0===e)return i[t];var n=ii.modifyOption(this,t,e);i[t]=void 0!==n?n:e,"group"===t&&Wi(i)},destroy:function(){ri("destroy",this);var t=this.el;t[Je]=null,xe(t,"mousedown",this._onTapStart),xe(t,"touchstart",this._onTapStart),xe(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(xe(t,"dragover",this),xe(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Mi.splice(Mi.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!pi){if(ri("hideClone",this),Qi.eventCanceled)return;je(hi,"display","none"),this.options.removeCloneOnHide&&hi.parentNode&&hi.parentNode.removeChild(hi),pi=!0}},_showClone:function(t){if("clone"===t.lastPutMode){if(pi){if(ri("showClone",this),Qi.eventCanceled)return;oi.parentNode!=ci||this.options.group.revertClone?di?ci.insertBefore(hi,di):ci.appendChild(hi):ci.insertBefore(hi,oi),this.options.group.revertClone&&this.animate(oi,hi),je(hi,"display",""),pi=!1}}else this._hideClone()}},Hi&&De(document,"touchmove",function(t){(Qi.active||Li)&&t.cancelable&&t.preventDefault()}),Qi.utils={on:De,off:xe,css:je,find:$e,is:function(t,e){return!!Ie(t,e,t,!1)},extend:function(t,e){if(t&&e)for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t},throttle:Ue,closest:Ie,toggleClass:Ne,clone:Qe,index:ze,nextTick:en,cancelNextTick:nn,detectDirection:zi,getChild:Be,expando:Je},Qi.get=function(t){return t[Je]},Qi.mount=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];e[0].constructor===Array&&(e=e[0]),e.forEach(function(t){if(!t.prototype||!t.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(t));t.utils&&(Qi.utils=ge(ge({},Qi.utils),t.utils)),ii.mount(t)})},Qi.create=function(t,e){return new Qi(t,e)},Qi.version="1.15.6";var rn,sn,on,an,ln,cn,dn=[],un=!1;function hn(){dn.forEach(function(t){clearInterval(t.pid)}),dn=[]}function pn(){clearInterval(cn)}var fn=Ue(function(t,e,i,n){if(e.scroll){var r,s=(t.touches?t.touches[0]:t).clientX,o=(t.touches?t.touches[0]:t).clientY,a=e.scrollSensitivity,l=e.scrollSpeed,c=He(),d=!1;sn!==i&&(sn=i,hn(),rn=e.scroll,r=e.scrollFn,!0===rn&&(rn=Ye(i,!0)));var u=0,h=rn;do{var p=h,f=qe(p),g=f.top,m=f.bottom,v=f.left,b=f.right,y=f.width,_=f.height,w=void 0,E=void 0,A=p.scrollWidth,S=p.scrollHeight,k=je(p),C=p.scrollLeft,O=p.scrollTop;p===c?(w=y<A&&("auto"===k.overflowX||"scroll"===k.overflowX||"visible"===k.overflowX),E=_<S&&("auto"===k.overflowY||"scroll"===k.overflowY||"visible"===k.overflowY)):(w=y<A&&("auto"===k.overflowX||"scroll"===k.overflowX),E=_<S&&("auto"===k.overflowY||"scroll"===k.overflowY));var D=w&&(Math.abs(b-s)<=a&&C+y<A)-(Math.abs(v-s)<=a&&!!C),x=E&&(Math.abs(m-o)<=a&&O+_<S)-(Math.abs(g-o)<=a&&!!O);if(!dn[u])for(var T=0;T<=u;T++)dn[T]||(dn[T]={});dn[u].vx==D&&dn[u].vy==x&&dn[u].el===p||(dn[u].el=p,dn[u].vx=D,dn[u].vy=x,clearInterval(dn[u].pid),0==D&&0==x||(d=!0,dn[u].pid=setInterval(function(){n&&0===this.layer&&Qi.active._onTouchMove(ln);var e=dn[this.layer].vy?dn[this.layer].vy*l:0,i=dn[this.layer].vx?dn[this.layer].vx*l:0;"function"==typeof r&&"continue"!==r.call(Qi.dragged.parentNode[Je],i,e,t,ln,dn[this.layer].el)||Xe(dn[this.layer].el,i,e)}.bind({layer:u}),24))),u++}while(e.bubbleScroll&&h!==c&&(h=Ye(h,!1)));un=d}},30),gn=function(t){var e=t.originalEvent,i=t.putSortable,n=t.dragEl,r=t.activeSortable,s=t.dispatchSortableEvent,o=t.hideGhostForTarget,a=t.unhideGhostForTarget;if(e){var l=i||r;o();var c=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e,d=document.elementFromPoint(c.clientX,c.clientY);a(),l&&!l.el.contains(d)&&(s("spill"),this.onSpill({dragEl:n,putSortable:i}))}};function mn(){}function vn(){}mn.prototype={startIndex:null,dragStart:function(t){var e=t.oldDraggableIndex;this.startIndex=e},onSpill:function(t){var e=t.dragEl,i=t.putSortable;this.sortable.captureAnimationState(),i&&i.captureAnimationState();var n=Be(this.sortable.el,this.startIndex,this.options);n?this.sortable.el.insertBefore(e,n):this.sortable.el.appendChild(e),this.sortable.animateAll(),i&&i.animateAll()},drop:gn},be(mn,{pluginName:"revertOnSpill"}),vn.prototype={onSpill:function(t){var e=t.dragEl,i=t.putSortable||this.sortable;i.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),i.animateAll()},drop:gn},be(vn,{pluginName:"removeOnSpill"}),Qi.mount(new function(){function t(){for(var t in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===t.charAt(0)&&"function"==typeof this[t]&&(this[t]=this[t].bind(this))}return t.prototype={dragStarted:function(t){var e=t.originalEvent;this.sortable.nativeDraggable?De(document,"dragover",this._handleAutoScroll):this.options.supportPointer?De(document,"pointermove",this._handleFallbackAutoScroll):e.touches?De(document,"touchmove",this._handleFallbackAutoScroll):De(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var e=t.originalEvent;this.options.dragOverBubble||e.rootEl||this._handleAutoScroll(e)},drop:function(){this.sortable.nativeDraggable?xe(document,"dragover",this._handleAutoScroll):(xe(document,"pointermove",this._handleFallbackAutoScroll),xe(document,"touchmove",this._handleFallbackAutoScroll),xe(document,"mousemove",this._handleFallbackAutoScroll)),pn(),hn(),clearTimeout(Me),Me=void 0},nulling:function(){ln=sn=rn=un=cn=on=an=null,dn.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,e){var i=this,n=(t.touches?t.touches[0]:t).clientX,r=(t.touches?t.touches[0]:t).clientY,s=document.elementFromPoint(n,r);if(ln=t,e||this.options.forceAutoScrollFallback||Ee||we||Se){fn(t,this.options,s,e);var o=Ye(s,!0);!un||cn&&n===on&&r===an||(cn&&pn(),cn=setInterval(function(){var s=Ye(document.elementFromPoint(n,r),!0);s!==o&&(o=s,hn()),fn(t,i.options,s,e)},10),on=n,an=r)}else{if(!this.options.bubbleScroll||Ye(s,!0)===He())return void hn();fn(t,this.options,Ye(s,!1),!1)}}},be(t,{pluginName:"scroll",initializeByDefault:!0})}),Qi.mount(vn,mn);class bn{initSortable(t){const e=t.el.querySelector("[data-sortable]");e&&new Qi(e,{handle:".handle-sort",draggable:"tr",sort:!0,direction:"vertical",async onEnd({item:e}){var i,n,r,s,o,a;const l=e.getAttribute("data-id");if(l){const c=null!==(n=null===(i=e.previousElementSibling)||void 0===i?void 0:i.getAttribute("data-id"))&&void 0!==n?n:null,d=null!==(s=null===(r=e.nextElementSibling)||void 0===r?void 0:r.getAttribute("data-id"))&&void 0!==s?s:null,u=t.el.querySelector("tbody");if(u){let e=null!==(o=u.getAttribute("data-sortable-parent-path"))&&void 0!==o?o:"";e.length&&(e=`${e}-`);const i=null!==(a=u.getAttribute("data-sortable-url"))&&void 0!==a?a:"?do=sort",n={[`${e}item_id`]:l,...c?{[`${e}prev_id`]:c}:{},...d?{[`${e}next_id`]:d}:{}};return await t.ajax.request({method:"GET",url:i,data:n})}}}})}initSortableTree(t){t.el.querySelectorAll(".datagrid-tree-item-children").forEach(t=>{new Qi(t,{handle:".handle-sort",draggable:".datagrid-tree-item:not(.datagrid-tree-header)",async onEnd({item:t}){}})})}}class yn{constructor(t,e={}){this.select=t,this.opts=e}initSelectpickers(t){var e,i,n;const r=null!==(n=null!==(e=this.select)&&void 0!==e?e:null===(i=w())||void 0===i?void 0:i.TomSelect)&&void 0!==n?n:null;r&&t.forEach(t=>{t.hasAttribute("data-Tom-Initialised")||(t.setAttribute("data-Tom-Initialised","true"),new r(t,"function"==typeof this.opts?this.opts(t):this.opts))})}}function _n(t){return t[t.length-1]}function wn(t,...e){return e.forEach(e=>{t.includes(e)||t.push(e)}),t}function En(t,e){return t?t.split(e):[]}function An(t,e,i){return(void 0===e||t>=e)&&(void 0===i||t<=i)}function Sn(t,e,i){return t<e?e:t>i?i:t}function kn(t,e,i={},n=0,r=""){r+=`<${Object.keys(i).reduce((t,e)=>{let r=i[e];return"function"==typeof r&&(r=r(n)),`${t} ${e}="${r}"`},t)}></${t}>`;const s=n+1;return s<e?kn(t,e,i,s,r):r}function Cn(t){return t.replace(/>\s+/g,">").replace(/\s+</,"<")}function On(t){return new Date(t).setHours(0,0,0,0)}function Dn(){return(new Date).setHours(0,0,0,0)}function xn(...t){switch(t.length){case 0:return Dn();case 1:return On(t[0])}const e=new Date(0);return e.setFullYear(...t),e.setHours(0,0,0,0)}function Tn(t,e){const i=new Date(t);return i.setDate(i.getDate()+e)}function Ln(t,e){const i=new Date(t),n=i.getMonth()+e;let r=n%12;r<0&&(r+=12);const s=i.setMonth(n);return i.getMonth()!==r?i.setDate(0):s}function In(t,e){const i=new Date(t),n=i.getMonth(),r=i.setFullYear(i.getFullYear()+e);return 1===n&&2===i.getMonth()?i.setDate(0):r}function Mn(t,e){return(t-e+7)%7}function Fn(t,e,i=0){const n=new Date(t).getDay();return Tn(t,Mn(e,i)-Mn(n,i))}function Nn(t,e){return Math.round((t-e)/6048e5)+1}function jn(t){const e=Fn(t,4,1);return Nn(e,Fn(new Date(e).setMonth(0,4),4,1))}function Pn(t,e){const i=Fn(new Date(t).setMonth(0,1),e,e),n=Fn(t,e,e),r=Nn(n,i);if(r<53)return r;return n===Fn(new Date(t).setDate(32),e,e)?1:r}function $n(t){return Pn(t,0)}function Hn(t){return Pn(t,6)}function qn(t,e){const i=new Date(t).getFullYear();return Math.floor(i/e)*e}function Rn(t,e,i){if(1!==e&&2!==e)return t;const n=new Date(t);return 1===e?i?n.setMonth(n.getMonth()+1,0):n.setDate(1):i?n.setFullYear(n.getFullYear()+1,0,0):n.setMonth(0,1),n.setHours(0,0,0,0)}const Bn=/dd?|DD?|mm?|MM?|yy?(?:yy)?/,Vn=/[\s!-/:-@[-`{-~年月日]+/;let zn={};const Wn={y:(t,e)=>new Date(t).setFullYear(parseInt(e,10)),m(t,e,i){const n=new Date(t);let r=parseInt(e,10)-1;if(isNaN(r)){if(!e)return NaN;const t=e.toLowerCase(),n=e=>e.toLowerCase().startsWith(t);if(r=i.monthsShort.findIndex(n),r<0&&(r=i.months.findIndex(n)),r<0)return NaN}return n.setMonth(r),n.getMonth()!==Kn(r)?n.setDate(0):n.getTime()},d:(t,e)=>new Date(t).setDate(parseInt(e,10))},Yn={d:t=>t.getDate(),dd:t=>Un(t.getDate(),2),D:(t,e)=>e.daysShort[t.getDay()],DD:(t,e)=>e.days[t.getDay()],m:t=>t.getMonth()+1,mm:t=>Un(t.getMonth()+1,2),M:(t,e)=>e.monthsShort[t.getMonth()],MM:(t,e)=>e.months[t.getMonth()],y:t=>t.getFullYear(),yy:t=>Un(t.getFullYear(),2).slice(-2),yyyy:t=>Un(t.getFullYear(),4)};function Kn(t){return t>-1?t%12:Kn(t+12)}function Un(t,e){return t.toString().padStart(e,"0")}function Xn(t){if("string"!=typeof t)throw new Error("Invalid date format.");if(t in zn)return zn[t];const e=t.split(Bn),i=t.match(new RegExp(Bn,"g"));if(0===e.length||!i)throw new Error("Invalid date format.");const n=i.map(t=>Yn[t]),r=Object.keys(Wn).reduce((t,e)=>(i.find(t=>"D"!==t[0]&&t[0].toLowerCase()===e)&&t.push(e),t),[]);return zn[t]={parser(t,e){const n=t.split(Vn).reduce((t,e,n)=>{if(e.length>0&&i[n]){const r=i[n][0];"M"===r?t.m=e:"D"!==r&&(t[r]=e)}return t},{});return r.reduce((t,i)=>{const r=Wn[i](t,n[i],e);return isNaN(r)?t:r},Dn())},formatter(t,i){let r=n.reduce((n,r,s)=>n+`${e[s]}${r(t,i)}`,"");return r+_n(e)}}}function Qn(t,e,i){if(t instanceof Date||"number"==typeof t){const e=On(t);return isNaN(e)?void 0:e}if(t){if("today"===t)return Dn();if(e&&e.toValue){const n=e.toValue(t,e,i);return isNaN(n)?void 0:On(n)}return Xn(e).parser(t,i)}}function Gn(t,e,i){if(isNaN(t)||!t&&0!==t)return"";const n="number"==typeof t?new Date(t):t;return e.toDisplay?e.toDisplay(n,e,i):Xn(e).formatter(n,i)}const Jn=document.createRange();function Zn(t){return Jn.createContextualFragment(t)}function tr(t){return t.parentElement||(t.parentNode instanceof ShadowRoot?t.parentNode.host:void 0)}function er(t){return t.getRootNode().activeElement===t}function ir(t){"none"!==t.style.display&&(t.style.display&&(t.dataset.styleDisplay=t.style.display),t.style.display="none")}function nr(t){"none"===t.style.display&&(t.dataset.styleDisplay?(t.style.display=t.dataset.styleDisplay,delete t.dataset.styleDisplay):t.style.display="")}function rr(t){t.firstChild&&(t.removeChild(t.firstChild),rr(t))}const sr=new WeakMap,{addEventListener:or,removeEventListener:ar}=EventTarget.prototype;function lr(t,e){let i=sr.get(t);i||(i=[],sr.set(t,i)),e.forEach(t=>{or.call(...t),i.push(t)})}if(!Event.prototype.composedPath){const t=(e,i=[])=>{let n;return i.push(e),e.parentNode?n=e.parentNode:e.host?n=e.host:e.defaultView&&(n=e.defaultView),n?t(n,i):i};Event.prototype.composedPath=function(){return t(this.target)}}function cr(t,e,i){const[n,...r]=t;return e(n)?n:n!==i&&"HTML"!==n.tagName&&0!==r.length?cr(r,e,i):void 0}function dr(t,e){const i="function"==typeof e?e:t=>t instanceof Element&&t.matches(e);return cr(t.composedPath(),i,t.currentTarget)}var ur={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear",titleFormat:"MM y"}},hr={autohide:!1,beforeShowDay:null,beforeShowDecade:null,beforeShowMonth:null,beforeShowYear:null,clearButton:!1,dateDelimiter:",",datesDisabled:[],daysOfWeekDisabled:[],daysOfWeekHighlighted:[],defaultViewDate:void 0,disableTouchKeyboard:!1,enableOnReadonly:!0,format:"mm/dd/yyyy",language:"en",maxDate:null,maxNumberOfDates:1,maxView:3,minDate:null,nextArrow:"»",orientation:"auto",pickLevel:0,prevArrow:"«",showDaysOfWeek:!0,showOnClick:!0,showOnFocus:!0,startView:0,title:"",todayButton:!1,todayButtonMode:0,todayHighlight:!1,updateOnBlur:!0,weekNumbers:0,weekStart:0};const{language:pr,format:fr,weekStart:gr}=hr;function mr(t,e){return t.length<6&&e>=0&&e<7?wn(t,e):t}function vr(t,e){switch(4===t?6===e?3:!e+1:t){case 1:return jn;case 2:return $n;case 3:return Hn}}function br(t,e,i){return e.weekStart=t,e.weekEnd=(t+6)%7,4===i&&(e.getWeekNumber=vr(4,t)),t}function yr(t,e,i,n){const r=Qn(t,e,i);return void 0!==r?r:n}function _r(t,e,i=3){const n=parseInt(t,10);return n>=0&&n<=i?n:e}function wr(t,e,i,n=void 0){e in t&&(i in t||(t[i]=n?n(t[e]):t[e]),delete t[e])}function Er(t,e){const i=Object.assign({},t),n={},r=e.constructor.locales,s=!!e.rangeSideIndex;let{datesDisabled:o,format:a,language:l,locale:c,maxDate:d,maxView:u,minDate:h,pickLevel:p,startView:f,weekNumbers:g,weekStart:m}=e.config||{};if(wr(i,"calendarWeeks","weekNumbers",t=>t?1:0),wr(i,"clearBtn","clearButton"),wr(i,"todayBtn","todayButton"),wr(i,"todayBtnMode","todayButtonMode"),i.language){let t;if(i.language!==l&&(r[i.language]?t=i.language:(t=i.language.split("-")[0],r[t]||(t=!1))),delete i.language,t){l=n.language=t;const e=c||r[pr];c=Object.assign({format:fr,weekStart:gr},r[pr]),l!==pr&&Object.assign(c,r[l]),n.locale=c,a===e.format&&(a=n.format=c.format),m===e.weekStart&&(m=br(c.weekStart,n,g))}}if(i.format){const t="function"==typeof i.format.toDisplay,e="function"==typeof i.format.toValue,r=Bn.test(i.format);(t&&e||r)&&(a=n.format=i.format),delete i.format}let v=p;"pickLevel"in i&&(v=_r(i.pickLevel,p,2),delete i.pickLevel),v!==p&&(v>p&&("minDate"in i||(i.minDate=h),"maxDate"in i||(i.maxDate=d)),o&&!i.datesDisabled&&(i.datesDisabled=[]),p=n.pickLevel=v);let b=h,y=d;if("minDate"in i){const t=xn(0,0,1);b=null===i.minDate?t:yr(i.minDate,a,c,b),b!==t&&(b=Rn(b,p,!1)),delete i.minDate}if("maxDate"in i&&(y=null===i.maxDate?void 0:yr(i.maxDate,a,c,y),void 0!==y&&(y=Rn(y,p,!0)),delete i.maxDate),y<b?(h=n.minDate=y,d=n.maxDate=b):(h!==b&&(h=n.minDate=b),d!==y&&(d=n.maxDate=y)),i.datesDisabled){const t=i.datesDisabled;if("function"==typeof t)n.datesDisabled=null,n.checkDisabled=(e,i)=>t(new Date(e),i,s);else{const e=n.datesDisabled=t.reduce((t,e)=>{const i=Qn(e,a,c);return void 0!==i?wn(t,Rn(i,p,s)):t},[]);n.checkDisabled=t=>e.includes(t)}delete i.datesDisabled}if("defaultViewDate"in i){const t=Qn(i.defaultViewDate,a,c);void 0!==t&&(n.defaultViewDate=t),delete i.defaultViewDate}if("weekStart"in i){const t=Number(i.weekStart)%7;isNaN(t)||(m=br(t,n,g)),delete i.weekStart}if(i.daysOfWeekDisabled&&(n.daysOfWeekDisabled=i.daysOfWeekDisabled.reduce(mr,[]),delete i.daysOfWeekDisabled),i.daysOfWeekHighlighted&&(n.daysOfWeekHighlighted=i.daysOfWeekHighlighted.reduce(mr,[]),delete i.daysOfWeekHighlighted),"weekNumbers"in i){let t=i.weekNumbers;if(t){const e="function"==typeof t?(e,i)=>t(new Date(e),i):vr(t=parseInt(t,10),m);e&&(g=n.weekNumbers=t,n.getWeekNumber=e)}else g=n.weekNumbers=0,n.getWeekNumber=null;delete i.weekNumbers}if("maxNumberOfDates"in i){const t=parseInt(i.maxNumberOfDates,10);t>=0&&(n.maxNumberOfDates=t,n.multidate=1!==t),delete i.maxNumberOfDates}i.dateDelimiter&&(n.dateDelimiter=String(i.dateDelimiter),delete i.dateDelimiter);let _=u;"maxView"in i&&(_=_r(i.maxView,u),delete i.maxView),_=p>_?p:_,_!==u&&(u=n.maxView=_);let w=f;if("startView"in i&&(w=_r(i.startView,w),delete i.startView),w<p?w=p:w>u&&(w=u),w!==f&&(n.startView=w),i.prevArrow){const t=Zn(i.prevArrow);t.childNodes.length>0&&(n.prevArrow=t.childNodes),delete i.prevArrow}if(i.nextArrow){const t=Zn(i.nextArrow);t.childNodes.length>0&&(n.nextArrow=t.childNodes),delete i.nextArrow}if("disableTouchKeyboard"in i&&(n.disableTouchKeyboard="ontouchstart"in document&&!!i.disableTouchKeyboard,delete i.disableTouchKeyboard),i.orientation){const t=i.orientation.toLowerCase().split(/\s+/g);n.orientation={x:t.find(t=>"left"===t||"right"===t)||"auto",y:t.find(t=>"top"===t||"bottom"===t)||"auto"},delete i.orientation}if("todayButtonMode"in i){switch(i.todayButtonMode){case 0:case 1:n.todayButtonMode=i.todayButtonMode}delete i.todayButtonMode}return Object.entries(i).forEach(([t,e])=>{void 0!==e&&t in hr&&(n[t]=e)}),n}const Ar={show:{key:"ArrowDown"},hide:null,toggle:{key:"Escape"},prevButton:{key:"ArrowLeft",ctrlOrMetaKey:!0},nextButton:{key:"ArrowRight",ctrlOrMetaKey:!0},viewSwitch:{key:"ArrowUp",ctrlOrMetaKey:!0},clearButton:{key:"Backspace",ctrlOrMetaKey:!0},todayButton:{key:".",ctrlOrMetaKey:!0},exitEditMode:{key:"ArrowDown",ctrlOrMetaKey:!0}};const Sr=t=>t.map(t=>`<button type="button" class="%buttonClass% ${t}" tabindex="-1"></button>`).join("");var kr=Cn(`<div class="datepicker">\n <div class="datepicker-picker">\n <div class="datepicker-header">\n <div class="datepicker-title"></div>\n <div class="datepicker-controls">\n ${Sr(["prev-button prev-btn","view-switch","next-button next-btn"])}\n </div>\n </div>\n <div class="datepicker-main"></div>\n <div class="datepicker-footer">\n <div class="datepicker-controls">\n ${Sr(["today-button today-btn","clear-button clear-btn"])}\n </div>\n </div>\n </div>\n</div>`),Cr=Cn(`<div class="days">\n <div class="days-of-week">${kn("span",7,{class:"dow"})}</div>\n <div class="datepicker-grid">${kn("span",42)}</div>\n</div>`),Or=Cn(`<div class="week-numbers calendar-weeks">\n <div class="days-of-week"><span class="dow"></span></div>\n <div class="weeks">${kn("span",6,{class:"week"})}</div>\n</div>`);class Dr{constructor(t,e){Object.assign(this,e,{picker:t,element:Zn('<div class="datepicker-view"></div>').firstChild,selected:[],isRangeEnd:!!t.datepicker.rangeSideIndex}),this.init(this.picker.datepicker.config)}init(t){"pickLevel"in t&&(this.isMinView=this.id===t.pickLevel),this.setOptions(t),this.updateFocus(),this.updateSelection()}prepareForRender(t,e,i){this.disabled=[];const n=this.picker;n.setViewSwitchLabel(t),n.setPrevButtonDisabled(e),n.setNextButtonDisabled(i)}setDisabled(t,e){e.add("disabled"),wn(this.disabled,t)}performBeforeHook(t,e){let i=this.beforeShow(new Date(e));switch(typeof i){case"boolean":i={enabled:i};break;case"string":i={classes:i}}if(i){const n=t.classList;if(!1===i.enabled&&this.setDisabled(e,n),i.classes){const t=i.classes.split(/\s+/);n.add(...t),t.includes("disabled")&&this.setDisabled(e,n)}i.content&&function(t,e){rr(t),e instanceof DocumentFragment?t.appendChild(e):"string"==typeof e?t.appendChild(Zn(e)):"function"==typeof e.forEach&&e.forEach(e=>{t.appendChild(e)})}(t,i.content)}}renderCell(t,e,i,n,{selected:r,range:s},o,a=[]){t.textContent=e,this.isMinView&&(t.dataset.date=n);const l=t.classList;if(t.className=`datepicker-cell ${this.cellClass}`,i<this.first?l.add("prev"):i>this.last&&l.add("next"),l.add(...a),(o||this.checkDisabled(n,this.id))&&this.setDisabled(n,l),s){const[t,e]=s;i>t&&i<e&&l.add("range"),i===t&&l.add("range-start"),i===e&&l.add("range-end")}r.includes(i)&&l.add("selected"),i===this.focused&&l.add("focused"),this.beforeShow&&this.performBeforeHook(t,n)}refreshCell(t,e,i,[n,r]){const s=t.classList;s.remove("range","range-start","range-end","selected","focused"),e>n&&e<r&&s.add("range"),e===n&&s.add("range-start"),e===r&&s.add("range-end"),i.includes(e)&&s.add("selected"),e===this.focused&&s.add("focused")}changeFocusedCell(t){this.grid.querySelectorAll(".focused").forEach(t=>{t.classList.remove("focused")}),this.grid.children[t].classList.add("focused")}}class xr extends Dr{constructor(t){super(t,{id:0,name:"days",cellClass:"day"})}init(t,e=!0){if(e){const t=Zn(Cr).firstChild;this.dow=t.firstChild,this.grid=t.lastChild,this.element.appendChild(t)}super.init(t)}setOptions(t){let e;if("minDate"in t&&(this.minDate=t.minDate),"maxDate"in t&&(this.maxDate=t.maxDate),t.checkDisabled&&(this.checkDisabled=t.checkDisabled),t.daysOfWeekDisabled&&(this.daysOfWeekDisabled=t.daysOfWeekDisabled,e=!0),t.daysOfWeekHighlighted&&(this.daysOfWeekHighlighted=t.daysOfWeekHighlighted),"todayHighlight"in t&&(this.todayHighlight=t.todayHighlight),"weekStart"in t&&(this.weekStart=t.weekStart,this.weekEnd=t.weekEnd,e=!0),t.locale){const i=this.locale=t.locale;this.dayNames=i.daysMin,this.switchLabelFormat=i.titleFormat,e=!0}if("beforeShowDay"in t&&(this.beforeShow="function"==typeof t.beforeShowDay?t.beforeShowDay:void 0),"weekNumbers"in t)if(t.weekNumbers&&!this.weekNumbers){const t=Zn(Or).firstChild;this.weekNumbers={element:t,dow:t.firstChild,weeks:t.lastChild},this.element.insertBefore(t,this.element.firstChild)}else this.weekNumbers&&!t.weekNumbers&&(this.element.removeChild(this.weekNumbers.element),this.weekNumbers=null);"getWeekNumber"in t&&(this.getWeekNumber=t.getWeekNumber),"showDaysOfWeek"in t&&(t.showDaysOfWeek?(nr(this.dow),this.weekNumbers&&nr(this.weekNumbers.dow)):(ir(this.dow),this.weekNumbers&&ir(this.weekNumbers.dow))),e&&Array.from(this.dow.children).forEach((t,e)=>{const i=(this.weekStart+e)%7;t.textContent=this.dayNames[i],t.className=this.daysOfWeekDisabled.includes(i)?"dow disabled":"dow"})}updateFocus(){const t=new Date(this.picker.viewDate),e=t.getFullYear(),i=t.getMonth(),n=xn(e,i,1),r=Fn(n,this.weekStart,this.weekStart);this.first=n,this.last=xn(e,i+1,0),this.start=r,this.focused=this.picker.viewDate}updateSelection(){const{dates:t,rangepicker:e}=this.picker.datepicker;this.selected=t,e&&(this.range=e.dates)}render(){if(this.today=this.todayHighlight?Dn():void 0,this.prepareForRender(Gn(this.focused,this.switchLabelFormat,this.locale),this.first<=this.minDate,this.last>=this.maxDate),this.weekNumbers){const t=this.weekStart,e=Fn(this.first,t,t);Array.from(this.weekNumbers.weeks.children).forEach((i,n)=>{const r=Tn(e,7*n);i.textContent=this.getWeekNumber(r,t),n>3&&i.classList[r>this.last?"add":"remove"]("next")})}Array.from(this.grid.children).forEach((t,e)=>{const i=Tn(this.start,e),n=new Date(i),r=n.getDay(),s=[];this.today===i&&s.push("today"),this.daysOfWeekHighlighted.includes(r)&&s.push("highlighted"),this.renderCell(t,n.getDate(),i,i,this,i<this.minDate||i>this.maxDate||this.daysOfWeekDisabled.includes(r),s)})}refresh(){const t=this.range||[];Array.from(this.grid.children).forEach(e=>{this.refreshCell(e,Number(e.dataset.date),this.selected,t)})}refreshFocus(){this.changeFocusedCell(Math.round((this.focused-this.start)/864e5))}}function Tr(t,e){if(!t||!t[0]||!t[1])return;const[[i,n],[r,s]]=t;return i>e||r<e?void 0:[i===e?n:-1,r===e?s:12]}class Lr extends Dr{constructor(t){super(t,{id:1,name:"months",cellClass:"month"})}init(t,e=!0){e&&(this.grid=this.element,this.element.classList.add("months","datepicker-grid"),this.grid.appendChild(Zn(kn("span",12,{"data-month":t=>t}))),this.first=0,this.last=11),super.init(t)}setOptions(t){if(t.locale&&(this.monthNames=t.locale.monthsShort),"minDate"in t)if(void 0===t.minDate)this.minYear=this.minMonth=this.minDate=void 0;else{const e=new Date(t.minDate);this.minYear=e.getFullYear(),this.minMonth=e.getMonth(),this.minDate=e.setDate(1)}if("maxDate"in t)if(void 0===t.maxDate)this.maxYear=this.maxMonth=this.maxDate=void 0;else{const e=new Date(t.maxDate);this.maxYear=e.getFullYear(),this.maxMonth=e.getMonth(),this.maxDate=xn(this.maxYear,this.maxMonth+1,0)}t.checkDisabled&&(this.checkDisabled=this.isMinView||null===t.datesDisabled?t.checkDisabled:()=>!1),"beforeShowMonth"in t&&(this.beforeShow="function"==typeof t.beforeShowMonth?t.beforeShowMonth:void 0)}updateFocus(){const t=new Date(this.picker.viewDate);this.year=t.getFullYear(),this.focused=t.getMonth()}updateSelection(){const{dates:t,rangepicker:e}=this.picker.datepicker;this.selected=t.reduce((t,e)=>{const i=new Date(e),n=i.getFullYear(),r=i.getMonth();return void 0===t[n]?t[n]=[r]:wn(t[n],r),t},{}),e&&e.dates&&(this.range=e.dates.map(t=>{const e=new Date(t);return isNaN(e)?void 0:[e.getFullYear(),e.getMonth()]}))}render(){this.prepareForRender(this.year,this.year<=this.minYear,this.year>=this.maxYear);const t=this.selected[this.year]||[],e=this.year<this.minYear||this.year>this.maxYear,i=this.year===this.minYear,n=this.year===this.maxYear,r=Tr(this.range,this.year);Array.from(this.grid.children).forEach((s,o)=>{const a=Rn(new Date(this.year,o,1),1,this.isRangeEnd);this.renderCell(s,this.monthNames[o],o,a,{selected:t,range:r},e||i&&o<this.minMonth||n&&o>this.maxMonth)})}refresh(){const t=this.selected[this.year]||[],e=Tr(this.range,this.year)||[];Array.from(this.grid.children).forEach((i,n)=>{this.refreshCell(i,n,t,e)})}refreshFocus(){this.changeFocusedCell(this.focused)}}class Ir extends Dr{constructor(t,e){super(t,e)}init(t,e=!0){var i;e&&(this.navStep=10*this.step,this.beforeShowOption=`beforeShow${i=this.cellClass,[...i].reduce((t,e,i)=>t+(i?e:e.toUpperCase()),"")}`,this.grid=this.element,this.element.classList.add(this.name,"datepicker-grid"),this.grid.appendChild(Zn(kn("span",12)))),super.init(t)}setOptions(t){if("minDate"in t&&(void 0===t.minDate?this.minYear=this.minDate=void 0:(this.minYear=qn(t.minDate,this.step),this.minDate=xn(this.minYear,0,1))),"maxDate"in t&&(void 0===t.maxDate?this.maxYear=this.maxDate=void 0:(this.maxYear=qn(t.maxDate,this.step),this.maxDate=xn(this.maxYear,11,31))),t.checkDisabled&&(this.checkDisabled=this.isMinView||null===t.datesDisabled?t.checkDisabled:()=>!1),this.beforeShowOption in t){const e=t[this.beforeShowOption];this.beforeShow="function"==typeof e?e:void 0}}updateFocus(){const t=new Date(this.picker.viewDate),e=qn(t,this.navStep),i=e+9*this.step;this.first=e,this.last=i,this.start=e-this.step,this.focused=qn(t,this.step)}updateSelection(){const{dates:t,rangepicker:e}=this.picker.datepicker;this.selected=t.reduce((t,e)=>wn(t,qn(e,this.step)),[]),e&&e.dates&&(this.range=e.dates.map(t=>{if(void 0!==t)return qn(t,this.step)}))}render(){this.prepareForRender(`${this.first}-${this.last}`,this.first<=this.minYear,this.last>=this.maxYear),Array.from(this.grid.children).forEach((t,e)=>{const i=this.start+e*this.step,n=Rn(new Date(i,0,1),2,this.isRangeEnd);t.dataset.year=i,this.renderCell(t,i,i,n,this,i<this.minYear||i>this.maxYear)})}refresh(){const t=this.range||[];Array.from(this.grid.children).forEach(e=>{this.refreshCell(e,Number(e.textContent),this.selected,t)})}refreshFocus(){this.changeFocusedCell(Math.round((this.focused-this.start)/this.step))}}function Mr(t,e){const i={bubbles:!0,cancelable:!0,detail:{date:t.getDate(),viewDate:new Date(t.picker.viewDate),viewId:t.picker.currentView.id,datepicker:t}};t.element.dispatchEvent(new CustomEvent(e,i))}function Fr(t,e){const{config:i,picker:n}=t,{currentView:r,viewDate:s}=n;let o;switch(r.id){case 0:o=Ln(s,e);break;case 1:o=In(s,e);break;default:o=In(s,e*r.navStep)}o=Sn(o,i.minDate,i.maxDate),n.changeFocus(o).render()}function Nr(t){const e=t.picker.currentView.id;e!==t.config.maxView&&t.picker.changeView(e+1).render()}function jr(t){t.setDate({clear:!0})}function Pr(t){const e=Dn();1===t.config.todayButtonMode?t.setDate(e,{forceRefresh:!0,viewDate:e}):t.setFocusedDate(e,!0)}function $r(t){const e=()=>{t.config.updateOnBlur?t.update({revert:!0}):t.refresh("input"),t.hide()},i=t.element;er(i)?i.addEventListener("blur",e,{once:!0}):e()}function Hr(t,e){const i=t.picker,n=new Date(i.viewDate),r=i.currentView.id,s=1===r?Ln(n,e-n.getMonth()):In(n,e-n.getFullYear());i.changeFocus(s).changeView(r-1).render()}function qr(t){Nr(t)}function Rr(t){Fr(t,-1)}function Br(t){Fr(t,1)}function Vr(t,e){const i=dr(e,".datepicker-cell");if(!i||i.classList.contains("disabled"))return;const{id:n,isMinView:r}=t.picker.currentView,s=i.dataset;r?t.setDate(Number(s.date)):Hr(t,Number(1===n?s.month:s.year))}function zr(t){t.preventDefault()}const Wr=["left","top","right","bottom"].reduce((t,e)=>(t[e]=`datepicker-orient-${e}`,t),{}),Yr=t=>t?`${t}px`:t;function Kr(t,e){if("title"in e&&(e.title?(t.controls.title.textContent=e.title,nr(t.controls.title)):(t.controls.title.textContent="",ir(t.controls.title))),e.prevArrow){const i=t.controls.prevButton;rr(i),e.prevArrow.forEach(t=>{i.appendChild(t.cloneNode(!0))})}if(e.nextArrow){const i=t.controls.nextButton;rr(i),e.nextArrow.forEach(t=>{i.appendChild(t.cloneNode(!0))})}if(e.locale&&(t.controls.todayButton.textContent=e.locale.today,t.controls.clearButton.textContent=e.locale.clear),"todayButton"in e&&(e.todayButton?nr(t.controls.todayButton):ir(t.controls.todayButton)),"minDate"in e||"maxDate"in e){const{minDate:e,maxDate:i}=t.datepicker.config;t.controls.todayButton.disabled=!An(Dn(),e,i)}"clearButton"in e&&(e.clearButton?nr(t.controls.clearButton):ir(t.controls.clearButton))}function Ur(t){const{dates:e,config:i,rangeSideIndex:n}=t;return Sn(e.length>0?_n(e):Rn(i.defaultViewDate,i.pickLevel,n),i.minDate,i.maxDate)}function Xr(t,e){"_oldViewDate"in t||e===t.viewDate||(t._oldViewDate=t.viewDate),t.viewDate=e;const{id:i,year:n,first:r,last:s}=t.currentView,o=new Date(e).getFullYear();switch(i){case 0:return e<r||e>s;case 1:return o!==n;default:return o<r||o>s}}function Qr(t){return window.getComputedStyle(t).direction}function Gr(t){const e=tr(t);if(e!==document.body&&e)return"visible"!==window.getComputedStyle(e).overflow?e:Gr(e)}class Jr{constructor(t){const{config:e,inputField:i}=this.datepicker=t,n=kr.replace(/%buttonClass%/g,e.buttonClass),r=this.element=Zn(n).firstChild,[s,o,a]=r.firstChild.children,l=s.firstElementChild,[c,d,u]=s.lastElementChild.children,[h,p]=a.firstChild.children,f={title:l,prevButton:c,viewSwitch:d,nextButton:u,todayButton:h,clearButton:p};this.main=o,this.controls=f;const g=i?"dropdown":"inline";r.classList.add(`datepicker-${g}`),Kr(this,e),this.viewDate=Ur(t),lr(t,[[r,"mousedown",zr],[o,"click",Vr.bind(null,t)],[f.viewSwitch,"click",qr.bind(null,t)],[f.prevButton,"click",Rr.bind(null,t)],[f.nextButton,"click",Br.bind(null,t)],[f.todayButton,"click",Pr.bind(null,t)],[f.clearButton,"click",jr.bind(null,t)]]),this.views=[new xr(this),new Lr(this),new Ir(this,{id:2,name:"years",cellClass:"year",step:1}),new Ir(this,{id:3,name:"decades",cellClass:"decade",step:10})],this.currentView=this.views[e.startView],this.currentView.render(),this.main.appendChild(this.currentView.element),e.container?e.container.appendChild(this.element):i.after(this.element)}setOptions(t){Kr(this,t),this.views.forEach(e=>{e.init(t,!1)}),this.currentView.render()}detach(){this.element.remove()}show(){if(this.active)return;const{datepicker:t,element:e}=this,i=t.inputField;if(i){const n=Qr(i);n!==Qr(tr(e))?e.dir=n:e.dir&&e.removeAttribute("dir"),this.place(),e.classList.add("active"),t.config.disableTouchKeyboard&&i.blur()}else e.classList.add("active");this.active=!0,Mr(t,"show")}hide(){this.active&&(this.datepicker.exitEditMode(),this.element.classList.remove("active"),this.active=!1,Mr(this.datepicker,"hide"))}place(){const{classList:t,style:e}=this.element;e.display="block";const{width:i,height:n}=this.element.getBoundingClientRect(),r=this.element.offsetParent;e.display="";const{config:s,inputField:o}=this.datepicker,{left:a,top:l,right:c,bottom:d,width:u,height:h}=o.getBoundingClientRect();let{x:p,y:f}=s.orientation,g=a,m=l;if(r!==document.body&&r){const t=r.getBoundingClientRect();g-=t.left-r.scrollLeft,m-=t.top-r.scrollTop}else g+=window.scrollX,m+=window.scrollY;const v=Gr(o);let b=0,y=0,{clientWidth:_,clientHeight:w}=document.documentElement;if(v){const t=v.getBoundingClientRect();t.top>0&&(y=t.top),t.left>0&&(b=t.left),t.right<_&&(_=t.right),t.bottom<w&&(w=t.bottom)}let E=0;"auto"===p&&(a<b?(p="left",E=b-a):a+i>_?(p="right",_<c&&(E=_-c)):p="rtl"===Qr(o)?c-i<b?"left":"right":"left"),"right"===p&&(g+=u-i),g+=E,"auto"===f&&(f=l-n>y&&d+n>w?"top":"bottom"),"top"===f?m-=n:m+=h,t.remove(...Object.values(Wr)),t.add(Wr[p],Wr[f]),e.left=Yr(g),e.top=Yr(m)}setViewSwitchLabel(t){this.controls.viewSwitch.textContent=t}setPrevButtonDisabled(t){this.controls.prevButton.disabled=t}setNextButtonDisabled(t){this.controls.nextButton.disabled=t}changeView(t){const e=this.currentView;return t!==e.id&&(this._oldView||(this._oldView=e),this.currentView=this.views[t],this._renderMethod="render"),this}changeFocus(t){return this._renderMethod=Xr(this,t)?"render":"refreshFocus",this.views.forEach(t=>{t.updateFocus()}),this}update(t=void 0){const e=void 0===t?Ur(this.datepicker):t;return this._renderMethod=Xr(this,e)?"render":"refresh",this.views.forEach(t=>{t.updateFocus(),t.updateSelection()}),this}render(t=!0){const{currentView:e,datepicker:i,_oldView:n}=this,r=new Date(this._oldViewDate),s=t&&this._renderMethod||"render";if(delete this._oldView,delete this._oldViewDate,delete this._renderMethod,e[s](),n&&(this.main.replaceChild(e.element,n.element),Mr(i,"changeView")),!isNaN(r)){const t=new Date(this.viewDate);t.getFullYear()!==r.getFullYear()&&Mr(i,"changeYear"),t.getMonth()!==r.getMonth()&&Mr(i,"changeMonth")}}}function Zr(t,e,i,n,r,s){if(An(t,r,s)){if(n(t)){return Zr(e(t,i),e,i,n,r,s)}return t}}function ts(t,e,i){const n=t.picker,r=n.currentView,s=r.step||1;let o,a=n.viewDate;switch(r.id){case 0:a=Tn(a,i?7*e:e),o=Tn;break;case 1:a=Ln(a,i?4*e:e),o=Ln;break;default:a=In(a,e*(i?4:1)*s),o=In}a=Zr(a,o,e<0?-s:s,t=>r.disabled.includes(t),r.minDate,r.maxDate),void 0!==a&&n.changeFocus(a).render()}function es(t,e){const{config:i,picker:n,editMode:r}=t,s=n.active,{key:o,altKey:a,shiftKey:l}=e,c=e.ctrlKey||e.metaKey,d=()=>{e.preventDefault(),e.stopPropagation()};if("Tab"===o)return void $r(t);if("Enter"===o){if(s)if(r)t.exitEditMode({update:!0,autohide:i.autohide});else{const e=n.currentView;e.isMinView?t.setDate(n.viewDate):(n.changeView(e.id-1).render(),d())}else t.update();return}const u=i.shortcutKeys,h={key:o,ctrlOrMetaKey:c,altKey:a,shiftKey:l},p=Object.keys(u).find(t=>{const e=u[t];return!Object.keys(e).find(t=>e[t]!==h[t])});if(p){let e;if("toggle"===p?e=p:r?"exitEditMode"===p&&(e=p):s?"hide"===p?e=p:"prevButton"===p?e=[Fr,[t,-1]]:"nextButton"===p?e=[Fr,[t,1]]:"viewSwitch"===p?e=[Nr,[t]]:i.clearButton&&"clearButton"===p?e=[jr,[t]]:i.todayButton&&"todayButton"===p&&(e=[Pr,[t]]):"show"===p&&(e=p),e)return Array.isArray(e)?e[0].apply(null,e[1]):t[e](),void d()}if(!s||r)return;const f=(i,n)=>{l||c||a?t.enterEditMode():(ts(t,i,n),e.preventDefault())};"ArrowLeft"===o?f(-1,!1):"ArrowRight"===o?f(1,!1):"ArrowUp"===o?f(-1,!0):"ArrowDown"===o?f(1,!0):("Backspace"===o||"Delete"===o||o&&1===o.length&&!c)&&t.enterEditMode()}function is(t){t.config.showOnFocus&&!t._showing&&t.show()}function ns(t,e){const i=e.target;(t.picker.active||t.config.showOnClick)&&(i._active=er(i),i._clicking=setTimeout(()=>{delete i._active,delete i._clicking},2e3))}function rs(t,e){const i=e.target;i._clicking&&(clearTimeout(i._clicking),delete i._clicking,i._active&&t.enterEditMode(),delete i._active,t.config.showOnClick&&t.show())}function ss(t,e){e.clipboardData.types.includes("text/plain")&&t.enterEditMode()}function os(t,e){const{element:i,picker:n}=t;if(!n.active&&!er(i))return;const r=n.element;dr(e,t=>t===i||t===r)||$r(t)}function as(t,e){return t.map(t=>Gn(t,e.format,e.locale)).join(e.dateDelimiter)}function ls(t,e,i=!1){if(0===e.length)return i?[]:void 0;const{config:n,dates:r,rangeSideIndex:s}=t,{pickLevel:o,maxNumberOfDates:a}=n;let l=e.reduce((t,e)=>{let i=Qn(e,n.format,n.locale);return void 0===i||(i=Rn(i,o,s),!An(i,n.minDate,n.maxDate)||t.includes(i)||n.checkDisabled(i,o)||!(o>0)&&n.daysOfWeekDisabled.includes(new Date(i).getDay())||t.push(i)),t},[]);return 0!==l.length?(n.multidate&&!i&&(l=l.reduce((t,e)=>(r.includes(e)||t.push(e),t),r.filter(t=>!l.includes(t)))),a&&l.length>a?l.slice(-1*a):l):void 0}function cs(t,e=3,i=!0,n=void 0){const{config:r,picker:s,inputField:o}=t;if(2&e){const t=s.active?r.pickLevel:r.startView;s.update(n).changeView(t).render(i)}1&e&&o&&(o.value=as(t.dates,r))}function ds(t,e,i){const n=t.config;let{clear:r,render:s,autohide:o,revert:a,forceRefresh:l,viewDate:c}=i;void 0===s&&(s=!0),s?void 0===o&&(o=n.autohide):o=l=!1,c=Qn(c,n.format,n.locale);const d=ls(t,e,r);(d||a)&&(d&&d.toString()!==t.dates.toString()?(t.dates=d,cs(t,s?3:1,!0,c),Mr(t,"changeDate")):cs(t,l?3:1,!0,c),o&&t.hide())}function us(t,e){return e?i=>Gn(i,e,t.config.locale):t=>new Date(t)}class hs{constructor(t,e={},i=void 0){t.datepicker=this,this.element=t,this.dates=[];const n=this.config=Object.assign({buttonClass:e.buttonClass&&String(e.buttonClass)||"button",container:null,defaultViewDate:Dn(),maxDate:void 0,minDate:void 0},Er(hr,this));let r;if("INPUT"===t.tagName?(r=this.inputField=t,r.classList.add("datepicker-input"),e.container&&(n.container=e.container instanceof HTMLElement?e.container:document.querySelector(e.container))):n.container=t,i){const t=i.inputs.indexOf(r),e=i.datepickers;if(t<0||t>1||!Array.isArray(e))throw Error("Invalid rangepicker object.");e[t]=this,this.rangepicker=i,this.rangeSideIndex=t}this._options=e,Object.assign(n,Er(e,this)),n.shortcutKeys=function(t){return Object.keys(Ar).reduce((e,i)=>{const n=void 0===t[i]?Ar[i]:t[i],r=n&&n.key;if(!r||"string"!=typeof r)return e;const s={key:r,ctrlOrMetaKey:!!(n.ctrlOrMetaKey||n.ctrlKey||n.metaKey)};return r.length>1&&(s.altKey=!!n.altKey,s.shiftKey=!!n.shiftKey),e[i]=s,e},{})}(e.shortcutKeys||{});const s=En(t.value||t.dataset.date,n.dateDelimiter);delete t.dataset.date;const o=ls(this,s);o&&o.length>0&&(this.dates=o),r&&(r.value=as(this.dates,n));const a=this.picker=new Jr(this),l=[t,"keydown",es.bind(null,this)];r?lr(this,[l,[r,"focus",is.bind(null,this)],[r,"mousedown",ns.bind(null,this)],[r,"click",rs.bind(null,this)],[r,"paste",ss.bind(null,this)],[document,"mousedown",os.bind(null,this)],[window,"resize",a.place.bind(a)]]):(lr(this,[l]),this.show())}static formatDate(t,e,i){return Gn(t,e,i&&ur[i]||ur.en)}static parseDate(t,e,i){return Qn(t,e,i&&ur[i]||ur.en)}static get locales(){return ur}get active(){return!(!this.picker||!this.picker.active)}get pickerElement(){return this.picker?this.picker.element:void 0}setOptions(t){const e=Er(t,this);Object.assign(this._options,t),Object.assign(this.config,e),this.picker.setOptions(e),cs(this,3)}show(){if(this.inputField){const{config:t,inputField:e}=this;if(e.disabled||e.readOnly&&!t.enableOnReadonly)return;er(e)||t.disableTouchKeyboard||(this._showing=!0,e.focus(),delete this._showing)}this.picker.show()}hide(){this.inputField&&(this.picker.hide(),this.picker.update().changeView(this.config.startView).render())}toggle(){this.picker.active?this.inputField&&this.picker.hide():this.show()}destroy(){this.hide(),function(t){let e=sr.get(t);e&&(e.forEach(t=>{ar.call(...t)}),sr.delete(t))}(this),this.picker.detach();const t=this.element;return t.classList.remove("datepicker-input"),delete t.datepicker,this}getDate(t=void 0){const e=us(this,t);return this.config.multidate?this.dates.map(e):this.dates.length>0?e(this.dates[0]):void 0}setDate(...t){const e=[...t],i={},n=_n(t);!n||"object"!=typeof n||Array.isArray(n)||n instanceof Date||Object.assign(i,e.pop());ds(this,Array.isArray(e[0])?e[0]:e,i)}update(t=void 0){if(!this.inputField)return;const e=Object.assign(t||{},{clear:!0,render:!0,viewDate:void 0});ds(this,En(this.inputField.value,this.config.dateDelimiter),e)}getFocusedDate(t=void 0){return us(this,t)(this.picker.viewDate)}setFocusedDate(t,e=!1){const{config:i,picker:n,active:r,rangeSideIndex:s}=this,o=i.pickLevel,a=Qn(t,i.format,i.locale);void 0!==a&&(n.changeFocus(Rn(a,o,s)),r&&e&&n.changeView(o),n.render())}refresh(t=void 0,e=!1){let i;t&&"string"!=typeof t&&(e=t,t=void 0),i="picker"===t?2:"input"===t?1:3,cs(this,i,!e)}enterEditMode(){const t=this.inputField;t&&!t.readOnly&&this.picker.active&&!this.editMode&&(this.editMode=!0,t.classList.add("in-edit"))}exitEditMode(t=void 0){if(!this.inputField||!this.editMode)return;const e=Object.assign({update:!1},t);delete this.editMode,this.inputField.classList.remove("in-edit"),e.update&&this.update(e)}}class ps{constructor(t={}){this.opts=t}initDatepickers(t){t.forEach(t=>{const e="function"==typeof this.opts?this.opts(t):this.opts;new hs(t,{...e,updateOnBlur:!1}),t.addEventListener("changeDate",()=>{const e=t.closest("form");e&&e.submit()})})}}class fs extends EventTarget{constructor(t,e,i){super(),this.el=t,this.options={...fs.defaultOptions,...i};const n=this.resolveDatagridName();if(!n)throw new Error("Cannot resolve name of a datagrid!");this.name=n,this.ajax="function"==typeof e?e(this):e,this.ajax.addEventListener("success",t=>{var e,i;(null===(e=t.detail.payload)||void 0===e?void 0:e._datagrid_name)===this.name&&(null===(i=t.detail.payload)||void 0===i?void 0:i._datagrid_init)&&this.init()}),this.init()}init(){!this.dispatch("beforeInit",{datagrid:this})||this.options.plugins.forEach(t=>{var e;null===(e=t.onDatagridInit)||void 0===e||e.call(t,this)});const t=this.el.querySelectorAll("input[data-check]:checked");if(1===t.length&&"toggle-all"===t[0].getAttribute("name")){const e=t[0];e&&(e.checked=!1)}this.el.querySelectorAll("input[data-datagrid-manualsubmit]").forEach(t=>{const e=t.closest("form");e&&t.addEventListener("keydown",t=>{if(_(t))return t.stopPropagation(),t.preventDefault(),this.ajax.submitForm(e)})}),this.ajax.addEventListener("success",({detail:{payload:t}})=>{var e;if(t._datagrid_name&&t._datagrid_name===this.name){const i=t=>t.getAttribute("data-datagrid-reset-filter-by-column"),n=Array.from(this.el.querySelectorAll("[data-datagrid-reset-filter-by-column]")),r=t.non_empty_filters?t.non_empty_filters:[];if(n.forEach(t=>{const e=i(t);e&&r.includes(e)?t.classList.remove("hidden"):t.classList.add("hidden")}),r.length>0){const t=null===(e=this.el.querySelector(".reset-filter"))||void 0===e?void 0:e.getAttribute("href");t&&n.forEach(e=>{const n=i(e),r=t.replace("-resetFilter","-resetColumnFilter");e.setAttribute("href",`${r}&${this.name}-key=${n}`)})}}}),this.dispatch("afterInit",{datagrid:this})}confirm(t){return this.options.confirm.bind(this)(t)}resolveDatagridName(){return this.options.resolveDatagridName.bind(this)(this.el)}dispatch(t,e,i){return this.dispatchEvent(new CustomEvent(t,{detail:e}))}}fs.defaultOptions={confirm:confirm,resolveDatagridName:function(t){const e=t.getAttribute("data-datagrid-name");if(e)return e;console.warn("Deprecated name resolution for datagrid",t,": Please add a data-datagrid-name attribute instead!\nCurrently, the Datagrid library relies on matching the name from the 'datagrid-[name]' class, which is unreliable and may cause bugs if the default class names are not used (eg. if you add a datagrid-xx class, or change the name class completely!)\nAlternatively, you can customize the name resolution with the `resolveDatagridName` option. See TBD for more info.");const i=t.classList.value.split(" ");for(const t of i){if(!t.startsWith("datagrid-"))continue;const[,...e]=t.split("-"),i=e.join("-");return i.length<1?(console.error(`Failed to resolve datagrid name - ambigious class name '${t}'`),null):i}return null},plugins:[]};class gs{constructor(t,e={}){this.ajax=t,this.datagrids=[],this.options={selector:"div[data-datagrid-name]",datagrid:{},root:document.body,...e};const i="string"==typeof this.options.root?document.querySelector(this.options.root):this.options.root;if(!(i&&i instanceof HTMLElement))throw new Error("Root element not found or is not an HTMLElement");this.root=i,this.init()}init(){var t,e;this.ajax.onInit(),(null!==(e=null===(t=this.options.datagrid)||void 0===t?void 0:t.plugins)&&void 0!==e?e:[]).forEach(t=>{var e;return null===(e=t.onInit)||void 0===e?void 0:e.call(t,this)}),this.initDatagrids()}initDatagrids(){this.datagrids=Array.from(this.root.querySelectorAll(this.options.selector)).map(t=>new fs(t,this.ajax,this.options.datagrid))}}class ms extends EventTarget{constructor(t){if(!t.VERSION||t.VERSION<2)throw new Error("NajaAjax supports Naja 2 and higher"+(t.VERSION?`(version ${t.VERSION} provided)`:""));super(),this.client=t}onInit(){return this.client.addEventListener("before",t=>this.dispatch("before",{params:t.detail})),this.client.uiHandler.addEventListener("interaction",t=>{if(!(t.detail.element instanceof HTMLElement))throw new Error("Element is not an instanceof HTMLElement");const e=this.dispatch("interact",{...t.detail,element:t.detail.element});return e||(t.stopPropagation(),t.preventDefault()),e}),this.client.addEventListener("success",t=>this.dispatch("success",{...t.detail,params:t.detail.request,payload:t.detail.payload})),this.client.addEventListener("error",t=>this.dispatch("error",{...t.detail,params:t.detail.request,response:t.detail.response})),this.client.addEventListener("complete",t=>this.dispatch("complete",{...t.detail,params:t.detail.request,response:t.detail.response})),this}async request(t){return await this.client.makeRequest(t.method,t.url,t.data)}async submitForm(t){return await this.client.uiHandler.submitForm(t)}dispatch(t,e,i){return this.dispatchEvent(new CustomEvent(t,{detail:e,cancelable:!0}))}}var vs="top",bs="bottom",ys="right",_s="left",ws="auto",Es=[vs,bs,ys,_s],As="start",Ss="end",ks="clippingParents",Cs="viewport",Os="popper",Ds="reference",xs=Es.reduce(function(t,e){return t.concat([e+"-"+As,e+"-"+Ss])},[]),Ts=[].concat(Es,[ws]).reduce(function(t,e){return t.concat([e,e+"-"+As,e+"-"+Ss])},[]),Ls="beforeRead",Is="read",Ms="afterRead",Fs="beforeMain",Ns="main",js="afterMain",Ps="beforeWrite",$s="write",Hs="afterWrite",qs=[Ls,Is,Ms,Fs,Ns,js,Ps,$s,Hs];function Rs(t){return t?(t.nodeName||"").toLowerCase():null}function Bs(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Vs(t){return t instanceof Bs(t).Element||t instanceof Element}function zs(t){return t instanceof Bs(t).HTMLElement||t instanceof HTMLElement}function Ws(t){return"undefined"!=typeof ShadowRoot&&(t instanceof Bs(t).ShadowRoot||t instanceof ShadowRoot)}var Ys={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},n=e.attributes[t]||{},r=e.elements[t];zs(r)&&Rs(r)&&(Object.assign(r.style,i),Object.keys(n).forEach(function(t){var e=n[t];!1===e?r.removeAttribute(t):r.setAttribute(t,!0===e?"":e)}))})},effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach(function(t){var n=e.elements[t],r=e.attributes[t]||{},s=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:i[t]).reduce(function(t,e){return t[e]="",t},{});zs(n)&&Rs(n)&&(Object.assign(n.style,s),Object.keys(r).forEach(function(t){n.removeAttribute(t)}))})}},requires:["computeStyles"]};function Ks(t){return t.split("-")[0]}var Us=Math.max,Xs=Math.min,Qs=Math.round;function Gs(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Js(){return!/^((?!chrome|android).)*safari/i.test(Gs())}function Zs(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var n=t.getBoundingClientRect(),r=1,s=1;e&&zs(t)&&(r=t.offsetWidth>0&&Qs(n.width)/t.offsetWidth||1,s=t.offsetHeight>0&&Qs(n.height)/t.offsetHeight||1);var o=(Vs(t)?Bs(t):window).visualViewport,a=!Js()&&i,l=(n.left+(a&&o?o.offsetLeft:0))/r,c=(n.top+(a&&o?o.offsetTop:0))/s,d=n.width/r,u=n.height/s;return{width:d,height:u,top:c,right:l+d,bottom:c+u,left:l,x:l,y:c}}function to(t){var e=Zs(t),i=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:n}}function eo(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&Ws(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function io(t){return Bs(t).getComputedStyle(t)}function no(t){return["table","td","th"].indexOf(Rs(t))>=0}function ro(t){return((Vs(t)?t.ownerDocument:t.document)||window.document).documentElement}function so(t){return"html"===Rs(t)?t:t.assignedSlot||t.parentNode||(Ws(t)?t.host:null)||ro(t)}function oo(t){return zs(t)&&"fixed"!==io(t).position?t.offsetParent:null}function ao(t){for(var e=Bs(t),i=oo(t);i&&no(i)&&"static"===io(i).position;)i=oo(i);return i&&("html"===Rs(i)||"body"===Rs(i)&&"static"===io(i).position)?e:i||function(t){var e=/firefox/i.test(Gs());if(/Trident/i.test(Gs())&&zs(t)&&"fixed"===io(t).position)return null;var i=so(t);for(Ws(i)&&(i=i.host);zs(i)&&["html","body"].indexOf(Rs(i))<0;){var n=io(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||e&&"filter"===n.willChange||e&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}(t)||e}function lo(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function co(t,e,i){return Us(t,Xs(e,i))}function uo(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function ho(t,e){return e.reduce(function(e,i){return e[i]=t,e},{})}var po={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,i=t.state,n=t.name,r=t.options,s=i.elements.arrow,o=i.modifiersData.popperOffsets,a=Ks(i.placement),l=lo(a),c=[_s,ys].indexOf(a)>=0?"height":"width";if(s&&o){var d=function(t,e){return uo("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:ho(t,Es))}(r.padding,i),u=to(s),h="y"===l?vs:_s,p="y"===l?bs:ys,f=i.rects.reference[c]+i.rects.reference[l]-o[l]-i.rects.popper[c],g=o[l]-i.rects.reference[l],m=ao(s),v=m?"y"===l?m.clientHeight||0:m.clientWidth||0:0,b=f/2-g/2,y=d[h],_=v-u[c]-d[p],w=v/2-u[c]/2+b,E=co(y,w,_),A=l;i.modifiersData[n]=((e={})[A]=E,e.centerOffset=E-w,e)}},effect:function(t){var e=t.state,i=t.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=e.elements.popper.querySelector(n)))&&eo(e.elements.popper,n)&&(e.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function fo(t){return t.split("-")[1]}var go={top:"auto",right:"auto",bottom:"auto",left:"auto"};function mo(t){var e,i=t.popper,n=t.popperRect,r=t.placement,s=t.variation,o=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,d=t.roundOffsets,u=t.isFixed,h=o.x,p=void 0===h?0:h,f=o.y,g=void 0===f?0:f,m="function"==typeof d?d({x:p,y:g}):{x:p,y:g};p=m.x,g=m.y;var v=o.hasOwnProperty("x"),b=o.hasOwnProperty("y"),y=_s,_=vs,w=window;if(c){var E=ao(i),A="clientHeight",S="clientWidth";if(E===Bs(i)&&"static"!==io(E=ro(i)).position&&"absolute"===a&&(A="scrollHeight",S="scrollWidth"),r===vs||(r===_s||r===ys)&&s===Ss)_=bs,g-=(u&&E===w&&w.visualViewport?w.visualViewport.height:E[A])-n.height,g*=l?1:-1;if(r===_s||(r===vs||r===bs)&&s===Ss)y=ys,p-=(u&&E===w&&w.visualViewport?w.visualViewport.width:E[S])-n.width,p*=l?1:-1}var k,C=Object.assign({position:a},c&&go),O=!0===d?function(t,e){var i=t.x,n=t.y,r=e.devicePixelRatio||1;return{x:Qs(i*r)/r||0,y:Qs(n*r)/r||0}}({x:p,y:g},Bs(i)):{x:p,y:g};return p=O.x,g=O.y,l?Object.assign({},C,((k={})[_]=b?"0":"",k[y]=v?"0":"",k.transform=(w.devicePixelRatio||1)<=1?"translate("+p+"px, "+g+"px)":"translate3d("+p+"px, "+g+"px, 0)",k)):Object.assign({},C,((e={})[_]=b?g+"px":"",e[y]=v?p+"px":"",e.transform="",e))}var vo={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,i=t.options,n=i.gpuAcceleration,r=void 0===n||n,s=i.adaptive,o=void 0===s||s,a=i.roundOffsets,l=void 0===a||a,c={placement:Ks(e.placement),variation:fo(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,mo(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,mo(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},bo={passive:!0};var yo={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,i=t.instance,n=t.options,r=n.scroll,s=void 0===r||r,o=n.resize,a=void 0===o||o,l=Bs(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach(function(t){t.addEventListener("scroll",i.update,bo)}),a&&l.addEventListener("resize",i.update,bo),function(){s&&c.forEach(function(t){t.removeEventListener("scroll",i.update,bo)}),a&&l.removeEventListener("resize",i.update,bo)}},data:{}},_o={left:"right",right:"left",bottom:"top",top:"bottom"};function wo(t){return t.replace(/left|right|bottom|top/g,function(t){return _o[t]})}var Eo={start:"end",end:"start"};function Ao(t){return t.replace(/start|end/g,function(t){return Eo[t]})}function So(t){var e=Bs(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ko(t){return Zs(ro(t)).left+So(t).scrollLeft}function Co(t){var e=io(t),i=e.overflow,n=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+r+n)}function Oo(t){return["html","body","#document"].indexOf(Rs(t))>=0?t.ownerDocument.body:zs(t)&&Co(t)?t:Oo(so(t))}function Do(t,e){var i;void 0===e&&(e=[]);var n=Oo(t),r=n===(null==(i=t.ownerDocument)?void 0:i.body),s=Bs(n),o=r?[s].concat(s.visualViewport||[],Co(n)?n:[]):n,a=e.concat(o);return r?a:a.concat(Do(so(o)))}function xo(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function To(t,e,i){return e===Cs?xo(function(t,e){var i=Bs(t),n=ro(t),r=i.visualViewport,s=n.clientWidth,o=n.clientHeight,a=0,l=0;if(r){s=r.width,o=r.height;var c=Js();(c||!c&&"fixed"===e)&&(a=r.offsetLeft,l=r.offsetTop)}return{width:s,height:o,x:a+ko(t),y:l}}(t,i)):Vs(e)?function(t,e){var i=Zs(t,!1,"fixed"===e);return i.top=i.top+t.clientTop,i.left=i.left+t.clientLeft,i.bottom=i.top+t.clientHeight,i.right=i.left+t.clientWidth,i.width=t.clientWidth,i.height=t.clientHeight,i.x=i.left,i.y=i.top,i}(e,i):xo(function(t){var e,i=ro(t),n=So(t),r=null==(e=t.ownerDocument)?void 0:e.body,s=Us(i.scrollWidth,i.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),o=Us(i.scrollHeight,i.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-n.scrollLeft+ko(t),l=-n.scrollTop;return"rtl"===io(r||i).direction&&(a+=Us(i.clientWidth,r?r.clientWidth:0)-s),{width:s,height:o,x:a,y:l}}(ro(t)))}function Lo(t,e,i,n){var r="clippingParents"===e?function(t){var e=Do(so(t)),i=["absolute","fixed"].indexOf(io(t).position)>=0&&zs(t)?ao(t):t;return Vs(i)?e.filter(function(t){return Vs(t)&&eo(t,i)&&"body"!==Rs(t)}):[]}(t):[].concat(e),s=[].concat(r,[i]),o=s[0],a=s.reduce(function(e,i){var r=To(t,i,n);return e.top=Us(r.top,e.top),e.right=Xs(r.right,e.right),e.bottom=Xs(r.bottom,e.bottom),e.left=Us(r.left,e.left),e},To(t,o,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Io(t){var e,i=t.reference,n=t.element,r=t.placement,s=r?Ks(r):null,o=r?fo(r):null,a=i.x+i.width/2-n.width/2,l=i.y+i.height/2-n.height/2;switch(s){case vs:e={x:a,y:i.y-n.height};break;case bs:e={x:a,y:i.y+i.height};break;case ys:e={x:i.x+i.width,y:l};break;case _s:e={x:i.x-n.width,y:l};break;default:e={x:i.x,y:i.y}}var c=s?lo(s):null;if(null!=c){var d="y"===c?"height":"width";switch(o){case As:e[c]=e[c]-(i[d]/2-n[d]/2);break;case Ss:e[c]=e[c]+(i[d]/2-n[d]/2)}}return e}function Mo(t,e){void 0===e&&(e={});var i=e,n=i.placement,r=void 0===n?t.placement:n,s=i.strategy,o=void 0===s?t.strategy:s,a=i.boundary,l=void 0===a?ks:a,c=i.rootBoundary,d=void 0===c?Cs:c,u=i.elementContext,h=void 0===u?Os:u,p=i.altBoundary,f=void 0!==p&&p,g=i.padding,m=void 0===g?0:g,v=uo("number"!=typeof m?m:ho(m,Es)),b=h===Os?Ds:Os,y=t.rects.popper,_=t.elements[f?b:h],w=Lo(Vs(_)?_:_.contextElement||ro(t.elements.popper),l,d,o),E=Zs(t.elements.reference),A=Io({reference:E,element:y,placement:r}),S=xo(Object.assign({},y,A)),k=h===Os?S:E,C={top:w.top-k.top+v.top,bottom:k.bottom-w.bottom+v.bottom,left:w.left-k.left+v.left,right:k.right-w.right+v.right},O=t.modifiersData.offset;if(h===Os&&O){var D=O[r];Object.keys(C).forEach(function(t){var e=[ys,bs].indexOf(t)>=0?1:-1,i=[vs,bs].indexOf(t)>=0?"y":"x";C[t]+=D[i]*e})}return C}function Fo(t,e){void 0===e&&(e={});var i=e,n=i.placement,r=i.boundary,s=i.rootBoundary,o=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,c=void 0===l?Ts:l,d=fo(n),u=d?a?xs:xs.filter(function(t){return fo(t)===d}):Es,h=u.filter(function(t){return c.indexOf(t)>=0});0===h.length&&(h=u);var p=h.reduce(function(e,i){return e[i]=Mo(t,{placement:i,boundary:r,rootBoundary:s,padding:o})[Ks(i)],e},{});return Object.keys(p).sort(function(t,e){return p[t]-p[e]})}var No={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var r=i.mainAxis,s=void 0===r||r,o=i.altAxis,a=void 0===o||o,l=i.fallbackPlacements,c=i.padding,d=i.boundary,u=i.rootBoundary,h=i.altBoundary,p=i.flipVariations,f=void 0===p||p,g=i.allowedAutoPlacements,m=e.options.placement,v=Ks(m),b=l||(v===m||!f?[wo(m)]:function(t){if(Ks(t)===ws)return[];var e=wo(t);return[Ao(t),e,Ao(e)]}(m)),y=[m].concat(b).reduce(function(t,i){return t.concat(Ks(i)===ws?Fo(e,{placement:i,boundary:d,rootBoundary:u,padding:c,flipVariations:f,allowedAutoPlacements:g}):i)},[]),_=e.rects.reference,w=e.rects.popper,E=new Map,A=!0,S=y[0],k=0;k<y.length;k++){var C=y[k],O=Ks(C),D=fo(C)===As,x=[vs,bs].indexOf(O)>=0,T=x?"width":"height",L=Mo(e,{placement:C,boundary:d,rootBoundary:u,altBoundary:h,padding:c}),I=x?D?ys:_s:D?bs:vs;_[T]>w[T]&&(I=wo(I));var M=wo(I),F=[];if(s&&F.push(L[O]<=0),a&&F.push(L[I]<=0,L[M]<=0),F.every(function(t){return t})){S=C,A=!1;break}E.set(C,F)}if(A)for(var N=function(t){var e=y.find(function(e){var i=E.get(e);if(i)return i.slice(0,t).every(function(t){return t})});if(e)return S=e,"break"},j=f?3:1;j>0;j--){if("break"===N(j))break}e.placement!==S&&(e.modifiersData[n]._skip=!0,e.placement=S,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function jo(t,e,i){return void 0===i&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function Po(t){return[vs,ys,bs,_s].some(function(e){return t[e]>=0})}var $o={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,i=t.name,n=e.rects.reference,r=e.rects.popper,s=e.modifiersData.preventOverflow,o=Mo(e,{elementContext:"reference"}),a=Mo(e,{altBoundary:!0}),l=jo(o,n),c=jo(a,r,s),d=Po(l),u=Po(c);e.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:u},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":u})}};var Ho={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,i=t.options,n=t.name,r=i.offset,s=void 0===r?[0,0]:r,o=Ts.reduce(function(t,i){return t[i]=function(t,e,i){var n=Ks(t),r=[_s,vs].indexOf(n)>=0?-1:1,s="function"==typeof i?i(Object.assign({},e,{placement:t})):i,o=s[0],a=s[1];return o=o||0,a=(a||0)*r,[_s,ys].indexOf(n)>=0?{x:a,y:o}:{x:o,y:a}}(i,e.rects,s),t},{}),a=o[e.placement],l=a.x,c=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[n]=o}};var qo={name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,i=t.name;e.modifiersData[i]=Io({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})},data:{}};var Ro={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name,r=i.mainAxis,s=void 0===r||r,o=i.altAxis,a=void 0!==o&&o,l=i.boundary,c=i.rootBoundary,d=i.altBoundary,u=i.padding,h=i.tether,p=void 0===h||h,f=i.tetherOffset,g=void 0===f?0:f,m=Mo(e,{boundary:l,rootBoundary:c,padding:u,altBoundary:d}),v=Ks(e.placement),b=fo(e.placement),y=!b,_=lo(v),w="x"===_?"y":"x",E=e.modifiersData.popperOffsets,A=e.rects.reference,S=e.rects.popper,k="function"==typeof g?g(Object.assign({},e.rects,{placement:e.placement})):g,C="number"==typeof k?{mainAxis:k,altAxis:k}:Object.assign({mainAxis:0,altAxis:0},k),O=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,D={x:0,y:0};if(E){if(s){var x,T="y"===_?vs:_s,L="y"===_?bs:ys,I="y"===_?"height":"width",M=E[_],F=M+m[T],N=M-m[L],j=p?-S[I]/2:0,P=b===As?A[I]:S[I],H=b===As?-S[I]:-A[I],q=e.elements.arrow,R=p&&q?to(q):{width:0,height:0},B=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},V=B[T],z=B[L],W=co(0,A[I],R[I]),Y=y?A[I]/2-j-W-V-C.mainAxis:P-W-V-C.mainAxis,K=y?-A[I]/2+j+W+z+C.mainAxis:H+W+z+C.mainAxis,U=e.elements.arrow&&ao(e.elements.arrow),X=U?"y"===_?U.clientTop||0:U.clientLeft||0:0,Q=null!=(x=null==O?void 0:O[_])?x:0,G=M+K-Q,J=co(p?Xs(F,M+Y-Q-X):F,M,p?Us(N,G):N);E[_]=J,D[_]=J-M}if(a){var Z,tt="x"===_?vs:_s,et="x"===_?bs:ys,it=E[w],nt="y"===w?"height":"width",rt=it+m[tt],st=it-m[et],ot=-1!==[vs,_s].indexOf(v),at=null!=(Z=null==O?void 0:O[w])?Z:0,lt=ot?rt:it-A[nt]-S[nt]-at+C.altAxis,ct=ot?it+A[nt]+S[nt]-at-C.altAxis:st,dt=p&&ot?function(t,e,i){var n=co(t,e,i);return n>i?i:n}(lt,it,ct):co(p?lt:rt,it,p?ct:st);E[w]=dt,D[w]=dt-it}e.modifiersData[n]=D}},requiresIfExists:["offset"]};function Bo(t,e,i){void 0===i&&(i=!1);var n,r,s=zs(e),o=zs(e)&&function(t){var e=t.getBoundingClientRect(),i=Qs(e.width)/t.offsetWidth||1,n=Qs(e.height)/t.offsetHeight||1;return 1!==i||1!==n}(e),a=ro(e),l=Zs(t,o,i),c={scrollLeft:0,scrollTop:0},d={x:0,y:0};return(s||!s&&!i)&&(("body"!==Rs(e)||Co(a))&&(c=(n=e)!==Bs(n)&&zs(n)?{scrollLeft:(r=n).scrollLeft,scrollTop:r.scrollTop}:So(n)),zs(e)?((d=Zs(e,!0)).x+=e.clientLeft,d.y+=e.clientTop):a&&(d.x=ko(a))),{x:l.left+c.scrollLeft-d.x,y:l.top+c.scrollTop-d.y,width:l.width,height:l.height}}function Vo(t){var e=new Map,i=new Set,n=[];function r(t){i.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach(function(t){if(!i.has(t)){var n=e.get(t);n&&r(n)}}),n.push(t)}return t.forEach(function(t){e.set(t.name,t)}),t.forEach(function(t){i.has(t.name)||r(t)}),n}var zo={placement:"bottom",modifiers:[],strategy:"absolute"};function Wo(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return!e.some(function(t){return!(t&&"function"==typeof t.getBoundingClientRect)})}function Yo(t){void 0===t&&(t={});var e=t,i=e.defaultModifiers,n=void 0===i?[]:i,r=e.defaultOptions,s=void 0===r?zo:r;return function(t,e,i){void 0===i&&(i=s);var r,o,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},zo,s),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},l=[],c=!1,d={state:a,setOptions:function(i){var r="function"==typeof i?i(a.options):i;u(),a.options=Object.assign({},s,a.options,r),a.scrollParents={reference:Vs(t)?Do(t):t.contextElement?Do(t.contextElement):[],popper:Do(e)};var o,c,h=function(t){var e=Vo(t);return qs.reduce(function(t,i){return t.concat(e.filter(function(t){return t.phase===i}))},[])}((o=[].concat(n,a.options.modifiers),c=o.reduce(function(t,e){var i=t[e.name];return t[e.name]=i?Object.assign({},i,e,{options:Object.assign({},i.options,e.options),data:Object.assign({},i.data,e.data)}):e,t},{}),Object.keys(c).map(function(t){return c[t]})));return a.orderedModifiers=h.filter(function(t){return t.enabled}),a.orderedModifiers.forEach(function(t){var e=t.name,i=t.options,n=void 0===i?{}:i,r=t.effect;if("function"==typeof r){var s=r({state:a,name:e,instance:d,options:n}),o=function(){};l.push(s||o)}}),d.update()},forceUpdate:function(){if(!c){var t=a.elements,e=t.reference,i=t.popper;if(Wo(e,i)){a.rects={reference:Bo(e,ao(i),"fixed"===a.options.strategy),popper:to(i)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach(function(t){return a.modifiersData[t.name]=Object.assign({},t.data)});for(var n=0;n<a.orderedModifiers.length;n++)if(!0!==a.reset){var r=a.orderedModifiers[n],s=r.fn,o=r.options,l=void 0===o?{}:o,u=r.name;"function"==typeof s&&(a=s({state:a,options:l,name:u,instance:d})||a)}else a.reset=!1,n=-1}}},update:(r=function(){return new Promise(function(t){d.forceUpdate(),t(a)})},function(){return o||(o=new Promise(function(t){Promise.resolve().then(function(){o=void 0,t(r())})})),o}),destroy:function(){u(),c=!0}};if(!Wo(t,e))return d;function u(){l.forEach(function(t){return t()}),l=[]}return d.setOptions(i).then(function(t){!c&&i.onFirstUpdate&&i.onFirstUpdate(t)}),d}}var Ko=Yo(),Uo=Yo({defaultModifiers:[yo,qo,vo,Ys]}),Xo=Yo({defaultModifiers:[yo,qo,vo,Ys,Ho,No,Ro,po,$o]}),Qo=Object.freeze({__proto__:null,afterMain:js,afterRead:Ms,afterWrite:Hs,applyStyles:Ys,arrow:po,auto:ws,basePlacements:Es,beforeMain:Fs,beforeRead:Ls,beforeWrite:Ps,bottom:bs,clippingParents:ks,computeStyles:vo,createPopper:Xo,createPopperBase:Ko,createPopperLite:Uo,detectOverflow:Mo,end:Ss,eventListeners:yo,flip:No,hide:$o,left:_s,main:Ns,modifierPhases:qs,offset:Ho,placements:Ts,popper:Os,popperGenerator:Yo,popperOffsets:qo,preventOverflow:Ro,read:Is,reference:Ds,right:ys,start:As,top:vs,variationPlacements:xs,viewport:Cs,write:$s});
13
+ */function fe(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,n)}return i}function ge(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?fe(Object(i),!0).forEach(function(e){ve(t,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):fe(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}function me(t){return me="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},me(t)}function ve(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function be(){return be=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},be.apply(this,arguments)}function ye(t,e){if(null==t)return{};var i,n,r=function(t,e){if(null==t)return{};var i,n,r={},s=Object.keys(t);for(n=0;n<s.length;n++)i=s[n],e.indexOf(i)>=0||(r[i]=t[i]);return r}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(n=0;n<s.length;n++)i=s[n],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(t,i)&&(r[i]=t[i])}return r}function _e(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var we=_e(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Ee=_e(/Edge/i),Ae=_e(/firefox/i),Se=_e(/safari/i)&&!_e(/chrome/i)&&!_e(/android/i),ke=_e(/iP(ad|od|hone)/i),Ce=_e(/chrome/i)&&_e(/android/i),Oe={capture:!1,passive:!1};function De(t,e,i){t.addEventListener(e,i,!we&&Oe)}function xe(t,e,i){t.removeEventListener(e,i,!we&&Oe)}function Te(t,e){if(e){if(">"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return!1}return!1}}function Le(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function Ie(t,e,i,n){if(t){i=i||document;do{if(null!=e&&(">"===e[0]?t.parentNode===i&&Te(t,e):Te(t,e))||n&&t===i)return t;if(t===i)break}while(t=Le(t))}return null}var Me,Fe=/\s+/g;function Ne(t,e,i){if(t&&e)if(t.classList)t.classList[i?"add":"remove"](e);else{var n=(" "+t.className+" ").replace(Fe," ").replace(" "+e+" "," ");t.className=(n+(i?" "+e:"")).replace(Fe," ")}}function je(t,e,i){var n=t&&t.style;if(n){if(void 0===i)return document.defaultView&&document.defaultView.getComputedStyle?i=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(i=t.currentStyle),void 0===e?i:i[e];e in n||-1!==e.indexOf("webkit")||(e="-webkit-"+e),n[e]=i+("string"==typeof i?"":"px")}}function Pe(t,e){var i="";if("string"==typeof t)i=t;else do{var n=je(t,"transform");n&&"none"!==n&&(i=n+" "+i)}while(!e&&(t=t.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(i)}function $e(t,e,i){if(t){var n=t.getElementsByTagName(e),r=0,s=n.length;if(i)for(;r<s;r++)i(n[r],r);return n}return[]}function He(){var t=document.scrollingElement;return t||document.documentElement}function qe(t,e,i,n,r){if(t.getBoundingClientRect||t===window){var s,o,a,l,c,d,u;if(t!==window&&t.parentNode&&t!==He()?(o=(s=t.getBoundingClientRect()).top,a=s.left,l=s.bottom,c=s.right,d=s.height,u=s.width):(o=0,a=0,l=window.innerHeight,c=window.innerWidth,d=window.innerHeight,u=window.innerWidth),(e||i)&&t!==window&&(r=r||t.parentNode,!we))do{if(r&&r.getBoundingClientRect&&("none"!==je(r,"transform")||i&&"static"!==je(r,"position"))){var h=r.getBoundingClientRect();o-=h.top+parseInt(je(r,"border-top-width")),a-=h.left+parseInt(je(r,"border-left-width")),l=o+s.height,c=a+s.width;break}}while(r=r.parentNode);if(n&&t!==window){var p=Pe(r||t),f=p&&p.a,g=p&&p.d;p&&(l=(o/=g)+(d/=g),c=(a/=f)+(u/=f))}return{top:o,left:a,bottom:l,right:c,width:u,height:d}}}function Re(t,e,i){for(var n=Ye(t,!0),r=qe(t)[e];n;){if(!(r>=qe(n)[i]))return n;if(n===He())break;n=Ye(n,!1)}return!1}function Be(t,e,i,n){for(var r=0,s=0,o=t.children;s<o.length;){if("none"!==o[s].style.display&&o[s]!==Qi.ghost&&(n||o[s]!==Qi.dragged)&&Ie(o[s],i.draggable,t,!1)){if(r===e)return o[s];r++}s++}return null}function Ve(t,e){for(var i=t.lastElementChild;i&&(i===Qi.ghost||"none"===je(i,"display")||e&&!Te(i,e));)i=i.previousElementSibling;return i||null}function ze(t,e){var i=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)"TEMPLATE"===t.nodeName.toUpperCase()||t===Qi.clone||e&&!Te(t,e)||i++;return i}function We(t){var e=0,i=0,n=He();if(t)do{var r=Pe(t),s=r.a,o=r.d;e+=t.scrollLeft*s,i+=t.scrollTop*o}while(t!==n&&(t=t.parentNode));return[e,i]}function Ye(t,e){if(!t||!t.getBoundingClientRect)return He();var i=t,n=!1;do{if(i.clientWidth<i.scrollWidth||i.clientHeight<i.scrollHeight){var r=je(i);if(i.clientWidth<i.scrollWidth&&("auto"==r.overflowX||"scroll"==r.overflowX)||i.clientHeight<i.scrollHeight&&("auto"==r.overflowY||"scroll"==r.overflowY)){if(!i.getBoundingClientRect||i===document.body)return He();if(n||e)return i;n=!0}}}while(i=i.parentNode);return He()}function Ke(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}function Ue(t,e){return function(){if(!Me){var i=arguments;1===i.length?t.call(this,i[0]):t.apply(this,i),Me=setTimeout(function(){Me=void 0},e)}}}function Xe(t,e,i){t.scrollLeft+=e,t.scrollTop+=i}function Qe(t){var e=window.Polymer,$=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):$?$(t).clone(!0)[0]:t.cloneNode(!0)}function Ge(t,e,i){var n={};return Array.from(t.children).forEach(function(r){var s,o,a,l;if(Ie(r,e.draggable,t,!1)&&!r.animated&&r!==i){var c=qe(r);n.left=Math.min(null!==(s=n.left)&&void 0!==s?s:1/0,c.left),n.top=Math.min(null!==(o=n.top)&&void 0!==o?o:1/0,c.top),n.right=Math.max(null!==(a=n.right)&&void 0!==a?a:-1/0,c.right),n.bottom=Math.max(null!==(l=n.bottom)&&void 0!==l?l:-1/0,c.bottom)}}),n.width=n.right-n.left,n.height=n.bottom-n.top,n.x=n.left,n.y=n.top,n}var Je="Sortable"+(new Date).getTime();function Ze(){var t,e=[];return{captureAnimationState:function(){(e=[],this.options.animation)&&[].slice.call(this.el.children).forEach(function(t){if("none"!==je(t,"display")&&t!==Qi.ghost){e.push({target:t,rect:qe(t)});var i=ge({},e[e.length-1].rect);if(t.thisAnimationDuration){var n=Pe(t,!0);n&&(i.top-=n.f,i.left-=n.e)}t.fromRect=i}})},addAnimationState:function(t){e.push(t)},removeAnimationState:function(t){e.splice(function(t,e){for(var i in t)if(t.hasOwnProperty(i))for(var n in e)if(e.hasOwnProperty(n)&&e[n]===t[i][n])return Number(i);return-1}(e,{target:t}),1)},animateAll:function(i){var n=this;if(!this.options.animation)return clearTimeout(t),void("function"==typeof i&&i());var r=!1,s=0;e.forEach(function(t){var e=0,i=t.target,o=i.fromRect,a=qe(i),l=i.prevFromRect,c=i.prevToRect,d=t.rect,u=Pe(i,!0);u&&(a.top-=u.f,a.left-=u.e),i.toRect=a,i.thisAnimationDuration&&Ke(l,a)&&!Ke(o,a)&&(d.top-a.top)/(d.left-a.left)===(o.top-a.top)/(o.left-a.left)&&(e=function(t,e,i,n){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-i.top,2)+Math.pow(e.left-i.left,2))*n.animation}(d,l,c,n.options)),Ke(a,o)||(i.prevFromRect=o,i.prevToRect=a,e||(e=n.options.animation),n.animate(i,d,a,e)),e&&(r=!0,s=Math.max(s,e),clearTimeout(i.animationResetTimer),i.animationResetTimer=setTimeout(function(){i.animationTime=0,i.prevFromRect=null,i.fromRect=null,i.prevToRect=null,i.thisAnimationDuration=null},e),i.thisAnimationDuration=e)}),clearTimeout(t),r?t=setTimeout(function(){"function"==typeof i&&i()},s):"function"==typeof i&&i(),e=[]},animate:function(t,e,i,n){if(n){je(t,"transition",""),je(t,"transform","");var r=Pe(this.el),s=r&&r.a,o=r&&r.d,a=(e.left-i.left)/(s||1),l=(e.top-i.top)/(o||1);t.animatingX=!!a,t.animatingY=!!l,je(t,"transform","translate3d("+a+"px,"+l+"px,0)"),this.forRepaintDummy=function(t){return t.offsetWidth}(t),je(t,"transition","transform "+n+"ms"+(this.options.easing?" "+this.options.easing:"")),je(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout(function(){je(t,"transition",""),je(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1},n)}}}}var ti=[],ei={initializeByDefault:!0},ii={mount:function(t){for(var e in ei)ei.hasOwnProperty(e)&&!(e in t)&&(t[e]=ei[e]);ti.forEach(function(e){if(e.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),ti.push(t)},pluginEvent:function(t,e,i){var n=this;this.eventCanceled=!1,i.cancel=function(){n.eventCanceled=!0};var r=t+"Global";ti.forEach(function(n){e[n.pluginName]&&(e[n.pluginName][r]&&e[n.pluginName][r](ge({sortable:e},i)),e.options[n.pluginName]&&e[n.pluginName][t]&&e[n.pluginName][t](ge({sortable:e},i)))})},initializePlugins:function(t,e,i,n){for(var r in ti.forEach(function(n){var r=n.pluginName;if(t.options[r]||n.initializeByDefault){var s=new n(t,e,t.options);s.sortable=t,s.options=t.options,t[r]=s,be(i,s.defaults)}}),t.options)if(t.options.hasOwnProperty(r)){var s=this.modifyOption(t,r,t.options[r]);void 0!==s&&(t.options[r]=s)}},getEventProperties:function(t,e){var i={};return ti.forEach(function(n){"function"==typeof n.eventProperties&&be(i,n.eventProperties.call(e[n.pluginName],t))}),i},modifyOption:function(t,e,i){var n;return ti.forEach(function(r){t[r.pluginName]&&r.optionListeners&&"function"==typeof r.optionListeners[e]&&(n=r.optionListeners[e].call(t[r.pluginName],i))}),n}};var ni=["evt"],ri=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=i.evt,r=ye(i,ni);ii.pluginEvent.bind(Qi)(t,e,ge({dragEl:oi,parentEl:ai,ghostEl:li,rootEl:ci,nextEl:di,lastDownEl:ui,cloneEl:hi,cloneHidden:pi,dragStarted:Ci,putSortable:yi,activeSortable:Qi.active,originalEvent:n,oldIndex:fi,oldDraggableIndex:mi,newIndex:gi,newDraggableIndex:vi,hideGhostForTarget:Yi,unhideGhostForTarget:Ki,cloneNowHidden:function(){pi=!0},cloneNowShown:function(){pi=!1},dispatchSortableEvent:function(t){si({sortable:e,name:t,originalEvent:n})}},r))};function si(t){!function(t){var e=t.sortable,i=t.rootEl,n=t.name,r=t.targetEl,s=t.cloneEl,o=t.toEl,a=t.fromEl,l=t.oldIndex,c=t.newIndex,d=t.oldDraggableIndex,u=t.newDraggableIndex,h=t.originalEvent,p=t.putSortable,f=t.extraEventProperties;if(e=e||i&&i[Je]){var g,m=e.options,v="on"+n.charAt(0).toUpperCase()+n.substr(1);!window.CustomEvent||we||Ee?(g=document.createEvent("Event")).initEvent(n,!0,!0):g=new CustomEvent(n,{bubbles:!0,cancelable:!0}),g.to=o||i,g.from=a||i,g.item=r||i,g.clone=s,g.oldIndex=l,g.newIndex=c,g.oldDraggableIndex=d,g.newDraggableIndex=u,g.originalEvent=h,g.pullMode=p?p.lastPutMode:void 0;var b=ge(ge({},f),ii.getEventProperties(n,e));for(var y in b)g[y]=b[y];i&&i.dispatchEvent(g),m[v]&&m[v].call(e,g)}}(ge({putSortable:yi,cloneEl:hi,targetEl:oi,rootEl:ci,oldIndex:fi,oldDraggableIndex:mi,newIndex:gi,newDraggableIndex:vi},t))}var oi,ai,li,ci,di,ui,hi,pi,fi,gi,mi,vi,bi,yi,_i,wi,Ei,Ai,Si,ki,Ci,Oi,Di,xi,Ti,Li=!1,Ii=!1,Mi=[],Fi=!1,Ni=!1,ji=[],Pi=!1,$i=[],Hi="undefined"!=typeof document,qi=ke,Ri=Ee||we?"cssFloat":"float",Bi=Hi&&!Ce&&!ke&&"draggable"in document.createElement("div"),Vi=function(){if(Hi){if(we)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),zi=function(t,e){var i=je(t),n=parseInt(i.width)-parseInt(i.paddingLeft)-parseInt(i.paddingRight)-parseInt(i.borderLeftWidth)-parseInt(i.borderRightWidth),r=Be(t,0,e),s=Be(t,1,e),o=r&&je(r),a=s&&je(s),l=o&&parseInt(o.marginLeft)+parseInt(o.marginRight)+qe(r).width,c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+qe(s).width;if("flex"===i.display)return"column"===i.flexDirection||"column-reverse"===i.flexDirection?"vertical":"horizontal";if("grid"===i.display)return i.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&o.float&&"none"!==o.float){var d="left"===o.float?"left":"right";return!s||"both"!==a.clear&&a.clear!==d?"horizontal":"vertical"}return r&&("block"===o.display||"flex"===o.display||"table"===o.display||"grid"===o.display||l>=n&&"none"===i[Ri]||s&&"none"===i[Ri]&&l+c>n)?"vertical":"horizontal"},Wi=function(t){function e(t,i){return function(n,r,s,o){var a=n.options.group.name&&r.options.group.name&&n.options.group.name===r.options.group.name;if(null==t&&(i||a))return!0;if(null==t||!1===t)return!1;if(i&&"clone"===t)return t;if("function"==typeof t)return e(t(n,r,s,o),i)(n,r,s,o);var l=(i?n:r).options.group.name;return!0===t||"string"==typeof t&&t===l||t.join&&t.indexOf(l)>-1}}var i={},n=t.group;n&&"object"==me(n)||(n={name:n}),i.name=n.name,i.checkPull=e(n.pull,!0),i.checkPut=e(n.put),i.revertClone=n.revertClone,t.group=i},Yi=function(){!Vi&&li&&je(li,"display","none")},Ki=function(){!Vi&&li&&je(li,"display","")};Hi&&!Ce&&document.addEventListener("click",function(t){if(Ii)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Ii=!1,!1},!0);var Ui=function(t){if(oi){t=t.touches?t.touches[0]:t;var e=(r=t.clientX,s=t.clientY,Mi.some(function(t){var e=t[Je].options.emptyInsertThreshold;if(e&&!Ve(t)){var i=qe(t),n=r>=i.left-e&&r<=i.right+e,a=s>=i.top-e&&s<=i.bottom+e;return n&&a?o=t:void 0}}),o);if(e){var i={};for(var n in t)t.hasOwnProperty(n)&&(i[n]=t[n]);i.target=i.rootEl=e,i.preventDefault=void 0,i.stopPropagation=void 0,e[Je]._onDragOver(i)}}var r,s,o},Xi=function(t){oi&&oi.parentNode[Je]._isOutsideThisEl(t.target)};function Qi(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=be({},e),t[Je]=this;var i={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return zi(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==Qi.supportPointer&&"PointerEvent"in window&&(!Se||ke),emptyInsertThreshold:5};for(var n in ii.initializePlugins(this,t,i),i)!(n in e)&&(e[n]=i[n]);for(var r in Wi(e),this)"_"===r.charAt(0)&&"function"==typeof this[r]&&(this[r]=this[r].bind(this));this.nativeDraggable=!e.forceFallback&&Bi,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?De(t,"pointerdown",this._onTapStart):(De(t,"mousedown",this._onTapStart),De(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(De(t,"dragover",this),De(t,"dragenter",this)),Mi.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),be(this,Ze())}function Gi(t,e,i,n,r,s,o,a){var l,c,d=t[Je],u=d.options.onMove;return!window.CustomEvent||we||Ee?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=e,l.from=t,l.dragged=i,l.draggedRect=n,l.related=r||e,l.relatedRect=s||qe(e),l.willInsertAfter=a,l.originalEvent=o,t.dispatchEvent(l),u&&(c=u.call(d,l,o)),c}function Ji(t){t.draggable=!1}function Zi(){Pi=!1}function tn(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,i=e.length,n=0;i--;)n+=e.charCodeAt(i);return n.toString(36)}function en(t){return setTimeout(t,0)}function nn(t){return clearTimeout(t)}Qi.prototype={constructor:Qi,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(Oi=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,oi):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,i=this.el,n=this.options,r=n.preventOnFilter,s=t.type,o=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,a=(o||t).target,l=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||a,c=n.filter;if(function(t){$i.length=0;var e=t.getElementsByTagName("input"),i=e.length;for(;i--;){var n=e[i];n.checked&&$i.push(n)}}(i),!oi&&!(/mousedown|pointerdown/.test(s)&&0!==t.button||n.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!Se||!a||"SELECT"!==a.tagName.toUpperCase())&&!((a=Ie(a,n.draggable,i,!1))&&a.animated||ui===a)){if(fi=ze(a),mi=ze(a,n.draggable),"function"==typeof c){if(c.call(this,t,a,this))return si({sortable:e,rootEl:l,name:"filter",targetEl:a,toEl:i,fromEl:i}),ri("filter",e,{evt:t}),void(r&&t.preventDefault())}else if(c&&(c=c.split(",").some(function(n){if(n=Ie(l,n.trim(),i,!1))return si({sortable:e,rootEl:n,name:"filter",targetEl:a,fromEl:i,toEl:i}),ri("filter",e,{evt:t}),!0})))return void(r&&t.preventDefault());n.handle&&!Ie(l,n.handle,i,!1)||this._prepareDragStart(t,o,a)}}},_prepareDragStart:function(t,e,i){var n,r=this,s=r.el,o=r.options,a=s.ownerDocument;if(i&&!oi&&i.parentNode===s){var l=qe(i);if(ci=s,ai=(oi=i).parentNode,di=oi.nextSibling,ui=i,bi=o.group,Qi.dragged=oi,_i={target:oi,clientX:(e||t).clientX,clientY:(e||t).clientY},Si=_i.clientX-l.left,ki=_i.clientY-l.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,oi.style["will-change"]="all",n=function(){ri("delayEnded",r,{evt:t}),Qi.eventCanceled?r._onDrop():(r._disableDelayedDragEvents(),!Ae&&r.nativeDraggable&&(oi.draggable=!0),r._triggerDragStart(t,e),si({sortable:r,name:"choose",originalEvent:t}),Ne(oi,o.chosenClass,!0))},o.ignore.split(",").forEach(function(t){$e(oi,t.trim(),Ji)}),De(a,"dragover",Ui),De(a,"mousemove",Ui),De(a,"touchmove",Ui),o.supportPointer?(De(a,"pointerup",r._onDrop),!this.nativeDraggable&&De(a,"pointercancel",r._onDrop)):(De(a,"mouseup",r._onDrop),De(a,"touchend",r._onDrop),De(a,"touchcancel",r._onDrop)),Ae&&this.nativeDraggable&&(this.options.touchStartThreshold=4,oi.draggable=!0),ri("delayStart",this,{evt:t}),!o.delay||o.delayOnTouchOnly&&!e||this.nativeDraggable&&(Ee||we))n();else{if(Qi.eventCanceled)return void this._onDrop();o.supportPointer?(De(a,"pointerup",r._disableDelayedDrag),De(a,"pointercancel",r._disableDelayedDrag)):(De(a,"mouseup",r._disableDelayedDrag),De(a,"touchend",r._disableDelayedDrag),De(a,"touchcancel",r._disableDelayedDrag)),De(a,"mousemove",r._delayedDragTouchMoveHandler),De(a,"touchmove",r._delayedDragTouchMoveHandler),o.supportPointer&&De(a,"pointermove",r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(n,o.delay)}}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){oi&&Ji(oi),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;xe(t,"mouseup",this._disableDelayedDrag),xe(t,"touchend",this._disableDelayedDrag),xe(t,"touchcancel",this._disableDelayedDrag),xe(t,"pointerup",this._disableDelayedDrag),xe(t,"pointercancel",this._disableDelayedDrag),xe(t,"mousemove",this._delayedDragTouchMoveHandler),xe(t,"touchmove",this._delayedDragTouchMoveHandler),xe(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?De(document,"pointermove",this._onTouchMove):De(document,e?"touchmove":"mousemove",this._onTouchMove):(De(oi,"dragend",this),De(ci,"dragstart",this._onDragStart));try{document.selection?en(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){if(Li=!1,ci&&oi){ri("dragStarted",this,{evt:e}),this.nativeDraggable&&De(document,"dragover",Xi);var i=this.options;!t&&Ne(oi,i.dragClass,!1),Ne(oi,i.ghostClass,!0),Qi.active=this,t&&this._appendGhost(),si({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(wi){this._lastX=wi.clientX,this._lastY=wi.clientY,Yi();for(var t=document.elementFromPoint(wi.clientX,wi.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(wi.clientX,wi.clientY))!==e;)e=t;if(oi.parentNode[Je]._isOutsideThisEl(t),e)do{if(e[Je]){if(e[Je]._onDragOver({clientX:wi.clientX,clientY:wi.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}t=e}while(e=Le(e));Ki()}},_onTouchMove:function(t){if(_i){var e=this.options,i=e.fallbackTolerance,n=e.fallbackOffset,r=t.touches?t.touches[0]:t,s=li&&Pe(li,!0),o=li&&s&&s.a,a=li&&s&&s.d,l=qi&&Ti&&We(Ti),c=(r.clientX-_i.clientX+n.x)/(o||1)+(l?l[0]-ji[0]:0)/(o||1),d=(r.clientY-_i.clientY+n.y)/(a||1)+(l?l[1]-ji[1]:0)/(a||1);if(!Qi.active&&!Li){if(i&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))<i)return;this._onDragStart(t,!0)}if(li){s?(s.e+=c-(Ei||0),s.f+=d-(Ai||0)):s={a:1,b:0,c:0,d:1,e:c,f:d};var u="matrix(".concat(s.a,",").concat(s.b,",").concat(s.c,",").concat(s.d,",").concat(s.e,",").concat(s.f,")");je(li,"webkitTransform",u),je(li,"mozTransform",u),je(li,"msTransform",u),je(li,"transform",u),Ei=c,Ai=d,wi=r}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!li){var t=this.options.fallbackOnBody?document.body:ci,e=qe(oi,!0,qi,!0,t),i=this.options;if(qi){for(Ti=t;"static"===je(Ti,"position")&&"none"===je(Ti,"transform")&&Ti!==document;)Ti=Ti.parentNode;Ti!==document.body&&Ti!==document.documentElement?(Ti===document&&(Ti=He()),e.top+=Ti.scrollTop,e.left+=Ti.scrollLeft):Ti=He(),ji=We(Ti)}Ne(li=oi.cloneNode(!0),i.ghostClass,!1),Ne(li,i.fallbackClass,!0),Ne(li,i.dragClass,!0),je(li,"transition",""),je(li,"transform",""),je(li,"box-sizing","border-box"),je(li,"margin",0),je(li,"top",e.top),je(li,"left",e.left),je(li,"width",e.width),je(li,"height",e.height),je(li,"opacity","0.8"),je(li,"position",qi?"absolute":"fixed"),je(li,"zIndex","100000"),je(li,"pointerEvents","none"),Qi.ghost=li,t.appendChild(li),je(li,"transform-origin",Si/parseInt(li.style.width)*100+"% "+ki/parseInt(li.style.height)*100+"%")}},_onDragStart:function(t,e){var i=this,n=t.dataTransfer,r=i.options;ri("dragStart",this,{evt:t}),Qi.eventCanceled?this._onDrop():(ri("setupClone",this),Qi.eventCanceled||((hi=Qe(oi)).removeAttribute("id"),hi.draggable=!1,hi.style["will-change"]="",this._hideClone(),Ne(hi,this.options.chosenClass,!1),Qi.clone=hi),i.cloneId=en(function(){ri("clone",i),Qi.eventCanceled||(i.options.removeCloneOnHide||ci.insertBefore(hi,oi),i._hideClone(),si({sortable:i,name:"clone"}))}),!e&&Ne(oi,r.dragClass,!0),e?(Ii=!0,i._loopId=setInterval(i._emulateDragOver,50)):(xe(document,"mouseup",i._onDrop),xe(document,"touchend",i._onDrop),xe(document,"touchcancel",i._onDrop),n&&(n.effectAllowed="move",r.setData&&r.setData.call(i,n,oi)),De(document,"drop",i),je(oi,"transform","translateZ(0)")),Li=!0,i._dragStartId=en(i._dragStarted.bind(i,e,t)),De(document,"selectstart",i),Ci=!0,window.getSelection().removeAllRanges(),Se&&je(document.body,"user-select","none"))},_onDragOver:function(t){var e,i,n,r,s=this.el,o=t.target,a=this.options,l=a.group,c=Qi.active,d=bi===l,u=a.sort,h=yi||c,p=this,f=!1;if(!Pi){if(void 0!==t.preventDefault&&t.cancelable&&t.preventDefault(),o=Ie(o,a.draggable,s,!0),x("dragOver"),Qi.eventCanceled)return f;if(oi.contains(t.target)||o.animated&&o.animatingX&&o.animatingY||p._ignoreWhileAnimating===o)return L(!1);if(Ii=!1,c&&!a.disabled&&(d?u||(n=ai!==ci):yi===this||(this.lastPutMode=bi.checkPull(this,c,oi,t))&&l.checkPut(this,c,oi,t))){if(r="vertical"===this._getDirection(t,o),e=qe(oi),x("dragOverValid"),Qi.eventCanceled)return f;if(n)return ai=ci,T(),this._hideClone(),x("revert"),Qi.eventCanceled||(di?ci.insertBefore(oi,di):ci.appendChild(oi)),L(!0);var g=Ve(s,a.draggable);if(!g||function(t,e,i){var n=qe(Ve(i.el,i.options.draggable)),r=Ge(i.el,i.options,li),s=10;return e?t.clientX>r.right+s||t.clientY>n.bottom&&t.clientX>n.left:t.clientY>r.bottom+s||t.clientX>n.right&&t.clientY>n.top}(t,r,this)&&!g.animated){if(g===oi)return L(!1);if(g&&s===t.target&&(o=g),o&&(i=qe(o)),!1!==Gi(ci,s,oi,e,o,i,t,!!o))return T(),g&&g.nextSibling?s.insertBefore(oi,g.nextSibling):s.appendChild(oi),ai=s,I(),L(!0)}else if(g&&function(t,e,i){var n=qe(Be(i.el,0,i.options,!0)),r=Ge(i.el,i.options,li),s=10;return e?t.clientX<r.left-s||t.clientY<n.top&&t.clientX<n.right:t.clientY<r.top-s||t.clientY<n.bottom&&t.clientX<n.left}(t,r,this)){var m=Be(s,0,a,!0);if(m===oi)return L(!1);if(i=qe(o=m),!1!==Gi(ci,s,oi,e,o,i,t,!1))return T(),s.insertBefore(oi,m),ai=s,I(),L(!0)}else if(o.parentNode===s){i=qe(o);var v,b,y,_=oi.parentNode!==s,w=!function(t,e,i){var n=i?t.left:t.top,r=i?t.right:t.bottom,s=i?t.width:t.height,o=i?e.left:e.top,a=i?e.right:e.bottom,l=i?e.width:e.height;return n===o||r===a||n+s/2===o+l/2}(oi.animated&&oi.toRect||e,o.animated&&o.toRect||i,r),E=r?"top":"left",A=Re(o,"top","top")||Re(oi,"top","top"),S=A?A.scrollTop:void 0;if(Oi!==o&&(b=i[E],Fi=!1,Ni=!w&&a.invertSwap||_),v=function(t,e,i,n,r,s,o,a){var l=n?t.clientY:t.clientX,c=n?i.height:i.width,d=n?i.top:i.left,u=n?i.bottom:i.right,h=!1;if(!o)if(a&&xi<c*r){if(!Fi&&(1===Di?l>d+c*s/2:l<u-c*s/2)&&(Fi=!0),Fi)h=!0;else if(1===Di?l<d+xi:l>u-xi)return-Di}else if(l>d+c*(1-r)/2&&l<u-c*(1-r)/2)return function(t){return ze(oi)<ze(t)?1:-1}(e);if((h=h||o)&&(l<d+c*s/2||l>u-c*s/2))return l>d+c/2?1:-1;return 0}(t,o,i,r,w?1:a.swapThreshold,null==a.invertedSwapThreshold?a.swapThreshold:a.invertedSwapThreshold,Ni,Oi===o),0!==v){var k=ze(oi);do{k-=v,y=ai.children[k]}while(y&&("none"===je(y,"display")||y===li))}if(0===v||y===o)return L(!1);Oi=o,Di=v;var C=o.nextElementSibling,O=!1,D=Gi(ci,s,oi,e,o,i,t,O=1===v);if(!1!==D)return 1!==D&&-1!==D||(O=1===D),Pi=!0,setTimeout(Zi,30),T(),O&&!C?s.appendChild(oi):o.parentNode.insertBefore(oi,O?C:o),A&&Xe(A,0,S-A.scrollTop),ai=oi.parentNode,void 0===b||Ni||(xi=Math.abs(b-qe(o)[E])),I(),L(!0)}if(s.contains(oi))return L(!1)}return!1}function x(a,l){ri(a,p,ge({evt:t,isOwner:d,axis:r?"vertical":"horizontal",revert:n,dragRect:e,targetRect:i,canSort:u,fromSortable:h,target:o,completed:L,onMove:function(i,n){return Gi(ci,s,oi,e,i,qe(i),t,n)},changed:I},l))}function T(){x("dragOverAnimationCapture"),p.captureAnimationState(),p!==h&&h.captureAnimationState()}function L(e){return x("dragOverCompleted",{insertion:e}),e&&(d?c._hideClone():c._showClone(p),p!==h&&(Ne(oi,yi?yi.options.ghostClass:c.options.ghostClass,!1),Ne(oi,a.ghostClass,!0)),yi!==p&&p!==Qi.active?yi=p:p===Qi.active&&yi&&(yi=null),h===p&&(p._ignoreWhileAnimating=o),p.animateAll(function(){x("dragOverAnimationComplete"),p._ignoreWhileAnimating=null}),p!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(o===oi&&!oi.animated||o===s&&!o.animated)&&(Oi=null),a.dragoverBubble||t.rootEl||o===document||(oi.parentNode[Je]._isOutsideThisEl(t.target),!e&&Ui(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),f=!0}function I(){gi=ze(oi),vi=ze(oi,a.draggable),si({sortable:p,name:"change",toEl:s,newIndex:gi,newDraggableIndex:vi,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){xe(document,"mousemove",this._onTouchMove),xe(document,"touchmove",this._onTouchMove),xe(document,"pointermove",this._onTouchMove),xe(document,"dragover",Ui),xe(document,"mousemove",Ui),xe(document,"touchmove",Ui)},_offUpEvents:function(){var t=this.el.ownerDocument;xe(t,"mouseup",this._onDrop),xe(t,"touchend",this._onDrop),xe(t,"pointerup",this._onDrop),xe(t,"pointercancel",this._onDrop),xe(t,"touchcancel",this._onDrop),xe(document,"selectstart",this)},_onDrop:function(t){var e=this.el,i=this.options;gi=ze(oi),vi=ze(oi,i.draggable),ri("drop",this,{evt:t}),ai=oi&&oi.parentNode,gi=ze(oi),vi=ze(oi,i.draggable),Qi.eventCanceled||(Li=!1,Ni=!1,Fi=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),nn(this.cloneId),nn(this._dragStartId),this.nativeDraggable&&(xe(document,"drop",this),xe(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Se&&je(document.body,"user-select",""),je(oi,"transform",""),t&&(Ci&&(t.cancelable&&t.preventDefault(),!i.dropBubble&&t.stopPropagation()),li&&li.parentNode&&li.parentNode.removeChild(li),(ci===ai||yi&&"clone"!==yi.lastPutMode)&&hi&&hi.parentNode&&hi.parentNode.removeChild(hi),oi&&(this.nativeDraggable&&xe(oi,"dragend",this),Ji(oi),oi.style["will-change"]="",Ci&&!Li&&Ne(oi,yi?yi.options.ghostClass:this.options.ghostClass,!1),Ne(oi,this.options.chosenClass,!1),si({sortable:this,name:"unchoose",toEl:ai,newIndex:null,newDraggableIndex:null,originalEvent:t}),ci!==ai?(gi>=0&&(si({rootEl:ai,name:"add",toEl:ai,fromEl:ci,originalEvent:t}),si({sortable:this,name:"remove",toEl:ai,originalEvent:t}),si({rootEl:ai,name:"sort",toEl:ai,fromEl:ci,originalEvent:t}),si({sortable:this,name:"sort",toEl:ai,originalEvent:t})),yi&&yi.save()):gi!==fi&&gi>=0&&(si({sortable:this,name:"update",toEl:ai,originalEvent:t}),si({sortable:this,name:"sort",toEl:ai,originalEvent:t})),Qi.active&&(null!=gi&&-1!==gi||(gi=fi,vi=mi),si({sortable:this,name:"end",toEl:ai,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){ri("nulling",this),ci=oi=ai=li=di=hi=ui=pi=_i=wi=Ci=gi=vi=fi=mi=Oi=Di=yi=bi=Qi.dragged=Qi.ghost=Qi.clone=Qi.active=null,$i.forEach(function(t){t.checked=!0}),$i.length=Ei=Ai=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":oi&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move");t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],i=this.el.children,n=0,r=i.length,s=this.options;n<r;n++)Ie(t=i[n],s.draggable,this.el,!1)&&e.push(t.getAttribute(s.dataIdAttr)||tn(t));return e},sort:function(t,e){var i={},n=this.el;this.toArray().forEach(function(t,e){var r=n.children[e];Ie(r,this.options.draggable,n,!1)&&(i[t]=r)},this),e&&this.captureAnimationState(),t.forEach(function(t){i[t]&&(n.removeChild(i[t]),n.appendChild(i[t]))}),e&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,e){return Ie(t,e||this.options.draggable,this.el,!1)},option:function(t,e){var i=this.options;if(void 0===e)return i[t];var n=ii.modifyOption(this,t,e);i[t]=void 0!==n?n:e,"group"===t&&Wi(i)},destroy:function(){ri("destroy",this);var t=this.el;t[Je]=null,xe(t,"mousedown",this._onTapStart),xe(t,"touchstart",this._onTapStart),xe(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(xe(t,"dragover",this),xe(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Mi.splice(Mi.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!pi){if(ri("hideClone",this),Qi.eventCanceled)return;je(hi,"display","none"),this.options.removeCloneOnHide&&hi.parentNode&&hi.parentNode.removeChild(hi),pi=!0}},_showClone:function(t){if("clone"===t.lastPutMode){if(pi){if(ri("showClone",this),Qi.eventCanceled)return;oi.parentNode!=ci||this.options.group.revertClone?di?ci.insertBefore(hi,di):ci.appendChild(hi):ci.insertBefore(hi,oi),this.options.group.revertClone&&this.animate(oi,hi),je(hi,"display",""),pi=!1}}else this._hideClone()}},Hi&&De(document,"touchmove",function(t){(Qi.active||Li)&&t.cancelable&&t.preventDefault()}),Qi.utils={on:De,off:xe,css:je,find:$e,is:function(t,e){return!!Ie(t,e,t,!1)},extend:function(t,e){if(t&&e)for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t},throttle:Ue,closest:Ie,toggleClass:Ne,clone:Qe,index:ze,nextTick:en,cancelNextTick:nn,detectDirection:zi,getChild:Be,expando:Je},Qi.get=function(t){return t[Je]},Qi.mount=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];e[0].constructor===Array&&(e=e[0]),e.forEach(function(t){if(!t.prototype||!t.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(t));t.utils&&(Qi.utils=ge(ge({},Qi.utils),t.utils)),ii.mount(t)})},Qi.create=function(t,e){return new Qi(t,e)},Qi.version="1.15.6";var rn,sn,on,an,ln,cn,dn=[],un=!1;function hn(){dn.forEach(function(t){clearInterval(t.pid)}),dn=[]}function pn(){clearInterval(cn)}var fn=Ue(function(t,e,i,n){if(e.scroll){var r,s=(t.touches?t.touches[0]:t).clientX,o=(t.touches?t.touches[0]:t).clientY,a=e.scrollSensitivity,l=e.scrollSpeed,c=He(),d=!1;sn!==i&&(sn=i,hn(),rn=e.scroll,r=e.scrollFn,!0===rn&&(rn=Ye(i,!0)));var u=0,h=rn;do{var p=h,f=qe(p),g=f.top,m=f.bottom,v=f.left,b=f.right,y=f.width,_=f.height,w=void 0,E=void 0,A=p.scrollWidth,S=p.scrollHeight,k=je(p),C=p.scrollLeft,O=p.scrollTop;p===c?(w=y<A&&("auto"===k.overflowX||"scroll"===k.overflowX||"visible"===k.overflowX),E=_<S&&("auto"===k.overflowY||"scroll"===k.overflowY||"visible"===k.overflowY)):(w=y<A&&("auto"===k.overflowX||"scroll"===k.overflowX),E=_<S&&("auto"===k.overflowY||"scroll"===k.overflowY));var D=w&&(Math.abs(b-s)<=a&&C+y<A)-(Math.abs(v-s)<=a&&!!C),x=E&&(Math.abs(m-o)<=a&&O+_<S)-(Math.abs(g-o)<=a&&!!O);if(!dn[u])for(var T=0;T<=u;T++)dn[T]||(dn[T]={});dn[u].vx==D&&dn[u].vy==x&&dn[u].el===p||(dn[u].el=p,dn[u].vx=D,dn[u].vy=x,clearInterval(dn[u].pid),0==D&&0==x||(d=!0,dn[u].pid=setInterval(function(){n&&0===this.layer&&Qi.active._onTouchMove(ln);var e=dn[this.layer].vy?dn[this.layer].vy*l:0,i=dn[this.layer].vx?dn[this.layer].vx*l:0;"function"==typeof r&&"continue"!==r.call(Qi.dragged.parentNode[Je],i,e,t,ln,dn[this.layer].el)||Xe(dn[this.layer].el,i,e)}.bind({layer:u}),24))),u++}while(e.bubbleScroll&&h!==c&&(h=Ye(h,!1)));un=d}},30),gn=function(t){var e=t.originalEvent,i=t.putSortable,n=t.dragEl,r=t.activeSortable,s=t.dispatchSortableEvent,o=t.hideGhostForTarget,a=t.unhideGhostForTarget;if(e){var l=i||r;o();var c=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e,d=document.elementFromPoint(c.clientX,c.clientY);a(),l&&!l.el.contains(d)&&(s("spill"),this.onSpill({dragEl:n,putSortable:i}))}};function mn(){}function vn(){}mn.prototype={startIndex:null,dragStart:function(t){var e=t.oldDraggableIndex;this.startIndex=e},onSpill:function(t){var e=t.dragEl,i=t.putSortable;this.sortable.captureAnimationState(),i&&i.captureAnimationState();var n=Be(this.sortable.el,this.startIndex,this.options);n?this.sortable.el.insertBefore(e,n):this.sortable.el.appendChild(e),this.sortable.animateAll(),i&&i.animateAll()},drop:gn},be(mn,{pluginName:"revertOnSpill"}),vn.prototype={onSpill:function(t){var e=t.dragEl,i=t.putSortable||this.sortable;i.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),i.animateAll()},drop:gn},be(vn,{pluginName:"removeOnSpill"}),Qi.mount(new function(){function t(){for(var t in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===t.charAt(0)&&"function"==typeof this[t]&&(this[t]=this[t].bind(this))}return t.prototype={dragStarted:function(t){var e=t.originalEvent;this.sortable.nativeDraggable?De(document,"dragover",this._handleAutoScroll):this.options.supportPointer?De(document,"pointermove",this._handleFallbackAutoScroll):e.touches?De(document,"touchmove",this._handleFallbackAutoScroll):De(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var e=t.originalEvent;this.options.dragOverBubble||e.rootEl||this._handleAutoScroll(e)},drop:function(){this.sortable.nativeDraggable?xe(document,"dragover",this._handleAutoScroll):(xe(document,"pointermove",this._handleFallbackAutoScroll),xe(document,"touchmove",this._handleFallbackAutoScroll),xe(document,"mousemove",this._handleFallbackAutoScroll)),pn(),hn(),clearTimeout(Me),Me=void 0},nulling:function(){ln=sn=rn=un=cn=on=an=null,dn.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,e){var i=this,n=(t.touches?t.touches[0]:t).clientX,r=(t.touches?t.touches[0]:t).clientY,s=document.elementFromPoint(n,r);if(ln=t,e||this.options.forceAutoScrollFallback||Ee||we||Se){fn(t,this.options,s,e);var o=Ye(s,!0);!un||cn&&n===on&&r===an||(cn&&pn(),cn=setInterval(function(){var s=Ye(document.elementFromPoint(n,r),!0);s!==o&&(o=s,hn()),fn(t,i.options,s,e)},10),on=n,an=r)}else{if(!this.options.bubbleScroll||Ye(s,!0)===He())return void hn();fn(t,this.options,Ye(s,!1),!1)}}},be(t,{pluginName:"scroll",initializeByDefault:!0})}),Qi.mount(vn,mn);class bn{initSortable(t){const e=t.el.querySelector("[data-sortable]");e&&new Qi(e,{handle:".handle-sort",draggable:"tr",sort:!0,direction:"vertical",async onEnd({item:e}){var i,n,r,s,o,a;const l=e.getAttribute("data-id");if(l){const c=null!==(n=null===(i=e.previousElementSibling)||void 0===i?void 0:i.getAttribute("data-id"))&&void 0!==n?n:null,d=null!==(s=null===(r=e.nextElementSibling)||void 0===r?void 0:r.getAttribute("data-id"))&&void 0!==s?s:null,u=t.el.querySelector("tbody");if(u){let e=null!==(o=u.getAttribute("data-sortable-parent-path"))&&void 0!==o?o:"";e.length&&(e=`${e}-`);const i=null!==(a=u.getAttribute("data-sortable-url"))&&void 0!==a?a:"?do=sort",n={[`${e}item_id`]:l,...c?{[`${e}prev_id`]:c}:{},...d?{[`${e}next_id`]:d}:{}};return await t.ajax.request({method:"GET",url:i,data:n})}}}})}initSortableTree(t){t.el.querySelectorAll(".datagrid-tree-item-children").forEach(t=>{new Qi(t,{handle:".handle-sort",draggable:".datagrid-tree-item:not(.datagrid-tree-header)",async onEnd({item:t}){}})})}}class yn{constructor(t,e={}){this.select=t,this.opts=e}initSelectpickers(t){var e,i,n;const r=null!==(n=null!==(e=this.select)&&void 0!==e?e:null===(i=w())||void 0===i?void 0:i.TomSelect)&&void 0!==n?n:null;r&&t.forEach(t=>{t.hasAttribute("data-Tom-Initialised")||(t.setAttribute("data-Tom-Initialised","true"),new r(t,"function"==typeof this.opts?this.opts(t):this.opts))})}}function _n(t){return t[t.length-1]}function wn(t,...e){return e.forEach(e=>{t.includes(e)||t.push(e)}),t}function En(t,e){return t?t.split(e):[]}function An(t,e,i){return(void 0===e||t>=e)&&(void 0===i||t<=i)}function Sn(t,e,i){return t<e?e:t>i?i:t}function kn(t,e,i={},n=0,r=""){r+=`<${Object.keys(i).reduce((t,e)=>{let r=i[e];return"function"==typeof r&&(r=r(n)),`${t} ${e}="${r}"`},t)}></${t}>`;const s=n+1;return s<e?kn(t,e,i,s,r):r}function Cn(t){return t.replace(/>\s+/g,">").replace(/\s+</,"<")}function On(t){return new Date(t).setHours(0,0,0,0)}function Dn(){return(new Date).setHours(0,0,0,0)}function xn(...t){switch(t.length){case 0:return Dn();case 1:return On(t[0])}const e=new Date(0);return e.setFullYear(...t),e.setHours(0,0,0,0)}function Tn(t,e){const i=new Date(t);return i.setDate(i.getDate()+e)}function Ln(t,e){const i=new Date(t),n=i.getMonth()+e;let r=n%12;r<0&&(r+=12);const s=i.setMonth(n);return i.getMonth()!==r?i.setDate(0):s}function In(t,e){const i=new Date(t),n=i.getMonth(),r=i.setFullYear(i.getFullYear()+e);return 1===n&&2===i.getMonth()?i.setDate(0):r}function Mn(t,e){return(t-e+7)%7}function Fn(t,e,i=0){const n=new Date(t).getDay();return Tn(t,Mn(e,i)-Mn(n,i))}function Nn(t,e){return Math.round((t-e)/6048e5)+1}function jn(t){const e=Fn(t,4,1);return Nn(e,Fn(new Date(e).setMonth(0,4),4,1))}function Pn(t,e){const i=Fn(new Date(t).setMonth(0,1),e,e),n=Fn(t,e,e),r=Nn(n,i);if(r<53)return r;return n===Fn(new Date(t).setDate(32),e,e)?1:r}function $n(t){return Pn(t,0)}function Hn(t){return Pn(t,6)}function qn(t,e){const i=new Date(t).getFullYear();return Math.floor(i/e)*e}function Rn(t,e,i){if(1!==e&&2!==e)return t;const n=new Date(t);return 1===e?i?n.setMonth(n.getMonth()+1,0):n.setDate(1):i?n.setFullYear(n.getFullYear()+1,0,0):n.setMonth(0,1),n.setHours(0,0,0,0)}const Bn=/dd?|DD?|mm?|MM?|yy?(?:yy)?/,Vn=/[\s!-/:-@[-`{-~年月日]+/;let zn={};const Wn={y:(t,e)=>new Date(t).setFullYear(parseInt(e,10)),m(t,e,i){const n=new Date(t);let r=parseInt(e,10)-1;if(isNaN(r)){if(!e)return NaN;const t=e.toLowerCase(),n=e=>e.toLowerCase().startsWith(t);if(r=i.monthsShort.findIndex(n),r<0&&(r=i.months.findIndex(n)),r<0)return NaN}return n.setMonth(r),n.getMonth()!==Kn(r)?n.setDate(0):n.getTime()},d:(t,e)=>new Date(t).setDate(parseInt(e,10))},Yn={d:t=>t.getDate(),dd:t=>Un(t.getDate(),2),D:(t,e)=>e.daysShort[t.getDay()],DD:(t,e)=>e.days[t.getDay()],m:t=>t.getMonth()+1,mm:t=>Un(t.getMonth()+1,2),M:(t,e)=>e.monthsShort[t.getMonth()],MM:(t,e)=>e.months[t.getMonth()],y:t=>t.getFullYear(),yy:t=>Un(t.getFullYear(),2).slice(-2),yyyy:t=>Un(t.getFullYear(),4)};function Kn(t){return t>-1?t%12:Kn(t+12)}function Un(t,e){return t.toString().padStart(e,"0")}function Xn(t){if("string"!=typeof t)throw new Error("Invalid date format.");if(t in zn)return zn[t];const e=t.split(Bn),i=t.match(new RegExp(Bn,"g"));if(0===e.length||!i)throw new Error("Invalid date format.");const n=i.map(t=>Yn[t]),r=Object.keys(Wn).reduce((t,e)=>(i.find(t=>"D"!==t[0]&&t[0].toLowerCase()===e)&&t.push(e),t),[]);return zn[t]={parser(t,e){const n=t.split(Vn).reduce((t,e,n)=>{if(e.length>0&&i[n]){const r=i[n][0];"M"===r?t.m=e:"D"!==r&&(t[r]=e)}return t},{});return r.reduce((t,i)=>{const r=Wn[i](t,n[i],e);return isNaN(r)?t:r},Dn())},formatter(t,i){let r=n.reduce((n,r,s)=>n+`${e[s]}${r(t,i)}`,"");return r+_n(e)}}}function Qn(t,e,i){if(t instanceof Date||"number"==typeof t){const e=On(t);return isNaN(e)?void 0:e}if(t){if("today"===t)return Dn();if(e&&e.toValue){const n=e.toValue(t,e,i);return isNaN(n)?void 0:On(n)}return Xn(e).parser(t,i)}}function Gn(t,e,i){if(isNaN(t)||!t&&0!==t)return"";const n="number"==typeof t?new Date(t):t;return e.toDisplay?e.toDisplay(n,e,i):Xn(e).formatter(n,i)}const Jn=document.createRange();function Zn(t){return Jn.createContextualFragment(t)}function tr(t){return t.parentElement||(t.parentNode instanceof ShadowRoot?t.parentNode.host:void 0)}function er(t){return t.getRootNode().activeElement===t}function ir(t){"none"!==t.style.display&&(t.style.display&&(t.dataset.styleDisplay=t.style.display),t.style.display="none")}function nr(t){"none"===t.style.display&&(t.dataset.styleDisplay?(t.style.display=t.dataset.styleDisplay,delete t.dataset.styleDisplay):t.style.display="")}function rr(t){t.firstChild&&(t.removeChild(t.firstChild),rr(t))}const sr=new WeakMap,{addEventListener:or,removeEventListener:ar}=EventTarget.prototype;function lr(t,e){let i=sr.get(t);i||(i=[],sr.set(t,i)),e.forEach(t=>{or.call(...t),i.push(t)})}if(!Event.prototype.composedPath){const t=(e,i=[])=>{let n;return i.push(e),e.parentNode?n=e.parentNode:e.host?n=e.host:e.defaultView&&(n=e.defaultView),n?t(n,i):i};Event.prototype.composedPath=function(){return t(this.target)}}function cr(t,e,i){const[n,...r]=t;return e(n)?n:n!==i&&"HTML"!==n.tagName&&0!==r.length?cr(r,e,i):void 0}function dr(t,e){const i="function"==typeof e?e:t=>t instanceof Element&&t.matches(e);return cr(t.composedPath(),i,t.currentTarget)}var ur={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear",titleFormat:"MM y"}},hr={autohide:!1,beforeShowDay:null,beforeShowDecade:null,beforeShowMonth:null,beforeShowYear:null,clearButton:!1,dateDelimiter:",",datesDisabled:[],daysOfWeekDisabled:[],daysOfWeekHighlighted:[],defaultViewDate:void 0,disableTouchKeyboard:!1,enableOnReadonly:!0,format:"mm/dd/yyyy",language:"en",maxDate:null,maxNumberOfDates:1,maxView:3,minDate:null,nextArrow:"»",orientation:"auto",pickLevel:0,prevArrow:"«",showDaysOfWeek:!0,showOnClick:!0,showOnFocus:!0,startView:0,title:"",todayButton:!1,todayButtonMode:0,todayHighlight:!1,updateOnBlur:!0,weekNumbers:0,weekStart:0};const{language:pr,format:fr,weekStart:gr}=hr;function mr(t,e){return t.length<6&&e>=0&&e<7?wn(t,e):t}function vr(t,e){switch(4===t?6===e?3:!e+1:t){case 1:return jn;case 2:return $n;case 3:return Hn}}function br(t,e,i){return e.weekStart=t,e.weekEnd=(t+6)%7,4===i&&(e.getWeekNumber=vr(4,t)),t}function yr(t,e,i,n){const r=Qn(t,e,i);return void 0!==r?r:n}function _r(t,e,i=3){const n=parseInt(t,10);return n>=0&&n<=i?n:e}function wr(t,e,i,n=void 0){e in t&&(i in t||(t[i]=n?n(t[e]):t[e]),delete t[e])}function Er(t,e){const i=Object.assign({},t),n={},r=e.constructor.locales,s=!!e.rangeSideIndex;let{datesDisabled:o,format:a,language:l,locale:c,maxDate:d,maxView:u,minDate:h,pickLevel:p,startView:f,weekNumbers:g,weekStart:m}=e.config||{};if(wr(i,"calendarWeeks","weekNumbers",t=>t?1:0),wr(i,"clearBtn","clearButton"),wr(i,"todayBtn","todayButton"),wr(i,"todayBtnMode","todayButtonMode"),i.language){let t;if(i.language!==l&&(r[i.language]?t=i.language:(t=i.language.split("-")[0],r[t]||(t=!1))),delete i.language,t){l=n.language=t;const e=c||r[pr];c=Object.assign({format:fr,weekStart:gr},r[pr]),l!==pr&&Object.assign(c,r[l]),n.locale=c,a===e.format&&(a=n.format=c.format),m===e.weekStart&&(m=br(c.weekStart,n,g))}}if(i.format){const t="function"==typeof i.format.toDisplay,e="function"==typeof i.format.toValue,r=Bn.test(i.format);(t&&e||r)&&(a=n.format=i.format),delete i.format}let v=p;"pickLevel"in i&&(v=_r(i.pickLevel,p,2),delete i.pickLevel),v!==p&&(v>p&&("minDate"in i||(i.minDate=h),"maxDate"in i||(i.maxDate=d)),o&&!i.datesDisabled&&(i.datesDisabled=[]),p=n.pickLevel=v);let b=h,y=d;if("minDate"in i){const t=xn(0,0,1);b=null===i.minDate?t:yr(i.minDate,a,c,b),b!==t&&(b=Rn(b,p,!1)),delete i.minDate}if("maxDate"in i&&(y=null===i.maxDate?void 0:yr(i.maxDate,a,c,y),void 0!==y&&(y=Rn(y,p,!0)),delete i.maxDate),y<b?(h=n.minDate=y,d=n.maxDate=b):(h!==b&&(h=n.minDate=b),d!==y&&(d=n.maxDate=y)),i.datesDisabled){const t=i.datesDisabled;if("function"==typeof t)n.datesDisabled=null,n.checkDisabled=(e,i)=>t(new Date(e),i,s);else{const e=n.datesDisabled=t.reduce((t,e)=>{const i=Qn(e,a,c);return void 0!==i?wn(t,Rn(i,p,s)):t},[]);n.checkDisabled=t=>e.includes(t)}delete i.datesDisabled}if("defaultViewDate"in i){const t=Qn(i.defaultViewDate,a,c);void 0!==t&&(n.defaultViewDate=t),delete i.defaultViewDate}if("weekStart"in i){const t=Number(i.weekStart)%7;isNaN(t)||(m=br(t,n,g)),delete i.weekStart}if(i.daysOfWeekDisabled&&(n.daysOfWeekDisabled=i.daysOfWeekDisabled.reduce(mr,[]),delete i.daysOfWeekDisabled),i.daysOfWeekHighlighted&&(n.daysOfWeekHighlighted=i.daysOfWeekHighlighted.reduce(mr,[]),delete i.daysOfWeekHighlighted),"weekNumbers"in i){let t=i.weekNumbers;if(t){const e="function"==typeof t?(e,i)=>t(new Date(e),i):vr(t=parseInt(t,10),m);e&&(g=n.weekNumbers=t,n.getWeekNumber=e)}else g=n.weekNumbers=0,n.getWeekNumber=null;delete i.weekNumbers}if("maxNumberOfDates"in i){const t=parseInt(i.maxNumberOfDates,10);t>=0&&(n.maxNumberOfDates=t,n.multidate=1!==t),delete i.maxNumberOfDates}i.dateDelimiter&&(n.dateDelimiter=String(i.dateDelimiter),delete i.dateDelimiter);let _=u;"maxView"in i&&(_=_r(i.maxView,u),delete i.maxView),_=p>_?p:_,_!==u&&(u=n.maxView=_);let w=f;if("startView"in i&&(w=_r(i.startView,w),delete i.startView),w<p?w=p:w>u&&(w=u),w!==f&&(n.startView=w),i.prevArrow){const t=Zn(i.prevArrow);t.childNodes.length>0&&(n.prevArrow=t.childNodes),delete i.prevArrow}if(i.nextArrow){const t=Zn(i.nextArrow);t.childNodes.length>0&&(n.nextArrow=t.childNodes),delete i.nextArrow}if("disableTouchKeyboard"in i&&(n.disableTouchKeyboard="ontouchstart"in document&&!!i.disableTouchKeyboard,delete i.disableTouchKeyboard),i.orientation){const t=i.orientation.toLowerCase().split(/\s+/g);n.orientation={x:t.find(t=>"left"===t||"right"===t)||"auto",y:t.find(t=>"top"===t||"bottom"===t)||"auto"},delete i.orientation}if("todayButtonMode"in i){switch(i.todayButtonMode){case 0:case 1:n.todayButtonMode=i.todayButtonMode}delete i.todayButtonMode}return Object.entries(i).forEach(([t,e])=>{void 0!==e&&t in hr&&(n[t]=e)}),n}const Ar={show:{key:"ArrowDown"},hide:null,toggle:{key:"Escape"},prevButton:{key:"ArrowLeft",ctrlOrMetaKey:!0},nextButton:{key:"ArrowRight",ctrlOrMetaKey:!0},viewSwitch:{key:"ArrowUp",ctrlOrMetaKey:!0},clearButton:{key:"Backspace",ctrlOrMetaKey:!0},todayButton:{key:".",ctrlOrMetaKey:!0},exitEditMode:{key:"ArrowDown",ctrlOrMetaKey:!0}};const Sr=t=>t.map(t=>`<button type="button" class="%buttonClass% ${t}" tabindex="-1"></button>`).join("");var kr=Cn(`<div class="datepicker">\n <div class="datepicker-picker">\n <div class="datepicker-header">\n <div class="datepicker-title"></div>\n <div class="datepicker-controls">\n ${Sr(["prev-button prev-btn","view-switch","next-button next-btn"])}\n </div>\n </div>\n <div class="datepicker-main"></div>\n <div class="datepicker-footer">\n <div class="datepicker-controls">\n ${Sr(["today-button today-btn","clear-button clear-btn"])}\n </div>\n </div>\n </div>\n</div>`),Cr=Cn(`<div class="days">\n <div class="days-of-week">${kn("span",7,{class:"dow"})}</div>\n <div class="datepicker-grid">${kn("span",42)}</div>\n</div>`),Or=Cn(`<div class="week-numbers calendar-weeks">\n <div class="days-of-week"><span class="dow"></span></div>\n <div class="weeks">${kn("span",6,{class:"week"})}</div>\n</div>`);class Dr{constructor(t,e){Object.assign(this,e,{picker:t,element:Zn('<div class="datepicker-view"></div>').firstChild,selected:[],isRangeEnd:!!t.datepicker.rangeSideIndex}),this.init(this.picker.datepicker.config)}init(t){"pickLevel"in t&&(this.isMinView=this.id===t.pickLevel),this.setOptions(t),this.updateFocus(),this.updateSelection()}prepareForRender(t,e,i){this.disabled=[];const n=this.picker;n.setViewSwitchLabel(t),n.setPrevButtonDisabled(e),n.setNextButtonDisabled(i)}setDisabled(t,e){e.add("disabled"),wn(this.disabled,t)}performBeforeHook(t,e){let i=this.beforeShow(new Date(e));switch(typeof i){case"boolean":i={enabled:i};break;case"string":i={classes:i}}if(i){const n=t.classList;if(!1===i.enabled&&this.setDisabled(e,n),i.classes){const t=i.classes.split(/\s+/);n.add(...t),t.includes("disabled")&&this.setDisabled(e,n)}i.content&&function(t,e){rr(t),e instanceof DocumentFragment?t.appendChild(e):"string"==typeof e?t.appendChild(Zn(e)):"function"==typeof e.forEach&&e.forEach(e=>{t.appendChild(e)})}(t,i.content)}}renderCell(t,e,i,n,{selected:r,range:s},o,a=[]){t.textContent=e,this.isMinView&&(t.dataset.date=n);const l=t.classList;if(t.className=`datepicker-cell ${this.cellClass}`,i<this.first?l.add("prev"):i>this.last&&l.add("next"),l.add(...a),(o||this.checkDisabled(n,this.id))&&this.setDisabled(n,l),s){const[t,e]=s;i>t&&i<e&&l.add("range"),i===t&&l.add("range-start"),i===e&&l.add("range-end")}r.includes(i)&&l.add("selected"),i===this.focused&&l.add("focused"),this.beforeShow&&this.performBeforeHook(t,n)}refreshCell(t,e,i,[n,r]){const s=t.classList;s.remove("range","range-start","range-end","selected","focused"),e>n&&e<r&&s.add("range"),e===n&&s.add("range-start"),e===r&&s.add("range-end"),i.includes(e)&&s.add("selected"),e===this.focused&&s.add("focused")}changeFocusedCell(t){this.grid.querySelectorAll(".focused").forEach(t=>{t.classList.remove("focused")}),this.grid.children[t].classList.add("focused")}}class xr extends Dr{constructor(t){super(t,{id:0,name:"days",cellClass:"day"})}init(t,e=!0){if(e){const t=Zn(Cr).firstChild;this.dow=t.firstChild,this.grid=t.lastChild,this.element.appendChild(t)}super.init(t)}setOptions(t){let e;if("minDate"in t&&(this.minDate=t.minDate),"maxDate"in t&&(this.maxDate=t.maxDate),t.checkDisabled&&(this.checkDisabled=t.checkDisabled),t.daysOfWeekDisabled&&(this.daysOfWeekDisabled=t.daysOfWeekDisabled,e=!0),t.daysOfWeekHighlighted&&(this.daysOfWeekHighlighted=t.daysOfWeekHighlighted),"todayHighlight"in t&&(this.todayHighlight=t.todayHighlight),"weekStart"in t&&(this.weekStart=t.weekStart,this.weekEnd=t.weekEnd,e=!0),t.locale){const i=this.locale=t.locale;this.dayNames=i.daysMin,this.switchLabelFormat=i.titleFormat,e=!0}if("beforeShowDay"in t&&(this.beforeShow="function"==typeof t.beforeShowDay?t.beforeShowDay:void 0),"weekNumbers"in t)if(t.weekNumbers&&!this.weekNumbers){const t=Zn(Or).firstChild;this.weekNumbers={element:t,dow:t.firstChild,weeks:t.lastChild},this.element.insertBefore(t,this.element.firstChild)}else this.weekNumbers&&!t.weekNumbers&&(this.element.removeChild(this.weekNumbers.element),this.weekNumbers=null);"getWeekNumber"in t&&(this.getWeekNumber=t.getWeekNumber),"showDaysOfWeek"in t&&(t.showDaysOfWeek?(nr(this.dow),this.weekNumbers&&nr(this.weekNumbers.dow)):(ir(this.dow),this.weekNumbers&&ir(this.weekNumbers.dow))),e&&Array.from(this.dow.children).forEach((t,e)=>{const i=(this.weekStart+e)%7;t.textContent=this.dayNames[i],t.className=this.daysOfWeekDisabled.includes(i)?"dow disabled":"dow"})}updateFocus(){const t=new Date(this.picker.viewDate),e=t.getFullYear(),i=t.getMonth(),n=xn(e,i,1),r=Fn(n,this.weekStart,this.weekStart);this.first=n,this.last=xn(e,i+1,0),this.start=r,this.focused=this.picker.viewDate}updateSelection(){const{dates:t,rangepicker:e}=this.picker.datepicker;this.selected=t,e&&(this.range=e.dates)}render(){if(this.today=this.todayHighlight?Dn():void 0,this.prepareForRender(Gn(this.focused,this.switchLabelFormat,this.locale),this.first<=this.minDate,this.last>=this.maxDate),this.weekNumbers){const t=this.weekStart,e=Fn(this.first,t,t);Array.from(this.weekNumbers.weeks.children).forEach((i,n)=>{const r=Tn(e,7*n);i.textContent=this.getWeekNumber(r,t),n>3&&i.classList[r>this.last?"add":"remove"]("next")})}Array.from(this.grid.children).forEach((t,e)=>{const i=Tn(this.start,e),n=new Date(i),r=n.getDay(),s=[];this.today===i&&s.push("today"),this.daysOfWeekHighlighted.includes(r)&&s.push("highlighted"),this.renderCell(t,n.getDate(),i,i,this,i<this.minDate||i>this.maxDate||this.daysOfWeekDisabled.includes(r),s)})}refresh(){const t=this.range||[];Array.from(this.grid.children).forEach(e=>{this.refreshCell(e,Number(e.dataset.date),this.selected,t)})}refreshFocus(){this.changeFocusedCell(Math.round((this.focused-this.start)/864e5))}}function Tr(t,e){if(!t||!t[0]||!t[1])return;const[[i,n],[r,s]]=t;return i>e||r<e?void 0:[i===e?n:-1,r===e?s:12]}class Lr extends Dr{constructor(t){super(t,{id:1,name:"months",cellClass:"month"})}init(t,e=!0){e&&(this.grid=this.element,this.element.classList.add("months","datepicker-grid"),this.grid.appendChild(Zn(kn("span",12,{"data-month":t=>t}))),this.first=0,this.last=11),super.init(t)}setOptions(t){if(t.locale&&(this.monthNames=t.locale.monthsShort),"minDate"in t)if(void 0===t.minDate)this.minYear=this.minMonth=this.minDate=void 0;else{const e=new Date(t.minDate);this.minYear=e.getFullYear(),this.minMonth=e.getMonth(),this.minDate=e.setDate(1)}if("maxDate"in t)if(void 0===t.maxDate)this.maxYear=this.maxMonth=this.maxDate=void 0;else{const e=new Date(t.maxDate);this.maxYear=e.getFullYear(),this.maxMonth=e.getMonth(),this.maxDate=xn(this.maxYear,this.maxMonth+1,0)}t.checkDisabled&&(this.checkDisabled=this.isMinView||null===t.datesDisabled?t.checkDisabled:()=>!1),"beforeShowMonth"in t&&(this.beforeShow="function"==typeof t.beforeShowMonth?t.beforeShowMonth:void 0)}updateFocus(){const t=new Date(this.picker.viewDate);this.year=t.getFullYear(),this.focused=t.getMonth()}updateSelection(){const{dates:t,rangepicker:e}=this.picker.datepicker;this.selected=t.reduce((t,e)=>{const i=new Date(e),n=i.getFullYear(),r=i.getMonth();return void 0===t[n]?t[n]=[r]:wn(t[n],r),t},{}),e&&e.dates&&(this.range=e.dates.map(t=>{const e=new Date(t);return isNaN(e)?void 0:[e.getFullYear(),e.getMonth()]}))}render(){this.prepareForRender(this.year,this.year<=this.minYear,this.year>=this.maxYear);const t=this.selected[this.year]||[],e=this.year<this.minYear||this.year>this.maxYear,i=this.year===this.minYear,n=this.year===this.maxYear,r=Tr(this.range,this.year);Array.from(this.grid.children).forEach((s,o)=>{const a=Rn(new Date(this.year,o,1),1,this.isRangeEnd);this.renderCell(s,this.monthNames[o],o,a,{selected:t,range:r},e||i&&o<this.minMonth||n&&o>this.maxMonth)})}refresh(){const t=this.selected[this.year]||[],e=Tr(this.range,this.year)||[];Array.from(this.grid.children).forEach((i,n)=>{this.refreshCell(i,n,t,e)})}refreshFocus(){this.changeFocusedCell(this.focused)}}class Ir extends Dr{constructor(t,e){super(t,e)}init(t,e=!0){var i;e&&(this.navStep=10*this.step,this.beforeShowOption=`beforeShow${i=this.cellClass,[...i].reduce((t,e,i)=>t+(i?e:e.toUpperCase()),"")}`,this.grid=this.element,this.element.classList.add(this.name,"datepicker-grid"),this.grid.appendChild(Zn(kn("span",12)))),super.init(t)}setOptions(t){if("minDate"in t&&(void 0===t.minDate?this.minYear=this.minDate=void 0:(this.minYear=qn(t.minDate,this.step),this.minDate=xn(this.minYear,0,1))),"maxDate"in t&&(void 0===t.maxDate?this.maxYear=this.maxDate=void 0:(this.maxYear=qn(t.maxDate,this.step),this.maxDate=xn(this.maxYear,11,31))),t.checkDisabled&&(this.checkDisabled=this.isMinView||null===t.datesDisabled?t.checkDisabled:()=>!1),this.beforeShowOption in t){const e=t[this.beforeShowOption];this.beforeShow="function"==typeof e?e:void 0}}updateFocus(){const t=new Date(this.picker.viewDate),e=qn(t,this.navStep),i=e+9*this.step;this.first=e,this.last=i,this.start=e-this.step,this.focused=qn(t,this.step)}updateSelection(){const{dates:t,rangepicker:e}=this.picker.datepicker;this.selected=t.reduce((t,e)=>wn(t,qn(e,this.step)),[]),e&&e.dates&&(this.range=e.dates.map(t=>{if(void 0!==t)return qn(t,this.step)}))}render(){this.prepareForRender(`${this.first}-${this.last}`,this.first<=this.minYear,this.last>=this.maxYear),Array.from(this.grid.children).forEach((t,e)=>{const i=this.start+e*this.step,n=Rn(new Date(i,0,1),2,this.isRangeEnd);t.dataset.year=i,this.renderCell(t,i,i,n,this,i<this.minYear||i>this.maxYear)})}refresh(){const t=this.range||[];Array.from(this.grid.children).forEach(e=>{this.refreshCell(e,Number(e.textContent),this.selected,t)})}refreshFocus(){this.changeFocusedCell(Math.round((this.focused-this.start)/this.step))}}function Mr(t,e){const i={bubbles:!0,cancelable:!0,detail:{date:t.getDate(),viewDate:new Date(t.picker.viewDate),viewId:t.picker.currentView.id,datepicker:t}};t.element.dispatchEvent(new CustomEvent(e,i))}function Fr(t,e){const{config:i,picker:n}=t,{currentView:r,viewDate:s}=n;let o;switch(r.id){case 0:o=Ln(s,e);break;case 1:o=In(s,e);break;default:o=In(s,e*r.navStep)}o=Sn(o,i.minDate,i.maxDate),n.changeFocus(o).render()}function Nr(t){const e=t.picker.currentView.id;e!==t.config.maxView&&t.picker.changeView(e+1).render()}function jr(t){t.setDate({clear:!0})}function Pr(t){const e=Dn();1===t.config.todayButtonMode?t.setDate(e,{forceRefresh:!0,viewDate:e}):t.setFocusedDate(e,!0)}function $r(t){const e=()=>{t.config.updateOnBlur?t.update({revert:!0}):t.refresh("input"),t.hide()},i=t.element;er(i)?i.addEventListener("blur",e,{once:!0}):e()}function Hr(t,e){const i=t.picker,n=new Date(i.viewDate),r=i.currentView.id,s=1===r?Ln(n,e-n.getMonth()):In(n,e-n.getFullYear());i.changeFocus(s).changeView(r-1).render()}function qr(t){Nr(t)}function Rr(t){Fr(t,-1)}function Br(t){Fr(t,1)}function Vr(t,e){const i=dr(e,".datepicker-cell");if(!i||i.classList.contains("disabled"))return;const{id:n,isMinView:r}=t.picker.currentView,s=i.dataset;r?t.setDate(Number(s.date)):Hr(t,Number(1===n?s.month:s.year))}function zr(t){t.preventDefault()}const Wr=["left","top","right","bottom"].reduce((t,e)=>(t[e]=`datepicker-orient-${e}`,t),{}),Yr=t=>t?`${t}px`:t;function Kr(t,e){if("title"in e&&(e.title?(t.controls.title.textContent=e.title,nr(t.controls.title)):(t.controls.title.textContent="",ir(t.controls.title))),e.prevArrow){const i=t.controls.prevButton;rr(i),e.prevArrow.forEach(t=>{i.appendChild(t.cloneNode(!0))})}if(e.nextArrow){const i=t.controls.nextButton;rr(i),e.nextArrow.forEach(t=>{i.appendChild(t.cloneNode(!0))})}if(e.locale&&(t.controls.todayButton.textContent=e.locale.today,t.controls.clearButton.textContent=e.locale.clear),"todayButton"in e&&(e.todayButton?nr(t.controls.todayButton):ir(t.controls.todayButton)),"minDate"in e||"maxDate"in e){const{minDate:e,maxDate:i}=t.datepicker.config;t.controls.todayButton.disabled=!An(Dn(),e,i)}"clearButton"in e&&(e.clearButton?nr(t.controls.clearButton):ir(t.controls.clearButton))}function Ur(t){const{dates:e,config:i,rangeSideIndex:n}=t;return Sn(e.length>0?_n(e):Rn(i.defaultViewDate,i.pickLevel,n),i.minDate,i.maxDate)}function Xr(t,e){"_oldViewDate"in t||e===t.viewDate||(t._oldViewDate=t.viewDate),t.viewDate=e;const{id:i,year:n,first:r,last:s}=t.currentView,o=new Date(e).getFullYear();switch(i){case 0:return e<r||e>s;case 1:return o!==n;default:return o<r||o>s}}function Qr(t){return window.getComputedStyle(t).direction}function Gr(t){const e=tr(t);if(e!==document.body&&e)return"visible"!==window.getComputedStyle(e).overflow?e:Gr(e)}class Jr{constructor(t){const{config:e,inputField:i}=this.datepicker=t,n=kr.replace(/%buttonClass%/g,e.buttonClass),r=this.element=Zn(n).firstChild,[s,o,a]=r.firstChild.children,l=s.firstElementChild,[c,d,u]=s.lastElementChild.children,[h,p]=a.firstChild.children,f={title:l,prevButton:c,viewSwitch:d,nextButton:u,todayButton:h,clearButton:p};this.main=o,this.controls=f;const g=i?"dropdown":"inline";r.classList.add(`datepicker-${g}`),Kr(this,e),this.viewDate=Ur(t),lr(t,[[r,"mousedown",zr],[o,"click",Vr.bind(null,t)],[f.viewSwitch,"click",qr.bind(null,t)],[f.prevButton,"click",Rr.bind(null,t)],[f.nextButton,"click",Br.bind(null,t)],[f.todayButton,"click",Pr.bind(null,t)],[f.clearButton,"click",jr.bind(null,t)]]),this.views=[new xr(this),new Lr(this),new Ir(this,{id:2,name:"years",cellClass:"year",step:1}),new Ir(this,{id:3,name:"decades",cellClass:"decade",step:10})],this.currentView=this.views[e.startView],this.currentView.render(),this.main.appendChild(this.currentView.element),e.container?e.container.appendChild(this.element):i.after(this.element)}setOptions(t){Kr(this,t),this.views.forEach(e=>{e.init(t,!1)}),this.currentView.render()}detach(){this.element.remove()}show(){if(this.active)return;const{datepicker:t,element:e}=this,i=t.inputField;if(i){const n=Qr(i);n!==Qr(tr(e))?e.dir=n:e.dir&&e.removeAttribute("dir"),this.place(),e.classList.add("active"),t.config.disableTouchKeyboard&&i.blur()}else e.classList.add("active");this.active=!0,Mr(t,"show")}hide(){this.active&&(this.datepicker.exitEditMode(),this.element.classList.remove("active"),this.active=!1,Mr(this.datepicker,"hide"))}place(){const{classList:t,style:e}=this.element;e.display="block";const{width:i,height:n}=this.element.getBoundingClientRect(),r=this.element.offsetParent;e.display="";const{config:s,inputField:o}=this.datepicker,{left:a,top:l,right:c,bottom:d,width:u,height:h}=o.getBoundingClientRect();let{x:p,y:f}=s.orientation,g=a,m=l;if(r!==document.body&&r){const t=r.getBoundingClientRect();g-=t.left-r.scrollLeft,m-=t.top-r.scrollTop}else g+=window.scrollX,m+=window.scrollY;const v=Gr(o);let b=0,y=0,{clientWidth:_,clientHeight:w}=document.documentElement;if(v){const t=v.getBoundingClientRect();t.top>0&&(y=t.top),t.left>0&&(b=t.left),t.right<_&&(_=t.right),t.bottom<w&&(w=t.bottom)}let E=0;"auto"===p&&(a<b?(p="left",E=b-a):a+i>_?(p="right",_<c&&(E=_-c)):p="rtl"===Qr(o)?c-i<b?"left":"right":"left"),"right"===p&&(g+=u-i),g+=E,"auto"===f&&(f=l-n>y&&d+n>w?"top":"bottom"),"top"===f?m-=n:m+=h,t.remove(...Object.values(Wr)),t.add(Wr[p],Wr[f]),e.left=Yr(g),e.top=Yr(m)}setViewSwitchLabel(t){this.controls.viewSwitch.textContent=t}setPrevButtonDisabled(t){this.controls.prevButton.disabled=t}setNextButtonDisabled(t){this.controls.nextButton.disabled=t}changeView(t){const e=this.currentView;return t!==e.id&&(this._oldView||(this._oldView=e),this.currentView=this.views[t],this._renderMethod="render"),this}changeFocus(t){return this._renderMethod=Xr(this,t)?"render":"refreshFocus",this.views.forEach(t=>{t.updateFocus()}),this}update(t=void 0){const e=void 0===t?Ur(this.datepicker):t;return this._renderMethod=Xr(this,e)?"render":"refresh",this.views.forEach(t=>{t.updateFocus(),t.updateSelection()}),this}render(t=!0){const{currentView:e,datepicker:i,_oldView:n}=this,r=new Date(this._oldViewDate),s=t&&this._renderMethod||"render";if(delete this._oldView,delete this._oldViewDate,delete this._renderMethod,e[s](),n&&(this.main.replaceChild(e.element,n.element),Mr(i,"changeView")),!isNaN(r)){const t=new Date(this.viewDate);t.getFullYear()!==r.getFullYear()&&Mr(i,"changeYear"),t.getMonth()!==r.getMonth()&&Mr(i,"changeMonth")}}}function Zr(t,e,i,n,r,s){if(An(t,r,s)){if(n(t)){return Zr(e(t,i),e,i,n,r,s)}return t}}function ts(t,e,i){const n=t.picker,r=n.currentView,s=r.step||1;let o,a=n.viewDate;switch(r.id){case 0:a=Tn(a,i?7*e:e),o=Tn;break;case 1:a=Ln(a,i?4*e:e),o=Ln;break;default:a=In(a,e*(i?4:1)*s),o=In}a=Zr(a,o,e<0?-s:s,t=>r.disabled.includes(t),r.minDate,r.maxDate),void 0!==a&&n.changeFocus(a).render()}function es(t,e){const{config:i,picker:n,editMode:r}=t,s=n.active,{key:o,altKey:a,shiftKey:l}=e,c=e.ctrlKey||e.metaKey,d=()=>{e.preventDefault(),e.stopPropagation()};if("Tab"===o)return void $r(t);if("Enter"===o){if(s)if(r)t.exitEditMode({update:!0,autohide:i.autohide});else{const e=n.currentView;e.isMinView?t.setDate(n.viewDate):(n.changeView(e.id-1).render(),d())}else t.update();return}const u=i.shortcutKeys,h={key:o,ctrlOrMetaKey:c,altKey:a,shiftKey:l},p=Object.keys(u).find(t=>{const e=u[t];return!Object.keys(e).find(t=>e[t]!==h[t])});if(p){let e;if("toggle"===p?e=p:r?"exitEditMode"===p&&(e=p):s?"hide"===p?e=p:"prevButton"===p?e=[Fr,[t,-1]]:"nextButton"===p?e=[Fr,[t,1]]:"viewSwitch"===p?e=[Nr,[t]]:i.clearButton&&"clearButton"===p?e=[jr,[t]]:i.todayButton&&"todayButton"===p&&(e=[Pr,[t]]):"show"===p&&(e=p),e)return Array.isArray(e)?e[0].apply(null,e[1]):t[e](),void d()}if(!s||r)return;const f=(i,n)=>{l||c||a?t.enterEditMode():(ts(t,i,n),e.preventDefault())};"ArrowLeft"===o?f(-1,!1):"ArrowRight"===o?f(1,!1):"ArrowUp"===o?f(-1,!0):"ArrowDown"===o?f(1,!0):("Backspace"===o||"Delete"===o||o&&1===o.length&&!c)&&t.enterEditMode()}function is(t){t.config.showOnFocus&&!t._showing&&t.show()}function ns(t,e){const i=e.target;(t.picker.active||t.config.showOnClick)&&(i._active=er(i),i._clicking=setTimeout(()=>{delete i._active,delete i._clicking},2e3))}function rs(t,e){const i=e.target;i._clicking&&(clearTimeout(i._clicking),delete i._clicking,i._active&&t.enterEditMode(),delete i._active,t.config.showOnClick&&t.show())}function ss(t,e){e.clipboardData.types.includes("text/plain")&&t.enterEditMode()}function os(t,e){const{element:i,picker:n}=t;if(!n.active&&!er(i))return;const r=n.element;dr(e,t=>t===i||t===r)||$r(t)}function as(t,e){return t.map(t=>Gn(t,e.format,e.locale)).join(e.dateDelimiter)}function ls(t,e,i=!1){if(0===e.length)return i?[]:void 0;const{config:n,dates:r,rangeSideIndex:s}=t,{pickLevel:o,maxNumberOfDates:a}=n;let l=e.reduce((t,e)=>{let i=Qn(e,n.format,n.locale);return void 0===i||(i=Rn(i,o,s),!An(i,n.minDate,n.maxDate)||t.includes(i)||n.checkDisabled(i,o)||!(o>0)&&n.daysOfWeekDisabled.includes(new Date(i).getDay())||t.push(i)),t},[]);return 0!==l.length?(n.multidate&&!i&&(l=l.reduce((t,e)=>(r.includes(e)||t.push(e),t),r.filter(t=>!l.includes(t)))),a&&l.length>a?l.slice(-1*a):l):void 0}function cs(t,e=3,i=!0,n=void 0){const{config:r,picker:s,inputField:o}=t;if(2&e){const t=s.active?r.pickLevel:r.startView;s.update(n).changeView(t).render(i)}1&e&&o&&(o.value=as(t.dates,r))}function ds(t,e,i){const n=t.config;let{clear:r,render:s,autohide:o,revert:a,forceRefresh:l,viewDate:c}=i;void 0===s&&(s=!0),s?void 0===o&&(o=n.autohide):o=l=!1,c=Qn(c,n.format,n.locale);const d=ls(t,e,r);(d||a)&&(d&&d.toString()!==t.dates.toString()?(t.dates=d,cs(t,s?3:1,!0,c),Mr(t,"changeDate")):cs(t,l?3:1,!0,c),o&&t.hide())}function us(t,e){return e?i=>Gn(i,e,t.config.locale):t=>new Date(t)}class hs{constructor(t,e={},i=void 0){t.datepicker=this,this.element=t,this.dates=[];const n=this.config=Object.assign({buttonClass:e.buttonClass&&String(e.buttonClass)||"button",container:null,defaultViewDate:Dn(),maxDate:void 0,minDate:void 0},Er(hr,this));let r;if("INPUT"===t.tagName?(r=this.inputField=t,r.classList.add("datepicker-input"),e.container&&(n.container=e.container instanceof HTMLElement?e.container:document.querySelector(e.container))):n.container=t,i){const t=i.inputs.indexOf(r),e=i.datepickers;if(t<0||t>1||!Array.isArray(e))throw Error("Invalid rangepicker object.");e[t]=this,this.rangepicker=i,this.rangeSideIndex=t}this._options=e,Object.assign(n,Er(e,this)),n.shortcutKeys=function(t){return Object.keys(Ar).reduce((e,i)=>{const n=void 0===t[i]?Ar[i]:t[i],r=n&&n.key;if(!r||"string"!=typeof r)return e;const s={key:r,ctrlOrMetaKey:!!(n.ctrlOrMetaKey||n.ctrlKey||n.metaKey)};return r.length>1&&(s.altKey=!!n.altKey,s.shiftKey=!!n.shiftKey),e[i]=s,e},{})}(e.shortcutKeys||{});const s=En(t.value||t.dataset.date,n.dateDelimiter);delete t.dataset.date;const o=ls(this,s);o&&o.length>0&&(this.dates=o),r&&(r.value=as(this.dates,n));const a=this.picker=new Jr(this),l=[t,"keydown",es.bind(null,this)];r?lr(this,[l,[r,"focus",is.bind(null,this)],[r,"mousedown",ns.bind(null,this)],[r,"click",rs.bind(null,this)],[r,"paste",ss.bind(null,this)],[document,"mousedown",os.bind(null,this)],[window,"resize",a.place.bind(a)]]):(lr(this,[l]),this.show())}static formatDate(t,e,i){return Gn(t,e,i&&ur[i]||ur.en)}static parseDate(t,e,i){return Qn(t,e,i&&ur[i]||ur.en)}static get locales(){return ur}get active(){return!(!this.picker||!this.picker.active)}get pickerElement(){return this.picker?this.picker.element:void 0}setOptions(t){const e=Er(t,this);Object.assign(this._options,t),Object.assign(this.config,e),this.picker.setOptions(e),cs(this,3)}show(){if(this.inputField){const{config:t,inputField:e}=this;if(e.disabled||e.readOnly&&!t.enableOnReadonly)return;er(e)||t.disableTouchKeyboard||(this._showing=!0,e.focus(),delete this._showing)}this.picker.show()}hide(){this.inputField&&(this.picker.hide(),this.picker.update().changeView(this.config.startView).render())}toggle(){this.picker.active?this.inputField&&this.picker.hide():this.show()}destroy(){this.hide(),function(t){let e=sr.get(t);e&&(e.forEach(t=>{ar.call(...t)}),sr.delete(t))}(this),this.picker.detach();const t=this.element;return t.classList.remove("datepicker-input"),delete t.datepicker,this}getDate(t=void 0){const e=us(this,t);return this.config.multidate?this.dates.map(e):this.dates.length>0?e(this.dates[0]):void 0}setDate(...t){const e=[...t],i={},n=_n(t);!n||"object"!=typeof n||Array.isArray(n)||n instanceof Date||Object.assign(i,e.pop());ds(this,Array.isArray(e[0])?e[0]:e,i)}update(t=void 0){if(!this.inputField)return;const e=Object.assign(t||{},{clear:!0,render:!0,viewDate:void 0});ds(this,En(this.inputField.value,this.config.dateDelimiter),e)}getFocusedDate(t=void 0){return us(this,t)(this.picker.viewDate)}setFocusedDate(t,e=!1){const{config:i,picker:n,active:r,rangeSideIndex:s}=this,o=i.pickLevel,a=Qn(t,i.format,i.locale);void 0!==a&&(n.changeFocus(Rn(a,o,s)),r&&e&&n.changeView(o),n.render())}refresh(t=void 0,e=!1){let i;t&&"string"!=typeof t&&(e=t,t=void 0),i="picker"===t?2:"input"===t?1:3,cs(this,i,!e)}enterEditMode(){const t=this.inputField;t&&!t.readOnly&&this.picker.active&&!this.editMode&&(this.editMode=!0,t.classList.add("in-edit"))}exitEditMode(t=void 0){if(!this.inputField||!this.editMode)return;const e=Object.assign({update:!1},t);delete this.editMode,this.inputField.classList.remove("in-edit"),e.update&&this.update(e)}}class ps{constructor(t={}){this.opts=t}initDatepickers(t){t.forEach(t=>{const e="function"==typeof this.opts?this.opts(t):this.opts;new hs(t,{...e,updateOnBlur:!1}),t.addEventListener("changeDate",()=>{const e=t.closest("form");e&&e.submit()})})}}class fs extends EventTarget{constructor(t,e,i){super(),this.el=t,this.options={...fs.defaultOptions,...i};const n=this.resolveDatagridName();if(!n)throw new Error("Cannot resolve name of a datagrid!");this.name=n,this.ajax="function"==typeof e?e(this):e,this.ajax.addEventListener("success",t=>{var e,i;(null===(e=t.detail.payload)||void 0===e?void 0:e._datagrid_name)===this.name&&(null===(i=t.detail.payload)||void 0===i?void 0:i._datagrid_init)&&this.init()}),this.init()}init(){!this.dispatch("beforeInit",{datagrid:this})||this.options.plugins.forEach(t=>{var e;null===(e=t.onDatagridInit)||void 0===e||e.call(t,this)});const t=this.el.querySelectorAll("input[data-check]:checked");if(1===t.length&&"toggle-all"===t[0].getAttribute("name")){const e=t[0];e&&(e.checked=!1)}this.el.querySelectorAll("input[data-datagrid-manualsubmit]").forEach(t=>{const e=t.closest("form");e&&t.addEventListener("keydown",t=>{if(_(t))return t.stopPropagation(),t.preventDefault(),this.ajax.submitForm(e)})}),this.ajax.addEventListener("success",({detail:{payload:t}})=>{var e;if(t._datagrid_name&&t._datagrid_name===this.name){const i=t=>t.getAttribute("data-datagrid-reset-filter-by-column"),n=Array.from(this.el.querySelectorAll("[data-datagrid-reset-filter-by-column]")),r=t.non_empty_filters?t.non_empty_filters:[];if(n.forEach(t=>{const e=i(t);e&&r.includes(e)?t.classList.remove("hidden"):t.classList.add("hidden")}),r.length>0){const t=null===(e=this.el.querySelector(".reset-filter"))||void 0===e?void 0:e.getAttribute("href");t&&n.forEach(e=>{const n=i(e),r=t.replace("-resetFilter","-resetColumnFilter");e.setAttribute("href",`${r}&${this.name}-key=${n}`)})}}}),this.dispatch("afterInit",{datagrid:this})}confirm(t){return this.options.confirm.bind(this)(t)}resolveDatagridName(){return this.options.resolveDatagridName.bind(this)(this.el)}dispatch(t,e,i){return this.dispatchEvent(new CustomEvent(t,{detail:e}))}}fs.defaultOptions={confirm:confirm,resolveDatagridName:function(t){const e=t.getAttribute("data-datagrid-name");if(e)return e;console.warn("Deprecated name resolution for datagrid",t,": Please add a data-datagrid-name attribute instead!\nCurrently, the Datagrid library relies on matching the name from the 'datagrid-[name]' class, which is unreliable and may cause bugs if the default class names are not used (eg. if you add a datagrid-xx class, or change the name class completely!)\nAlternatively, you can customize the name resolution with the `resolveDatagridName` option. See TBD for more info.");const i=t.classList.value.split(" ");for(const t of i){if(!t.startsWith("datagrid-"))continue;const[,...e]=t.split("-"),i=e.join("-");return i.length<1?(console.error(`Failed to resolve datagrid name - ambigious class name '${t}'`),null):i}return null},plugins:[]};class gs{constructor(t,e={}){this.ajax=t,this.datagrids=[],this.options={selector:"div[data-datagrid-name]",datagrid:{},root:document.body,...e};const i="string"==typeof this.options.root?document.querySelector(this.options.root):this.options.root;if(!(i&&i instanceof HTMLElement))throw new Error("Root element not found or is not an HTMLElement");this.root=i,this.init()}init(){var t,e;this.ajax.onInit(),(null!==(e=null===(t=this.options.datagrid)||void 0===t?void 0:t.plugins)&&void 0!==e?e:[]).forEach(t=>{var e;return null===(e=t.onInit)||void 0===e?void 0:e.call(t,this)}),this.initDatagrids()}initDatagrids(){this.datagrids=Array.from(this.root.querySelectorAll(this.options.selector)).map(t=>new fs(t,this.ajax,this.options.datagrid))}}class ms extends EventTarget{constructor(t){if(!t.VERSION||t.VERSION<2)throw new Error("NajaAjax supports Naja 2 and higher"+(t.VERSION?`(version ${t.VERSION} provided)`:""));super(),this.client=t}onInit(){return this.client.addEventListener("before",t=>this.dispatch("before",{params:t.detail})),this.client.uiHandler.addEventListener("interaction",t=>{if(!(t.detail.element instanceof HTMLElement))throw new Error("Element is not an instanceof HTMLElement");const e=this.dispatch("interact",{...t.detail,element:t.detail.element});return e||(t.stopPropagation(),t.preventDefault()),e}),this.client.addEventListener("success",t=>this.dispatch("success",{...t.detail,params:t.detail.request,payload:t.detail.payload})),this.client.addEventListener("error",t=>this.dispatch("error",{...t.detail,params:t.detail.request,response:t.detail.response})),this.client.addEventListener("complete",t=>this.dispatch("complete",{...t.detail,params:t.detail.request,response:t.detail.response})),this}async request(t){var e;const i={history:!1,...t.options};return await this.client.makeRequest(t.method,t.url,null!==(e=t.data)&&void 0!==e?e:null,i)}async submitForm(t){return await this.client.uiHandler.submitForm(t)}dispatch(t,e,i){return this.dispatchEvent(new CustomEvent(t,{detail:e,cancelable:!0}))}}var vs="top",bs="bottom",ys="right",_s="left",ws="auto",Es=[vs,bs,ys,_s],As="start",Ss="end",ks="clippingParents",Cs="viewport",Os="popper",Ds="reference",xs=Es.reduce(function(t,e){return t.concat([e+"-"+As,e+"-"+Ss])},[]),Ts=[].concat(Es,[ws]).reduce(function(t,e){return t.concat([e,e+"-"+As,e+"-"+Ss])},[]),Ls="beforeRead",Is="read",Ms="afterRead",Fs="beforeMain",Ns="main",js="afterMain",Ps="beforeWrite",$s="write",Hs="afterWrite",qs=[Ls,Is,Ms,Fs,Ns,js,Ps,$s,Hs];function Rs(t){return t?(t.nodeName||"").toLowerCase():null}function Bs(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Vs(t){return t instanceof Bs(t).Element||t instanceof Element}function zs(t){return t instanceof Bs(t).HTMLElement||t instanceof HTMLElement}function Ws(t){return"undefined"!=typeof ShadowRoot&&(t instanceof Bs(t).ShadowRoot||t instanceof ShadowRoot)}var Ys={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},n=e.attributes[t]||{},r=e.elements[t];zs(r)&&Rs(r)&&(Object.assign(r.style,i),Object.keys(n).forEach(function(t){var e=n[t];!1===e?r.removeAttribute(t):r.setAttribute(t,!0===e?"":e)}))})},effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach(function(t){var n=e.elements[t],r=e.attributes[t]||{},s=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:i[t]).reduce(function(t,e){return t[e]="",t},{});zs(n)&&Rs(n)&&(Object.assign(n.style,s),Object.keys(r).forEach(function(t){n.removeAttribute(t)}))})}},requires:["computeStyles"]};function Ks(t){return t.split("-")[0]}var Us=Math.max,Xs=Math.min,Qs=Math.round;function Gs(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Js(){return!/^((?!chrome|android).)*safari/i.test(Gs())}function Zs(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var n=t.getBoundingClientRect(),r=1,s=1;e&&zs(t)&&(r=t.offsetWidth>0&&Qs(n.width)/t.offsetWidth||1,s=t.offsetHeight>0&&Qs(n.height)/t.offsetHeight||1);var o=(Vs(t)?Bs(t):window).visualViewport,a=!Js()&&i,l=(n.left+(a&&o?o.offsetLeft:0))/r,c=(n.top+(a&&o?o.offsetTop:0))/s,d=n.width/r,u=n.height/s;return{width:d,height:u,top:c,right:l+d,bottom:c+u,left:l,x:l,y:c}}function to(t){var e=Zs(t),i=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:n}}function eo(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&Ws(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function io(t){return Bs(t).getComputedStyle(t)}function no(t){return["table","td","th"].indexOf(Rs(t))>=0}function ro(t){return((Vs(t)?t.ownerDocument:t.document)||window.document).documentElement}function so(t){return"html"===Rs(t)?t:t.assignedSlot||t.parentNode||(Ws(t)?t.host:null)||ro(t)}function oo(t){return zs(t)&&"fixed"!==io(t).position?t.offsetParent:null}function ao(t){for(var e=Bs(t),i=oo(t);i&&no(i)&&"static"===io(i).position;)i=oo(i);return i&&("html"===Rs(i)||"body"===Rs(i)&&"static"===io(i).position)?e:i||function(t){var e=/firefox/i.test(Gs());if(/Trident/i.test(Gs())&&zs(t)&&"fixed"===io(t).position)return null;var i=so(t);for(Ws(i)&&(i=i.host);zs(i)&&["html","body"].indexOf(Rs(i))<0;){var n=io(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||e&&"filter"===n.willChange||e&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}(t)||e}function lo(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function co(t,e,i){return Us(t,Xs(e,i))}function uo(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function ho(t,e){return e.reduce(function(e,i){return e[i]=t,e},{})}var po={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,i=t.state,n=t.name,r=t.options,s=i.elements.arrow,o=i.modifiersData.popperOffsets,a=Ks(i.placement),l=lo(a),c=[_s,ys].indexOf(a)>=0?"height":"width";if(s&&o){var d=function(t,e){return uo("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:ho(t,Es))}(r.padding,i),u=to(s),h="y"===l?vs:_s,p="y"===l?bs:ys,f=i.rects.reference[c]+i.rects.reference[l]-o[l]-i.rects.popper[c],g=o[l]-i.rects.reference[l],m=ao(s),v=m?"y"===l?m.clientHeight||0:m.clientWidth||0:0,b=f/2-g/2,y=d[h],_=v-u[c]-d[p],w=v/2-u[c]/2+b,E=co(y,w,_),A=l;i.modifiersData[n]=((e={})[A]=E,e.centerOffset=E-w,e)}},effect:function(t){var e=t.state,i=t.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=e.elements.popper.querySelector(n)))&&eo(e.elements.popper,n)&&(e.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function fo(t){return t.split("-")[1]}var go={top:"auto",right:"auto",bottom:"auto",left:"auto"};function mo(t){var e,i=t.popper,n=t.popperRect,r=t.placement,s=t.variation,o=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,d=t.roundOffsets,u=t.isFixed,h=o.x,p=void 0===h?0:h,f=o.y,g=void 0===f?0:f,m="function"==typeof d?d({x:p,y:g}):{x:p,y:g};p=m.x,g=m.y;var v=o.hasOwnProperty("x"),b=o.hasOwnProperty("y"),y=_s,_=vs,w=window;if(c){var E=ao(i),A="clientHeight",S="clientWidth";if(E===Bs(i)&&"static"!==io(E=ro(i)).position&&"absolute"===a&&(A="scrollHeight",S="scrollWidth"),r===vs||(r===_s||r===ys)&&s===Ss)_=bs,g-=(u&&E===w&&w.visualViewport?w.visualViewport.height:E[A])-n.height,g*=l?1:-1;if(r===_s||(r===vs||r===bs)&&s===Ss)y=ys,p-=(u&&E===w&&w.visualViewport?w.visualViewport.width:E[S])-n.width,p*=l?1:-1}var k,C=Object.assign({position:a},c&&go),O=!0===d?function(t,e){var i=t.x,n=t.y,r=e.devicePixelRatio||1;return{x:Qs(i*r)/r||0,y:Qs(n*r)/r||0}}({x:p,y:g},Bs(i)):{x:p,y:g};return p=O.x,g=O.y,l?Object.assign({},C,((k={})[_]=b?"0":"",k[y]=v?"0":"",k.transform=(w.devicePixelRatio||1)<=1?"translate("+p+"px, "+g+"px)":"translate3d("+p+"px, "+g+"px, 0)",k)):Object.assign({},C,((e={})[_]=b?g+"px":"",e[y]=v?p+"px":"",e.transform="",e))}var vo={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,i=t.options,n=i.gpuAcceleration,r=void 0===n||n,s=i.adaptive,o=void 0===s||s,a=i.roundOffsets,l=void 0===a||a,c={placement:Ks(e.placement),variation:fo(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,mo(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,mo(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},bo={passive:!0};var yo={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,i=t.instance,n=t.options,r=n.scroll,s=void 0===r||r,o=n.resize,a=void 0===o||o,l=Bs(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach(function(t){t.addEventListener("scroll",i.update,bo)}),a&&l.addEventListener("resize",i.update,bo),function(){s&&c.forEach(function(t){t.removeEventListener("scroll",i.update,bo)}),a&&l.removeEventListener("resize",i.update,bo)}},data:{}},_o={left:"right",right:"left",bottom:"top",top:"bottom"};function wo(t){return t.replace(/left|right|bottom|top/g,function(t){return _o[t]})}var Eo={start:"end",end:"start"};function Ao(t){return t.replace(/start|end/g,function(t){return Eo[t]})}function So(t){var e=Bs(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ko(t){return Zs(ro(t)).left+So(t).scrollLeft}function Co(t){var e=io(t),i=e.overflow,n=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+r+n)}function Oo(t){return["html","body","#document"].indexOf(Rs(t))>=0?t.ownerDocument.body:zs(t)&&Co(t)?t:Oo(so(t))}function Do(t,e){var i;void 0===e&&(e=[]);var n=Oo(t),r=n===(null==(i=t.ownerDocument)?void 0:i.body),s=Bs(n),o=r?[s].concat(s.visualViewport||[],Co(n)?n:[]):n,a=e.concat(o);return r?a:a.concat(Do(so(o)))}function xo(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function To(t,e,i){return e===Cs?xo(function(t,e){var i=Bs(t),n=ro(t),r=i.visualViewport,s=n.clientWidth,o=n.clientHeight,a=0,l=0;if(r){s=r.width,o=r.height;var c=Js();(c||!c&&"fixed"===e)&&(a=r.offsetLeft,l=r.offsetTop)}return{width:s,height:o,x:a+ko(t),y:l}}(t,i)):Vs(e)?function(t,e){var i=Zs(t,!1,"fixed"===e);return i.top=i.top+t.clientTop,i.left=i.left+t.clientLeft,i.bottom=i.top+t.clientHeight,i.right=i.left+t.clientWidth,i.width=t.clientWidth,i.height=t.clientHeight,i.x=i.left,i.y=i.top,i}(e,i):xo(function(t){var e,i=ro(t),n=So(t),r=null==(e=t.ownerDocument)?void 0:e.body,s=Us(i.scrollWidth,i.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),o=Us(i.scrollHeight,i.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-n.scrollLeft+ko(t),l=-n.scrollTop;return"rtl"===io(r||i).direction&&(a+=Us(i.clientWidth,r?r.clientWidth:0)-s),{width:s,height:o,x:a,y:l}}(ro(t)))}function Lo(t,e,i,n){var r="clippingParents"===e?function(t){var e=Do(so(t)),i=["absolute","fixed"].indexOf(io(t).position)>=0&&zs(t)?ao(t):t;return Vs(i)?e.filter(function(t){return Vs(t)&&eo(t,i)&&"body"!==Rs(t)}):[]}(t):[].concat(e),s=[].concat(r,[i]),o=s[0],a=s.reduce(function(e,i){var r=To(t,i,n);return e.top=Us(r.top,e.top),e.right=Xs(r.right,e.right),e.bottom=Xs(r.bottom,e.bottom),e.left=Us(r.left,e.left),e},To(t,o,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Io(t){var e,i=t.reference,n=t.element,r=t.placement,s=r?Ks(r):null,o=r?fo(r):null,a=i.x+i.width/2-n.width/2,l=i.y+i.height/2-n.height/2;switch(s){case vs:e={x:a,y:i.y-n.height};break;case bs:e={x:a,y:i.y+i.height};break;case ys:e={x:i.x+i.width,y:l};break;case _s:e={x:i.x-n.width,y:l};break;default:e={x:i.x,y:i.y}}var c=s?lo(s):null;if(null!=c){var d="y"===c?"height":"width";switch(o){case As:e[c]=e[c]-(i[d]/2-n[d]/2);break;case Ss:e[c]=e[c]+(i[d]/2-n[d]/2)}}return e}function Mo(t,e){void 0===e&&(e={});var i=e,n=i.placement,r=void 0===n?t.placement:n,s=i.strategy,o=void 0===s?t.strategy:s,a=i.boundary,l=void 0===a?ks:a,c=i.rootBoundary,d=void 0===c?Cs:c,u=i.elementContext,h=void 0===u?Os:u,p=i.altBoundary,f=void 0!==p&&p,g=i.padding,m=void 0===g?0:g,v=uo("number"!=typeof m?m:ho(m,Es)),b=h===Os?Ds:Os,y=t.rects.popper,_=t.elements[f?b:h],w=Lo(Vs(_)?_:_.contextElement||ro(t.elements.popper),l,d,o),E=Zs(t.elements.reference),A=Io({reference:E,element:y,placement:r}),S=xo(Object.assign({},y,A)),k=h===Os?S:E,C={top:w.top-k.top+v.top,bottom:k.bottom-w.bottom+v.bottom,left:w.left-k.left+v.left,right:k.right-w.right+v.right},O=t.modifiersData.offset;if(h===Os&&O){var D=O[r];Object.keys(C).forEach(function(t){var e=[ys,bs].indexOf(t)>=0?1:-1,i=[vs,bs].indexOf(t)>=0?"y":"x";C[t]+=D[i]*e})}return C}function Fo(t,e){void 0===e&&(e={});var i=e,n=i.placement,r=i.boundary,s=i.rootBoundary,o=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,c=void 0===l?Ts:l,d=fo(n),u=d?a?xs:xs.filter(function(t){return fo(t)===d}):Es,h=u.filter(function(t){return c.indexOf(t)>=0});0===h.length&&(h=u);var p=h.reduce(function(e,i){return e[i]=Mo(t,{placement:i,boundary:r,rootBoundary:s,padding:o})[Ks(i)],e},{});return Object.keys(p).sort(function(t,e){return p[t]-p[e]})}var No={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var r=i.mainAxis,s=void 0===r||r,o=i.altAxis,a=void 0===o||o,l=i.fallbackPlacements,c=i.padding,d=i.boundary,u=i.rootBoundary,h=i.altBoundary,p=i.flipVariations,f=void 0===p||p,g=i.allowedAutoPlacements,m=e.options.placement,v=Ks(m),b=l||(v===m||!f?[wo(m)]:function(t){if(Ks(t)===ws)return[];var e=wo(t);return[Ao(t),e,Ao(e)]}(m)),y=[m].concat(b).reduce(function(t,i){return t.concat(Ks(i)===ws?Fo(e,{placement:i,boundary:d,rootBoundary:u,padding:c,flipVariations:f,allowedAutoPlacements:g}):i)},[]),_=e.rects.reference,w=e.rects.popper,E=new Map,A=!0,S=y[0],k=0;k<y.length;k++){var C=y[k],O=Ks(C),D=fo(C)===As,x=[vs,bs].indexOf(O)>=0,T=x?"width":"height",L=Mo(e,{placement:C,boundary:d,rootBoundary:u,altBoundary:h,padding:c}),I=x?D?ys:_s:D?bs:vs;_[T]>w[T]&&(I=wo(I));var M=wo(I),F=[];if(s&&F.push(L[O]<=0),a&&F.push(L[I]<=0,L[M]<=0),F.every(function(t){return t})){S=C,A=!1;break}E.set(C,F)}if(A)for(var N=function(t){var e=y.find(function(e){var i=E.get(e);if(i)return i.slice(0,t).every(function(t){return t})});if(e)return S=e,"break"},j=f?3:1;j>0;j--){if("break"===N(j))break}e.placement!==S&&(e.modifiersData[n]._skip=!0,e.placement=S,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function jo(t,e,i){return void 0===i&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function Po(t){return[vs,ys,bs,_s].some(function(e){return t[e]>=0})}var $o={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,i=t.name,n=e.rects.reference,r=e.rects.popper,s=e.modifiersData.preventOverflow,o=Mo(e,{elementContext:"reference"}),a=Mo(e,{altBoundary:!0}),l=jo(o,n),c=jo(a,r,s),d=Po(l),u=Po(c);e.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:u},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":u})}};var Ho={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,i=t.options,n=t.name,r=i.offset,s=void 0===r?[0,0]:r,o=Ts.reduce(function(t,i){return t[i]=function(t,e,i){var n=Ks(t),r=[_s,vs].indexOf(n)>=0?-1:1,s="function"==typeof i?i(Object.assign({},e,{placement:t})):i,o=s[0],a=s[1];return o=o||0,a=(a||0)*r,[_s,ys].indexOf(n)>=0?{x:a,y:o}:{x:o,y:a}}(i,e.rects,s),t},{}),a=o[e.placement],l=a.x,c=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[n]=o}};var qo={name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,i=t.name;e.modifiersData[i]=Io({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})},data:{}};var Ro={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name,r=i.mainAxis,s=void 0===r||r,o=i.altAxis,a=void 0!==o&&o,l=i.boundary,c=i.rootBoundary,d=i.altBoundary,u=i.padding,h=i.tether,p=void 0===h||h,f=i.tetherOffset,g=void 0===f?0:f,m=Mo(e,{boundary:l,rootBoundary:c,padding:u,altBoundary:d}),v=Ks(e.placement),b=fo(e.placement),y=!b,_=lo(v),w="x"===_?"y":"x",E=e.modifiersData.popperOffsets,A=e.rects.reference,S=e.rects.popper,k="function"==typeof g?g(Object.assign({},e.rects,{placement:e.placement})):g,C="number"==typeof k?{mainAxis:k,altAxis:k}:Object.assign({mainAxis:0,altAxis:0},k),O=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,D={x:0,y:0};if(E){if(s){var x,T="y"===_?vs:_s,L="y"===_?bs:ys,I="y"===_?"height":"width",M=E[_],F=M+m[T],N=M-m[L],j=p?-S[I]/2:0,P=b===As?A[I]:S[I],H=b===As?-S[I]:-A[I],q=e.elements.arrow,R=p&&q?to(q):{width:0,height:0},B=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},V=B[T],z=B[L],W=co(0,A[I],R[I]),Y=y?A[I]/2-j-W-V-C.mainAxis:P-W-V-C.mainAxis,K=y?-A[I]/2+j+W+z+C.mainAxis:H+W+z+C.mainAxis,U=e.elements.arrow&&ao(e.elements.arrow),X=U?"y"===_?U.clientTop||0:U.clientLeft||0:0,Q=null!=(x=null==O?void 0:O[_])?x:0,G=M+K-Q,J=co(p?Xs(F,M+Y-Q-X):F,M,p?Us(N,G):N);E[_]=J,D[_]=J-M}if(a){var Z,tt="x"===_?vs:_s,et="x"===_?bs:ys,it=E[w],nt="y"===w?"height":"width",rt=it+m[tt],st=it-m[et],ot=-1!==[vs,_s].indexOf(v),at=null!=(Z=null==O?void 0:O[w])?Z:0,lt=ot?rt:it-A[nt]-S[nt]-at+C.altAxis,ct=ot?it+A[nt]+S[nt]-at-C.altAxis:st,dt=p&&ot?function(t,e,i){var n=co(t,e,i);return n>i?i:n}(lt,it,ct):co(p?lt:rt,it,p?ct:st);E[w]=dt,D[w]=dt-it}e.modifiersData[n]=D}},requiresIfExists:["offset"]};function Bo(t,e,i){void 0===i&&(i=!1);var n,r,s=zs(e),o=zs(e)&&function(t){var e=t.getBoundingClientRect(),i=Qs(e.width)/t.offsetWidth||1,n=Qs(e.height)/t.offsetHeight||1;return 1!==i||1!==n}(e),a=ro(e),l=Zs(t,o,i),c={scrollLeft:0,scrollTop:0},d={x:0,y:0};return(s||!s&&!i)&&(("body"!==Rs(e)||Co(a))&&(c=(n=e)!==Bs(n)&&zs(n)?{scrollLeft:(r=n).scrollLeft,scrollTop:r.scrollTop}:So(n)),zs(e)?((d=Zs(e,!0)).x+=e.clientLeft,d.y+=e.clientTop):a&&(d.x=ko(a))),{x:l.left+c.scrollLeft-d.x,y:l.top+c.scrollTop-d.y,width:l.width,height:l.height}}function Vo(t){var e=new Map,i=new Set,n=[];function r(t){i.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach(function(t){if(!i.has(t)){var n=e.get(t);n&&r(n)}}),n.push(t)}return t.forEach(function(t){e.set(t.name,t)}),t.forEach(function(t){i.has(t.name)||r(t)}),n}var zo={placement:"bottom",modifiers:[],strategy:"absolute"};function Wo(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return!e.some(function(t){return!(t&&"function"==typeof t.getBoundingClientRect)})}function Yo(t){void 0===t&&(t={});var e=t,i=e.defaultModifiers,n=void 0===i?[]:i,r=e.defaultOptions,s=void 0===r?zo:r;return function(t,e,i){void 0===i&&(i=s);var r,o,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},zo,s),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},l=[],c=!1,d={state:a,setOptions:function(i){var r="function"==typeof i?i(a.options):i;u(),a.options=Object.assign({},s,a.options,r),a.scrollParents={reference:Vs(t)?Do(t):t.contextElement?Do(t.contextElement):[],popper:Do(e)};var o,c,h=function(t){var e=Vo(t);return qs.reduce(function(t,i){return t.concat(e.filter(function(t){return t.phase===i}))},[])}((o=[].concat(n,a.options.modifiers),c=o.reduce(function(t,e){var i=t[e.name];return t[e.name]=i?Object.assign({},i,e,{options:Object.assign({},i.options,e.options),data:Object.assign({},i.data,e.data)}):e,t},{}),Object.keys(c).map(function(t){return c[t]})));return a.orderedModifiers=h.filter(function(t){return t.enabled}),a.orderedModifiers.forEach(function(t){var e=t.name,i=t.options,n=void 0===i?{}:i,r=t.effect;if("function"==typeof r){var s=r({state:a,name:e,instance:d,options:n}),o=function(){};l.push(s||o)}}),d.update()},forceUpdate:function(){if(!c){var t=a.elements,e=t.reference,i=t.popper;if(Wo(e,i)){a.rects={reference:Bo(e,ao(i),"fixed"===a.options.strategy),popper:to(i)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach(function(t){return a.modifiersData[t.name]=Object.assign({},t.data)});for(var n=0;n<a.orderedModifiers.length;n++)if(!0!==a.reset){var r=a.orderedModifiers[n],s=r.fn,o=r.options,l=void 0===o?{}:o,u=r.name;"function"==typeof s&&(a=s({state:a,options:l,name:u,instance:d})||a)}else a.reset=!1,n=-1}}},update:(r=function(){return new Promise(function(t){d.forceUpdate(),t(a)})},function(){return o||(o=new Promise(function(t){Promise.resolve().then(function(){o=void 0,t(r())})})),o}),destroy:function(){u(),c=!0}};if(!Wo(t,e))return d;function u(){l.forEach(function(t){return t()}),l=[]}return d.setOptions(i).then(function(t){!c&&i.onFirstUpdate&&i.onFirstUpdate(t)}),d}}var Ko=Yo(),Uo=Yo({defaultModifiers:[yo,qo,vo,Ys]}),Xo=Yo({defaultModifiers:[yo,qo,vo,Ys,Ho,No,Ro,po,$o]}),Qo=Object.freeze({__proto__:null,afterMain:js,afterRead:Ms,afterWrite:Hs,applyStyles:Ys,arrow:po,auto:ws,basePlacements:Es,beforeMain:Fs,beforeRead:Ls,beforeWrite:Ps,bottom:bs,clippingParents:ks,computeStyles:vo,createPopper:Xo,createPopperBase:Ko,createPopperLite:Uo,detectOverflow:Mo,end:Ss,eventListeners:yo,flip:No,hide:$o,left:_s,main:Ns,modifierPhases:qs,offset:Ho,placements:Ts,popper:Os,popperGenerator:Yo,popperOffsets:qo,preventOverflow:Ro,read:Is,reference:Ds,right:ys,start:As,top:vs,variationPlacements:xs,viewport:Cs,write:$s});
14
14
  /*!
15
15
  * Bootstrap v5.3.8 (https://getbootstrap.com/)
16
16
  * Copyright 2011-2025 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)