jplan-pack 0.6.661 → 0.6.662

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,7 +17,7 @@ This will fail in production.`);l=Yi,l._s.has(n)||(wm(n,i,l),process.env.NODE_EN
17
17
  * @author RubaXa <trash@rubaxa.org>
18
18
  * @author owenm <owen23355@gmail.com>
19
19
  * @license MIT
20
- */function Dm(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function nr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Dm(Object(t),!0).forEach(function(n){gP(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Dm(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Ks(r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ks=function(e){return typeof e}:Ks=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ks(r)}function gP(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Tr(){return Tr=Object.assign||function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},Tr.apply(this,arguments)}function mP(r,e){if(r==null)return{};var t={},n=Object.keys(r),i,s;for(s=0;s<n.length;s++)i=n[s],!(e.indexOf(i)>=0)&&(t[i]=r[i]);return t}function pP(r,e){if(r==null)return{};var t=mP(r,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(r);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}var vP="1.14.0";function wr(r){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(r)}var Sr=wr(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),wa=wr(/Edge/i),Lm=wr(/firefox/i),na=wr(/safari/i)&&!wr(/chrome/i)&&!wr(/android/i),qv=wr(/iP(ad|od|hone)/i),yP=wr(/chrome/i)&&wr(/android/i),Wv={capture:!1,passive:!1};function Se(r,e,t){r.addEventListener(e,t,!Sr&&Wv)}function Ce(r,e,t){r.removeEventListener(e,t,!Sr&&Wv)}function tc(r,e){if(e){if(e[0]===">"&&(e=e.substring(1)),r)try{if(r.matches)return r.matches(e);if(r.msMatchesSelector)return r.msMatchesSelector(e);if(r.webkitMatchesSelector)return r.webkitMatchesSelector(e)}catch{return!1}return!1}}function CP(r){return r.host&&r!==document&&r.host.nodeType?r.host:r.parentNode}function jn(r,e,t,n){if(r){t=t||document;do{if(e!=null&&(e[0]===">"?r.parentNode===t&&tc(r,e):tc(r,e))||n&&r===t)return r;if(r===t)break}while(r=CP(r))}return null}var Bm=/\s+/g;function jt(r,e,t){if(r&&e)if(r.classList)r.classList[t?"add":"remove"](e);else{var n=(" "+r.className+" ").replace(Bm," ").replace(" "+e+" "," ");r.className=(n+(t?" "+e:"")).replace(Bm," ")}}function re(r,e,t){var n=r&&r.style;if(n){if(t===void 0)return document.defaultView&&document.defaultView.getComputedStyle?t=document.defaultView.getComputedStyle(r,""):r.currentStyle&&(t=r.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 ci(r,e){var t="";if(typeof r=="string")t=r;else do{var n=re(r,"transform");n&&n!=="none"&&(t=n+" "+t)}while(!e&&(r=r.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(t)}function Gv(r,e,t){if(r){var n=r.getElementsByTagName(e),i=0,s=n.length;if(t)for(;i<s;i++)t(n[i],i);return n}return[]}function er(){var r=document.scrollingElement;return r||document.documentElement}function ot(r,e,t,n,i){if(!(!r.getBoundingClientRect&&r!==window)){var s,l,d,f,g,m,C;if(r!==window&&r.parentNode&&r!==er()?(s=r.getBoundingClientRect(),l=s.top,d=s.left,f=s.bottom,g=s.right,m=s.height,C=s.width):(l=0,d=0,f=window.innerHeight,g=window.innerWidth,m=window.innerHeight,C=window.innerWidth),(e||t)&&r!==window&&(i=i||r.parentNode,!Sr))do if(i&&i.getBoundingClientRect&&(re(i,"transform")!=="none"||t&&re(i,"position")!=="static")){var v=i.getBoundingClientRect();l-=v.top+parseInt(re(i,"border-top-width")),d-=v.left+parseInt(re(i,"border-left-width")),f=l+s.height,g=d+s.width;break}while(i=i.parentNode);if(n&&r!==window){var E=ci(i||r),_=E&&E.a,A=E&&E.d;E&&(l/=A,d/=_,C/=_,m/=A,f=l+m,g=d+C)}return{top:l,left:d,bottom:f,right:g,width:C,height:m}}}function Um(r,e,t){for(var n=Kr(r,!0),i=ot(r)[e];n;){var s=ot(n)[t],l=void 0;if(l=i>=s,!l)return n;if(n===er())break;n=Kr(n,!1)}return!1}function hi(r,e,t,n){for(var i=0,s=0,l=r.children;s<l.length;){if(l[s].style.display!=="none"&&l[s]!==oe.ghost&&(n||l[s]!==oe.dragged)&&jn(l[s],t.draggable,r,!1)){if(i===e)return l[s];i++}s++}return null}function Vd(r,e){for(var t=r.lastElementChild;t&&(t===oe.ghost||re(t,"display")==="none"||e&&!tc(t,e));)t=t.previousElementSibling;return t||null}function Tn(r,e){var t=0;if(!r||!r.parentNode)return-1;for(;r=r.previousElementSibling;)r.nodeName.toUpperCase()!=="TEMPLATE"&&r!==oe.clone&&(!e||tc(r,e))&&t++;return t}function Vm(r){var e=0,t=0,n=er();if(r)do{var i=ci(r),s=i.a,l=i.d;e+=r.scrollLeft*s,t+=r.scrollTop*l}while(r!==n&&(r=r.parentNode));return[e,t]}function wP(r,e){for(var t in r)if(r.hasOwnProperty(t)){for(var n in e)if(e.hasOwnProperty(n)&&e[n]===r[t][n])return Number(t)}return-1}function Kr(r,e){if(!r||!r.getBoundingClientRect)return er();var t=r,n=!1;do if(t.clientWidth<t.scrollWidth||t.clientHeight<t.scrollHeight){var i=re(t);if(t.clientWidth<t.scrollWidth&&(i.overflowX=="auto"||i.overflowX=="scroll")||t.clientHeight<t.scrollHeight&&(i.overflowY=="auto"||i.overflowY=="scroll")){if(!t.getBoundingClientRect||t===document.body)return er();if(n||e)return t;n=!0}}while(t=t.parentNode);return er()}function _P(r,e){if(r&&e)for(var t in e)e.hasOwnProperty(t)&&(r[t]=e[t]);return r}function Tu(r,e){return Math.round(r.top)===Math.round(e.top)&&Math.round(r.left)===Math.round(e.left)&&Math.round(r.height)===Math.round(e.height)&&Math.round(r.width)===Math.round(e.width)}var ra;function jv(r,e){return function(){if(!ra){var t=arguments,n=this;t.length===1?r.call(n,t[0]):r.apply(n,t),ra=setTimeout(function(){ra=void 0},e)}}}function TP(){clearTimeout(ra),ra=void 0}function Yv(r,e,t){r.scrollLeft+=e,r.scrollTop+=t}function Jv(r){var e=window.Polymer,t=window.jQuery||window.Zepto;return e&&e.dom?e.dom(r).cloneNode(!0):t?t(r).clone(!0)[0]:r.cloneNode(!0)}var tn="Sortable"+new Date().getTime();function EP(){var r=[],e;return{captureAnimationState:function(){if(r=[],!!this.options.animation){var n=[].slice.call(this.el.children);n.forEach(function(i){if(!(re(i,"display")==="none"||i===oe.ghost)){r.push({target:i,rect:ot(i)});var s=nr({},r[r.length-1].rect);if(i.thisAnimationDuration){var l=ci(i,!0);l&&(s.top-=l.f,s.left-=l.e)}i.fromRect=s}})}},addAnimationState:function(n){r.push(n)},removeAnimationState:function(n){r.splice(wP(r,{target:n}),1)},animateAll:function(n){var i=this;if(!this.options.animation){clearTimeout(e),typeof n=="function"&&n();return}var s=!1,l=0;r.forEach(function(d){var f=0,g=d.target,m=g.fromRect,C=ot(g),v=g.prevFromRect,E=g.prevToRect,_=d.rect,A=ci(g,!0);A&&(C.top-=A.f,C.left-=A.e),g.toRect=C,g.thisAnimationDuration&&Tu(v,C)&&!Tu(m,C)&&(_.top-C.top)/(_.left-C.left)===(m.top-C.top)/(m.left-C.left)&&(f=AP(_,v,E,i.options)),Tu(C,m)||(g.prevFromRect=m,g.prevToRect=C,f||(f=i.options.animation),i.animate(g,_,C,f)),f&&(s=!0,l=Math.max(l,f),clearTimeout(g.animationResetTimer),g.animationResetTimer=setTimeout(function(){g.animationTime=0,g.prevFromRect=null,g.fromRect=null,g.prevToRect=null,g.thisAnimationDuration=null},f),g.thisAnimationDuration=f)}),clearTimeout(e),s?e=setTimeout(function(){typeof n=="function"&&n()},l):typeof n=="function"&&n(),r=[]},animate:function(n,i,s,l){if(l){re(n,"transition",""),re(n,"transform","");var d=ci(this.el),f=d&&d.a,g=d&&d.d,m=(i.left-s.left)/(f||1),C=(i.top-s.top)/(g||1);n.animatingX=!!m,n.animatingY=!!C,re(n,"transform","translate3d("+m+"px,"+C+"px,0)"),this.forRepaintDummy=SP(n),re(n,"transition","transform "+l+"ms"+(this.options.easing?" "+this.options.easing:"")),re(n,"transform","translate3d(0,0,0)"),typeof n.animated=="number"&&clearTimeout(n.animated),n.animated=setTimeout(function(){re(n,"transition",""),re(n,"transform",""),n.animated=!1,n.animatingX=!1,n.animatingY=!1},l)}}}}function SP(r){return r.offsetWidth}function AP(r,e,t,n){return Math.sqrt(Math.pow(e.top-r.top,2)+Math.pow(e.left-r.left,2))/Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))*n.animation}var $o=[],Eu={initializeByDefault:!0},_a={mount:function(e){for(var t in Eu)Eu.hasOwnProperty(t)&&!(t in e)&&(e[t]=Eu[t]);$o.forEach(function(n){if(n.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),$o.push(e)},pluginEvent:function(e,t,n){var i=this;this.eventCanceled=!1,n.cancel=function(){i.eventCanceled=!0};var s=e+"Global";$o.forEach(function(l){t[l.pluginName]&&(t[l.pluginName][s]&&t[l.pluginName][s](nr({sortable:t},n)),t.options[l.pluginName]&&t[l.pluginName][e]&&t[l.pluginName][e](nr({sortable:t},n)))})},initializePlugins:function(e,t,n,i){$o.forEach(function(d){var f=d.pluginName;if(!(!e.options[f]&&!d.initializeByDefault)){var g=new d(e,t,e.options);g.sortable=e,g.options=e.options,e[f]=g,Tr(n,g.defaults)}});for(var s in e.options)if(e.options.hasOwnProperty(s)){var l=this.modifyOption(e,s,e.options[s]);typeof l<"u"&&(e.options[s]=l)}},getEventProperties:function(e,t){var n={};return $o.forEach(function(i){typeof i.eventProperties=="function"&&Tr(n,i.eventProperties.call(t[i.pluginName],e))}),n},modifyOption:function(e,t,n){var i;return $o.forEach(function(s){e[s.pluginName]&&s.optionListeners&&typeof s.optionListeners[t]=="function"&&(i=s.optionListeners[t].call(e[s.pluginName],n))}),i}};function bP(r){var e=r.sortable,t=r.rootEl,n=r.name,i=r.targetEl,s=r.cloneEl,l=r.toEl,d=r.fromEl,f=r.oldIndex,g=r.newIndex,m=r.oldDraggableIndex,C=r.newDraggableIndex,v=r.originalEvent,E=r.putSortable,_=r.extraEventProperties;if(e=e||t&&t[tn],!!e){var A,N=e.options,K="on"+n.charAt(0).toUpperCase()+n.substr(1);window.CustomEvent&&!Sr&&!wa?A=new CustomEvent(n,{bubbles:!0,cancelable:!0}):(A=document.createEvent("Event"),A.initEvent(n,!0,!0)),A.to=l||t,A.from=d||t,A.item=i||t,A.clone=s,A.oldIndex=f,A.newIndex=g,A.oldDraggableIndex=m,A.newDraggableIndex=C,A.originalEvent=v,A.pullMode=E?E.lastPutMode:void 0;var V=nr(nr({},_),_a.getEventProperties(n,e));for(var U in V)A[U]=V[U];t&&t.dispatchEvent(A),N[K]&&N[K].call(e,A)}}var IP=["evt"],Ut=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=n.evt,s=pP(n,IP);_a.pluginEvent.bind(oe)(e,t,nr({dragEl:H,parentEl:We,ghostEl:le,rootEl:Fe,nextEl:co,lastDownEl:zs,cloneEl:Ge,cloneHidden:Ur,dragStarted:Ji,putSortable:vt,activeSortable:oe.active,originalEvent:i,oldIndex:oi,oldDraggableIndex:oa,newIndex:Yt,newDraggableIndex:Br,hideGhostForTarget:ey,unhideGhostForTarget:ty,cloneNowHidden:function(){Ur=!0},cloneNowShown:function(){Ur=!1},dispatchSortableEvent:function(d){Pt({sortable:t,name:d,originalEvent:i})}},s))};function Pt(r){bP(nr({putSortable:vt,cloneEl:Ge,targetEl:H,rootEl:Fe,oldIndex:oi,oldDraggableIndex:oa,newIndex:Yt,newDraggableIndex:Br},r))}var H,We,le,Fe,co,zs,Ge,Ur,oi,Yt,oa,Br,_s,vt,Qo=!1,nc=!1,rc=[],oo,Pn,Su,Au,Fm,Hm,Ji,Ko,ia,aa=!1,Ts=!1,qs,Et,bu=[],nd=!1,oc=[],Ic=typeof document<"u",Es=qv,$m=wa||Sr?"cssFloat":"float",kP=Ic&&!yP&&!qv&&"draggable"in document.createElement("div"),Qv=function(){if(Ic){if(Sr)return!1;var r=document.createElement("x");return r.style.cssText="pointer-events:auto",r.style.pointerEvents==="auto"}}(),Xv=function(e,t){var n=re(e),i=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),s=hi(e,0,t),l=hi(e,1,t),d=s&&re(s),f=l&&re(l),g=d&&parseInt(d.marginLeft)+parseInt(d.marginRight)+ot(s).width,m=f&&parseInt(f.marginLeft)+parseInt(f.marginRight)+ot(l).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(s&&d.float&&d.float!=="none"){var C=d.float==="left"?"left":"right";return l&&(f.clear==="both"||f.clear===C)?"vertical":"horizontal"}return s&&(d.display==="block"||d.display==="flex"||d.display==="table"||d.display==="grid"||g>=i&&n[$m]==="none"||l&&n[$m]==="none"&&g+m>i)?"vertical":"horizontal"},RP=function(e,t,n){var i=n?e.left:e.top,s=n?e.right:e.bottom,l=n?e.width:e.height,d=n?t.left:t.top,f=n?t.right:t.bottom,g=n?t.width:t.height;return i===d||s===f||i+l/2===d+g/2},NP=function(e,t){var n;return rc.some(function(i){var s=i[tn].options.emptyInsertThreshold;if(!(!s||Vd(i))){var l=ot(i),d=e>=l.left-s&&e<=l.right+s,f=t>=l.top-s&&t<=l.bottom+s;if(d&&f)return n=i}}),n},Zv=function(e){function t(s,l){return function(d,f,g,m){var C=d.options.group.name&&f.options.group.name&&d.options.group.name===f.options.group.name;if(s==null&&(l||C))return!0;if(s==null||s===!1)return!1;if(l&&s==="clone")return s;if(typeof s=="function")return t(s(d,f,g,m),l)(d,f,g,m);var v=(l?d:f).options.group.name;return s===!0||typeof s=="string"&&s===v||s.join&&s.indexOf(v)>-1}}var n={},i=e.group;(!i||Ks(i)!="object")&&(i={name:i}),n.name=i.name,n.checkPull=t(i.pull,!0),n.checkPut=t(i.put),n.revertClone=i.revertClone,e.group=n},ey=function(){!Qv&&le&&re(le,"display","none")},ty=function(){!Qv&&le&&re(le,"display","")};Ic&&document.addEventListener("click",function(r){if(nc)return r.preventDefault(),r.stopPropagation&&r.stopPropagation(),r.stopImmediatePropagation&&r.stopImmediatePropagation(),nc=!1,!1},!0);var io=function(e){if(H){e=e.touches?e.touches[0]:e;var t=NP(e.clientX,e.clientY);if(t){var n={};for(var i in e)e.hasOwnProperty(i)&&(n[i]=e[i]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[tn]._onDragOver(n)}}},OP=function(e){H&&H.parentNode[tn]._isOutsideThisEl(e.target)};function oe(r,e){if(!(r&&r.nodeType&&r.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(r));this.el=r,this.options=e=Tr({},e),r[tn]=this;var t={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(r.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Xv(r,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(l,d){l.setData("Text",d.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:oe.supportPointer!==!1&&"PointerEvent"in window&&!na,emptyInsertThreshold:5};_a.initializePlugins(this,r,t);for(var n in t)!(n in e)&&(e[n]=t[n]);Zv(e);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=e.forceFallback?!1:kP,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?Se(r,"pointerdown",this._onTapStart):(Se(r,"mousedown",this._onTapStart),Se(r,"touchstart",this._onTapStart)),this.nativeDraggable&&(Se(r,"dragover",this),Se(r,"dragenter",this)),rc.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),Tr(this,EP())}oe.prototype={constructor:oe,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(Ko=null)},_getDirection:function(e,t){return typeof this.options.direction=="function"?this.options.direction.call(this,e,t,H):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,i=this.options,s=i.preventOnFilter,l=e.type,d=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,f=(d||e).target,g=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||f,m=i.filter;if(VP(n),!H&&!(/mousedown|pointerdown/.test(l)&&e.button!==0||i.disabled)&&!g.isContentEditable&&!(!this.nativeDraggable&&na&&f&&f.tagName.toUpperCase()==="SELECT")&&(f=jn(f,i.draggable,n,!1),!(f&&f.animated)&&zs!==f)){if(oi=Tn(f),oa=Tn(f,i.draggable),typeof m=="function"){if(m.call(this,e,f,this)){Pt({sortable:t,rootEl:g,name:"filter",targetEl:f,toEl:n,fromEl:n}),Ut("filter",t,{evt:e}),s&&e.cancelable&&e.preventDefault();return}}else if(m&&(m=m.split(",").some(function(C){if(C=jn(g,C.trim(),n,!1),C)return Pt({sortable:t,rootEl:C,name:"filter",targetEl:f,fromEl:n,toEl:n}),Ut("filter",t,{evt:e}),!0}),m)){s&&e.cancelable&&e.preventDefault();return}i.handle&&!jn(g,i.handle,n,!1)||this._prepareDragStart(e,d,f)}}},_prepareDragStart:function(e,t,n){var i=this,s=i.el,l=i.options,d=s.ownerDocument,f;if(n&&!H&&n.parentNode===s){var g=ot(n);if(Fe=s,H=n,We=H.parentNode,co=H.nextSibling,zs=n,_s=l.group,oe.dragged=H,oo={target:H,clientX:(t||e).clientX,clientY:(t||e).clientY},Fm=oo.clientX-g.left,Hm=oo.clientY-g.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,H.style["will-change"]="all",f=function(){if(Ut("delayEnded",i,{evt:e}),oe.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!Lm&&i.nativeDraggable&&(H.draggable=!0),i._triggerDragStart(e,t),Pt({sortable:i,name:"choose",originalEvent:e}),jt(H,l.chosenClass,!0)},l.ignore.split(",").forEach(function(m){Gv(H,m.trim(),Iu)}),Se(d,"dragover",io),Se(d,"mousemove",io),Se(d,"touchmove",io),Se(d,"mouseup",i._onDrop),Se(d,"touchend",i._onDrop),Se(d,"touchcancel",i._onDrop),Lm&&this.nativeDraggable&&(this.options.touchStartThreshold=4,H.draggable=!0),Ut("delayStart",this,{evt:e}),l.delay&&(!l.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(wa||Sr))){if(oe.eventCanceled){this._onDrop();return}Se(d,"mouseup",i._disableDelayedDrag),Se(d,"touchend",i._disableDelayedDrag),Se(d,"touchcancel",i._disableDelayedDrag),Se(d,"mousemove",i._delayedDragTouchMoveHandler),Se(d,"touchmove",i._delayedDragTouchMoveHandler),l.supportPointer&&Se(d,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(f,l.delay)}else f()}},_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(){H&&Iu(H),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;Ce(e,"mouseup",this._disableDelayedDrag),Ce(e,"touchend",this._disableDelayedDrag),Ce(e,"touchcancel",this._disableDelayedDrag),Ce(e,"mousemove",this._delayedDragTouchMoveHandler),Ce(e,"touchmove",this._delayedDragTouchMoveHandler),Ce(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||e.pointerType=="touch"&&e,!this.nativeDraggable||t?this.options.supportPointer?Se(document,"pointermove",this._onTouchMove):t?Se(document,"touchmove",this._onTouchMove):Se(document,"mousemove",this._onTouchMove):(Se(H,"dragend",this),Se(Fe,"dragstart",this._onDragStart));try{document.selection?Ws(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(Qo=!1,Fe&&H){Ut("dragStarted",this,{evt:t}),this.nativeDraggable&&Se(document,"dragover",OP);var n=this.options;!e&&jt(H,n.dragClass,!1),jt(H,n.ghostClass,!0),oe.active=this,e&&this._appendGhost(),Pt({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(Pn){this._lastX=Pn.clientX,this._lastY=Pn.clientY,ey();for(var e=document.elementFromPoint(Pn.clientX,Pn.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(Pn.clientX,Pn.clientY),e!==t);)t=e;if(H.parentNode[tn]._isOutsideThisEl(e),t)do{if(t[tn]){var n=void 0;if(n=t[tn]._onDragOver({clientX:Pn.clientX,clientY:Pn.clientY,target:e,rootEl:t}),n&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);ty()}},_onTouchMove:function(e){if(oo){var t=this.options,n=t.fallbackTolerance,i=t.fallbackOffset,s=e.touches?e.touches[0]:e,l=le&&ci(le,!0),d=le&&l&&l.a,f=le&&l&&l.d,g=Es&&Et&&Vm(Et),m=(s.clientX-oo.clientX+i.x)/(d||1)+(g?g[0]-bu[0]:0)/(d||1),C=(s.clientY-oo.clientY+i.y)/(f||1)+(g?g[1]-bu[1]:0)/(f||1);if(!oe.active&&!Qo){if(n&&Math.max(Math.abs(s.clientX-this._lastX),Math.abs(s.clientY-this._lastY))<n)return;this._onDragStart(e,!0)}if(le){l?(l.e+=m-(Su||0),l.f+=C-(Au||0)):l={a:1,b:0,c:0,d:1,e:m,f:C};var v="matrix(".concat(l.a,",").concat(l.b,",").concat(l.c,",").concat(l.d,",").concat(l.e,",").concat(l.f,")");re(le,"webkitTransform",v),re(le,"mozTransform",v),re(le,"msTransform",v),re(le,"transform",v),Su=m,Au=C,Pn=s}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!le){var e=this.options.fallbackOnBody?document.body:Fe,t=ot(H,!0,Es,!0,e),n=this.options;if(Es){for(Et=e;re(Et,"position")==="static"&&re(Et,"transform")==="none"&&Et!==document;)Et=Et.parentNode;Et!==document.body&&Et!==document.documentElement?(Et===document&&(Et=er()),t.top+=Et.scrollTop,t.left+=Et.scrollLeft):Et=er(),bu=Vm(Et)}le=H.cloneNode(!0),jt(le,n.ghostClass,!1),jt(le,n.fallbackClass,!0),jt(le,n.dragClass,!0),re(le,"transition",""),re(le,"transform",""),re(le,"box-sizing","border-box"),re(le,"margin",0),re(le,"top",t.top),re(le,"left",t.left),re(le,"width",t.width),re(le,"height",t.height),re(le,"opacity","0.8"),re(le,"position",Es?"absolute":"fixed"),re(le,"zIndex","100000"),re(le,"pointerEvents","none"),oe.ghost=le,e.appendChild(le),re(le,"transform-origin",Fm/parseInt(le.style.width)*100+"% "+Hm/parseInt(le.style.height)*100+"%")}},_onDragStart:function(e,t){var n=this,i=e.dataTransfer,s=n.options;if(Ut("dragStart",this,{evt:e}),oe.eventCanceled){this._onDrop();return}Ut("setupClone",this),oe.eventCanceled||(Ge=Jv(H),Ge.draggable=!1,Ge.style["will-change"]="",this._hideClone(),jt(Ge,this.options.chosenClass,!1),oe.clone=Ge),n.cloneId=Ws(function(){Ut("clone",n),!oe.eventCanceled&&(n.options.removeCloneOnHide||Fe.insertBefore(Ge,H),n._hideClone(),Pt({sortable:n,name:"clone"}))}),!t&&jt(H,s.dragClass,!0),t?(nc=!0,n._loopId=setInterval(n._emulateDragOver,50)):(Ce(document,"mouseup",n._onDrop),Ce(document,"touchend",n._onDrop),Ce(document,"touchcancel",n._onDrop),i&&(i.effectAllowed="move",s.setData&&s.setData.call(n,i,H)),Se(document,"drop",n),re(H,"transform","translateZ(0)")),Qo=!0,n._dragStartId=Ws(n._dragStarted.bind(n,t,e)),Se(document,"selectstart",n),Ji=!0,na&&re(document.body,"user-select","none")},_onDragOver:function(e){var t=this.el,n=e.target,i,s,l,d=this.options,f=d.group,g=oe.active,m=_s===f,C=d.sort,v=vt||g,E,_=this,A=!1;if(nd)return;function N(at,wt){Ut(at,_,nr({evt:e,isOwner:m,axis:E?"vertical":"horizontal",revert:l,dragRect:i,targetRect:s,canSort:C,fromSortable:v,target:n,completed:V,onMove:function(Ht,Yc){return Ss(Fe,t,H,i,Ht,ot(Ht),e,Yc)},changed:U},wt))}function K(){N("dragOverAnimationCapture"),_.captureAnimationState(),_!==v&&v.captureAnimationState()}function V(at){return N("dragOverCompleted",{insertion:at}),at&&(m?g._hideClone():g._showClone(_),_!==v&&(jt(H,vt?vt.options.ghostClass:g.options.ghostClass,!1),jt(H,d.ghostClass,!0)),vt!==_&&_!==oe.active?vt=_:_===oe.active&&vt&&(vt=null),v===_&&(_._ignoreWhileAnimating=n),_.animateAll(function(){N("dragOverAnimationComplete"),_._ignoreWhileAnimating=null}),_!==v&&(v.animateAll(),v._ignoreWhileAnimating=null)),(n===H&&!H.animated||n===t&&!n.animated)&&(Ko=null),!d.dragoverBubble&&!e.rootEl&&n!==document&&(H.parentNode[tn]._isOutsideThisEl(e.target),!at&&io(e)),!d.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),A=!0}function U(){Yt=Tn(H),Br=Tn(H,d.draggable),Pt({sortable:_,name:"change",toEl:t,newIndex:Yt,newDraggableIndex:Br,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),n=jn(n,d.draggable,t,!0),N("dragOver"),oe.eventCanceled)return A;if(H.contains(e.target)||n.animated&&n.animatingX&&n.animatingY||_._ignoreWhileAnimating===n)return V(!1);if(nc=!1,g&&!d.disabled&&(m?C||(l=We!==Fe):vt===this||(this.lastPutMode=_s.checkPull(this,g,H,e))&&f.checkPut(this,g,H,e))){if(E=this._getDirection(e,n)==="vertical",i=ot(H),N("dragOverValid"),oe.eventCanceled)return A;if(l)return We=Fe,K(),this._hideClone(),N("revert"),oe.eventCanceled||(co?Fe.insertBefore(H,co):Fe.appendChild(H)),V(!0);var Q=Vd(t,d.draggable);if(!Q||DP(e,E,this)&&!Q.animated){if(Q===H)return V(!1);if(Q&&t===e.target&&(n=Q),n&&(s=ot(n)),Ss(Fe,t,H,i,n,s,e,!!n)!==!1)return K(),t.appendChild(H),We=t,U(),V(!0)}else if(Q&&xP(e,E,this)){var ce=hi(t,0,d,!0);if(ce===H)return V(!1);if(n=ce,s=ot(n),Ss(Fe,t,H,i,n,s,e,!1)!==!1)return K(),t.insertBefore(H,ce),We=t,U(),V(!0)}else if(n.parentNode===t){s=ot(n);var we=0,z,et=H.parentNode!==t,_e=!RP(H.animated&&H.toRect||i,n.animated&&n.toRect||s,E),j=E?"top":"left",W=Um(n,"top","top")||Um(H,"top","top"),Te=W?W.scrollTop:void 0;Ko!==n&&(z=s[j],aa=!1,Ts=!_e&&d.invertSwap||et),we=LP(e,n,s,E,_e?1:d.swapThreshold,d.invertedSwapThreshold==null?d.swapThreshold:d.invertedSwapThreshold,Ts,Ko===n);var Ue;if(we!==0){var Ct=Tn(H);do Ct-=we,Ue=We.children[Ct];while(Ue&&(re(Ue,"display")==="none"||Ue===le))}if(we===0||Ue===n)return V(!1);Ko=n,ia=we;var Sn=n.nextElementSibling,on=!1;on=we===1;var An=Ss(Fe,t,H,i,n,s,e,on);if(An!==!1)return(An===1||An===-1)&&(on=An===1),nd=!0,setTimeout(MP,30),K(),on&&!Sn?t.appendChild(H):n.parentNode.insertBefore(H,on?Sn:n),W&&Yv(W,0,Te-W.scrollTop),We=H.parentNode,z!==void 0&&!Ts&&(qs=Math.abs(z-ot(n)[j])),U(),V(!0)}if(t.contains(H))return V(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){Ce(document,"mousemove",this._onTouchMove),Ce(document,"touchmove",this._onTouchMove),Ce(document,"pointermove",this._onTouchMove),Ce(document,"dragover",io),Ce(document,"mousemove",io),Ce(document,"touchmove",io)},_offUpEvents:function(){var e=this.el.ownerDocument;Ce(e,"mouseup",this._onDrop),Ce(e,"touchend",this._onDrop),Ce(e,"pointerup",this._onDrop),Ce(e,"touchcancel",this._onDrop),Ce(document,"selectstart",this)},_onDrop:function(e){var t=this.el,n=this.options;if(Yt=Tn(H),Br=Tn(H,n.draggable),Ut("drop",this,{evt:e}),We=H&&H.parentNode,Yt=Tn(H),Br=Tn(H,n.draggable),oe.eventCanceled){this._nulling();return}Qo=!1,Ts=!1,aa=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),rd(this.cloneId),rd(this._dragStartId),this.nativeDraggable&&(Ce(document,"drop",this),Ce(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),na&&re(document.body,"user-select",""),re(H,"transform",""),e&&(Ji&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),le&&le.parentNode&&le.parentNode.removeChild(le),(Fe===We||vt&&vt.lastPutMode!=="clone")&&Ge&&Ge.parentNode&&Ge.parentNode.removeChild(Ge),H&&(this.nativeDraggable&&Ce(H,"dragend",this),Iu(H),H.style["will-change"]="",Ji&&!Qo&&jt(H,vt?vt.options.ghostClass:this.options.ghostClass,!1),jt(H,this.options.chosenClass,!1),Pt({sortable:this,name:"unchoose",toEl:We,newIndex:null,newDraggableIndex:null,originalEvent:e}),Fe!==We?(Yt>=0&&(Pt({rootEl:We,name:"add",toEl:We,fromEl:Fe,originalEvent:e}),Pt({sortable:this,name:"remove",toEl:We,originalEvent:e}),Pt({rootEl:We,name:"sort",toEl:We,fromEl:Fe,originalEvent:e}),Pt({sortable:this,name:"sort",toEl:We,originalEvent:e})),vt&&vt.save()):Yt!==oi&&Yt>=0&&(Pt({sortable:this,name:"update",toEl:We,originalEvent:e}),Pt({sortable:this,name:"sort",toEl:We,originalEvent:e})),oe.active&&((Yt==null||Yt===-1)&&(Yt=oi,Br=oa),Pt({sortable:this,name:"end",toEl:We,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){Ut("nulling",this),Fe=H=We=le=co=Ge=zs=Ur=oo=Pn=Ji=Yt=Br=oi=oa=Ko=ia=vt=_s=oe.dragged=oe.ghost=oe.clone=oe.active=null,oc.forEach(function(e){e.checked=!0}),oc.length=Su=Au=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":H&&(this._onDragOver(e),PP(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],t,n=this.el.children,i=0,s=n.length,l=this.options;i<s;i++)t=n[i],jn(t,l.draggable,this.el,!1)&&e.push(t.getAttribute(l.dataIdAttr)||UP(t));return e},sort:function(e,t){var n={},i=this.el;this.toArray().forEach(function(s,l){var d=i.children[l];jn(d,this.options.draggable,i,!1)&&(n[s]=d)},this),t&&this.captureAnimationState(),e.forEach(function(s){n[s]&&(i.removeChild(n[s]),i.appendChild(n[s]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return jn(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var n=this.options;if(t===void 0)return n[e];var i=_a.modifyOption(this,e,t);typeof i<"u"?n[e]=i:n[e]=t,e==="group"&&Zv(n)},destroy:function(){Ut("destroy",this);var e=this.el;e[tn]=null,Ce(e,"mousedown",this._onTapStart),Ce(e,"touchstart",this._onTapStart),Ce(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(Ce(e,"dragover",this),Ce(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),rc.splice(rc.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!Ur){if(Ut("hideClone",this),oe.eventCanceled)return;re(Ge,"display","none"),this.options.removeCloneOnHide&&Ge.parentNode&&Ge.parentNode.removeChild(Ge),Ur=!0}},_showClone:function(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(Ur){if(Ut("showClone",this),oe.eventCanceled)return;H.parentNode==Fe&&!this.options.group.revertClone?Fe.insertBefore(Ge,H):co?Fe.insertBefore(Ge,co):Fe.appendChild(Ge),this.options.group.revertClone&&this.animate(H,Ge),re(Ge,"display",""),Ur=!1}}};function PP(r){r.dataTransfer&&(r.dataTransfer.dropEffect="move"),r.cancelable&&r.preventDefault()}function Ss(r,e,t,n,i,s,l,d){var f,g=r[tn],m=g.options.onMove,C;return window.CustomEvent&&!Sr&&!wa?f=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(f=document.createEvent("Event"),f.initEvent("move",!0,!0)),f.to=e,f.from=r,f.dragged=t,f.draggedRect=n,f.related=i||e,f.relatedRect=s||ot(e),f.willInsertAfter=d,f.originalEvent=l,r.dispatchEvent(f),m&&(C=m.call(g,f,l)),C}function Iu(r){r.draggable=!1}function MP(){nd=!1}function xP(r,e,t){var n=ot(hi(t.el,0,t.options,!0)),i=10;return e?r.clientX<n.left-i||r.clientY<n.top&&r.clientX<n.right:r.clientY<n.top-i||r.clientY<n.bottom&&r.clientX<n.left}function DP(r,e,t){var n=ot(Vd(t.el,t.options.draggable)),i=10;return e?r.clientX>n.right+i||r.clientX<=n.right&&r.clientY>n.bottom&&r.clientX>=n.left:r.clientX>n.right&&r.clientY>n.top||r.clientX<=n.right&&r.clientY>n.bottom+i}function LP(r,e,t,n,i,s,l,d){var f=n?r.clientY:r.clientX,g=n?t.height:t.width,m=n?t.top:t.left,C=n?t.bottom:t.right,v=!1;if(!l){if(d&&qs<g*i){if(!aa&&(ia===1?f>m+g*s/2:f<C-g*s/2)&&(aa=!0),aa)v=!0;else if(ia===1?f<m+qs:f>C-qs)return-ia}else if(f>m+g*(1-i)/2&&f<C-g*(1-i)/2)return BP(e)}return v=v||l,v&&(f<m+g*s/2||f>C-g*s/2)?f>m+g/2?1:-1:0}function BP(r){return Tn(H)<Tn(r)?1:-1}function UP(r){for(var e=r.tagName+r.className+r.src+r.href+r.textContent,t=e.length,n=0;t--;)n+=e.charCodeAt(t);return n.toString(36)}function VP(r){oc.length=0;for(var e=r.getElementsByTagName("input"),t=e.length;t--;){var n=e[t];n.checked&&oc.push(n)}}function Ws(r){return setTimeout(r,0)}function rd(r){return clearTimeout(r)}Ic&&Se(document,"touchmove",function(r){(oe.active||Qo)&&r.cancelable&&r.preventDefault()});oe.utils={on:Se,off:Ce,css:re,find:Gv,is:function(e,t){return!!jn(e,t,e,!1)},extend:_P,throttle:jv,closest:jn,toggleClass:jt,clone:Jv,index:Tn,nextTick:Ws,cancelNextTick:rd,detectDirection:Xv,getChild:hi};oe.get=function(r){return r[tn]};oe.mount=function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;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&&(oe.utils=nr(nr({},oe.utils),n.utils)),_a.mount(n)})};oe.create=function(r,e){return new oe(r,e)};oe.version=vP;var Qe=[],Qi,od,id=!1,ku,Ru,ic,Xi;function FP(){function r(){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 r.prototype={dragStarted:function(t){var n=t.originalEvent;this.sortable.nativeDraggable?Se(document,"dragover",this._handleAutoScroll):this.options.supportPointer?Se(document,"pointermove",this._handleFallbackAutoScroll):n.touches?Se(document,"touchmove",this._handleFallbackAutoScroll):Se(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var n=t.originalEvent;!this.options.dragOverBubble&&!n.rootEl&&this._handleAutoScroll(n)},drop:function(){this.sortable.nativeDraggable?Ce(document,"dragover",this._handleAutoScroll):(Ce(document,"pointermove",this._handleFallbackAutoScroll),Ce(document,"touchmove",this._handleFallbackAutoScroll),Ce(document,"mousemove",this._handleFallbackAutoScroll)),Km(),Gs(),TP()},nulling:function(){ic=od=Qi=id=Xi=ku=Ru=null,Qe.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,n){var i=this,s=(t.touches?t.touches[0]:t).clientX,l=(t.touches?t.touches[0]:t).clientY,d=document.elementFromPoint(s,l);if(ic=t,n||this.options.forceAutoScrollFallback||wa||Sr||na){Nu(t,this.options,d,n);var f=Kr(d,!0);id&&(!Xi||s!==ku||l!==Ru)&&(Xi&&Km(),Xi=setInterval(function(){var g=Kr(document.elementFromPoint(s,l),!0);g!==f&&(f=g,Gs()),Nu(t,i.options,g,n)},10),ku=s,Ru=l)}else{if(!this.options.bubbleScroll||Kr(d,!0)===er()){Gs();return}Nu(t,this.options,Kr(d,!1),!1)}}},Tr(r,{pluginName:"scroll",initializeByDefault:!0})}function Gs(){Qe.forEach(function(r){clearInterval(r.pid)}),Qe=[]}function Km(){clearInterval(Xi)}var Nu=jv(function(r,e,t,n){if(e.scroll){var i=(r.touches?r.touches[0]:r).clientX,s=(r.touches?r.touches[0]:r).clientY,l=e.scrollSensitivity,d=e.scrollSpeed,f=er(),g=!1,m;od!==t&&(od=t,Gs(),Qi=e.scroll,m=e.scrollFn,Qi===!0&&(Qi=Kr(t,!0)));var C=0,v=Qi;do{var E=v,_=ot(E),A=_.top,N=_.bottom,K=_.left,V=_.right,U=_.width,Q=_.height,ce=void 0,we=void 0,z=E.scrollWidth,et=E.scrollHeight,_e=re(E),j=E.scrollLeft,W=E.scrollTop;E===f?(ce=U<z&&(_e.overflowX==="auto"||_e.overflowX==="scroll"||_e.overflowX==="visible"),we=Q<et&&(_e.overflowY==="auto"||_e.overflowY==="scroll"||_e.overflowY==="visible")):(ce=U<z&&(_e.overflowX==="auto"||_e.overflowX==="scroll"),we=Q<et&&(_e.overflowY==="auto"||_e.overflowY==="scroll"));var Te=ce&&(Math.abs(V-i)<=l&&j+U<z)-(Math.abs(K-i)<=l&&!!j),Ue=we&&(Math.abs(N-s)<=l&&W+Q<et)-(Math.abs(A-s)<=l&&!!W);if(!Qe[C])for(var Ct=0;Ct<=C;Ct++)Qe[Ct]||(Qe[Ct]={});(Qe[C].vx!=Te||Qe[C].vy!=Ue||Qe[C].el!==E)&&(Qe[C].el=E,Qe[C].vx=Te,Qe[C].vy=Ue,clearInterval(Qe[C].pid),(Te!=0||Ue!=0)&&(g=!0,Qe[C].pid=setInterval((function(){n&&this.layer===0&&oe.active._onTouchMove(ic);var Sn=Qe[this.layer].vy?Qe[this.layer].vy*d:0,on=Qe[this.layer].vx?Qe[this.layer].vx*d:0;typeof m=="function"&&m.call(oe.dragged.parentNode[tn],on,Sn,r,ic,Qe[this.layer].el)!=="continue"||Yv(Qe[this.layer].el,on,Sn)}).bind({layer:C}),24))),C++}while(e.bubbleScroll&&v!==f&&(v=Kr(v,!1)));id=g}},30),ny=function(e){var t=e.originalEvent,n=e.putSortable,i=e.dragEl,s=e.activeSortable,l=e.dispatchSortableEvent,d=e.hideGhostForTarget,f=e.unhideGhostForTarget;if(t){var g=n||s;d();var m=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,C=document.elementFromPoint(m.clientX,m.clientY);f(),g&&!g.el.contains(C)&&(l("spill"),this.onSpill({dragEl:i,putSortable:n}))}};function Fd(){}Fd.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 i=hi(this.sortable.el,this.startIndex,this.options);i?this.sortable.el.insertBefore(t,i):this.sortable.el.appendChild(t),this.sortable.animateAll(),n&&n.animateAll()},drop:ny};Tr(Fd,{pluginName:"revertOnSpill"});function Hd(){}Hd.prototype={onSpill:function(e){var t=e.dragEl,n=e.putSortable,i=n||this.sortable;i.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),i.animateAll()},drop:ny};Tr(Hd,{pluginName:"removeOnSpill"});oe.mount(new FP);oe.mount(Hd,Fd);function HP(){return typeof window<"u"?window.console:global.console}const $P=HP();function KP(r){const e=Object.create(null);return function(n){return e[n]||(e[n]=r(n))}}const zP=/-(\w)/g,zm=KP(r=>r.replace(zP,(e,t)=>t?t.toUpperCase():""));function Ou(r){r.parentElement!==null&&r.parentElement.removeChild(r)}function qm(r,e,t){const n=t===0?r.children[0]:r.children[t-1].nextSibling;r.insertBefore(e,n)}function qP(r,e){return Object.values(r).indexOf(e)}function WP(r,e,t,n){if(!r)return[];const i=Object.values(r),s=e.length-n;return[...e].map((d,f)=>f>=s?i.length:i.indexOf(d))}function ry(r,e){this.$nextTick(()=>this.$emit(r.toLowerCase(),e))}function GP(r){return e=>{this.realList!==null&&this["onDrag"+r](e),ry.call(this,r,e)}}function jP(r){return["transition-group","TransitionGroup"].includes(r)}function YP(r){if(!r||r.length!==1)return!1;const[{type:e}]=r;return e?jP(e.name):!1}function JP(r,e){return e?{...e.props,...e.attrs}:r}const ad=["Start","Add","Remove","Update","End"],sd=["Choose","Unchoose","Sort","Filter","Clone"],QP=["Move",...ad,...sd].map(r=>"on"+r);let Pu=null;const XP={options:Object,list:{type:Array,required:!1,default:null},noTransitionOnDrag:{type:Boolean,default:!1},clone:{type:Function,default:r=>r},tag:{type:String,default:"div"},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null},component:{type:String,default:null},modelValue:{type:Array,required:!1,default:null}},ZP=c.defineComponent({name:"VueDraggableNext",inheritAttrs:!1,emits:["update:modelValue","move","change",...ad.map(r=>r.toLowerCase()),...sd.map(r=>r.toLowerCase())],props:XP,data(){return{transitionMode:!1,noneFunctionalComponentMode:!1,headerOffset:0,footerOffset:0,_sortable:{},visibleIndexes:[],context:{}}},render(){const r=this.$slots.default?this.$slots.default():null,e=JP(this.$attrs,this.componentData);return r?(this.transitionMode=YP(r),c.h(this.getTag(),e,r)):c.h(this.getTag(),e,[])},created(){this.list!==null&&this.modelValue!==null&&$P.error("list props are mutually exclusive! Please set one.")},mounted(){const r={};ad.forEach(i=>{r["on"+i]=GP.call(this,i)}),sd.forEach(i=>{r["on"+i]=ry.bind(this,i)});const e=Object.keys(this.$attrs).reduce((i,s)=>(i[zm(s)]=this.$attrs[s],i),{}),t=Object.assign({},e,r,{onMove:(i,s)=>this.onDragMove(i,s)});!("draggable"in t)&&(t.draggable=">*");const n=this.$el.nodeType===1?this.$el:this.$el.parentElement;this._sortable=new oe(n,t),n.__draggable_component__=this,this.computeIndexes()},beforeUnmount(){try{this._sortable!==void 0&&this._sortable.destroy()}catch{}},computed:{realList(){return this.list?this.list:this.modelValue}},watch:{$attrs:{handler(r){this.updateOptions(r)},deep:!0},realList(){this.computeIndexes()}},methods:{getTag(){return this.component?c.resolveComponent(this.component):this.tag},updateOptions(r){for(var e in r){const t=zm(e);QP.indexOf(t)===-1&&this._sortable.option(t,r[e])}},getChildrenNodes(){return this.$el.children},computeIndexes(){this.$nextTick(()=>{this.visibleIndexes=WP(this.getChildrenNodes(),this.$el.children,this.transitionMode,this.footerOffset)})},getUnderlyingVm(r){const e=qP(this.getChildrenNodes()||[],r);if(e===-1)return null;const t=this.realList[e];return{index:e,element:t}},emitChanges(r){this.$nextTick(()=>{this.$emit("change",r)})},alterList(r){if(this.list){r(this.list);return}const e=[...this.modelValue];r(e),this.$emit("update:modelValue",e)},spliceList(){const r=e=>e.splice(...arguments);this.alterList(r)},updatePosition(r,e){const t=n=>n.splice(e,0,n.splice(r,1)[0]);this.alterList(t)},getVmIndex(r){const e=this.visibleIndexes,t=e.length;return r>t-1?t:e[r]},getComponent(){return this.$slots.default?this.$slots.default()[0].componentInstance:null},resetTransitionData(r){if(!this.noTransitionOnDrag||!this.transitionMode)return;var e=this.getChildrenNodes();e[r].data=null;const t=this.getComponent();t.children=[],t.kept=void 0},onDragStart(r){this.computeIndexes(),this.context=this.getUnderlyingVm(r.item),this.context&&(r.item._underlying_vm_=this.clone(this.context.element),Pu=r.item)},onDragAdd(r){const e=r.item._underlying_vm_;if(e===void 0)return;Ou(r.item);const t=this.getVmIndex(r.newIndex);this.spliceList(t,0,e),this.computeIndexes();const n={element:e,newIndex:t};this.emitChanges({added:n})},onDragRemove(r){if(qm(this.$el,r.item,r.oldIndex),r.pullMode==="clone"){Ou(r.clone);return}if(!this.context)return;const e=this.context.index;this.spliceList(e,1);const t={element:this.context.element,oldIndex:e};this.resetTransitionData(e),this.emitChanges({removed:t})},onDragUpdate(r){Ou(r.item),qm(r.from,r.item,r.oldIndex);const e=this.context.index,t=this.getVmIndex(r.newIndex);this.updatePosition(e,t);const n={element:this.context.element,oldIndex:e,newIndex:t};this.emitChanges({moved:n})},updateProperty(r,e){r.hasOwnProperty(e)&&(r[e]+=this.headerOffset)},onDragMove(r,e){const t=this.move;if(!t||!this.realList)return!0;const n=this.getRelatedContextFromMoveEvent(r),i=this.context,s=this.computeFutureIndex(n,r);Object.assign(i,{futureIndex:s});const l=Object.assign({},r,{relatedContext:n,draggedContext:i});return t(l,e)},onDragEnd(){this.computeIndexes(),Pu=null},getTrargetedComponent(r){return r.__draggable_component__},getRelatedContextFromMoveEvent({to:r,related:e}){const t=this.getTrargetedComponent(r);if(!t)return{component:t};const n=t.realList,i={list:n,component:t};if(r!==e&&n&&t.getUnderlyingVm){const s=t.getUnderlyingVm(e);if(s)return Object.assign(s,i)}return i},computeFutureIndex(r,e){const t=[...e.to.children].filter(l=>l.style.display!=="none");if(t.length===0)return 0;const n=t.indexOf(e.related),i=r.component.getVmIndex(n);return t.indexOf(Pu)!==-1||!e.willInsertAfter?i:i+1}}}),e1={class:"d-flex flex-row align-center"},$d=c.defineComponent({__name:"ColumnSettingsDialog",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(r){const e=c.useModel(r,"modelValue"),t=c.ref(""),n=c.computed(()=>{var i;return(i=e.value)==null?void 0:i.filter(s=>s.title.toLowerCase().includes(t.value.toLowerCase()))});return(i,s)=>{const l=c.resolveComponent("v-list-item-content");return c.openBlock(),c.createBlock(Ca,{"dd-id":"col-settings",buttons:!1,title:"Column settings"},{default:c.withCtx(()=>[c.createVNode(bc,{modelValue:t.value,"onUpdate:modelValue":s[0]||(s[0]=d=>t.value=d)},null,8,["modelValue"]),c.createVNode(St.VList,null,{default:c.withCtx(()=>[c.createVNode(c.unref(ZP),{list:n.value,animation:200,"ghost-class":"ghost-card"},{default:c.withCtx(()=>[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(n.value,d=>(c.openBlock(),c.createBlock(St.VListItem,{key:d.key,class:"pa-0"},{default:c.withCtx(()=>[c.createElementVNode("div",e1,[c.createVNode(c.unref(h0),{class:"cursor-grab mb-2"}),c.createVNode(St.VListItemAction,null,{default:c.withCtx(()=>[c.createVNode(Tk.VCheckbox,{modelValue:d.checked,"onUpdate:modelValue":f=>d.checked=f},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),c.createVNode(l,null,{default:c.withCtx(()=>[c.createVNode(St.VListItemTitle,{class:"mb-1"},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(d.title)+"  ",1)]),_:2},1024)]),_:2},1024),d.icon?(c.openBlock(),c.createBlock(Xs.VIcon,{key:0},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(d.icon),1)]),_:2},1024)):c.createCommentVNode("",!0)])]),_:2},1024))),128))]),_:1},8,["list"])]),_:1})]),_:1})}}}),t1=["src","height","width"],n1={key:0,class:"text-center text-h6"},r1={key:1,class:"text-center text-h5"},o1={key:0,class:"text-center"},i1={class:"d-flex justify-center align-center mt-4 ga-3"},Kd=c.defineComponent({__name:"TableCard",props:{item:{},columns:{},size:{},image:{},tags:{},route:{},callback:{type:Function}},setup(r){const e=r,t=()=>{var i;return((i=e.columns.find(s=>s.isHeader))==null?void 0:i.key)||""},n=()=>{var i;return((i=e.columns.find(s=>s.isSubtitle))==null?void 0:i.key)||""};return(i,s)=>(c.openBlock(),c.createBlock(lt.VCard,{onClick:i.callback,ripple:"",class:"d-flex flex-column pa-4pa-4 bg-containerBg"},{default:c.withCtx(()=>[c.createVNode(lt.VCardActions,null,{default:c.withCtx(()=>[c.createVNode(Oe.VRow,{"no-gutters":"",align:"center",justify:"end"},{default:c.withCtx(()=>[c.renderSlot(i.$slots,"actions",{item:i.item})]),_:3})]),_:3}),c.createVNode(lt.VCardTitle,null,{default:c.withCtx(()=>[c.createVNode(Oe.VRow,{"no-gutters":"",align:"center",justify:"center"},{default:c.withCtx(()=>[i.image?(c.openBlock(),c.createElementBlock("img",{key:0,src:i.image,height:i.size,width:i.size,alt:""},null,8,t1)):c.createCommentVNode("",!0)]),_:1})]),_:1}),t()?(c.openBlock(),c.createElementBlock("div",n1,c.toDisplayString(i.item[t()]),1)):c.createCommentVNode("",!0),n()?(c.openBlock(),c.createElementBlock("div",r1,c.toDisplayString(i.item[n()]),1)):c.createCommentVNode("",!0),c.createVNode(fo.VDivider,{class:"ma-3"}),c.createVNode(lt.VCardText,{class:"d-flex flex-column align-center pa-4 pt-1"},{default:c.withCtx(()=>[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(i.columns,l=>(c.openBlock(),c.createElementBlock(c.Fragment,{key:l.key},[i.item[l.key]&&!l.isHeader&&!l.isSubtitle?(c.openBlock(),c.createElementBlock("div",o1,c.toDisplayString(l.title)+": "+c.toDisplayString(i.item[l.key]),1)):c.createCommentVNode("",!0)],64))),128)),c.createElementVNode("div",i1,[i.tags?(c.openBlock(!0),c.createElementBlock(c.Fragment,{key:0},c.renderList(i.tags,l=>(c.openBlock(),c.createBlock(Ek.VChip,{class:"pa-3",key:l},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(l),1)]),_:2},1024))),128)):c.createCommentVNode("",!0)])]),_:1})]),_:3},8,["onClick"]))}}),a1=c.defineComponent({__name:"TableCardsView",props:{data:{},columns:{},size:{},itemKey:{}},setup(r){return(e,t)=>(c.openBlock(),c.createBlock(Oe.VRow,{class:"mt-5 border tb-cards-h",wrap:""},{default:c.withCtx(()=>[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(e.data,n=>(c.openBlock(),c.createBlock(Oe.VCol,{cols:"12",sm:"6",md:"4",lg:"3",class:"pa-2",key:n[e.itemKey]},{default:c.withCtx(()=>[c.createVNode(Kd,{item:n,columns:e.columns,size:e.size},{actions:c.withCtx(({item:i})=>[c.renderSlot(e.$slots,"actions",{item:i},void 0,!0)]),_:2},1032,["item","columns","size"])]),_:2},1024))),128))]),_:3}))}}),oy=vi(a1,[["__scopeId","data-v-e1a4ccbc"]]),s1={class:"j-field px-4 py-3 rounded-sm bg-containerBg"},iy=c.defineComponent({__name:"ReadOnlyField",props:{value:{}},setup(r){return(e,t)=>(c.openBlock(),c.createElementBlock("div",s1,c.toDisplayString(e.value),1))}}),c1={key:0,class:"mb-2 ms-1"},ay=c.defineComponent({__name:"JTextField",props:{modelValue:{},name:{},label:{},type:{default:"text"},readonly:{type:Boolean},density:{},rules:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,i=c.computed(()=>t.readonly?"solo":"solo-filled");return(s,l)=>(c.openBlock(),c.createElementBlock("div",null,[s.name?(c.openBlock(),c.createElementBlock("p",c1,c.toDisplayString(s.name),1)):c.createCommentVNode("",!0),s.label?(c.openBlock(),c.createBlock(ua.VLabel,{key:1,class:"text-subtitle-1 text-high-emphasis mb-2"},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(s.label),1)]),_:1})):c.createCommentVNode("",!0),s.readonly?c.createCommentVNode("",!0):(c.openBlock(),c.createBlock(c.unref(zr.VTextField),{key:2,variant:i.value,color:"secondary","bg-color":"containerBg",rounded:"sm","hide-details":"auto",type:s.type,density:s.density,rules:s.rules,value:s.modelValue,"onUpdate:modelValue":l[0]||(l[0]=d=>n("update:modelValue",d)),class:"j-field"},null,8,["variant","type","density","rules","value"])),s.readonly?(c.openBlock(),c.createBlock(iy,{key:3,value:s.modelValue},null,8,["value"])):c.createCommentVNode("",!0)]))}}),l1={class:"text-faded mt-7"},u1={class:"d-flex align-baseline mb-1"},d1={class:"me-1"},h1={class:"max-w-_form-metadataJ"},f1={key:0,class:"mb-1"},g1={key:1,class:"mb-1"},m1={class:"mb-1"},kc=c.defineComponent({__name:"FormMetadata",props:{meta:{},id:{}},setup(r){return(e,t)=>(c.openBlock(),c.createElementBlock("div",l1,[c.createVNode(Oe.VRow,{"no-gutters":"",class:"align-end ga-3",align:"center"},{default:c.withCtx(()=>[c.renderSlot(e.$slots,"default"),e.id?(c.openBlock(),c.createBlock(Oe.VCol,{key:0,cols:"auto",class:"pa-2"},{default:c.withCtx(()=>[c.createElementVNode("p",u1,[c.createElementVNode("b",d1,c.toDisplayString(e.id.title)+": ",1),c.createElementVNode("span",h1,c.toDisplayString(e.id.key||"-"),1),c.createElementVNode("span",null,[c.createVNode(yc,{"content-to-copy":e.id.key,size:15},null,8,["content-to-copy"])])]),c.createElementVNode("p",null,[t[0]||(t[0]=c.createElementVNode("b",null,"Created: ",-1)),c.createTextVNode(c.toDisplayString(e.meta.created_at)+" - "+c.toDisplayString(e.meta.created_by),1)])]),_:1})):c.createCommentVNode("",!0),c.createVNode(Oe.VCol,{cols:"auto",class:"d-flex flex-column align-baseline px-2 mt-1"},{default:c.withCtx(()=>[e.meta.updated_at&&e.meta.updated_by?(c.openBlock(),c.createElementBlock("p",f1,[t[1]||(t[1]=c.createElementVNode("b",null,"Updated:  ",-1)),c.createTextVNode(c.toDisplayString(e.meta.updated_at)+" - "+c.toDisplayString(e.meta.updated_by),1)])):(c.openBlock(),c.createElementBlock("p",g1,[t[2]||(t[2]=c.createElementVNode("b",null,"Modified:  ",-1)),c.createTextVNode(c.toDisplayString(e.meta.modified_at)+" - "+c.toDisplayString(e.meta.modified_by),1)])),c.createElementVNode("p",m1,[t[3]||(t[3]=c.createElementVNode("b",null,"Delegated: ",-1)),c.createTextVNode(c.toDisplayString(e.meta.delegated_at)+" - "+c.toDisplayString(e.meta.delegated_by),1)])]),_:1})]),_:3})]))}}),p1={key:0,class:"mb-2 ms-1"},sy=c.defineComponent({__name:"JSelect",props:{modelValue:{},name:{},label:{},placeholder:{},readonly:{type:Boolean},items:{},itemTitle:{},itemValue:{},density:{},loading:{type:Boolean},clearable:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,i=c.computed(()=>t.readonly?"solo":"solo-filled"),s=c.computed(()=>{if(Array.isArray(t.items)&&t.items.length>0)if(typeof t.items[0]=="object"&&t.itemValue&&t.itemTitle){const d=t.items.find(f=>f[t.itemValue]===t.modelValue);return d?d[t.itemTitle]:""}else{const d=t.items.indexOf(t.modelValue);return d!==-1?t.items[d]:""}return""}),l=d=>{n("update:modelValue",d)};return(d,f)=>(c.openBlock(),c.createElementBlock(c.Fragment,null,[d.name?(c.openBlock(),c.createElementBlock("p",p1,c.toDisplayString(d.name),1)):c.createCommentVNode("",!0),d.label?(c.openBlock(),c.createBlock(ua.VLabel,{key:1,class:"text-subtitle-1 text-high-emphasis mb-2"},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(d.label),1)]),_:1})):c.createCommentVNode("",!0),d.readonly?(c.openBlock(),c.createBlock(iy,{key:3,value:s.value},null,8,["value"])):(c.openBlock(),c.createBlock(c.unref(zr.VSelect),{key:2,modelValue:t.modelValue,"onUpdate:modelValue":[f[0]||(f[0]=g=>t.modelValue=g),l],variant:i.value,items:d.items,"item-title":d.itemTitle,"item-value":d.itemValue,loading:d.loading,placeholder:d.placeholder,density:d.density,"bg-color":"containerBg",rounded:"false","hide-details":"",class:"j-field",clearable:d.clearable},null,8,["modelValue","variant","items","item-title","item-value","loading","placeholder","density","clearable"]))],64))}}),v1={key:0,class:"mb-2 ms-1"},y1={key:3,class:"j-textarea px-4 py-3 rounded-sm bg-containerBg"},cy=c.defineComponent({__name:"JTextArea",props:{modelValue:{},name:{},label:{},readonly:{type:Boolean},rows:{},hideDetails:{type:Boolean}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,i=c.computed(()=>t.readonly?"solo":"solo-filled");return(s,l)=>(c.openBlock(),c.createElementBlock(c.Fragment,null,[s.name?(c.openBlock(),c.createElementBlock("p",v1,c.toDisplayString(s.name),1)):c.createCommentVNode("",!0),s.label?(c.openBlock(),c.createBlock(ua.VLabel,{key:1,class:"text-subtitle-1 text-high-emphasis mb-2"},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(s.label),1)]),_:1})):c.createCommentVNode("",!0),s.readonly?c.createCommentVNode("",!0):(c.openBlock(),c.createBlock(Sk.VTextarea,{key:2,variant:i.value,"bg-color":"containerBg",rounded:"false",rows:s.rows,hideDetails:s.hideDetails,value:s.modelValue,"onUpdate:modelValue":l[0]||(l[0]=d=>n("update:modelValue",d)),"no-resize":""},null,8,["variant","rows","hideDetails","value"])),s.readonly?(c.openBlock(),c.createElementBlock("div",y1,c.toDisplayString(s.modelValue),1)):c.createCommentVNode("",!0)],64))}}),ly=c.defineComponent({__name:"CancelButton",props:{title:{}},emits:["cancel"],setup(r,{emit:e}){const t=e;return(n,i)=>(c.openBlock(),c.createBlock(Be.VBtn,{color:"secondary",variant:"outlined",onClick:i[0]||(i[0]=s=>t("cancel")),class:"me-2 j-btn-form"},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(n.title?"Cancel":"Back"),1)]),_:1}))}}),uy=c.defineComponent({__name:"SaveButton",props:{disabled:{type:Boolean}},emits:["onSave"],setup(r,{emit:e}){const t=e,n=c.ref(!1);async function i(){n.value=!0,await t("onSave"),n.value=!1}return(s,l)=>(c.openBlock(),c.createBlock(Be.VBtn,{disabled:s.disabled,loading:n.value,color:"secondary",onClick:i,onKeydown:c.withKeys(i,["enter"]),class:"j-btn-form"},{default:c.withCtx(()=>l[0]||(l[0]=[c.createTextVNode(" Save ")])),_:1},8,["disabled","loading"]))}}),C1={class:"mt-4"},dy=c.defineComponent({__name:"JForm",props:{title:{},metadata:{},id:{},cancelReturn:{type:Boolean}},emits:["onSave","onCancel"],setup(r,{emit:e}){const t=e;return(n,i)=>(c.openBlock(),c.createBlock(Ec,{title:n.title,class:"d-flex flex-column ma-0"},{default:c.withCtx(()=>[n.title?(c.openBlock(),c.createBlock(fo.VDivider,{key:0})):c.createCommentVNode("",!0),c.createElementVNode("div",C1,[c.renderSlot(n.$slots,"default")]),c.createVNode(lt.VCardText,{class:"pa-0 mx-0 align-content-end"},{default:c.withCtx(()=>[c.createVNode(Oe.VRow,{justify:"space-between",class:"mt-4"},{default:c.withCtx(()=>[c.createVNode(Oe.VCol,{cols:"auto",class:"text-sm-subtitle-2 text-medium-emphasis"},{default:c.withCtx(()=>[c.createVNode(kc,{id:n.id,meta:n.metadata},null,8,["id","meta"])]),_:1}),c.createVNode(Oe.VSpacer),c.createVNode(Oe.VCol,{cols:"auto",class:"align-content-end"},{default:c.withCtx(()=>[c.createVNode(ly,{"cancel-return":n.cancelReturn,onCancel:i[0]||(i[0]=s=>t("onCancel"))},null,8,["cancel-return"]),c.createVNode(uy,{onOnSave:i[1]||(i[1]=s=>t("onSave"))})]),_:1})]),_:1})]),_:1})]),_:3},8,["title"]))}}),w1={class:"d-flex align-items-center"},_1={key:0,class:"d-flex align-center"},T1={class:"ms-1"},E1={class:"d-flex"},S1={class:"d-flex mb-1 align-center"},A1={class:"min-w-100 relative"},hy=c.defineComponent({__name:"TabFormHeader",props:{id:{},readonly:{type:Boolean,default:!1}},emits:["update:isEdition","save","cancel","delete","disable"],setup(r,{emit:e}){var g;const t=r,n=e,i=c.getCurrentInstance(),s=((g=i==null?void 0:i.vnode.props)==null?void 0:g.onDisable)!==void 0,l=c.ref(t.readonly);function d(){l.value=!l.value,n("update:isEdition",l.value)}async function f(){n("delete"),n("disable")}return(m,C)=>(c.openBlock(),c.createElementBlock("div",w1,[m.id?(c.openBlock(),c.createElementBlock("div",_1,[C[0]||(C[0]=c.createElementVNode("b",null,"ID:",-1)),c.createElementVNode("span",T1,c.toDisplayString(m.id),1),c.createVNode(yc,{"content-to-copy":m.id,size:20},null,8,["content-to-copy"])])):c.createCommentVNode("",!0),c.createVNode(Oe.VSpacer),c.createElementVNode("div",E1,[c.createVNode(Be.VBtn,{onClick:f,variant:"text"},{default:c.withCtx(()=>[s?(c.openBlock(),c.createBlock(c.unref(a0),{key:0,size:"11",class:"me-2"})):c.createCommentVNode("",!0),c.createVNode(Xs.VIcon,{class:"me-2"},{default:c.withCtx(()=>C[1]||(C[1]=[c.createTextVNode("mdi-delete-outline")])),_:1}),c.createTextVNode(" "+c.toDisplayString(s?"Disable":"Delete"),1)]),_:1}),c.createElementVNode("div",S1,[c.createVNode(fo.VDivider,{class:"mx-2 my-1",vertical:""}),c.createElementVNode("div",A1,[c.withDirectives(c.createVNode(Be.VBtn,{onClick:d,variant:"text",color:"secondary","prepend-icon":"mdi-pencil",width:"95"},{default:c.withCtx(()=>C[2]||(C[2]=[c.createTextVNode(" Edit ")])),_:1},512),[[c.vShow,!l.value]]),c.withDirectives(c.createVNode(Be.VBtn,{onClick:d,variant:"text",color:"secondary",width:"95"},{default:c.withCtx(()=>[c.createVNode(Xs.VIcon,{class:"pt-1 pe-2"},{default:c.withCtx(()=>C[3]||(C[3]=[c.createTextVNode("mdi-close")])),_:1}),C[4]||(C[4]=c.createTextVNode(" Cancel "))]),_:1},512),[[c.vShow,l.value]])])])])]))}}),b1={class:"d-flex flex-column"},I1={class:"height d-flex flex-column"},k1={class:"d-flex justify-between align-end"},R1=c.defineComponent({__name:"FormHeadless",props:{id:{},metadata:{},readonly:{type:Boolean,default:!1}},emits:["onSave","onCancel"],setup(r,{emit:e}){const t=e,n=c.useAttrs();return(i,s)=>(c.openBlock(),c.createBlock(Ec,null,{default:c.withCtx(()=>[c.createElementVNode("div",b1,[c.createElementVNode("div",I1,[c.renderSlot(i.$slots,"default",{},void 0,!0)])]),c.createElementVNode("div",k1,[c.createVNode(Oe.VRow,{"no-gutters":"",justify:"space-between",class:"w-100"},{default:c.withCtx(()=>[c.createVNode(Oe.VCol,{cols:"auto",class:"text-sm-subtitle-2 text-medium-emphasis"},{default:c.withCtx(()=>[c.createVNode(kc,{id:i.id,meta:i.metadata},null,8,["id","meta"])]),_:1}),i.readonly?c.createCommentVNode("",!0):(c.openBlock(),c.createBlock(Oe.VCol,{key:0,class:"d-flex align-end",cols:"auto"},{default:c.withCtx(()=>["onCancel"in c.unref(n)?(c.openBlock(),c.createBlock(ly,{key:0,title:"Back",onCancel:s[0]||(s[0]=l=>t("onCancel"))})):c.createCommentVNode("",!0),"onSave"in c.unref(n)?(c.openBlock(),c.createBlock(uy,{key:1,onOnSave:s[1]||(s[1]=l=>t("onSave"))})):c.createCommentVNode("",!0)]),_:1}))]),_:1})])]),_:3}))}}),fy=vi(R1,[["__scopeId","data-v-489d31c3"]]);/**
20
+ */function Dm(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function nr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Dm(Object(t),!0).forEach(function(n){gP(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Dm(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Ks(r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ks=function(e){return typeof e}:Ks=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ks(r)}function gP(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Tr(){return Tr=Object.assign||function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},Tr.apply(this,arguments)}function mP(r,e){if(r==null)return{};var t={},n=Object.keys(r),i,s;for(s=0;s<n.length;s++)i=n[s],!(e.indexOf(i)>=0)&&(t[i]=r[i]);return t}function pP(r,e){if(r==null)return{};var t=mP(r,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(r);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}var vP="1.14.0";function wr(r){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(r)}var Sr=wr(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),wa=wr(/Edge/i),Lm=wr(/firefox/i),na=wr(/safari/i)&&!wr(/chrome/i)&&!wr(/android/i),qv=wr(/iP(ad|od|hone)/i),yP=wr(/chrome/i)&&wr(/android/i),Wv={capture:!1,passive:!1};function Se(r,e,t){r.addEventListener(e,t,!Sr&&Wv)}function Ce(r,e,t){r.removeEventListener(e,t,!Sr&&Wv)}function tc(r,e){if(e){if(e[0]===">"&&(e=e.substring(1)),r)try{if(r.matches)return r.matches(e);if(r.msMatchesSelector)return r.msMatchesSelector(e);if(r.webkitMatchesSelector)return r.webkitMatchesSelector(e)}catch{return!1}return!1}}function CP(r){return r.host&&r!==document&&r.host.nodeType?r.host:r.parentNode}function jn(r,e,t,n){if(r){t=t||document;do{if(e!=null&&(e[0]===">"?r.parentNode===t&&tc(r,e):tc(r,e))||n&&r===t)return r;if(r===t)break}while(r=CP(r))}return null}var Bm=/\s+/g;function jt(r,e,t){if(r&&e)if(r.classList)r.classList[t?"add":"remove"](e);else{var n=(" "+r.className+" ").replace(Bm," ").replace(" "+e+" "," ");r.className=(n+(t?" "+e:"")).replace(Bm," ")}}function re(r,e,t){var n=r&&r.style;if(n){if(t===void 0)return document.defaultView&&document.defaultView.getComputedStyle?t=document.defaultView.getComputedStyle(r,""):r.currentStyle&&(t=r.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 ci(r,e){var t="";if(typeof r=="string")t=r;else do{var n=re(r,"transform");n&&n!=="none"&&(t=n+" "+t)}while(!e&&(r=r.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(t)}function Gv(r,e,t){if(r){var n=r.getElementsByTagName(e),i=0,s=n.length;if(t)for(;i<s;i++)t(n[i],i);return n}return[]}function er(){var r=document.scrollingElement;return r||document.documentElement}function ot(r,e,t,n,i){if(!(!r.getBoundingClientRect&&r!==window)){var s,l,d,f,g,m,C;if(r!==window&&r.parentNode&&r!==er()?(s=r.getBoundingClientRect(),l=s.top,d=s.left,f=s.bottom,g=s.right,m=s.height,C=s.width):(l=0,d=0,f=window.innerHeight,g=window.innerWidth,m=window.innerHeight,C=window.innerWidth),(e||t)&&r!==window&&(i=i||r.parentNode,!Sr))do if(i&&i.getBoundingClientRect&&(re(i,"transform")!=="none"||t&&re(i,"position")!=="static")){var v=i.getBoundingClientRect();l-=v.top+parseInt(re(i,"border-top-width")),d-=v.left+parseInt(re(i,"border-left-width")),f=l+s.height,g=d+s.width;break}while(i=i.parentNode);if(n&&r!==window){var E=ci(i||r),_=E&&E.a,A=E&&E.d;E&&(l/=A,d/=_,C/=_,m/=A,f=l+m,g=d+C)}return{top:l,left:d,bottom:f,right:g,width:C,height:m}}}function Um(r,e,t){for(var n=Kr(r,!0),i=ot(r)[e];n;){var s=ot(n)[t],l=void 0;if(l=i>=s,!l)return n;if(n===er())break;n=Kr(n,!1)}return!1}function hi(r,e,t,n){for(var i=0,s=0,l=r.children;s<l.length;){if(l[s].style.display!=="none"&&l[s]!==oe.ghost&&(n||l[s]!==oe.dragged)&&jn(l[s],t.draggable,r,!1)){if(i===e)return l[s];i++}s++}return null}function Vd(r,e){for(var t=r.lastElementChild;t&&(t===oe.ghost||re(t,"display")==="none"||e&&!tc(t,e));)t=t.previousElementSibling;return t||null}function Tn(r,e){var t=0;if(!r||!r.parentNode)return-1;for(;r=r.previousElementSibling;)r.nodeName.toUpperCase()!=="TEMPLATE"&&r!==oe.clone&&(!e||tc(r,e))&&t++;return t}function Vm(r){var e=0,t=0,n=er();if(r)do{var i=ci(r),s=i.a,l=i.d;e+=r.scrollLeft*s,t+=r.scrollTop*l}while(r!==n&&(r=r.parentNode));return[e,t]}function wP(r,e){for(var t in r)if(r.hasOwnProperty(t)){for(var n in e)if(e.hasOwnProperty(n)&&e[n]===r[t][n])return Number(t)}return-1}function Kr(r,e){if(!r||!r.getBoundingClientRect)return er();var t=r,n=!1;do if(t.clientWidth<t.scrollWidth||t.clientHeight<t.scrollHeight){var i=re(t);if(t.clientWidth<t.scrollWidth&&(i.overflowX=="auto"||i.overflowX=="scroll")||t.clientHeight<t.scrollHeight&&(i.overflowY=="auto"||i.overflowY=="scroll")){if(!t.getBoundingClientRect||t===document.body)return er();if(n||e)return t;n=!0}}while(t=t.parentNode);return er()}function _P(r,e){if(r&&e)for(var t in e)e.hasOwnProperty(t)&&(r[t]=e[t]);return r}function Tu(r,e){return Math.round(r.top)===Math.round(e.top)&&Math.round(r.left)===Math.round(e.left)&&Math.round(r.height)===Math.round(e.height)&&Math.round(r.width)===Math.round(e.width)}var ra;function jv(r,e){return function(){if(!ra){var t=arguments,n=this;t.length===1?r.call(n,t[0]):r.apply(n,t),ra=setTimeout(function(){ra=void 0},e)}}}function TP(){clearTimeout(ra),ra=void 0}function Yv(r,e,t){r.scrollLeft+=e,r.scrollTop+=t}function Jv(r){var e=window.Polymer,t=window.jQuery||window.Zepto;return e&&e.dom?e.dom(r).cloneNode(!0):t?t(r).clone(!0)[0]:r.cloneNode(!0)}var tn="Sortable"+new Date().getTime();function EP(){var r=[],e;return{captureAnimationState:function(){if(r=[],!!this.options.animation){var n=[].slice.call(this.el.children);n.forEach(function(i){if(!(re(i,"display")==="none"||i===oe.ghost)){r.push({target:i,rect:ot(i)});var s=nr({},r[r.length-1].rect);if(i.thisAnimationDuration){var l=ci(i,!0);l&&(s.top-=l.f,s.left-=l.e)}i.fromRect=s}})}},addAnimationState:function(n){r.push(n)},removeAnimationState:function(n){r.splice(wP(r,{target:n}),1)},animateAll:function(n){var i=this;if(!this.options.animation){clearTimeout(e),typeof n=="function"&&n();return}var s=!1,l=0;r.forEach(function(d){var f=0,g=d.target,m=g.fromRect,C=ot(g),v=g.prevFromRect,E=g.prevToRect,_=d.rect,A=ci(g,!0);A&&(C.top-=A.f,C.left-=A.e),g.toRect=C,g.thisAnimationDuration&&Tu(v,C)&&!Tu(m,C)&&(_.top-C.top)/(_.left-C.left)===(m.top-C.top)/(m.left-C.left)&&(f=AP(_,v,E,i.options)),Tu(C,m)||(g.prevFromRect=m,g.prevToRect=C,f||(f=i.options.animation),i.animate(g,_,C,f)),f&&(s=!0,l=Math.max(l,f),clearTimeout(g.animationResetTimer),g.animationResetTimer=setTimeout(function(){g.animationTime=0,g.prevFromRect=null,g.fromRect=null,g.prevToRect=null,g.thisAnimationDuration=null},f),g.thisAnimationDuration=f)}),clearTimeout(e),s?e=setTimeout(function(){typeof n=="function"&&n()},l):typeof n=="function"&&n(),r=[]},animate:function(n,i,s,l){if(l){re(n,"transition",""),re(n,"transform","");var d=ci(this.el),f=d&&d.a,g=d&&d.d,m=(i.left-s.left)/(f||1),C=(i.top-s.top)/(g||1);n.animatingX=!!m,n.animatingY=!!C,re(n,"transform","translate3d("+m+"px,"+C+"px,0)"),this.forRepaintDummy=SP(n),re(n,"transition","transform "+l+"ms"+(this.options.easing?" "+this.options.easing:"")),re(n,"transform","translate3d(0,0,0)"),typeof n.animated=="number"&&clearTimeout(n.animated),n.animated=setTimeout(function(){re(n,"transition",""),re(n,"transform",""),n.animated=!1,n.animatingX=!1,n.animatingY=!1},l)}}}}function SP(r){return r.offsetWidth}function AP(r,e,t,n){return Math.sqrt(Math.pow(e.top-r.top,2)+Math.pow(e.left-r.left,2))/Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))*n.animation}var $o=[],Eu={initializeByDefault:!0},_a={mount:function(e){for(var t in Eu)Eu.hasOwnProperty(t)&&!(t in e)&&(e[t]=Eu[t]);$o.forEach(function(n){if(n.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),$o.push(e)},pluginEvent:function(e,t,n){var i=this;this.eventCanceled=!1,n.cancel=function(){i.eventCanceled=!0};var s=e+"Global";$o.forEach(function(l){t[l.pluginName]&&(t[l.pluginName][s]&&t[l.pluginName][s](nr({sortable:t},n)),t.options[l.pluginName]&&t[l.pluginName][e]&&t[l.pluginName][e](nr({sortable:t},n)))})},initializePlugins:function(e,t,n,i){$o.forEach(function(d){var f=d.pluginName;if(!(!e.options[f]&&!d.initializeByDefault)){var g=new d(e,t,e.options);g.sortable=e,g.options=e.options,e[f]=g,Tr(n,g.defaults)}});for(var s in e.options)if(e.options.hasOwnProperty(s)){var l=this.modifyOption(e,s,e.options[s]);typeof l<"u"&&(e.options[s]=l)}},getEventProperties:function(e,t){var n={};return $o.forEach(function(i){typeof i.eventProperties=="function"&&Tr(n,i.eventProperties.call(t[i.pluginName],e))}),n},modifyOption:function(e,t,n){var i;return $o.forEach(function(s){e[s.pluginName]&&s.optionListeners&&typeof s.optionListeners[t]=="function"&&(i=s.optionListeners[t].call(e[s.pluginName],n))}),i}};function bP(r){var e=r.sortable,t=r.rootEl,n=r.name,i=r.targetEl,s=r.cloneEl,l=r.toEl,d=r.fromEl,f=r.oldIndex,g=r.newIndex,m=r.oldDraggableIndex,C=r.newDraggableIndex,v=r.originalEvent,E=r.putSortable,_=r.extraEventProperties;if(e=e||t&&t[tn],!!e){var A,N=e.options,K="on"+n.charAt(0).toUpperCase()+n.substr(1);window.CustomEvent&&!Sr&&!wa?A=new CustomEvent(n,{bubbles:!0,cancelable:!0}):(A=document.createEvent("Event"),A.initEvent(n,!0,!0)),A.to=l||t,A.from=d||t,A.item=i||t,A.clone=s,A.oldIndex=f,A.newIndex=g,A.oldDraggableIndex=m,A.newDraggableIndex=C,A.originalEvent=v,A.pullMode=E?E.lastPutMode:void 0;var V=nr(nr({},_),_a.getEventProperties(n,e));for(var U in V)A[U]=V[U];t&&t.dispatchEvent(A),N[K]&&N[K].call(e,A)}}var IP=["evt"],Ut=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=n.evt,s=pP(n,IP);_a.pluginEvent.bind(oe)(e,t,nr({dragEl:H,parentEl:We,ghostEl:le,rootEl:Fe,nextEl:co,lastDownEl:zs,cloneEl:Ge,cloneHidden:Ur,dragStarted:Ji,putSortable:vt,activeSortable:oe.active,originalEvent:i,oldIndex:oi,oldDraggableIndex:oa,newIndex:Yt,newDraggableIndex:Br,hideGhostForTarget:ey,unhideGhostForTarget:ty,cloneNowHidden:function(){Ur=!0},cloneNowShown:function(){Ur=!1},dispatchSortableEvent:function(d){Pt({sortable:t,name:d,originalEvent:i})}},s))};function Pt(r){bP(nr({putSortable:vt,cloneEl:Ge,targetEl:H,rootEl:Fe,oldIndex:oi,oldDraggableIndex:oa,newIndex:Yt,newDraggableIndex:Br},r))}var H,We,le,Fe,co,zs,Ge,Ur,oi,Yt,oa,Br,_s,vt,Qo=!1,nc=!1,rc=[],oo,Pn,Su,Au,Fm,Hm,Ji,Ko,ia,aa=!1,Ts=!1,qs,Et,bu=[],nd=!1,oc=[],Ic=typeof document<"u",Es=qv,$m=wa||Sr?"cssFloat":"float",kP=Ic&&!yP&&!qv&&"draggable"in document.createElement("div"),Qv=function(){if(Ic){if(Sr)return!1;var r=document.createElement("x");return r.style.cssText="pointer-events:auto",r.style.pointerEvents==="auto"}}(),Xv=function(e,t){var n=re(e),i=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),s=hi(e,0,t),l=hi(e,1,t),d=s&&re(s),f=l&&re(l),g=d&&parseInt(d.marginLeft)+parseInt(d.marginRight)+ot(s).width,m=f&&parseInt(f.marginLeft)+parseInt(f.marginRight)+ot(l).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(s&&d.float&&d.float!=="none"){var C=d.float==="left"?"left":"right";return l&&(f.clear==="both"||f.clear===C)?"vertical":"horizontal"}return s&&(d.display==="block"||d.display==="flex"||d.display==="table"||d.display==="grid"||g>=i&&n[$m]==="none"||l&&n[$m]==="none"&&g+m>i)?"vertical":"horizontal"},RP=function(e,t,n){var i=n?e.left:e.top,s=n?e.right:e.bottom,l=n?e.width:e.height,d=n?t.left:t.top,f=n?t.right:t.bottom,g=n?t.width:t.height;return i===d||s===f||i+l/2===d+g/2},NP=function(e,t){var n;return rc.some(function(i){var s=i[tn].options.emptyInsertThreshold;if(!(!s||Vd(i))){var l=ot(i),d=e>=l.left-s&&e<=l.right+s,f=t>=l.top-s&&t<=l.bottom+s;if(d&&f)return n=i}}),n},Zv=function(e){function t(s,l){return function(d,f,g,m){var C=d.options.group.name&&f.options.group.name&&d.options.group.name===f.options.group.name;if(s==null&&(l||C))return!0;if(s==null||s===!1)return!1;if(l&&s==="clone")return s;if(typeof s=="function")return t(s(d,f,g,m),l)(d,f,g,m);var v=(l?d:f).options.group.name;return s===!0||typeof s=="string"&&s===v||s.join&&s.indexOf(v)>-1}}var n={},i=e.group;(!i||Ks(i)!="object")&&(i={name:i}),n.name=i.name,n.checkPull=t(i.pull,!0),n.checkPut=t(i.put),n.revertClone=i.revertClone,e.group=n},ey=function(){!Qv&&le&&re(le,"display","none")},ty=function(){!Qv&&le&&re(le,"display","")};Ic&&document.addEventListener("click",function(r){if(nc)return r.preventDefault(),r.stopPropagation&&r.stopPropagation(),r.stopImmediatePropagation&&r.stopImmediatePropagation(),nc=!1,!1},!0);var io=function(e){if(H){e=e.touches?e.touches[0]:e;var t=NP(e.clientX,e.clientY);if(t){var n={};for(var i in e)e.hasOwnProperty(i)&&(n[i]=e[i]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[tn]._onDragOver(n)}}},OP=function(e){H&&H.parentNode[tn]._isOutsideThisEl(e.target)};function oe(r,e){if(!(r&&r.nodeType&&r.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(r));this.el=r,this.options=e=Tr({},e),r[tn]=this;var t={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(r.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Xv(r,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(l,d){l.setData("Text",d.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:oe.supportPointer!==!1&&"PointerEvent"in window&&!na,emptyInsertThreshold:5};_a.initializePlugins(this,r,t);for(var n in t)!(n in e)&&(e[n]=t[n]);Zv(e);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=e.forceFallback?!1:kP,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?Se(r,"pointerdown",this._onTapStart):(Se(r,"mousedown",this._onTapStart),Se(r,"touchstart",this._onTapStart)),this.nativeDraggable&&(Se(r,"dragover",this),Se(r,"dragenter",this)),rc.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),Tr(this,EP())}oe.prototype={constructor:oe,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(Ko=null)},_getDirection:function(e,t){return typeof this.options.direction=="function"?this.options.direction.call(this,e,t,H):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,i=this.options,s=i.preventOnFilter,l=e.type,d=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,f=(d||e).target,g=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||f,m=i.filter;if(VP(n),!H&&!(/mousedown|pointerdown/.test(l)&&e.button!==0||i.disabled)&&!g.isContentEditable&&!(!this.nativeDraggable&&na&&f&&f.tagName.toUpperCase()==="SELECT")&&(f=jn(f,i.draggable,n,!1),!(f&&f.animated)&&zs!==f)){if(oi=Tn(f),oa=Tn(f,i.draggable),typeof m=="function"){if(m.call(this,e,f,this)){Pt({sortable:t,rootEl:g,name:"filter",targetEl:f,toEl:n,fromEl:n}),Ut("filter",t,{evt:e}),s&&e.cancelable&&e.preventDefault();return}}else if(m&&(m=m.split(",").some(function(C){if(C=jn(g,C.trim(),n,!1),C)return Pt({sortable:t,rootEl:C,name:"filter",targetEl:f,fromEl:n,toEl:n}),Ut("filter",t,{evt:e}),!0}),m)){s&&e.cancelable&&e.preventDefault();return}i.handle&&!jn(g,i.handle,n,!1)||this._prepareDragStart(e,d,f)}}},_prepareDragStart:function(e,t,n){var i=this,s=i.el,l=i.options,d=s.ownerDocument,f;if(n&&!H&&n.parentNode===s){var g=ot(n);if(Fe=s,H=n,We=H.parentNode,co=H.nextSibling,zs=n,_s=l.group,oe.dragged=H,oo={target:H,clientX:(t||e).clientX,clientY:(t||e).clientY},Fm=oo.clientX-g.left,Hm=oo.clientY-g.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,H.style["will-change"]="all",f=function(){if(Ut("delayEnded",i,{evt:e}),oe.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!Lm&&i.nativeDraggable&&(H.draggable=!0),i._triggerDragStart(e,t),Pt({sortable:i,name:"choose",originalEvent:e}),jt(H,l.chosenClass,!0)},l.ignore.split(",").forEach(function(m){Gv(H,m.trim(),Iu)}),Se(d,"dragover",io),Se(d,"mousemove",io),Se(d,"touchmove",io),Se(d,"mouseup",i._onDrop),Se(d,"touchend",i._onDrop),Se(d,"touchcancel",i._onDrop),Lm&&this.nativeDraggable&&(this.options.touchStartThreshold=4,H.draggable=!0),Ut("delayStart",this,{evt:e}),l.delay&&(!l.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(wa||Sr))){if(oe.eventCanceled){this._onDrop();return}Se(d,"mouseup",i._disableDelayedDrag),Se(d,"touchend",i._disableDelayedDrag),Se(d,"touchcancel",i._disableDelayedDrag),Se(d,"mousemove",i._delayedDragTouchMoveHandler),Se(d,"touchmove",i._delayedDragTouchMoveHandler),l.supportPointer&&Se(d,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(f,l.delay)}else f()}},_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(){H&&Iu(H),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;Ce(e,"mouseup",this._disableDelayedDrag),Ce(e,"touchend",this._disableDelayedDrag),Ce(e,"touchcancel",this._disableDelayedDrag),Ce(e,"mousemove",this._delayedDragTouchMoveHandler),Ce(e,"touchmove",this._delayedDragTouchMoveHandler),Ce(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||e.pointerType=="touch"&&e,!this.nativeDraggable||t?this.options.supportPointer?Se(document,"pointermove",this._onTouchMove):t?Se(document,"touchmove",this._onTouchMove):Se(document,"mousemove",this._onTouchMove):(Se(H,"dragend",this),Se(Fe,"dragstart",this._onDragStart));try{document.selection?Ws(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(Qo=!1,Fe&&H){Ut("dragStarted",this,{evt:t}),this.nativeDraggable&&Se(document,"dragover",OP);var n=this.options;!e&&jt(H,n.dragClass,!1),jt(H,n.ghostClass,!0),oe.active=this,e&&this._appendGhost(),Pt({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(Pn){this._lastX=Pn.clientX,this._lastY=Pn.clientY,ey();for(var e=document.elementFromPoint(Pn.clientX,Pn.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(Pn.clientX,Pn.clientY),e!==t);)t=e;if(H.parentNode[tn]._isOutsideThisEl(e),t)do{if(t[tn]){var n=void 0;if(n=t[tn]._onDragOver({clientX:Pn.clientX,clientY:Pn.clientY,target:e,rootEl:t}),n&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);ty()}},_onTouchMove:function(e){if(oo){var t=this.options,n=t.fallbackTolerance,i=t.fallbackOffset,s=e.touches?e.touches[0]:e,l=le&&ci(le,!0),d=le&&l&&l.a,f=le&&l&&l.d,g=Es&&Et&&Vm(Et),m=(s.clientX-oo.clientX+i.x)/(d||1)+(g?g[0]-bu[0]:0)/(d||1),C=(s.clientY-oo.clientY+i.y)/(f||1)+(g?g[1]-bu[1]:0)/(f||1);if(!oe.active&&!Qo){if(n&&Math.max(Math.abs(s.clientX-this._lastX),Math.abs(s.clientY-this._lastY))<n)return;this._onDragStart(e,!0)}if(le){l?(l.e+=m-(Su||0),l.f+=C-(Au||0)):l={a:1,b:0,c:0,d:1,e:m,f:C};var v="matrix(".concat(l.a,",").concat(l.b,",").concat(l.c,",").concat(l.d,",").concat(l.e,",").concat(l.f,")");re(le,"webkitTransform",v),re(le,"mozTransform",v),re(le,"msTransform",v),re(le,"transform",v),Su=m,Au=C,Pn=s}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!le){var e=this.options.fallbackOnBody?document.body:Fe,t=ot(H,!0,Es,!0,e),n=this.options;if(Es){for(Et=e;re(Et,"position")==="static"&&re(Et,"transform")==="none"&&Et!==document;)Et=Et.parentNode;Et!==document.body&&Et!==document.documentElement?(Et===document&&(Et=er()),t.top+=Et.scrollTop,t.left+=Et.scrollLeft):Et=er(),bu=Vm(Et)}le=H.cloneNode(!0),jt(le,n.ghostClass,!1),jt(le,n.fallbackClass,!0),jt(le,n.dragClass,!0),re(le,"transition",""),re(le,"transform",""),re(le,"box-sizing","border-box"),re(le,"margin",0),re(le,"top",t.top),re(le,"left",t.left),re(le,"width",t.width),re(le,"height",t.height),re(le,"opacity","0.8"),re(le,"position",Es?"absolute":"fixed"),re(le,"zIndex","100000"),re(le,"pointerEvents","none"),oe.ghost=le,e.appendChild(le),re(le,"transform-origin",Fm/parseInt(le.style.width)*100+"% "+Hm/parseInt(le.style.height)*100+"%")}},_onDragStart:function(e,t){var n=this,i=e.dataTransfer,s=n.options;if(Ut("dragStart",this,{evt:e}),oe.eventCanceled){this._onDrop();return}Ut("setupClone",this),oe.eventCanceled||(Ge=Jv(H),Ge.draggable=!1,Ge.style["will-change"]="",this._hideClone(),jt(Ge,this.options.chosenClass,!1),oe.clone=Ge),n.cloneId=Ws(function(){Ut("clone",n),!oe.eventCanceled&&(n.options.removeCloneOnHide||Fe.insertBefore(Ge,H),n._hideClone(),Pt({sortable:n,name:"clone"}))}),!t&&jt(H,s.dragClass,!0),t?(nc=!0,n._loopId=setInterval(n._emulateDragOver,50)):(Ce(document,"mouseup",n._onDrop),Ce(document,"touchend",n._onDrop),Ce(document,"touchcancel",n._onDrop),i&&(i.effectAllowed="move",s.setData&&s.setData.call(n,i,H)),Se(document,"drop",n),re(H,"transform","translateZ(0)")),Qo=!0,n._dragStartId=Ws(n._dragStarted.bind(n,t,e)),Se(document,"selectstart",n),Ji=!0,na&&re(document.body,"user-select","none")},_onDragOver:function(e){var t=this.el,n=e.target,i,s,l,d=this.options,f=d.group,g=oe.active,m=_s===f,C=d.sort,v=vt||g,E,_=this,A=!1;if(nd)return;function N(at,wt){Ut(at,_,nr({evt:e,isOwner:m,axis:E?"vertical":"horizontal",revert:l,dragRect:i,targetRect:s,canSort:C,fromSortable:v,target:n,completed:V,onMove:function(Ht,Yc){return Ss(Fe,t,H,i,Ht,ot(Ht),e,Yc)},changed:U},wt))}function K(){N("dragOverAnimationCapture"),_.captureAnimationState(),_!==v&&v.captureAnimationState()}function V(at){return N("dragOverCompleted",{insertion:at}),at&&(m?g._hideClone():g._showClone(_),_!==v&&(jt(H,vt?vt.options.ghostClass:g.options.ghostClass,!1),jt(H,d.ghostClass,!0)),vt!==_&&_!==oe.active?vt=_:_===oe.active&&vt&&(vt=null),v===_&&(_._ignoreWhileAnimating=n),_.animateAll(function(){N("dragOverAnimationComplete"),_._ignoreWhileAnimating=null}),_!==v&&(v.animateAll(),v._ignoreWhileAnimating=null)),(n===H&&!H.animated||n===t&&!n.animated)&&(Ko=null),!d.dragoverBubble&&!e.rootEl&&n!==document&&(H.parentNode[tn]._isOutsideThisEl(e.target),!at&&io(e)),!d.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),A=!0}function U(){Yt=Tn(H),Br=Tn(H,d.draggable),Pt({sortable:_,name:"change",toEl:t,newIndex:Yt,newDraggableIndex:Br,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),n=jn(n,d.draggable,t,!0),N("dragOver"),oe.eventCanceled)return A;if(H.contains(e.target)||n.animated&&n.animatingX&&n.animatingY||_._ignoreWhileAnimating===n)return V(!1);if(nc=!1,g&&!d.disabled&&(m?C||(l=We!==Fe):vt===this||(this.lastPutMode=_s.checkPull(this,g,H,e))&&f.checkPut(this,g,H,e))){if(E=this._getDirection(e,n)==="vertical",i=ot(H),N("dragOverValid"),oe.eventCanceled)return A;if(l)return We=Fe,K(),this._hideClone(),N("revert"),oe.eventCanceled||(co?Fe.insertBefore(H,co):Fe.appendChild(H)),V(!0);var Q=Vd(t,d.draggable);if(!Q||DP(e,E,this)&&!Q.animated){if(Q===H)return V(!1);if(Q&&t===e.target&&(n=Q),n&&(s=ot(n)),Ss(Fe,t,H,i,n,s,e,!!n)!==!1)return K(),t.appendChild(H),We=t,U(),V(!0)}else if(Q&&xP(e,E,this)){var ce=hi(t,0,d,!0);if(ce===H)return V(!1);if(n=ce,s=ot(n),Ss(Fe,t,H,i,n,s,e,!1)!==!1)return K(),t.insertBefore(H,ce),We=t,U(),V(!0)}else if(n.parentNode===t){s=ot(n);var we=0,z,et=H.parentNode!==t,_e=!RP(H.animated&&H.toRect||i,n.animated&&n.toRect||s,E),j=E?"top":"left",W=Um(n,"top","top")||Um(H,"top","top"),Te=W?W.scrollTop:void 0;Ko!==n&&(z=s[j],aa=!1,Ts=!_e&&d.invertSwap||et),we=LP(e,n,s,E,_e?1:d.swapThreshold,d.invertedSwapThreshold==null?d.swapThreshold:d.invertedSwapThreshold,Ts,Ko===n);var Ue;if(we!==0){var Ct=Tn(H);do Ct-=we,Ue=We.children[Ct];while(Ue&&(re(Ue,"display")==="none"||Ue===le))}if(we===0||Ue===n)return V(!1);Ko=n,ia=we;var Sn=n.nextElementSibling,on=!1;on=we===1;var An=Ss(Fe,t,H,i,n,s,e,on);if(An!==!1)return(An===1||An===-1)&&(on=An===1),nd=!0,setTimeout(MP,30),K(),on&&!Sn?t.appendChild(H):n.parentNode.insertBefore(H,on?Sn:n),W&&Yv(W,0,Te-W.scrollTop),We=H.parentNode,z!==void 0&&!Ts&&(qs=Math.abs(z-ot(n)[j])),U(),V(!0)}if(t.contains(H))return V(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){Ce(document,"mousemove",this._onTouchMove),Ce(document,"touchmove",this._onTouchMove),Ce(document,"pointermove",this._onTouchMove),Ce(document,"dragover",io),Ce(document,"mousemove",io),Ce(document,"touchmove",io)},_offUpEvents:function(){var e=this.el.ownerDocument;Ce(e,"mouseup",this._onDrop),Ce(e,"touchend",this._onDrop),Ce(e,"pointerup",this._onDrop),Ce(e,"touchcancel",this._onDrop),Ce(document,"selectstart",this)},_onDrop:function(e){var t=this.el,n=this.options;if(Yt=Tn(H),Br=Tn(H,n.draggable),Ut("drop",this,{evt:e}),We=H&&H.parentNode,Yt=Tn(H),Br=Tn(H,n.draggable),oe.eventCanceled){this._nulling();return}Qo=!1,Ts=!1,aa=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),rd(this.cloneId),rd(this._dragStartId),this.nativeDraggable&&(Ce(document,"drop",this),Ce(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),na&&re(document.body,"user-select",""),re(H,"transform",""),e&&(Ji&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),le&&le.parentNode&&le.parentNode.removeChild(le),(Fe===We||vt&&vt.lastPutMode!=="clone")&&Ge&&Ge.parentNode&&Ge.parentNode.removeChild(Ge),H&&(this.nativeDraggable&&Ce(H,"dragend",this),Iu(H),H.style["will-change"]="",Ji&&!Qo&&jt(H,vt?vt.options.ghostClass:this.options.ghostClass,!1),jt(H,this.options.chosenClass,!1),Pt({sortable:this,name:"unchoose",toEl:We,newIndex:null,newDraggableIndex:null,originalEvent:e}),Fe!==We?(Yt>=0&&(Pt({rootEl:We,name:"add",toEl:We,fromEl:Fe,originalEvent:e}),Pt({sortable:this,name:"remove",toEl:We,originalEvent:e}),Pt({rootEl:We,name:"sort",toEl:We,fromEl:Fe,originalEvent:e}),Pt({sortable:this,name:"sort",toEl:We,originalEvent:e})),vt&&vt.save()):Yt!==oi&&Yt>=0&&(Pt({sortable:this,name:"update",toEl:We,originalEvent:e}),Pt({sortable:this,name:"sort",toEl:We,originalEvent:e})),oe.active&&((Yt==null||Yt===-1)&&(Yt=oi,Br=oa),Pt({sortable:this,name:"end",toEl:We,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){Ut("nulling",this),Fe=H=We=le=co=Ge=zs=Ur=oo=Pn=Ji=Yt=Br=oi=oa=Ko=ia=vt=_s=oe.dragged=oe.ghost=oe.clone=oe.active=null,oc.forEach(function(e){e.checked=!0}),oc.length=Su=Au=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":H&&(this._onDragOver(e),PP(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],t,n=this.el.children,i=0,s=n.length,l=this.options;i<s;i++)t=n[i],jn(t,l.draggable,this.el,!1)&&e.push(t.getAttribute(l.dataIdAttr)||UP(t));return e},sort:function(e,t){var n={},i=this.el;this.toArray().forEach(function(s,l){var d=i.children[l];jn(d,this.options.draggable,i,!1)&&(n[s]=d)},this),t&&this.captureAnimationState(),e.forEach(function(s){n[s]&&(i.removeChild(n[s]),i.appendChild(n[s]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return jn(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var n=this.options;if(t===void 0)return n[e];var i=_a.modifyOption(this,e,t);typeof i<"u"?n[e]=i:n[e]=t,e==="group"&&Zv(n)},destroy:function(){Ut("destroy",this);var e=this.el;e[tn]=null,Ce(e,"mousedown",this._onTapStart),Ce(e,"touchstart",this._onTapStart),Ce(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(Ce(e,"dragover",this),Ce(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),rc.splice(rc.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!Ur){if(Ut("hideClone",this),oe.eventCanceled)return;re(Ge,"display","none"),this.options.removeCloneOnHide&&Ge.parentNode&&Ge.parentNode.removeChild(Ge),Ur=!0}},_showClone:function(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(Ur){if(Ut("showClone",this),oe.eventCanceled)return;H.parentNode==Fe&&!this.options.group.revertClone?Fe.insertBefore(Ge,H):co?Fe.insertBefore(Ge,co):Fe.appendChild(Ge),this.options.group.revertClone&&this.animate(H,Ge),re(Ge,"display",""),Ur=!1}}};function PP(r){r.dataTransfer&&(r.dataTransfer.dropEffect="move"),r.cancelable&&r.preventDefault()}function Ss(r,e,t,n,i,s,l,d){var f,g=r[tn],m=g.options.onMove,C;return window.CustomEvent&&!Sr&&!wa?f=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(f=document.createEvent("Event"),f.initEvent("move",!0,!0)),f.to=e,f.from=r,f.dragged=t,f.draggedRect=n,f.related=i||e,f.relatedRect=s||ot(e),f.willInsertAfter=d,f.originalEvent=l,r.dispatchEvent(f),m&&(C=m.call(g,f,l)),C}function Iu(r){r.draggable=!1}function MP(){nd=!1}function xP(r,e,t){var n=ot(hi(t.el,0,t.options,!0)),i=10;return e?r.clientX<n.left-i||r.clientY<n.top&&r.clientX<n.right:r.clientY<n.top-i||r.clientY<n.bottom&&r.clientX<n.left}function DP(r,e,t){var n=ot(Vd(t.el,t.options.draggable)),i=10;return e?r.clientX>n.right+i||r.clientX<=n.right&&r.clientY>n.bottom&&r.clientX>=n.left:r.clientX>n.right&&r.clientY>n.top||r.clientX<=n.right&&r.clientY>n.bottom+i}function LP(r,e,t,n,i,s,l,d){var f=n?r.clientY:r.clientX,g=n?t.height:t.width,m=n?t.top:t.left,C=n?t.bottom:t.right,v=!1;if(!l){if(d&&qs<g*i){if(!aa&&(ia===1?f>m+g*s/2:f<C-g*s/2)&&(aa=!0),aa)v=!0;else if(ia===1?f<m+qs:f>C-qs)return-ia}else if(f>m+g*(1-i)/2&&f<C-g*(1-i)/2)return BP(e)}return v=v||l,v&&(f<m+g*s/2||f>C-g*s/2)?f>m+g/2?1:-1:0}function BP(r){return Tn(H)<Tn(r)?1:-1}function UP(r){for(var e=r.tagName+r.className+r.src+r.href+r.textContent,t=e.length,n=0;t--;)n+=e.charCodeAt(t);return n.toString(36)}function VP(r){oc.length=0;for(var e=r.getElementsByTagName("input"),t=e.length;t--;){var n=e[t];n.checked&&oc.push(n)}}function Ws(r){return setTimeout(r,0)}function rd(r){return clearTimeout(r)}Ic&&Se(document,"touchmove",function(r){(oe.active||Qo)&&r.cancelable&&r.preventDefault()});oe.utils={on:Se,off:Ce,css:re,find:Gv,is:function(e,t){return!!jn(e,t,e,!1)},extend:_P,throttle:jv,closest:jn,toggleClass:jt,clone:Jv,index:Tn,nextTick:Ws,cancelNextTick:rd,detectDirection:Xv,getChild:hi};oe.get=function(r){return r[tn]};oe.mount=function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;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&&(oe.utils=nr(nr({},oe.utils),n.utils)),_a.mount(n)})};oe.create=function(r,e){return new oe(r,e)};oe.version=vP;var Qe=[],Qi,od,id=!1,ku,Ru,ic,Xi;function FP(){function r(){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 r.prototype={dragStarted:function(t){var n=t.originalEvent;this.sortable.nativeDraggable?Se(document,"dragover",this._handleAutoScroll):this.options.supportPointer?Se(document,"pointermove",this._handleFallbackAutoScroll):n.touches?Se(document,"touchmove",this._handleFallbackAutoScroll):Se(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var n=t.originalEvent;!this.options.dragOverBubble&&!n.rootEl&&this._handleAutoScroll(n)},drop:function(){this.sortable.nativeDraggable?Ce(document,"dragover",this._handleAutoScroll):(Ce(document,"pointermove",this._handleFallbackAutoScroll),Ce(document,"touchmove",this._handleFallbackAutoScroll),Ce(document,"mousemove",this._handleFallbackAutoScroll)),Km(),Gs(),TP()},nulling:function(){ic=od=Qi=id=Xi=ku=Ru=null,Qe.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,n){var i=this,s=(t.touches?t.touches[0]:t).clientX,l=(t.touches?t.touches[0]:t).clientY,d=document.elementFromPoint(s,l);if(ic=t,n||this.options.forceAutoScrollFallback||wa||Sr||na){Nu(t,this.options,d,n);var f=Kr(d,!0);id&&(!Xi||s!==ku||l!==Ru)&&(Xi&&Km(),Xi=setInterval(function(){var g=Kr(document.elementFromPoint(s,l),!0);g!==f&&(f=g,Gs()),Nu(t,i.options,g,n)},10),ku=s,Ru=l)}else{if(!this.options.bubbleScroll||Kr(d,!0)===er()){Gs();return}Nu(t,this.options,Kr(d,!1),!1)}}},Tr(r,{pluginName:"scroll",initializeByDefault:!0})}function Gs(){Qe.forEach(function(r){clearInterval(r.pid)}),Qe=[]}function Km(){clearInterval(Xi)}var Nu=jv(function(r,e,t,n){if(e.scroll){var i=(r.touches?r.touches[0]:r).clientX,s=(r.touches?r.touches[0]:r).clientY,l=e.scrollSensitivity,d=e.scrollSpeed,f=er(),g=!1,m;od!==t&&(od=t,Gs(),Qi=e.scroll,m=e.scrollFn,Qi===!0&&(Qi=Kr(t,!0)));var C=0,v=Qi;do{var E=v,_=ot(E),A=_.top,N=_.bottom,K=_.left,V=_.right,U=_.width,Q=_.height,ce=void 0,we=void 0,z=E.scrollWidth,et=E.scrollHeight,_e=re(E),j=E.scrollLeft,W=E.scrollTop;E===f?(ce=U<z&&(_e.overflowX==="auto"||_e.overflowX==="scroll"||_e.overflowX==="visible"),we=Q<et&&(_e.overflowY==="auto"||_e.overflowY==="scroll"||_e.overflowY==="visible")):(ce=U<z&&(_e.overflowX==="auto"||_e.overflowX==="scroll"),we=Q<et&&(_e.overflowY==="auto"||_e.overflowY==="scroll"));var Te=ce&&(Math.abs(V-i)<=l&&j+U<z)-(Math.abs(K-i)<=l&&!!j),Ue=we&&(Math.abs(N-s)<=l&&W+Q<et)-(Math.abs(A-s)<=l&&!!W);if(!Qe[C])for(var Ct=0;Ct<=C;Ct++)Qe[Ct]||(Qe[Ct]={});(Qe[C].vx!=Te||Qe[C].vy!=Ue||Qe[C].el!==E)&&(Qe[C].el=E,Qe[C].vx=Te,Qe[C].vy=Ue,clearInterval(Qe[C].pid),(Te!=0||Ue!=0)&&(g=!0,Qe[C].pid=setInterval((function(){n&&this.layer===0&&oe.active._onTouchMove(ic);var Sn=Qe[this.layer].vy?Qe[this.layer].vy*d:0,on=Qe[this.layer].vx?Qe[this.layer].vx*d:0;typeof m=="function"&&m.call(oe.dragged.parentNode[tn],on,Sn,r,ic,Qe[this.layer].el)!=="continue"||Yv(Qe[this.layer].el,on,Sn)}).bind({layer:C}),24))),C++}while(e.bubbleScroll&&v!==f&&(v=Kr(v,!1)));id=g}},30),ny=function(e){var t=e.originalEvent,n=e.putSortable,i=e.dragEl,s=e.activeSortable,l=e.dispatchSortableEvent,d=e.hideGhostForTarget,f=e.unhideGhostForTarget;if(t){var g=n||s;d();var m=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,C=document.elementFromPoint(m.clientX,m.clientY);f(),g&&!g.el.contains(C)&&(l("spill"),this.onSpill({dragEl:i,putSortable:n}))}};function Fd(){}Fd.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 i=hi(this.sortable.el,this.startIndex,this.options);i?this.sortable.el.insertBefore(t,i):this.sortable.el.appendChild(t),this.sortable.animateAll(),n&&n.animateAll()},drop:ny};Tr(Fd,{pluginName:"revertOnSpill"});function Hd(){}Hd.prototype={onSpill:function(e){var t=e.dragEl,n=e.putSortable,i=n||this.sortable;i.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),i.animateAll()},drop:ny};Tr(Hd,{pluginName:"removeOnSpill"});oe.mount(new FP);oe.mount(Hd,Fd);function HP(){return typeof window<"u"?window.console:global.console}const $P=HP();function KP(r){const e=Object.create(null);return function(n){return e[n]||(e[n]=r(n))}}const zP=/-(\w)/g,zm=KP(r=>r.replace(zP,(e,t)=>t?t.toUpperCase():""));function Ou(r){r.parentElement!==null&&r.parentElement.removeChild(r)}function qm(r,e,t){const n=t===0?r.children[0]:r.children[t-1].nextSibling;r.insertBefore(e,n)}function qP(r,e){return Object.values(r).indexOf(e)}function WP(r,e,t,n){if(!r)return[];const i=Object.values(r),s=e.length-n;return[...e].map((d,f)=>f>=s?i.length:i.indexOf(d))}function ry(r,e){this.$nextTick(()=>this.$emit(r.toLowerCase(),e))}function GP(r){return e=>{this.realList!==null&&this["onDrag"+r](e),ry.call(this,r,e)}}function jP(r){return["transition-group","TransitionGroup"].includes(r)}function YP(r){if(!r||r.length!==1)return!1;const[{type:e}]=r;return e?jP(e.name):!1}function JP(r,e){return e?{...e.props,...e.attrs}:r}const ad=["Start","Add","Remove","Update","End"],sd=["Choose","Unchoose","Sort","Filter","Clone"],QP=["Move",...ad,...sd].map(r=>"on"+r);let Pu=null;const XP={options:Object,list:{type:Array,required:!1,default:null},noTransitionOnDrag:{type:Boolean,default:!1},clone:{type:Function,default:r=>r},tag:{type:String,default:"div"},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null},component:{type:String,default:null},modelValue:{type:Array,required:!1,default:null}},ZP=c.defineComponent({name:"VueDraggableNext",inheritAttrs:!1,emits:["update:modelValue","move","change",...ad.map(r=>r.toLowerCase()),...sd.map(r=>r.toLowerCase())],props:XP,data(){return{transitionMode:!1,noneFunctionalComponentMode:!1,headerOffset:0,footerOffset:0,_sortable:{},visibleIndexes:[],context:{}}},render(){const r=this.$slots.default?this.$slots.default():null,e=JP(this.$attrs,this.componentData);return r?(this.transitionMode=YP(r),c.h(this.getTag(),e,r)):c.h(this.getTag(),e,[])},created(){this.list!==null&&this.modelValue!==null&&$P.error("list props are mutually exclusive! Please set one.")},mounted(){const r={};ad.forEach(i=>{r["on"+i]=GP.call(this,i)}),sd.forEach(i=>{r["on"+i]=ry.bind(this,i)});const e=Object.keys(this.$attrs).reduce((i,s)=>(i[zm(s)]=this.$attrs[s],i),{}),t=Object.assign({},e,r,{onMove:(i,s)=>this.onDragMove(i,s)});!("draggable"in t)&&(t.draggable=">*");const n=this.$el.nodeType===1?this.$el:this.$el.parentElement;this._sortable=new oe(n,t),n.__draggable_component__=this,this.computeIndexes()},beforeUnmount(){try{this._sortable!==void 0&&this._sortable.destroy()}catch{}},computed:{realList(){return this.list?this.list:this.modelValue}},watch:{$attrs:{handler(r){this.updateOptions(r)},deep:!0},realList(){this.computeIndexes()}},methods:{getTag(){return this.component?c.resolveComponent(this.component):this.tag},updateOptions(r){for(var e in r){const t=zm(e);QP.indexOf(t)===-1&&this._sortable.option(t,r[e])}},getChildrenNodes(){return this.$el.children},computeIndexes(){this.$nextTick(()=>{this.visibleIndexes=WP(this.getChildrenNodes(),this.$el.children,this.transitionMode,this.footerOffset)})},getUnderlyingVm(r){const e=qP(this.getChildrenNodes()||[],r);if(e===-1)return null;const t=this.realList[e];return{index:e,element:t}},emitChanges(r){this.$nextTick(()=>{this.$emit("change",r)})},alterList(r){if(this.list){r(this.list);return}const e=[...this.modelValue];r(e),this.$emit("update:modelValue",e)},spliceList(){const r=e=>e.splice(...arguments);this.alterList(r)},updatePosition(r,e){const t=n=>n.splice(e,0,n.splice(r,1)[0]);this.alterList(t)},getVmIndex(r){const e=this.visibleIndexes,t=e.length;return r>t-1?t:e[r]},getComponent(){return this.$slots.default?this.$slots.default()[0].componentInstance:null},resetTransitionData(r){if(!this.noTransitionOnDrag||!this.transitionMode)return;var e=this.getChildrenNodes();e[r].data=null;const t=this.getComponent();t.children=[],t.kept=void 0},onDragStart(r){this.computeIndexes(),this.context=this.getUnderlyingVm(r.item),this.context&&(r.item._underlying_vm_=this.clone(this.context.element),Pu=r.item)},onDragAdd(r){const e=r.item._underlying_vm_;if(e===void 0)return;Ou(r.item);const t=this.getVmIndex(r.newIndex);this.spliceList(t,0,e),this.computeIndexes();const n={element:e,newIndex:t};this.emitChanges({added:n})},onDragRemove(r){if(qm(this.$el,r.item,r.oldIndex),r.pullMode==="clone"){Ou(r.clone);return}if(!this.context)return;const e=this.context.index;this.spliceList(e,1);const t={element:this.context.element,oldIndex:e};this.resetTransitionData(e),this.emitChanges({removed:t})},onDragUpdate(r){Ou(r.item),qm(r.from,r.item,r.oldIndex);const e=this.context.index,t=this.getVmIndex(r.newIndex);this.updatePosition(e,t);const n={element:this.context.element,oldIndex:e,newIndex:t};this.emitChanges({moved:n})},updateProperty(r,e){r.hasOwnProperty(e)&&(r[e]+=this.headerOffset)},onDragMove(r,e){const t=this.move;if(!t||!this.realList)return!0;const n=this.getRelatedContextFromMoveEvent(r),i=this.context,s=this.computeFutureIndex(n,r);Object.assign(i,{futureIndex:s});const l=Object.assign({},r,{relatedContext:n,draggedContext:i});return t(l,e)},onDragEnd(){this.computeIndexes(),Pu=null},getTrargetedComponent(r){return r.__draggable_component__},getRelatedContextFromMoveEvent({to:r,related:e}){const t=this.getTrargetedComponent(r);if(!t)return{component:t};const n=t.realList,i={list:n,component:t};if(r!==e&&n&&t.getUnderlyingVm){const s=t.getUnderlyingVm(e);if(s)return Object.assign(s,i)}return i},computeFutureIndex(r,e){const t=[...e.to.children].filter(l=>l.style.display!=="none");if(t.length===0)return 0;const n=t.indexOf(e.related),i=r.component.getVmIndex(n);return t.indexOf(Pu)!==-1||!e.willInsertAfter?i:i+1}}}),e1={class:"d-flex flex-row align-center"},$d=c.defineComponent({__name:"ColumnSettingsDialog",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(r){const e=c.useModel(r,"modelValue"),t=c.ref(""),n=c.computed(()=>{var i;return(i=e.value)==null?void 0:i.filter(s=>s.title.toLowerCase().includes(t.value.toLowerCase()))});return(i,s)=>{const l=c.resolveComponent("v-list-item-content");return c.openBlock(),c.createBlock(Ca,{"dd-id":"col-settings",buttons:!1,title:"Column settings"},{default:c.withCtx(()=>[c.createVNode(bc,{modelValue:t.value,"onUpdate:modelValue":s[0]||(s[0]=d=>t.value=d)},null,8,["modelValue"]),c.createVNode(St.VList,null,{default:c.withCtx(()=>[c.createVNode(c.unref(ZP),{list:n.value,animation:200,"ghost-class":"ghost-card"},{default:c.withCtx(()=>[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(n.value,d=>(c.openBlock(),c.createBlock(St.VListItem,{key:d.key,class:"pa-0"},{default:c.withCtx(()=>[c.createElementVNode("div",e1,[c.createVNode(c.unref(h0),{class:"cursor-grab mb-2"}),c.createVNode(St.VListItemAction,null,{default:c.withCtx(()=>[c.createVNode(Tk.VCheckbox,{modelValue:d.checked,"onUpdate:modelValue":f=>d.checked=f},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),c.createVNode(l,null,{default:c.withCtx(()=>[c.createVNode(St.VListItemTitle,{class:"mb-1"},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(d.title)+"  ",1)]),_:2},1024)]),_:2},1024),d.icon?(c.openBlock(),c.createBlock(Xs.VIcon,{key:0},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(d.icon),1)]),_:2},1024)):c.createCommentVNode("",!0)])]),_:2},1024))),128))]),_:1},8,["list"])]),_:1})]),_:1})}}}),t1=["src","height","width"],n1={key:0,class:"text-center text-h6"},r1={key:1,class:"text-center text-h5"},o1={key:0,class:"text-center"},i1={class:"d-flex justify-center align-center mt-4 ga-3"},Kd=c.defineComponent({__name:"TableCard",props:{item:{},columns:{},size:{},image:{},tags:{},route:{},callback:{type:Function}},setup(r){const e=r,t=()=>{var i;return((i=e.columns.find(s=>s.isHeader))==null?void 0:i.key)||""},n=()=>{var i;return((i=e.columns.find(s=>s.isSubtitle))==null?void 0:i.key)||""};return(i,s)=>(c.openBlock(),c.createBlock(lt.VCard,{onClick:i.callback,ripple:"",class:"d-flex flex-column pa-4pa-4 bg-containerBg"},{default:c.withCtx(()=>[c.createVNode(lt.VCardActions,null,{default:c.withCtx(()=>[c.createVNode(Oe.VRow,{"no-gutters":"",align:"center",justify:"end"},{default:c.withCtx(()=>[c.renderSlot(i.$slots,"actions",{item:i.item})]),_:3})]),_:3}),c.createVNode(lt.VCardTitle,null,{default:c.withCtx(()=>[c.createVNode(Oe.VRow,{"no-gutters":"",align:"center",justify:"center"},{default:c.withCtx(()=>[i.image?(c.openBlock(),c.createElementBlock("img",{key:0,src:i.image,height:i.size,width:i.size,alt:""},null,8,t1)):c.createCommentVNode("",!0)]),_:1})]),_:1}),t()?(c.openBlock(),c.createElementBlock("div",n1,c.toDisplayString(i.item[t()]),1)):c.createCommentVNode("",!0),n()?(c.openBlock(),c.createElementBlock("div",r1,c.toDisplayString(i.item[n()]),1)):c.createCommentVNode("",!0),c.createVNode(fo.VDivider,{class:"ma-3"}),c.createVNode(lt.VCardText,{class:"d-flex flex-column align-center pa-4 pt-1"},{default:c.withCtx(()=>[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(i.columns,l=>(c.openBlock(),c.createElementBlock(c.Fragment,{key:l.key},[i.item[l.key]&&!l.isHeader&&!l.isSubtitle?(c.openBlock(),c.createElementBlock("div",o1,c.toDisplayString(l.title)+": "+c.toDisplayString(i.item[l.key]),1)):c.createCommentVNode("",!0)],64))),128)),c.createElementVNode("div",i1,[i.tags?(c.openBlock(!0),c.createElementBlock(c.Fragment,{key:0},c.renderList(i.tags,l=>(c.openBlock(),c.createBlock(Ek.VChip,{class:"pa-3",key:l},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(l),1)]),_:2},1024))),128)):c.createCommentVNode("",!0)])]),_:1})]),_:3},8,["onClick"]))}}),a1=c.defineComponent({__name:"TableCardsView",props:{data:{},columns:{},size:{},itemKey:{}},setup(r){return(e,t)=>(c.openBlock(),c.createBlock(Oe.VRow,{class:"mt-5 border tb-cards-h",wrap:""},{default:c.withCtx(()=>[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(e.data,n=>(c.openBlock(),c.createBlock(Oe.VCol,{cols:"12",sm:"6",md:"4",lg:"3",class:"pa-2",key:n[e.itemKey]},{default:c.withCtx(()=>[c.createVNode(Kd,{item:n,columns:e.columns,size:e.size},{actions:c.withCtx(({item:i})=>[c.renderSlot(e.$slots,"actions",{item:i},void 0,!0)]),_:2},1032,["item","columns","size"])]),_:2},1024))),128))]),_:3}))}}),oy=vi(a1,[["__scopeId","data-v-e1a4ccbc"]]),s1={class:"j-field px-4 py-3 rounded-sm bg-containerBg"},iy=c.defineComponent({__name:"ReadOnlyField",props:{value:{}},setup(r){return(e,t)=>(c.openBlock(),c.createElementBlock("div",s1,c.toDisplayString(e.value),1))}}),c1={key:0,class:"mb-2 ms-1"},ay=c.defineComponent({__name:"JTextField",props:{modelValue:{},name:{},label:{},type:{default:"text"},readonly:{type:Boolean},density:{},rules:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,i=c.computed(()=>t.readonly?"solo":"solo-filled");return(s,l)=>(c.openBlock(),c.createElementBlock("div",null,[s.name?(c.openBlock(),c.createElementBlock("p",c1,c.toDisplayString(s.name),1)):c.createCommentVNode("",!0),s.label?(c.openBlock(),c.createBlock(ua.VLabel,{key:1,class:"text-subtitle-1 text-high-emphasis mb-2"},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(s.label),1)]),_:1})):c.createCommentVNode("",!0),s.readonly?c.createCommentVNode("",!0):(c.openBlock(),c.createBlock(c.unref(zr.VTextField),{key:2,variant:i.value,color:"secondary","bg-color":"containerBg",rounded:"sm","hide-details":"auto",type:s.type,density:s.density,rules:s.rules,value:s.modelValue,"onUpdate:modelValue":l[0]||(l[0]=d=>n("update:modelValue",d)),class:"j-field"},null,8,["variant","type","density","rules","value"])),s.readonly?(c.openBlock(),c.createBlock(iy,{key:3,value:s.modelValue},null,8,["value"])):c.createCommentVNode("",!0)]))}}),l1={class:"text-faded mt-7"},u1={class:"d-flex align-baseline mb-1"},d1={class:"me-1"},h1={class:"max-w-_form-metadataJ"},f1={key:0,class:"mb-1"},g1={key:1,class:"mb-1"},m1={class:"mb-1"},kc=c.defineComponent({__name:"FormMetadata",props:{meta:{},id:{}},setup(r){return(e,t)=>(c.openBlock(),c.createElementBlock("div",l1,[c.createVNode(Oe.VRow,{"no-gutters":"",class:"align-end ga-3",align:"center"},{default:c.withCtx(()=>[c.renderSlot(e.$slots,"default"),e.id?(c.openBlock(),c.createBlock(Oe.VCol,{key:0,cols:"auto",class:"pa-2"},{default:c.withCtx(()=>[c.createElementVNode("p",u1,[c.createElementVNode("b",d1,c.toDisplayString(e.id.title)+": ",1),c.createElementVNode("span",h1,c.toDisplayString(e.id.key||"-"),1),c.createElementVNode("span",null,[c.createVNode(yc,{"content-to-copy":e.id.key,size:15},null,8,["content-to-copy"])])]),c.createElementVNode("p",null,[t[0]||(t[0]=c.createElementVNode("b",null,"Created: ",-1)),c.createTextVNode(c.toDisplayString(e.meta.created_at)+" - "+c.toDisplayString(e.meta.created_by),1)])]),_:1})):c.createCommentVNode("",!0),c.createVNode(Oe.VCol,{cols:"auto",class:"d-flex flex-column align-baseline px-2 mt-1"},{default:c.withCtx(()=>[e.meta.updated_at&&e.meta.updated_by?(c.openBlock(),c.createElementBlock("p",f1,[t[1]||(t[1]=c.createElementVNode("b",null,"Updated:  ",-1)),c.createTextVNode(c.toDisplayString(e.meta.updated_at)+" - "+c.toDisplayString(e.meta.updated_by),1)])):(c.openBlock(),c.createElementBlock("p",g1,[t[2]||(t[2]=c.createElementVNode("b",null,"Modified:  ",-1)),c.createTextVNode(c.toDisplayString(e.meta.modified_at)+" - "+c.toDisplayString(e.meta.modified_by),1)])),c.createElementVNode("p",m1,[t[3]||(t[3]=c.createElementVNode("b",null,"Delegated: ",-1)),c.createTextVNode(c.toDisplayString(e.meta.delegated_at)+" - "+c.toDisplayString(e.meta.delegated_by),1)])]),_:1})]),_:3})]))}}),p1={key:0,class:"mb-2 ms-1"},sy=c.defineComponent({__name:"JSelect",props:{modelValue:{},name:{},label:{},placeholder:{},readonly:{type:Boolean},items:{},itemTitle:{},itemValue:{},density:{},loading:{type:Boolean},clearable:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,i=c.computed(()=>t.readonly?"solo":"solo-filled"),s=c.computed(()=>{if(Array.isArray(t.items)&&t.items.length>0)if(typeof t.items[0]=="object"&&t.itemValue&&t.itemTitle){const d=t.items.find(f=>f[t.itemValue]===t.modelValue);return d?d[t.itemTitle]:""}else{const d=t.items.indexOf(t.modelValue);return d!==-1?t.items[d]:""}return""}),l=d=>{n("update:modelValue",d)};return(d,f)=>(c.openBlock(),c.createElementBlock(c.Fragment,null,[d.name?(c.openBlock(),c.createElementBlock("p",p1,c.toDisplayString(d.name),1)):c.createCommentVNode("",!0),d.label?(c.openBlock(),c.createBlock(ua.VLabel,{key:1,class:"text-subtitle-1 text-high-emphasis mb-2"},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(d.label),1)]),_:1})):c.createCommentVNode("",!0),d.readonly?(c.openBlock(),c.createBlock(iy,{key:3,value:s.value},null,8,["value"])):(c.openBlock(),c.createBlock(c.unref(zr.VSelect),{key:2,modelValue:t.modelValue,"onUpdate:modelValue":[f[0]||(f[0]=g=>t.modelValue=g),l],variant:i.value,items:d.items,"item-title":d.itemTitle,"item-value":d.itemValue,loading:d.loading,placeholder:d.placeholder,density:d.density,"bg-color":"containerBg",rounded:"false","hide-details":"",class:"j-field",clearable:d.clearable},null,8,["modelValue","variant","items","item-title","item-value","loading","placeholder","density","clearable"]))],64))}}),v1={key:0,class:"mb-2 ms-1"},y1={key:3,class:"j-textarea px-4 py-3 rounded-sm bg-containerBg"},cy=c.defineComponent({__name:"JTextArea",props:{modelValue:{},name:{},label:{},readonly:{type:Boolean},rows:{},hideDetails:{type:Boolean}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,i=c.computed(()=>t.readonly?"solo":"solo-filled");return(s,l)=>(c.openBlock(),c.createElementBlock(c.Fragment,null,[s.name?(c.openBlock(),c.createElementBlock("p",v1,c.toDisplayString(s.name),1)):c.createCommentVNode("",!0),s.label?(c.openBlock(),c.createBlock(ua.VLabel,{key:1,class:"text-subtitle-1 text-high-emphasis mb-2"},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(s.label),1)]),_:1})):c.createCommentVNode("",!0),s.readonly?c.createCommentVNode("",!0):(c.openBlock(),c.createBlock(Sk.VTextarea,{key:2,variant:i.value,"bg-color":"containerBg",rounded:"false",rows:s.rows,hideDetails:s.hideDetails,value:s.modelValue,"onUpdate:modelValue":l[0]||(l[0]=d=>n("update:modelValue",d)),"no-resize":""},null,8,["variant","rows","hideDetails","value"])),s.readonly?(c.openBlock(),c.createElementBlock("div",y1,c.toDisplayString(s.modelValue),1)):c.createCommentVNode("",!0)],64))}}),ly=c.defineComponent({__name:"CancelButton",props:{title:{}},emits:["cancel"],setup(r,{emit:e}){const t=e;return(n,i)=>(c.openBlock(),c.createBlock(Be.VBtn,{color:"secondary",variant:"outlined",onClick:i[0]||(i[0]=s=>t("cancel")),class:"me-2 j-btn-form"},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(n.title?"Cancel":"Back"),1)]),_:1}))}}),uy=c.defineComponent({__name:"SaveButton",props:{disabled:{type:Boolean}},emits:["onSave"],setup(r,{emit:e}){const t=e,n=c.ref(!1);async function i(){n.value=!0,await t("onSave"),n.value=!1}return(s,l)=>(c.openBlock(),c.createBlock(Be.VBtn,{disabled:s.disabled,loading:n.value,color:"secondary",onClick:i,onKeydown:c.withKeys(i,["enter"]),class:"j-btn-form"},{default:c.withCtx(()=>l[0]||(l[0]=[c.createTextVNode(" Save ")])),_:1},8,["disabled","loading"]))}}),C1={class:"mt-4"},dy=c.defineComponent({__name:"JForm",props:{title:{},metadata:{},id:{},cancelReturn:{type:Boolean}},emits:["onSave","onCancel"],setup(r,{emit:e}){const t=e;return(n,i)=>(c.openBlock(),c.createBlock(Ec,{title:n.title,class:"d-flex flex-column ma-0"},{default:c.withCtx(()=>[n.title?(c.openBlock(),c.createBlock(fo.VDivider,{key:0})):c.createCommentVNode("",!0),c.createElementVNode("div",C1,[c.renderSlot(n.$slots,"default")]),c.createVNode(lt.VCardText,{class:"pa-0 mx-0 align-content-end"},{default:c.withCtx(()=>[c.createVNode(Oe.VRow,{justify:"space-between",class:"mt-4"},{default:c.withCtx(()=>[c.createVNode(Oe.VCol,{cols:"auto",class:"text-sm-subtitle-2 text-medium-emphasis"},{default:c.withCtx(()=>[c.createVNode(kc,{id:n.id,meta:n.metadata},null,8,["id","meta"])]),_:1}),c.createVNode(Oe.VSpacer),c.createVNode(Oe.VCol,{cols:"auto",class:"align-content-end"},{default:c.withCtx(()=>[c.createVNode(ly,{"cancel-return":n.cancelReturn,onCancel:i[0]||(i[0]=s=>t("onCancel"))},null,8,["cancel-return"]),c.createVNode(uy,{onOnSave:i[1]||(i[1]=s=>t("onSave"))})]),_:1})]),_:1})]),_:1})]),_:3},8,["title"]))}}),w1={class:"d-flex align-items-center"},_1={key:0,class:"d-flex align-center"},T1={class:"ms-1"},E1={class:"d-flex"},S1={class:"d-flex mb-1 align-center"},A1={class:"min-w-100 relative"},hy=c.defineComponent({__name:"TabFormHeader",props:{id:{},readonly:{type:Boolean,default:!1}},emits:["update:isEdition","save","cancel","delete","disable"],setup(r,{emit:e}){var g;const t=r,n=e,i=c.getCurrentInstance(),s=((g=i==null?void 0:i.vnode.props)==null?void 0:g.onDisable)!==void 0,l=c.ref(t.readonly);function d(){l.value=!l.value,n("update:isEdition",l.value)}async function f(){n("delete"),n("disable")}return(m,C)=>(c.openBlock(),c.createElementBlock("div",w1,[m.id?(c.openBlock(),c.createElementBlock("div",_1,[C[0]||(C[0]=c.createElementVNode("b",null,"ID:",-1)),c.createElementVNode("span",T1,c.toDisplayString(m.id),1),c.createVNode(yc,{"content-to-copy":m.id,size:20},null,8,["content-to-copy"])])):c.createCommentVNode("",!0),c.createVNode(Oe.VSpacer),c.createElementVNode("div",E1,[c.createVNode(Be.VBtn,{onClick:f,variant:"text"},{default:c.withCtx(()=>[s?(c.openBlock(),c.createBlock(c.unref(a0),{key:0,size:"11",class:"me-2"})):c.createCommentVNode("",!0),c.createVNode(Xs.VIcon,{class:"me-2"},{default:c.withCtx(()=>C[1]||(C[1]=[c.createTextVNode("mdi-delete-outline")])),_:1}),c.createTextVNode(" "+c.toDisplayString(s?"Disable":"Delete"),1)]),_:1}),c.createElementVNode("div",S1,[c.createVNode(fo.VDivider,{class:"mx-2 my-1",vertical:""}),c.createElementVNode("div",A1,[c.withDirectives(c.createVNode(Be.VBtn,{onClick:d,variant:"text",color:"secondary","prepend-icon":"mdi-pencil",width:"95"},{default:c.withCtx(()=>C[2]||(C[2]=[c.createTextVNode(" Edit ")])),_:1},512),[[c.vShow,!l.value]]),c.withDirectives(c.createVNode(Be.VBtn,{onClick:d,variant:"text",color:"secondary",width:"95"},{default:c.withCtx(()=>[c.createVNode(Xs.VIcon,{class:"pt-1 pe-2"},{default:c.withCtx(()=>C[3]||(C[3]=[c.createTextVNode("mdi-close")])),_:1}),C[4]||(C[4]=c.createTextVNode(" Cancel "))]),_:1},512),[[c.vShow,l.value]])])])])]))}}),b1={class:"d-flex flex-column"},I1={class:"height d-flex flex-column"},k1={class:"d-flex justify-between align-end"},R1=c.defineComponent({__name:"FormHeadless",props:{id:{},metadata:{},readonly:{type:Boolean,default:!1}},emits:["onSave","onCancel"],setup(r,{emit:e}){const t=e,n=c.getCurrentInstance(),i=c.computed(()=>{var l;return!!((l=n==null?void 0:n.vnode.props)!=null&&l.onOnSave)}),s=c.computed(()=>{var l;return!!((l=n==null?void 0:n.vnode.props)!=null&&l.onOnCancel)});return(l,d)=>(c.openBlock(),c.createBlock(Ec,null,{default:c.withCtx(()=>[c.createElementVNode("div",b1,[c.createElementVNode("div",I1,[c.renderSlot(l.$slots,"default",{},void 0,!0)])]),c.createElementVNode("div",k1,[c.createVNode(Oe.VRow,{"no-gutters":"",justify:"space-between",class:"w-100"},{default:c.withCtx(()=>[c.createVNode(Oe.VCol,{cols:"auto",class:"text-sm-subtitle-2 text-medium-emphasis"},{default:c.withCtx(()=>[c.createVNode(kc,{id:l.id,meta:l.metadata},null,8,["id","meta"])]),_:1}),l.readonly?c.createCommentVNode("",!0):(c.openBlock(),c.createBlock(Oe.VCol,{key:0,class:"d-flex align-end",cols:"auto"},{default:c.withCtx(()=>[s.value?(c.openBlock(),c.createBlock(ly,{key:0,title:"Back",onCancel:d[0]||(d[0]=f=>t("onCancel"))})):c.createCommentVNode("",!0),i.value?(c.openBlock(),c.createBlock(uy,{key:1,onOnSave:d[1]||(d[1]=f=>t("onSave"))})):c.createCommentVNode("",!0)]),_:1}))]),_:1})])]),_:3}))}}),fy=vi(R1,[["__scopeId","data-v-515844c6"]]);/**
21
21
  * @license @tabler/icons-vue v3.31.0 - MIT
22
22
  *
23
23
  * This source code is licensed under the MIT license.
@@ -89,4 +89,4 @@ __p += '`),ve&&(L+=`' +
89
89
  function print() { __p += __j.call(arguments, '') }
90
90
  `:`;
91
91
  `)+L+`return __p
92
- }`;var he=dm(function(){return Ee(w,Y+"return "+L).apply(t,T)});if(he.source=L,au(he))throw he;return he}function kI(o){return Ae(o).toLowerCase()}function RI(o){return Ae(o).toUpperCase()}function NI(o,a,u){if(o=Ae(o),o&&(u||a===t))return wf(o);if(!o||!(a=zt(a)))return o;var h=kn(o),p=kn(a),w=_f(h,p),T=Tf(h,p)+1;return Pr(h,w,T).join("")}function OI(o,a,u){if(o=Ae(o),o&&(u||a===t))return o.slice(0,Sf(o)+1);if(!o||!(a=zt(a)))return o;var h=kn(o),p=Tf(h,kn(a))+1;return Pr(h,0,p).join("")}function PI(o,a,u){if(o=Ae(o),o&&(u||a===t))return o.replace(al,"");if(!o||!(a=zt(a)))return o;var h=kn(o),p=_f(h,kn(a));return Pr(h,p).join("")}function MI(o,a){var u=j,h=W;if(Ke(a)){var p="separator"in a?a.separator:p;u="length"in a?de(a.length):u,h="omission"in a?zt(a.omission):h}o=Ae(o);var w=o.length;if(bo(o)){var T=kn(o);w=T.length}if(u>=w)return o;var S=u-Io(h);if(S<1)return h;var I=T?Pr(T,0,S).join(""):o.slice(0,S);if(p===t)return I+h;if(T&&(S+=I.length-S),su(p)){if(o.slice(S).search(p)){var x,D=I;for(p.global||(p=El(p.source,Ae(Hh.exec(p))+"g")),p.lastIndex=0;x=p.exec(D);)var L=x.index;I=I.slice(0,L===t?S:L)}}else if(o.indexOf(zt(p),S)!=S){var $=I.lastIndexOf(p);$>-1&&(I=I.slice(0,$))}return I+h}function xI(o){return o=Ae(o),o&&qw.test(o)?o.replace(Uh,lT):o}var DI=xo(function(o,a,u){return o+(u?" ":"")+a.toUpperCase()}),uu=hg("toUpperCase");function um(o,a,u){return o=Ae(o),a=u?t:a,a===t?oT(o)?hT(o):Y_(o):o.match(a)||[]}var dm=fe(function(o,a){try{return $t(o,t,a)}catch(u){return au(u)?u:new ae(u)}}),LI=lr(function(o,a){return sn(a,function(u){u=qn(u),sr(o,u,ou(o[u],o))}),o});function BI(o){var a=o==null?0:o.length,u=X();return o=a?Ve(o,function(h){if(typeof h[1]!="function")throw new cn(l);return[u(h[0]),h[1]]}):[],fe(function(h){for(var p=-1;++p<a;){var w=o[p];if($t(w[0],this,h))return $t(w[1],this,h)}})}function UI(o){return lE(un(o,C))}function du(o){return function(){return o}}function VI(o,a){return o==null||o!==o?a:o}var FI=gg(),HI=gg(!0);function Bt(o){return o}function hu(o){return zf(typeof o=="function"?o:un(o,C))}function $I(o){return Wf(un(o,C))}function KI(o,a){return Gf(o,un(a,C))}var zI=fe(function(o,a){return function(u){return Hi(u,o,a)}}),qI=fe(function(o,a){return function(u){return Hi(o,u,a)}});function fu(o,a,u){var h=st(a),p=es(a,h);u==null&&!(Ke(a)&&(p.length||!h.length))&&(u=a,a=o,o=this,p=es(a,st(a)));var w=!(Ke(u)&&"chain"in u)||!!u.chain,T=dr(o);return sn(p,function(S){var I=a[S];o[S]=I,T&&(o.prototype[S]=function(){var x=this.__chain__;if(w||x){var D=o(this.__wrapped__),L=D.__actions__=xt(this.__actions__);return L.push({func:I,args:arguments,thisArg:o}),D.__chain__=x,D}return I.apply(o,br([this.value()],arguments))})}),o}function WI(){return ht._===this&&(ht._=yT),this}function gu(){}function GI(o){return o=de(o),fe(function(a){return jf(a,o)})}var jI=ql(Ve),YI=ql(mf),JI=ql(pl);function hm(o){return Xl(o)?vl(qn(o)):bE(o)}function QI(o){return function(a){return o==null?t:eo(o,a)}}var XI=pg(),ZI=pg(!0);function mu(){return[]}function pu(){return!1}function ek(){return{}}function tk(){return""}function nk(){return!0}function rk(o,a){if(o=de(o),o<1||o>at)return[];var u=Ht,h=_t(o,Ht);a=X(a),o-=Ht;for(var p=wl(h,a);++u<o;)a(u);return p}function ok(o){return se(o)?Ve(o,qn):qt(o)?[o]:xt(Pg(Ae(o)))}function ik(o){var a=++pT;return Ae(o)+a}var ak=as(function(o,a){return o+a},0),sk=Wl("ceil"),ck=as(function(o,a){return o/a},1),lk=Wl("floor");function uk(o){return o&&o.length?Za(o,Bt,Ol):t}function dk(o,a){return o&&o.length?Za(o,X(a,2),Ol):t}function hk(o){return yf(o,Bt)}function fk(o,a){return yf(o,X(a,2))}function gk(o){return o&&o.length?Za(o,Bt,Dl):t}function mk(o,a){return o&&o.length?Za(o,X(a,2),Dl):t}var pk=as(function(o,a){return o*a},1),vk=Wl("round"),yk=as(function(o,a){return o-a},0);function Ck(o){return o&&o.length?Cl(o,Bt):0}function wk(o,a){return o&&o.length?Cl(o,X(a,2)):0}return y.after=$A,y.ary=Kg,y.assign=Rb,y.assignIn=rm,y.assignInWith=Cs,y.assignWith=Nb,y.at=Ob,y.before=zg,y.bind=ou,y.bindAll=LI,y.bindKey=qg,y.castArray=eb,y.chain=Fg,y.chunk=lS,y.compact=uS,y.concat=dS,y.cond=BI,y.conforms=UI,y.constant=du,y.countBy=CA,y.create=Pb,y.curry=Wg,y.curryRight=Gg,y.debounce=jg,y.defaults=Mb,y.defaultsDeep=xb,y.defer=KA,y.delay=zA,y.difference=hS,y.differenceBy=fS,y.differenceWith=gS,y.drop=mS,y.dropRight=pS,y.dropRightWhile=vS,y.dropWhile=yS,y.fill=CS,y.filter=_A,y.flatMap=SA,y.flatMapDeep=AA,y.flatMapDepth=bA,y.flatten=Lg,y.flattenDeep=wS,y.flattenDepth=_S,y.flip=qA,y.flow=FI,y.flowRight=HI,y.fromPairs=TS,y.functions=Hb,y.functionsIn=$b,y.groupBy=IA,y.initial=SS,y.intersection=AS,y.intersectionBy=bS,y.intersectionWith=IS,y.invert=zb,y.invertBy=qb,y.invokeMap=RA,y.iteratee=hu,y.keyBy=NA,y.keys=st,y.keysIn=Lt,y.map=fs,y.mapKeys=Gb,y.mapValues=jb,y.matches=$I,y.matchesProperty=KI,y.memoize=ms,y.merge=Yb,y.mergeWith=om,y.method=zI,y.methodOf=qI,y.mixin=fu,y.negate=ps,y.nthArg=GI,y.omit=Jb,y.omitBy=Qb,y.once=WA,y.orderBy=OA,y.over=jI,y.overArgs=GA,y.overEvery=YI,y.overSome=JI,y.partial=iu,y.partialRight=Yg,y.partition=PA,y.pick=Xb,y.pickBy=im,y.property=hm,y.propertyOf=QI,y.pull=OS,y.pullAll=Ug,y.pullAllBy=PS,y.pullAllWith=MS,y.pullAt=xS,y.range=XI,y.rangeRight=ZI,y.rearg=jA,y.reject=DA,y.remove=DS,y.rest=YA,y.reverse=nu,y.sampleSize=BA,y.set=eI,y.setWith=tI,y.shuffle=UA,y.slice=LS,y.sortBy=HA,y.sortedUniq=KS,y.sortedUniqBy=zS,y.split=SI,y.spread=JA,y.tail=qS,y.take=WS,y.takeRight=GS,y.takeRightWhile=jS,y.takeWhile=YS,y.tap=uA,y.throttle=QA,y.thru=hs,y.toArray=em,y.toPairs=am,y.toPairsIn=sm,y.toPath=ok,y.toPlainObject=nm,y.transform=nI,y.unary=XA,y.union=JS,y.unionBy=QS,y.unionWith=XS,y.uniq=ZS,y.uniqBy=eA,y.uniqWith=tA,y.unset=rI,y.unzip=ru,y.unzipWith=Vg,y.update=oI,y.updateWith=iI,y.values=Bo,y.valuesIn=aI,y.without=nA,y.words=um,y.wrap=ZA,y.xor=rA,y.xorBy=oA,y.xorWith=iA,y.zip=aA,y.zipObject=sA,y.zipObjectDeep=cA,y.zipWith=lA,y.entries=am,y.entriesIn=sm,y.extend=rm,y.extendWith=Cs,fu(y,y),y.add=ak,y.attempt=dm,y.camelCase=uI,y.capitalize=cm,y.ceil=sk,y.clamp=sI,y.clone=tb,y.cloneDeep=rb,y.cloneDeepWith=ob,y.cloneWith=nb,y.conformsTo=ib,y.deburr=lm,y.defaultTo=VI,y.divide=ck,y.endsWith=dI,y.eq=Nn,y.escape=hI,y.escapeRegExp=fI,y.every=wA,y.find=TA,y.findIndex=xg,y.findKey=Db,y.findLast=EA,y.findLastIndex=Dg,y.findLastKey=Lb,y.floor=lk,y.forEach=Hg,y.forEachRight=$g,y.forIn=Bb,y.forInRight=Ub,y.forOwn=Vb,y.forOwnRight=Fb,y.get=cu,y.gt=ab,y.gte=sb,y.has=Kb,y.hasIn=lu,y.head=Bg,y.identity=Bt,y.includes=kA,y.indexOf=ES,y.inRange=cI,y.invoke=Wb,y.isArguments=ro,y.isArray=se,y.isArrayBuffer=cb,y.isArrayLike=Dt,y.isArrayLikeObject=je,y.isBoolean=lb,y.isBuffer=Mr,y.isDate=ub,y.isElement=db,y.isEmpty=hb,y.isEqual=fb,y.isEqualWith=gb,y.isError=au,y.isFinite=mb,y.isFunction=dr,y.isInteger=Jg,y.isLength=vs,y.isMap=Qg,y.isMatch=pb,y.isMatchWith=vb,y.isNaN=yb,y.isNative=Cb,y.isNil=_b,y.isNull=wb,y.isNumber=Xg,y.isObject=Ke,y.isObjectLike=ze,y.isPlainObject=Gi,y.isRegExp=su,y.isSafeInteger=Tb,y.isSet=Zg,y.isString=ys,y.isSymbol=qt,y.isTypedArray=Lo,y.isUndefined=Eb,y.isWeakMap=Sb,y.isWeakSet=Ab,y.join=kS,y.kebabCase=gI,y.last=hn,y.lastIndexOf=RS,y.lowerCase=mI,y.lowerFirst=pI,y.lt=bb,y.lte=Ib,y.max=uk,y.maxBy=dk,y.mean=hk,y.meanBy=fk,y.min=gk,y.minBy=mk,y.stubArray=mu,y.stubFalse=pu,y.stubObject=ek,y.stubString=tk,y.stubTrue=nk,y.multiply=pk,y.nth=NS,y.noConflict=WI,y.noop=gu,y.now=gs,y.pad=vI,y.padEnd=yI,y.padStart=CI,y.parseInt=wI,y.random=lI,y.reduce=MA,y.reduceRight=xA,y.repeat=_I,y.replace=TI,y.result=Zb,y.round=vk,y.runInContext=b,y.sample=LA,y.size=VA,y.snakeCase=EI,y.some=FA,y.sortedIndex=BS,y.sortedIndexBy=US,y.sortedIndexOf=VS,y.sortedLastIndex=FS,y.sortedLastIndexBy=HS,y.sortedLastIndexOf=$S,y.startCase=AI,y.startsWith=bI,y.subtract=yk,y.sum=Ck,y.sumBy=wk,y.template=II,y.times=rk,y.toFinite=hr,y.toInteger=de,y.toLength=tm,y.toLower=kI,y.toNumber=fn,y.toSafeInteger=kb,y.toString=Ae,y.toUpper=RI,y.trim=NI,y.trimEnd=OI,y.trimStart=PI,y.truncate=MI,y.unescape=xI,y.uniqueId=ik,y.upperCase=DI,y.upperFirst=uu,y.each=Hg,y.eachRight=$g,y.first=Bg,fu(y,function(){var o={};return Kn(y,function(a,u){be.call(y.prototype,u)||(o[u]=a)}),o}(),{chain:!1}),y.VERSION=n,sn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){y[o].placeholder=y}),sn(["drop","take"],function(o,a){pe.prototype[o]=function(u){u=u===t?1:nt(de(u),0);var h=this.__filtered__&&!a?new pe(this):this.clone();return h.__filtered__?h.__takeCount__=_t(u,h.__takeCount__):h.__views__.push({size:_t(u,Ht),type:o+(h.__dir__<0?"Right":"")}),h},pe.prototype[o+"Right"]=function(u){return this.reverse()[o](u).reverse()}}),sn(["filter","map","takeWhile"],function(o,a){var u=a+1,h=u==Ct||u==on;pe.prototype[o]=function(p){var w=this.clone();return w.__iteratees__.push({iteratee:X(p,3),type:u}),w.__filtered__=w.__filtered__||h,w}}),sn(["head","last"],function(o,a){var u="take"+(a?"Right":"");pe.prototype[o]=function(){return this[u](1).value()[0]}}),sn(["initial","tail"],function(o,a){var u="drop"+(a?"":"Right");pe.prototype[o]=function(){return this.__filtered__?new pe(this):this[u](1)}}),pe.prototype.compact=function(){return this.filter(Bt)},pe.prototype.find=function(o){return this.filter(o).head()},pe.prototype.findLast=function(o){return this.reverse().find(o)},pe.prototype.invokeMap=fe(function(o,a){return typeof o=="function"?new pe(this):this.map(function(u){return Hi(u,o,a)})}),pe.prototype.reject=function(o){return this.filter(ps(X(o)))},pe.prototype.slice=function(o,a){o=de(o);var u=this;return u.__filtered__&&(o>0||a<0)?new pe(u):(o<0?u=u.takeRight(-o):o&&(u=u.drop(o)),a!==t&&(a=de(a),u=a<0?u.dropRight(-a):u.take(a-o)),u)},pe.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},pe.prototype.toArray=function(){return this.take(Ht)},Kn(pe.prototype,function(o,a){var u=/^(?:filter|find|map|reject)|While$/.test(a),h=/^(?:head|last)$/.test(a),p=y[h?"take"+(a=="last"?"Right":""):a],w=h||/^find/.test(a);p&&(y.prototype[a]=function(){var T=this.__wrapped__,S=h?[1]:arguments,I=T instanceof pe,x=S[0],D=I||se(T),L=function(me){var ve=p.apply(y,br([me],S));return h&&$?ve[0]:ve};D&&u&&typeof x=="function"&&x.length!=1&&(I=D=!1);var $=this.__chain__,Y=!!this.__actions__.length,Z=w&&!$,he=I&&!Y;if(!w&&D){T=he?T:new pe(this);var ee=o.apply(T,S);return ee.__actions__.push({func:hs,args:[L],thisArg:t}),new ln(ee,$)}return Z&&he?o.apply(this,S):(ee=this.thru(L),Z?h?ee.value()[0]:ee.value():ee)})}),sn(["pop","push","shift","sort","splice","unshift"],function(o){var a=Ua[o],u=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",h=/^(?:pop|shift)$/.test(o);y.prototype[o]=function(){var p=arguments;if(h&&!this.__chain__){var w=this.value();return a.apply(se(w)?w:[],p)}return this[u](function(T){return a.apply(se(T)?T:[],p)})}}),Kn(pe.prototype,function(o,a){var u=y[a];if(u){var h=u.name+"";be.call(Oo,h)||(Oo[h]=[]),Oo[h].push({name:a,func:u})}}),Oo[is(t,K).name]=[{name:"wrapper",func:t}],pe.prototype.clone=xT,pe.prototype.reverse=DT,pe.prototype.value=LT,y.prototype.at=dA,y.prototype.chain=hA,y.prototype.commit=fA,y.prototype.next=gA,y.prototype.plant=pA,y.prototype.reverse=vA,y.prototype.toJSON=y.prototype.valueOf=y.prototype.value=yA,y.prototype.first=y.prototype.head,xi&&(y.prototype[xi]=mA),y},ko=fT();Yr?((Yr.exports=ko)._=ko,hl._=ko):ht._=ko}).call(VB)}(ea,ea.exports)),ea.exports}var Ti=FB();const Qs=UB(Ti),HB={path:"/_/dashboard",component:()=>Promise.resolve().then(()=>require("./AuthRoute-BNwNCD08.js")),meta:{requiresAuth:!1}},$B={path:"/jplan-auth-fail",component:()=>Promise.resolve().then(()=>require("./AuthFailRoute-71aFxEWh.js")),meta:{requiresAuth:!1}},{isAuthenticated:zp,handleRedirect:KB}=Oh(),zB=jc();function qB(r,e){r.addRoute(HB),r.addRoute($B),r.beforeEach(async(t,n,i)=>{function s(d){return d.matched.some(f=>f.meta.requiresAuth)}if(!s(t))return i();if(!zp.value){ie.value=!0;try{await KB(e,t.fullPath),await zB.__init__()}catch(d){console.error("Fail to authenticate",d),await r.push("/jplan-auth-fail")}ie.value=!1}if(zp.value){if(localStorage.getItem("returnRoute")&&localStorage.getItem("returnRoute")!==null){const d=localStorage.getItem("returnRoute")??"/";console.log("trying to go to saved route:",d),i(d),localStorage.removeItem("returnRoute");return}i()}})}const{scope:qp}=jc();function WB(){const r=Dh(),e=c.ref({scope_type:"org"});async function t(n){e.value=n}return c.watch(qp,()=>{r.interceptors.request.use(n=>{const i=n.headers,s=i.Authorization;s&&(i.Authorization=s);const l=qp.value;return l&&(l.scope_type&&(i["j-scope-type"]=l.scope_type,l.organization&&(i["j-scope-organization"]=l.organization),l.team&&(i["j-scope-team"]=l.team)),l.environment&&(i["j-scope-environment"]=l.environment)),n})},{immediate:!0}),Object.assign(r,{setScope:t,scope:e})}function Ei(r){const e=WB();e.defaults.baseURL=r;const t=c.ref({scope_type:"org"});async function n(i){t.value=i}return c.watch(t,()=>{e.interceptors.request.use(i=>{const s=t.value;return delete i.headers["j-scope-type"],delete i.headers["j-scope-organization"],delete i.headers["j-scope-team"],s!=null&&s.scope_type&&(i.headers["j-scope-type"]=s.scope_type),s!=null&&s.organization&&(i.headers["j-scope-organization"]=s.organization),s!=null&&s.team&&(i.headers["j-scope-team"]=s.team),i})},{immediate:!0}),Object.assign(e,{setScope:n,scope:t})}function GB(){const r=Ei("https://api.jplan.com.br/management/organization"),{error:e}=Fn();return{async getOrgList(t){try{const n=t?`?filter_query=${t}`:"",i=await r.get(`/list/${n}`);if(i.data.error)throw e("Failed to fetch Organization list"),new Error(i.data.error);return i.data.data}catch(n){console.error("Error in getOrgList:",n),e("Failed to fetch Organization list");return}},async createOrg(t){var n,i;try{const s=await r.post("/item",t);return s.status>=200&&s.status<300?s:void 0}catch(s){throw console.error("Error in createOrg:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to create Organization"),s}},async updateOrg(t){var n,i;try{const s=await r.patch("/item",t);if(s.data.error)throw e("Failed to update Organization"),new Error(s.data.error);return s}catch(s){throw console.error("Error in updateOrg:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to update Organization"),s}},async getOrg(t){var n,i;try{const s=await r.get(`/item/${t}`);if(s.data.error)throw e("Failed to fetch Organization"),new Error(s.data.error);return s.data}catch(s){throw console.error("Error in getOrg:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to fetch Organization"),s}},async activateOrg(t){var n,i;try{const s=await r.post(`/item/${t}/activate`);if(s.data.error)throw e("Failed to activate Organization"),new Error(s.data.error)}catch(s){throw console.error("Error in activateOrg:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to activate Organization"),s}},async deactivateOrg(t){var n,i;try{const s=await r.post(`/item/${t}/deactivate`);if(s.data.error)throw e("Failed to deactivate Organization"),new Error(s.data.error)}catch(s){throw console.error("Error in deactivateOrg:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to deactivate Organization"),s}}}}const Vr=GB();function jB(){const r=Ei("https://api.jplan.com.br/management/branch/"),{error:e}=Fn();return{async getBranchList(t){try{const n=t?`?filter_query=${t}`:"",i=await r.get(`/list/${n}`);if(i.data.error){e("Failed to fetch Branch list");return}return i.data.data}catch(n){console.error("Error in getBranchList:",n),e("Failed to fetch Branch list")}},async createBranch(t){var n,i;try{const s=await r.post("/item",t);return s.status>=200&&s.status<300?s:void 0}catch(s){console.error("Error in createBranch:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to create Branch")}},async updateBranch(t){var n,i;try{const s=await r.patch("/item",t);if(s.data.error){e(s.data.error||"Failed to update Branch");return}return s}catch(s){console.error("Error in updateBranch:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to update Branch")}},async getBranch(t){var n,i;try{const s=await r.get(`/item/${t}`);if(s.data.error){e(s.data.error||"Failed to fetch Branch");return}return s.data}catch(s){console.error("Error in getBranch:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to fetch Branch")}},async activateBranch(t){var n,i;try{const s=await r.post(`/item/${t}/activate`);if(s.data.error){e(s.data.error||"Failed to activate Branch");return}}catch(s){console.error("Error in activateBranch:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to activate Branch")}},async deactivateBranch(t){var n,i;try{const s=await r.post(`/item/${t}/deactivate`);if(s.data.error){e(s.data.error||"Failed to deactivate Branch");return}}catch(s){console.error("Error in deactivateBranch:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to deactivate Branch")}}}}const Fr=jB();function YB(){const r=Ei("https://api.jplan.com.br/management/team"),{error:e}=Fn();return{async getTeamList(t){try{const n=t?`?filter_query=${t}`:"",i=await r.get(`/list/${n}`);if(i.data.error)throw e("Failed to fetch Team list"),new Error(i.data.error);return i.data.data}catch(n){console.error("Error in getTeamList:",n),e("Failed to fetch Team list");return}},async createTeam(t){var n,i;try{const s=await r.post("/item",t);if(s.data.error)throw e("Failed to create Team"),new Error(s.data.error);return s}catch(s){throw console.error("Error in createTeam:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to create Team"),s}},async updateTeam(t){var n,i;try{const s=await r.patch("/item",t);return s.status>=200&&s.status<300?s:void 0}catch(s){throw console.error("Error in updateTeam:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to update Team"),s}},async getTeam(t){var n,i;try{const s=await r.get(`/item/${t}`);return s.data.error&&e("Failed to fetch Team"),s.data}catch(s){console.error("Error in getTeam:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to fetch Team");return}},async activateTeam(t){var n,i;try{const s=await r.post(`/item/${t}/activate`);if(s.data.error)throw e("Failed to activate Team"),new Error(s.data.error)}catch(s){throw console.error("Error in activateTeam:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to activate Team"),s}},async deactivateTeam(t){var n,i;try{const s=await r.post(`/item/${t}/deactivate`);if(s.data.error)throw e("Failed to deactivate Team"),new Error(s.data.error)}catch(s){throw console.error("Error in deactivateTeam:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to deactivate Team"),s}},async getTeamUserList(t,n){try{const i=n?`?filter_query=${n}`:"",s=await r.get(`/item/${t}/user/list/${i}`);if(s.data.error)throw e("Failed to fetch Team User list"),new Error(s.data.error);return s.data.data}catch(i){console.error("Error in getTeamUserList:",i),e("Failed to fetch Team User list");return}},async linkManageUser(t,n){try{const i=await r.post(`/item/${t}/user/item/`,n);if(i.data.error)throw e("Failed to link User"),new Error(i.data.error);return i.data}catch(i){console.error("Error in link User:",i),e("Failed to link User");return}},async updateManageUser(t,n){try{const i=await r.patch(`/item/${t}/user/item/`,n);if(i.data.error)throw e("Failed to update User"),new Error(i.data.error);return i.data.data}catch(i){throw console.error("Error in update User:",i),e("Failed to update User"),i}},async getManageUser(t,n,i){try{const s=i?`?filter_query=${i}`:"",l=await r.get(`/item/${t}/user/item/${n}/${s}`);if(l.data.error)throw e("Failed to fetch User"),new Error(l.data.error);return l.data.data}catch(s){console.error("Error in getUser:",s),e("Failed to fetch User");return}},async unlinkManageUser(t,n,i){try{const s=i?`?filter_query=${i}`:"";await r.delete(`/item/${t}/user/item/${n}/${s}`)}catch(s){throw console.error("Error in unlink User:",s),e("Failed to unlink User"),s}}}}const Xt=YB();async function JB({url:r,method:e,header:t={},body:n,bearerToken:i}){const s=i?{Authorization:`Bearer ${i}`}:{};try{return(await $e({url:r,method:e,headers:{...t,...s},data:n??{}})).data}catch(l){throw console.error(`Request failed for ${e} ${r}:`,l),l}}function Si(r,e,t=[]){const n=XB(e);if(!n)return r;const i=n.split(" ");return r.filter(s=>QB(s,i,t))}function QB(r,e,t){return t.some(n=>{const i=Qs.get(r,n);if(Qs.isNil(i))return!1;const s=Qs.toString(i).toLowerCase();return e.every(l=>s.includes(l))})}function XB(r){return Qs.trim(r).toLowerCase().replace(/\s+/g," ")}let Ds=!1;const zu=c.ref(!1),gn=c.ref([]),Wp=c.ref([]),qe=c.ref(null),Wo=c.ref([]),Go=c.ref([]),kw=()=>{const r=Fn(),e=async _=>{zu.value=!0;const A=_?`_active eq true and ${_}`:"_active eq true",N=await Vr.getOrgList(A);N&&(gn.value=N,Ds=!0),zu.value=!1},t=async _=>{var A;return(A=gn.value)!=null&&A.length||await e(_),gn.value};function n(_){if(!gn.value)throw new Error("Data not stored yet");const A=Si(gn.value,_,["name","description"]);return _!==""?A:gn.value}const i=_=>{Wp.value=_},s=_=>{qe.value=Ti.cloneDeep(_)},l=async _=>await Vr.getOrg(_),d=async()=>{if(qe.value!=null){const _=await Vr.createOrg(qe.value);return _!=null&&_.data.created_at&&(r.success("Organization created."),Ds&&gn.value.push(_.data)),_==null?void 0:_.data}},f=async()=>{if(ie.value=!0,qe.value&&qe.value.__id){const _=await Vr.updateOrg(qe.value);if(Ds&&(_!=null&&_.data.__id)){const A=gn.value.findIndex(N=>N.__id===_.data.__id);return A!==-1?(gn.value[A]=_.data,r.success("Organization updated.")):r.error("Unable to update item"),ie.value=!1,_.data}}else ie.value=!1,r.error("Unable to update item")},g=async()=>{if(ie.value=!0,qe.value&&qe.value.created_at){if(await Vr.deactivateOrg(qe.value.__id),Ds){const _=gn.value.findIndex(A=>{var N;return A.__id===((N=qe.value)==null?void 0:N.__id)});if(_!==-1)return gn.value.splice(_,1),qe.value;r.error("Unable to deactivate organization")}ie.value=!1}};async function m(_){ie.value=!0;try{if(qe.value&&qe.value.__id){const A={..._,organization:qe.value.__id};if(!await Fr.updateBranch(A)){ie.value=!1;return}if(Wo.value.findIndex(V=>V.__id===_.__id)===-1)return r.success("Branch added successfully."),Wo.value.push(A),A;r.info("Branch already added.")}}catch(A){console.error(A)}finally{ie.value=!1}}async function C(_){if(ie.value=!0,qe.value&&qe.value.__id){const A={..._,organization:null};if(!await Fr.updateBranch(A)){ie.value=!1;return}const K=Wo.value.findIndex(V=>V.__id===_.__id);if(K!==-1)return Wo.value.splice(K,1),ie.value=!1,Wo.value;throw new Error("Item not found to remove")}ie.value=!1}async function v(_){ie.value=!0;try{if(qe.value&&qe.value.__id){const A={..._,organization:qe.value.__id};if(!await Xt.updateTeam(A)){ie.value=!1;return}if(Go.value.findIndex(V=>V.__id===_.__id)===-1)return r.success("Team added successfully."),Go.value.push(A),A;r.info("Team already added.")}}catch(A){console.error(A)}finally{ie.value=!1}}async function E(_){if(ie.value=!0,qe.value&&qe.value.__id){const A={..._,organization:null};if(!await Xt.updateTeam(A)){ie.value=!1;return}const K=Go.value.findIndex(V=>V.__id===_.__id);if(K!==-1)return Go.value.splice(K,1),ie.value=!1,Go.value;throw new Error("Item not found to remove")}ie.value=!1}return{data:gn,loading:zu,columns:Wp,item:qe,filterData:n,__init__:e,getData:t,setColumns:i,setItem:s,getItem:l,createItem:d,updateItem:f,removeItem:g,orgBranches:Wo,orgTeams:Go,linkBranch:m,unlinkBranch:C,linkTeam:v,unlinkTeam:E}};let Ls=!1;const mn=c.ref([]),Gp=c.ref([]),rt=c.ref(null),qu=c.ref(!1),jo=c.ref([]),Rw=()=>{const r=Fn(),e=async v=>{qu.value=!0;const E=v?`_active eq true and ${v}`:"_active eq true",_=await Xt.getTeamList(E);_&&(mn.value=_,Ls=!0),qu.value=!1},t=async v=>(mn.value.length||await e(v),mn.value);function n(v){if(!mn.value)throw new Error("Data not stored yet");const E=Si(mn.value,v,["name","description"]);return v!==""?E:mn.value}const i=v=>{Gp.value=v},s=v=>{rt.value=Ti.cloneDeep(v)},l=async v=>await Xt.getTeam(v),d=async()=>{if(rt.value!=null){const v=await Xt.createTeam(rt.value);return v!=null&&v.data.created_at&&(r.success("Team created."),Ls&&mn.value.push(v.data)),v==null?void 0:v.data}},f=async()=>{if(ie.value=!0,rt.value&&rt.value.__id){const v=await Xt.updateTeam(rt.value);if(Ls&&(v!=null&&v.data.__id)){const E=mn.value.findIndex(_=>_.__id===v.data.__id);return E!==-1?(mn.value[E]=v.data,r.success("Team updated.")):r.error("Unable to update item"),v.data}}else r.error("Unable to update item")},g=async()=>{if(rt.value&&rt.value.created_at&&(await Xt.deactivateTeam(rt.value.__id),Ls)){const v=mn.value.findIndex(E=>{var _;return E.__id===((_=rt.value)==null?void 0:_.__id)});if(v!==-1)return mn.value.splice(v,1),rt.value;r.error("Unable to deactivate organization")}};async function m(v){var E;if(ie.value=!0,(E=rt.value)!=null&&E.__id)if(jo.value.findIndex(A=>A.__id===v.__id)===-1)try{const A=await Xt.linkManageUser(rt.value.__id,{team:rt.value.__id,user:v.__id,role:"string",joined_at:"string",comments:"string"}),N=await Xt.getTeamUserList(rt.value.__id);return N&&(jo.value=N),r.success("User added successfully."),A}catch(A){console.error(A),r.error("Unable to add User.")}finally{ie.value=!1}else r.info("User already added.");else console.warn("No item selected or item ID is missing."),r.info("Please select a valid item.");ie.value=!1}async function C(v){if(ie.value=!0,rt.value&&rt.value.__id){const E=jo.value.findIndex(_=>_.__id===v);if(E!==-1)return await Xt.unlinkManageUser(rt.value.__id,v),jo.value.splice(E,1),ie.value=!1,jo.value;throw new Error("Item not found to remove")}ie.value=!1}return{data:mn,loading:qu,columns:Gp,item:rt,usersTeam:jo,__init__:e,getData:t,filterData:n,setColumns:i,setItem:s,getItem:l,createItem:d,updateItem:f,removeItem:g,linkUser:m,unlinkUser:C}},Nw=c.defineComponent({__name:"GlobalScopeFilter",setup(r){var A,N,K;const{openDialog:e}=va("global-scope__J-"),{user:t,scope:n,session:i,setScope:s}=jc(),{getData:l,data:d}=kw(),{getData:f,data:g}=Rw(),m=c.ref(!1);c.onBeforeMount(async()=>{m.value=!0,await l(),await f(),m.value=!1});const C=c.ref({scope_type:(A=n.value)==null?void 0:A.scope_type,organization:((N=n.value)==null?void 0:N.organization)??"org",team:(K=n.value)==null?void 0:K.team});function v(){var V,U,Q;C.value={...n.value,scope_type:(V=n.value)==null?void 0:V.scope_type,organization:((U=n.value)==null?void 0:U.organization)??"",team:(Q=n.value)==null?void 0:Q.team},e()}const E=c.computed(()=>{var V;switch((V=n.value)==null?void 0:V.scope_type){case"user":return P1;case"org":return N1;case"team":return M1;default:return O1}});async function _(){var V;((V=n.value)==null?void 0:V.scope_type)!==""&&s(C.value)}return(V,U)=>(c.openBlock(),c.createElementBlock(c.Fragment,null,[c.createVNode(Be.VBtn,{onClick:v,icon:"",class:"text-secondary",color:"surface",rounded:"sm",size:"small",variant:"flat"},{default:c.withCtx(()=>[(c.openBlock(),c.createBlock(c.resolveDynamicComponent(E.value),{size:"20"}))]),_:1}),c.createVNode(c.unref(Ca),{loading:m.value,title:"Scope","dd-id":"global-scope__J-",onOnSave:_},{default:c.withCtx(()=>[c.createElementVNode("div",null,[c.createVNode(Oe.VRow,null,{default:c.withCtx(()=>[c.createVNode(Oe.VCol,{cols:"4",class:"d-flex flex-row align-center"},{default:c.withCtx(()=>[c.createVNode(St.VListItem,null,{default:c.withCtx(()=>[c.createVNode(St.VListItemTitle,null,{default:c.withCtx(()=>U[3]||(U[3]=[c.createTextVNode(" User")])),_:1}),c.createVNode(St.VListItemSubtitle,null,{default:c.withCtx(()=>{var Q;return[c.createTextVNode(c.toDisplayString(((Q=c.unref(t))==null?void 0:Q.name)||"Unknown"),1)]}),_:1})]),_:1})]),_:1}),c.createVNode(Oe.VCol,{cols:"4"},{default:c.withCtx(()=>[c.createVNode(St.VListItem,null,{default:c.withCtx(()=>[c.createVNode(St.VListItemTitle,null,{default:c.withCtx(()=>U[4]||(U[4]=[c.createTextVNode(" Domain")])),_:1}),c.createVNode(St.VListItemSubtitle,null,{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(c.unref(i).domain),1)]),_:1})]),_:1})]),_:1}),c.createVNode(Oe.VCol,{cols:"4"},{default:c.withCtx(()=>[c.createVNode(St.VListItem,null,{default:c.withCtx(()=>[c.createVNode(St.VListItemTitle,null,{default:c.withCtx(()=>U[5]||(U[5]=[c.createTextVNode(" Environment")])),_:1}),c.createVNode(St.VListItemSubtitle,null,{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(c.unref(i).environment),1)]),_:1})]),_:1})]),_:1})]),_:1}),c.createVNode(Ak.VBtnToggle,{density:"compact",variant:"outlined",modelValue:C.value.scope_type,"onUpdate:modelValue":U[0]||(U[0]=Q=>C.value.scope_type=Q),class:"d-flex justify-center my-4"},{default:c.withCtx(()=>[c.createVNode(Be.VBtn,{value:"org",label:"Organizational",color:"secondary",class:""},{default:c.withCtx(()=>U[6]||(U[6]=[c.createTextVNode("Organizational")])),_:1}),c.createVNode(Be.VBtn,{value:"team",label:"Team",color:"secondary",class:""},{default:c.withCtx(()=>U[7]||(U[7]=[c.createTextVNode("Team")])),_:1}),c.createVNode(Be.VBtn,{value:"user",label:"User",color:"secondary",class:""},{default:c.withCtx(()=>U[8]||(U[8]=[c.createTextVNode("User")])),_:1}),c.createVNode(Be.VBtn,{value:"",label:"None",color:"lightext",class:""},{default:c.withCtx(()=>U[9]||(U[9]=[c.createTextVNode("None")])),_:1})]),_:1},8,["modelValue"]),c.createElementVNode("div",null,[c.createVNode(ua.VLabel,{class:"text-subtitle-1 text-high-emphasis mb-2"},{default:c.withCtx(()=>U[10]||(U[10]=[c.createTextVNode("Organization")])),_:1}),c.createVNode(ta.VSelect,{items:c.unref(d),"item-title":"name","item-value":"__id",variant:"solo","bg-color":"containerBg",rounded:"false",placeholder:"Select a Organization",class:"min-w-50",modelValue:C.value.organization,"onUpdate:modelValue":U[1]||(U[1]=Q=>C.value.organization=Q),clearable:""},null,8,["items","modelValue"]),c.createVNode(ua.VLabel,{class:"text-subtitle-1 text-high-emphasis mb-2"},{default:c.withCtx(()=>U[11]||(U[11]=[c.createTextVNode("Team")])),_:1}),c.createVNode(ta.VSelect,{items:c.unref(g),"item-title":"name","item-value":"__id",variant:"solo","bg-color":"containerBg",rounded:"false",placeholder:"Select a Team",class:"min-w-50",modelValue:C.value.team,"onUpdate:modelValue":U[2]||(U[2]=Q=>C.value.team=Q),clearable:""},null,8,["items","modelValue"])])])]),_:1},8,["loading"])],64))}}),ZB={},eU={class:"double-ring-spinner-container"};function tU(r,e){return c.openBlock(),c.createElementBlock("div",eU,e[0]||(e[0]=[c.createElementVNode("div",{class:"spinner-loading"},[c.createElementVNode("div"),c.createElementVNode("div"),c.createElementVNode("div",null,[c.createElementVNode("div")]),c.createElementVNode("div",null,[c.createElementVNode("div")])],-1)]))}const Ow=vi(ZB,[["render",tU],["__scopeId","data-v-00d7a69f"]]),nU={key:0,class:"_jspinner-overlay_jj"},Pw=c.defineComponent({__name:"GlobalSpinner",setup(r){return(e,t)=>c.unref(ie)?(c.openBlock(),c.createElementBlock("div",nU,t[0]||(t[0]=[c.createElementVNode("div",{class:"j-double-ring-spinner-container"},[c.createElementVNode("div",{class:"j-global-spinner-loading"},[c.createElementVNode("div"),c.createElementVNode("div"),c.createElementVNode("div",null,[c.createElementVNode("div")]),c.createElementVNode("div",null,[c.createElementVNode("div")])])],-1)]))):c.createCommentVNode("",!0)}}),Mw=c.defineComponent({__name:"SubMenu",props:{title:{}},setup(r,{expose:e}){return e({props:r}),(n,i)=>(c.openBlock(),c.createBlock(St.VListItem,{onClick:i[0]||(i[0]=()=>{}),density:"compact"},{append:c.withCtx(()=>[c.createVNode(c.unref(x1))]),default:c.withCtx(()=>[c.createVNode(St.VListItemTitle,null,{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(n.title),1)]),_:1}),c.createVNode(Md.VMenu,{activator:"parent","open-on-hover":"",submenu:"",density:"compact"},{default:c.withCtx(()=>[c.renderSlot(n.$slots,"default")]),_:3})]),_:3}))}}),rU=Object.freeze(Object.defineProperty({__proto__:null,AvatarPicture:Dv,ColumnSettingsDialog:$d,ConfirmDialog:Mv,ContextMenu:Lv,CopyButton:yc,DeleteAllBtn:Bd,DotsMenu:Pv,EditButton:Ov,FormHeadless:fy,FormMetadata:kc,GlobalScopeFilter:Nw,GlobalSpinner:Pw,JAvatar:xv,JBtn:ev,JDialog:Ca,JForm:dy,JIconBtn:Zp,JSelect:sy,JTextArea:cy,JTextField:ay,ParentCard:Ec,SearchFilter:bc,SpinnerLoader:Ow,SubMenu:Mw,TabFormHeader:hy,TableAdvanced:Kv,TableCard:Kd,TableCardsView:oy,TableHeader:zv,UiTable:Bv},Symbol.toStringTag,{value:"Module"})),oU=eR(),iU={transition:"Vue-Toastification__fade",maxToasts:20,newestOnTop:!0};let Wu=!1;const Gu=c.ref(!1),pn=c.ref([]),jp=c.ref([]),gt=c.ref(null),Yo=c.ref([]),aU=()=>{const r=Fn(),e=async v=>{Gu.value=!0;const E=v?`_active eq true and ${v}`:"_active eq true",_=await Fr.getBranchList(E);_&&(pn.value=_,Wu=!0),Gu.value=!1},t=async v=>(pn.value.length||await e(v),pn.value);function n(v){if(!pn.value)throw new Error("Data not stored yet");const E=Si(pn.value,v,["name","description"]);return v!==""?E:pn.value}const i=v=>{jp.value=v},s=v=>{gt.value=Ti.cloneDeep(v)},l=async v=>await Fr.getBranch(v),d=async()=>{if(gt.value!=null){const v=await Fr.createBranch(gt.value);return v!=null&&v.data.created_at&&(r.success("Branch created."),Wu&&pn.value.push(v.data)),v==null?void 0:v.data}},f=async()=>{if(gt.value&&gt.value.__id){const v=await Fr.updateBranch(gt.value);if(Wu&&v){const E=pn.value.findIndex(_=>_.__id===v.data.__id);return E!==-1?(pn.value[E]=v.data,r.success("Branch updated.")):r.error("Unable to update item"),v}}else r.error("Unable to update item")},g=async()=>{if(gt.value&&gt.value.created_at){await Fr.deactivateBranch(gt.value.__id);const v=pn.value.findIndex(E=>{var _;return E.__id===((_=gt.value)==null?void 0:_.__id)});if(v!==-1)return pn.value.splice(v,1),gt.value;r.error("Unable to deactivate Domain")}};async function m(v){ie.value=!0;try{if(gt.value&&gt.value.__id){const E={...v,branch:gt.value.__id};if(!await Xt.updateTeam(E)){r.error("Unable to link team");return}if(Yo.value.findIndex(N=>N.__id===v.__id)===-1)return r.success("Team added successfully."),Yo.value.push(E),E;r.info("Team already added.")}else throw new Error("Item is not defined")}catch(E){console.error(E)}finally{ie.value=!1}}async function C(v){if(ie.value=!0,gt.value&&gt.value.__id){const E={...v,branch:null};if(!await Xt.updateTeam(E))return;const A=Yo.value.findIndex(N=>N.__id===v.__id);if(A!==-1)return Yo.value.splice(A,1),ie.value=!1,Yo.value;throw new Error("Item not found to remove")}ie.value=!1}return{data:pn,columns:jp,item:gt,loading:Gu,__init__:e,getData:t,filterData:n,setColumns:i,setItem:s,getItem:l,createItem:d,updateItem:f,removeItem:g,branchTeams:Yo,linkTeam:m,unlinkTeam:C}};function sU(){const r=Ei("https://api.jplan.com.br/management/division"),{error:e}=Fn();return{async getDivisionList(t){try{const n=t?`?filter_query=${t}`:"",i=await r.get(`/list/${n}`);if(i.data.error)throw e("Failed to fetch Division list"),new Error(i.data.error);return i.data.data}catch(n){console.error("Error in getDivisionList:",n),e("Failed to fetch Division list");return}},async createDivision(t){var n,i;try{const s=await r.post("/item",t);return s.status>=200&&s.status<300?s:void 0}catch(s){throw console.error("Error in createDivision:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to create Division"),s}},async updateDivision(t){var n,i;try{const s=await r.patch("/item",t);if(s.data.error)throw e("Failed to update Division"),new Error(s.data.error);return s}catch(s){throw console.error("Error in updateDivision:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to update Division"),s}},async getDivision(t){var n,i;try{const s=await r.get(`/item/${t}`);if(s.data.error)throw e("Failed to fetch Division"),new Error(s.data.error);return s.data}catch(s){throw console.error("Error in getDivision:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to fetch Division"),s}},async activateDivision(t){var n,i;try{const s=await r.post(`/item/${t}/activate`);if(s.data.error)throw e("Failed to activate Division"),new Error(s.data.error)}catch(s){throw console.error("Error in activateDivision:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to activate Division"),s}},async deactivateDivision(t){var n,i;try{const s=await r.post(`/item/${t}/deactivate`);if(s.data.error)throw e("Failed to deactivate Division"),new Error(s.data.error)}catch(s){throw console.error("Error in deactivateDivision:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to deactivate Division"),s}}}}const ti=sU();let ju=!1;const Yu=c.ref(!1),vn=c.ref([]),Yp=c.ref([]),mt=c.ref(null),Jo=c.ref([]),cU=()=>{const r=Fn(),e=async v=>{Yu.value=!0;const E=v?`_active eq true and ${v}`:"_active eq true",_=await ti.getDivisionList(E);_&&(vn.value=_,ju=!0),Yu.value=!1},t=async v=>(vn.value.length||await e(v),vn.value);function n(v){if(!vn.value)throw new Error("Data not stored yet");const E=Si(vn.value,v,["name","description"]);return v!==""?E:vn.value}const i=v=>{Yp.value=v},s=v=>{mt.value=Ti.cloneDeep(v)},l=async v=>await ti.getDivision(v),d=async()=>{if(mt.value!=null){const v=await ti.createDivision(mt.value);return v!=null&&v.data.created_at&&(r.success("Division created."),ju&&vn.value.push(v.data)),v==null?void 0:v.data}},f=async()=>{if(ie.value=!0,mt.value&&mt.value.__id){const v=await ti.updateDivision(mt.value);if(ju&&(v!=null&&v.data.__id)){const E=vn.value.findIndex(_=>_.__id===v.data.__id);return E!==-1?(vn.value[E]=v.data,r.success("Updated Division.")):r.error("Unable to update item"),ie.value=!1,v}}else ie.value=!1,r.error("Unable to update item")},g=async()=>{if(ie.value=!0,mt.value&&mt.value.created_at){await ti.deactivateDivision(mt.value.__id);const v=vn.value.findIndex(E=>{var _;return E.__id===((_=mt.value)==null?void 0:_.__id)});if(v!==-1)return vn.value.splice(v,1),mt.value;r.error("Unable to deactivate Division")}ie.value=!1};async function m(v){ie.value=!0;try{if(mt.value&&mt.value.__id){const E={...v,division:mt.value.__id};return await Vr.updateOrg(E)?(Jo.value.findIndex(N=>N.__id===v.__id)===-1?(r.success("Organization added successfully."),Jo.value.push(E)):r.info("Organization already added."),E):void 0}else throw new Error("Item is not defined")}catch(E){console.error(E)}finally{ie.value=!1}}async function C(v){if(ie.value=!0,mt.value&&mt.value.__id){const E={...v,division:null};if(!await Vr.updateOrg(E))return;const A=Jo.value.findIndex(N=>N.__id===v.__id);if(A!==-1)Jo.value.splice(A,1);else throw new Error("Item não encontrado para remoção")}else throw new Error("Item não está definido");return ie.value=!1,Jo.value}return{data:vn,columns:Yp,item:mt,loading:Yu,__init__:e,filterData:n,getData:t,setColumns:i,setItem:s,getItem:l,createItem:d,updateItem:f,removeItem:g,orgs:Jo,linkDivision:m,unlinkDivision:C}};function lU(){const r=Ei("https://api.jplan.com.br/management/user"),{error:e}=Fn();return{async getManageUserList(t){try{const n=t?`?filter_query=${t}`:"",i=await r.get(`/list/${n}`);if(i.data.error)throw e("Failed to fetch User list"),new Error(i.data.error);return i.data.data}catch(n){console.error("Error in getManageUserList:",n),e("Failed to fetch User list");return}},async createManageUser(t){var n,i;try{const s=await r.post("/item",t);return s.status>=200&&s.status<300?s:void 0}catch(s){throw console.error("Error in createManageUser:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to create User"),s}},async updateManageUser(t){var n,i;try{const s=await r.patch("/item",t);if(s.data.error)throw e("Failed to update User"),new Error(s.data.error);return s}catch(s){throw console.error("Error in updateManageUser:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to update User"),s}},async getManageUser(t){var n,i;try{const s=await r.get(`/item/${t}`);if(s.data.error)throw e("Failed to fetch User"),new Error(s.data.error);return s.data}catch(s){console.error("Error in getManageUser:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to fetch User");return}},async activateManageUser(t){var n,i;try{const s=await r.post(`/item/${t}/activate`);if(s.data.error)throw e("Failed to activate User"),new Error(s.data.error)}catch(s){throw console.error("Error in activateManageUser:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to activate User"),s}},async deactivateManageUser(t){var n,i;try{const s=await r.post(`/item/${t}/deactivate`);if(s.data.error)throw e("Failed to deactivate User"),new Error(s.data.error)}catch(s){throw console.error("Error in deactivateManageUser:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to deactivate User"),s}}}}const ni=lU();let Ju=!1,Qu=c.ref(!1);const yn=c.ref([]),Jp=c.ref([]),Cn=c.ref(null),uU=c.ref(null),dU=c.ref([]),hU=()=>{const r=Fn(),e=async m=>{Qu.value=!0;const C=m?`_active eq true and ${m}`:"_active eq true",v=await ni.getManageUserList(C);v&&(yn.value=v,Ju=!0),Qu.value=!1},t=async m=>(yn.value.length||await e(m),yn.value);function n(m){if(!yn.value)throw new Error("Data not stored yet");const C=Si(yn.value,m,["name","description"]);return m!==""?C:yn.value}return{data:yn,loading:Qu,columns:Jp,item:Cn,filterData:n,__init__:e,getData:t,setColumns:m=>{Jp.value=m},setItem:m=>{Cn.value=Ti.cloneDeep(m)},getItem:async m=>await ni.getManageUser(m),createItem:async()=>{if(Cn.value!=null){const m=crypto.randomUUID(),C=await ni.createManageUser({...Cn.value,__id:m});return C!=null&&C.data.created_at&&(r.success("User created."),Ju&&yn.value.push(C.data)),C==null?void 0:C.data}},updateItem:async()=>{if(ie.value=!0,Cn.value&&Cn.value.created_at){const m=await ni.updateManageUser(Cn.value);if(Ju&&(m!=null&&m.data)){const C=yn.value.findIndex(v=>v.__id===(m==null?void 0:m.data.__id));if(C!==-1)yn.value[C]=m==null?void 0:m.data,r.success("User created.");else throw new Error("Unable to find item after update")}return ie.value=!1,m==null?void 0:m.data}},removeItem:async()=>{if(Cn.value&&Cn.value.created_at){try{await ni.deactivateManageUser(Cn.value.__id)}catch{r.error("Unable to deactivate user");return}const m=yn.value.findIndex(C=>{var v;return C.__id===((v=Cn.value)==null?void 0:v.__id)});if(m!==-1)return yn.value.splice(m,1),Cn.value}},userOrg:uU,userTeams:dU}},fU=r=>{r.use(oU),r.use(n0,iU),Object.entries(rU).forEach(([e,t])=>{r.component(e,t)}),Object.entries(Ik).forEach(([e,t])=>{r.provide(e,t)})},gU={install:fU};exports.ContextMenu=Lv;exports.EmptyListImg=td;exports.EventBus=_c;exports.FormHeadless=fy;exports.HttpCore=JB;exports.SpinnerLoader=Ow;exports.TableCardsView=oy;exports.TableHeader=zv;exports.__spinner=ie;exports._export_sfc=vi;exports._sfc_main=Bv;exports._sfc_main$1=Kv;exports._sfc_main$10=Bd;exports._sfc_main$11=Ov;exports._sfc_main$12=Zp;exports._sfc_main$13=sy;exports._sfc_main$14=cy;exports._sfc_main$15=ay;exports._sfc_main$16=dy;exports._sfc_main$17=hy;exports._sfc_main$18=Ec;exports._sfc_main$19=xv;exports._sfc_main$2=$d;exports._sfc_main$20=Dv;exports._sfc_main$21=Ca;exports._sfc_main$22=Mw;exports._sfc_main$23=Nw;exports._sfc_main$24=Pw;exports._sfc_main$3=Kd;exports._sfc_main$4=bc;exports._sfc_main$5=Mv;exports._sfc_main$6=yc;exports._sfc_main$7=Pv;exports._sfc_main$8=kc;exports._sfc_main$9=ev;exports.branchInstance=Fr;exports.coreClient=Dh;exports.createToastInterface=fa;exports.dateFormat=$v;exports.divisionInstance=ti;exports.filterQuery=Si;exports.globalEventBus=Ld;exports.index=gU;exports.manageUserInstance=ni;exports.msal=yt;exports.orgInstance=Vr;exports.provideToast=t0;exports.scopedClient=Ei;exports.setupAuthGuard=qB;exports.teamInstance=Xt;exports.toastInjectionKey=Tc;exports.useAuth=Oh;exports.useBranchStore=aU;exports.useCustomizer=iR;exports.useDialog=va;exports.useDivisionStore=cU;exports.useManageUserStore=hU;exports.useOrganizationStore=kw;exports.useSession=jc;exports.useTeamStore=Rw;exports.useToast=Fn;
92
+ }`;var he=dm(function(){return Ee(w,Y+"return "+L).apply(t,T)});if(he.source=L,au(he))throw he;return he}function kI(o){return Ae(o).toLowerCase()}function RI(o){return Ae(o).toUpperCase()}function NI(o,a,u){if(o=Ae(o),o&&(u||a===t))return wf(o);if(!o||!(a=zt(a)))return o;var h=kn(o),p=kn(a),w=_f(h,p),T=Tf(h,p)+1;return Pr(h,w,T).join("")}function OI(o,a,u){if(o=Ae(o),o&&(u||a===t))return o.slice(0,Sf(o)+1);if(!o||!(a=zt(a)))return o;var h=kn(o),p=Tf(h,kn(a))+1;return Pr(h,0,p).join("")}function PI(o,a,u){if(o=Ae(o),o&&(u||a===t))return o.replace(al,"");if(!o||!(a=zt(a)))return o;var h=kn(o),p=_f(h,kn(a));return Pr(h,p).join("")}function MI(o,a){var u=j,h=W;if(Ke(a)){var p="separator"in a?a.separator:p;u="length"in a?de(a.length):u,h="omission"in a?zt(a.omission):h}o=Ae(o);var w=o.length;if(bo(o)){var T=kn(o);w=T.length}if(u>=w)return o;var S=u-Io(h);if(S<1)return h;var I=T?Pr(T,0,S).join(""):o.slice(0,S);if(p===t)return I+h;if(T&&(S+=I.length-S),su(p)){if(o.slice(S).search(p)){var x,D=I;for(p.global||(p=El(p.source,Ae(Hh.exec(p))+"g")),p.lastIndex=0;x=p.exec(D);)var L=x.index;I=I.slice(0,L===t?S:L)}}else if(o.indexOf(zt(p),S)!=S){var $=I.lastIndexOf(p);$>-1&&(I=I.slice(0,$))}return I+h}function xI(o){return o=Ae(o),o&&qw.test(o)?o.replace(Uh,lT):o}var DI=xo(function(o,a,u){return o+(u?" ":"")+a.toUpperCase()}),uu=hg("toUpperCase");function um(o,a,u){return o=Ae(o),a=u?t:a,a===t?oT(o)?hT(o):Y_(o):o.match(a)||[]}var dm=fe(function(o,a){try{return $t(o,t,a)}catch(u){return au(u)?u:new ae(u)}}),LI=lr(function(o,a){return sn(a,function(u){u=qn(u),sr(o,u,ou(o[u],o))}),o});function BI(o){var a=o==null?0:o.length,u=X();return o=a?Ve(o,function(h){if(typeof h[1]!="function")throw new cn(l);return[u(h[0]),h[1]]}):[],fe(function(h){for(var p=-1;++p<a;){var w=o[p];if($t(w[0],this,h))return $t(w[1],this,h)}})}function UI(o){return lE(un(o,C))}function du(o){return function(){return o}}function VI(o,a){return o==null||o!==o?a:o}var FI=gg(),HI=gg(!0);function Bt(o){return o}function hu(o){return zf(typeof o=="function"?o:un(o,C))}function $I(o){return Wf(un(o,C))}function KI(o,a){return Gf(o,un(a,C))}var zI=fe(function(o,a){return function(u){return Hi(u,o,a)}}),qI=fe(function(o,a){return function(u){return Hi(o,u,a)}});function fu(o,a,u){var h=st(a),p=es(a,h);u==null&&!(Ke(a)&&(p.length||!h.length))&&(u=a,a=o,o=this,p=es(a,st(a)));var w=!(Ke(u)&&"chain"in u)||!!u.chain,T=dr(o);return sn(p,function(S){var I=a[S];o[S]=I,T&&(o.prototype[S]=function(){var x=this.__chain__;if(w||x){var D=o(this.__wrapped__),L=D.__actions__=xt(this.__actions__);return L.push({func:I,args:arguments,thisArg:o}),D.__chain__=x,D}return I.apply(o,br([this.value()],arguments))})}),o}function WI(){return ht._===this&&(ht._=yT),this}function gu(){}function GI(o){return o=de(o),fe(function(a){return jf(a,o)})}var jI=ql(Ve),YI=ql(mf),JI=ql(pl);function hm(o){return Xl(o)?vl(qn(o)):bE(o)}function QI(o){return function(a){return o==null?t:eo(o,a)}}var XI=pg(),ZI=pg(!0);function mu(){return[]}function pu(){return!1}function ek(){return{}}function tk(){return""}function nk(){return!0}function rk(o,a){if(o=de(o),o<1||o>at)return[];var u=Ht,h=_t(o,Ht);a=X(a),o-=Ht;for(var p=wl(h,a);++u<o;)a(u);return p}function ok(o){return se(o)?Ve(o,qn):qt(o)?[o]:xt(Pg(Ae(o)))}function ik(o){var a=++pT;return Ae(o)+a}var ak=as(function(o,a){return o+a},0),sk=Wl("ceil"),ck=as(function(o,a){return o/a},1),lk=Wl("floor");function uk(o){return o&&o.length?Za(o,Bt,Ol):t}function dk(o,a){return o&&o.length?Za(o,X(a,2),Ol):t}function hk(o){return yf(o,Bt)}function fk(o,a){return yf(o,X(a,2))}function gk(o){return o&&o.length?Za(o,Bt,Dl):t}function mk(o,a){return o&&o.length?Za(o,X(a,2),Dl):t}var pk=as(function(o,a){return o*a},1),vk=Wl("round"),yk=as(function(o,a){return o-a},0);function Ck(o){return o&&o.length?Cl(o,Bt):0}function wk(o,a){return o&&o.length?Cl(o,X(a,2)):0}return y.after=$A,y.ary=Kg,y.assign=Rb,y.assignIn=rm,y.assignInWith=Cs,y.assignWith=Nb,y.at=Ob,y.before=zg,y.bind=ou,y.bindAll=LI,y.bindKey=qg,y.castArray=eb,y.chain=Fg,y.chunk=lS,y.compact=uS,y.concat=dS,y.cond=BI,y.conforms=UI,y.constant=du,y.countBy=CA,y.create=Pb,y.curry=Wg,y.curryRight=Gg,y.debounce=jg,y.defaults=Mb,y.defaultsDeep=xb,y.defer=KA,y.delay=zA,y.difference=hS,y.differenceBy=fS,y.differenceWith=gS,y.drop=mS,y.dropRight=pS,y.dropRightWhile=vS,y.dropWhile=yS,y.fill=CS,y.filter=_A,y.flatMap=SA,y.flatMapDeep=AA,y.flatMapDepth=bA,y.flatten=Lg,y.flattenDeep=wS,y.flattenDepth=_S,y.flip=qA,y.flow=FI,y.flowRight=HI,y.fromPairs=TS,y.functions=Hb,y.functionsIn=$b,y.groupBy=IA,y.initial=SS,y.intersection=AS,y.intersectionBy=bS,y.intersectionWith=IS,y.invert=zb,y.invertBy=qb,y.invokeMap=RA,y.iteratee=hu,y.keyBy=NA,y.keys=st,y.keysIn=Lt,y.map=fs,y.mapKeys=Gb,y.mapValues=jb,y.matches=$I,y.matchesProperty=KI,y.memoize=ms,y.merge=Yb,y.mergeWith=om,y.method=zI,y.methodOf=qI,y.mixin=fu,y.negate=ps,y.nthArg=GI,y.omit=Jb,y.omitBy=Qb,y.once=WA,y.orderBy=OA,y.over=jI,y.overArgs=GA,y.overEvery=YI,y.overSome=JI,y.partial=iu,y.partialRight=Yg,y.partition=PA,y.pick=Xb,y.pickBy=im,y.property=hm,y.propertyOf=QI,y.pull=OS,y.pullAll=Ug,y.pullAllBy=PS,y.pullAllWith=MS,y.pullAt=xS,y.range=XI,y.rangeRight=ZI,y.rearg=jA,y.reject=DA,y.remove=DS,y.rest=YA,y.reverse=nu,y.sampleSize=BA,y.set=eI,y.setWith=tI,y.shuffle=UA,y.slice=LS,y.sortBy=HA,y.sortedUniq=KS,y.sortedUniqBy=zS,y.split=SI,y.spread=JA,y.tail=qS,y.take=WS,y.takeRight=GS,y.takeRightWhile=jS,y.takeWhile=YS,y.tap=uA,y.throttle=QA,y.thru=hs,y.toArray=em,y.toPairs=am,y.toPairsIn=sm,y.toPath=ok,y.toPlainObject=nm,y.transform=nI,y.unary=XA,y.union=JS,y.unionBy=QS,y.unionWith=XS,y.uniq=ZS,y.uniqBy=eA,y.uniqWith=tA,y.unset=rI,y.unzip=ru,y.unzipWith=Vg,y.update=oI,y.updateWith=iI,y.values=Bo,y.valuesIn=aI,y.without=nA,y.words=um,y.wrap=ZA,y.xor=rA,y.xorBy=oA,y.xorWith=iA,y.zip=aA,y.zipObject=sA,y.zipObjectDeep=cA,y.zipWith=lA,y.entries=am,y.entriesIn=sm,y.extend=rm,y.extendWith=Cs,fu(y,y),y.add=ak,y.attempt=dm,y.camelCase=uI,y.capitalize=cm,y.ceil=sk,y.clamp=sI,y.clone=tb,y.cloneDeep=rb,y.cloneDeepWith=ob,y.cloneWith=nb,y.conformsTo=ib,y.deburr=lm,y.defaultTo=VI,y.divide=ck,y.endsWith=dI,y.eq=Nn,y.escape=hI,y.escapeRegExp=fI,y.every=wA,y.find=TA,y.findIndex=xg,y.findKey=Db,y.findLast=EA,y.findLastIndex=Dg,y.findLastKey=Lb,y.floor=lk,y.forEach=Hg,y.forEachRight=$g,y.forIn=Bb,y.forInRight=Ub,y.forOwn=Vb,y.forOwnRight=Fb,y.get=cu,y.gt=ab,y.gte=sb,y.has=Kb,y.hasIn=lu,y.head=Bg,y.identity=Bt,y.includes=kA,y.indexOf=ES,y.inRange=cI,y.invoke=Wb,y.isArguments=ro,y.isArray=se,y.isArrayBuffer=cb,y.isArrayLike=Dt,y.isArrayLikeObject=je,y.isBoolean=lb,y.isBuffer=Mr,y.isDate=ub,y.isElement=db,y.isEmpty=hb,y.isEqual=fb,y.isEqualWith=gb,y.isError=au,y.isFinite=mb,y.isFunction=dr,y.isInteger=Jg,y.isLength=vs,y.isMap=Qg,y.isMatch=pb,y.isMatchWith=vb,y.isNaN=yb,y.isNative=Cb,y.isNil=_b,y.isNull=wb,y.isNumber=Xg,y.isObject=Ke,y.isObjectLike=ze,y.isPlainObject=Gi,y.isRegExp=su,y.isSafeInteger=Tb,y.isSet=Zg,y.isString=ys,y.isSymbol=qt,y.isTypedArray=Lo,y.isUndefined=Eb,y.isWeakMap=Sb,y.isWeakSet=Ab,y.join=kS,y.kebabCase=gI,y.last=hn,y.lastIndexOf=RS,y.lowerCase=mI,y.lowerFirst=pI,y.lt=bb,y.lte=Ib,y.max=uk,y.maxBy=dk,y.mean=hk,y.meanBy=fk,y.min=gk,y.minBy=mk,y.stubArray=mu,y.stubFalse=pu,y.stubObject=ek,y.stubString=tk,y.stubTrue=nk,y.multiply=pk,y.nth=NS,y.noConflict=WI,y.noop=gu,y.now=gs,y.pad=vI,y.padEnd=yI,y.padStart=CI,y.parseInt=wI,y.random=lI,y.reduce=MA,y.reduceRight=xA,y.repeat=_I,y.replace=TI,y.result=Zb,y.round=vk,y.runInContext=b,y.sample=LA,y.size=VA,y.snakeCase=EI,y.some=FA,y.sortedIndex=BS,y.sortedIndexBy=US,y.sortedIndexOf=VS,y.sortedLastIndex=FS,y.sortedLastIndexBy=HS,y.sortedLastIndexOf=$S,y.startCase=AI,y.startsWith=bI,y.subtract=yk,y.sum=Ck,y.sumBy=wk,y.template=II,y.times=rk,y.toFinite=hr,y.toInteger=de,y.toLength=tm,y.toLower=kI,y.toNumber=fn,y.toSafeInteger=kb,y.toString=Ae,y.toUpper=RI,y.trim=NI,y.trimEnd=OI,y.trimStart=PI,y.truncate=MI,y.unescape=xI,y.uniqueId=ik,y.upperCase=DI,y.upperFirst=uu,y.each=Hg,y.eachRight=$g,y.first=Bg,fu(y,function(){var o={};return Kn(y,function(a,u){be.call(y.prototype,u)||(o[u]=a)}),o}(),{chain:!1}),y.VERSION=n,sn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){y[o].placeholder=y}),sn(["drop","take"],function(o,a){pe.prototype[o]=function(u){u=u===t?1:nt(de(u),0);var h=this.__filtered__&&!a?new pe(this):this.clone();return h.__filtered__?h.__takeCount__=_t(u,h.__takeCount__):h.__views__.push({size:_t(u,Ht),type:o+(h.__dir__<0?"Right":"")}),h},pe.prototype[o+"Right"]=function(u){return this.reverse()[o](u).reverse()}}),sn(["filter","map","takeWhile"],function(o,a){var u=a+1,h=u==Ct||u==on;pe.prototype[o]=function(p){var w=this.clone();return w.__iteratees__.push({iteratee:X(p,3),type:u}),w.__filtered__=w.__filtered__||h,w}}),sn(["head","last"],function(o,a){var u="take"+(a?"Right":"");pe.prototype[o]=function(){return this[u](1).value()[0]}}),sn(["initial","tail"],function(o,a){var u="drop"+(a?"":"Right");pe.prototype[o]=function(){return this.__filtered__?new pe(this):this[u](1)}}),pe.prototype.compact=function(){return this.filter(Bt)},pe.prototype.find=function(o){return this.filter(o).head()},pe.prototype.findLast=function(o){return this.reverse().find(o)},pe.prototype.invokeMap=fe(function(o,a){return typeof o=="function"?new pe(this):this.map(function(u){return Hi(u,o,a)})}),pe.prototype.reject=function(o){return this.filter(ps(X(o)))},pe.prototype.slice=function(o,a){o=de(o);var u=this;return u.__filtered__&&(o>0||a<0)?new pe(u):(o<0?u=u.takeRight(-o):o&&(u=u.drop(o)),a!==t&&(a=de(a),u=a<0?u.dropRight(-a):u.take(a-o)),u)},pe.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},pe.prototype.toArray=function(){return this.take(Ht)},Kn(pe.prototype,function(o,a){var u=/^(?:filter|find|map|reject)|While$/.test(a),h=/^(?:head|last)$/.test(a),p=y[h?"take"+(a=="last"?"Right":""):a],w=h||/^find/.test(a);p&&(y.prototype[a]=function(){var T=this.__wrapped__,S=h?[1]:arguments,I=T instanceof pe,x=S[0],D=I||se(T),L=function(me){var ve=p.apply(y,br([me],S));return h&&$?ve[0]:ve};D&&u&&typeof x=="function"&&x.length!=1&&(I=D=!1);var $=this.__chain__,Y=!!this.__actions__.length,Z=w&&!$,he=I&&!Y;if(!w&&D){T=he?T:new pe(this);var ee=o.apply(T,S);return ee.__actions__.push({func:hs,args:[L],thisArg:t}),new ln(ee,$)}return Z&&he?o.apply(this,S):(ee=this.thru(L),Z?h?ee.value()[0]:ee.value():ee)})}),sn(["pop","push","shift","sort","splice","unshift"],function(o){var a=Ua[o],u=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",h=/^(?:pop|shift)$/.test(o);y.prototype[o]=function(){var p=arguments;if(h&&!this.__chain__){var w=this.value();return a.apply(se(w)?w:[],p)}return this[u](function(T){return a.apply(se(T)?T:[],p)})}}),Kn(pe.prototype,function(o,a){var u=y[a];if(u){var h=u.name+"";be.call(Oo,h)||(Oo[h]=[]),Oo[h].push({name:a,func:u})}}),Oo[is(t,K).name]=[{name:"wrapper",func:t}],pe.prototype.clone=xT,pe.prototype.reverse=DT,pe.prototype.value=LT,y.prototype.at=dA,y.prototype.chain=hA,y.prototype.commit=fA,y.prototype.next=gA,y.prototype.plant=pA,y.prototype.reverse=vA,y.prototype.toJSON=y.prototype.valueOf=y.prototype.value=yA,y.prototype.first=y.prototype.head,xi&&(y.prototype[xi]=mA),y},ko=fT();Yr?((Yr.exports=ko)._=ko,hl._=ko):ht._=ko}).call(VB)}(ea,ea.exports)),ea.exports}var Ti=FB();const Qs=UB(Ti),HB={path:"/_/dashboard",component:()=>Promise.resolve().then(()=>require("./AuthRoute-Ct4gZcTn.js")),meta:{requiresAuth:!1}},$B={path:"/jplan-auth-fail",component:()=>Promise.resolve().then(()=>require("./AuthFailRoute--FUhpbMD.js")),meta:{requiresAuth:!1}},{isAuthenticated:zp,handleRedirect:KB}=Oh(),zB=jc();function qB(r,e){r.addRoute(HB),r.addRoute($B),r.beforeEach(async(t,n,i)=>{function s(d){return d.matched.some(f=>f.meta.requiresAuth)}if(!s(t))return i();if(!zp.value){ie.value=!0;try{await KB(e,t.fullPath),await zB.__init__()}catch(d){console.error("Fail to authenticate",d),await r.push("/jplan-auth-fail")}ie.value=!1}if(zp.value){if(localStorage.getItem("returnRoute")&&localStorage.getItem("returnRoute")!==null){const d=localStorage.getItem("returnRoute")??"/";console.log("trying to go to saved route:",d),i(d),localStorage.removeItem("returnRoute");return}i()}})}const{scope:qp}=jc();function WB(){const r=Dh(),e=c.ref({scope_type:"org"});async function t(n){e.value=n}return c.watch(qp,()=>{r.interceptors.request.use(n=>{const i=n.headers,s=i.Authorization;s&&(i.Authorization=s);const l=qp.value;return l&&(l.scope_type&&(i["j-scope-type"]=l.scope_type,l.organization&&(i["j-scope-organization"]=l.organization),l.team&&(i["j-scope-team"]=l.team)),l.environment&&(i["j-scope-environment"]=l.environment)),n})},{immediate:!0}),Object.assign(r,{setScope:t,scope:e})}function Ei(r){const e=WB();e.defaults.baseURL=r;const t=c.ref({scope_type:"org"});async function n(i){t.value=i}return c.watch(t,()=>{e.interceptors.request.use(i=>{const s=t.value;return delete i.headers["j-scope-type"],delete i.headers["j-scope-organization"],delete i.headers["j-scope-team"],s!=null&&s.scope_type&&(i.headers["j-scope-type"]=s.scope_type),s!=null&&s.organization&&(i.headers["j-scope-organization"]=s.organization),s!=null&&s.team&&(i.headers["j-scope-team"]=s.team),i})},{immediate:!0}),Object.assign(e,{setScope:n,scope:t})}function GB(){const r=Ei("https://api.jplan.com.br/management/organization"),{error:e}=Fn();return{async getOrgList(t){try{const n=t?`?filter_query=${t}`:"",i=await r.get(`/list/${n}`);if(i.data.error)throw e("Failed to fetch Organization list"),new Error(i.data.error);return i.data.data}catch(n){console.error("Error in getOrgList:",n),e("Failed to fetch Organization list");return}},async createOrg(t){var n,i;try{const s=await r.post("/item",t);return s.status>=200&&s.status<300?s:void 0}catch(s){throw console.error("Error in createOrg:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to create Organization"),s}},async updateOrg(t){var n,i;try{const s=await r.patch("/item",t);if(s.data.error)throw e("Failed to update Organization"),new Error(s.data.error);return s}catch(s){throw console.error("Error in updateOrg:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to update Organization"),s}},async getOrg(t){var n,i;try{const s=await r.get(`/item/${t}`);if(s.data.error)throw e("Failed to fetch Organization"),new Error(s.data.error);return s.data}catch(s){throw console.error("Error in getOrg:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to fetch Organization"),s}},async activateOrg(t){var n,i;try{const s=await r.post(`/item/${t}/activate`);if(s.data.error)throw e("Failed to activate Organization"),new Error(s.data.error)}catch(s){throw console.error("Error in activateOrg:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to activate Organization"),s}},async deactivateOrg(t){var n,i;try{const s=await r.post(`/item/${t}/deactivate`);if(s.data.error)throw e("Failed to deactivate Organization"),new Error(s.data.error)}catch(s){throw console.error("Error in deactivateOrg:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to deactivate Organization"),s}}}}const Vr=GB();function jB(){const r=Ei("https://api.jplan.com.br/management/branch/"),{error:e}=Fn();return{async getBranchList(t){try{const n=t?`?filter_query=${t}`:"",i=await r.get(`/list/${n}`);if(i.data.error){e("Failed to fetch Branch list");return}return i.data.data}catch(n){console.error("Error in getBranchList:",n),e("Failed to fetch Branch list")}},async createBranch(t){var n,i;try{const s=await r.post("/item",t);return s.status>=200&&s.status<300?s:void 0}catch(s){console.error("Error in createBranch:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to create Branch")}},async updateBranch(t){var n,i;try{const s=await r.patch("/item",t);if(s.data.error){e(s.data.error||"Failed to update Branch");return}return s}catch(s){console.error("Error in updateBranch:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to update Branch")}},async getBranch(t){var n,i;try{const s=await r.get(`/item/${t}`);if(s.data.error){e(s.data.error||"Failed to fetch Branch");return}return s.data}catch(s){console.error("Error in getBranch:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to fetch Branch")}},async activateBranch(t){var n,i;try{const s=await r.post(`/item/${t}/activate`);if(s.data.error){e(s.data.error||"Failed to activate Branch");return}}catch(s){console.error("Error in activateBranch:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to activate Branch")}},async deactivateBranch(t){var n,i;try{const s=await r.post(`/item/${t}/deactivate`);if(s.data.error){e(s.data.error||"Failed to deactivate Branch");return}}catch(s){console.error("Error in deactivateBranch:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to deactivate Branch")}}}}const Fr=jB();function YB(){const r=Ei("https://api.jplan.com.br/management/team"),{error:e}=Fn();return{async getTeamList(t){try{const n=t?`?filter_query=${t}`:"",i=await r.get(`/list/${n}`);if(i.data.error)throw e("Failed to fetch Team list"),new Error(i.data.error);return i.data.data}catch(n){console.error("Error in getTeamList:",n),e("Failed to fetch Team list");return}},async createTeam(t){var n,i;try{const s=await r.post("/item",t);if(s.data.error)throw e("Failed to create Team"),new Error(s.data.error);return s}catch(s){throw console.error("Error in createTeam:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to create Team"),s}},async updateTeam(t){var n,i;try{const s=await r.patch("/item",t);return s.status>=200&&s.status<300?s:void 0}catch(s){throw console.error("Error in updateTeam:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to update Team"),s}},async getTeam(t){var n,i;try{const s=await r.get(`/item/${t}`);return s.data.error&&e("Failed to fetch Team"),s.data}catch(s){console.error("Error in getTeam:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to fetch Team");return}},async activateTeam(t){var n,i;try{const s=await r.post(`/item/${t}/activate`);if(s.data.error)throw e("Failed to activate Team"),new Error(s.data.error)}catch(s){throw console.error("Error in activateTeam:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to activate Team"),s}},async deactivateTeam(t){var n,i;try{const s=await r.post(`/item/${t}/deactivate`);if(s.data.error)throw e("Failed to deactivate Team"),new Error(s.data.error)}catch(s){throw console.error("Error in deactivateTeam:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to deactivate Team"),s}},async getTeamUserList(t,n){try{const i=n?`?filter_query=${n}`:"",s=await r.get(`/item/${t}/user/list/${i}`);if(s.data.error)throw e("Failed to fetch Team User list"),new Error(s.data.error);return s.data.data}catch(i){console.error("Error in getTeamUserList:",i),e("Failed to fetch Team User list");return}},async linkManageUser(t,n){try{const i=await r.post(`/item/${t}/user/item/`,n);if(i.data.error)throw e("Failed to link User"),new Error(i.data.error);return i.data}catch(i){console.error("Error in link User:",i),e("Failed to link User");return}},async updateManageUser(t,n){try{const i=await r.patch(`/item/${t}/user/item/`,n);if(i.data.error)throw e("Failed to update User"),new Error(i.data.error);return i.data.data}catch(i){throw console.error("Error in update User:",i),e("Failed to update User"),i}},async getManageUser(t,n,i){try{const s=i?`?filter_query=${i}`:"",l=await r.get(`/item/${t}/user/item/${n}/${s}`);if(l.data.error)throw e("Failed to fetch User"),new Error(l.data.error);return l.data.data}catch(s){console.error("Error in getUser:",s),e("Failed to fetch User");return}},async unlinkManageUser(t,n,i){try{const s=i?`?filter_query=${i}`:"";await r.delete(`/item/${t}/user/item/${n}/${s}`)}catch(s){throw console.error("Error in unlink User:",s),e("Failed to unlink User"),s}}}}const Xt=YB();async function JB({url:r,method:e,header:t={},body:n,bearerToken:i}){const s=i?{Authorization:`Bearer ${i}`}:{};try{return(await $e({url:r,method:e,headers:{...t,...s},data:n??{}})).data}catch(l){throw console.error(`Request failed for ${e} ${r}:`,l),l}}function Si(r,e,t=[]){const n=XB(e);if(!n)return r;const i=n.split(" ");return r.filter(s=>QB(s,i,t))}function QB(r,e,t){return t.some(n=>{const i=Qs.get(r,n);if(Qs.isNil(i))return!1;const s=Qs.toString(i).toLowerCase();return e.every(l=>s.includes(l))})}function XB(r){return Qs.trim(r).toLowerCase().replace(/\s+/g," ")}let Ds=!1;const zu=c.ref(!1),gn=c.ref([]),Wp=c.ref([]),qe=c.ref(null),Wo=c.ref([]),Go=c.ref([]),kw=()=>{const r=Fn(),e=async _=>{zu.value=!0;const A=_?`_active eq true and ${_}`:"_active eq true",N=await Vr.getOrgList(A);N&&(gn.value=N,Ds=!0),zu.value=!1},t=async _=>{var A;return(A=gn.value)!=null&&A.length||await e(_),gn.value};function n(_){if(!gn.value)throw new Error("Data not stored yet");const A=Si(gn.value,_,["name","description"]);return _!==""?A:gn.value}const i=_=>{Wp.value=_},s=_=>{qe.value=Ti.cloneDeep(_)},l=async _=>await Vr.getOrg(_),d=async()=>{if(qe.value!=null){const _=await Vr.createOrg(qe.value);return _!=null&&_.data.created_at&&(r.success("Organization created."),Ds&&gn.value.push(_.data)),_==null?void 0:_.data}},f=async()=>{if(ie.value=!0,qe.value&&qe.value.__id){const _=await Vr.updateOrg(qe.value);if(Ds&&(_!=null&&_.data.__id)){const A=gn.value.findIndex(N=>N.__id===_.data.__id);return A!==-1?(gn.value[A]=_.data,r.success("Organization updated.")):r.error("Unable to update item"),ie.value=!1,_.data}}else ie.value=!1,r.error("Unable to update item")},g=async()=>{if(ie.value=!0,qe.value&&qe.value.created_at){if(await Vr.deactivateOrg(qe.value.__id),Ds){const _=gn.value.findIndex(A=>{var N;return A.__id===((N=qe.value)==null?void 0:N.__id)});if(_!==-1)return gn.value.splice(_,1),qe.value;r.error("Unable to deactivate organization")}ie.value=!1}};async function m(_){ie.value=!0;try{if(qe.value&&qe.value.__id){const A={..._,organization:qe.value.__id};if(!await Fr.updateBranch(A)){ie.value=!1;return}if(Wo.value.findIndex(V=>V.__id===_.__id)===-1)return r.success("Branch added successfully."),Wo.value.push(A),A;r.info("Branch already added.")}}catch(A){console.error(A)}finally{ie.value=!1}}async function C(_){if(ie.value=!0,qe.value&&qe.value.__id){const A={..._,organization:null};if(!await Fr.updateBranch(A)){ie.value=!1;return}const K=Wo.value.findIndex(V=>V.__id===_.__id);if(K!==-1)return Wo.value.splice(K,1),ie.value=!1,Wo.value;throw new Error("Item not found to remove")}ie.value=!1}async function v(_){ie.value=!0;try{if(qe.value&&qe.value.__id){const A={..._,organization:qe.value.__id};if(!await Xt.updateTeam(A)){ie.value=!1;return}if(Go.value.findIndex(V=>V.__id===_.__id)===-1)return r.success("Team added successfully."),Go.value.push(A),A;r.info("Team already added.")}}catch(A){console.error(A)}finally{ie.value=!1}}async function E(_){if(ie.value=!0,qe.value&&qe.value.__id){const A={..._,organization:null};if(!await Xt.updateTeam(A)){ie.value=!1;return}const K=Go.value.findIndex(V=>V.__id===_.__id);if(K!==-1)return Go.value.splice(K,1),ie.value=!1,Go.value;throw new Error("Item not found to remove")}ie.value=!1}return{data:gn,loading:zu,columns:Wp,item:qe,filterData:n,__init__:e,getData:t,setColumns:i,setItem:s,getItem:l,createItem:d,updateItem:f,removeItem:g,orgBranches:Wo,orgTeams:Go,linkBranch:m,unlinkBranch:C,linkTeam:v,unlinkTeam:E}};let Ls=!1;const mn=c.ref([]),Gp=c.ref([]),rt=c.ref(null),qu=c.ref(!1),jo=c.ref([]),Rw=()=>{const r=Fn(),e=async v=>{qu.value=!0;const E=v?`_active eq true and ${v}`:"_active eq true",_=await Xt.getTeamList(E);_&&(mn.value=_,Ls=!0),qu.value=!1},t=async v=>(mn.value.length||await e(v),mn.value);function n(v){if(!mn.value)throw new Error("Data not stored yet");const E=Si(mn.value,v,["name","description"]);return v!==""?E:mn.value}const i=v=>{Gp.value=v},s=v=>{rt.value=Ti.cloneDeep(v)},l=async v=>await Xt.getTeam(v),d=async()=>{if(rt.value!=null){const v=await Xt.createTeam(rt.value);return v!=null&&v.data.created_at&&(r.success("Team created."),Ls&&mn.value.push(v.data)),v==null?void 0:v.data}},f=async()=>{if(ie.value=!0,rt.value&&rt.value.__id){const v=await Xt.updateTeam(rt.value);if(Ls&&(v!=null&&v.data.__id)){const E=mn.value.findIndex(_=>_.__id===v.data.__id);return E!==-1?(mn.value[E]=v.data,r.success("Team updated.")):r.error("Unable to update item"),v.data}}else r.error("Unable to update item")},g=async()=>{if(rt.value&&rt.value.created_at&&(await Xt.deactivateTeam(rt.value.__id),Ls)){const v=mn.value.findIndex(E=>{var _;return E.__id===((_=rt.value)==null?void 0:_.__id)});if(v!==-1)return mn.value.splice(v,1),rt.value;r.error("Unable to deactivate organization")}};async function m(v){var E;if(ie.value=!0,(E=rt.value)!=null&&E.__id)if(jo.value.findIndex(A=>A.__id===v.__id)===-1)try{const A=await Xt.linkManageUser(rt.value.__id,{team:rt.value.__id,user:v.__id,role:"string",joined_at:"string",comments:"string"}),N=await Xt.getTeamUserList(rt.value.__id);return N&&(jo.value=N),r.success("User added successfully."),A}catch(A){console.error(A),r.error("Unable to add User.")}finally{ie.value=!1}else r.info("User already added.");else console.warn("No item selected or item ID is missing."),r.info("Please select a valid item.");ie.value=!1}async function C(v){if(ie.value=!0,rt.value&&rt.value.__id){const E=jo.value.findIndex(_=>_.__id===v);if(E!==-1)return await Xt.unlinkManageUser(rt.value.__id,v),jo.value.splice(E,1),ie.value=!1,jo.value;throw new Error("Item not found to remove")}ie.value=!1}return{data:mn,loading:qu,columns:Gp,item:rt,usersTeam:jo,__init__:e,getData:t,filterData:n,setColumns:i,setItem:s,getItem:l,createItem:d,updateItem:f,removeItem:g,linkUser:m,unlinkUser:C}},Nw=c.defineComponent({__name:"GlobalScopeFilter",setup(r){var A,N,K;const{openDialog:e}=va("global-scope__J-"),{user:t,scope:n,session:i,setScope:s}=jc(),{getData:l,data:d}=kw(),{getData:f,data:g}=Rw(),m=c.ref(!1);c.onBeforeMount(async()=>{m.value=!0,await l(),await f(),m.value=!1});const C=c.ref({scope_type:(A=n.value)==null?void 0:A.scope_type,organization:((N=n.value)==null?void 0:N.organization)??"org",team:(K=n.value)==null?void 0:K.team});function v(){var V,U,Q;C.value={...n.value,scope_type:(V=n.value)==null?void 0:V.scope_type,organization:((U=n.value)==null?void 0:U.organization)??"",team:(Q=n.value)==null?void 0:Q.team},e()}const E=c.computed(()=>{var V;switch((V=n.value)==null?void 0:V.scope_type){case"user":return P1;case"org":return N1;case"team":return M1;default:return O1}});async function _(){var V;((V=n.value)==null?void 0:V.scope_type)!==""&&s(C.value)}return(V,U)=>(c.openBlock(),c.createElementBlock(c.Fragment,null,[c.createVNode(Be.VBtn,{onClick:v,icon:"",class:"text-secondary",color:"surface",rounded:"sm",size:"small",variant:"flat"},{default:c.withCtx(()=>[(c.openBlock(),c.createBlock(c.resolveDynamicComponent(E.value),{size:"20"}))]),_:1}),c.createVNode(c.unref(Ca),{loading:m.value,title:"Scope","dd-id":"global-scope__J-",onOnSave:_},{default:c.withCtx(()=>[c.createElementVNode("div",null,[c.createVNode(Oe.VRow,null,{default:c.withCtx(()=>[c.createVNode(Oe.VCol,{cols:"4",class:"d-flex flex-row align-center"},{default:c.withCtx(()=>[c.createVNode(St.VListItem,null,{default:c.withCtx(()=>[c.createVNode(St.VListItemTitle,null,{default:c.withCtx(()=>U[3]||(U[3]=[c.createTextVNode(" User")])),_:1}),c.createVNode(St.VListItemSubtitle,null,{default:c.withCtx(()=>{var Q;return[c.createTextVNode(c.toDisplayString(((Q=c.unref(t))==null?void 0:Q.name)||"Unknown"),1)]}),_:1})]),_:1})]),_:1}),c.createVNode(Oe.VCol,{cols:"4"},{default:c.withCtx(()=>[c.createVNode(St.VListItem,null,{default:c.withCtx(()=>[c.createVNode(St.VListItemTitle,null,{default:c.withCtx(()=>U[4]||(U[4]=[c.createTextVNode(" Domain")])),_:1}),c.createVNode(St.VListItemSubtitle,null,{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(c.unref(i).domain),1)]),_:1})]),_:1})]),_:1}),c.createVNode(Oe.VCol,{cols:"4"},{default:c.withCtx(()=>[c.createVNode(St.VListItem,null,{default:c.withCtx(()=>[c.createVNode(St.VListItemTitle,null,{default:c.withCtx(()=>U[5]||(U[5]=[c.createTextVNode(" Environment")])),_:1}),c.createVNode(St.VListItemSubtitle,null,{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(c.unref(i).environment),1)]),_:1})]),_:1})]),_:1})]),_:1}),c.createVNode(Ak.VBtnToggle,{density:"compact",variant:"outlined",modelValue:C.value.scope_type,"onUpdate:modelValue":U[0]||(U[0]=Q=>C.value.scope_type=Q),class:"d-flex justify-center my-4"},{default:c.withCtx(()=>[c.createVNode(Be.VBtn,{value:"org",label:"Organizational",color:"secondary",class:""},{default:c.withCtx(()=>U[6]||(U[6]=[c.createTextVNode("Organizational")])),_:1}),c.createVNode(Be.VBtn,{value:"team",label:"Team",color:"secondary",class:""},{default:c.withCtx(()=>U[7]||(U[7]=[c.createTextVNode("Team")])),_:1}),c.createVNode(Be.VBtn,{value:"user",label:"User",color:"secondary",class:""},{default:c.withCtx(()=>U[8]||(U[8]=[c.createTextVNode("User")])),_:1}),c.createVNode(Be.VBtn,{value:"",label:"None",color:"lightext",class:""},{default:c.withCtx(()=>U[9]||(U[9]=[c.createTextVNode("None")])),_:1})]),_:1},8,["modelValue"]),c.createElementVNode("div",null,[c.createVNode(ua.VLabel,{class:"text-subtitle-1 text-high-emphasis mb-2"},{default:c.withCtx(()=>U[10]||(U[10]=[c.createTextVNode("Organization")])),_:1}),c.createVNode(ta.VSelect,{items:c.unref(d),"item-title":"name","item-value":"__id",variant:"solo","bg-color":"containerBg",rounded:"false",placeholder:"Select a Organization",class:"min-w-50",modelValue:C.value.organization,"onUpdate:modelValue":U[1]||(U[1]=Q=>C.value.organization=Q),clearable:""},null,8,["items","modelValue"]),c.createVNode(ua.VLabel,{class:"text-subtitle-1 text-high-emphasis mb-2"},{default:c.withCtx(()=>U[11]||(U[11]=[c.createTextVNode("Team")])),_:1}),c.createVNode(ta.VSelect,{items:c.unref(g),"item-title":"name","item-value":"__id",variant:"solo","bg-color":"containerBg",rounded:"false",placeholder:"Select a Team",class:"min-w-50",modelValue:C.value.team,"onUpdate:modelValue":U[2]||(U[2]=Q=>C.value.team=Q),clearable:""},null,8,["items","modelValue"])])])]),_:1},8,["loading"])],64))}}),ZB={},eU={class:"double-ring-spinner-container"};function tU(r,e){return c.openBlock(),c.createElementBlock("div",eU,e[0]||(e[0]=[c.createElementVNode("div",{class:"spinner-loading"},[c.createElementVNode("div"),c.createElementVNode("div"),c.createElementVNode("div",null,[c.createElementVNode("div")]),c.createElementVNode("div",null,[c.createElementVNode("div")])],-1)]))}const Ow=vi(ZB,[["render",tU],["__scopeId","data-v-00d7a69f"]]),nU={key:0,class:"_jspinner-overlay_jj"},Pw=c.defineComponent({__name:"GlobalSpinner",setup(r){return(e,t)=>c.unref(ie)?(c.openBlock(),c.createElementBlock("div",nU,t[0]||(t[0]=[c.createElementVNode("div",{class:"j-double-ring-spinner-container"},[c.createElementVNode("div",{class:"j-global-spinner-loading"},[c.createElementVNode("div"),c.createElementVNode("div"),c.createElementVNode("div",null,[c.createElementVNode("div")]),c.createElementVNode("div",null,[c.createElementVNode("div")])])],-1)]))):c.createCommentVNode("",!0)}}),Mw=c.defineComponent({__name:"SubMenu",props:{title:{}},setup(r,{expose:e}){return e({props:r}),(n,i)=>(c.openBlock(),c.createBlock(St.VListItem,{onClick:i[0]||(i[0]=()=>{}),density:"compact"},{append:c.withCtx(()=>[c.createVNode(c.unref(x1))]),default:c.withCtx(()=>[c.createVNode(St.VListItemTitle,null,{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(n.title),1)]),_:1}),c.createVNode(Md.VMenu,{activator:"parent","open-on-hover":"",submenu:"",density:"compact"},{default:c.withCtx(()=>[c.renderSlot(n.$slots,"default")]),_:3})]),_:3}))}}),rU=Object.freeze(Object.defineProperty({__proto__:null,AvatarPicture:Dv,ColumnSettingsDialog:$d,ConfirmDialog:Mv,ContextMenu:Lv,CopyButton:yc,DeleteAllBtn:Bd,DotsMenu:Pv,EditButton:Ov,FormHeadless:fy,FormMetadata:kc,GlobalScopeFilter:Nw,GlobalSpinner:Pw,JAvatar:xv,JBtn:ev,JDialog:Ca,JForm:dy,JIconBtn:Zp,JSelect:sy,JTextArea:cy,JTextField:ay,ParentCard:Ec,SearchFilter:bc,SpinnerLoader:Ow,SubMenu:Mw,TabFormHeader:hy,TableAdvanced:Kv,TableCard:Kd,TableCardsView:oy,TableHeader:zv,UiTable:Bv},Symbol.toStringTag,{value:"Module"})),oU=eR(),iU={transition:"Vue-Toastification__fade",maxToasts:20,newestOnTop:!0};let Wu=!1;const Gu=c.ref(!1),pn=c.ref([]),jp=c.ref([]),gt=c.ref(null),Yo=c.ref([]),aU=()=>{const r=Fn(),e=async v=>{Gu.value=!0;const E=v?`_active eq true and ${v}`:"_active eq true",_=await Fr.getBranchList(E);_&&(pn.value=_,Wu=!0),Gu.value=!1},t=async v=>(pn.value.length||await e(v),pn.value);function n(v){if(!pn.value)throw new Error("Data not stored yet");const E=Si(pn.value,v,["name","description"]);return v!==""?E:pn.value}const i=v=>{jp.value=v},s=v=>{gt.value=Ti.cloneDeep(v)},l=async v=>await Fr.getBranch(v),d=async()=>{if(gt.value!=null){const v=await Fr.createBranch(gt.value);return v!=null&&v.data.created_at&&(r.success("Branch created."),Wu&&pn.value.push(v.data)),v==null?void 0:v.data}},f=async()=>{if(gt.value&&gt.value.__id){const v=await Fr.updateBranch(gt.value);if(Wu&&v){const E=pn.value.findIndex(_=>_.__id===v.data.__id);return E!==-1?(pn.value[E]=v.data,r.success("Branch updated.")):r.error("Unable to update item"),v}}else r.error("Unable to update item")},g=async()=>{if(gt.value&&gt.value.created_at){await Fr.deactivateBranch(gt.value.__id);const v=pn.value.findIndex(E=>{var _;return E.__id===((_=gt.value)==null?void 0:_.__id)});if(v!==-1)return pn.value.splice(v,1),gt.value;r.error("Unable to deactivate Domain")}};async function m(v){ie.value=!0;try{if(gt.value&&gt.value.__id){const E={...v,branch:gt.value.__id};if(!await Xt.updateTeam(E)){r.error("Unable to link team");return}if(Yo.value.findIndex(N=>N.__id===v.__id)===-1)return r.success("Team added successfully."),Yo.value.push(E),E;r.info("Team already added.")}else throw new Error("Item is not defined")}catch(E){console.error(E)}finally{ie.value=!1}}async function C(v){if(ie.value=!0,gt.value&&gt.value.__id){const E={...v,branch:null};if(!await Xt.updateTeam(E))return;const A=Yo.value.findIndex(N=>N.__id===v.__id);if(A!==-1)return Yo.value.splice(A,1),ie.value=!1,Yo.value;throw new Error("Item not found to remove")}ie.value=!1}return{data:pn,columns:jp,item:gt,loading:Gu,__init__:e,getData:t,filterData:n,setColumns:i,setItem:s,getItem:l,createItem:d,updateItem:f,removeItem:g,branchTeams:Yo,linkTeam:m,unlinkTeam:C}};function sU(){const r=Ei("https://api.jplan.com.br/management/division"),{error:e}=Fn();return{async getDivisionList(t){try{const n=t?`?filter_query=${t}`:"",i=await r.get(`/list/${n}`);if(i.data.error)throw e("Failed to fetch Division list"),new Error(i.data.error);return i.data.data}catch(n){console.error("Error in getDivisionList:",n),e("Failed to fetch Division list");return}},async createDivision(t){var n,i;try{const s=await r.post("/item",t);return s.status>=200&&s.status<300?s:void 0}catch(s){throw console.error("Error in createDivision:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to create Division"),s}},async updateDivision(t){var n,i;try{const s=await r.patch("/item",t);if(s.data.error)throw e("Failed to update Division"),new Error(s.data.error);return s}catch(s){throw console.error("Error in updateDivision:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to update Division"),s}},async getDivision(t){var n,i;try{const s=await r.get(`/item/${t}`);if(s.data.error)throw e("Failed to fetch Division"),new Error(s.data.error);return s.data}catch(s){throw console.error("Error in getDivision:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to fetch Division"),s}},async activateDivision(t){var n,i;try{const s=await r.post(`/item/${t}/activate`);if(s.data.error)throw e("Failed to activate Division"),new Error(s.data.error)}catch(s){throw console.error("Error in activateDivision:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to activate Division"),s}},async deactivateDivision(t){var n,i;try{const s=await r.post(`/item/${t}/deactivate`);if(s.data.error)throw e("Failed to deactivate Division"),new Error(s.data.error)}catch(s){throw console.error("Error in deactivateDivision:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to deactivate Division"),s}}}}const ti=sU();let ju=!1;const Yu=c.ref(!1),vn=c.ref([]),Yp=c.ref([]),mt=c.ref(null),Jo=c.ref([]),cU=()=>{const r=Fn(),e=async v=>{Yu.value=!0;const E=v?`_active eq true and ${v}`:"_active eq true",_=await ti.getDivisionList(E);_&&(vn.value=_,ju=!0),Yu.value=!1},t=async v=>(vn.value.length||await e(v),vn.value);function n(v){if(!vn.value)throw new Error("Data not stored yet");const E=Si(vn.value,v,["name","description"]);return v!==""?E:vn.value}const i=v=>{Yp.value=v},s=v=>{mt.value=Ti.cloneDeep(v)},l=async v=>await ti.getDivision(v),d=async()=>{if(mt.value!=null){const v=await ti.createDivision(mt.value);return v!=null&&v.data.created_at&&(r.success("Division created."),ju&&vn.value.push(v.data)),v==null?void 0:v.data}},f=async()=>{if(ie.value=!0,mt.value&&mt.value.__id){const v=await ti.updateDivision(mt.value);if(ju&&(v!=null&&v.data.__id)){const E=vn.value.findIndex(_=>_.__id===v.data.__id);return E!==-1?(vn.value[E]=v.data,r.success("Updated Division.")):r.error("Unable to update item"),ie.value=!1,v}}else ie.value=!1,r.error("Unable to update item")},g=async()=>{if(ie.value=!0,mt.value&&mt.value.created_at){await ti.deactivateDivision(mt.value.__id);const v=vn.value.findIndex(E=>{var _;return E.__id===((_=mt.value)==null?void 0:_.__id)});if(v!==-1)return vn.value.splice(v,1),mt.value;r.error("Unable to deactivate Division")}ie.value=!1};async function m(v){ie.value=!0;try{if(mt.value&&mt.value.__id){const E={...v,division:mt.value.__id};return await Vr.updateOrg(E)?(Jo.value.findIndex(N=>N.__id===v.__id)===-1?(r.success("Organization added successfully."),Jo.value.push(E)):r.info("Organization already added."),E):void 0}else throw new Error("Item is not defined")}catch(E){console.error(E)}finally{ie.value=!1}}async function C(v){if(ie.value=!0,mt.value&&mt.value.__id){const E={...v,division:null};if(!await Vr.updateOrg(E))return;const A=Jo.value.findIndex(N=>N.__id===v.__id);if(A!==-1)Jo.value.splice(A,1);else throw new Error("Item não encontrado para remoção")}else throw new Error("Item não está definido");return ie.value=!1,Jo.value}return{data:vn,columns:Yp,item:mt,loading:Yu,__init__:e,filterData:n,getData:t,setColumns:i,setItem:s,getItem:l,createItem:d,updateItem:f,removeItem:g,orgs:Jo,linkDivision:m,unlinkDivision:C}};function lU(){const r=Ei("https://api.jplan.com.br/management/user"),{error:e}=Fn();return{async getManageUserList(t){try{const n=t?`?filter_query=${t}`:"",i=await r.get(`/list/${n}`);if(i.data.error)throw e("Failed to fetch User list"),new Error(i.data.error);return i.data.data}catch(n){console.error("Error in getManageUserList:",n),e("Failed to fetch User list");return}},async createManageUser(t){var n,i;try{const s=await r.post("/item",t);return s.status>=200&&s.status<300?s:void 0}catch(s){throw console.error("Error in createManageUser:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to create User"),s}},async updateManageUser(t){var n,i;try{const s=await r.patch("/item",t);if(s.data.error)throw e("Failed to update User"),new Error(s.data.error);return s}catch(s){throw console.error("Error in updateManageUser:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to update User"),s}},async getManageUser(t){var n,i;try{const s=await r.get(`/item/${t}`);if(s.data.error)throw e("Failed to fetch User"),new Error(s.data.error);return s.data}catch(s){console.error("Error in getManageUser:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to fetch User");return}},async activateManageUser(t){var n,i;try{const s=await r.post(`/item/${t}/activate`);if(s.data.error)throw e("Failed to activate User"),new Error(s.data.error)}catch(s){throw console.error("Error in activateManageUser:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to activate User"),s}},async deactivateManageUser(t){var n,i;try{const s=await r.post(`/item/${t}/deactivate`);if(s.data.error)throw e("Failed to deactivate User"),new Error(s.data.error)}catch(s){throw console.error("Error in deactivateManageUser:",s),e(((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message)||"Failed to deactivate User"),s}}}}const ni=lU();let Ju=!1,Qu=c.ref(!1);const yn=c.ref([]),Jp=c.ref([]),Cn=c.ref(null),uU=c.ref(null),dU=c.ref([]),hU=()=>{const r=Fn(),e=async m=>{Qu.value=!0;const C=m?`_active eq true and ${m}`:"_active eq true",v=await ni.getManageUserList(C);v&&(yn.value=v,Ju=!0),Qu.value=!1},t=async m=>(yn.value.length||await e(m),yn.value);function n(m){if(!yn.value)throw new Error("Data not stored yet");const C=Si(yn.value,m,["name","description"]);return m!==""?C:yn.value}return{data:yn,loading:Qu,columns:Jp,item:Cn,filterData:n,__init__:e,getData:t,setColumns:m=>{Jp.value=m},setItem:m=>{Cn.value=Ti.cloneDeep(m)},getItem:async m=>await ni.getManageUser(m),createItem:async()=>{if(Cn.value!=null){const m=crypto.randomUUID(),C=await ni.createManageUser({...Cn.value,__id:m});return C!=null&&C.data.created_at&&(r.success("User created."),Ju&&yn.value.push(C.data)),C==null?void 0:C.data}},updateItem:async()=>{if(ie.value=!0,Cn.value&&Cn.value.created_at){const m=await ni.updateManageUser(Cn.value);if(Ju&&(m!=null&&m.data)){const C=yn.value.findIndex(v=>v.__id===(m==null?void 0:m.data.__id));if(C!==-1)yn.value[C]=m==null?void 0:m.data,r.success("User created.");else throw new Error("Unable to find item after update")}return ie.value=!1,m==null?void 0:m.data}},removeItem:async()=>{if(Cn.value&&Cn.value.created_at){try{await ni.deactivateManageUser(Cn.value.__id)}catch{r.error("Unable to deactivate user");return}const m=yn.value.findIndex(C=>{var v;return C.__id===((v=Cn.value)==null?void 0:v.__id)});if(m!==-1)return yn.value.splice(m,1),Cn.value}},userOrg:uU,userTeams:dU}},fU=r=>{r.use(oU),r.use(n0,iU),Object.entries(rU).forEach(([e,t])=>{r.component(e,t)}),Object.entries(Ik).forEach(([e,t])=>{r.provide(e,t)})},gU={install:fU};exports.ContextMenu=Lv;exports.EmptyListImg=td;exports.EventBus=_c;exports.FormHeadless=fy;exports.HttpCore=JB;exports.SpinnerLoader=Ow;exports.TableCardsView=oy;exports.TableHeader=zv;exports.__spinner=ie;exports._export_sfc=vi;exports._sfc_main=Bv;exports._sfc_main$1=Kv;exports._sfc_main$10=Bd;exports._sfc_main$11=Ov;exports._sfc_main$12=Zp;exports._sfc_main$13=sy;exports._sfc_main$14=cy;exports._sfc_main$15=ay;exports._sfc_main$16=dy;exports._sfc_main$17=hy;exports._sfc_main$18=Ec;exports._sfc_main$19=xv;exports._sfc_main$2=$d;exports._sfc_main$20=Dv;exports._sfc_main$21=Ca;exports._sfc_main$22=Mw;exports._sfc_main$23=Nw;exports._sfc_main$24=Pw;exports._sfc_main$3=Kd;exports._sfc_main$4=bc;exports._sfc_main$5=Mv;exports._sfc_main$6=yc;exports._sfc_main$7=Pv;exports._sfc_main$8=kc;exports._sfc_main$9=ev;exports.branchInstance=Fr;exports.coreClient=Dh;exports.createToastInterface=fa;exports.dateFormat=$v;exports.divisionInstance=ti;exports.filterQuery=Si;exports.globalEventBus=Ld;exports.index=gU;exports.manageUserInstance=ni;exports.msal=yt;exports.orgInstance=Vr;exports.provideToast=t0;exports.scopedClient=Ei;exports.setupAuthGuard=qB;exports.teamInstance=Xt;exports.toastInjectionKey=Tc;exports.useAuth=Oh;exports.useBranchStore=aU;exports.useCustomizer=iR;exports.useDialog=va;exports.useDivisionStore=cU;exports.useManageUserStore=hU;exports.useOrganizationStore=kw;exports.useSession=jc;exports.useTeamStore=Rw;exports.useToast=Fn;