(()=>{"use strict";var uo={};/**! * Sortable 1.14.0 * @author RubaXa * @author owenm * @license MIT */function xt(o,e){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(o);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(o,r).enumerable})),t.push.apply(t,n)}return t}function U(o){for(var e=1;e=0)&&(t[r]=o[r]);return t}function ln(o,e){if(o==null)return{};var t=sn(o,e),n,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(o);for(r=0;r=0)&&(!Object.prototype.propertyIsEnumerable.call(o,n)||(t[n]=o[n]))}return t}function cn(o){return dn(o)||un(o)||fn(o)||hn()}function dn(o){if(Array.isArray(o))return dt(o)}function un(o){if(typeof Symbol<"u"&&o[Symbol.iterator]!=null||o["@@iterator"]!=null)return Array.from(o)}function fn(o,e){if(!!o){if(typeof o=="string")return dt(o,e);var t=Object.prototype.toString.call(o).slice(8,-1);if(t==="Object"&&o.constructor&&(t=o.constructor.name),t==="Map"||t==="Set")return Array.from(o);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return dt(o,e)}}function dt(o,e){(e==null||e>o.length)&&(e=o.length);for(var t=0,n=new Array(e);t"&&(e=e.substring(1)),o)try{if(o.matches)return o.matches(e);if(o.msMatchesSelector)return o.msMatchesSelector(e);if(o.webkitMatchesSelector)return o.webkitMatchesSelector(e)}catch{return!1}return!1}}function mn(o){return o.host&&o!==document&&o.host.nodeType?o.host:o.parentNode}function V(o,e,t,n){if(o){t=t||document;do{if(e!=null&&(e[0]===">"?o.parentNode===t&&We(o,e):We(o,e))||n&&o===t)return o;if(o===t)break}while(o=mn(o))}return null}var $t=/\s+/g;function T(o,e,t){if(o&&e)if(o.classList)o.classList[t?"add":"remove"](e);else{var n=(" "+o.className+" ").replace($t," ").replace(" "+e+" "," ");o.className=(n+(t?" "+e:"")).replace($t," ")}}function h(o,e,t){var n=o&&o.style;if(n){if(t===void 0)return document.defaultView&&document.defaultView.getComputedStyle?t=document.defaultView.getComputedStyle(o,""):o.currentStyle&&(t=o.currentStyle),e===void 0?t:t[e];!(e in n)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),n[e]=t+(typeof t=="string"?"":"px")}}function ue(o,e){var t="";if(typeof o=="string")t=o;else do{var n=h(o,"transform");n&&n!=="none"&&(t=n+" "+t)}while(!e&&(o=o.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(t)}function Ft(o,e,t){if(o){var n=o.getElementsByTagName(e),r=0,i=n.length;if(t)for(;r=i:a=r<=i,!a)return n;if(n===J())break;n=ie(n,!1)}return!1}function ye(o,e,t,n){for(var r=0,i=0,a=o.children;i2&&arguments[2]!==void 0?arguments[2]:{},r=n.evt,i=ln(n,Cn);Ae.pluginEvent.bind(g)(e,t,U({dragEl:f,parentEl:I,ghostEl:v,rootEl:P,nextEl:fe,lastDownEl:Ge,cloneEl:O,cloneHidden:ae,dragStarted:xe,putSortable:M,activeSortable:g.active,originalEvent:r,oldIndex:Ee,oldDraggableIndex:Oe,newIndex:K,newDraggableIndex:se,hideGhostForTarget:zt,unhideGhostForTarget:jt,cloneNowHidden:function(){ae=!0},cloneNowShown:function(){ae=!1},dispatchSortableEvent:function(s){R({sortable:t,name:s,originalEvent:r})}},i))};function R(o){Ie(U({putSortable:M,cloneEl:O,targetEl:f,rootEl:P,oldIndex:Ee,oldDraggableIndex:Oe,newIndex:K,newDraggableIndex:se},o))}var f,I,v,P,fe,Ge,O,ae,Ee,K,Oe,se,Ve,M,Se=!1,ze=!1,je=[],he,z,mt,vt,Xt,Yt,xe,Ce,Ne,ke=!1,Ue=!1,Je,F,bt=[],yt=!1,Ze=[],Qe=typeof document<"u",et=kt,qt=_e||oe?"cssFloat":"float",Dn=Qe&&!gn&&!kt&&"draggable"in document.createElement("div"),Wt=function(){if(!!Qe){if(oe)return!1;var o=document.createElement("x");return o.style.cssText="pointer-events:auto",o.style.pointerEvents==="auto"}}(),Gt=function(e,t){var n=h(e),r=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=ye(e,0,t),a=ye(e,1,t),s=i&&h(i),l=a&&h(a),c=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+_(i).width,u=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+_(a).width;if(n.display==="flex")return n.flexDirection==="column"||n.flexDirection==="column-reverse"?"vertical":"horizontal";if(n.display==="grid")return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&s.float&&s.float!=="none"){var d=s.float==="left"?"left":"right";return a&&(l.clear==="both"||l.clear===d)?"vertical":"horizontal"}return i&&(s.display==="block"||s.display==="flex"||s.display==="table"||s.display==="grid"||c>=r&&n[qt]==="none"||a&&n[qt]==="none"&&c+u>r)?"vertical":"horizontal"},_n=function(e,t,n){var r=n?e.left:e.top,i=n?e.right:e.bottom,a=n?e.width:e.height,s=n?t.left:t.top,l=n?t.right:t.bottom,c=n?t.width:t.height;return r===s||i===l||r+a/2===s+c/2},Pn=function(e,t){var n;return je.some(function(r){var i=r[$].options.emptyInsertThreshold;if(!(!i||ut(r))){var a=_(r),s=e>=a.left-i&&e<=a.right+i,l=t>=a.top-i&&t<=a.bottom+i;if(s&&l)return n=r}}),n},Vt=function(e){function t(i,a){return function(s,l,c,u){var d=s.options.group.name&&l.options.group.name&&s.options.group.name===l.options.group.name;if(i==null&&(a||d))return!0;if(i==null||i===!1)return!1;if(a&&i==="clone")return i;if(typeof i=="function")return t(i(s,l,c,u),a)(s,l,c,u);var p=(a?s:l).options.group.name;return i===!0||typeof i=="string"&&i===p||i.join&&i.indexOf(p)>-1}}var n={},r=e.group;(!r||qe(r)!="object")&&(r={name:r}),n.name=r.name,n.checkPull=t(r.pull,!0),n.checkPut=t(r.put),n.revertClone=r.revertClone,e.group=n},zt=function(){!Wt&&v&&h(v,"display","none")},jt=function(){!Wt&&v&&h(v,"display","")};Qe&&document.addEventListener("click",function(o){if(ze)return o.preventDefault(),o.stopPropagation&&o.stopPropagation(),o.stopImmediatePropagation&&o.stopImmediatePropagation(),ze=!1,!1},!0);var pe=function(e){if(f){e=e.touches?e.touches[0]:e;var t=Pn(e.clientX,e.clientY);if(t){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[$]._onDragOver(n)}}},Tn=function(e){f&&f.parentNode[$]._isOutsideThisEl(e.target)};function g(o,e){if(!(o&&o.nodeType&&o.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(o));this.el=o,this.options=e=q({},e),o[$]=this;var t={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(o.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Gt(o,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(a,s){a.setData("Text",s.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:g.supportPointer!==!1&&"PointerEvent"in window&&!Pe,emptyInsertThreshold:5};Ae.initializePlugins(this,o,t);for(var n in t)!(n in e)&&(e[n]=t[n]);Vt(e);for(var r in this)r.charAt(0)==="_"&&typeof this[r]=="function"&&(this[r]=this[r].bind(this));this.nativeDraggable=e.forceFallback?!1:Dn,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?E(o,"pointerdown",this._onTapStart):(E(o,"mousedown",this._onTapStart),E(o,"touchstart",this._onTapStart)),this.nativeDraggable&&(E(o,"dragover",this),E(o,"dragenter",this)),je.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),q(this,wn())}g.prototype={constructor:g,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(Ce=null)},_getDirection:function(e,t){return typeof this.options.direction=="function"?this.options.direction.call(this,e,t,f):this.options.direction},_onTapStart:function(e){if(!!e.cancelable){var t=this,n=this.el,r=this.options,i=r.preventOnFilter,a=e.type,s=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,l=(s||e).target,c=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||l,u=r.filter;if($n(n),!f&&!(/mousedown|pointerdown/.test(a)&&e.button!==0||r.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&Pe&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=V(l,r.draggable,n,!1),!(l&&l.animated)&&Ge!==l)){if(Ee=A(l),Oe=A(l,r.draggable),typeof u=="function"){if(u.call(this,e,l,this)){R({sortable:t,rootEl:c,name:"filter",targetEl:l,toEl:n,fromEl:n}),L("filter",t,{evt:e}),i&&e.cancelable&&e.preventDefault();return}}else if(u&&(u=u.split(",").some(function(d){if(d=V(c,d.trim(),n,!1),d)return R({sortable:t,rootEl:d,name:"filter",targetEl:l,fromEl:n,toEl:n}),L("filter",t,{evt:e}),!0}),u)){i&&e.cancelable&&e.preventDefault();return}r.handle&&!V(c,r.handle,n,!1)||this._prepareDragStart(e,s,l)}}},_prepareDragStart:function(e,t,n){var r=this,i=r.el,a=r.options,s=i.ownerDocument,l;if(n&&!f&&n.parentNode===i){var c=_(n);if(P=i,f=n,I=f.parentNode,fe=f.nextSibling,Ge=n,Ve=a.group,g.dragged=f,he={target:f,clientX:(t||e).clientX,clientY:(t||e).clientY},Xt=he.clientX-c.left,Yt=he.clientY-c.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,f.style["will-change"]="all",l=function(){if(L("delayEnded",r,{evt:e}),g.eventCanceled){r._onDrop();return}r._disableDelayedDragEvents(),!Nt&&r.nativeDraggable&&(f.draggable=!0),r._triggerDragStart(e,t),R({sortable:r,name:"choose",originalEvent:e}),T(f,a.chosenClass,!0)},a.ignore.split(",").forEach(function(u){Ft(f,u.trim(),wt)}),E(s,"dragover",pe),E(s,"mousemove",pe),E(s,"touchmove",pe),E(s,"mouseup",r._onDrop),E(s,"touchend",r._onDrop),E(s,"touchcancel",r._onDrop),Nt&&this.nativeDraggable&&(this.options.touchStartThreshold=4,f.draggable=!0),L("delayStart",this,{evt:e}),a.delay&&(!a.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(_e||oe))){if(g.eventCanceled){this._onDrop();return}E(s,"mouseup",r._disableDelayedDrag),E(s,"touchend",r._disableDelayedDrag),E(s,"touchcancel",r._disableDelayedDrag),E(s,"mousemove",r._delayedDragTouchMoveHandler),E(s,"touchmove",r._delayedDragTouchMoveHandler),a.supportPointer&&E(s,"pointermove",r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(l,a.delay)}else l()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){f&&wt(f),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;w(e,"mouseup",this._disableDelayedDrag),w(e,"touchend",this._disableDelayedDrag),w(e,"touchcancel",this._disableDelayedDrag),w(e,"mousemove",this._delayedDragTouchMoveHandler),w(e,"touchmove",this._delayedDragTouchMoveHandler),w(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||e.pointerType=="touch"&&e,!this.nativeDraggable||t?this.options.supportPointer?E(document,"pointermove",this._onTouchMove):t?E(document,"touchmove",this._onTouchMove):E(document,"mousemove",this._onTouchMove):(E(f,"dragend",this),E(P,"dragstart",this._onDragStart));try{document.selection?nt(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(Se=!1,P&&f){L("dragStarted",this,{evt:t}),this.nativeDraggable&&E(document,"dragover",Tn);var n=this.options;!e&&T(f,n.dragClass,!1),T(f,n.ghostClass,!0),g.active=this,e&&this._appendGhost(),R({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(z){this._lastX=z.clientX,this._lastY=z.clientY,zt();for(var e=document.elementFromPoint(z.clientX,z.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(z.clientX,z.clientY),e!==t);)t=e;if(f.parentNode[$]._isOutsideThisEl(e),t)do{if(t[$]){var n=void 0;if(n=t[$]._onDragOver({clientX:z.clientX,clientY:z.clientY,target:e,rootEl:t}),n&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);jt()}},_onTouchMove:function(e){if(he){var t=this.options,n=t.fallbackTolerance,r=t.fallbackOffset,i=e.touches?e.touches[0]:e,a=v&&ue(v,!0),s=v&&a&&a.a,l=v&&a&&a.d,c=et&&F&&Lt(F),u=(i.clientX-he.clientX+r.x)/(s||1)+(c?c[0]-bt[0]:0)/(s||1),d=(i.clientY-he.clientY+r.y)/(l||1)+(c?c[1]-bt[1]:0)/(l||1);if(!g.active&&!Se){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))=0&&(R({rootEl:I,name:"add",toEl:I,fromEl:P,originalEvent:e}),R({sortable:this,name:"remove",toEl:I,originalEvent:e}),R({rootEl:I,name:"sort",toEl:I,fromEl:P,originalEvent:e}),R({sortable:this,name:"sort",toEl:I,originalEvent:e})),M&&M.save()):K!==Ee&&K>=0&&(R({sortable:this,name:"update",toEl:I,originalEvent:e}),R({sortable:this,name:"sort",toEl:I,originalEvent:e})),g.active&&((K==null||K===-1)&&(K=Ee,se=Oe),R({sortable:this,name:"end",toEl:I,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){L("nulling",this),P=f=I=v=fe=O=Ge=ae=he=z=xe=K=se=Ee=Oe=Ce=Ne=M=Ve=g.dragged=g.ghost=g.clone=g.active=null,Ze.forEach(function(e){e.checked=!0}),Ze.length=mt=vt=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":f&&(this._onDragOver(e),An(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],t,n=this.el.children,r=0,i=n.length,a=this.options;rn.right+r||o.clientX<=n.right&&o.clientY>n.bottom&&o.clientX>=n.left:o.clientX>n.right&&o.clientY>n.top||o.clientX<=n.right&&o.clientY>n.bottom+r}function Nn(o,e,t,n,r,i,a,s){var l=n?o.clientY:o.clientX,c=n?t.height:t.width,u=n?t.top:t.left,d=n?t.bottom:t.right,p=!1;if(!a){if(s&&Jeu+c*i/2:ld-Je)return-Ne}else if(l>u+c*(1-r)/2&&ld-c*i/2)?l>u+c/2?1:-1:0}function kn(o){return A(f)1&&(m.forEach(function(s){i.addAnimationState({target:s,rect:B?_(s):a}),pt(s),s.fromRect=a,n.removeAnimationState(s)}),B=!1,Ln(!this.options.removeCloneOnHide,r))},dragOverCompleted:function(t){var n=t.sortable,r=t.isOwner,i=t.insertion,a=t.activeSortable,s=t.parentEl,l=t.putSortable,c=this.options;if(i){if(r&&a._hideClone(),Re=!1,c.animation&&m.length>1&&(B||!r&&!a.options.sort&&!l)){var u=_(D,!1,!0,!0);m.forEach(function(p){p!==D&&(Kt(p,u),s.appendChild(p))}),B=!0}if(!r)if(B||at(),m.length>1){var d=it;a._showClone(n),a.options.animation&&!it&&d&&X.forEach(function(p){a.addAnimationState({target:p,rect:Le}),p.fromRect=Le,p.thisAnimationDuration=null})}else a._showClone(n)}},dragOverAnimationCapture:function(t){var n=t.dragRect,r=t.isOwner,i=t.activeSortable;if(m.forEach(function(s){s.thisAnimationDuration=null}),i.options.animation&&!r&&i.multiDrag.isMultiDrag){Le=q({},n);var a=ue(D,!0);Le.top-=a.f,Le.left-=a.e}},dragOverAnimationComplete:function(){B&&(B=!1,at())},drop:function(t){var n=t.originalEvent,r=t.rootEl,i=t.parentEl,a=t.sortable,s=t.dispatchSortableEvent,l=t.oldIndex,c=t.putSortable,u=c||this.sortable;if(!!n){var d=this.options,p=i.children;if(!De)if(d.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),T(D,d.selectedClass,!~m.indexOf(D)),~m.indexOf(D))m.splice(m.indexOf(D),1),Fe=null,Ie({sortable:a,rootEl:r,name:"deselect",targetEl:D,originalEvt:n});else{if(m.push(D),Ie({sortable:a,rootEl:r,name:"select",targetEl:D,originalEvt:n}),n.shiftKey&&Fe&&a.el.contains(Fe)){var b=A(Fe),y=A(D);if(~b&&~y&&b!==y){var S,N;for(y>b?(N=b,S=y):(N=y,S=b+1);N1){var G=_(D),k=A(D,":not(."+this.options.selectedClass+")");if(!Re&&d.animation&&(D.thisAnimationDuration=null),u.captureAnimationState(),!Re&&(d.animation&&(D.fromRect=G,m.forEach(function(C){if(C.thisAnimationDuration=null,C!==D){var ee=B?_(C):G;C.fromRect=ee,u.addAnimationState({target:C,rect:ee})}})),at(),m.forEach(function(C){p[k]?i.insertBefore(C,p[k]):i.appendChild(C),k++}),l===A(D))){var H=!1;m.forEach(function(C){if(C.sortableIndex!==A(C)){H=!0;return}}),H&&s("update")}m.forEach(function(C){pt(C)}),u.animateAll()}j=u}(r===i||c&&c.lastPutMode!=="clone")&&X.forEach(function(C){C.parentNode&&C.parentNode.removeChild(C)})}},nullingGlobal:function(){this.isMultiDrag=De=!1,X.length=0},destroyGlobal:function(){this._deselectMultiDrag(),w(document,"pointerup",this._deselectMultiDrag),w(document,"mouseup",this._deselectMultiDrag),w(document,"touchend",this._deselectMultiDrag),w(document,"keydown",this._checkKeyDown),w(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(t){if(!(typeof De<"u"&&De)&&j===this.sortable&&!(t&&V(t.target,this.options.draggable,this.sortable.el,!1))&&!(t&&t.button!==0))for(;m.length;){var n=m[0];T(n,this.options.selectedClass,!1),m.shift(),Ie({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:n,originalEvt:t})}},_checkKeyDown:function(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},q(o,{pluginName:"multiDrag",utils:{select:function(t){var n=t.parentNode[$];!n||!n.options.multiDrag||~m.indexOf(t)||(j&&j!==n&&(j.multiDrag._deselectMultiDrag(),j=n),T(t,n.options.selectedClass,!0),m.push(t))},deselect:function(t){var n=t.parentNode[$],r=m.indexOf(t);!n||!n.options.multiDrag||!~r||(T(t,n.options.selectedClass,!1),m.splice(r,1))}},eventProperties:function(){var t=this,n=[],r=[];return m.forEach(function(i){n.push({multiDragElement:i,index:i.sortableIndex});var a;B&&i!==D?a=-1:B?a=A(i,":not(."+t.options.selectedClass+")"):a=A(i),r.push({multiDragElement:i,index:a})}),{items:cn(m),clones:[].concat(X),oldIndicies:n,newIndicies:r}},optionListeners:{multiDragKey:function(t){return t=t.toLowerCase(),t==="ctrl"?t="Control":t.length>1&&(t=t.charAt(0).toUpperCase()+t.substr(1)),t}}})}function Ln(o,e){m.forEach(function(t,n){var r=e.children[t.sortableIndex+(o?Number(n):0)];r?e.insertBefore(t,r):e.appendChild(t)})}function Zt(o,e){X.forEach(function(t,n){var r=e.children[t.sortableIndex+(o?Number(n):0)];r?e.insertBefore(t,r):e.appendChild(t)})}function at(){m.forEach(function(o){o!==D&&o.parentNode&&o.parentNode.removeChild(o)})}g.mount(new Fn),g.mount(At,Tt);const Bn=g;var Hn=Object.defineProperty,Kn=(o,e,t)=>e in o?Hn(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,Xn=(o,e,t)=>(Kn(o,typeof e!="symbol"?e+"":e,t),t);class Qt{constructor(e){this.method=e,Xn(this,"_")}}class Z extends Qt{}class st extends Qt{}function en(o,e,t){o.method===e.method&&t(e.params)}const Yn=new Z("webview/ready"),po=new Z("command/execute"),go=new Z("configuration/preview"),mo=new Z("configuration/update"),vo=new st("configuration/didChange"),bo=new st("configuration/didPreview"),yo=new st("webview/didOpenAnchor"),qn=new Z("rebase/abort"),Wn=new Z("rebase/disable"),Gn=new Z("rebase/start"),Vn=new Z("rebase/switch"),zn=new Z("rebase/change/entry"),jn=new Z("rebase/move/entry"),tn=new st("rebase/didChange");var Q;(o=>{function e(r,i,a,s){let l=!1;if(typeof r=="string"){const u=function(d){const p=d?.target;!p?.matches(r)||a(d,p)};return document.addEventListener(i,u,s??!0),{dispose:()=>{l||(l=!0,document.removeEventListener(i,u,s??!0))}}}const c=function(u){a(u,this)};return r.addEventListener(i,c,s??!1),{dispose:()=>{l||(l=!0,r.removeEventListener(i,c,s??!1))}}}o.on=e;function t(r,i,a){const s=document.getElementById(r);if(i.replaceChildren(s?.content.cloneNode(!0)),i.className=s.className,a?.visible!=null){const l=i.querySelectorAll("[data-visible]");for(const c of l){const u=c.dataset.visible;!u||(a.visible[u]?c.style.display="initial":c.style.display="none")}}if(a?.bindings!=null){const l=i.querySelectorAll("[data-bind]");for(const c of l){const u=c.dataset.bind;if(!u)continue;const d=a.bindings[u];d!=null&&(c.textContent=String(d))}}}o.insertTemplate=t;function n(r){r.replaceChildren(),r.className=""}o.resetSlot=n})(Q||(Q={}));const Un=/^(?:(#?)([0-9a-f]{3}|[0-9a-f]{6})|((?:rgb|hsl)a?)\((-?\d+%?)[,\s]+(-?\d+%?)[,\s]+(-?\d+%?)[,\s]*(-?[\d.]+%?)?\))$/i;function It(o,e){const t=o+e,n=e<0?t<0?0:t:t>255?255:t;return Math.round(n)}function le(o,e){return ge(o,-e)}function ge(o,e){const t=nn(o);if(t==null)return o;const[n,r,i,a]=t,s=255*e/100;return`rgba(${It(n,s)}, ${It(r,s)}, ${It(i,s)}, ${a})`}function me(o,e){const t=nn(o);if(t==null)return o;const[n,r,i,a]=t;return`rgba(${n}, ${r}, ${i}, ${a*(e/100)})`}function nn(o){o=o.trim();const e=Un.exec(o);if(e==null)return null;if(e[1]==="#"){const t=e[2];switch(t.length){case 3:return[parseInt(t[0]+t[0],16),parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),1];case 6:return[parseInt(t.substring(0,2),16),parseInt(t.substring(2,4),16),parseInt(t.substring(4,6),16),1]}return null}switch(e[3]){case"rgb":return[parseInt(e[4],10),parseInt(e[5],10),parseInt(e[6],10),1];case"rgba":return[parseInt(e[4],10),parseInt(e[5],10),parseInt(e[6],10),parseFloat(e[7])];default:return null}}function Jn(){const o=()=>{const t=document.body,n=window.getComputedStyle(t),r=t.style;r.setProperty("--font-family",n.getPropertyValue("--vscode-font-family").trim()),r.setProperty("--font-size",n.getPropertyValue("--vscode-font-size").trim()),r.setProperty("--font-weight",n.getPropertyValue("--vscode-font-weight").trim()),r.setProperty("--editor-font-family",n.getPropertyValue("--vscode-editor-font-family").trim()),r.setProperty("--editor-font-size",n.getPropertyValue("--vscode-editor-font-size").trim()),r.setProperty("--editor-font-weight",n.getPropertyValue("--vscode-editor-font-weight").trim());let i=n.getPropertyValue("--vscode-editor-background").trim();r.setProperty("--color-background",i),r.setProperty("--color-background--lighten-05",ge(i,5)),r.setProperty("--color-background--darken-05",le(i,5)),r.setProperty("--color-background--lighten-075",ge(i,7.5)),r.setProperty("--color-background--darken-075",le(i,7.5)),r.setProperty("--color-background--lighten-15",ge(i,15)),r.setProperty("--color-background--darken-15",le(i,15)),r.setProperty("--color-background--lighten-30",ge(i,30)),r.setProperty("--color-background--darken-30",le(i,30)),r.setProperty("--color-background--lighten-50",ge(i,50)),r.setProperty("--color-background--darken-50",le(i,50)),i=n.getPropertyValue("--vscode-button-background").trim(),r.setProperty("--color-button-background",i),r.setProperty("--color-button-background--darken-30",le(i,30)),i=n.getPropertyValue("--vscode-button-secondaryBackground").trim(),r.setProperty("--color-button-secondary-background",i),r.setProperty("--color-button-secondary-background--darken-30",le(i,30)),i=n.getPropertyValue("--vscode-button-background").trim(),r.setProperty("--color-highlight",i),r.setProperty("--color-highlight--75",me(i,75)),r.setProperty("--color-highlight--50",me(i,50)),r.setProperty("--color-highlight--25",me(i,25)),i=n.getPropertyValue("--vscode-button-foreground").trim(),r.setProperty("--color-button-foreground",i);let a=n.getPropertyValue("--vscode-editor-foreground").trim();a||(a=n.getPropertyValue("--vscode-foreground").trim()),r.setProperty("--color-foreground",a),r.setProperty("--color-foreground--85",me(a,85)),r.setProperty("--color-foreground--75",me(a,75)),r.setProperty("--color-foreground--65",me(a,65)),r.setProperty("--color-foreground--50",me(a,50)),i=n.getPropertyValue("--vscode-focusBorder").trim(),r.setProperty("--color-focus-border",i),i=n.getPropertyValue("--vscode-textLink-foreground").trim(),r.setProperty("--color-link-foreground",i),r.setProperty("--color-link-foreground--darken-20",le(i,20)),r.setProperty("--color-link-foreground--lighten-20",ge(i,20)),i=n.getPropertyValue("--vscode-sideBar-foreground").trim(),r.setProperty("--color-view-foreground",i||a),r.setProperty("--color-view-header-foreground",n.getPropertyValue("--vscode-sideBarSectionHeader-foreground").trim()||i||a),i=n.getPropertyValue("--vscode-editorHoverWidget-background").trim(),r.setProperty("--color-hover-background",i),i=n.getPropertyValue("--vscode-editorHoverWidget-border").trim(),r.setProperty("--color-hover-border",i),i=n.getPropertyValue("--vscode-editorHoverWidget-foreground").trim(),r.setProperty("--color-hover-foreground",i),i=n.getPropertyValue("--vscode-editorHoverWidget-statusBarBackground").trim(),r.setProperty("--color-hover-statusBarBackground",i)},e=new MutationObserver(o);return e.observe(document.body,{attributes:!0,attributeFilter:["class"]}),o(),e}var Zn=Object.defineProperty,Qn=(o,e,t)=>e in o?Zn(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,Ot=(o,e,t)=>(Qn(o,typeof e!="symbol"?e+"":e,t),t);const eo=2**30;let lt=0;function on(){return lt===eo?lt=1:lt++,`webview:${lt}`}class to{constructor(e){this.appName=e,Ot(this,"_api"),Ot(this,"state"),Ot(this,"bindDisposables"),this.state=window.bootstrap,window.bootstrap=void 0,this.log(`${this.appName}()`),this._api=acquireVsCodeApi(),Jn(),requestAnimationFrame(()=>{this.log(`${this.appName}.initializing`);try{this.onInitialize?.(),this.bind(),this.onMessageReceived!=null&&window.addEventListener("message",this.onMessageReceived.bind(this)),this.sendCommand(Yn,void 0),this.onInitialized?.()}finally{setTimeout(()=>{document.body.classList.remove("preload")},500)}})}bind(){this.bindDisposables?.forEach(e=>e.dispose()),this.bindDisposables=this.onBind?.()}log(e){}getState(){return this._api.getState()}sendCommand(e,t){const n=on();return this.log(`${this.appName}.sendCommand(${n}): name=${e.method}`),this.postMessage({id:n,method:e.method,params:t})}sendCommandWithCompletion(e,t,n,r){const i=on();this.log(`${this.appName}.sendCommandWithCompletion(${i}): name=${e.method}`);const a=Q.on(window,"message",s=>{en(n,s.data,l=>{l.completionId===i&&(a.dispose(),r(l))})});return this.postMessage({id:i,method:e.method,params:t})}setState(e){this.state=e,e!=null&&this._api.setState(e)}postMessage(e){this._api.postMessage(e)}}var no=Object.defineProperty,oo=(o,e,t)=>e in o?no(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,ro=(o,e,t)=>(oo(o,typeof e!="symbol"?e+"":e,t),t);const io=["pick","reword","edit","squash","fixup","drop"],ao=new Map([["p","pick"],["P","pick"],["r","reword"],["R","reword"],["e","edit"],["E","edit"],["s","squash"],["S","squash"],["f","fixup"],["F","fixup"],["d","drop"],["D","drop"]]);class so extends to{constructor(){super("RebaseEditor");ro(this,"commitTokenRegex",new RegExp(encodeURIComponent("${commit}")))}onInitialize(){this.state=this.getState()??this.state,this.state!=null&&this.refresh(this.state)}onBind(){const e=super.onBind?.()??[],t=document.getElementById("entries");if(Bn.create(t,{animation:150,handle:".entry-handle",filter:".entry--base",dragClass:"entry--drag",ghostClass:"entry--dragging",onChange:()=>{let n=!1,r=!1;const i=document.querySelectorAll("li[data-ref]");for(const a of i)r=!1,a.classList.contains("entry--squash")||a.classList.contains("entry--fixup")?n=!0:n&&(a.classList.contains("entry--drop")||(r=!0,n=!1)),a.classList.toggle("entry--squash-to",r&&!a.classList.contains("entry--base"))},onEnd:n=>{if(n.newIndex==null||n.newIndex===n.oldIndex)return;const r=n.item.dataset.ref;r!=null&&(this.moveEntry(r,n.newIndex,!1),document.querySelectorAll(`li[data-ref="${r}"]`)[0]?.focus())},onMove:n=>!n.related.classList.contains("entry--base")}),window.navigator.platform.startsWith("Mac")){let n=document.querySelector('[data-action="start"] .shortcut');n.textContent="Cmd+Enter",n=document.querySelector('[data-action="abort"] .shortcut'),n.textContent="Cmd+A"}return e.push(Q.on(window,"keydown",n=>{(n.ctrlKey||n.metaKey)&&(n.key==="Enter"||n.key==="r"?(n.preventDefault(),n.stopPropagation(),this.onStartClicked()):n.key==="a"&&(n.preventDefault(),n.stopPropagation(),this.onAbortClicked()))}),Q.on('[data-action="start"]',"click",()=>this.onStartClicked()),Q.on('[data-action="abort"]',"click",()=>this.onAbortClicked()),Q.on('[data-action="disable"]',"click",()=>this.onDisableClicked()),Q.on('[data-action="switch"]',"click",()=>this.onSwitchClicked()),Q.on("li[data-ref]","keydown",(n,r)=>{if(r.matches("select[data-ref]")){n.key==="Escape"&&r.focus();return}if(n.key==="Enter"||n.key===" "){if(n.key==="Enter"&&r.matches("a.entry-ref"))return;const i=r.querySelectorAll("select[data-ref]")[0];i?.focus()}else if(n.key==="ArrowUp"||n.key==="ArrowDown"){if(!n.metaKey&&!n.ctrlKey&&!n.shiftKey)if(n.altKey){const i=r.dataset.ref;i&&(n.stopPropagation(),this.moveEntry(i,n.key==="ArrowDown"?1:-1,!0))}else{if(this.state==null)return;let i=r.dataset.ref;if(i==null)return;n.preventDefault();let a=this.getEntryIndex(i)+(n.key==="ArrowDown"?1:-1);a<0?a=this.state.entries.length-1:a===this.state.entries.length&&(a=0),i=this.state.entries[a].ref,document.querySelectorAll(`li[data-ref="${i}"]`)[0]?.focus()}}else if(n.key==="j"||n.key==="k"){if(!n.metaKey&&!n.ctrlKey&&!n.shiftKey&&!n.altKey){if(this.state==null)return;let i=r.dataset.ref;if(i==null)return;n.preventDefault();let a=this.getEntryIndex(i)+(n.key==="j"?1:-1);a<0?a=this.state.entries.length-1:a===this.state.entries.length&&(a=0),i=this.state.entries[a].ref,document.querySelectorAll(`li[data-ref="${i}"]`)[0]?.focus()}}else if(n.key==="J"||n.key==="K"){if(!n.metaKey&&!n.ctrlKey&&!n.altKey&&n.shiftKey){const i=r.dataset.ref;i&&(n.stopPropagation(),this.moveEntry(i,n.key==="J"?1:-1,!0))}}else if(!n.metaKey&&!n.altKey&&!n.ctrlKey){const i=ao.get(n.key);if(i!==void 0){n.stopPropagation();const a=r.querySelectorAll("select[data-ref]")[0];a!=null&&!a.disabled&&(a.value=i,this.onSelectChanged(a))}}}),Q.on("select[data-ref]","input",(n,r)=>this.onSelectChanged(r))),e}getEntry(e){return this.state?.entries.find(t=>t.ref===e)}getEntryIndex(e){return this.state?.entries.findIndex(t=>t.ref===e)??-1}moveEntry(e,t,n){const r=this.getEntry(e);r!=null&&this.sendCommand(jn,{ref:r.ref,to:t,relative:n})}setEntryAction(e,t){const n=this.getEntry(e);if(n!=null){if(n.action===t)return;this.sendCommand(zn,{ref:n.ref,action:t})}}onAbortClicked(){this.sendCommand(qn,void 0)}onDisableClicked(){this.sendCommand(Wn,void 0)}onSelectChanged(e){const t=e.dataset.ref;t&&this.setEntryAction(t,e.options[e.selectedIndex].value)}onStartClicked(){this.sendCommand(Gn,void 0)}onSwitchClicked(){this.sendCommand(Vn,void 0)}onMessageReceived(e){const t=e.data;switch(t.method){case tn.method:this.log(`${this.appName}.onMessageReceived(${t.id}): name=${t.method}`),en(tn,t,n=>{this.setState({...this.state,...n.state}),this.refresh(this.state)});break;default:super.onMessageReceived?.(e)}}refresh(e){const t=document.activeElement?.closest("li[data-ref]")?.dataset.ref;let n=!1;document.activeElement?.matches("select[data-ref]")&&(n=!0);const r=document.getElementById("subhead");r.innerHTML="";let i=document.createElement("span");i.textContent=e.branch,i.classList.add("icon--branch","mr-1"),r.appendChild(i),i=document.createTextNode(`Rebasing ${e.entries.length} commit${e.entries.length!==1?"s":""}${e.onto?" onto":""}`),r.appendChild(i),e.onto&&(i=document.createElement("span"),i.textContent=e.onto,i.classList.add("icon--commit"),r.appendChild(i));const a=document.getElementById("entries");if(a.innerHTML="",e.entries.length===0){a.classList.add("entries--empty");const u=document.querySelector('.button[name="start"]');u!=null&&(u.disabled=!0);const d=document.createElement("li"),p=document.createElement("h3");p.textContent="No commits to rebase",d.appendChild(p),a.appendChild(d);return}let s=!1,l=!1,c=0;for(const u of e.entries){l=!1,u.action==="squash"||u.action==="fixup"?s=!0:s&&u.action!=="drop"&&(l=!0,s=!1);let d;[d,c]=this.createEntry(u,e,++c,l),a.appendChild(d)}if(e.onto){const u=e.commits.find(d=>d.ref.startsWith(e.onto));if(u!=null){const[d]=this.createEntry({action:void 0,index:0,message:u.message.split(` `)[0],ref:e.onto},e,++c,!1);a.appendChild(d),a.classList.add("entries--base")}}document.querySelectorAll(`${n?"select":"li"}[data-ref="${t??e.entries[0].ref}"]`)[0]?.focus(),this.bind()}createEntry(e,t,n,r){const i=document.createElement("li");if(i.classList.add("entry",`entry--${e.action??"base"}`),i.classList.toggle("entry--squash-to",r),i.dataset.ref=e.ref,e.action!=null){i.tabIndex=n++;const c=document.createElement("span");c.classList.add("entry-handle"),i.appendChild(c);const u=document.createElement("div");u.classList.add("entry-action","select-container"),i.appendChild(u);const d=document.createElement("select");d.dataset.ref=e.ref,d.name="action",d.tabIndex=n++;for(const p of io){const b=document.createElement("option");b.value=p,b.text=p,e.action===p&&(b.selected=!0),d.appendChild(b)}u.appendChild(d)}const a=document.createElement("span");a.classList.add("entry-message"),a.textContent=e.message??"",i.appendChild(a);const s=t.commits.find(c=>c.ref.startsWith(e.ref));if(s!=null){if(a.title=s.message??"",s.author){const c=t.authors.find(d=>d.author===s.author);if(c?.avatarUrl.length){const d=document.createElement("img");d.classList.add("entry-avatar"),d.src=c.avatarUrl,i.appendChild(d)}const u=document.createElement("span");u.classList.add("entry-author"),u.textContent=s.author,i.appendChild(u)}if(s.dateFromNow){const c=document.createElement("span");c.title=s.date??"",c.classList.add("entry-date"),c.textContent=s.dateFromNow,i.appendChild(c)}}const l=document.createElement("a");return l.classList.add("entry-ref","icon--commit"),l.href=s?.ref?t.commands.commit.replace(this.commitTokenRegex,s.ref):"#",l.textContent=e.ref.substr(0,7),l.tabIndex=n++,i.appendChild(l),[i,n]}}new so})(); //# sourceMappingURL=rebase.js.map