solorice/vscode/extensions/eamodio.gitlens-12.0.6/dist/webviews/rebase.js
2022-04-28 20:54:44 +03:00

10 lines
58 KiB
JavaScript

(()=>{"use strict";var uo={};/**!
* Sortable 1.14.0
* @author RubaXa <trash@rubaxa.org>
* @author owenm <owen23355@gmail.com>
* @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<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?xt(Object(t),!0).forEach(function(n){an(o,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(t)):xt(Object(t)).forEach(function(n){Object.defineProperty(o,n,Object.getOwnPropertyDescriptor(t,n))})}return o}function qe(o){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?qe=function(e){return typeof e}:qe=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qe(o)}function an(o,e,t){return e in o?Object.defineProperty(o,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):o[e]=t,o}function q(){return q=Object.assign||function(o){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(o[n]=t[n])}return o},q.apply(this,arguments)}function sn(o,e){if(o==null)return{};var t={},n=Object.keys(o),r,i;for(i=0;i<n.length;i++)r=n[i],!(e.indexOf(r)>=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<i.length;r++)n=i[r],!(e.indexOf(n)>=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;t++)n[t]=o[t];return n}function hn(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var pn="1.14.0";function ne(o){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(o)}var oe=ne(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),_e=ne(/Edge/i),Nt=ne(/firefox/i),Pe=ne(/safari/i)&&!ne(/chrome/i)&&!ne(/android/i),kt=ne(/iP(ad|od|hone)/i),gn=ne(/chrome/i)&&ne(/android/i),Mt={capture:!1,passive:!1};function E(o,e,t){o.addEventListener(e,t,!oe&&Mt)}function w(o,e,t){o.removeEventListener(e,t,!oe&&Mt)}function We(o,e){if(!!e){if(e[0]===">"&&(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;r++)t(n[r],r);return n}return[]}function J(){var o=document.scrollingElement;return o||document.documentElement}function _(o,e,t,n,r){if(!(!o.getBoundingClientRect&&o!==window)){var i,a,s,l,c,u,d;if(o!==window&&o.parentNode&&o!==J()?(i=o.getBoundingClientRect(),a=i.top,s=i.left,l=i.bottom,c=i.right,u=i.height,d=i.width):(a=0,s=0,l=window.innerHeight,c=window.innerWidth,u=window.innerHeight,d=window.innerWidth),(e||t)&&o!==window&&(r=r||o.parentNode,!oe))do if(r&&r.getBoundingClientRect&&(h(r,"transform")!=="none"||t&&h(r,"position")!=="static")){var p=r.getBoundingClientRect();a-=p.top+parseInt(h(r,"border-top-width")),s-=p.left+parseInt(h(r,"border-left-width")),l=a+i.height,c=s+i.width;break}while(r=r.parentNode);if(n&&o!==window){var b=ue(r||o),y=b&&b.a,S=b&&b.d;b&&(a/=S,s/=y,d/=y,u/=S,l=a+u,c=s+d)}return{top:a,left:s,bottom:l,right:c,width:d,height:u}}}function Rt(o,e,t){for(var n=ie(o,!0),r=_(o)[e];n;){var i=_(n)[t],a=void 0;if(t==="top"||t==="left"?a=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;i<a.length;){if(a[i].style.display!=="none"&&a[i]!==g.ghost&&(n||a[i]!==g.dragged)&&V(a[i],t.draggable,o,!1)){if(r===e)return a[i];r++}i++}return null}function ut(o,e){for(var t=o.lastElementChild;t&&(t===g.ghost||h(t,"display")==="none"||e&&!We(t,e));)t=t.previousElementSibling;return t||null}function A(o,e){var t=0;if(!o||!o.parentNode)return-1;for(;o=o.previousElementSibling;)o.nodeName.toUpperCase()!=="TEMPLATE"&&o!==g.clone&&(!e||We(o,e))&&t++;return t}function Lt(o){var e=0,t=0,n=J();if(o)do{var r=ue(o),i=r.a,a=r.d;e+=o.scrollLeft*i,t+=o.scrollTop*a}while(o!==n&&(o=o.parentNode));return[e,t]}function vn(o,e){for(var t in o)if(!!o.hasOwnProperty(t)){for(var n in e)if(e.hasOwnProperty(n)&&e[n]===o[t][n])return Number(t)}return-1}function ie(o,e){if(!o||!o.getBoundingClientRect)return J();var t=o,n=!1;do if(t.clientWidth<t.scrollWidth||t.clientHeight<t.scrollHeight){var r=h(t);if(t.clientWidth<t.scrollWidth&&(r.overflowX=="auto"||r.overflowX=="scroll")||t.clientHeight<t.scrollHeight&&(r.overflowY=="auto"||r.overflowY=="scroll")){if(!t.getBoundingClientRect||t===document.body)return J();if(n||e)return t;n=!0}}while(t=t.parentNode);return J()}function bn(o,e){if(o&&e)for(var t in e)e.hasOwnProperty(t)&&(o[t]=e[t]);return o}function ft(o,e){return Math.round(o.top)===Math.round(e.top)&&Math.round(o.left)===Math.round(e.left)&&Math.round(o.height)===Math.round(e.height)&&Math.round(o.width)===Math.round(e.width)}var Te;function Bt(o,e){return function(){if(!Te){var t=arguments,n=this;t.length===1?o.call(n,t[0]):o.apply(n,t),Te=setTimeout(function(){Te=void 0},e)}}}function yn(){clearTimeout(Te),Te=void 0}function Ht(o,e,t){o.scrollLeft+=e,o.scrollTop+=t}function ht(o){var e=window.Polymer,t=window.jQuery||window.Zepto;return e&&e.dom?e.dom(o).cloneNode(!0):t?t(o).clone(!0)[0]:o.cloneNode(!0)}function Kt(o,e){h(o,"position","absolute"),h(o,"top",e.top),h(o,"left",e.left),h(o,"width",e.width),h(o,"height",e.height)}function pt(o){h(o,"position",""),h(o,"top",""),h(o,"left",""),h(o,"width",""),h(o,"height","")}var $="Sortable"+new Date().getTime();function wn(){var o=[],e;return{captureAnimationState:function(){if(o=[],!!this.options.animation){var n=[].slice.call(this.el.children);n.forEach(function(r){if(!(h(r,"display")==="none"||r===g.ghost)){o.push({target:r,rect:_(r)});var i=U({},o[o.length-1].rect);if(r.thisAnimationDuration){var a=ue(r,!0);a&&(i.top-=a.f,i.left-=a.e)}r.fromRect=i}})}},addAnimationState:function(n){o.push(n)},removeAnimationState:function(n){o.splice(vn(o,{target:n}),1)},animateAll:function(n){var r=this;if(!this.options.animation){clearTimeout(e),typeof n=="function"&&n();return}var i=!1,a=0;o.forEach(function(s){var l=0,c=s.target,u=c.fromRect,d=_(c),p=c.prevFromRect,b=c.prevToRect,y=s.rect,S=ue(c,!0);S&&(d.top-=S.f,d.left-=S.e),c.toRect=d,c.thisAnimationDuration&&ft(p,d)&&!ft(u,d)&&(y.top-d.top)/(y.left-d.left)===(u.top-d.top)/(u.left-d.left)&&(l=Sn(y,p,b,r.options)),ft(d,u)||(c.prevFromRect=u,c.prevToRect=d,l||(l=r.options.animation),r.animate(c,y,d,l)),l&&(i=!0,a=Math.max(a,l),clearTimeout(c.animationResetTimer),c.animationResetTimer=setTimeout(function(){c.animationTime=0,c.prevFromRect=null,c.fromRect=null,c.prevToRect=null,c.thisAnimationDuration=null},l),c.thisAnimationDuration=l)}),clearTimeout(e),i?e=setTimeout(function(){typeof n=="function"&&n()},a):typeof n=="function"&&n(),o=[]},animate:function(n,r,i,a){if(a){h(n,"transition",""),h(n,"transform","");var s=ue(this.el),l=s&&s.a,c=s&&s.d,u=(r.left-i.left)/(l||1),d=(r.top-i.top)/(c||1);n.animatingX=!!u,n.animatingY=!!d,h(n,"transform","translate3d("+u+"px,"+d+"px,0)"),this.forRepaintDummy=En(n),h(n,"transition","transform "+a+"ms"+(this.options.easing?" "+this.options.easing:"")),h(n,"transform","translate3d(0,0,0)"),typeof n.animated=="number"&&clearTimeout(n.animated),n.animated=setTimeout(function(){h(n,"transition",""),h(n,"transform",""),n.animated=!1,n.animatingX=!1,n.animatingY=!1},a)}}}}function En(o){return o.offsetWidth}function Sn(o,e,t,n){return Math.sqrt(Math.pow(e.top-o.top,2)+Math.pow(e.left-o.left,2))/Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))*n.animation}var we=[],gt={initializeByDefault:!0},Ae={mount:function(e){for(var t in gt)gt.hasOwnProperty(t)&&!(t in e)&&(e[t]=gt[t]);we.forEach(function(n){if(n.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),we.push(e)},pluginEvent:function(e,t,n){var r=this;this.eventCanceled=!1,n.cancel=function(){r.eventCanceled=!0};var i=e+"Global";we.forEach(function(a){!t[a.pluginName]||(t[a.pluginName][i]&&t[a.pluginName][i](U({sortable:t},n)),t.options[a.pluginName]&&t[a.pluginName][e]&&t[a.pluginName][e](U({sortable:t},n)))})},initializePlugins:function(e,t,n,r){we.forEach(function(s){var l=s.pluginName;if(!(!e.options[l]&&!s.initializeByDefault)){var c=new s(e,t,e.options);c.sortable=e,c.options=e.options,e[l]=c,q(n,c.defaults)}});for(var i in e.options)if(!!e.options.hasOwnProperty(i)){var a=this.modifyOption(e,i,e.options[i]);typeof a<"u"&&(e.options[i]=a)}},getEventProperties:function(e,t){var n={};return we.forEach(function(r){typeof r.eventProperties=="function"&&q(n,r.eventProperties.call(t[r.pluginName],e))}),n},modifyOption:function(e,t,n){var r;return we.forEach(function(i){!e[i.pluginName]||i.optionListeners&&typeof i.optionListeners[t]=="function"&&(r=i.optionListeners[t].call(e[i.pluginName],n))}),r}};function Ie(o){var e=o.sortable,t=o.rootEl,n=o.name,r=o.targetEl,i=o.cloneEl,a=o.toEl,s=o.fromEl,l=o.oldIndex,c=o.newIndex,u=o.oldDraggableIndex,d=o.newDraggableIndex,p=o.originalEvent,b=o.putSortable,y=o.extraEventProperties;if(e=e||t&&t[$],!!e){var S,N=e.options,G="on"+n.charAt(0).toUpperCase()+n.substr(1);window.CustomEvent&&!oe&&!_e?S=new CustomEvent(n,{bubbles:!0,cancelable:!0}):(S=document.createEvent("Event"),S.initEvent(n,!0,!0)),S.to=a||t,S.from=s||t,S.item=r||t,S.clone=i,S.oldIndex=l,S.newIndex=c,S.oldDraggableIndex=u,S.newDraggableIndex=d,S.originalEvent=p,S.pullMode=b?b.lastPutMode:void 0;var k=U(U({},y),Ae.getEventProperties(n,e));for(var H in k)S[H]=k[H];t&&t.dispatchEvent(S),N[G]&&N[G].call(e,S)}}var Cn=["evt"],L=function(e,t){var n=arguments.length>2&&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))<n)return;this._onDragStart(e,!0)}if(v){a?(a.e+=u-(mt||0),a.f+=d-(vt||0)):a={a:1,b:0,c:0,d:1,e:u,f:d};var p="matrix(".concat(a.a,",").concat(a.b,",").concat(a.c,",").concat(a.d,",").concat(a.e,",").concat(a.f,")");h(v,"webkitTransform",p),h(v,"mozTransform",p),h(v,"msTransform",p),h(v,"transform",p),mt=u,vt=d,z=i}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!v){var e=this.options.fallbackOnBody?document.body:P,t=_(f,!0,et,!0,e),n=this.options;if(et){for(F=e;h(F,"position")==="static"&&h(F,"transform")==="none"&&F!==document;)F=F.parentNode;F!==document.body&&F!==document.documentElement?(F===document&&(F=J()),t.top+=F.scrollTop,t.left+=F.scrollLeft):F=J(),bt=Lt(F)}v=f.cloneNode(!0),T(v,n.ghostClass,!1),T(v,n.fallbackClass,!0),T(v,n.dragClass,!0),h(v,"transition",""),h(v,"transform",""),h(v,"box-sizing","border-box"),h(v,"margin",0),h(v,"top",t.top),h(v,"left",t.left),h(v,"width",t.width),h(v,"height",t.height),h(v,"opacity","0.8"),h(v,"position",et?"absolute":"fixed"),h(v,"zIndex","100000"),h(v,"pointerEvents","none"),g.ghost=v,e.appendChild(v),h(v,"transform-origin",Xt/parseInt(v.style.width)*100+"% "+Yt/parseInt(v.style.height)*100+"%")}},_onDragStart:function(e,t){var n=this,r=e.dataTransfer,i=n.options;if(L("dragStart",this,{evt:e}),g.eventCanceled){this._onDrop();return}L("setupClone",this),g.eventCanceled||(O=ht(f),O.draggable=!1,O.style["will-change"]="",this._hideClone(),T(O,this.options.chosenClass,!1),g.clone=O),n.cloneId=nt(function(){L("clone",n),!g.eventCanceled&&(n.options.removeCloneOnHide||P.insertBefore(O,f),n._hideClone(),R({sortable:n,name:"clone"}))}),!t&&T(f,i.dragClass,!0),t?(ze=!0,n._loopId=setInterval(n._emulateDragOver,50)):(w(document,"mouseup",n._onDrop),w(document,"touchend",n._onDrop),w(document,"touchcancel",n._onDrop),r&&(r.effectAllowed="move",i.setData&&i.setData.call(n,r,f)),E(document,"drop",n),h(f,"transform","translateZ(0)")),Se=!0,n._dragStartId=nt(n._dragStarted.bind(n,t,e)),E(document,"selectstart",n),xe=!0,Pe&&h(document.body,"user-select","none")},_onDragOver:function(e){var t=this.el,n=e.target,r,i,a,s=this.options,l=s.group,c=g.active,u=Ve===l,d=s.sort,p=M||c,b,y=this,S=!1;if(yt)return;function N(Ye,lo){L(Ye,y,U({evt:e,isOwner:u,axis:b?"vertical":"horizontal",revert:a,dragRect:r,targetRect:i,canSort:d,fromSortable:p,target:n,completed:k,onMove:function(rn,co){return tt(P,t,f,r,rn,_(rn),e,co)},changed:H},lo))}function G(){N("dragOverAnimationCapture"),y.captureAnimationState(),y!==p&&p.captureAnimationState()}function k(Ye){return N("dragOverCompleted",{insertion:Ye}),Ye&&(u?c._hideClone():c._showClone(y),y!==p&&(T(f,M?M.options.ghostClass:c.options.ghostClass,!1),T(f,s.ghostClass,!0)),M!==y&&y!==g.active?M=y:y===g.active&&M&&(M=null),p===y&&(y._ignoreWhileAnimating=n),y.animateAll(function(){N("dragOverAnimationComplete"),y._ignoreWhileAnimating=null}),y!==p&&(p.animateAll(),p._ignoreWhileAnimating=null)),(n===f&&!f.animated||n===t&&!n.animated)&&(Ce=null),!s.dragoverBubble&&!e.rootEl&&n!==document&&(f.parentNode[$]._isOutsideThisEl(e.target),!Ye&&pe(e)),!s.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),S=!0}function H(){K=A(f),se=A(f,s.draggable),R({sortable:y,name:"change",toEl:t,newIndex:K,newDraggableIndex:se,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),n=V(n,s.draggable,t,!0),N("dragOver"),g.eventCanceled)return S;if(f.contains(e.target)||n.animated&&n.animatingX&&n.animatingY||y._ignoreWhileAnimating===n)return k(!1);if(ze=!1,c&&!s.disabled&&(u?d||(a=I!==P):M===this||(this.lastPutMode=Ve.checkPull(this,c,f,e))&&l.checkPut(this,c,f,e))){if(b=this._getDirection(e,n)==="vertical",r=_(f),N("dragOverValid"),g.eventCanceled)return S;if(a)return I=P,G(),this._hideClone(),N("revert"),g.eventCanceled||(fe?P.insertBefore(f,fe):P.appendChild(f)),k(!0);var C=ut(t,s.draggable);if(!C||xn(e,b,this)&&!C.animated){if(C===f)return k(!1);if(C&&t===e.target&&(n=C),n&&(i=_(n)),tt(P,t,f,r,n,i,e,!!n)!==!1)return G(),t.appendChild(f),I=t,H(),k(!0)}else if(C&&On(e,b,this)){var ee=ye(t,0,s,!0);if(ee===f)return k(!1);if(n=ee,i=_(n),tt(P,t,f,r,n,i,e,!1)!==!1)return G(),t.insertBefore(f,ee),I=t,H(),k(!0)}else if(n.parentNode===t){i=_(n);var te=0,ve,Be=f.parentNode!==t,Y=!_n(f.animated&&f.toRect||r,n.animated&&n.toRect||i,b),He=b?"top":"left",ce=Rt(n,"top","top")||Rt(f,"top","top"),Ke=ce?ce.scrollTop:void 0;Ce!==n&&(ve=i[He],ke=!1,Ue=!Y&&s.invertSwap||Be),te=Nn(e,n,i,b,Y?1:s.swapThreshold,s.invertedSwapThreshold==null?s.swapThreshold:s.invertedSwapThreshold,Ue,Ce===n);var re;if(te!==0){var be=A(f);do be-=te,re=I.children[be];while(re&&(h(re,"display")==="none"||re===v))}if(te===0||re===n)return k(!1);Ce=n,Ne=te;var Xe=n.nextElementSibling,de=!1;de=te===1;var ct=tt(P,t,f,r,n,i,e,de);if(ct!==!1)return(ct===1||ct===-1)&&(de=ct===1),yt=!0,setTimeout(In,30),G(),de&&!Xe?t.appendChild(f):n.parentNode.insertBefore(f,de?Xe:n),ce&&Ht(ce,0,Ke-ce.scrollTop),I=f.parentNode,ve!==void 0&&!Ue&&(Je=Math.abs(ve-_(n)[He])),H(),k(!0)}if(t.contains(f))return k(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){w(document,"mousemove",this._onTouchMove),w(document,"touchmove",this._onTouchMove),w(document,"pointermove",this._onTouchMove),w(document,"dragover",pe),w(document,"mousemove",pe),w(document,"touchmove",pe)},_offUpEvents:function(){var e=this.el.ownerDocument;w(e,"mouseup",this._onDrop),w(e,"touchend",this._onDrop),w(e,"pointerup",this._onDrop),w(e,"touchcancel",this._onDrop),w(document,"selectstart",this)},_onDrop:function(e){var t=this.el,n=this.options;if(K=A(f),se=A(f,n.draggable),L("drop",this,{evt:e}),I=f&&f.parentNode,K=A(f),se=A(f,n.draggable),g.eventCanceled){this._nulling();return}Se=!1,Ue=!1,ke=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Et(this.cloneId),Et(this._dragStartId),this.nativeDraggable&&(w(document,"drop",this),w(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Pe&&h(document.body,"user-select",""),h(f,"transform",""),e&&(xe&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),v&&v.parentNode&&v.parentNode.removeChild(v),(P===I||M&&M.lastPutMode!=="clone")&&O&&O.parentNode&&O.parentNode.removeChild(O),f&&(this.nativeDraggable&&w(f,"dragend",this),wt(f),f.style["will-change"]="",xe&&!Se&&T(f,M?M.options.ghostClass:this.options.ghostClass,!1),T(f,this.options.chosenClass,!1),R({sortable:this,name:"unchoose",toEl:I,newIndex:null,newDraggableIndex:null,originalEvent:e}),P!==I?(K>=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;r<i;r++)t=n[r],V(t,a.draggable,this.el,!1)&&e.push(t.getAttribute(a.dataIdAttr)||Mn(t));return e},sort:function(e,t){var n={},r=this.el;this.toArray().forEach(function(i,a){var s=r.children[a];V(s,this.options.draggable,r,!1)&&(n[i]=s)},this),t&&this.captureAnimationState(),e.forEach(function(i){n[i]&&(r.removeChild(n[i]),r.appendChild(n[i]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return V(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var n=this.options;if(t===void 0)return n[e];var r=Ae.modifyOption(this,e,t);typeof r<"u"?n[e]=r:n[e]=t,e==="group"&&Vt(n)},destroy:function(){L("destroy",this);var e=this.el;e[$]=null,w(e,"mousedown",this._onTapStart),w(e,"touchstart",this._onTapStart),w(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(w(e,"dragover",this),w(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),je.splice(je.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!ae){if(L("hideClone",this),g.eventCanceled)return;h(O,"display","none"),this.options.removeCloneOnHide&&O.parentNode&&O.parentNode.removeChild(O),ae=!0}},_showClone:function(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(ae){if(L("showClone",this),g.eventCanceled)return;f.parentNode==P&&!this.options.group.revertClone?P.insertBefore(O,f):fe?P.insertBefore(O,fe):P.appendChild(O),this.options.group.revertClone&&this.animate(f,O),h(O,"display",""),ae=!1}}};function An(o){o.dataTransfer&&(o.dataTransfer.dropEffect="move"),o.cancelable&&o.preventDefault()}function tt(o,e,t,n,r,i,a,s){var l,c=o[$],u=c.options.onMove,d;return window.CustomEvent&&!oe&&!_e?l=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(l=document.createEvent("Event"),l.initEvent("move",!0,!0)),l.to=e,l.from=o,l.dragged=t,l.draggedRect=n,l.related=r||e,l.relatedRect=i||_(e),l.willInsertAfter=s,l.originalEvent=a,o.dispatchEvent(l),u&&(d=u.call(c,l,a)),d}function wt(o){o.draggable=!1}function In(){yt=!1}function On(o,e,t){var n=_(ye(t.el,0,t.options,!0)),r=10;return e?o.clientX<n.left-r||o.clientY<n.top&&o.clientX<n.right:o.clientY<n.top-r||o.clientY<n.bottom&&o.clientX<n.left}function xn(o,e,t){var n=_(ut(t.el,t.options.draggable)),r=10;return e?o.clientX>n.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&&Je<c*r){if(!ke&&(Ne===1?l>u+c*i/2:l<d-c*i/2)&&(ke=!0),ke)p=!0;else if(Ne===1?l<u+Je:l>d-Je)return-Ne}else if(l>u+c*(1-r)/2&&l<d-c*(1-r)/2)return kn(e)}return p=p||a,p&&(l<u+c*i/2||l>d-c*i/2)?l>u+c/2?1:-1:0}function kn(o){return A(f)<A(o)?1:-1}function Mn(o){for(var e=o.tagName+o.className+o.src+o.href+o.textContent,t=e.length,n=0;t--;)n+=e.charCodeAt(t);return n.toString(36)}function $n(o){Ze.length=0;for(var e=o.getElementsByTagName("input"),t=e.length;t--;){var n=e[t];n.checked&&Ze.push(n)}}function nt(o){return setTimeout(o,0)}function Et(o){return clearTimeout(o)}Qe&&E(document,"touchmove",function(o){(g.active||Se)&&o.cancelable&&o.preventDefault()}),g.utils={on:E,off:w,css:h,find:Ft,is:function(e,t){return!!V(e,t,e,!1)},extend:bn,throttle:Bt,closest:V,toggleClass:T,clone:ht,index:A,nextTick:nt,cancelNextTick:Et,detectDirection:Gt,getChild:ye},g.get=function(o){return o[$]},g.mount=function(){for(var o=arguments.length,e=new Array(o),t=0;t<o;t++)e[t]=arguments[t];e[0].constructor===Array&&(e=e[0]),e.forEach(function(n){if(!n.prototype||!n.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(n));n.utils&&(g.utils=U(U({},g.utils),n.utils)),Ae.mount(n)})},g.create=function(o,e){return new g(o,e)},g.version=pn;var x=[],Me,St,Ct=!1,Dt,_t,ot,$e;function Fn(){function o(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this))}return o.prototype={dragStarted:function(t){var n=t.originalEvent;this.sortable.nativeDraggable?E(document,"dragover",this._handleAutoScroll):this.options.supportPointer?E(document,"pointermove",this._handleFallbackAutoScroll):n.touches?E(document,"touchmove",this._handleFallbackAutoScroll):E(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var n=t.originalEvent;!this.options.dragOverBubble&&!n.rootEl&&this._handleAutoScroll(n)},drop:function(){this.sortable.nativeDraggable?w(document,"dragover",this._handleAutoScroll):(w(document,"pointermove",this._handleFallbackAutoScroll),w(document,"touchmove",this._handleFallbackAutoScroll),w(document,"mousemove",this._handleFallbackAutoScroll)),Ut(),rt(),yn()},nulling:function(){ot=St=Me=Ct=$e=Dt=_t=null,x.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,n){var r=this,i=(t.touches?t.touches[0]:t).clientX,a=(t.touches?t.touches[0]:t).clientY,s=document.elementFromPoint(i,a);if(ot=t,n||this.options.forceAutoScrollFallback||_e||oe||Pe){Pt(t,this.options,s,n);var l=ie(s,!0);Ct&&(!$e||i!==Dt||a!==_t)&&($e&&Ut(),$e=setInterval(function(){var c=ie(document.elementFromPoint(i,a),!0);c!==l&&(l=c,rt()),Pt(t,r.options,c,n)},10),Dt=i,_t=a)}else{if(!this.options.bubbleScroll||ie(s,!0)===J()){rt();return}Pt(t,this.options,ie(s,!1),!1)}}},q(o,{pluginName:"scroll",initializeByDefault:!0})}function rt(){x.forEach(function(o){clearInterval(o.pid)}),x=[]}function Ut(){clearInterval($e)}var Pt=Bt(function(o,e,t,n){if(!!e.scroll){var r=(o.touches?o.touches[0]:o).clientX,i=(o.touches?o.touches[0]:o).clientY,a=e.scrollSensitivity,s=e.scrollSpeed,l=J(),c=!1,u;St!==t&&(St=t,rt(),Me=e.scroll,u=e.scrollFn,Me===!0&&(Me=ie(t,!0)));var d=0,p=Me;do{var b=p,y=_(b),S=y.top,N=y.bottom,G=y.left,k=y.right,H=y.width,C=y.height,ee=void 0,te=void 0,ve=b.scrollWidth,Be=b.scrollHeight,Y=h(b),He=b.scrollLeft,ce=b.scrollTop;b===l?(ee=H<ve&&(Y.overflowX==="auto"||Y.overflowX==="scroll"||Y.overflowX==="visible"),te=C<Be&&(Y.overflowY==="auto"||Y.overflowY==="scroll"||Y.overflowY==="visible")):(ee=H<ve&&(Y.overflowX==="auto"||Y.overflowX==="scroll"),te=C<Be&&(Y.overflowY==="auto"||Y.overflowY==="scroll"));var Ke=ee&&(Math.abs(k-r)<=a&&He+H<ve)-(Math.abs(G-r)<=a&&!!He),re=te&&(Math.abs(N-i)<=a&&ce+C<Be)-(Math.abs(S-i)<=a&&!!ce);if(!x[d])for(var be=0;be<=d;be++)x[be]||(x[be]={});(x[d].vx!=Ke||x[d].vy!=re||x[d].el!==b)&&(x[d].el=b,x[d].vx=Ke,x[d].vy=re,clearInterval(x[d].pid),(Ke!=0||re!=0)&&(c=!0,x[d].pid=setInterval(function(){n&&this.layer===0&&g.active._onTouchMove(ot);var Xe=x[this.layer].vy?x[this.layer].vy*s:0,de=x[this.layer].vx?x[this.layer].vx*s:0;typeof u=="function"&&u.call(g.dragged.parentNode[$],de,Xe,o,ot,x[this.layer].el)!=="continue"||Ht(x[this.layer].el,de,Xe)}.bind({layer:d}),24))),d++}while(e.bubbleScroll&&p!==l&&(p=ie(p,!1)));Ct=c}},30),Jt=function(e){var t=e.originalEvent,n=e.putSortable,r=e.dragEl,i=e.activeSortable,a=e.dispatchSortableEvent,s=e.hideGhostForTarget,l=e.unhideGhostForTarget;if(!!t){var c=n||i;s();var u=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,d=document.elementFromPoint(u.clientX,u.clientY);l(),c&&!c.el.contains(d)&&(a("spill"),this.onSpill({dragEl:r,putSortable:n}))}};function Tt(){}Tt.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,n=e.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var r=ye(this.sortable.el,this.startIndex,this.options);r?this.sortable.el.insertBefore(t,r):this.sortable.el.appendChild(t),this.sortable.animateAll(),n&&n.animateAll()},drop:Jt},q(Tt,{pluginName:"revertOnSpill"});function At(){}At.prototype={onSpill:function(e){var t=e.dragEl,n=e.putSortable,r=n||this.sortable;r.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),r.animateAll()},drop:Jt},q(At,{pluginName:"removeOnSpill"});var W;function fo(){function o(){this.defaults={swapClass:"sortable-swap-highlight"}}return o.prototype={dragStart:function(t){var n=t.dragEl;W=n},dragOverValid:function(t){var n=t.completed,r=t.target,i=t.onMove,a=t.activeSortable,s=t.changed,l=t.cancel;if(!!a.options.swap){var c=this.sortable.el,u=this.options;if(r&&r!==c){var d=W;i(r)!==!1?(T(r,u.swapClass,!0),W=r):W=null,d&&d!==W&&T(d,u.swapClass,!1)}s(),n(!0),l()}},drop:function(t){var n=t.activeSortable,r=t.putSortable,i=t.dragEl,a=r||this.sortable,s=this.options;W&&T(W,s.swapClass,!1),W&&(s.swap||r&&r.options.swap)&&i!==W&&(a.captureAnimationState(),a!==n&&n.captureAnimationState(),Rn(i,W),a.animateAll(),a!==n&&n.animateAll())},nulling:function(){W=null}},q(o,{pluginName:"swap",eventProperties:function(){return{swapItem:W}}})}function Rn(o,e){var t=o.parentNode,n=e.parentNode,r,i;!t||!n||t.isEqualNode(e)||n.isEqualNode(o)||(r=A(o),i=A(e),t.isEqualNode(n)&&r<i&&i++,t.insertBefore(e,t.children[r]),n.insertBefore(o,n.children[i]))}var m=null,X=null,Fe,j,Re=!1,B=!1,De=!1,D,Le,it;function ho(){function o(e){for(var t in this)t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this));e.options.supportPointer?E(document,"pointerup",this._deselectMultiDrag):(E(document,"mouseup",this._deselectMultiDrag),E(document,"touchend",this._deselectMultiDrag)),E(document,"keydown",this._checkKeyDown),E(document,"keyup",this._checkKeyUp),this.defaults={selectedClass:"sortable-selected",multiDragKey:null,setData:function(r,i){var a="";m.length&&j===e?m.forEach(function(s,l){a+=(l?", ":"")+s.textContent}):a=i.textContent,r.setData("Text",a)}}}return o.prototype={multiDragKeyDown:!1,isMultiDrag:!1,delayStartGlobal:function(t){var n=t.dragEl;D=n},delayEnded:function(){this.isMultiDrag=~m.indexOf(D)},setupClone:function(t){var n=t.sortable,r=t.cancel;if(!!this.isMultiDrag){for(var i=0;i<m.length;i++)X.push(ht(m[i])),X[i].sortableIndex=m[i].sortableIndex,X[i].draggable=!1,X[i].style["will-change"]="",T(X[i],this.options.selectedClass,!1),m[i]===D&&T(X[i],this.options.chosenClass,!1);n._hideClone(),r()}},clone:function(t){var n=t.sortable,r=t.rootEl,i=t.dispatchSortableEvent,a=t.cancel;!this.isMultiDrag||this.options.removeCloneOnHide||m.length&&j===n&&(Zt(!0,r),i("clone"),a())},showClone:function(t){var n=t.cloneNowShown,r=t.rootEl,i=t.cancel;!this.isMultiDrag||(Zt(!1,r),X.forEach(function(a){h(a,"display","")}),n(),it=!1,i())},hideClone:function(t){var n=this,r=t.sortable,i=t.cloneNowHidden,a=t.cancel;!this.isMultiDrag||(X.forEach(function(s){h(s,"display","none"),n.options.removeCloneOnHide&&s.parentNode&&s.parentNode.removeChild(s)}),i(),it=!0,a())},dragStartGlobal:function(t){var n=t.sortable;!this.isMultiDrag&&j&&j.multiDrag._deselectMultiDrag(),m.forEach(function(r){r.sortableIndex=A(r)}),m=m.sort(function(r,i){return r.sortableIndex-i.sortableIndex}),De=!0},dragStarted:function(t){var n=this,r=t.sortable;if(!!this.isMultiDrag){if(this.options.sort&&(r.captureAnimationState(),this.options.animation)){m.forEach(function(a){a!==D&&h(a,"position","absolute")});var i=_(D,!1,!0,!0);m.forEach(function(a){a!==D&&Kt(a,i)}),B=!0,Re=!0}r.animateAll(function(){B=!1,Re=!1,n.options.animation&&m.forEach(function(a){pt(a)}),n.options.sort&&at()})}},dragOver:function(t){var n=t.target,r=t.completed,i=t.cancel;B&&~m.indexOf(n)&&(r(!1),i())},revert:function(t){var n=t.fromSortable,r=t.rootEl,i=t.sortable,a=t.dragRect;m.length>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);N<S;N++)~m.indexOf(p[N])||(T(p[N],d.selectedClass,!0),m.push(p[N]),Ie({sortable:a,rootEl:r,name:"select",targetEl:p[N],originalEvt:n}))}}else Fe=D;j=u}if(De&&this.isMultiDrag){if(B=!1,(i[$].options.sort||i!==r)&&m.length>1){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