From 5a05c50114c8d82931c4e9b26a6bff6239565c45 Mon Sep 17 00:00:00 2001 From: Roberto Guido Date: Sun, 26 May 2024 20:23:11 +0200 Subject: [PATCH] filtro utenti in fase di esportazione. closes #282 --- code/app/Http/Controllers/UsersController.php | 5 ++++ code/public/js/gasdotto.js | 2 +- code/public/js/gasdotto.js.map | 2 +- code/public/mix-manifest.json | 2 +- code/resources/assets/js/callables.js | 27 ++++++++++++++----- .../views/movement/credits.blade.php | 2 +- .../views/movement/suppliers.blade.php | 2 +- code/resources/views/pages/users.blade.php | 8 ++++-- 8 files changed, 37 insertions(+), 13 deletions(-) diff --git a/code/app/Http/Controllers/UsersController.php b/code/app/Http/Controllers/UsersController.php index c0d3a91e..699fa3ea 100644 --- a/code/app/Http/Controllers/UsersController.php +++ b/code/app/Http/Controllers/UsersController.php @@ -94,6 +94,11 @@ public function export(Request $request) $headers = UserFormatter::getHeaders($fields); $users = $this->service->list('', true); + if ($request->input('exportables') == 'selected') { + $selected = $request->input('users', []); + $users = $users->filter(fn($u) => in_array($u->id, $selected)); + } + return output_csv(_i('utenti.csv'), $headers, $users, function($user) use ($fields) { return UserFormatter::format($user, $fields); }); diff --git a/code/public/js/gasdotto.js b/code/public/js/gasdotto.js index d4ff3da1..9b8194d2 100644 --- a/code/public/js/gasdotto.js +++ b/code/public/js/gasdotto.js @@ -1,3 +1,3 @@ /*! For license information please see gasdotto.js.LICENSE.txt */ -(()=>{var t,e={281:t=>{var e;self,e=()=>(()=>{"use strict";var t={362:(t,e,i)=>{function n(t){return t.split("-")[0]}function o(t){return t.split("-")[1]}function s(t){return["top","bottom"].includes(n(t))?"x":"y"}function r(t){return"y"===t?"height":"width"}function a(t,e,i){let{reference:a,floating:l}=t;const c=a.x+a.width/2-l.width/2,u=a.y+a.height/2-l.height/2,d=s(e),h=r(d),p=a[h]/2-l[h]/2,f="x"===d;let m;switch(n(e)){case"top":m={x:c,y:a.y-l.height};break;case"bottom":m={x:c,y:a.y+a.height};break;case"right":m={x:a.x+a.width,y:u};break;case"left":m={x:a.x-l.width,y:u};break;default:m={x:a.x,y:a.y}}switch(o(e)){case"start":m[d]-=p*(i&&f?-1:1);break;case"end":m[d]+=p*(i&&f?-1:1)}return m}function l(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function c(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}async function u(t,e){var i;void 0===e&&(e={});const{x:n,y:o,platform:s,rects:r,elements:a,strategy:u}=t,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:f=!1,padding:m=0}=e,g=l(m),v=a[f?"floating"===p?"reference":"floating":p],y=c(await s.getClippingRect({element:null==(i=await(null==s.isElement?void 0:s.isElement(v)))||i?v:v.contextElement||await(null==s.getDocumentElement?void 0:s.getDocumentElement(a.floating)),boundary:d,rootBoundary:h,strategy:u})),b=c(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:"floating"===p?{...r.floating,x:n,y:o}:r.reference,offsetParent:await(null==s.getOffsetParent?void 0:s.getOffsetParent(a.floating)),strategy:u}):r[p]);return{top:y.top-b.top+g.top,bottom:b.bottom-y.bottom+g.bottom,left:y.left-b.left+g.left,right:b.right-y.right+g.right}}i.r(e),i.d(e,{arrow:()=>f,autoPlacement:()=>x,autoUpdate:()=>ct,computePosition:()=>ut,detectOverflow:()=>u,flip:()=>k,getOverflowAncestors:()=>st,hide:()=>A,inline:()=>O,limitShift:()=>$,offset:()=>D,platform:()=>lt,shift:()=>S,size:()=>P});const d=Math.min,h=Math.max;function p(t,e,i){return h(t,d(e,i))}const f=t=>({name:"arrow",options:t,async fn(e){const{element:i,padding:n=0}=null!=t?t:{},{x:a,y:c,placement:u,rects:d,platform:h}=e;if(null==i)return{};const f=l(n),m={x:a,y:c},g=s(u),v=o(u),y=r(g),b=await h.getDimensions(i),_="y"===g?"top":"left",w="y"===g?"bottom":"right",x=d.reference[y]+d.reference[g]-m[g]-d.floating[y],k=m[g]-d.reference[g],C=await(null==h.getOffsetParent?void 0:h.getOffsetParent(i));let T=C?"y"===g?C.clientHeight||0:C.clientWidth||0:0;0===T&&(T=d.floating[y]);const A=x/2-k/2,D=f[_],E=T-b[y]-f[w],S=T/2-b[y]/2+A,$=p(D,S,E),P=("start"===v?f[_]:f[w])>0&&S!==$&&d.reference[y]<=d.floating[y];return{[g]:m[g]-(P?Sm[t]))}function v(t,e,i){void 0===i&&(i=!1);const n=o(t),a=s(t),l=r(a);let c="x"===a?n===(i?"end":"start")?"right":"left":"start"===n?"bottom":"top";return e.reference[l]>e.floating[l]&&(c=g(c)),{main:c,cross:g(c)}}const y={start:"end",end:"start"};function b(t){return t.replace(/start|end/g,(t=>y[t]))}const _=["top","right","bottom","left"],w=_.reduce(((t,e)=>t.concat(e,e+"-start",e+"-end")),[]),x=function(t){return void 0===t&&(t={}),{name:"autoPlacement",options:t,async fn(e){var i,s,r,a,l;const{x:c,y:d,rects:h,middlewareData:p,placement:f,platform:m,elements:g}=e,{alignment:y=null,allowedPlacements:_=w,autoAlignment:x=!0,...k}=t,C=function(t,e,i){return(t?[...i.filter((e=>o(e)===t)),...i.filter((e=>o(e)!==t))]:i.filter((t=>n(t)===t))).filter((i=>!t||o(i)===t||!!e&&b(i)!==i))}(y,x,_),T=await u(e,k),A=null!=(i=null==(s=p.autoPlacement)?void 0:s.index)?i:0,D=C[A];if(null==D)return{};const{main:E,cross:S}=v(D,h,await(null==m.isRTL?void 0:m.isRTL(g.floating)));if(f!==D)return{x:c,y:d,reset:{placement:C[0]}};const $=[T[n(D)],T[E],T[S]],P=[...null!=(r=null==(a=p.autoPlacement)?void 0:a.overflows)?r:[],{placement:D,overflows:$}],O=C[A+1];if(O)return{data:{index:A+1,overflows:P},reset:{placement:O}};const L=P.slice().sort(((t,e)=>t.overflows[0]-e.overflows[0])),j=null==(l=L.find((t=>{let{overflows:e}=t;return e.every((t=>t<=0))})))?void 0:l.placement,I=null!=j?j:L[0].placement;return I!==f?{data:{index:A+1,overflows:P},reset:{placement:I}}:{}}}},k=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var i;const{placement:o,middlewareData:s,rects:r,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",flipAlignment:m=!0,...y}=t,_=n(o),w=p||(_!==a&&m?function(t){const e=g(t);return[b(t),e,b(e)]}(a):[g(a)]),x=[a,...w],k=await u(e,y),C=[];let T=(null==(i=s.flip)?void 0:i.overflows)||[];if(d&&C.push(k[_]),h){const{main:t,cross:e}=v(o,r,await(null==l.isRTL?void 0:l.isRTL(c.floating)));C.push(k[t],k[e])}if(T=[...T,{placement:o,overflows:C}],!C.every((t=>t<=0))){var A,D;const t=(null!=(A=null==(D=s.flip)?void 0:D.index)?A:0)+1,e=x[t];if(e)return{data:{index:t,overflows:T},reset:{placement:e}};let i="bottom";switch(f){case"bestFit":{var E;const t=null==(E=T.map((t=>[t,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:E[0].placement;t&&(i=t);break}case"initialPlacement":i=a}if(o!==i)return{reset:{placement:i}}}return{}}}};function C(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function T(t){return _.some((e=>t[e]>=0))}const A=function(t){let{strategy:e="referenceHidden",...i}=void 0===t?{}:t;return{name:"hide",async fn(t){const{rects:n}=t;switch(e){case"referenceHidden":{const e=C(await u(t,{...i,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:T(e)}}}case"escaped":{const e=C(await u(t,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:T(e)}}}default:return{}}}}},D=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){const{x:i,y:r}=e,a=await async function(t,e){const{placement:i,platform:r,elements:a}=t,l=await(null==r.isRTL?void 0:r.isRTL(a.floating)),c=n(i),u=o(i),d="x"===s(i),h=["left","top"].includes(c)?-1:1,p=l&&d?-1:1,f="function"==typeof e?e(t):e;let{mainAxis:m,crossAxis:g,alignmentAxis:v}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return u&&"number"==typeof v&&(g="end"===u?-1*v:v),d?{x:g*p,y:m*h}:{x:m*h,y:g*p}}(e,t);return{x:i+a.x,y:r+a.y,data:a}}}};function E(t){return"x"===t?"y":"x"}const S=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:i,y:o,placement:r}=e,{mainAxis:a=!0,crossAxis:l=!1,limiter:c={fn:t=>{let{x:e,y:i}=t;return{x:e,y:i}}},...d}=t,h={x:i,y:o},f=await u(e,d),m=s(n(r)),g=E(m);let v=h[m],y=h[g];if(a){const t="y"===m?"bottom":"right";v=p(v+f["y"===m?"top":"left"],v,v-f[t])}if(l){const t="y"===g?"bottom":"right";y=p(y+f["y"===g?"top":"left"],y,y-f[t])}const b=c.fn({...e,[m]:v,[g]:y});return{...b,data:{x:b.x-i,y:b.y-o}}}}},$=function(t){return void 0===t&&(t={}),{options:t,fn(e){const{x:i,y:o,placement:r,rects:a,middlewareData:l}=e,{offset:c=0,mainAxis:u=!0,crossAxis:d=!0}=t,h={x:i,y:o},p=s(r),f=E(p);let m=h[p],g=h[f];const v="function"==typeof c?c(e):c,y="number"==typeof v?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(u){const t="y"===p?"height":"width",e=a.reference[p]-a.floating[t]+y.mainAxis,i=a.reference[p]+a.reference[t]-y.mainAxis;mi&&(m=i)}if(d){var b,_,w,x;const t="y"===p?"width":"height",e=["top","left"].includes(n(r)),i=a.reference[f]-a.floating[t]+(e&&null!=(b=null==(_=l.offset)?void 0:_[f])?b:0)+(e?0:y.crossAxis),o=a.reference[f]+a.reference[t]+(e?0:null!=(w=null==(x=l.offset)?void 0:x[f])?w:0)-(e?y.crossAxis:0);go&&(g=o)}return{[p]:m,[f]:g}}}},P=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){const{placement:i,rects:s,platform:r,elements:a}=e,{apply:l=(()=>{}),...c}=t,d=await u(e,c),p=n(i),f=o(i);let m,g;"top"===p||"bottom"===p?(m=p,g=f===(await(null==r.isRTL?void 0:r.isRTL(a.floating))?"start":"end")?"left":"right"):(g=p,m="end"===f?"top":"bottom");const v=h(d.left,0),y=h(d.right,0),b=h(d.top,0),_=h(d.bottom,0),w={availableHeight:s.floating.height-(["left","right"].includes(i)?2*(0!==b||0!==_?b+_:h(d.top,d.bottom)):d[m]),availableWidth:s.floating.width-(["top","bottom"].includes(i)?2*(0!==v||0!==y?v+y:h(d.left,d.right)):d[g])};await l({...e,...w});const x=await r.getDimensions(a.floating);return s.floating.width!==x.width||s.floating.height!==x.height?{reset:{rects:!0}}:{}}}},O=function(t){return void 0===t&&(t={}),{name:"inline",options:t,async fn(e){var i;const{placement:o,elements:r,rects:a,platform:u,strategy:p}=e,{padding:f=2,x:m,y:g}=t,v=c(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({rect:a.reference,offsetParent:await(null==u.getOffsetParent?void 0:u.getOffsetParent(r.floating)),strategy:p}):a.reference),y=null!=(i=await(null==u.getClientRects?void 0:u.getClientRects(r.reference)))?i:[],b=l(f),_=await u.getElementRects({reference:{getBoundingClientRect:function(){var t;if(2===y.length&&y[0].left>y[1].right&&null!=m&&null!=g)return null!=(t=y.find((t=>m>t.left-b.left&&mt.top-b.top&&g=2){if("x"===s(o)){const t=y[0],e=y[y.length-1],i="top"===n(o),s=t.top,r=e.bottom,a=i?t.left:e.left,l=i?t.right:e.right;return{top:s,bottom:r,left:a,right:l,width:l-a,height:r-s,x:a,y:s}}const t="left"===n(o),e=h(...y.map((t=>t.right))),i=d(...y.map((t=>t.left))),r=y.filter((n=>t?n.left===i:n.right===e)),a=r[0].top,l=r[r.length-1].bottom;return{top:a,bottom:l,left:i,right:e,width:e-i,height:l-a,x:i,y:a}}return v}},floating:r.floating,strategy:p});return a.reference.x!==_.reference.x||a.reference.y!==_.reference.y||a.reference.width!==_.reference.width||a.reference.height!==_.reference.height?{reset:{rects:_}}:{}}}};function L(t){return t&&t.document&&t.location&&t.alert&&t.setInterval}function j(t){if(null==t)return window;if(!L(t)){const e=t.ownerDocument;return e&&e.defaultView||window}return t}function I(t){return j(t).getComputedStyle(t)}function M(t){return L(t)?"":t?(t.nodeName||"").toLowerCase():""}function N(){const t=navigator.userAgentData;return null!=t&&t.brands?t.brands.map((t=>t.brand+"/"+t.version)).join(" "):navigator.userAgent}function H(t){return t instanceof j(t).HTMLElement}function F(t){return t instanceof j(t).Element}function R(t){return"undefined"!=typeof ShadowRoot&&(t instanceof j(t).ShadowRoot||t instanceof ShadowRoot)}function B(t){const{overflow:e,overflowX:i,overflowY:n,display:o}=I(t);return/auto|scroll|overlay|hidden/.test(e+n+i)&&!["inline","contents"].includes(o)}function q(t){return["table","td","th"].includes(M(t))}function U(t){const e=/firefox/i.test(N()),i=I(t);return"none"!==i.transform||"none"!==i.perspective||e&&"filter"===i.willChange||e&&!!i.filter&&"none"!==i.filter||["transform","perspective"].some((t=>i.willChange.includes(t)))||["paint","layout","strict","content"].some((t=>{const e=i.contain;return null!=e&&e.includes(t)}))}function W(){return!/^((?!chrome|android).)*safari/i.test(N())}function z(t){return["html","body","#document"].includes(M(t))}const V=Math.min,Y=Math.max,X=Math.round;function G(t,e,i){var n,o,s,r;void 0===e&&(e=!1),void 0===i&&(i=!1);const a=t.getBoundingClientRect();let l=1,c=1;e&&H(t)&&(l=t.offsetWidth>0&&X(a.width)/t.offsetWidth||1,c=t.offsetHeight>0&&X(a.height)/t.offsetHeight||1);const u=F(t)?j(t):window,d=!W()&&i,h=(a.left+(d&&null!=(n=null==(o=u.visualViewport)?void 0:o.offsetLeft)?n:0))/l,p=(a.top+(d&&null!=(s=null==(r=u.visualViewport)?void 0:r.offsetTop)?s:0))/c,f=a.width/l,m=a.height/c;return{width:f,height:m,top:p,right:h+f,bottom:p+m,left:h,x:h,y:p}}function Q(t){return(e=t,(e instanceof j(e).Node?t.ownerDocument:t.document)||window.document).documentElement;var e}function K(t){return F(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function J(t){return G(Q(t)).left+K(t).scrollLeft}function Z(t,e,i){const n=H(e),o=Q(e),s=G(t,n&&function(t){const e=G(t);return X(e.width)!==t.offsetWidth||X(e.height)!==t.offsetHeight}(e),"fixed"===i);let r={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(n||!n&&"fixed"!==i)if(("body"!==M(e)||B(o))&&(r=K(e)),H(e)){const t=G(e,!0);a.x=t.x+e.clientLeft,a.y=t.y+e.clientTop}else o&&(a.x=J(o));return{x:s.left+r.scrollLeft-a.x,y:s.top+r.scrollTop-a.y,width:s.width,height:s.height}}function tt(t){return"html"===M(t)?t:t.assignedSlot||t.parentNode||(R(t)?t.host:null)||Q(t)}function et(t){return H(t)&&"fixed"!==I(t).position?t.offsetParent:null}function it(t){const e=j(t);let i=et(t);for(;i&&q(i)&&"static"===I(i).position;)i=et(i);return i&&("html"===M(i)||"body"===M(i)&&"static"===I(i).position&&!U(i))?e:i||function(t){let e=tt(t);for(R(e)&&(e=e.host);H(e)&&!z(e);){if(U(e))return e;{const t=e.parentNode;e=R(t)?t.host:t}}return null}(t)||e}function nt(t){if(H(t))return{width:t.offsetWidth,height:t.offsetHeight};const e=G(t);return{width:e.width,height:e.height}}function ot(t){const e=tt(t);return z(e)?t.ownerDocument.body:H(e)&&B(e)?e:ot(e)}function st(t,e){var i;void 0===e&&(e=[]);const n=ot(t),o=n===(null==(i=t.ownerDocument)?void 0:i.body),s=j(n),r=o?[s].concat(s.visualViewport||[],B(n)?n:[]):n,a=e.concat(r);return o?a:a.concat(st(r))}function rt(t,e,i){return"viewport"===e?c(function(t,e){const i=j(t),n=Q(t),o=i.visualViewport;let s=n.clientWidth,r=n.clientHeight,a=0,l=0;if(o){s=o.width,r=o.height;const t=W();(t||!t&&"fixed"===e)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:s,height:r,x:a,y:l}}(t,i)):F(e)?function(t,e){const i=G(t,!1,"fixed"===e),n=i.top+t.clientTop,o=i.left+t.clientLeft;return{top:n,left:o,x:o,y:n,right:o+t.clientWidth,bottom:n+t.clientHeight,width:t.clientWidth,height:t.clientHeight}}(e,i):c(function(t){var e;const i=Q(t),n=K(t),o=null==(e=t.ownerDocument)?void 0:e.body,s=Y(i.scrollWidth,i.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),r=Y(i.scrollHeight,i.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0);let a=-n.scrollLeft+J(t);const l=-n.scrollTop;return"rtl"===I(o||i).direction&&(a+=Y(i.clientWidth,o?o.clientWidth:0)-s),{width:s,height:r,x:a,y:l}}(Q(t)))}function at(t){const e=st(t),i=function(t,e){let i=t;for(;i&&!z(i)&&!e.includes(i)&&(!F(i)||!["absolute","fixed"].includes(I(i).position));){const t=tt(i);i=R(t)?t.host:t}return i}(t,e);let n=null;if(i&&H(i)){const t=it(i);B(i)?n=i:H(t)&&(n=t)}return F(n)?e.filter((t=>n&&F(t)&&function(t,e){const i=null==e.getRootNode?void 0:e.getRootNode();if(t.contains(e))return!0;if(i&&R(i)){let i=e;do{if(i&&t===i)return!0;i=i.parentNode||i.host}while(i)}return!1}(t,n)&&"body"!==M(t))):[]}const lt={getClippingRect:function(t){let{element:e,boundary:i,rootBoundary:n,strategy:o}=t;const s=[..."clippingAncestors"===i?at(e):[].concat(i),n],r=s[0],a=s.reduce(((t,i)=>{const n=rt(e,i,o);return t.top=Y(n.top,t.top),t.right=V(n.right,t.right),t.bottom=V(n.bottom,t.bottom),t.left=Y(n.left,t.left),t}),rt(e,r,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:e,offsetParent:i,strategy:n}=t;const o=H(i),s=Q(i);if(i===s)return e;let r={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if((o||!o&&"fixed"!==n)&&(("body"!==M(i)||B(s))&&(r=K(i)),H(i))){const t=G(i,!0);a.x=t.x+i.clientLeft,a.y=t.y+i.clientTop}return{...e,x:e.x-r.scrollLeft+a.x,y:e.y-r.scrollTop+a.y}},isElement:F,getDimensions:nt,getOffsetParent:it,getDocumentElement:Q,getElementRects:t=>{let{reference:e,floating:i,strategy:n}=t;return{reference:Z(e,it(i),n),floating:{...nt(i),x:0,y:0}}},getClientRects:t=>Array.from(t.getClientRects()),isRTL:t=>"rtl"===I(t).direction};function ct(t,e,i,n){void 0===n&&(n={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:r=!0,animationFrame:a=!1}=n,l=o&&!a,c=l||s?[...F(t)?st(t):[],...st(e)]:[];c.forEach((t=>{l&&t.addEventListener("scroll",i,{passive:!0}),s&&t.addEventListener("resize",i)}));let u,d=null;if(r){let n=!0;d=new ResizeObserver((()=>{n||i(),n=!1})),F(t)&&!a&&d.observe(t),d.observe(e)}let h=a?G(t):null;return a&&function e(){const n=G(t);!h||n.x===h.x&&n.y===h.y&&n.width===h.width&&n.height===h.height||i(),h=n,u=requestAnimationFrame(e)}(),i(),()=>{var t;c.forEach((t=>{l&&t.removeEventListener("scroll",i),s&&t.removeEventListener("resize",i)})),null==(t=d)||t.disconnect(),d=null,a&&cancelAnimationFrame(u)}}const ut=(t,e,i)=>(async(t,e,i)=>{const{placement:n="bottom",strategy:o="absolute",middleware:s=[],platform:r}=i,l=await(null==r.isRTL?void 0:r.isRTL(e));let c=await r.getElementRects({reference:t,floating:e,strategy:o}),{x:u,y:d}=a(c,n,l),h=n,p={},f=0;for(let i=0;i{i.p},797:function(t,e,i){var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var o=Object.getOwnPropertyDescriptor(e,i);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,n,o)}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)"default"!==i&&Object.prototype.hasOwnProperty.call(t,i)&&n(e,t,i);return o(e,t),e},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.TourGuideClient=void 0;const a=i(693),l=r(i(121)),c=i(319),u=i(166),d=i(737),h=s(i(483)),p=r(i(971)),f=r(i(330)),m=r(i(340)),g=r(i(544)),v=s(i(612)),y=s(i(283)),b=r(i(717));e.TourGuideClient=class{constructor(t){this.group="",this.isVisible=!1,this.activeStep=0,this.tourSteps=[],this.options=b.default,this.isFinished=y.getIsFinished,this.createTourGuideBackdrop=c.createTourGuideBackdrop,this.computeBackdropAttributes=c.computeBackdropAttributes,this.createTourGuideDialog=a.createTourGuideDialog,this.start=f.default,this.visitStep=h.default,this.addSteps=p.default,this.nextStep=h.handleVisitNextStep,this.prevStep=h.handleVisitPrevStep,this.exit=g.default,this.refresh=v.default,this.refreshDialog=v.handleRefreshDialog,this.finishTour=y.default,this.updatePositions=l.default,this.deleteFinishedTour=y.delFinishedTour,this.setOptions=m.default,this.initListeners=d.handleInitListeners,this.destroyListeners=d.handleDestroyListeners,this._trackedEvents={nextBtnClickEvent:{initialized:!1,fn:this.nextStep.bind(this)},prevBtnClickEvent:{initialized:!1,fn:this.prevStep.bind(this)},closeBtnClickEvent:{initialized:!1,fn:this.exit.bind(this)},keyPressEvent:{initialized:!1,fn:d.keyPressHandler.bind(this)},outsideClickEvent:{initialized:!1,fn:d.clickOutsideHandler.bind(this)}},this.onFinish=u.handleOnFinish,this.onBeforeExit=u.handleOnBeforeExit,this.onAfterExit=u.handleOnAfterExit,this.onBeforeStepChange=u.handleOnBeforeStepChange,this.onAfterStepChange=u.handleOnAfterStepChange,this.dialog=document.createElement("div"),this.backdrop=document.createElement("div"),this.options=b.default,t&&Object.assign(this.options,t),this.createTourGuideDialog().catch((t=>{this.options.debug&&console.warn(t)})),this.createTourGuideBackdrop()}}},319:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.computeBackdropPosition=e.computeBackdropAttributes=e.createTourGuideBackdrop=void 0,e.createTourGuideBackdrop=function(){this.backdrop=document.createElement("div"),this.computeBackdropAttributes(),document.body.append(this.backdrop)},e.computeBackdropAttributes=function(){this.options&&(this.backdrop.className="tg-backdrop",this.backdrop.style.boxShadow=this.options.backdropColor+" 0 0 1px 2px, "+this.options.backdropColor+" 0 0 0 1000vh",this.options.backdropClass&&this.backdrop.classList.add(this.options.backdropClass),this.options.dialogAnimate&&this.backdrop.classList.add("tg-backdrop-animate"))},e.computeBackdropPosition=function(t){return new Promise((async(e,i)=>{if(void 0===t.options.targetPadding)return i("Options failed to initialize");if(!t.backdrop)return i("No backdrop element initialized");const n=t.tourSteps[t.activeStep],o=n.target,s=o.getBoundingClientRect(),r=s.width+t.options.targetPadding>document.documentElement.clientWidth;if(o===document.body){const e=0;s.width=e,s.height=e,t.backdrop.style.position="fixed",t.backdrop.style.top=window.innerHeight/2.5+"px",t.backdrop.style.left=window.innerWidth/2+"px"}else n.fixed?(t.backdrop.style.position="fixed",t.backdrop.style.top=s.top-t.options.targetPadding/2+"px",t.backdrop.style.left=(r?s.x:s.x-t.options.targetPadding/2)+"px"):(t.backdrop.style.position="absolute",t.backdrop.style.top=window.scrollY+s.top-t.options.targetPadding/2+"px",t.backdrop.style.left=(r?s.x:s.x-t.options.targetPadding/2)+"px");t.backdrop.style.width=(r?s.width:s.width+t.options.targetPadding)+"px",t.backdrop.style.height=(s.height?s.height+t.options.targetPadding:s.height)+"px",e(!0)}))}},166:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.handleOnAfterStepChange=e.handleOnBeforeStepChange=e.handleOnAfterExit=e.handleOnBeforeExit=e.handleOnFinish=void 0,e.handleOnFinish=function(t){if("function"!=typeof t)throw new Error("Provided callback for onFinish was not a function");this._globalFinishCallback=t},e.handleOnBeforeExit=function(t){if("function"!=typeof t)throw new Error("Provided callback for onBeforeExit was not a function");this._globalBeforeExitCallback=t},e.handleOnAfterExit=function(t){if("function"!=typeof t)throw new Error("Provided callback for onAfterExit was not a function");this._globalAfterExitCallback=t},e.handleOnBeforeStepChange=function(t){if("function"!=typeof t)throw new Error("Provided callback for onBeforeStepChange was not a function");this._globalBeforeChangeCallback=t},e.handleOnAfterStepChange=function(t){if("function"!=typeof t)throw new Error("Provided callback for onAfterStepChange was not a function");this._globalAfterChangeCallback=t}},693:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.computeDialogPosition=e.updateDialogHtml=e.renderDialogHtml=e.createTourGuideDialog=void 0;const n=i(500),o=i(362);async function s(t){t.options.dialogClass&&t.dialog.classList.add(t.options.dialogClass),t.options.dialogZ&&(t.dialog.style.zIndex=String(t.options.dialogZ)),t.dialog.style.width=t.options.dialogWidth?t.options.dialogWidth+"px":"auto",t.options.dialogMaxWidth&&(t.dialog.style.maxWidth=t.options.dialogMaxWidth+"px");let e="";if(e+="
",e+='
\x3c!-- JS rendered --\x3e
',t.options.closeButton&&(e+='
',e+=' ',e+="
"),e+="
",t.options.progressBar&&(e+='
'),e+='
\x3c!-- JS rendered --\x3e
',t.options.showStepDots&&"body"===t.options.stepDotsPlacement){const t=(0,n.dotsWrapperHtmlString)();t&&(e+=t)}e+='",e+='
\x3c!-- end tour arrow --\x3e',e}e.createTourGuideDialog=async function(){return this.dialog=document.createElement("div"),this.dialog.classList.add("tg-dialog"),await s(this).then((t=>{this.dialog.innerHTML=t})),document.body.append(this.dialog),!0},e.renderDialogHtml=s,e.updateDialogHtml=function(t){return new Promise(((e,i)=>{const o=t.tourSteps[t.activeStep];o||i("No active step data");const s=document.getElementById("tg-dialog-title");s&&(s.innerHTML=o.title?o.title:"");const r=document.getElementById("tg-dialog-body");r&&o&&("string"==typeof o.content?r.innerHTML=o.content?o.content:"":(r.innerHTML="",r.append(o.content)));const a=document.getElementById("tg-dialog-dots");a&&t.options.showStepDots&&(0,n.computeDots)(t)&&(a.innerHTML=(0,n.computeDots)(t));const l=document.getElementById("tg-dialog-prev-btn");l&&(0===t.activeStep?(l.classList.add("disabled"),l.setAttribute("disabled","true")):(l.classList.remove("disabled"),l.removeAttribute("disabled")));const c=document.getElementById("tg-dialog-next-btn");c&&(c.innerHTML=t.activeStep+1>=t.tourSteps.length?t.options.finishLabel:t.options.nextLabel);const u=document.getElementById("tg-step-progress");u&&(u.innerHTML=t.activeStep+1+"/"+t.tourSteps.length);const d=document.getElementById("tg-dialog-progbar");d&&(t.options.progressBar&&(d.style.backgroundColor=t.options.progressBar),d.style.width=(t.activeStep+1)/t.tourSteps.length*100+"%"),e(!0)}))},e.computeDialogPosition=function(t){return new Promise((async e=>{const i=document.querySelector("#tg-arrow");let n=t.tourSteps[t.activeStep].target;if(n===document.body)return Object.assign(t.dialog.style,{top:window.innerHeight/2.25-t.dialog.clientHeight/2+"px",left:window.innerWidth/2-t.dialog.clientWidth/2+"px",position:"fixed"}),t.dialog.classList.add("tg-dialog-fixed"),i&&(i.style.display="none"),e(!0);t.dialog.style.position="absolute",t.dialog.classList.remove("tg-dialog-fixed"),i&&(i.style.display="inline-block"),(0,o.computePosition)(n,t.dialog,{placement:t.options.dialogPlacement,middleware:[(0,o.autoPlacement)({autoAlignment:!0,padding:5}),(0,o.shift)({padding:15}),(0,o.arrow)({element:i}),(0,o.offset)(20)]}).then((({x:n,y:o,placement:s,middlewareData:r})=>{if(Object.assign(t.dialog.style,{left:`${n}px`,top:`${o}px`}),r.arrow){const t=r.arrow.x,e=r.arrow.y,n={top:"bottom",right:"left",bottom:"top",left:"right"}[s.split("-")[0]];i&&Object.assign(i.style,{left:null!=t?`${t}px`:"",top:null!=e?`${e}px`:"",[n]:"-4px"})}return e(!0)}))}))}},500:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.computeDots=e.dotsWrapperHtmlString=void 0,e.dotsWrapperHtmlString=function(){const t=document.createElement("div");return t.classList.add("tg-dialog-dots"),t.id="tg-dialog-dots",t.outerHTML},e.computeDots=t=>{let e="";return t.tourSteps.length&&t.tourSteps.forEach(((i,n)=>{const o=document.createElement("span");o.classList.add("tg-dot"),n===t.activeStep&&o.classList.add("tg-dot-active"),e+=o.outerHTML})),e}},737:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.keyPressHandler=e.clickOutsideHandler=e.handleDestroyListeners=e.handleInitListeners=void 0,e.clickOutsideHandler=async function(t){if(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),!(t.target instanceof Element))return;const e=this.backdrop.getBoundingClientRect();if(t.clientX>=e.x&&t.clientX<=e.x+e.width&&t.clientY>=e.y&&t.clientY<=e.y+e.height)return;const i=this.dialog.getBoundingClientRect();t.clientX>=i.x&&t.clientX<=i.x+i.width&&t.clientY>=i.y&&t.clientY<=i.y+i.height||this.dialog.contains(t.target)||await this.exit()},e.keyPressHandler=async function(t){return"Escape"===t.key&&this.options.exitOnEscape?(t.preventDefault(),void await this.exit()):"ArrowRight"===t.key&&this.options.keyboardControls?(t.preventDefault(),void this.visitStep("next").catch((t=>{this.options.debug&&console.warn(t)}))):"ArrowLeft"===t.key&&this.options.keyboardControls?(t.preventDefault(),void this.visitStep("prev").catch((t=>{this.options.debug&&console.warn(t)}))):void 0},e.handleInitListeners=function(){const t=()=>{let t=document.getElementById("tg-dialog-next-btn");t&&!this._trackedEvents.nextBtnClickEvent.initialized&&(t.addEventListener("click",this._trackedEvents.nextBtnClickEvent.fn),this._trackedEvents.nextBtnClickEvent.initialized=!0)},e=()=>{let t=document.getElementById("tg-dialog-prev-btn");t&&!this._trackedEvents.prevBtnClickEvent.initialized&&(t.addEventListener("click",this._trackedEvents.prevBtnClickEvent.fn),this._trackedEvents.prevBtnClickEvent.initialized=!0)},i=()=>{let t=document.getElementById("tg-dialog-close-btn");t&&!this._trackedEvents.closeBtnClickEvent.initialized&&(t.addEventListener("click",this._trackedEvents.closeBtnClickEvent.fn,!1),this._trackedEvents.closeBtnClickEvent.initialized=!0)},n=()=>{this._trackedEvents.outsideClickEvent.initialized||(document.body.addEventListener("click",this._trackedEvents.outsideClickEvent.fn,!1),this._trackedEvents.outsideClickEvent.initialized=!0)},o=()=>{this._trackedEvents.keyPressEvent.initialized||(window.addEventListener("keydown",this._trackedEvents.keyPressEvent.fn,!1),this._trackedEvents.keyPressEvent.initialized=!0)};return new Promise((s=>(this.options.showButtons&&t(),this.options.showButtons&&e(),this.options.closeButton&&i(),this.options.exitOnClickOutside&&n(),(this.options.keyboardControls||this.options.exitOnEscape)&&o(),s(!0))))},e.handleDestroyListeners=function(){const t=()=>{let t=document.getElementById("tg-dialog-next-btn");t&&(t.removeEventListener("click",this._trackedEvents.nextBtnClickEvent.fn),this._trackedEvents.nextBtnClickEvent.initialized=!1)},e=()=>{let t=document.getElementById("tg-dialog-prev-btn");t&&(t.removeEventListener("click",this._trackedEvents.prevBtnClickEvent.fn),this._trackedEvents.prevBtnClickEvent.initialized=!1)},i=()=>{let t=document.getElementById("tg-dialog-close-btn");t&&(t.removeEventListener("click",this._trackedEvents.closeBtnClickEvent.fn,!1),this._trackedEvents.closeBtnClickEvent.initialized=!1)},n=()=>{document.body.removeEventListener("click",this._trackedEvents.outsideClickEvent.fn,!1),this._trackedEvents.outsideClickEvent.initialized=!1},o=()=>{window.removeEventListener("keydown",this._trackedEvents.keyPressEvent.fn,!1),this._trackedEvents.keyPressEvent.initialized=!1};return new Promise((s=>(this.options.showButtons&&t(),this.options.showButtons&&e(),this.options.closeButton&&i(),this.options.exitOnClickOutside&&n(),(this.options.keyboardControls||this.options.exitOnEscape)&&o(),s(!0))))}},121:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0});const n=i(319),o=i(693);e.default=function(){return new Promise((async t=>{this.backdrop.style.display="block",await(0,n.computeBackdropPosition)(this),this.dialog.style.display="block",this.options.dialogAnimate&&this.isVisible&&this.dialog.classList.add("animate-position"),await(0,o.computeDialogPosition)(this),this.options.dialogAnimate&&setTimeout((()=>{this.dialog.classList.remove("animate-position")}),300),this.isVisible=!0,window.onresize||(window.onresize=()=>{(0,n.computeBackdropPosition)(this),(0,o.computeDialogPosition)(this)}),window.onscroll||(window.onscroll=()=>{(0,o.computeDialogPosition)(this)}),await setTimeout((()=>t(!0)),300)}))}},830:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=(t,e)=>{e.scrollIntoView({behavior:t.options.autoScrollSmooth?"smooth":"auto",block:"end",inline:"nearest"})}},755:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=async function(t){return new Promise((async(e,i)=>{let n=[];t.options.steps&&t.options.steps.length&&(n=t.options.steps.map((t=>("string"==typeof t.target&&(t.target=document.querySelector(t.target)),t.target||(t.target=document.body),t))));const o=document.querySelectorAll("[data-tg-tour]");return o&&o.forEach((e=>{const i=e.getAttribute("data-tg-title"),o=e.getAttribute("data-tg-tour"),s=e.getAttribute("data-tg-group"),r=e.getAttribute("data-tg-order"),a=e.getAttribute("data-tg-fixed"),l=e.getAttribute("data-tg-margin");t.options.targetPadding&&t.options.autoScrollOffset?e.style.scrollMargin=(l?l+t.options.targetPadding:t.options.autoScrollOffset+t.options.targetPadding)+"px 0":e.style.scrollMargin=(l||"30")+"px 0",n.push({title:i||void 0,order:r?Number(r):999,target:e,content:o||void 0,fixed:null!==a&&"false"!==a,group:s||void 0})})),t.group&&(n=n.filter((e=>e.group===t.group))),n.sort((function(t,e){return new Date(t.order){this.options.debug&&console.warn(t)})),this.isVisible&&this.updatePositions().catch((t=>{this.options.debug&&console.warn(t)})),this.isVisible&&await(0,r.default)(".tg-dialog").then((async()=>(await this.destroyListeners(),await this.initListeners(),!0))))}},544:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=async function(){if(this._globalBeforeExitCallback)try{await this._globalBeforeExitCallback()}catch(t){return}this.dialog.style.display="none",this.backdrop.style.display="none",this.isVisible=!1,this.options.rememberStep||(this.activeStep=0),this.options.debug&&console.info("Tour exited"),await this.destroyListeners(),setTimeout((()=>{this._globalAfterExitCallback&&this._globalAfterExitCallback()}),0)}},283:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.delFinishedTour=e.getIsFinished=void 0,e.getIsFinished=function(t="tour"){return localStorage.tg_tours_complete.split(",").includes(t)},e.delFinishedTour=function(t="tour"){if("all"===t)return void(localStorage.tg_tours_complete=null);const e=localStorage.tg_tours_complete.split(",");localStorage.tg_tours_complete=e.filter((e=>e!==t))},e.default=async function(t=!0,e="tour"){if(this._globalFinishCallback)try{await this._globalFinishCallback()}catch(t){return!1}if(this.options.completeOnFinish){if(!localStorage.tg_tours_complete)return localStorage.tg_tours_complete=[e],t&&await this.exit(),void(this.activeStep=0);const i=localStorage.tg_tours_complete.split(",");i.push(e),localStorage.tg_tours_complete=i}return t&&await this.exit(),this.activeStep=0,!0}},612:function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.handleRefreshDialog=void 0;const o=n(i(755)),s=i(693),r=n(i(570));e.handleRefreshDialog=async function(){return new Promise((async(t,e)=>(await(0,s.renderDialogHtml)(this).then((t=>{t&&(this.dialog.innerHTML=t)})).catch((t=>{this.options.debug&&console.warn(t)})),await(0,s.updateDialogHtml)(this).catch((t=>{this.options.debug&&console.warn(t),e(t)})),await this.updatePositions(),this.isVisible&&await(0,r.default)(".tg-dialog").then((async()=>(await this.destroyListeners(),await this.initListeners(),!0))),t(!0))))},e.default=async function(){return new Promise((async(t,e)=>(await(0,o.default)(this).catch((t=>e(t))),this.computeBackdropAttributes(),await this.refreshDialog().catch((t=>e(t))),t(!0))))}},340:function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const o=i(693),s=n(i(570));e.default=async function(t){if(t)return Object.assign(this.options,t),this.computeBackdropAttributes(),await(0,o.renderDialogHtml)(this).then((t=>{t&&(this.dialog.innerHTML=t)})).catch((t=>{this.options.debug&&console.warn(t)})),await(0,o.updateDialogHtml)(this).catch((t=>{this.options.debug&&console.warn(t)})),this.isVisible&&await(0,s.default)(".tg-dialog").then((async()=>(await this.destroyListeners(),await this.initListeners(),!0))),this}},330:function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const o=n(i(570)),s=n(i(755));e.default=async function(t){return new Promise((async(e,i)=>{if(this.isVisible)return this.options.debug&&console.warn("Tour already active"),i("Tour already active");t&&(this.group=t),this.options.debug&&console.info("Start tour");const n=this;try{await(0,s.default)(n)}catch(t){return this.options.debug&&console.warn(t),i(t)}return await n.visitStep(this.activeStep).catch((t=>(this.options.debug&&console.warn(t),i(t)))),await(0,o.default)(".tg-dialog").then((async()=>{await this.initListeners(),this.options.dialogAnimate&&this.dialog.classList.add("animate-position")})),e(!0)}))}},483:function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.handleVisitPrevStep=e.handleVisitNextStep=e.goToStep=void 0;const o=i(693),s=n(i(830));function r(t,e){return new Promise((async(i,n)=>{if(e>=t.tourSteps.length)return n("End of tour steps");if(e<0)return n("Start of tour steps");const r=t.activeStep,a=t.tourSteps[r],l=t.tourSteps[e];if(!l||!a)return n("Step not found by index");if(t._globalBeforeChangeCallback&&e!==r)try{await t._globalBeforeChangeCallback()}catch(t){return n(t)}if(a.beforeLeave)try{await a.beforeLeave(a,l)}catch(t){return n(t)}if(l.beforeEnter)try{await l.beforeEnter(a,l)}catch(t){return n(t)}return"string"==typeof l.target&&(t.tourSteps[e].target=document.querySelector(l.target)),l.target&&t.tourSteps[e].target||(t.tourSteps[e].target=document.body),t.activeStep=Number(e),await(0,o.updateDialogHtml)(t).catch((e=>{t.options.debug&&console.warn(e),n(e)})),t.options.autoScroll&&l.target!==document.body&&await(0,s.default)(t,l.target),await t.updatePositions(),a.afterLeave&&await a.afterLeave(a,l),l.afterEnter&&await l.afterEnter(a,l),t._globalAfterChangeCallback&&e!==r&&await t._globalAfterChangeCallback(),i(!0)}))}e.handleVisitNextStep=async function(){return new Promise((async(t,e)=>{const i=this.activeStep+1;try{await this.visitStep(i)}catch(t){return e(t)}return t(!0)}))},e.handleVisitPrevStep=async function(){return new Promise((async(t,e)=>{const i=this.activeStep-1;try{await this.visitStep(i)}catch(t){return e(t)}return t(!0)}))},e.goToStep=r,e.default=async function(t){return new Promise((async(e,i)=>{if("string"==typeof t&&(t="next"===t?this.activeStep+1:this.activeStep-1),!(t>=this.tourSteps.length))return await r(this,t).catch((t=>i(t))),e(!0);await this.finishTour(!0,this.group)}))}},717:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={nextLabel:"Next",prevLabel:"Back",finishLabel:"Finish",hidePrev:!1,hideNext:!1,dialogClass:"",dialogZ:999,dialogWidth:0,dialogMaxWidth:340,dialogAnimate:!0,dialogPlacement:void 0,backdropClass:"",backdropColor:"rgba(20,20,21,0.84)",backdropAnimate:!0,targetPadding:30,completeOnFinish:!0,showStepDots:!0,stepDotsPlacement:"footer",showButtons:!0,showStepProgress:!0,progressBar:"",keyboardControls:!0,exitOnEscape:!0,exitOnClickOutside:!0,autoScroll:!0,autoScrollSmooth:!0,autoScrollOffset:20,closeButton:!0,rememberStep:!1,debug:!0,steps:[]}},570:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return new Promise((e=>{if(document.querySelector(t))return e(document.querySelector(t));const i=new MutationObserver((()=>{document.querySelector(t)&&(e(document.querySelector(t)),i.disconnect())}));i.observe(document.body,{childList:!0,subtree:!0})}))}}},e={};function i(n){var o=e[n];if(void 0!==o)return o.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,i),s.exports}return i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.p="",i(131),i(797)})(),t.exports=e()},899:()=>{!function(t){t.fn.aggregator=function(){function e(t){var e=t.clone();return e.attr("data-aggregate-id","new").find("ul").empty(),t.before(e),i(e),e}function i(i){i.find("li").length<2&&i.find(".explode-aggregate").hide(),i.find("ul").sortable({connectWith:"#orderAggregator div.card ul",accept:"li",drop:function(i,n){var o=t(this).find("li").length;0==o?e(t(this)):1==o&&t(this).find(".explode-aggregate").show();var s=n.draggable.closest(".card");2==s.find("li").length&&s.find(".explode-aggregate").hide(),n.draggable.css("right","").css("left","").css("top","").css("bottom","").css("width","").css("height",""),t(this).find("ul").append(n.draggable)}})}t(this).each((function(){t(this).find("div.card").each((function(){i(t(this))})),t(this).on("click",".explode-aggregate",(function(){var i=t(this).closest(".card");i.find("li").each((function(){e(i).find("ul").append(t(this).clone())})),i.remove()})),t(this).submit((function(e){e.preventDefault();var i=t(this);i.find("button[type=submit]").prop("disabled",!1);var n=new Array;i.find(".card").each((function(){var e={id:t(this).attr("data-aggregate-id"),orders:new Array};t(this).find("li").each((function(){e.orders.push(t(this).attr("data-order-id"))})),n.push(e)})),t.ajax({method:i.attr("method"),url:i.attr("action"),data:{data:JSON.stringify(n)},dataType:"json",success:function(t){location.reload()}})}))}))}}(jQuery)},676:(t,e,i)=>{"use strict";i.d(e,{A:()=>l});var n=i(404),o=i(955);function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function r(t,e){for(var i=0;i .accordion-item").sort((function(e,i){e=$(e),i=$(i);var n=t.getBookingRowStatus(e),o=t.getBookingRowStatus(i),s=0;if(n==o)s=e.find(".accordion-button").text().trim().localeCompare(i.find(".accordion-button").text().trim());else{var r=["pending","saved","shipped"];s=r.indexOf(n)-r.indexOf(o)}return s})).each((function(){$(this).appendTo(e)}))}},{key:"submitDeliveryForm",value:function(t){t.find(".fit-add-product").not(".hidden").each((function(){if(0==$(this).find(".inline-variant-selector").length){var e=$(this).find(".booking-product-quantity input:text.number");if(0!=e.length){var i=n.A.sanitizeId(e.attr("name")),o=n.A.parseFloatC(e.val()),s=t.find("tr.booking-product").not(".fit-add-product").find("input:text.number[name="+i+"]");0!=s.length&&(s.val(n.A.parseFloatC(s.val())+o),e.remove())}}}))}},{key:"evaluateEmptyBooking",value:function(t){if("shipped"==t.find("input:hidden[name=action]").val()){var e=!1;if(t.find(".booking-total").each((function(){var t=n.A.parseFloatC($(this).textVal());e=e||0!=t})),0==e&&0==(e=confirm(_("Tutte le quantità consegnate sono a zero! Vuoi davvero procedere?"))))throw"Empty!"}}},{key:"collectFilteredUsers",value:function(t){t.find('input:hidden[name^="users"]').remove(),$("#credits_status_table tbody tr:visible").each((function(){var e=$(this).find("input[name^=user_id]").val();t.append('')}))}},{key:"formToDownload",value:function(t){var e=t.find("input, select").serializeArray(),i=t.attr("action")+"&"+$.param(e);throw window.open(i,"_blank"),"Done!"}},{key:"passwordProtected",value:function(t){if("1"!=t.attr("data-password-protected-verified")){var e=t.attr("id"),i=$("#password-protection-dialog");throw i.find("input:password").val(""),i.attr("data-form-target","#"+e).modal("show"),"Check password!"}}},{key:"checkVariantsValues",value:function(t){if(t.find("table tbody tr").filter((function(){var t=$(this).find("input[name^=value]").first();if(t){var e=t.val();return void 0!==e&&""!=e}return!1})).length<=0)throw alert("Devi specificare almeno un valore per la variante"),"No values!"}},{key:"closeAllModals",value:function(){$(".modal.fade.show").modal("hide")}},{key:"triggerPayment",value:function(t){if("shipped"==t.find("input:hidden[name=action]").val()){var e=t.attr("data-reference-modal");$("#"+e).appendTo("body").modal("show")}}},{key:"displayRecalculatedBalances",value:function(t,e){var i=$("#display-recalculated-balance-modal");if(0!=e.diffs.length){var n=i.find(".broken.hidden").removeClass("hidden").find("tbody");for(var o in e.diffs)e.diffs.hasOwnProperty(o)&&n.append(""+o+""+e.diffs[o][0]+""+e.diffs[o][1]+"")}else i.find(".fixed.hidden").removeClass("hidden");i.modal("show")}},{key:"refreshFilter",value:function(t){var e=t.find("input:hidden[name=data-refresh-target]").val();e?$(".form-filler").filter(e).find("button[type=submit]").click():$(".form-filler").find("button[type=submit]").click()}},{key:"genericAfterChange",value:function(t,e,i){n.A.postAjax({method:"GET",url:i+"/"+e.id+"/post_feedback",dataType:"JSON",success:function(t){for(var e=0;e a[data-element-id="+e.id+"]").length&&(e.url=e.url.replace("booking/","delivery/"),o.A.appendToLoadableList(n,e,!1))}}else o.A.closeParent(t)}},{key:"removeTargetListItem",value:function(t,e){t=o.A.formByElementId(e.id);var i=o.A.closeParent(t),n=i.closest(".loadable-list");i.remove(),o.A.testListsEmptiness(n)}},{key:"handleUserApproval",value:function(t,e){if(o.A.closeParent(t),"approve"!=e.action){var i=o.A.closeParent(t),n=i.closest(".loadable-list");i.remove(),o.A.testListsEmptiness(n)}}},{key:"reloadLoadableHeaders",value:function(t,e){var i;0!=(i=$('.accordion-item[data-element-id="'+t.find("input[name=sender_id]").val()+'"]').filter(":visible")).length&&o.A.reloadLoadableHead(i),0!=(i=$('.accordion-item[data-element-id="'+t.find("input[name=target_id]").val()+'"]').filter(":visible")).length&&o.A.reloadLoadableHead(i)}},{key:"closeMainForm",value:function(t,e){o.A.closeParent(t)}}],(i=null)&&r(e.prototype,i),s&&r(e,s),Object.defineProperty(e,"prototype",{writable:!1}),t}()},234:(t,e,i)=>{"use strict";function n(t){for(var e=1;et?($(this).val(""),a.A.setInputErrorText($(this),_("Il file è troppo grande!")),!1):(a.A.setInputErrorText($(this),null),!0)}})),$(".img-preview input:file",t).change((function(t){e.previewImage(t.currentTarget)})),$(".simple-sum",t).change((function(){var t=0,e=$(this).closest(".simple-sum-container");e.find(".simple-sum").each((function(){t+=a.A.parseFloatC($(this).val())})),e.find(".simple-sum-result").val(t)})),$(".selective-display",t).each((function(){var e=$(this).attr("data-target"),i=$(this).find("input:radio").filter(":checked").val();$(e,t).addClass("d-none").filter("[data-type="+i+"]").removeClass("d-none")})).find("input:radio").change((function(){if(0!=$(this).prop("checked")){var e=$(this).closest(".selective-display").attr("data-target"),i=$(this).val();$(e,t).addClass("d-none").filter("[data-type="+i+"]").removeClass("d-none")}})),$('.status-selector input:radio[name*="status"]',t).change((function(){var t=$(this).closest(".status-selector"),e=$(this).val(),i="deleted"!=e;t.find("[name=deleted_at]").prop("hidden",i).closest(".input-group").prop("hidden",i);var n="suspended"!=e;t.find("[name=suspended_at]").prop("hidden",n).closest(".input-group").prop("hidden",n)})),0!=$('input[value="put_random_here"]',t).length){var i="new_"+a.A.randomString(5);$('input[value="put_random_here"]',t).each((function(){0!=$(this).closest(".dynamic-table").length&&0!=$(this).closest("tbody").length&&$(this).val(i)}))}$(".sortable-table tbody",t).sortable({items:"> tr",handler:".sorter"})}},{key:"dateEnforcePeer",value:function(t,e){var i=t.attr(e),n=t.closest(".input-group").find(i);return 0==n.length&&0==(n=t.closest("tr").find(i)).length&&(n=t.closest("form").find(i)),n}},{key:"initDatesWidgets",value:function(t){var e=this;$("input.date",t).datepicker({format:"DD dd MM yyyy",autoclose:!0,language:a.A.currentLanguage(),clearBtn:!0}).each((function(){var t=$(this);t.siblings(".input-group-addon").click((function(){t.focus()}))})).on("show",(function(t){t.stopPropagation()})),$("input.date-to-month",t).datepicker({format:"dd MM",autoclose:!0,language:a.A.currentLanguage(),clearBtn:!1,maxViewMode:"months"}),$(".date[data-enforce-after]",t).each((function(t,i){var n=$(i),o=e.dateEnforcePeer(n,"data-enforce-after");o.datepicker().on("changeDate",(function(){var t=n.datepicker("getDate"),e=o.datepicker("getDate");t .table-sorting-header").addClass("d-none").filter("[data-sorting-"+i+"]").removeClass("d-none"),t.find("> tr[data-sorting-"+i+"], .table-sorting-header:visible").sort((function(t,e){var o=$(t).attr("data-sorting-"+i),s=$(e).attr("data-sorting-"+i);return n?parseFloat(o)-parseFloat(s):o.localeCompare(s)})).each((function(){$(this).appendTo(t)})),t.find("> tr.do-not-sort").each((function(){$(this).appendTo(t)}))}))})),$(".form-filler button[type=submit]",t).click((function(t){t.preventDefault();var e=$(this);e.addClass("disabled");var i=e.closest(".form-filler"),n=$(i.attr("data-fill-target")),o=i.find("input, select").serialize(),s=e.attr("data-action");null==s&&(s=i.attr("data-action")),n.empty().append(a.A.j().makeSpinner()),$.ajax({method:"GET",url:s,data:o,dataType:"html",success:function(t){e.removeClass("disabled"),t=$(t),n.empty().append(t),a.A.j().initElements(t)}})})),$(".columns-selector",t).on("click",".dropdown-menu",(function(t){t.stopPropagation()})).on("change","input:checkbox",(function(t){t.preventDefault(),t.stopPropagation();var e=$(t.currentTarget),i=$(e).closest(".columns-selector").attr("data-target"),n=$(e).val(),o=$(e).prop("checked");$("#"+i).find(".order-cell-"+n).toggleClass("hidden",!o)}))}},{key:"compactFilter",value:function(t,e,i){i?$(t).each((function(){$(this).closest(".filter-master-block").show()})):setTimeout((function(){$(t).each((function(){var t=$(this).closest(".filter-master-block");if(0!=t.length){var i=$(this).find(e);i.filter(".hidden").length==i.length?t.hide():t.show()}}))}),100)}},{key:"tableFilters",value:function(t){var e=$('[data-table-target="'+t+'"]');$("table"+t).find("tbody tr").each((function(){var t=!0,i=$(this);e.each((function(){if($(this).hasClass("table-number-filters")){var e=$(this).find("input.table-number-filter").val().toLowerCase();if(""==e)t=t&&!0;else{var n=parseFloat(e),o=$(this).find("input[name=filter_mode]:checked").val(),s=i.find(".text-filterable-cell"),r=parseFloat(s.text());t="min"==o&&r<=n||"max"==o&&r>=n?t&&!0:t&&!1}}else if($(this).hasClass("table-filters")){var a=$(this).find("input:radio:checked"),l=a.val();if("all"==l)t=t&&!0;else{var c=a.attr("name"),u=i.attr("data-filtered-"+c);t=t&&u==l}}else if($(this).hasClass("table-text-filter")){var d=$(this).val().toLowerCase();""==d?t=t&&!0:(t=!1,i.find(".text-filterable-cell").each((function(){if(-1!=$(this).text().toLowerCase().indexOf(d))return t=!0,!1})))}if(0==t)return!1})),i.toggleClass("hidden",0==t)})),this.compactFilter("table"+t,"tbody tr",!1)}},{key:"iconsLegendTrigger",value:function(t,e){if(!t.hasClass("dropdown-toggle")){var i=t.closest(e),n=i.attr("data-list-target"),o="",s="";".icons-legend"==e?(o=".loadable-list"+n,s=".accordion-item"):(o=".table"+n,s="tbody tr");var r=o+" "+s;if(t.hasClass("active"))t.removeClass("active"),t.is("a")&&t.closest(".dropdown-menu").siblings(".dropdown-toggle").removeClass("active"),$(r).toggleClass("hidden",!1),this.compactFilter(o,s,!0),$(o).trigger("inactive-filter");else{i.find("button, a").removeClass("active"),t.addClass("active"),t.is("a")&&t.closest(".dropdown-menu").siblings(".dropdown-toggle").addClass("active");var a=t.find("i").attr("class"),l=0;$(r).each((function(){var t=!1;$(this).find("i").each((function(){var e=$(this).attr("class");if(t=e==a)return!1})),$(this).toggleClass("hidden",0==t),0==t&&l++})),this.compactFilter(o,s,!1),0==l?$(o).trigger("inactive-filter"):$(o).trigger("active-filter")}}}}],(i=null)&&A(e.prototype,i),n&&A(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();const S=E;function P(t){return P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},P(t)}function O(t,e){for(var i=0;i").attr("type","hidden").attr("name","remove[]").attr("value",n);i.addClass("table-danger").find("td").eq(1).append(o)}))})))}}],(i=null)&&O(e.prototype,i),n&&O(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();const I=j;function M(t){return M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},M(t)}function N(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var n,o,s,r,a=[],l=!0,c=!1;try{if(s=(i=i.call(t)).next,0===e){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=s.call(i)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=i.return&&(r=i.return(),Object(r)!==r))return}finally{if(c)throw o}}return a}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return H(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return H(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function H(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);it.length)&&(e=t.length);for(var i=0,n=new Array(e);i'+_("Questa prenotazione esiste già e non può essere ricreata.")+"")),s.empty().append(t),a.A.j().initElements(t)}})}})})),t.on("change",".variants-selector select",(function(t){var i=$(t.currentTarget).closest(".inline-variant-selector"),n=i.closest(".booking-editor");if(0==a.A.parseFloatC(i.find(".booking-product-quantity input").val())){var o=[];i.find(".form-select").each((function(){o.push($(this).find(":selected").val())})),a.A.postAjax({method:"GET",url:"products/price",dataType:"JSON",data:{id:i.closest("tr").find("input:hidden").first().attr("name"),order_id:n.attr("data-order-id"),variant:o},success:function(t){var e=i.index(),n=i.closest("tr").find(".prices_block"),o=n.find(".row").first().clone();o.find("small").text(t.price),n.find(".row").length>e?n.find(".row").eq(e).replaceWith(o):n.append(o)}})}else e.bookingTotal(n)})),$(".add-booking-product",t).click((function(t){t.preventDefault();var e=$(this).closest("table"),i=e.find(".fit-add-product").first().clone().removeClass("hidden");return a.A.j().initElements(i),i.appendTo(e.find("tbody")),!1})),$(".alt_price_selector input",t).change((function(t){var i=$(t.currentTarget);if(i.prop("checked")){var n=i.closest(".booking-editor");e.bookingTotal(n)}})),$(".fit-add-product-select",t).change((function(t){var i=$(t.currentTarget),n=i.find("option:selected").val(),o=i.closest("tr"),s=o.closest(".booking-editor");-1==n?(o.find(".bookable-target").empty(),e.bookingTotal(s)):a.A.postAjax({method:"GET",url:"products/"+n,data:{format:"bookable",order_id:s.attr("data-order-id")},dataType:"HTML",success:function(t){t=$(t),a.A.j().initElements(t),o.find(".bookable-target").empty().append(t),e.bookingTotal(s)}})})),$(".preload-quantities",t).click((function(t){t.preventDefault();var i=$(t.currentTarget).closest("form").find(".booking-editor");return i.each((function(t,i){e.preloadQuantities($(i),!1)})),e.bookingTotal(i.first()),!1})),$("input.manual-total",t).keyup((function(t){var e=$(t.currentTarget);parseFloat(e.val())>0?e.addClass("is-changed"):e.removeClass("is-changed")})).change((function(t){var i=$(t.currentTarget).closest(".booking-editor");e.bookingTotal(i)})),$(".inline-calculator button[type=submit]",t).click((function(t){t.preventDefault();var e=$(t.currentTarget).closest(".modal"),i=0;e.find("input.number").each((function(){var t=$(this).val();""!=t&&(i+=a.A.parseFloatC(t)),$(this).val("0")}));var n=e.attr("id");$('[data-bs-target="#'+n+'"]').closest(".booking-product-quantity").find("input.number").first().val(i.toFixed(3)).blur(),e.modal("hide")})),$(".delete-booking",t).click((function(t){t.preventDefault();var i=$(t.currentTarget).closest(".inner-form");return confirm(_("Sei sicuro di voler annullare questa prenotazione?"))&&(i.find("button").prop("disabled",!0),a.A.postAjax({method:"DELETE",url:i.attr("action"),dataType:"json",success:function(t){i.find("button").prop("disabled",!1),i.find(".booking-product-quantity input").val("0"),i.find(".variants-selector").each((function(){for(;1!=$(this).find(".row:not(.master-variant-selector)").length;)$(this).find(".row:not(.master-variant-selector):last").remove()})),e.bookingTotal(i.find(".booking-editor"))}})),!1})),$(".booking-form .info-button",t).click((function(t){t.preventDefault();var e=$(t.currentTarget).closest("form");e.find("input:hidden[name=action]").val("saved"),e.submit()}))}},{key:"initOnce",value:function(){var t=this;$("body").on("blur",".booking-product-quantity input",(function(e){var i=$(e.currentTarget).closest(".booking-editor");t.bookingTotal(i)})).on("focus",".booking-product-quantity input",(function(t){$(t.currentTarget).removeClass("is-invalid")})).on("click",".booking-product .add-variant",(function(t){t.preventDefault();var e=$(t.currentTarget).closest(".variants-selector").find(".master-variant-selector"),i=e.clone().removeClass("master-variant-selector");return i.find(".skip-on-submit").removeClass("skip-on-submit"),e.before(i),i.find("select").first().change(),!1}))}},{key:"preloadQuantities",value:function(t,e){t.find(".booking-product").each((function(){var t=$(this).find("input:hidden[name=booking-product-real-booked]");0!=t.length&&$(this).find(".booking-product-quantity input").val(t.val())})),e&&this.bookingTotal(t.closest(".booking-editor"))}},{key:"serializeBooking",value:function(t){t.find("textarea").addClass("skip-on-submit restore-after-serialize"),t.find(".booking-product-quantity input").filter((function(){return 0==$(this).closest(".master-variant-selector").length})).filter((function(){return 0==$(this).attr("name").startsWith("variant_quantity_")})).each((function(){$(this).toggleClass("skip-on-submit restore-after-serialize","0"==$(this).val())}));var e=t.find(".manual-total");e.length&&0==e.hasClass("is-changed")&&e.val("");var i=t.find(":not(.skip-on-submit)").serialize();return t.find(".restore-after-serialize").removeClass("skip-on-submit restore-after-serialize"),i}},{key:"checkInvalidFeedback",value:function(t,e,i){e?(t.toggleClass("is-invalid",!0),t.toggleClass("is-annotated",!1),t.val("0")):(t.toggleClass("is-invalid",!1),t.toggleClass("is-annotated",""!=i)),t.siblings(".invalid-feedback").text(i)}},{key:"priceRow",value:function(t){return'
"}},{key:"updateBookingQuantities",value:function(t,e,i){for(var n=0,o=Object.entries(t);nl.variants.length)for(var f=l.variants.length;fi)})))}},{key:"updatePayment",value:function(t,e,i){var n=t.attr("data-reference-modal"),o=$("#"+n);0!=o.length&&(o.find("input[name=amount]").val(e.toFixed(2)).change(),o.find("input[name=delivering-status]").val(JSON.stringify(i)))}},{key:"verifyManualTotal",value:function(t,e){if(0==e.products.length){var i=$("input.manual-total",t);0!=i.length&&0!=i.val()&&this.preloadQuantities(t,!0)}}},{key:"bookingTotal",value:function(t){var e=this,i=$(t).closest("form"),n=this.serializeBooking(i),o=i.attr("data-dynamic-url");this.dynamicBookingRequest&&this.dynamicBookingRequest.abort(),this.dynamicBookingRequest=$.ajax({url:o,method:"GET",data:n,dataType:"JSON",success:function(t){if(t.hasOwnProperty("status")&&"error"==t.status)a.A.displayServerError(null,t);else{if(0==Object.entries(t.bookings).length)$(".booking-product-price span",i).text(a.A.priceRound(0)),$(".booking-modifier, .booking-total",h).textVal(a.A.priceRound(0)),$(".all-bookings-total",i).text(a.A.priceRound(0));else{var n=$("input:hidden[name=action]",i).val(),o=0,s={};$(".booking-bottom-helper",h).removeClass("bg-success").addClass("bg-danger");for(var r=0,l=Object.entries(t.bookings);ro&&n.val(o)}else{var s=parseInt(e.val())+1;n.attr("min",s),n.removeAttr("max"),n.val()");n.find("[role=tablist]").find(".last-tab").before(l),l.find("button").click(),i.val("")}})}})})),$(".role-editor",t).on("change","input:checkbox[data-role]",(function(t){var e=$(this);e.removeClass("saved-checkbox saved-left-feedback");var i=e.is(":checked")?"roles/attach":"roles/detach";a.A.postAjax({url:i,data:{role:e.attr("data-role"),action:e.attr("data-action"),user:e.attr("data-user"),target_id:e.attr("data-target-id"),target_class:e.attr("data-target-class")},success:function(){e.addClass("saved-checkbox saved-left-feedback")}})})).on("click",".remove-role",(function(t){if(t.preventDefault(),confirm(_("Sei sicuro di voler revocare questo ruolo?"))){var e=$(this),i=e.attr("data-user");a.A.postAjax({url:"roles/detach",data:{role:e.attr("data-role"),user:e.attr("data-user")},success:function(){var t=e.closest(".accordion-body"),n=t.find("[data-user="+i+"]");t.find(n.find("button").attr("data-bs-target")).remove(),n.remove()}})}}))}}],(i=null)&&ot(e.prototype,i),n&&ot(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function at(t){return at="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},at(t)}function lt(t,e){for(var i=0;ia.A.parseFloatC(t.find(".current-sender-credit").text())?t.removeClass("alert-success").addClass("alert-danger"):t.removeClass("alert-danger").addClass("alert-success"))}))}},{key:"movementTypeEditor",value:function(t){$("select[name=sender_type], select[name=target_type]",t).change((function(t){var e=$(this).closest(".movement-type-editor"),i=e.find("select[name=sender_type] option:selected").val(),n=e.find("select[name=target_type] option:selected").val(),o=e.find("table");o.find("tbody tr").each((function(){var t=$(this).attr("data-target-class");$(this).toggleClass("hidden","App\\Gas"!=t&&t!=i&&t!=n)})),o.find("thead input[data-active-for]").each((function(){var t=$(this).attr("data-active-for");""!=t&&t!=i&&t!=n?$(this).prop("checked",!1).prop("disabled",!0).change():$(this).prop("disabled",!1)}))})),$("table thead input:checkbox",t).change((function(){var t=$(this).prop("checked"),e=$(this).closest("th").index();0==t?$(this).closest("table").find("tbody tr").each((function(){var t=$(this).find("td:nth-child("+(e+1)+")");t.find("input[value=ignore]").click(),t.find("label, input").prop("disabled",!0)})):$(this).closest("table").find("tbody tr").each((function(){$(this).find("td:nth-child("+(e+1)+")").find("label, input").prop("disabled",!1)}))}))}},{key:"enforcePaymentMethod",value:function(t){var e=t.find("option:selected").val(),i=null,n=null;JSON.parse(t.closest(".modal").find("input[name=matching_methods_for_movement_types]").val()).forEach((function(t){if(t.method==e)return i=t.default_payment,n=t.payments,!1})),null!=n?t.closest("tr").find(".csv_movement_method_select").find("option").each((function(){var t=$(this).val();n.indexOf(t)>=0?($(this).prop("disabled",!1),$(this).prop("selected",i==t)):$(this).prop("disabled",!0)})):t.closest("tr").find(".csv_movement_method_select").find("option").prop("disabled",!1)}}],(i=null)&<(e.prototype,i),n&<(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();const dt=ut;function ht(t){return ht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ht(t)}function pt(t,e){for(var i=0;i":">",'"':""","'":"'"};function _t(t,e){return"number"==typeof t?t+e:t}function wt(t){if("string"==typeof t){const e=/^(\d+)\s*(.*)$/g.exec(t);return{value:e?+e[1]:0,unit:(null==e?void 0:e[2])||void 0}}return{value:Number(t)}}function xt(t){return String.fromCharCode(97+t%26)}const kt=2221e-19;function Ct(t,e,i){return e/i.range*t}function Tt(t,e){const i=Math.pow(10,e||yt);return Math.round(t*i)/i}function At(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const o={high:e.high,low:e.low,valueRange:0,oom:0,step:0,min:0,max:0,range:0,numberOfSteps:0,values:[]};o.valueRange=o.high-o.low,o.oom=function(t){return Math.floor(Math.log(Math.abs(t))/Math.LN10)}(o.valueRange),o.step=Math.pow(10,o.oom),o.min=Math.floor(o.low/o.step)*o.step,o.max=Math.ceil(o.high/o.step)*o.step,o.range=o.max-o.min,o.numberOfSteps=Math.round(o.range/o.step);const s=Ct(t,o.step,o)=i)o.step=1;else if(n&&r=i)o.step=r;else{let e=0;for(;;){if(s&&Ct(t,o.step,o)<=i)o.step*=2;else{if(s||!(Ct(t,o.step/2,o)>=i))break;if(o.step/=2,n&&o.step%1!=0){o.step*=2;break}}if(e++>1e3)throw new Error("Exceeded maximum number of iterations while optimizing scale step!")}}function a(t,e){return t===(t+=e)&&(t*=1+(e>0?kt:-kt)),t}o.step=Math.max(o.step,kt);let l=o.min,c=o.max;for(;l+o.step<=o.low;)l=a(l,o.step);for(;c-o.step>=o.high;)c=a(c,-o.step);o.min=l,o.max=c,o.range=o.max-o.min;const u=[];for(let t=o.min;t<=o.max;t=a(t,o.step)){const e=Tt(t);e!==u[u.length-1]&&u.push(e)}return o.values=u,o}function Dt(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;nt;function St(t,e){return Array.from({length:t},e?(t,i)=>e(i):()=>{})}function $t(t,e){return null!==t&&"object"==typeof t&&Reflect.has(t,e)}function Pt(t){return null!==t&&isFinite(t)}function Ot(t){return!t&&0!==t}function Lt(t){return Pt(t)?Number(t):void 0}function jt(t,e){let i=0;t[arguments.length>2&&void 0!==arguments[2]&&arguments[2]?"reduceRight":"reduce"](((t,n,o)=>e(n,i++,o)),void 0)}function It(t,e){const i=Array.isArray(t)?t[e]:$t(t,"data")?t.data[e]:null;return $t(i,"meta")?i.meta:void 0}function Mt(t){return null==t||"number"==typeof t&&isNaN(t)}function Nt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"y";return function(t){return"object"==typeof t&&null!==t&&(Reflect.has(t,"x")||Reflect.has(t,"y"))}(t)&&$t(t,e)?Lt(t[e]):Lt(t)}function Ht(t,e,i){const n={high:void 0===(e={...e,...i?"x"===i?e.axisX:e.axisY:{}}).high?-Number.MAX_VALUE:+e.high,low:void 0===e.low?Number.MAX_VALUE:+e.low},o=void 0===e.high,s=void 0===e.low;return(o||s)&&function t(e){if(!Mt(e))if(Array.isArray(e))for(let i=0;in.high&&(n.high=t),s&&t0||(n.high=1),n.low=0)),n}function Ft(t){let e,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0;const s={labels:(t.labels||[]).slice(),series:qt(t.series,n,o)},r=s.labels.length;return!function(t){return!!Array.isArray(t)&&t.every(Array.isArray)}(s.series)?e=s.series.length:(e=Math.max(r,...s.series.map((t=>t.length))),s.series.forEach((t=>{t.push(...St(Math.max(0,e-t.length)))}))),s.labels.push(...St(Math.max(0,e-r),(()=>""))),i&&function(t){var e;null===(e=t.labels)||void 0===e||e.reverse(),t.series.reverse();for(const e of t.series)$t(e,"data")?e.data.reverse():Array.isArray(e)&&e.reverse()}(s),s}function Rt(t,e){if(!Mt(t))return e?function(t,e){let i,n;if("object"!=typeof t){const o=Lt(t);"x"===e?i=o:n=o}else $t(t,"x")&&(i=Lt(t.x)),$t(t,"y")&&(n=Lt(t.y));if(void 0!==i||void 0!==n)return{x:i,y:n}}(t,e):Lt(t)}function Bt(t,e){return Array.isArray(t)?t.map((t=>$t(t,"value")?Rt(t.value,e):Rt(t,e))):Bt(t.data,e)}function qt(t,e,i){if(function(t){return Array.isArray(t)&&t.every((t=>Array.isArray(t)||$t(t,"data")))}(t))return t.map((t=>Bt(t,e)));const n=Bt(t,e);return i?n.map((t=>[t])):n}function Ut(t){let e="";return null==t?t:(e="number"==typeof t?""+t:"object"==typeof t?JSON.stringify({data:t}):String(t),Object.keys(bt).reduce(((t,e)=>t.replaceAll(e,bt[e])),e))}class Wt{call(t,e){return this.svgElements.forEach((i=>Reflect.apply(i[t],i,e))),this}attr(){for(var t=arguments.length,e=new Array(t),i=0;i3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4?arguments[4]:void 0;const{easing:s,...r}=i,a={};let l,c;s&&(l=Array.isArray(s)?s:zt[s]),r.begin=_t(r.begin,"ms"),r.dur=_t(r.dur,"ms"),l&&(r.calcMode="spline",r.keySplines=l.join(" "),r.keyTimes="0;1"),n&&(r.fill="freeze",a[e]=r.from,t.attr(a),c=wt(r.begin||0).value,r.begin="indefinite");const u=t.elem("animate",{attributeName:e,...r});n&&setTimeout((()=>{try{u._node.beginElement()}catch(i){a[e]=r.to,t.attr(a),u.remove()}}),c);const d=u.getNode();o&&d.addEventListener("beginEvent",(()=>o.emit("animationBegin",{element:t,animate:d,params:i}))),d.addEventListener("endEvent",(()=>{o&&o.emit("animationEnd",{element:t,animate:d,params:i}),n&&(a[e]=r.to,t.attr(a),u.remove())}))}class Yt{attr(t,e){return"string"==typeof t?e?this._node.getAttributeNS(e,t):this._node.getAttribute(t):(Object.keys(t).forEach((e=>{if(void 0!==t[e])if(-1!==e.indexOf(":")){const i=e.split(":");this._node.setAttributeNS(vt[i[0]],e,String(t[e]))}else this._node.setAttribute(e,String(t[e]))})),this)}elem(t,e,i){return new Yt(t,e,i,this,arguments.length>3&&void 0!==arguments[3]&&arguments[3])}parent(){return this._node.parentNode instanceof SVGElement?new Yt(this._node.parentNode):null}root(){let t=this._node;for(;"svg"!==t.nodeName&&t.parentElement;)t=t.parentElement;return new Yt(t)}querySelector(t){const e=this._node.querySelector(t);return e?new Yt(e):null}querySelectorAll(t){const e=this._node.querySelectorAll(t);return new Wt(e)}getNode(){return this._node}foreignObject(t,e,i){let n,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("string"==typeof t){const e=document.createElement("div");e.innerHTML=t,n=e.firstChild}else n=t;n instanceof Element&&n.setAttribute("xmlns",vt.xmlns);const s=this.elem("foreignObject",e,i,o);return s._node.appendChild(n),s}text(t){return this._node.appendChild(document.createTextNode(t)),this}empty(){for(;this._node.firstChild;)this._node.removeChild(this._node.firstChild);return this}remove(){var t;return null===(t=this._node.parentNode)||void 0===t||t.removeChild(this._node),this.parent()}replace(t){var e;return null===(e=this._node.parentNode)||void 0===e||e.replaceChild(t._node,this._node),t}append(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&this._node.firstChild?this._node.insertBefore(t._node,this._node.firstChild):this._node.appendChild(t._node),this}classes(){const t=this._node.getAttribute("class");return t?t.trim().split(/\s+/):[]}addClass(t){return this._node.setAttribute("class",this.classes().concat(t.trim().split(/\s+/)).filter((function(t,e,i){return i.indexOf(t)===e})).join(" ")),this}removeClass(t){const e=t.trim().split(/\s+/);return this._node.setAttribute("class",this.classes().filter((t=>-1===e.indexOf(t))).join(" ")),this}removeAllClasses(){return this._node.setAttribute("class",""),this}height(){return this._node.getBoundingClientRect().height}width(){return this._node.getBoundingClientRect().width}animate(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2?arguments[2]:void 0;return Object.keys(t).forEach((n=>{const o=t[n];Array.isArray(o)?o.forEach((t=>Vt(this,n,t,!1,i))):Vt(this,n,o,e,i)})),this}constructor(t,e,i,n,o=!1){t instanceof Element?this._node=t:(this._node=document.createElementNS(vt.svg,t),"svg"===t&&this.attr({"xmlns:ct":vt.ct})),e&&this.attr(e),i&&this.addClass(i),n&&(o&&n._node.firstChild?n._node.insertBefore(this._node,n._node.firstChild):n._node.appendChild(this._node))}}function Xt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"100%",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"100%",n=arguments.length>3?arguments[3]:void 0;Array.from(t.querySelectorAll("svg")).filter((t=>t.getAttributeNS(vt.xmlns,"ct"))).forEach((e=>t.removeChild(e)));const o=new Yt("svg").attr({width:e,height:i}).attr({style:"width: ".concat(e,"; height: ").concat(i,";")});return n&&o.addClass(n),t.appendChild(o.getNode()),o}function Gt(t,e){var i,n,o,s;const r=Boolean(e.axisX||e.axisY),a=(null===(i=e.axisY)||void 0===i?void 0:i.offset)||0,l=(null===(n=e.axisX)||void 0===n?void 0:n.offset)||0,c=null===(o=e.axisY)||void 0===o?void 0:o.position,u=null===(s=e.axisX)||void 0===s?void 0:s.position;let d=t.width()||wt(e.width).value||0,h=t.height()||wt(e.height).value||0;const p="number"==typeof(f=e.chartPadding)?{top:f,right:f,bottom:f,left:f}:void 0===f?{top:0,right:0,bottom:0,left:0}:{top:"number"==typeof f.top?f.top:0,right:"number"==typeof f.right?f.right:0,bottom:"number"==typeof f.bottom?f.bottom:0,left:"number"==typeof f.left?f.left:0};var f;d=Math.max(d,a+p.left+p.right),h=Math.max(h,l+p.top+p.bottom);const m={x1:0,x2:0,y1:0,y2:0,padding:p,width(){return this.x2-this.x1},height(){return this.y1-this.y2}};return r?("start"===u?(m.y2=p.top+l,m.y1=Math.max(h-p.bottom,m.y2+1)):(m.y2=p.top,m.y1=Math.max(h-p.bottom-l,m.y2+1)),"start"===c?(m.x1=p.left+a,m.x2=Math.max(d-p.right,m.x1+1)):(m.x1=p.left,m.x2=Math.max(d-p.right-a,m.x1+1))):(m.x1=p.left,m.x2=Math.max(d-p.right,m.x1+1),m.y2=p.top,m.y1=Math.max(h-p.bottom,m.y2+1)),m}function Qt(t,e,i,n){const o=t.elem("rect",{x:e.x1,y:e.y2,width:e.width(),height:e.height()},i,!0);n.emit("draw",{type:"gridBackground",group:t,element:o})}function Kt(t,e,i){let n;const o=[];function s(o){const s=n;n=Dt({},t),e&&e.forEach((t=>{window.matchMedia(t[0]).matches&&(n=Dt(n,t[1]))})),i&&o&&i.emit("optionsChanged",{previousOptions:s,currentOptions:n})}if(!window.matchMedia)throw new Error("window.matchMedia not found! Make sure you're using a polyfill.");return e&&e.forEach((t=>{const e=window.matchMedia(t[0]);e.addEventListener("change",s),o.push(e)})),s(),{removeMediaQueryListeners:function(){o.forEach((t=>t.removeEventListener("change",s)))},getCurrentOptions:()=>n}}Yt.Easing=zt;class Jt{on(t,e){const{allListeners:i,listeners:n}=this;"*"===t?i.add(e):(n.has(t)||n.set(t,new Set),n.get(t).add(e))}off(t,e){const{allListeners:i,listeners:n}=this;if("*"===t)e?i.delete(e):i.clear();else if(n.has(t)){const i=n.get(t);e?i.delete(e):i.clear(),i.size||n.delete(t)}}emit(t,e){const{allListeners:i,listeners:n}=this;n.has(t)&&n.get(t).forEach((t=>t(e))),i.forEach((i=>i(t,e)))}constructor(){this.listeners=new Map,this.allListeners=new Set}}const Zt=new WeakMap;class te{update(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];var n;(t&&(this.data=t||{},this.data.labels=this.data.labels||[],this.data.series=this.data.series||[],this.eventEmitter.emit("data",{type:"update",data:this.data})),e)&&(this.options=Dt({},i?this.options:this.defaultOptions,e),this.initializeTimeoutId||(null===(n=this.optionsProvider)||void 0===n||n.removeMediaQueryListeners(),this.optionsProvider=Kt(this.options,this.responsiveOptions,this.eventEmitter)));return!this.initializeTimeoutId&&this.optionsProvider&&this.createChart(this.optionsProvider.getCurrentOptions()),this}detach(){var t;this.initializeTimeoutId?window.clearTimeout(this.initializeTimeoutId):(window.removeEventListener("resize",this.resizeListener),null===(t=this.optionsProvider)||void 0===t||t.removeMediaQueryListeners());return Zt.delete(this.container),this}on(t,e){return this.eventEmitter.on(t,e),this}off(t,e){return this.eventEmitter.off(t,e),this}initialize(){window.addEventListener("resize",this.resizeListener),this.optionsProvider=Kt(this.options,this.responsiveOptions,this.eventEmitter),this.eventEmitter.on("optionsChanged",(()=>this.update())),this.options.plugins&&this.options.plugins.forEach((t=>{Array.isArray(t)?t[0](this,t[1]):t(this)})),this.eventEmitter.emit("data",{type:"initial",data:this.data}),this.createChart(this.optionsProvider.getCurrentOptions()),this.initializeTimeoutId=null}constructor(t,e,i,n,o){this.data=e,this.defaultOptions=i,this.options=n,this.responsiveOptions=o,this.eventEmitter=new Jt,this.resizeListener=()=>this.update(),this.initializeTimeoutId=setTimeout((()=>this.initialize()),0);const s="string"==typeof t?document.querySelector(t):t;if(!s)throw new Error("Target element is not found");this.container=s;const r=Zt.get(s);r&&r.detach(),Zt.set(s,this)}}const ee={x:{pos:"x",len:"width",dir:"horizontal",rectStart:"x1",rectEnd:"x2",rectOffset:"y2"},y:{pos:"y",len:"height",dir:"vertical",rectStart:"y2",rectEnd:"y1",rectOffset:"x1"}};class ie{createGridAndLabels(t,e,i,n){const o="x"===this.units.pos?i.axisX:i.axisY,s=this.ticks.map(((t,e)=>this.projectValue(t,e))),r=this.ticks.map(o.labelInterpolationFnc);s.forEach(((a,l)=>{const c=r[l],u={x:0,y:0};let d;d=s[l+1]?s[l+1]-a:Math.max(this.axisLength-a,this.axisLength/this.ticks.length),""!==c&&Ot(c)||("x"===this.units.pos?(a=this.chartRect.x1+a,u.x=i.axisX.labelOffset.x,"start"===i.axisX.position?u.y=this.chartRect.padding.top+i.axisX.labelOffset.y+5:u.y=this.chartRect.y1+i.axisX.labelOffset.y+5):(a=this.chartRect.y1-a,u.y=i.axisY.labelOffset.y-d,"start"===i.axisY.position?u.x=this.chartRect.padding.left+i.axisY.labelOffset.x:u.x=this.chartRect.x2+i.axisY.labelOffset.x+10),o.showGrid&&function(t,e,i,n,o,s,r,a){const l={["".concat(i.units.pos,"1")]:t,["".concat(i.units.pos,"2")]:t,["".concat(i.counterUnits.pos,"1")]:n,["".concat(i.counterUnits.pos,"2")]:n+o},c=s.elem("line",l,r.join(" "));a.emit("draw",{type:"grid",axis:i,index:e,group:s,element:c,...l})}(a,l,this,this.gridOffset,this.chartRect[this.counterUnits.len](),t,[i.classNames.grid,i.classNames[this.units.dir]],n),o.showLabel&&function(t,e,i,n,o,s,r,a,l,c){const u={[o.units.pos]:t+r[o.units.pos],[o.counterUnits.pos]:r[o.counterUnits.pos],[o.units.len]:e,[o.counterUnits.len]:Math.max(0,s-10)},d=Math.round(u[o.units.len]),h=Math.round(u[o.counterUnits.len]),p=document.createElement("span");p.className=l.join(" "),p.style[o.units.len]=d+"px",p.style[o.counterUnits.len]=h+"px",p.textContent=String(n);const f=a.foreignObject(p,{style:"overflow: visible;",...u});c.emit("draw",{type:"label",axis:o,index:i,group:a,element:f,text:n,...u})}(a,d,l,c,this,o.offset,u,e,[i.classNames.label,i.classNames[this.units.dir],"start"===o.position?i.classNames[o.position]:i.classNames.end],n))}))}constructor(t,e,i){this.units=t,this.chartRect=e,this.ticks=i,this.counterUnits=t===ee.x?ee.y:ee.x,this.axisLength=e[this.units.rectEnd]-e[this.units.rectStart],this.gridOffset=e[this.units.rectOffset]}}class ne extends ie{projectValue(t){const e=Number(Nt(t,this.units.pos));return this.axisLength*(e-this.bounds.min)/this.bounds.range}constructor(t,e,i,n){const o=n.highLow||Ht(e,n,t.pos),s=At(i[t.rectEnd]-i[t.rectStart],o,n.scaleMinSpace||20,n.onlyInteger),r={min:s.min,max:s.max};super(t,i,s.values),this.bounds=s,this.range=r}}class oe extends ie{projectValue(t,e){return this.stepLength*e}constructor(t,e,i,n){const o=n.ticks||[];super(t,i,o);const s=Math.max(1,o.length-(n.stretch?1:0));this.stepLength=this.axisLength/s,this.stretch=Boolean(n.stretch)}}function se(t){return e=t,i=function(){for(var t=arguments.length,e=new Array(t),i=0;i({x:t.x+($t(e,"x")?e.x:0),y:t.y+($t(e,"y")?e.y:0)})),{x:0,y:0})},St(Math.max(...e.map((t=>t.length))),(t=>i(...e.map((e=>e[t])))));var e,i}const re={axisX:{offset:30,position:"end",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:Et,scaleMinSpace:30,onlyInteger:!1},axisY:{offset:40,position:"start",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:Et,scaleMinSpace:20,onlyInteger:!1},width:void 0,height:void 0,high:void 0,low:void 0,referenceValue:0,chartPadding:{top:15,right:15,bottom:5,left:10},seriesBarDistance:15,stackBars:!1,stackMode:"accumulate",horizontalBars:!1,distributeSeries:!1,reverseData:!1,showGridBackground:!1,classNames:{chart:"ct-chart-bar",horizontalBars:"ct-horizontal-bars",label:"ct-label",labelGroup:"ct-labels",series:"ct-series",bar:"ct-bar",grid:"ct-grid",gridGroup:"ct-grids",gridBackground:"ct-grid-background",vertical:"ct-vertical",horizontal:"ct-horizontal",start:"ct-start",end:"ct-end"}};class ae extends te{createChart(t){const{data:e}=this,i=Ft(e,t.reverseData,t.horizontalBars?"x":"y",!0),n=Xt(this.container,t.width,t.height,t.classNames.chart+(t.horizontalBars?" "+t.classNames.horizontalBars:"")),o=t.stackBars&&!0!==t.stackMode&&i.series.length?Ht([se(i.series)],t,t.horizontalBars?"x":"y"):Ht(i.series,t,t.horizontalBars?"x":"y");this.svg=n;const s=n.elem("g").addClass(t.classNames.gridGroup),r=n.elem("g"),a=n.elem("g").addClass(t.classNames.labelGroup);"number"==typeof t.high&&(o.high=t.high),"number"==typeof t.low&&(o.low=t.low);const l=Gt(n,t);let c;const u=t.distributeSeries&&t.stackBars?i.labels.slice(0,1):i.labels;let d,h,p;t.horizontalBars?(c=h=void 0===t.axisX.type?new ne(ee.x,i.series,l,{...t.axisX,highLow:o,referenceValue:0}):new t.axisX.type(ee.x,i.series,l,{...t.axisX,highLow:o,referenceValue:0}),d=p=void 0===t.axisY.type?new oe(ee.y,i.series,l,{ticks:u}):new t.axisY.type(ee.y,i.series,l,t.axisY)):(d=h=void 0===t.axisX.type?new oe(ee.x,i.series,l,{ticks:u}):new t.axisX.type(ee.x,i.series,l,t.axisX),c=p=void 0===t.axisY.type?new ne(ee.y,i.series,l,{...t.axisY,highLow:o,referenceValue:0}):new t.axisY.type(ee.y,i.series,l,{...t.axisY,highLow:o,referenceValue:0}));const f=t.horizontalBars?l.x1+c.projectValue(0):l.y1-c.projectValue(0),m="accumulate"===t.stackMode,g="accumulate-relative"===t.stackMode,v=[],y=[];let b=v;d.createGridAndLabels(s,a,t,this.eventEmitter),c.createGridAndLabels(s,a,t,this.eventEmitter),t.showGridBackground&&Qt(s,l,t.classNames.gridBackground,this.eventEmitter),jt(e.series,((n,o)=>{const s=o-(e.series.length-1)/2;let a;a=t.distributeSeries&&!t.stackBars?d.axisLength/i.series.length/2:t.distributeSeries&&t.stackBars?d.axisLength/2:d.axisLength/i.series[o].length/2;const u=r.elem("g"),_=$t(n,"name")&&n.name,w=$t(n,"className")&&n.className,x=$t(n,"meta")?n.meta:void 0;_&&u.attr({"ct:series-name":_}),x&&u.attr({"ct:meta":Ut(x)}),u.addClass([t.classNames.series,w||"".concat(t.classNames.series,"-").concat(xt(o))].join(" ")),i.series[o].forEach(((e,r)=>{const _=$t(e,"x")&&e.x,w=$t(e,"y")&&e.y;let x,k;x=t.distributeSeries&&!t.stackBars?o:t.distributeSeries&&t.stackBars?0:r,k=t.horizontalBars?{x:l.x1+c.projectValue(_||0,r,i.series[o]),y:l.y1-d.projectValue(w||0,x,i.series[o])}:{x:l.x1+d.projectValue(_||0,x,i.series[o]),y:l.y1-c.projectValue(w||0,r,i.series[o])},d instanceof oe&&(d.stretch||(k[d.units.pos]+=a*(t.horizontalBars?-1:1)),k[d.units.pos]+=t.stackBars||t.distributeSeries?0:s*t.seriesBarDistance*(t.horizontalBars?-1:1)),g&&(b=w>=0||_>=0?v:y);const C=b[r]||f;if(b[r]=C-(f-k[d.counterUnits.pos]),void 0===e)return;const T={["".concat(d.units.pos,"1")]:k[d.units.pos],["".concat(d.units.pos,"2")]:k[d.units.pos]};t.stackBars&&(m||g||!t.stackMode)?(T["".concat(d.counterUnits.pos,"1")]=C,T["".concat(d.counterUnits.pos,"2")]=b[r]):(T["".concat(d.counterUnits.pos,"1")]=f,T["".concat(d.counterUnits.pos,"2")]=k[d.counterUnits.pos]),T.x1=Math.min(Math.max(T.x1,l.x1),l.x2),T.x2=Math.min(Math.max(T.x2,l.x1),l.x2),T.y1=Math.min(Math.max(T.y1,l.y2),l.y1),T.y2=Math.min(Math.max(T.y2,l.y2),l.y1);const A=It(n,r),D=u.elem("line",T,t.classNames.bar).attr({"ct:value":[_,w].filter(Pt).join(","),"ct:meta":Ut(A)});this.eventEmitter.emit("draw",{type:"bar",value:e,index:r,meta:A,series:n,seriesIndex:o,axisX:h,axisY:p,chartRect:l,group:u,element:D,...T})}))}),t.reverseData),this.eventEmitter.emit("created",{chartRect:l,axisX:h,axisY:p,svg:n,options:t})}constructor(t,e,i,n){super(t,e,re,Dt({},re,i),n),this.data=e}}function le(t){return le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},le(t)}function ce(t,e){for(var i=0;i'+e.item.label+'
');var n=i.closest(".completion-rows"),o=gt.A[n.attr("data-callback-add")];"function"==typeof o&&o(n,e.item.id)}})}})),$(t).on("click",".btn-danger",(function(){var t=$(this).closest("li"),e=t.closest(".completion-rows"),i=gt.A[e.attr("data-callback-remove")];"function"==typeof i&&i(e,t.attr("data-object-id")),t.remove()}))})),t.hasClass("modal")?t.draggable({handle:".modal-header"}):$(".modal",t).draggable({handle:".modal-header"});var i=$(".measure-selector",t);0!=i.length&&(null==pe?a.A.postAjax({method:"GET",url:"measures/discretes",dataType:"JSON",success:function(t){pe=t,e(i)}}):e(i)),$(".postponed",t).appendTo("#postponed").removeClass("postponed"),$("ul[role=tablist]",t).each((function(){0==$(this).find("li.active").length&&$(this).find("li a").first().tab("show")})),a.A.init(t),z.init(t),I.init(t),p.init(t),l.A.init(t),y.init(t),J.init(t),it.init(t),C.init(t),S.init(t),rt.init(t),dt.init(t),mt.init(t),de.init(t)}function ge(t,e){try{t.closest(".modal").modal("hide");var i=$(e);a.A.j().initElements(i),i.modal("show")}catch(t){var n=JSON.parse(e),o=$("#service-modal");o.find(".modal-body").empty().append("

"+n.message+"

"),o.modal("show")}}function ve(t,e){if(1==he)return!1;var i;if(he=!0,0!=(i=t.find("input[name=test-feedback]")).length&&"error"==e.status)return a.A.displayServerError(t,e),he=!1,!1;if(l.A.innerCallbacks(t,e),0!=(i=t.find("input[name=update-select]")).length){var n=i.val();$("select[name="+n+"]").each((function(){var t=$('");if(e.hasOwnProperty("parent")&&null!=e.parent){for(var i=$(this).find("option[value="+e.parent+"]").first(),n=i.text().replace(/ /g," "),o="  ",s=0;s{"use strict";i.r(e);var n=i(404);i(285),function(t){t.fn.dynamictree=function(){function e(t){for(var i=[],n=1;;){var o=t.find("> li:nth-child("+n+")");if(0==o.length)break;var s={id:o.attr("id"),name:o.find("input:text").val()};s.children=e(o.find("ul")),i.push(s),n++}return i}function i(t){0==t.find("ul").length&&t.append("
    "),t.find("ul").sortable({items:"li",connectWith:".dynamic-tree, .dynamic-tree ul"})}function o(e){t(e.target).closest("li").remove()}function s(e){e.preventDefault();var n=t(e.target).closest(".dynamic-tree-box"),o=n.find("input[name=new_category]"),s=o.val(),r=n.find(".dynamic-tree"),a=t('
  • ');return r.append(a),r.sortable("refresh"),i(a),o.val(""),!1}function r(i){i.preventDefault();var o=t(i.target),s=o.find("button[type=submit]");s.prop("disabled",!0);var r=e(o.find(".dynamic-tree"));return t.ajax({method:o.attr("method"),url:o.attr("action"),data:{_token:o.find("input[name=_token]").val(),_method:o.find("input[name=_method]").val(),serialized:r},success:function(){n.A.inlineFeedback(s,_("Salvato!")),o.closest(".modal").modal("hide")}}),!1}t(this).each((function(){t(this).find(".dynamic-tree").sortable({items:"li",connectWith:".dynamic-tree ul",start:function(){t(".dynamic-tree ul").css("min-height","50px")},stop:function(){t(".dynamic-tree ul").css("min-height","0")},receive:function(t,e){i(e.item)}}),t(this).find(".dynamic-tree ul").sortable({items:"li",connectWith:".dynamic-tree, .dynamic-tree ul",receive:function(t,e){var i=t.target.closest("ul");e.item.find("ul").find("li").each((function(){i.append(this)})),e.item.find("ul").remove()}}),t(this).on("click",".dynamic-tree-remove",o),t(this).on("click",".dynamic-tree-add",s),t(this).on("submit",r)}))}}(jQuery)},955:(t,e,i)=>{"use strict";i.d(e,{A:()=>l});var n=i(404),o=i(676);function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function r(t,e){for(var i=0;i .loadable-sorting-header").addClass("hidden").filter("[data-sorting-"+n+"]").removeClass("hidden"),i.find("> .accordion-item:visible, .loadable-sorting-header:visible").sort((function(t,e){var i=$(t).attr("data-sorting-"+n),o=$(e).attr("data-sorting-"+n);return i.localeCompare(o)})).each((function(){$(this).appendTo(i)}))})),e.on("click",".list-filters button",(function(){var t=$(this).closest(".list-filters").attr("data-list-target"),e=$(this).attr("data-filter-attribute");$(".loadable-list"+t+" .accordion-item[data-filtered-"+e+"=true]").each((function(){$(this).toggleClass("d-none")}))})),e.on("keyup",".list-text-filter",(function(){var t=$(this).val().toLowerCase(),e=$(this).attr("data-list-target");""==t?$(".loadable-list"+e+" .accordion-item").css("display","block"):$(".loadable-list"+e+" .accordion-item").each((function(){-1==$(this).find(".accordion-button").text().toLowerCase().indexOf(t)?$(this).css("display","none"):$(this).css("display","block")}))})),e.on("hidden.bs.collapse",".loadable-list > .accordion-item > .accordion-collapse",(function(e){e.stopPropagation();var i=$(this).closest(".accordion-item");t.reloadLoadableHead(i)})),e.on("show.bs.collapse",".loadable-list > .accordion-item > .accordion-collapse",(function(t){t.stopPropagation(),$(this).find(".accordion-body").animate({"min-height":"150px"},600)})),e.on("shown.bs.collapse",".loadable-list > .accordion-item > .accordion-collapse",(function(t){t.stopPropagation();var e=$(this);$("html, body").animate({scrollTop:e.closest(".accordion-item").offset().top-50},300)}))}},{key:"innerCallbacks",value:function(e,i){var n;if(0!=(n=e.find("input[name=update-list]")).length){var o=$("#"+n.val());t.appendToLoadableList(o,i,!0)}0!=(n=e.find("input[name=append-list]")).length&&(o=$("#"+n.val()),t.appendToLoadableList(o,i,!1)),0!=(n=e.find("input[name=reload-loadable]")).length&&t.reloadCurrentLoadable(n.val())}},{key:"listRow",value:function(t,e,i,n){var o=Math.random().toString(36).substring(2);return $('

    ')}},{key:"appendToLoadableList",value:function(e,i,o){var s=t.listRow(e,i.id,i.url,i.header);e.append(s),n.A.j().initElements(e),t.afterListChanges(e),o&&s.find(".accordion-button").click()}},{key:"currentLoadableLoaded",value:function(t){return $(t).closest(".async-accordion").attr("data-element-id")}},{key:"reloadCurrentLoadable",value:function(t){$(t).find("> .accordion-item > .accordion-header > .accordion-button:not(.collapsed)").each((function(){var t=$(this);t.click(),setTimeout((function(){t.click()}),600)}))}},{key:"closeAllLoadable",value:function(t){t.find("> accordion-item .accordion-button").filter(":not(.collapsed)").each((function(){$(this).click()}))}},{key:"reloadLoadableHead",value:function(e){n.A.postAjax({method:"GET",url:e.attr("data-accordion-url")+"/header",dataType:"json",success:function(i){e.find("> .accordion-header > .accordion-button").empty().append(i.header),e.attr("data-accordion-url",i.url),t.afterListChanges(e.closest(".loadable-list"))}})}},{key:"formByElementId",value:function(t){return $('.accordion-item[data-element-id="'+t+'"]').find("form")}},{key:"closeParent",value:function(t){var e=t.closest(".accordion-item");return e.find("> .accordion-header > .accordion-button").click(),e}},{key:"afterListChanges",value:function(e){var i=e.attr("data-sorting-function");null!=i&&o.A[i](e),t.testListsEmptiness(e)}},{key:"testListsEmptiness",value:function(t){var e=t.attr("id"),i=t.find("> .accordion-item").length;$("#empty-"+e).toggleClass("d-none",0!=i)}}],(i=null)&&r(e.prototype,i),s&&r(e,s),Object.defineProperty(e,"prototype",{writable:!1}),t}()},720:(t,e,i)=>{"use strict";i.r(e);var n=i(404);$(document).ready((function(){$("body").on("click",".password-field .bi-eye-slash",(function(){var t=$(this).closest(".password-field").find("input[type!=hidden]");"password"==t.attr("type")?t.attr("type","text"):t.attr("type","password"),$(this).toggleClass("bi-eye").toggleClass("bi-eye-close")})),$("body").on("focus","input.password-changer",(function(){var t="body",e=$(this).closest(".modal");0!=e.length&&(t="#"+e.attr("id"));var i=$(this);i.popover({content:function(){var t='
    ';return i.hasClass("enforcable_change")&&(t+='

    "),t+='
    ",(t=$(t)).find("button.btn-success").click((function(e){e.preventDefault(),e.stopPropagation();var n=t.find("input[name=password]").val();if(n==t.find("input[name=password_confirm]").val()){if(0!=t.find("input[name=enforce_change]").length){var o=t.find("input[name=enforce_change]").prop("checked")?"true":"false";i.closest(".input-group").find("input[name=enforce_password_change]").val(o)}i.val(n),i.popover("dispose"),i.change()}else alert("Le password sono diverse!")})),t.find("button.btn-light").click((function(t){t.preventDefault(),t.stopPropagation(),i.popover("dispose")})),setTimeout((function(){t.find("input[name=password]").focus()}),200),t},offset:[0,-50],template:'',placement:"left",container:t,html:!0})})),$("body").on("submit","#password-protection-dialog form",(function(t){t.preventDefault();var e=$(this).closest(".modal");$.ajax({method:"POST",url:$(this).attr("action"),data:{password:$(this).find("input[type=password]").val()},success:function(t){e.modal("hide");var i=e.attr("data-form-target"),o=$(i);if("ok"==t)o.attr("data-password-protected-verified","1"),o.submit();else{var s=o.find("button:submit");n.A.inlineFeedback(s,_("Password errata!"))}}})}))}))},195:(t,e,i)=>{"use strict";i.r(e);var n=i(404);$(document).ready((function(){function t(t,e,i){var n=t.closest(".modal");0==n.length&&(n=!1),t.popover({container:n,template:'',placement:"left",html:!0,content:i(t)})}$("body").on("focus","input.address",(function(){t($(this),"address",(function(t){var e=$('
    "),i=t.val();if(""!=i){for(var n=i.split(","),o=n.length;o<3;o++)n[o]="";e.find("input[name=street]").val(n[0].trim()),e.find("input[name=city]").val(n[1].trim()),e.find("input[name=cap]").val(n[2].trim())}return e.find("button.btn-success").click((function(i){i.preventDefault(),i.stopPropagation();var n=e.find("input[name=street]").val().trim().replace(",",""),o=e.find("input[name=city]").val().trim().replace(",",""),s=e.find("input[name=cap]").val().trim().replace(",","");""==n&&""==o&&""==s?t.val(""):t.val(n+", "+o+", "+s),t.change(),t.popover("dispose")})),e.find("button.btn-light").click((function(e){e.preventDefault(),e.stopPropagation(),t.popover("dispose")})),setTimeout((function(){e.find("input[name=street]").focus()}),200),e}))})),$("body").on("focus","input.periodic",(function(){t($(this),"periodic",(function(t){var e=$('
    ");$("input.date",e).datepicker({format:"DD dd MM yyyy",autoclose:!0,language:n.A.currentLanguage(),clearBtn:!0});var i=t.val();if(""!=i){for(var o=i.split(" - "),s=o.length;s<4;s++)o[s]="";e.find("select[name=day] option").filter((function(){return $(this).html()==o[0]})).prop("selected",!0),e.find("select[name=cycle] option").filter((function(){return $(this).html()==o[1]})).prop("selected",!0),e.find("input[name=from]").val(o[2].trim()),e.find("input[name=to]").val(o[3].trim())}return e.find("button.btn-success").click((function(i){i.preventDefault(),i.stopPropagation();var n=e.find("select[name=day] option:selected").text(),o=e.find("select[name=cycle] option:selected").text(),s=e.find("input[name=from]").val().trim().replace(",",""),r=e.find("input[name=to]").val().trim().replace(",","");t.val(n+" - "+o+" - "+s+" - "+r).change(),t.change(),t.popover("dispose")})),e.find("button.btn-light").click((function(e){e.preventDefault(),e.stopPropagation(),t.popover("dispose")})),setTimeout((function(){e.find("select[name=day]").focus()}),200),e}))})),$("body").on("change","#dates-in-range input.date, #dates-in-range input.periodic",(function(){if(""!=$(this).val()){var t=$(this).closest("tr");$(this).hasClass("date")?t.find(".periodic").val(""):t.find(".date").val("")}}))}))},995:()=>{!function(){var t=function(t){var e=function(t){if(null==o||null==t)return t;if(t in o==0)return null!=n?n(t):t;var e=o[t];if(null==e)return t;return e}(t);if("function"==typeof e)e=e.apply(this,arguments);else if(arguments.length>1){var s=Array.prototype.slice.call(arguments,1);e=i(e,s)}return e};t.translate=t;var e,i=(e=/\{([^}]+)\}/g,function(t,i){return t.replace(e,(function(t,e){return i[e]}))});t.setFormatter=function(t){i=t},t.format=function(){var t=Array.prototype.slice,e=arguments[0],n=t.call(arguments,1);return i(e,n)};var n=null;t.setDynamicTranslator=function(t){n=t};var o=null;t.setTranslation=function(t){o=t},window._=t}()},404:(t,e,i)=>{"use strict";i.d(e,{A:()=>c});const n=class{init(t){this.mainOptions=$.extend({},{initFunction:function(){},fixBootstrap:[]},t||{}),this.fixBootstrap(["Modal","Popover"].concat(this.mainOptions.fixBootstrap)),this.onceInit(),this.initElements($("body"))}defineJQueryPlugin(t){const e=t.NAME;if(e in $.fn==0){const i=$.fn[e];$.fn[e]=t.jQueryInterface,$.fn[e].Constructor=t,$.fn[e].noConflict=()=>($.fn[e]=i,t.jQueryInterface)}}fixBootstrap(t){window.bootstrap&&t.forEach((t=>{this.defineJQueryPlugin(window.bootstrap[t])}))}assignIDs(t,e){t.forEach((function(t,i){$(t,e).not("[id]").each((function(){$(this).attr("id",Math.random().toString(36).substring(2))}))}))}makeSpinner(){return'
    '}formValidation(t){return!t.hasClass("needs-validation")||(t.addClass("was-validated"),t.get(0).checkValidity())}initElements(t){$("form.needs-validation",t).jbobInitUninited().on("submit",(t=>{let e=$(t.currentTarget);0==this.formValidation(e)&&(t.preventDefault(),t.stopPropagation())})),this.assignIDs([".async-modal"],t),$(".async-modal",t).jbobInitUninited().click((t=>{t.preventDefault();let e=$(t.currentTarget);this.loadAsyncModal(e)})),this.assignIDs([".async-accordion"],t),$(".async-accordion > .accordion-collapse",t).jbobInitUninited().on("show.bs.collapse",(t=>{t.stopPropagation();let e=$(t.currentTarget).closest(".async-accordion");this.loadAsyncAccordion(e)})),this.assignIDs([".async-tab"],t),$(".async-tab",t).jbobInitUninited().on("show.bs.tab",(t=>{this.loadAsyncTab($(t.currentTarget))})).on("hidden.bs.tab",(t=>{t.stopPropagation();let e=$(t.currentTarget).attr("data-bs-target");$(e).empty()})),$(".async-popover",t).jbobInitUninited().on("show.bs.popover",(t=>{let e=$(t.currentTarget);e.trigger("jb-before-async-fetch");let i=e.attr("data-contents-url");$.ajax({url:i,method:"GET",dataType:"HTML",success:t=>{e.attr("data-bs-content",t),e.popover("dispose").popover("show"),e.trigger("jb-after-async-fetch",[!0])},error:()=>{e.trigger("jb-after-async-fetch",[!1])}})})),$(".dynamic-table",t).jbobInitUninited().each((function(){$(this).find("> tfoot").find("input, select, textarea").addClass("skip-on-submit")})).on("click",".add-row",(t=>{t.preventDefault();let e=$(t.currentTarget),i=e.closest("table").find("> tfoot tr").first().clone();i.find(".skip-on-submit").removeClass("skip-on-submit"),e.closest("tr").before(i),this.initElements(i)})).on("click",".remove-row",(function(t){t.preventDefault(),$(this).closest("tr").remove()})),$(".modal-form",t).jbobInitUninited().on("submit",(t=>{t.preventDefault();let e=$(t.currentTarget);this.formValidation(e)&&$.ajax({method:e.attr("method"),url:e.attr("action"),data:this.serializeForm(e),success:()=>{e.closest(".modal").modal("hide")}})})),$(".infinite-scroll",t).jbobInitUninited().each(((t,e)=>{let i=$(e),n=i.find(".pagination").closest("nav"),o=!1;$(window).on("scroll",(()=>{if(this.onScreen(n,200)&&0==o){o=!0;let t=n.find("li.active").next("li");n.remove(),t.length>0&&(i.trigger("jb-before-async-fetch"),$.ajax({url:t.find("a").attr("href"),method:"GET",dataType:"HTML",success:t=>{let e=null;e=(t=$(t)).hasClass("infinite-scroll")?t.html():t.find(".infinite-scroll").html(),e&&(this.initElements(e),i.append(e),n=i.find(".pagination").closest("nav")),o=!1,i.trigger("jb-after-async-fetch",[!0])},error:()=>{i.trigger("jb-after-async-fetch",[!1])}}))}}))})),this.mainOptions.initFunction(t)}loadAsyncAccordion(t){t.trigger("jb-before-async-fetch");let e=t.attr("data-accordion-url"),i=t.find(".accordion-body").first();this.fetchNode(e,i).then((e=>{t.trigger("jb-after-async-fetch",[e])})).catch((()=>{t.trigger("jb-after-async-fetch",[!1])}))}loadAsyncModal(t){t.prop("disabled",!0).trigger("jb-before-async-fetch");let e=t.attr("data-modal-url")||t.attr("href");this.fetchRemoteModal(e).then((e=>{t.prop("disabled",!1).trigger("jb-after-async-fetch",[e])})).catch((()=>{t.prop("disabled",!1).trigger("jb-after-async-fetch",[!1])}))}loadAsyncTab(t){t.trigger("jb-before-async-fetch");let e=t.attr("data-bs-target"),i=$(e),n=t.attr("data-tab-url");this.fetchNode(n,i).then((e=>{t.trigger("jb-after-async-fetch",[e])})).catch((()=>{t.trigger("jb-after-async-fetch",[!1])}))}async fetchRemoteModal(t){return new Promise((e=>{$.ajax({url:t,method:"GET",dataType:"HTML",success:t=>{try{let i=$(t);this.initElements(i),i.addClass("delete-on-close").modal("show"),e(!0)}catch(t){e(!1)}},error:()=>{e(!1)}})}))}async fetchNode(t,e){return e.empty().append(this.makeSpinner()),new Promise((i=>{$.ajax({url:t,method:"GET",dataType:"HTML",success:t=>{try{let n=$(t);this.initElements(n),e.empty().append(n),i(!0)}catch(t){i(!1)}},error:()=>{i(!1)}})}))}reloadNode(t){let e=t.attr("data-reload-url");e?t.hasClass("modal")?(this.fetchRemoteModal(e),t.modal("hide")):$.ajax({url:e,method:"GET",dataType:"HTML",success:e=>{let i=$(e);this.initElements(i),t.replaceWith(i)}}):t.reloadAsync()}submitButton(t){let e=t.find("button[type=submit]");if(0==e.length){let i=t.attr("id");i&&(e=$("button[type=submit][form="+i+"]"))}return e}serializeForm(t){return t.find(":not(.skip-on-submit)").serialize()}serializeFormData(t){let e=new FormData;$.each(t.find('input[type="file"]:not(.skip-on-submit)'),(function(t,i){$.each($(i)[0].files,(function(t,n){e.append(i.name,n)}))}));let i=t.find(":not(.skip-on-submit)").serializeArray();return $.each(i,(function(t,i){e.append(i.name,i.value)})),e}onScreen(t,e){void 0===e&&(e=0);let i=$(window).scrollTop(),n=i+$(window).height(),o=t.offset().top;return o+t.outerHeight()<=n+e&&o>=i-e}onceInit(){let t=this;$.fn.extend({jbobInitUninited:function(){return this.not(".jb-in").addClass("jb-in")},reloadAsync:function(){this.each(((e,i)=>{(i=$(i)).hasClass("async-modal")?t.loadAsyncModal(i):i.hasClass("async-accordion")?t.loadAsyncAccordion(i):i.hasClass("async-tab")&&t.loadAsyncTab(i)}))}}),$("body").on("hidden.bs.modal",".modal.delete-on-close",(function(){$(this).remove()}))}};var o=i(955);function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function r(t,e){for(var i=0;i