9 lines
44 KiB
JavaScript
9 lines
44 KiB
JavaScript
import{d as Ut,c as Ct,bo as bn,l as F,r as Lt,dD as yn,dE as wn,dF as mt,aM as qt,o as Sn,aT as zt,cq as Dn,aS as Qe,aL as En,aH as et,a as Cn,h as _t,w as Q,aN as _n,g as re,aO as Tn,O as xn,b as tt,e as Tt,j as ue,t as ie,z as me,F as xt,p as On,aP as In,M as Mn,f as _e,Q as bt,Y as yt,L as An}from"./main-BhFWIRV_.js";import{b as Nn}from"./model_utils-CVQgSPL_.js";var kn=Object.defineProperty,Ue=Object.getOwnPropertySymbols,Gt=Object.prototype.hasOwnProperty,Jt=Object.prototype.propertyIsEnumerable,Ot=(e,n,t)=>n in e?kn(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,Se=(e,n)=>{for(var t in n||(n={}))Gt.call(n,t)&&Ot(e,t,n[t]);if(Ue)for(var t of Ue(n))Jt.call(n,t)&&Ot(e,t,n[t]);return e},Zt=(e,n)=>{var t={};for(var o in e)Gt.call(e,o)&&n.indexOf(o)<0&&(t[o]=e[o]);if(e!=null&&Ue)for(var o of Ue(e))n.indexOf(o)<0&&Jt.call(e,o)&&(t[o]=e[o]);return t};const Kt="[vue-draggable-plus]: ";function Pn(e){console.warn(Kt+e)}function Rn(e){console.error(Kt+e)}function It(e,n,t){return t>=0&&t<e.length&&e.splice(t,0,e.splice(n,1)[0]),e}function Yn(e){return e.replace(/-(\w)/g,(n,t)=>t?t.toUpperCase():"")}function Bn(e){return Object.keys(e).reduce((n,t)=>(typeof e[t]<"u"&&(n[Yn(t)]=e[t]),n),{})}function Mt(e,n){return Array.isArray(e)&&e.splice(n,1),e}function At(e,n,t){return Array.isArray(e)&&e.splice(n,0,t),e}function Xn(e){return typeof e>"u"}function Fn(e){return typeof e=="string"}function Nt(e,n,t){const o=e.children[t];e.insertBefore(n,o)}function nt(e){e.parentNode&&e.parentNode.removeChild(e)}function Vn(e,n=document){var t;let o=null;return typeof n?.querySelector=="function"?o=(t=n?.querySelector)==null?void 0:t.call(n,e):o=document.querySelector(e),o||Pn(`Element not found: ${e}`),o}function jn(e,n,t=null){return function(...o){return e.apply(t,o),n.apply(t,o)}}function Hn(e,n){const t=Se({},e);return Object.keys(n).forEach(o=>{t[o]?t[o]=jn(e[o],n[o]):t[o]=n[o]}),t}function $n(e){return e instanceof HTMLElement}function kt(e,n){Object.keys(e).forEach(t=>{n(t,e[t])})}function Wn(e){return e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97)}const Un=Object.assign;/**!
|
|
* Sortable 1.15.2
|
|
* @author RubaXa <trash@rubaxa.org>
|
|
* @author owenm <owen23355@gmail.com>
|
|
* @license MIT
|
|
*/function Pt(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function te(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?Pt(Object(t),!0).forEach(function(o){Ln(e,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Pt(Object(t)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(t,o))})}return e}function Ve(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ve=function(n){return typeof n}:Ve=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Ve(e)}function Ln(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function le(){return le=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},le.apply(this,arguments)}function qn(e,n){if(e==null)return{};var t={},o=Object.keys(e),r,a;for(a=0;a<o.length;a++)r=o[a],!(n.indexOf(r)>=0)&&(t[r]=e[r]);return t}function zn(e,n){if(e==null)return{};var t=qn(e,n),o,r;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)o=a[r],!(n.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(t[o]=e[o])}return t}var Gn="1.15.2";function ae(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var se=ae(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Pe=ae(/Edge/i),Rt=ae(/firefox/i),Ie=ae(/safari/i)&&!ae(/chrome/i)&&!ae(/android/i),Qt=ae(/iP(ad|od|hone)/i),en=ae(/chrome/i)&&ae(/android/i),tn={capture:!1,passive:!1};function D(e,n,t){e.addEventListener(n,t,!se&&tn)}function y(e,n,t){e.removeEventListener(n,t,!se&&tn)}function Le(e,n){if(n){if(n[0]===">"&&(n=n.substring(1)),e)try{if(e.matches)return e.matches(n);if(e.msMatchesSelector)return e.msMatchesSelector(n);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(n)}catch{return!1}return!1}}function Jn(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function Z(e,n,t,o){if(e){t=t||document;do{if(n!=null&&(n[0]===">"?e.parentNode===t&&Le(e,n):Le(e,n))||o&&e===t)return e;if(e===t)break}while(e=Jn(e))}return null}var Yt=/\s+/g;function W(e,n,t){if(e&&n)if(e.classList)e.classList[t?"add":"remove"](n);else{var o=(" "+e.className+" ").replace(Yt," ").replace(" "+n+" "," ");e.className=(o+(t?" "+n:"")).replace(Yt," ")}}function p(e,n,t){var o=e&&e.style;if(o){if(t===void 0)return document.defaultView&&document.defaultView.getComputedStyle?t=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(t=e.currentStyle),n===void 0?t:t[n];!(n in o)&&n.indexOf("webkit")===-1&&(n="-webkit-"+n),o[n]=t+(typeof t=="string"?"":"px")}}function Ee(e,n){var t="";if(typeof e=="string")t=e;else do{var o=p(e,"transform");o&&o!=="none"&&(t=o+" "+t)}while(!n&&(e=e.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(t)}function nn(e,n,t){if(e){var o=e.getElementsByTagName(n),r=0,a=o.length;if(t)for(;r<a;r++)t(o[r],r);return o}return[]}function ee(){var e=document.scrollingElement;return e||document.documentElement}function N(e,n,t,o,r){if(!(!e.getBoundingClientRect&&e!==window)){var a,i,s,l,u,c,f;if(e!==window&&e.parentNode&&e!==ee()?(a=e.getBoundingClientRect(),i=a.top,s=a.left,l=a.bottom,u=a.right,c=a.height,f=a.width):(i=0,s=0,l=window.innerHeight,u=window.innerWidth,c=window.innerHeight,f=window.innerWidth),(n||t)&&e!==window&&(r=r||e.parentNode,!se))do if(r&&r.getBoundingClientRect&&(p(r,"transform")!=="none"||t&&p(r,"position")!=="static")){var S=r.getBoundingClientRect();i-=S.top+parseInt(p(r,"border-top-width")),s-=S.left+parseInt(p(r,"border-left-width")),l=i+a.height,u=s+a.width;break}while(r=r.parentNode);if(o&&e!==window){var h=Ee(r||e),C=h&&h.a,w=h&&h.d;h&&(i/=w,s/=C,f/=C,c/=w,l=i+c,u=s+f)}return{top:i,left:s,bottom:l,right:u,width:f,height:c}}}function Bt(e,n,t){for(var o=fe(e,!0),r=N(e)[n];o;){var a=N(o)[t],i=void 0;if(i=r>=a,!i)return o;if(o===ee())break;o=fe(o,!1)}return!1}function Ce(e,n,t,o){for(var r=0,a=0,i=e.children;a<i.length;){if(i[a].style.display!=="none"&&i[a]!==g.ghost&&(o||i[a]!==g.dragged)&&Z(i[a],t.draggable,e,!1)){if(r===n)return i[a];r++}a++}return null}function wt(e,n){for(var t=e.lastElementChild;t&&(t===g.ghost||p(t,"display")==="none"||n&&!Le(t,n));)t=t.previousElementSibling;return t||null}function z(e,n){var t=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==g.clone&&(!n||Le(e,n))&&t++;return t}function Xt(e){var n=0,t=0,o=ee();if(e)do{var r=Ee(e),a=r.a,i=r.d;n+=e.scrollLeft*a,t+=e.scrollTop*i}while(e!==o&&(e=e.parentNode));return[n,t]}function Zn(e,n){for(var t in e)if(e.hasOwnProperty(t)){for(var o in n)if(n.hasOwnProperty(o)&&n[o]===e[t][o])return Number(t)}return-1}function fe(e,n){if(!e||!e.getBoundingClientRect)return ee();var t=e,o=!1;do if(t.clientWidth<t.scrollWidth||t.clientHeight<t.scrollHeight){var r=p(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 ee();if(o||n)return t;o=!0}}while(t=t.parentNode);return ee()}function Kn(e,n){if(e&&n)for(var t in n)n.hasOwnProperty(t)&&(e[t]=n[t]);return e}function ot(e,n){return Math.round(e.top)===Math.round(n.top)&&Math.round(e.left)===Math.round(n.left)&&Math.round(e.height)===Math.round(n.height)&&Math.round(e.width)===Math.round(n.width)}var Me;function on(e,n){return function(){if(!Me){var t=arguments,o=this;t.length===1?e.call(o,t[0]):e.apply(o,t),Me=setTimeout(function(){Me=void 0},n)}}}function Qn(){clearTimeout(Me),Me=void 0}function rn(e,n,t){e.scrollLeft+=n,e.scrollTop+=t}function an(e){var n=window.Polymer,t=window.jQuery||window.Zepto;return n&&n.dom?n.dom(e).cloneNode(!0):t?t(e).clone(!0)[0]:e.cloneNode(!0)}function ln(e,n,t){var o={};return Array.from(e.children).forEach(function(r){var a,i,s,l;if(!(!Z(r,n.draggable,e,!1)||r.animated||r===t)){var u=N(r);o.left=Math.min((a=o.left)!==null&&a!==void 0?a:1/0,u.left),o.top=Math.min((i=o.top)!==null&&i!==void 0?i:1/0,u.top),o.right=Math.max((s=o.right)!==null&&s!==void 0?s:-1/0,u.right),o.bottom=Math.max((l=o.bottom)!==null&&l!==void 0?l:-1/0,u.bottom)}}),o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}var L="Sortable"+new Date().getTime();function eo(){var e=[],n;return{captureAnimationState:function(){if(e=[],!!this.options.animation){var t=[].slice.call(this.el.children);t.forEach(function(o){if(!(p(o,"display")==="none"||o===g.ghost)){e.push({target:o,rect:N(o)});var r=te({},e[e.length-1].rect);if(o.thisAnimationDuration){var a=Ee(o,!0);a&&(r.top-=a.f,r.left-=a.e)}o.fromRect=r}})}},addAnimationState:function(t){e.push(t)},removeAnimationState:function(t){e.splice(Zn(e,{target:t}),1)},animateAll:function(t){var o=this;if(!this.options.animation){clearTimeout(n),typeof t=="function"&&t();return}var r=!1,a=0;e.forEach(function(i){var s=0,l=i.target,u=l.fromRect,c=N(l),f=l.prevFromRect,S=l.prevToRect,h=i.rect,C=Ee(l,!0);C&&(c.top-=C.f,c.left-=C.e),l.toRect=c,l.thisAnimationDuration&&ot(f,c)&&!ot(u,c)&&(h.top-c.top)/(h.left-c.left)===(u.top-c.top)/(u.left-c.left)&&(s=no(h,f,S,o.options)),ot(c,u)||(l.prevFromRect=u,l.prevToRect=c,s||(s=o.options.animation),o.animate(l,h,c,s)),s&&(r=!0,a=Math.max(a,s),clearTimeout(l.animationResetTimer),l.animationResetTimer=setTimeout(function(){l.animationTime=0,l.prevFromRect=null,l.fromRect=null,l.prevToRect=null,l.thisAnimationDuration=null},s),l.thisAnimationDuration=s)}),clearTimeout(n),r?n=setTimeout(function(){typeof t=="function"&&t()},a):typeof t=="function"&&t(),e=[]},animate:function(t,o,r,a){if(a){p(t,"transition",""),p(t,"transform","");var i=Ee(this.el),s=i&&i.a,l=i&&i.d,u=(o.left-r.left)/(s||1),c=(o.top-r.top)/(l||1);t.animatingX=!!u,t.animatingY=!!c,p(t,"transform","translate3d("+u+"px,"+c+"px,0)"),this.forRepaintDummy=to(t),p(t,"transition","transform "+a+"ms"+(this.options.easing?" "+this.options.easing:"")),p(t,"transform","translate3d(0,0,0)"),typeof t.animated=="number"&&clearTimeout(t.animated),t.animated=setTimeout(function(){p(t,"transition",""),p(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1},a)}}}}function to(e){return e.offsetWidth}function no(e,n,t,o){return Math.sqrt(Math.pow(n.top-e.top,2)+Math.pow(n.left-e.left,2))/Math.sqrt(Math.pow(n.top-t.top,2)+Math.pow(n.left-t.left,2))*o.animation}var be=[],rt={initializeByDefault:!0},Re={mount:function(e){for(var n in rt)rt.hasOwnProperty(n)&&!(n in e)&&(e[n]=rt[n]);be.forEach(function(t){if(t.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),be.push(e)},pluginEvent:function(e,n,t){var o=this;this.eventCanceled=!1,t.cancel=function(){o.eventCanceled=!0};var r=e+"Global";be.forEach(function(a){n[a.pluginName]&&(n[a.pluginName][r]&&n[a.pluginName][r](te({sortable:n},t)),n.options[a.pluginName]&&n[a.pluginName][e]&&n[a.pluginName][e](te({sortable:n},t)))})},initializePlugins:function(e,n,t,o){be.forEach(function(i){var s=i.pluginName;if(!(!e.options[s]&&!i.initializeByDefault)){var l=new i(e,n,e.options);l.sortable=e,l.options=e.options,e[s]=l,le(t,l.defaults)}});for(var r in e.options)if(e.options.hasOwnProperty(r)){var a=this.modifyOption(e,r,e.options[r]);typeof a<"u"&&(e.options[r]=a)}},getEventProperties:function(e,n){var t={};return be.forEach(function(o){typeof o.eventProperties=="function"&&le(t,o.eventProperties.call(n[o.pluginName],e))}),t},modifyOption:function(e,n,t){var o;return be.forEach(function(r){e[r.pluginName]&&r.optionListeners&&typeof r.optionListeners[n]=="function"&&(o=r.optionListeners[n].call(e[r.pluginName],t))}),o}};function oo(e){var n=e.sortable,t=e.rootEl,o=e.name,r=e.targetEl,a=e.cloneEl,i=e.toEl,s=e.fromEl,l=e.oldIndex,u=e.newIndex,c=e.oldDraggableIndex,f=e.newDraggableIndex,S=e.originalEvent,h=e.putSortable,C=e.extraEventProperties;if(n=n||t&&t[L],!!n){var w,$=n.options,I="on"+o.charAt(0).toUpperCase()+o.substr(1);window.CustomEvent&&!se&&!Pe?w=new CustomEvent(o,{bubbles:!0,cancelable:!0}):(w=document.createEvent("Event"),w.initEvent(o,!0,!0)),w.to=i||t,w.from=s||t,w.item=r||t,w.clone=a,w.oldIndex=l,w.newIndex=u,w.oldDraggableIndex=c,w.newDraggableIndex=f,w.originalEvent=S,w.pullMode=h?h.lastPutMode:void 0;var G=te(te({},C),Re.getEventProperties(o,n));for(var k in G)w[k]=G[k];t&&t.dispatchEvent(w),$[I]&&$[I].call(n,w)}}var ro=["evt"],H=function(e,n){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=t.evt,r=zn(t,ro);Re.pluginEvent.bind(g)(e,n,te({dragEl:d,parentEl:x,ghostEl:v,rootEl:_,nextEl:ve,lastDownEl:je,cloneEl:T,cloneHidden:de,dragStarted:Te,putSortable:B,activeSortable:g.active,originalEvent:o,oldIndex:De,oldDraggableIndex:Ae,newIndex:U,newDraggableIndex:ce,hideGhostForTarget:dn,unhideGhostForTarget:fn,cloneNowHidden:function(){de=!0},cloneNowShown:function(){de=!1},dispatchSortableEvent:function(a){V({sortable:n,name:a,originalEvent:o})}},r))};function V(e){oo(te({putSortable:B,cloneEl:T,targetEl:d,rootEl:_,oldIndex:De,oldDraggableIndex:Ae,newIndex:U,newDraggableIndex:ce},e))}var d,x,v,_,ve,je,T,de,De,U,Ae,ce,Ye,B,we=!1,qe=!1,ze=[],pe,J,it,at,Ft,Vt,Te,ye,Ne,ke=!1,Be=!1,He,X,lt=[],ft=!1,Ge=[],Ze=typeof document<"u",Xe=Qt,jt=Pe||se?"cssFloat":"float",io=Ze&&!en&&!Qt&&"draggable"in document.createElement("div"),sn=function(){if(Ze){if(se)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),un=function(e,n){var t=p(e),o=parseInt(t.width)-parseInt(t.paddingLeft)-parseInt(t.paddingRight)-parseInt(t.borderLeftWidth)-parseInt(t.borderRightWidth),r=Ce(e,0,n),a=Ce(e,1,n),i=r&&p(r),s=a&&p(a),l=i&&parseInt(i.marginLeft)+parseInt(i.marginRight)+N(r).width,u=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+N(a).width;if(t.display==="flex")return t.flexDirection==="column"||t.flexDirection==="column-reverse"?"vertical":"horizontal";if(t.display==="grid")return t.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&i.float&&i.float!=="none"){var c=i.float==="left"?"left":"right";return a&&(s.clear==="both"||s.clear===c)?"vertical":"horizontal"}return r&&(i.display==="block"||i.display==="flex"||i.display==="table"||i.display==="grid"||l>=o&&t[jt]==="none"||a&&t[jt]==="none"&&l+u>o)?"vertical":"horizontal"},ao=function(e,n,t){var o=t?e.left:e.top,r=t?e.right:e.bottom,a=t?e.width:e.height,i=t?n.left:n.top,s=t?n.right:n.bottom,l=t?n.width:n.height;return o===i||r===s||o+a/2===i+l/2},lo=function(e,n){var t;return ze.some(function(o){var r=o[L].options.emptyInsertThreshold;if(!(!r||wt(o))){var a=N(o),i=e>=a.left-r&&e<=a.right+r,s=n>=a.top-r&&n<=a.bottom+r;if(i&&s)return t=o}}),t},cn=function(e){function n(r,a){return function(i,s,l,u){var c=i.options.group.name&&s.options.group.name&&i.options.group.name===s.options.group.name;if(r==null&&(a||c))return!0;if(r==null||r===!1)return!1;if(a&&r==="clone")return r;if(typeof r=="function")return n(r(i,s,l,u),a)(i,s,l,u);var f=(a?i:s).options.group.name;return r===!0||typeof r=="string"&&r===f||r.join&&r.indexOf(f)>-1}}var t={},o=e.group;(!o||Ve(o)!="object")&&(o={name:o}),t.name=o.name,t.checkPull=n(o.pull,!0),t.checkPut=n(o.put),t.revertClone=o.revertClone,e.group=t},dn=function(){!sn&&v&&p(v,"display","none")},fn=function(){!sn&&v&&p(v,"display","")};Ze&&!en&&document.addEventListener("click",function(e){if(qe)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),qe=!1,!1},!0);var ge=function(e){if(d){e=e.touches?e.touches[0]:e;var n=lo(e.clientX,e.clientY);if(n){var t={};for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);t.target=t.rootEl=n,t.preventDefault=void 0,t.stopPropagation=void 0,n[L]._onDragOver(t)}}},so=function(e){d&&d.parentNode[L]._isOutsideThisEl(e.target)};function g(e,n){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=n=le({},n),e[L]=this;var t={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return un(e,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,i){a.setData("Text",i.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&&!Ie,emptyInsertThreshold:5};Re.initializePlugins(this,e,t);for(var o in t)!(o in n)&&(n[o]=t[o]);cn(n);for(var r in this)r.charAt(0)==="_"&&typeof this[r]=="function"&&(this[r]=this[r].bind(this));this.nativeDraggable=n.forceFallback?!1:io,this.nativeDraggable&&(this.options.touchStartThreshold=1),n.supportPointer?D(e,"pointerdown",this._onTapStart):(D(e,"mousedown",this._onTapStart),D(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(D(e,"dragover",this),D(e,"dragenter",this)),ze.push(this.el),n.store&&n.store.get&&this.sort(n.store.get(this)||[]),le(this,eo())}g.prototype={constructor:g,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(ye=null)},_getDirection:function(e,n){return typeof this.options.direction=="function"?this.options.direction.call(this,e,n,d):this.options.direction},_onTapStart:function(e){if(e.cancelable){var n=this,t=this.el,o=this.options,r=o.preventOnFilter,a=e.type,i=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,s=(i||e).target,l=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||s,u=o.filter;if(mo(t),!d&&!(/mousedown|pointerdown/.test(a)&&e.button!==0||o.disabled)&&!l.isContentEditable&&!(!this.nativeDraggable&&Ie&&s&&s.tagName.toUpperCase()==="SELECT")&&(s=Z(s,o.draggable,t,!1),!(s&&s.animated)&&je!==s)){if(De=z(s),Ae=z(s,o.draggable),typeof u=="function"){if(u.call(this,e,s,this)){V({sortable:n,rootEl:l,name:"filter",targetEl:s,toEl:t,fromEl:t}),H("filter",n,{evt:e}),r&&e.cancelable&&e.preventDefault();return}}else if(u&&(u=u.split(",").some(function(c){if(c=Z(l,c.trim(),t,!1),c)return V({sortable:n,rootEl:c,name:"filter",targetEl:s,fromEl:t,toEl:t}),H("filter",n,{evt:e}),!0}),u)){r&&e.cancelable&&e.preventDefault();return}o.handle&&!Z(l,o.handle,t,!1)||this._prepareDragStart(e,i,s)}}},_prepareDragStart:function(e,n,t){var o=this,r=o.el,a=o.options,i=r.ownerDocument,s;if(t&&!d&&t.parentNode===r){var l=N(t);if(_=r,d=t,x=d.parentNode,ve=d.nextSibling,je=t,Ye=a.group,g.dragged=d,pe={target:d,clientX:(n||e).clientX,clientY:(n||e).clientY},Ft=pe.clientX-l.left,Vt=pe.clientY-l.top,this._lastX=(n||e).clientX,this._lastY=(n||e).clientY,d.style["will-change"]="all",s=function(){if(H("delayEnded",o,{evt:e}),g.eventCanceled){o._onDrop();return}o._disableDelayedDragEvents(),!Rt&&o.nativeDraggable&&(d.draggable=!0),o._triggerDragStart(e,n),V({sortable:o,name:"choose",originalEvent:e}),W(d,a.chosenClass,!0)},a.ignore.split(",").forEach(function(u){nn(d,u.trim(),st)}),D(i,"dragover",ge),D(i,"mousemove",ge),D(i,"touchmove",ge),D(i,"mouseup",o._onDrop),D(i,"touchend",o._onDrop),D(i,"touchcancel",o._onDrop),Rt&&this.nativeDraggable&&(this.options.touchStartThreshold=4,d.draggable=!0),H("delayStart",this,{evt:e}),a.delay&&(!a.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(Pe||se))){if(g.eventCanceled){this._onDrop();return}D(i,"mouseup",o._disableDelayedDrag),D(i,"touchend",o._disableDelayedDrag),D(i,"touchcancel",o._disableDelayedDrag),D(i,"mousemove",o._delayedDragTouchMoveHandler),D(i,"touchmove",o._delayedDragTouchMoveHandler),a.supportPointer&&D(i,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(s,a.delay)}else s()}},_delayedDragTouchMoveHandler:function(e){var n=e.touches?e.touches[0]:e;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){d&&st(d),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;y(e,"mouseup",this._disableDelayedDrag),y(e,"touchend",this._disableDelayedDrag),y(e,"touchcancel",this._disableDelayedDrag),y(e,"mousemove",this._delayedDragTouchMoveHandler),y(e,"touchmove",this._delayedDragTouchMoveHandler),y(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,n){n=n||e.pointerType=="touch"&&e,!this.nativeDraggable||n?this.options.supportPointer?D(document,"pointermove",this._onTouchMove):n?D(document,"touchmove",this._onTouchMove):D(document,"mousemove",this._onTouchMove):(D(d,"dragend",this),D(_,"dragstart",this._onDragStart));try{document.selection?$e(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,n){if(we=!1,_&&d){H("dragStarted",this,{evt:n}),this.nativeDraggable&&D(document,"dragover",so);var t=this.options;!e&&W(d,t.dragClass,!1),W(d,t.ghostClass,!0),g.active=this,e&&this._appendGhost(),V({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(J){this._lastX=J.clientX,this._lastY=J.clientY,dn();for(var e=document.elementFromPoint(J.clientX,J.clientY),n=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(J.clientX,J.clientY),e!==n);)n=e;if(d.parentNode[L]._isOutsideThisEl(e),n)do{if(n[L]){var t=void 0;if(t=n[L]._onDragOver({clientX:J.clientX,clientY:J.clientY,target:e,rootEl:n}),t&&!this.options.dragoverBubble)break}e=n}while(n=n.parentNode);fn()}},_onTouchMove:function(e){if(pe){var n=this.options,t=n.fallbackTolerance,o=n.fallbackOffset,r=e.touches?e.touches[0]:e,a=v&&Ee(v,!0),i=v&&a&&a.a,s=v&&a&&a.d,l=Xe&&X&&Xt(X),u=(r.clientX-pe.clientX+o.x)/(i||1)+(l?l[0]-lt[0]:0)/(i||1),c=(r.clientY-pe.clientY+o.y)/(s||1)+(l?l[1]-lt[1]:0)/(s||1);if(!g.active&&!we){if(t&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))<t)return;this._onDragStart(e,!0)}if(v){a?(a.e+=u-(it||0),a.f+=c-(at||0)):a={a:1,b:0,c:0,d:1,e:u,f:c};var f="matrix(".concat(a.a,",").concat(a.b,",").concat(a.c,",").concat(a.d,",").concat(a.e,",").concat(a.f,")");p(v,"webkitTransform",f),p(v,"mozTransform",f),p(v,"msTransform",f),p(v,"transform",f),it=u,at=c,J=r}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!v){var e=this.options.fallbackOnBody?document.body:_,n=N(d,!0,Xe,!0,e),t=this.options;if(Xe){for(X=e;p(X,"position")==="static"&&p(X,"transform")==="none"&&X!==document;)X=X.parentNode;X!==document.body&&X!==document.documentElement?(X===document&&(X=ee()),n.top+=X.scrollTop,n.left+=X.scrollLeft):X=ee(),lt=Xt(X)}v=d.cloneNode(!0),W(v,t.ghostClass,!1),W(v,t.fallbackClass,!0),W(v,t.dragClass,!0),p(v,"transition",""),p(v,"transform",""),p(v,"box-sizing","border-box"),p(v,"margin",0),p(v,"top",n.top),p(v,"left",n.left),p(v,"width",n.width),p(v,"height",n.height),p(v,"opacity","0.8"),p(v,"position",Xe?"absolute":"fixed"),p(v,"zIndex","100000"),p(v,"pointerEvents","none"),g.ghost=v,e.appendChild(v),p(v,"transform-origin",Ft/parseInt(v.style.width)*100+"% "+Vt/parseInt(v.style.height)*100+"%")}},_onDragStart:function(e,n){var t=this,o=e.dataTransfer,r=t.options;if(H("dragStart",this,{evt:e}),g.eventCanceled){this._onDrop();return}H("setupClone",this),g.eventCanceled||(T=an(d),T.removeAttribute("id"),T.draggable=!1,T.style["will-change"]="",this._hideClone(),W(T,this.options.chosenClass,!1),g.clone=T),t.cloneId=$e(function(){H("clone",t),!g.eventCanceled&&(t.options.removeCloneOnHide||_.insertBefore(T,d),t._hideClone(),V({sortable:t,name:"clone"}))}),!n&&W(d,r.dragClass,!0),n?(qe=!0,t._loopId=setInterval(t._emulateDragOver,50)):(y(document,"mouseup",t._onDrop),y(document,"touchend",t._onDrop),y(document,"touchcancel",t._onDrop),o&&(o.effectAllowed="move",r.setData&&r.setData.call(t,o,d)),D(document,"drop",t),p(d,"transform","translateZ(0)")),we=!0,t._dragStartId=$e(t._dragStarted.bind(t,n,e)),D(document,"selectstart",t),Te=!0,Ie&&p(document.body,"user-select","none")},_onDragOver:function(e){var n=this.el,t=e.target,o,r,a,i=this.options,s=i.group,l=g.active,u=Ye===s,c=i.sort,f=B||l,S,h=this,C=!1;if(ft)return;function w(oe,Ke){H(oe,h,te({evt:e,isOwner:u,axis:S?"vertical":"horizontal",revert:a,dragRect:o,targetRect:r,canSort:c,fromSortable:f,target:t,completed:I,onMove:function(Et,mn){return Fe(_,n,d,o,Et,N(Et),e,mn)},changed:G},Ke))}function $(){w("dragOverAnimationCapture"),h.captureAnimationState(),h!==f&&f.captureAnimationState()}function I(oe){return w("dragOverCompleted",{insertion:oe}),oe&&(u?l._hideClone():l._showClone(h),h!==f&&(W(d,B?B.options.ghostClass:l.options.ghostClass,!1),W(d,i.ghostClass,!0)),B!==h&&h!==g.active?B=h:h===g.active&&B&&(B=null),f===h&&(h._ignoreWhileAnimating=t),h.animateAll(function(){w("dragOverAnimationComplete"),h._ignoreWhileAnimating=null}),h!==f&&(f.animateAll(),f._ignoreWhileAnimating=null)),(t===d&&!d.animated||t===n&&!t.animated)&&(ye=null),!i.dragoverBubble&&!e.rootEl&&t!==document&&(d.parentNode[L]._isOutsideThisEl(e.target),!oe&&ge(e)),!i.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),C=!0}function G(){U=z(d),ce=z(d,i.draggable),V({sortable:h,name:"change",toEl:n,newIndex:U,newDraggableIndex:ce,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),t=Z(t,i.draggable,n,!0),w("dragOver"),g.eventCanceled)return C;if(d.contains(e.target)||t.animated&&t.animatingX&&t.animatingY||h._ignoreWhileAnimating===t)return I(!1);if(qe=!1,l&&!i.disabled&&(u?c||(a=x!==_):B===this||(this.lastPutMode=Ye.checkPull(this,l,d,e))&&s.checkPut(this,l,d,e))){if(S=this._getDirection(e,t)==="vertical",o=N(d),w("dragOverValid"),g.eventCanceled)return C;if(a)return x=_,$(),this._hideClone(),w("revert"),g.eventCanceled||(ve?_.insertBefore(d,ve):_.appendChild(d)),I(!0);var k=wt(n,i.draggable);if(!k||ho(e,S,this)&&!k.animated){if(k===d)return I(!1);if(k&&n===e.target&&(t=k),t&&(r=N(t)),Fe(_,n,d,o,t,r,e,!!t)!==!1)return $(),k&&k.nextSibling?n.insertBefore(d,k.nextSibling):n.appendChild(d),x=n,G(),I(!0)}else if(k&&fo(e,S,this)){var K=Ce(n,0,i,!0);if(K===d)return I(!1);if(t=K,r=N(t),Fe(_,n,d,o,t,r,e,!1)!==!1)return $(),n.insertBefore(d,K),x=n,G(),I(!0)}else if(t.parentNode===n){r=N(t);var R=0,ne,he=d.parentNode!==n,m=!ao(d.animated&&d.toRect||o,t.animated&&t.toRect||r,S),b=S?"top":"left",M=Bt(t,"top","top")||Bt(d,"top","top"),j=M?M.scrollTop:void 0;ye!==t&&(ne=r[b],ke=!1,Be=!m&&i.invertSwap||he),R=po(e,t,r,S,m?1:i.swapThreshold,i.invertedSwapThreshold==null?i.swapThreshold:i.invertedSwapThreshold,Be,ye===t);var E;if(R!==0){var O=z(d);do O-=R,E=x.children[O];while(E&&(p(E,"display")==="none"||E===v))}if(R===0||E===t)return I(!1);ye=t,Ne=R;var Y=t.nextElementSibling,P=!1;P=R===1;var q=Fe(_,n,d,o,t,r,e,P);if(q!==!1)return(q===1||q===-1)&&(P=q===1),ft=!0,setTimeout(co,30),$(),P&&!Y?n.appendChild(d):t.parentNode.insertBefore(d,P?Y:t),M&&rn(M,0,j-M.scrollTop),x=d.parentNode,ne!==void 0&&!Be&&(He=Math.abs(ne-N(t)[b])),G(),I(!0)}if(n.contains(d))return I(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){y(document,"mousemove",this._onTouchMove),y(document,"touchmove",this._onTouchMove),y(document,"pointermove",this._onTouchMove),y(document,"dragover",ge),y(document,"mousemove",ge),y(document,"touchmove",ge)},_offUpEvents:function(){var e=this.el.ownerDocument;y(e,"mouseup",this._onDrop),y(e,"touchend",this._onDrop),y(e,"pointerup",this._onDrop),y(e,"touchcancel",this._onDrop),y(document,"selectstart",this)},_onDrop:function(e){var n=this.el,t=this.options;if(U=z(d),ce=z(d,t.draggable),H("drop",this,{evt:e}),x=d&&d.parentNode,U=z(d),ce=z(d,t.draggable),g.eventCanceled){this._nulling();return}we=!1,Be=!1,ke=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),ht(this.cloneId),ht(this._dragStartId),this.nativeDraggable&&(y(document,"drop",this),y(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Ie&&p(document.body,"user-select",""),p(d,"transform",""),e&&(Te&&(e.cancelable&&e.preventDefault(),!t.dropBubble&&e.stopPropagation()),v&&v.parentNode&&v.parentNode.removeChild(v),(_===x||B&&B.lastPutMode!=="clone")&&T&&T.parentNode&&T.parentNode.removeChild(T),d&&(this.nativeDraggable&&y(d,"dragend",this),st(d),d.style["will-change"]="",Te&&!we&&W(d,B?B.options.ghostClass:this.options.ghostClass,!1),W(d,this.options.chosenClass,!1),V({sortable:this,name:"unchoose",toEl:x,newIndex:null,newDraggableIndex:null,originalEvent:e}),_!==x?(U>=0&&(V({rootEl:x,name:"add",toEl:x,fromEl:_,originalEvent:e}),V({sortable:this,name:"remove",toEl:x,originalEvent:e}),V({rootEl:x,name:"sort",toEl:x,fromEl:_,originalEvent:e}),V({sortable:this,name:"sort",toEl:x,originalEvent:e})),B&&B.save()):U!==De&&U>=0&&(V({sortable:this,name:"update",toEl:x,originalEvent:e}),V({sortable:this,name:"sort",toEl:x,originalEvent:e})),g.active&&((U==null||U===-1)&&(U=De,ce=Ae),V({sortable:this,name:"end",toEl:x,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){H("nulling",this),_=d=x=v=ve=T=je=de=pe=J=Te=U=ce=De=Ae=ye=Ne=B=Ye=g.dragged=g.ghost=g.clone=g.active=null,Ge.forEach(function(e){e.checked=!0}),Ge.length=it=at=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":d&&(this._onDragOver(e),uo(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],n,t=this.el.children,o=0,r=t.length,a=this.options;o<r;o++)n=t[o],Z(n,a.draggable,this.el,!1)&&e.push(n.getAttribute(a.dataIdAttr)||vo(n));return e},sort:function(e,n){var t={},o=this.el;this.toArray().forEach(function(r,a){var i=o.children[a];Z(i,this.options.draggable,o,!1)&&(t[r]=i)},this),n&&this.captureAnimationState(),e.forEach(function(r){t[r]&&(o.removeChild(t[r]),o.appendChild(t[r]))}),n&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,n){return Z(e,n||this.options.draggable,this.el,!1)},option:function(e,n){var t=this.options;if(n===void 0)return t[e];var o=Re.modifyOption(this,e,n);typeof o<"u"?t[e]=o:t[e]=n,e==="group"&&cn(t)},destroy:function(){H("destroy",this);var e=this.el;e[L]=null,y(e,"mousedown",this._onTapStart),y(e,"touchstart",this._onTapStart),y(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(y(e,"dragover",this),y(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),ze.splice(ze.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!de){if(H("hideClone",this),g.eventCanceled)return;p(T,"display","none"),this.options.removeCloneOnHide&&T.parentNode&&T.parentNode.removeChild(T),de=!0}},_showClone:function(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(de){if(H("showClone",this),g.eventCanceled)return;d.parentNode==_&&!this.options.group.revertClone?_.insertBefore(T,d):ve?_.insertBefore(T,ve):_.appendChild(T),this.options.group.revertClone&&this.animate(d,T),p(T,"display",""),de=!1}}};function uo(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function Fe(e,n,t,o,r,a,i,s){var l,u=e[L],c=u.options.onMove,f;return window.CustomEvent&&!se&&!Pe?l=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(l=document.createEvent("Event"),l.initEvent("move",!0,!0)),l.to=n,l.from=e,l.dragged=t,l.draggedRect=o,l.related=r||n,l.relatedRect=a||N(n),l.willInsertAfter=s,l.originalEvent=i,e.dispatchEvent(l),c&&(f=c.call(u,l,i)),f}function st(e){e.draggable=!1}function co(){ft=!1}function fo(e,n,t){var o=N(Ce(t.el,0,t.options,!0)),r=ln(t.el,t.options,v),a=10;return n?e.clientX<r.left-a||e.clientY<o.top&&e.clientX<o.right:e.clientY<r.top-a||e.clientY<o.bottom&&e.clientX<o.left}function ho(e,n,t){var o=N(wt(t.el,t.options.draggable)),r=ln(t.el,t.options,v),a=10;return n?e.clientX>r.right+a||e.clientY>o.bottom&&e.clientX>o.left:e.clientY>r.bottom+a||e.clientX>o.right&&e.clientY>o.top}function po(e,n,t,o,r,a,i,s){var l=o?e.clientY:e.clientX,u=o?t.height:t.width,c=o?t.top:t.left,f=o?t.bottom:t.right,S=!1;if(!i){if(s&&He<u*r){if(!ke&&(Ne===1?l>c+u*a/2:l<f-u*a/2)&&(ke=!0),ke)S=!0;else if(Ne===1?l<c+He:l>f-He)return-Ne}else if(l>c+u*(1-r)/2&&l<f-u*(1-r)/2)return go(n)}return S=S||i,S&&(l<c+u*a/2||l>f-u*a/2)?l>c+u/2?1:-1:0}function go(e){return z(d)<z(e)?1:-1}function vo(e){for(var n=e.tagName+e.className+e.src+e.href+e.textContent,t=n.length,o=0;t--;)o+=n.charCodeAt(t);return o.toString(36)}function mo(e){Ge.length=0;for(var n=e.getElementsByTagName("input"),t=n.length;t--;){var o=n[t];o.checked&&Ge.push(o)}}function $e(e){return setTimeout(e,0)}function ht(e){return clearTimeout(e)}Ze&&D(document,"touchmove",function(e){(g.active||we)&&e.cancelable&&e.preventDefault()});g.utils={on:D,off:y,css:p,find:nn,is:function(e,n){return!!Z(e,n,e,!1)},extend:Kn,throttle:on,closest:Z,toggleClass:W,clone:an,index:z,nextTick:$e,cancelNextTick:ht,detectDirection:un,getChild:Ce};g.get=function(e){return e[L]};g.mount=function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];n[0].constructor===Array&&(n=n[0]),n.forEach(function(o){if(!o.prototype||!o.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(o));o.utils&&(g.utils=te(te({},g.utils),o.utils)),Re.mount(o)})};g.create=function(e,n){return new g(e,n)};g.version=Gn;var A=[],xe,pt,gt=!1,ut,ct,Je,Oe;function bo(){function e(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var n in this)n.charAt(0)==="_"&&typeof this[n]=="function"&&(this[n]=this[n].bind(this))}return e.prototype={dragStarted:function(n){var t=n.originalEvent;this.sortable.nativeDraggable?D(document,"dragover",this._handleAutoScroll):this.options.supportPointer?D(document,"pointermove",this._handleFallbackAutoScroll):t.touches?D(document,"touchmove",this._handleFallbackAutoScroll):D(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var t=n.originalEvent;!this.options.dragOverBubble&&!t.rootEl&&this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?y(document,"dragover",this._handleAutoScroll):(y(document,"pointermove",this._handleFallbackAutoScroll),y(document,"touchmove",this._handleFallbackAutoScroll),y(document,"mousemove",this._handleFallbackAutoScroll)),Ht(),We(),Qn()},nulling:function(){Je=pt=xe=gt=Oe=ut=ct=null,A.length=0},_handleFallbackAutoScroll:function(n){this._handleAutoScroll(n,!0)},_handleAutoScroll:function(n,t){var o=this,r=(n.touches?n.touches[0]:n).clientX,a=(n.touches?n.touches[0]:n).clientY,i=document.elementFromPoint(r,a);if(Je=n,t||this.options.forceAutoScrollFallback||Pe||se||Ie){dt(n,this.options,i,t);var s=fe(i,!0);gt&&(!Oe||r!==ut||a!==ct)&&(Oe&&Ht(),Oe=setInterval(function(){var l=fe(document.elementFromPoint(r,a),!0);l!==s&&(s=l,We()),dt(n,o.options,l,t)},10),ut=r,ct=a)}else{if(!this.options.bubbleScroll||fe(i,!0)===ee()){We();return}dt(n,this.options,fe(i,!1),!1)}}},le(e,{pluginName:"scroll",initializeByDefault:!0})}function We(){A.forEach(function(e){clearInterval(e.pid)}),A=[]}function Ht(){clearInterval(Oe)}var dt=on(function(e,n,t,o){if(n.scroll){var r=(e.touches?e.touches[0]:e).clientX,a=(e.touches?e.touches[0]:e).clientY,i=n.scrollSensitivity,s=n.scrollSpeed,l=ee(),u=!1,c;pt!==t&&(pt=t,We(),xe=n.scroll,c=n.scrollFn,xe===!0&&(xe=fe(t,!0)));var f=0,S=xe;do{var h=S,C=N(h),w=C.top,$=C.bottom,I=C.left,G=C.right,k=C.width,K=C.height,R=void 0,ne=void 0,he=h.scrollWidth,m=h.scrollHeight,b=p(h),M=h.scrollLeft,j=h.scrollTop;h===l?(R=k<he&&(b.overflowX==="auto"||b.overflowX==="scroll"||b.overflowX==="visible"),ne=K<m&&(b.overflowY==="auto"||b.overflowY==="scroll"||b.overflowY==="visible")):(R=k<he&&(b.overflowX==="auto"||b.overflowX==="scroll"),ne=K<m&&(b.overflowY==="auto"||b.overflowY==="scroll"));var E=R&&(Math.abs(G-r)<=i&&M+k<he)-(Math.abs(I-r)<=i&&!!M),O=ne&&(Math.abs($-a)<=i&&j+K<m)-(Math.abs(w-a)<=i&&!!j);if(!A[f])for(var Y=0;Y<=f;Y++)A[Y]||(A[Y]={});(A[f].vx!=E||A[f].vy!=O||A[f].el!==h)&&(A[f].el=h,A[f].vx=E,A[f].vy=O,clearInterval(A[f].pid),(E!=0||O!=0)&&(u=!0,A[f].pid=setInterval((function(){o&&this.layer===0&&g.active._onTouchMove(Je);var P=A[this.layer].vy?A[this.layer].vy*s:0,q=A[this.layer].vx?A[this.layer].vx*s:0;typeof c=="function"&&c.call(g.dragged.parentNode[L],q,P,e,Je,A[this.layer].el)!=="continue"||rn(A[this.layer].el,q,P)}).bind({layer:f}),24))),f++}while(n.bubbleScroll&&S!==l&&(S=fe(S,!1)));gt=u}},30),hn=function(e){var n=e.originalEvent,t=e.putSortable,o=e.dragEl,r=e.activeSortable,a=e.dispatchSortableEvent,i=e.hideGhostForTarget,s=e.unhideGhostForTarget;if(n){var l=t||r;i();var u=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n,c=document.elementFromPoint(u.clientX,u.clientY);s(),l&&!l.el.contains(c)&&(a("spill"),this.onSpill({dragEl:o,putSortable:t}))}};function St(){}St.prototype={startIndex:null,dragStart:function(e){var n=e.oldDraggableIndex;this.startIndex=n},onSpill:function(e){var n=e.dragEl,t=e.putSortable;this.sortable.captureAnimationState(),t&&t.captureAnimationState();var o=Ce(this.sortable.el,this.startIndex,this.options);o?this.sortable.el.insertBefore(n,o):this.sortable.el.appendChild(n),this.sortable.animateAll(),t&&t.animateAll()},drop:hn};le(St,{pluginName:"revertOnSpill"});function Dt(){}Dt.prototype={onSpill:function(e){var n=e.dragEl,t=e.putSortable,o=t||this.sortable;o.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),o.animateAll()},drop:hn};le(Dt,{pluginName:"removeOnSpill"});g.mount(new bo);g.mount(Dt,St);function yo(e){return e==null?e:JSON.parse(JSON.stringify(e))}function wo(e){mt()&&Dn(e)}function So(e){mt()?Sn(e):zt(e)}let pn=null,gn=null;function $t(e=null,n=null){pn=e,gn=n}function Do(){return{data:pn,clonedData:gn}}const Wt=Symbol("cloneElement");function Eo(...e){var n,t;const o=(n=mt())==null?void 0:n.proxy;let r=null;const a=e[0];let[,i,s]=e;Array.isArray(F(i))||(s=i,i=null);let l=null;const{immediate:u=!0,clone:c=yo,customUpdate:f}=(t=F(s))!=null?t:{};function S(m){var b;const{from:M,oldIndex:j,item:E}=m;r=Array.from(M.childNodes);const O=F((b=F(i))==null?void 0:b[j]),Y=c(O);$t(O,Y),E[Wt]=Y}function h(m){const b=m.item[Wt];if(!Xn(b)){if(nt(m.item),Qe(i)){const M=[...F(i)];i.value=At(M,m.newDraggableIndex,b);return}At(F(i),m.newDraggableIndex,b)}}function C(m){const{from:b,item:M,oldIndex:j,oldDraggableIndex:E,pullMode:O,clone:Y}=m;if(Nt(b,M,j),O==="clone"){nt(Y);return}if(Qe(i)){const P=[...F(i)];i.value=Mt(P,E);return}Mt(F(i),E)}function w(m){if(f){f(m);return}const{from:b,item:M,oldIndex:j,oldDraggableIndex:E,newDraggableIndex:O}=m;if(nt(M),Nt(b,M,j),Qe(i)){const Y=[...F(i)];i.value=It(Y,E,O);return}It(F(i),E,O)}function $(m){const{newIndex:b,oldIndex:M,from:j,to:E}=m;let O=null;const Y=b===M&&j===E;try{if(Y){let P=null;r?.some((q,oe)=>{if(P&&r?.length!==E.childNodes.length)return j.insertBefore(P,q.nextSibling),!0;const Ke=E.childNodes[oe];P=E?.replaceChild(q,Ke)})}}catch(P){O=P}finally{r=null}zt(()=>{if($t(),O)throw O})}const I={onUpdate:w,onStart:S,onAdd:h,onRemove:C,onEnd:$};function G(m){const b=F(a);return m||(m=Fn(b)?Vn(b,o?.$el):b),m&&!$n(m)&&(m=m.$el),m||Rn("Root element not found"),m}function k(){var m;const b=(m=F(s))!=null?m:{},{immediate:M,clone:j}=b,E=Zt(b,["immediate","clone"]);return kt(E,(O,Y)=>{Wn(O)&&(E[O]=(P,...q)=>{const oe=Do();return Un(P,oe),Y(P,...q)})}),Hn(i===null?{}:I,E)}const K=m=>{m=G(m),l&&R.destroy(),l=new g(m,k())};qt(()=>s,()=>{l&&kt(k(),(m,b)=>{l?.option(m,b)})},{deep:!0});const R={option:(m,b)=>l?.option(m,b),destroy:()=>{l?.destroy(),l=null},save:()=>l?.save(),toArray:()=>l?.toArray(),closest:(...m)=>l?.closest(...m)},ne=()=>R?.option("disabled",!0),he=()=>R?.option("disabled",!1);return So(()=>{u&&K()}),wo(R.destroy),Se({start:K,pause:ne,resume:he},R)}const vt=["update","start","add","remove","choose","unchoose","end","sort","filter","clone","move","change"],Co=["clone","animation","ghostClass","group","sort","disabled","store","handle","draggable","swapThreshold","invertSwap","invertedSwapThreshold","removeCloneOnHide","direction","chosenClass","dragClass","ignore","filter","preventOnFilter","easing","setData","dropBubble","dragoverBubble","dataIdAttr","delay","delayOnTouchOnly","touchStartThreshold","forceFallback","fallbackClass","fallbackOnBody","fallbackTolerance","fallbackOffset","supportPointer","emptyInsertThreshold","scroll","forceAutoScrollFallback","scrollSensitivity","scrollSpeed","bubbleScroll","modelValue","tag","target","customUpdate",...vt.map(e=>`on${e.replace(/^\S/,n=>n.toUpperCase())}`)],Oo=Ut({name:"VueDraggable",model:{prop:"modelValue",event:"update:modelValue"},props:Co,emits:["update:modelValue",...vt],setup(e,{slots:n,emit:t,expose:o,attrs:r}){const a=vt.reduce((c,f)=>{const S=`on${f.replace(/^\S/,h=>h.toUpperCase())}`;return c[S]=(...h)=>t(f,...h),c},{}),i=Ct(()=>{const c=bn(e),{modelValue:f}=c,S=Zt(c,["modelValue"]),h=Object.entries(S).reduce((C,[w,$])=>{const I=F($);return I!==void 0&&(C[w]=I),C},{});return Se(Se({},a),Bn(Se(Se({},r),h)))}),s=Ct({get:()=>e.modelValue,set:c=>t("update:modelValue",c)}),l=Lt(),u=yn(Eo(e.target||l,s,i));return o(u),()=>{var c;return wn(e.tag||"div",{ref:l},(c=n?.default)==null?void 0:c.call(n,u))}}}),_o={key:0},Io=Ut({__name:"StepIngredientSorterDialog",props:En({stepIndex:{type:Number,required:!0},ingredientIndex:{type:Number,required:!0}},{modelValue:{required:!0,default:!1},modelModifiers:{},step:{required:!0},stepModifiers:{},recipe:{required:!0},recipeModifiers:{}}),emits:["update:modelValue","update:step","update:recipe"],setup(e){const n=et(e,"modelValue"),t=et(e,"step"),o=et(e,"recipe"),r=e,{mobile:a}=Cn();qt(()=>r.ingredientIndex,()=>{console.log("updated ingredient inex"),i.value=r.ingredientIndex});const i=Lt(0);function s(l,u,c){let f=t.value.ingredients[l];t.value.ingredients.splice(l,1),o.value.steps[u].ingredients.splice(c,0,f),u!=r.stepIndex?n.value=!1:i.value=c}return(l,u)=>(_e(),_t(_n,{modelValue:n.value,"onUpdate:modelValue":u[6]||(u[6]=c=>n.value=c),"max-width":F(a)?"100vw":"25vw",fullscreen:F(a)},{default:Q(()=>[re(Mn,null,{default:Q(()=>[re(Tn,{title:l.$t("Move"),modelValue:n.value,"onUpdate:modelValue":u[0]||(u[0]=c=>n.value=c),"sub-title":F(Nn)(t.value.ingredients[i.value])},null,8,["title","modelValue","sub-title"]),re(xn,null,{default:Q(()=>[t.value.ingredients.length>1?(_e(),tt(xt,{key:0},[ue(ie(l.$t("Order"))+" ",1),re(me,{block:"",disabled:i.value==0,onClick:u[1]||(u[1]=c=>s(i.value,r.stepIndex,0))},{default:Q(()=>[ue(ie(l.$t("First")),1)]),_:1},8,["disabled"]),re(me,{block:"",disabled:i.value==0,class:"mt-1",onClick:u[2]||(u[2]=c=>s(i.value,r.stepIndex,i.value-1))},{default:Q(()=>[ue(ie(l.$t("Up")),1)]),_:1},8,["disabled"]),re(me,{block:"",disabled:i.value+1==t.value.ingredients.length,class:"mt-1",onClick:u[3]||(u[3]=c=>s(i.value,r.stepIndex,i.value+1))},{default:Q(()=>[ue(ie(l.$t("Down")),1)]),_:1},8,["disabled"]),re(me,{block:"",disabled:i.value+1==t.value.ingredients.length,class:"mt-1",onClick:u[4]||(u[4]=c=>s(i.value,r.stepIndex,t.value.ingredients.length-1))},{default:Q(()=>[ue(ie(l.$t("Last")),1)]),_:1},8,["disabled"])],64)):Tt("",!0),ue(" "+ie(l.$t("MoveToStep"))+" ",1),(_e(!0),tt(xt,null,On(o.value.steps,(c,f)=>(_e(),_t(me,{block:"",disabled:f==r.stepIndex,class:"mt-1",onClick:S=>s(i.value,f,o.value.steps[f].ingredients.length)},{default:Q(()=>[ue(ie(f+1)+" ",1),"name"in c?(_e(),tt("span",_o,ie(c.name),1)):Tt("",!0)]),_:2},1032,["disabled","onClick"]))),256))]),_:1}),re(In,null,{default:Q(()=>[re(me,{onClick:u[5]||(u[5]=c=>n.value=!1)},{default:Q(()=>[ue(ie(l.$t("Close")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue","max-width","fullscreen"]))}});function vn(e,n){let t=[];return e.instruction&&(e.instruction.split(n).forEach(o=>{o.trim()!==""&&t.push({instruction:o,ingredients:[],time:0,showIngredientsTable:An().userSettings.showStepIngredients})}),t[0].ingredients=e.ingredients),t}function Mo(e,n){let t=[];e?(e.forEach(o=>{t=t.concat(vn(o,n))}),e.splice(0,e.length,...t)):bt().addMessage(yt.ERROR,"no steps found to split")}function Ao(e,n,t){if(e){let o=e.findIndex(a=>a===n),r=vn(n,t);e.splice(o,1,...r)}else bt().addMessage(yt.ERROR,"no steps found to split")}function No(e,n){return n.instruction&&(e.instruction=e.instruction+`
|
|
`+n.instruction),e.ingredients=e.ingredients.concat(n.ingredients),e}function ko(e){return e.length>1?(e[0].instruction=e.map(n=>n.instruction).join(`
|
|
`),e[0].ingredients=e.flatMap(n=>n.ingredients),e=[e[0]]):bt().addMessage(yt.ERROR,"no steps found to split"),e}export{Io as _,Ao as a,No as b,Oo as l,ko as m,Mo as s};
|