diff --git a/assets/js/form_upload_progress.js b/assets/js/form_upload_progress.js index 9978579..6f8288d 100644 --- a/assets/js/form_upload_progress.js +++ b/assets/js/form_upload_progress.js @@ -12,6 +12,7 @@ export default function (rootEl) { ); let form = input.closest("form"); let csrfToken = document.querySelector("meta[name=csrf-token]").content; + let nUploadsBusy = 0 files.forEach((file, i) => { let tmpl = document @@ -84,6 +85,22 @@ export default function (rootEl) { let req = new XMLHttpRequest(); + req.addEventListener( + "loadstart", () => { + nUploadsBusy++; + // duplicate listeners are ignored + window.addEventListener("beforeunload", beforeUnloadHandler) + } + ) + req.addEventListener( + "loadend", () => { + nUploadsBusy--; + if (nUploadsBusy <= 0) { + window.removeEventListener("beforeunload", beforeUnloadHandler) + } + } + ) + req.addEventListener( "abort", (e) => { @@ -185,3 +202,10 @@ function friendlyBytes(n) { } return val.toFixed(0) + " " + unit; } + +function beforeUnloadHandler(evt){ + // Recommended + evt.preventDefault(); + // Included for legacy support, e.g. Chrome/Edge < 119 + evt.returnValue = true; +} \ No newline at end of file diff --git a/static/js/app.js b/static/js/app.js index 0d74f64..e4c7275 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -1,3 +1,3 @@ /*! For license information please see app.js.LICENSE.txt */ -(()=>{var __webpack_modules__={180:(e,t,n)=>{"use strict";var r={};n.r(r),n.d(r,{afterMain:()=>S,afterRead:()=>x,afterWrite:()=>k,applyStyles:()=>P,arrow:()=>te,auto:()=>u,basePlacements:()=>f,beforeMain:()=>E,beforeRead:()=>y,beforeWrite:()=>C,bottom:()=>a,clippingParents:()=>p,computeStyles:()=>oe,createPopper:()=>Pe,createPopperBase:()=>Me,createPopperLite:()=>qe,detectOverflow:()=>we,end:()=>h,eventListeners:()=>ae,flip:()=>xe,hide:()=>Se,left:()=>c,main:()=>A,modifierPhases:()=>O,offset:()=>Ce,placements:()=>b,popper:()=>m,popperGenerator:()=>Ne,popperOffsets:()=>Te,preventOverflow:()=>ke,read:()=>w,reference:()=>_,right:()=>l,start:()=>d,top:()=>s,variationPlacements:()=>v,viewport:()=>g,write:()=>T});var i=n(28),o=n.n(i),s="top",a="bottom",l="right",c="left",u="auto",f=[s,a,l,c],d="start",h="end",p="clippingParents",g="viewport",m="popper",_="reference",v=f.reduce((function(e,t){return e.concat([t+"-"+d,t+"-"+h])}),[]),b=[].concat(f,[u]).reduce((function(e,t){return e.concat([t,t+"-"+d,t+"-"+h])}),[]),y="beforeRead",w="read",x="afterRead",E="beforeMain",A="main",S="afterMain",C="beforeWrite",T="write",k="afterWrite",O=[y,w,x,E,A,S,C,T,k];function L(e){return e?(e.nodeName||"").toLowerCase():null}function I(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function D(e){return e instanceof I(e).Element||e instanceof Element}function N(e){return e instanceof I(e).HTMLElement||e instanceof HTMLElement}function M(e){return"undefined"!=typeof ShadowRoot&&(e instanceof I(e).ShadowRoot||e instanceof ShadowRoot)}const P={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];N(i)&&L(i)&&(Object.assign(i.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],i=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});N(r)&&L(r)&&(Object.assign(r.style,o),Object.keys(i).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};function q(e){return e.split("-")[0]}var $=Math.max,R=Math.min,H=Math.round;function j(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function F(){return!/^((?!chrome|android).)*safari/i.test(j())}function z(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&N(e)&&(i=e.offsetWidth>0&&H(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&H(r.height)/e.offsetHeight||1);var s=(D(e)?I(e):window).visualViewport,a=!F()&&n,l=(r.left+(a&&s?s.offsetLeft:0))/i,c=(r.top+(a&&s?s.offsetTop:0))/o,u=r.width/i,f=r.height/o;return{width:u,height:f,top:c,right:l+u,bottom:c+f,left:l,x:l,y:c}}function B(e){var t=z(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function W(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&M(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Y(e){return I(e).getComputedStyle(e)}function Q(e){return["table","td","th"].indexOf(L(e))>=0}function Z(e){return((D(e)?e.ownerDocument:e.document)||window.document).documentElement}function X(e){return"html"===L(e)?e:e.assignedSlot||e.parentNode||(M(e)?e.host:null)||Z(e)}function V(e){return N(e)&&"fixed"!==Y(e).position?e.offsetParent:null}function U(e){for(var t=I(e),n=V(e);n&&Q(n)&&"static"===Y(n).position;)n=V(n);return n&&("html"===L(n)||"body"===L(n)&&"static"===Y(n).position)?t:n||function(e){var t=/firefox/i.test(j());if(/Trident/i.test(j())&&N(e)&&"fixed"===Y(e).position)return null;var n=X(e);for(M(n)&&(n=n.host);N(n)&&["html","body"].indexOf(L(n))<0;){var r=Y(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}function K(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function J(e,t,n){return $(e,R(t,n))}function G(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function ee(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}const te={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,u=n.modifiersData.popperOffsets,d=q(n.placement),h=K(d),p=[c,l].indexOf(d)>=0?"height":"width";if(o&&u){var g=function(e,t){return G("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:ee(e,f))}(i.padding,n),m=B(o),_="y"===h?s:c,v="y"===h?a:l,b=n.rects.reference[p]+n.rects.reference[h]-u[h]-n.rects.popper[p],y=u[h]-n.rects.reference[h],w=U(o),x=w?"y"===h?w.clientHeight||0:w.clientWidth||0:0,E=b/2-y/2,A=g[_],S=x-m[p]-g[v],C=x/2-m[p]/2+E,T=J(A,C,S),k=h;n.modifiersData[r]=((t={})[k]=T,t.centerOffset=T-C,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&W(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ne(e){return e.split("-")[1]}var re={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ie(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,u=e.offsets,f=e.position,d=e.gpuAcceleration,p=e.adaptive,g=e.roundOffsets,m=e.isFixed,_=u.x,v=void 0===_?0:_,b=u.y,y=void 0===b?0:b,w="function"==typeof g?g({x:v,y}):{x:v,y};v=w.x,y=w.y;var x=u.hasOwnProperty("x"),E=u.hasOwnProperty("y"),A=c,S=s,C=window;if(p){var T=U(n),k="clientHeight",O="clientWidth";if(T===I(n)&&"static"!==Y(T=Z(n)).position&&"absolute"===f&&(k="scrollHeight",O="scrollWidth"),i===s||(i===c||i===l)&&o===h)S=a,y-=(m&&T===C&&C.visualViewport?C.visualViewport.height:T[k])-r.height,y*=d?1:-1;if(i===c||(i===s||i===a)&&o===h)A=l,v-=(m&&T===C&&C.visualViewport?C.visualViewport.width:T[O])-r.width,v*=d?1:-1}var L,D=Object.assign({position:f},p&&re),N=!0===g?function(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:H(n*i)/i||0,y:H(r*i)/i||0}}({x:v,y},I(n)):{x:v,y};return v=N.x,y=N.y,d?Object.assign({},D,((L={})[S]=E?"0":"",L[A]=x?"0":"",L.transform=(C.devicePixelRatio||1)<=1?"translate("+v+"px, "+y+"px)":"translate3d("+v+"px, "+y+"px, 0)",L)):Object.assign({},D,((t={})[S]=E?y+"px":"",t[A]=x?v+"px":"",t.transform="",t))}const oe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=void 0===r||r,o=n.adaptive,s=void 0===o||o,a=n.roundOffsets,l=void 0===a||a,c={placement:q(t.placement),variation:ne(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,ie(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,ie(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}};var se={passive:!0};const ae={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=void 0===i||i,s=r.resize,a=void 0===s||s,l=I(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&c.forEach((function(e){e.addEventListener("scroll",n.update,se)})),a&&l.addEventListener("resize",n.update,se),function(){o&&c.forEach((function(e){e.removeEventListener("scroll",n.update,se)})),a&&l.removeEventListener("resize",n.update,se)}},data:{}};var le={left:"right",right:"left",bottom:"top",top:"bottom"};function ce(e){return e.replace(/left|right|bottom|top/g,(function(e){return le[e]}))}var ue={start:"end",end:"start"};function fe(e){return e.replace(/start|end/g,(function(e){return ue[e]}))}function de(e){var t=I(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function he(e){return z(Z(e)).left+de(e).scrollLeft}function pe(e){var t=Y(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function ge(e){return["html","body","#document"].indexOf(L(e))>=0?e.ownerDocument.body:N(e)&&pe(e)?e:ge(X(e))}function me(e,t){var n;void 0===t&&(t=[]);var r=ge(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=I(r),s=i?[o].concat(o.visualViewport||[],pe(r)?r:[]):r,a=t.concat(s);return i?a:a.concat(me(X(s)))}function _e(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ve(e,t,n){return t===g?_e(function(e,t){var n=I(e),r=Z(e),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;var c=F();(c||!c&&"fixed"===t)&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a+he(e),y:l}}(e,n)):D(t)?function(e,t){var n=z(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):_e(function(e){var t,n=Z(e),r=de(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=$(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=$(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+he(e),l=-r.scrollTop;return"rtl"===Y(i||n).direction&&(a+=$(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}(Z(e)))}function be(e,t,n,r){var i="clippingParents"===t?function(e){var t=me(X(e)),n=["absolute","fixed"].indexOf(Y(e).position)>=0&&N(e)?U(e):e;return D(n)?t.filter((function(e){return D(e)&&W(e,n)&&"body"!==L(e)})):[]}(e):[].concat(t),o=[].concat(i,[n]),s=o[0],a=o.reduce((function(t,n){var i=ve(e,n,r);return t.top=$(i.top,t.top),t.right=R(i.right,t.right),t.bottom=R(i.bottom,t.bottom),t.left=$(i.left,t.left),t}),ve(e,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ye(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?q(i):null,u=i?ne(i):null,f=n.x+n.width/2-r.width/2,p=n.y+n.height/2-r.height/2;switch(o){case s:t={x:f,y:n.y-r.height};break;case a:t={x:f,y:n.y+n.height};break;case l:t={x:n.x+n.width,y:p};break;case c:t={x:n.x-r.width,y:p};break;default:t={x:n.x,y:n.y}}var g=o?K(o):null;if(null!=g){var m="y"===g?"height":"width";switch(u){case d:t[g]=t[g]-(n[m]/2-r[m]/2);break;case h:t[g]=t[g]+(n[m]/2-r[m]/2)}}return t}function we(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=void 0===r?e.placement:r,o=n.strategy,c=void 0===o?e.strategy:o,u=n.boundary,d=void 0===u?p:u,h=n.rootBoundary,v=void 0===h?g:h,b=n.elementContext,y=void 0===b?m:b,w=n.altBoundary,x=void 0!==w&&w,E=n.padding,A=void 0===E?0:E,S=G("number"!=typeof A?A:ee(A,f)),C=y===m?_:m,T=e.rects.popper,k=e.elements[x?C:y],O=be(D(k)?k:k.contextElement||Z(e.elements.popper),d,v,c),L=z(e.elements.reference),I=ye({reference:L,element:T,strategy:"absolute",placement:i}),N=_e(Object.assign({},T,I)),M=y===m?N:L,P={top:O.top-M.top+S.top,bottom:M.bottom-O.bottom+S.bottom,left:O.left-M.left+S.left,right:M.right-O.right+S.right},q=e.modifiersData.offset;if(y===m&&q){var $=q[i];Object.keys(P).forEach((function(e){var t=[l,a].indexOf(e)>=0?1:-1,n=[s,a].indexOf(e)>=0?"y":"x";P[e]+=$[n]*t}))}return P}const xe={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=void 0===i||i,h=n.altAxis,p=void 0===h||h,g=n.fallbackPlacements,m=n.padding,_=n.boundary,y=n.rootBoundary,w=n.altBoundary,x=n.flipVariations,E=void 0===x||x,A=n.allowedAutoPlacements,S=t.options.placement,C=q(S),T=g||(C===S||!E?[ce(S)]:function(e){if(q(e)===u)return[];var t=ce(e);return[fe(e),t,fe(t)]}(S)),k=[S].concat(T).reduce((function(e,n){return e.concat(q(n)===u?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?b:l,u=ne(r),d=u?a?v:v.filter((function(e){return ne(e)===u})):f,h=d.filter((function(e){return c.indexOf(e)>=0}));0===h.length&&(h=d);var p=h.reduce((function(t,n){return t[n]=we(e,{placement:n,boundary:i,rootBoundary:o,padding:s})[q(n)],t}),{});return Object.keys(p).sort((function(e,t){return p[e]-p[t]}))}(t,{placement:n,boundary:_,rootBoundary:y,padding:m,flipVariations:E,allowedAutoPlacements:A}):n)}),[]),O=t.rects.reference,L=t.rects.popper,I=new Map,D=!0,N=k[0],M=0;M=0,j=H?"width":"height",F=we(t,{placement:P,boundary:_,rootBoundary:y,altBoundary:w,padding:m}),z=H?R?l:c:R?a:s;O[j]>L[j]&&(z=ce(z));var B=ce(z),W=[];if(o&&W.push(F[$]<=0),p&&W.push(F[z]<=0,F[B]<=0),W.every((function(e){return e}))){N=P,D=!1;break}I.set(P,W)}if(D)for(var Y=function(e){var t=k.find((function(t){var n=I.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return N=t,"break"},Q=E?3:1;Q>0;Q--){if("break"===Y(Q))break}t.placement!==N&&(t.modifiersData[r]._skip=!0,t.placement=N,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function Ee(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Ae(e){return[s,l,a,c].some((function(t){return e[t]>=0}))}const Se={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,s=we(t,{elementContext:"reference"}),a=we(t,{altBoundary:!0}),l=Ee(s,r),c=Ee(a,i,o),u=Ae(l),f=Ae(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}};const Ce={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=void 0===i?[0,0]:i,a=b.reduce((function(e,n){return e[n]=function(e,t,n){var r=q(e),i=[c,s].indexOf(r)>=0?-1:1,o="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=o[0],u=o[1];return a=a||0,u=(u||0)*i,[c,l].indexOf(r)>=0?{x:u,y:a}:{x:a,y:u}}(n,t.rects,o),e}),{}),u=a[t.placement],f=u.x,d=u.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=f,t.modifiersData.popperOffsets.y+=d),t.modifiersData[r]=a}};const Te={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=ye({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};const ke={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=void 0===i||i,u=n.altAxis,f=void 0!==u&&u,h=n.boundary,p=n.rootBoundary,g=n.altBoundary,m=n.padding,_=n.tether,v=void 0===_||_,b=n.tetherOffset,y=void 0===b?0:b,w=we(t,{boundary:h,rootBoundary:p,padding:m,altBoundary:g}),x=q(t.placement),E=ne(t.placement),A=!E,S=K(x),C="x"===S?"y":"x",T=t.modifiersData.popperOffsets,k=t.rects.reference,O=t.rects.popper,L="function"==typeof y?y(Object.assign({},t.rects,{placement:t.placement})):y,I="number"==typeof L?{mainAxis:L,altAxis:L}:Object.assign({mainAxis:0,altAxis:0},L),D=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,N={x:0,y:0};if(T){if(o){var M,P="y"===S?s:c,H="y"===S?a:l,j="y"===S?"height":"width",F=T[S],z=F+w[P],W=F-w[H],Y=v?-O[j]/2:0,Q=E===d?k[j]:O[j],Z=E===d?-O[j]:-k[j],X=t.elements.arrow,V=v&&X?B(X):{width:0,height:0},G=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},ee=G[P],te=G[H],re=J(0,k[j],V[j]),ie=A?k[j]/2-Y-re-ee-I.mainAxis:Q-re-ee-I.mainAxis,oe=A?-k[j]/2+Y+re+te+I.mainAxis:Z+re+te+I.mainAxis,se=t.elements.arrow&&U(t.elements.arrow),ae=se?"y"===S?se.clientTop||0:se.clientLeft||0:0,le=null!=(M=null==D?void 0:D[S])?M:0,ce=F+oe-le,ue=J(v?R(z,F+ie-le-ae):z,F,v?$(W,ce):W);T[S]=ue,N[S]=ue-F}if(f){var fe,de="x"===S?s:c,he="x"===S?a:l,pe=T[C],ge="y"===C?"height":"width",me=pe+w[de],_e=pe-w[he],ve=-1!==[s,c].indexOf(x),be=null!=(fe=null==D?void 0:D[C])?fe:0,ye=ve?me:pe-k[ge]-O[ge]-be+I.altAxis,xe=ve?pe+k[ge]+O[ge]-be-I.altAxis:_e,Ee=v&&ve?function(e,t,n){var r=J(e,t,n);return r>n?n:r}(ye,pe,xe):J(v?ye:me,pe,v?xe:_e);T[C]=Ee,N[C]=Ee-pe}t.modifiersData[r]=N}},requiresIfExists:["offset"]};function Oe(e,t,n){void 0===n&&(n=!1);var r,i,o=N(t),s=N(t)&&function(e){var t=e.getBoundingClientRect(),n=H(t.width)/e.offsetWidth||1,r=H(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),a=Z(t),l=z(e,s,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(o||!o&&!n)&&(("body"!==L(t)||pe(a))&&(c=(r=t)!==I(r)&&N(r)?{scrollLeft:(i=r).scrollLeft,scrollTop:i.scrollTop}:de(r)),N(t)?((u=z(t,!0)).x+=t.clientLeft,u.y+=t.clientTop):a&&(u.x=he(a))),{x:l.left+c.scrollLeft-u.x,y:l.top+c.scrollTop-u.y,width:l.width,height:l.height}}function Le(e){var t=new Map,n=new Set,r=[];function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||i(e)})),r}var Ie={placement:"bottom",modifiers:[],strategy:"absolute"};function De(){for(var e=arguments.length,t=new Array(e),n=0;n$e.has(e)&&$e.get(e).get(t)||null,remove(e,t){if(!$e.has(e))return;const n=$e.get(e);n.delete(t),0===n.size&&$e.delete(e)}},He="transitionend",je=e=>(e&&window.CSS&&window.CSS.escape&&(e=e.replace(/#([^\s"#']+)/g,((e,t)=>`#${CSS.escape(t)}`))),e),Fe=e=>{e.dispatchEvent(new Event(He))},ze=e=>!(!e||"object"!=typeof e)&&(void 0!==e.jquery&&(e=e[0]),void 0!==e.nodeType),Be=e=>ze(e)?e.jquery?e[0]:e:"string"==typeof e&&e.length>0?document.querySelector(je(e)):null,We=e=>{if(!ze(e)||0===e.getClientRects().length)return!1;const t="visible"===getComputedStyle(e).getPropertyValue("visibility"),n=e.closest("details:not([open])");if(!n)return t;if(n!==e){const t=e.closest("summary");if(t&&t.parentNode!==n)return!1;if(null===t)return!1}return t},Ye=e=>!e||e.nodeType!==Node.ELEMENT_NODE||(!!e.classList.contains("disabled")||(void 0!==e.disabled?e.disabled:e.hasAttribute("disabled")&&"false"!==e.getAttribute("disabled"))),Qe=e=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof e.getRootNode){const t=e.getRootNode();return t instanceof ShadowRoot?t:null}return e instanceof ShadowRoot?e:e.parentNode?Qe(e.parentNode):null},Ze=()=>{},Xe=e=>{e.offsetHeight},Ve=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,Ue=[],Ke=()=>"rtl"===document.documentElement.dir,Je=e=>{var t;t=()=>{const t=Ve();if(t){const n=e.NAME,r=t.fn[n];t.fn[n]=e.jQueryInterface,t.fn[n].Constructor=e,t.fn[n].noConflict=()=>(t.fn[n]=r,e.jQueryInterface)}},"loading"===document.readyState?(Ue.length||document.addEventListener("DOMContentLoaded",(()=>{for(const e of Ue)e()})),Ue.push(t)):t()},Ge=(e,t=[],n=e)=>"function"==typeof e?e(...t):n,et=(e,t,n=!0)=>{if(!n)return void Ge(e);const r=(e=>{if(!e)return 0;let{transitionDuration:t,transitionDelay:n}=window.getComputedStyle(e);const r=Number.parseFloat(t),i=Number.parseFloat(n);return r||i?(t=t.split(",")[0],n=n.split(",")[0],1e3*(Number.parseFloat(t)+Number.parseFloat(n))):0})(t)+5;let i=!1;const o=({target:n})=>{n===t&&(i=!0,t.removeEventListener(He,o),Ge(e))};t.addEventListener(He,o),setTimeout((()=>{i||Fe(t)}),r)},tt=(e,t,n,r)=>{const i=e.length;let o=e.indexOf(t);return-1===o?!n&&r?e[i-1]:e[0]:(o+=n?1:-1,r&&(o=(o+i)%i),e[Math.max(0,Math.min(o,i-1))])},nt=/[^.]*(?=\..*)\.|.*/,rt=/\..*/,it=/::\d+$/,ot={};let st=1;const at={mouseenter:"mouseover",mouseleave:"mouseout"},lt=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function ct(e,t){return t&&`${t}::${st++}`||e.uidEvent||st++}function ut(e){const t=ct(e);return e.uidEvent=t,ot[t]=ot[t]||{},ot[t]}function ft(e,t,n=null){return Object.values(e).find((e=>e.callable===t&&e.delegationSelector===n))}function dt(e,t,n){const r="string"==typeof t,i=r?n:t||n;let o=mt(e);return lt.has(o)||(o=e),[r,i,o]}function ht(e,t,n,r,i){if("string"!=typeof t||!e)return;let[o,s,a]=dt(t,n,r);if(t in at){const e=e=>function(t){if(!t.relatedTarget||t.relatedTarget!==t.delegateTarget&&!t.delegateTarget.contains(t.relatedTarget))return e.call(this,t)};s=e(s)}const l=ut(e),c=l[a]||(l[a]={}),u=ft(c,s,o?n:null);if(u)return void(u.oneOff=u.oneOff&&i);const f=ct(s,t.replace(nt,"")),d=o?function(e,t,n){return function r(i){const o=e.querySelectorAll(t);for(let{target:s}=i;s&&s!==this;s=s.parentNode)for(const a of o)if(a===s)return vt(i,{delegateTarget:s}),r.oneOff&&_t.off(e,i.type,t,n),n.apply(s,[i])}}(e,n,s):function(e,t){return function n(r){return vt(r,{delegateTarget:e}),n.oneOff&&_t.off(e,r.type,t),t.apply(e,[r])}}(e,s);d.delegationSelector=o?n:null,d.callable=s,d.oneOff=i,d.uidEvent=f,c[f]=d,e.addEventListener(a,d,o)}function pt(e,t,n,r,i){const o=ft(t[n],r,i);o&&(e.removeEventListener(n,o,Boolean(i)),delete t[n][o.uidEvent])}function gt(e,t,n,r){const i=t[n]||{};for(const[o,s]of Object.entries(i))o.includes(r)&&pt(e,t,n,s.callable,s.delegationSelector)}function mt(e){return e=e.replace(rt,""),at[e]||e}const _t={on(e,t,n,r){ht(e,t,n,r,!1)},one(e,t,n,r){ht(e,t,n,r,!0)},off(e,t,n,r){if("string"!=typeof t||!e)return;const[i,o,s]=dt(t,n,r),a=s!==t,l=ut(e),c=l[s]||{},u=t.startsWith(".");if(void 0===o){if(u)for(const n of Object.keys(l))gt(e,l,n,t.slice(1));for(const[n,r]of Object.entries(c)){const i=n.replace(it,"");a&&!t.includes(i)||pt(e,l,s,r.callable,r.delegationSelector)}}else{if(!Object.keys(c).length)return;pt(e,l,s,o,i?n:null)}},trigger(e,t,n){if("string"!=typeof t||!e)return null;const r=Ve();let i=null,o=!0,s=!0,a=!1;t!==mt(t)&&r&&(i=r.Event(t,n),r(e).trigger(i),o=!i.isPropagationStopped(),s=!i.isImmediatePropagationStopped(),a=i.isDefaultPrevented());const l=vt(new Event(t,{bubbles:o,cancelable:!0}),n);return a&&l.preventDefault(),s&&e.dispatchEvent(l),l.defaultPrevented&&i&&i.preventDefault(),l}};function vt(e,t={}){for(const[n,r]of Object.entries(t))try{e[n]=r}catch(t){Object.defineProperty(e,n,{configurable:!0,get:()=>r})}return e}function bt(e){if("true"===e)return!0;if("false"===e)return!1;if(e===Number(e).toString())return Number(e);if(""===e||"null"===e)return null;if("string"!=typeof e)return e;try{return JSON.parse(decodeURIComponent(e))}catch(t){return e}}function yt(e){return e.replace(/[A-Z]/g,(e=>`-${e.toLowerCase()}`))}const wt={setDataAttribute(e,t,n){e.setAttribute(`data-bs-${yt(t)}`,n)},removeDataAttribute(e,t){e.removeAttribute(`data-bs-${yt(t)}`)},getDataAttributes(e){if(!e)return{};const t={},n=Object.keys(e.dataset).filter((e=>e.startsWith("bs")&&!e.startsWith("bsConfig")));for(const r of n){let n=r.replace(/^bs/,"");n=n.charAt(0).toLowerCase()+n.slice(1,n.length),t[n]=bt(e.dataset[r])}return t},getDataAttribute:(e,t)=>bt(e.getAttribute(`data-bs-${yt(t)}`))};class xt{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(e){return e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e}_mergeConfigObj(e,t){const n=ze(t)?wt.getDataAttribute(t,"config"):{};return{...this.constructor.Default,..."object"==typeof n?n:{},...ze(t)?wt.getDataAttributes(t):{},..."object"==typeof e?e:{}}}_typeCheckConfig(e,t=this.constructor.DefaultType){for(const[r,i]of Object.entries(t)){const t=e[r],o=ze(t)?"element":null==(n=t)?`${n}`:Object.prototype.toString.call(n).match(/\s([a-z]+)/i)[1].toLowerCase();if(!new RegExp(i).test(o))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${r}" provided type "${o}" but expected type "${i}".`)}var n}}class Et extends xt{constructor(e,t){super(),(e=Be(e))&&(this._element=e,this._config=this._getConfig(t),Re.set(this._element,this.constructor.DATA_KEY,this))}dispose(){Re.remove(this._element,this.constructor.DATA_KEY),_t.off(this._element,this.constructor.EVENT_KEY);for(const e of Object.getOwnPropertyNames(this))this[e]=null}_queueCallback(e,t,n=!0){et(e,t,n)}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return Re.get(Be(e),this.DATA_KEY)}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,"object"==typeof t?t:null)}static get VERSION(){return"5.3.0"}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(e){return`${e}${this.EVENT_KEY}`}}const At=e=>{let t=e.getAttribute("data-bs-target");if(!t||"#"===t){let n=e.getAttribute("href");if(!n||!n.includes("#")&&!n.startsWith("."))return null;n.includes("#")&&!n.startsWith("#")&&(n=`#${n.split("#")[1]}`),t=n&&"#"!==n?n.trim():null}return je(t)},St={find:(e,t=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(t,e)),findOne:(e,t=document.documentElement)=>Element.prototype.querySelector.call(t,e),children:(e,t)=>[].concat(...e.children).filter((e=>e.matches(t))),parents(e,t){const n=[];let r=e.parentNode.closest(t);for(;r;)n.push(r),r=r.parentNode.closest(t);return n},prev(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return[n];n=n.previousElementSibling}return[]},next(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return[n];n=n.nextElementSibling}return[]},focusableChildren(e){const t=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map((e=>`${e}:not([tabindex^="-"])`)).join(",");return this.find(t,e).filter((e=>!Ye(e)&&We(e)))},getSelectorFromElement(e){const t=At(e);return t&&St.findOne(t)?t:null},getElementFromSelector(e){const t=At(e);return t?St.findOne(t):null},getMultipleElementsFromSelector(e){const t=At(e);return t?St.find(t):[]}},Ct=(e,t="hide")=>{const n=`click.dismiss${e.EVENT_KEY}`,r=e.NAME;_t.on(document,n,`[data-bs-dismiss="${r}"]`,(function(n){if(["A","AREA"].includes(this.tagName)&&n.preventDefault(),Ye(this))return;const i=St.getElementFromSelector(this)||this.closest(`.${r}`);e.getOrCreateInstance(i)[t]()}))},Tt=".bs.alert",kt=`close${Tt}`,Ot=`closed${Tt}`;class Lt extends Et{static get NAME(){return"alert"}close(){if(_t.trigger(this._element,kt).defaultPrevented)return;this._element.classList.remove("show");const e=this._element.classList.contains("fade");this._queueCallback((()=>this._destroyElement()),this._element,e)}_destroyElement(){this._element.remove(),_t.trigger(this._element,Ot),this.dispose()}static jQueryInterface(e){return this.each((function(){const t=Lt.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e](this)}}))}}Ct(Lt,"close"),Je(Lt);const It='[data-bs-toggle="button"]';class Dt extends Et{static get NAME(){return"button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}static jQueryInterface(e){return this.each((function(){const t=Dt.getOrCreateInstance(this);"toggle"===e&&t[e]()}))}}_t.on(document,"click.bs.button.data-api",It,(e=>{e.preventDefault();const t=e.target.closest(It);Dt.getOrCreateInstance(t).toggle()})),Je(Dt);const Nt=".bs.swipe",Mt=`touchstart${Nt}`,Pt=`touchmove${Nt}`,qt=`touchend${Nt}`,$t=`pointerdown${Nt}`,Rt=`pointerup${Nt}`,Ht={endCallback:null,leftCallback:null,rightCallback:null},jt={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class Ft extends xt{constructor(e,t){super(),this._element=e,e&&Ft.isSupported()&&(this._config=this._getConfig(t),this._deltaX=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents())}static get Default(){return Ht}static get DefaultType(){return jt}static get NAME(){return"swipe"}dispose(){_t.off(this._element,Nt)}_start(e){this._supportPointerEvents?this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX):this._deltaX=e.touches[0].clientX}_end(e){this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX-this._deltaX),this._handleSwipe(),Ge(this._config.endCallback)}_move(e){this._deltaX=e.touches&&e.touches.length>1?0:e.touches[0].clientX-this._deltaX}_handleSwipe(){const e=Math.abs(this._deltaX);if(e<=40)return;const t=e/this._deltaX;this._deltaX=0,t&&Ge(t>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(_t.on(this._element,$t,(e=>this._start(e))),_t.on(this._element,Rt,(e=>this._end(e))),this._element.classList.add("pointer-event")):(_t.on(this._element,Mt,(e=>this._start(e))),_t.on(this._element,Pt,(e=>this._move(e))),_t.on(this._element,qt,(e=>this._end(e))))}_eventIsPointerPenTouch(e){return this._supportPointerEvents&&("pen"===e.pointerType||"touch"===e.pointerType)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const zt=".bs.carousel",Bt=".data-api",Wt="next",Yt="prev",Qt="left",Zt="right",Xt=`slide${zt}`,Vt=`slid${zt}`,Ut=`keydown${zt}`,Kt=`mouseenter${zt}`,Jt=`mouseleave${zt}`,Gt=`dragstart${zt}`,en=`load${zt}${Bt}`,tn=`click${zt}${Bt}`,nn="carousel",rn="active",on=".active",sn=".carousel-item",an=on+sn,ln={ArrowLeft:Zt,ArrowRight:Qt},cn={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},un={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class fn extends Et{constructor(e,t){super(e,t),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=St.findOne(".carousel-indicators",this._element),this._addEventListeners(),this._config.ride===nn&&this.cycle()}static get Default(){return cn}static get DefaultType(){return un}static get NAME(){return"carousel"}next(){this._slide(Wt)}nextWhenVisible(){!document.hidden&&We(this._element)&&this.next()}prev(){this._slide(Yt)}pause(){this._isSliding&&Fe(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval((()=>this.nextWhenVisible()),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?_t.one(this._element,Vt,(()=>this.cycle())):this.cycle())}to(e){const t=this._getItems();if(e>t.length-1||e<0)return;if(this._isSliding)return void _t.one(this._element,Vt,(()=>this.to(e)));const n=this._getItemIndex(this._getActive());if(n===e)return;const r=e>n?Wt:Yt;this._slide(r,t[e])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(e){return e.defaultInterval=e.interval,e}_addEventListeners(){this._config.keyboard&&_t.on(this._element,Ut,(e=>this._keydown(e))),"hover"===this._config.pause&&(_t.on(this._element,Kt,(()=>this.pause())),_t.on(this._element,Jt,(()=>this._maybeEnableCycle()))),this._config.touch&&Ft.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const e of St.find(".carousel-item img",this._element))_t.on(e,Gt,(e=>e.preventDefault()));const e={leftCallback:()=>this._slide(this._directionToOrder(Qt)),rightCallback:()=>this._slide(this._directionToOrder(Zt)),endCallback:()=>{"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout((()=>this._maybeEnableCycle()),500+this._config.interval))}};this._swipeHelper=new Ft(this._element,e)}_keydown(e){if(/input|textarea/i.test(e.target.tagName))return;const t=ln[e.key];t&&(e.preventDefault(),this._slide(this._directionToOrder(t)))}_getItemIndex(e){return this._getItems().indexOf(e)}_setActiveIndicatorElement(e){if(!this._indicatorsElement)return;const t=St.findOne(on,this._indicatorsElement);t.classList.remove(rn),t.removeAttribute("aria-current");const n=St.findOne(`[data-bs-slide-to="${e}"]`,this._indicatorsElement);n&&(n.classList.add(rn),n.setAttribute("aria-current","true"))}_updateInterval(){const e=this._activeElement||this._getActive();if(!e)return;const t=Number.parseInt(e.getAttribute("data-bs-interval"),10);this._config.interval=t||this._config.defaultInterval}_slide(e,t=null){if(this._isSliding)return;const n=this._getActive(),r=e===Wt,i=t||tt(this._getItems(),n,r,this._config.wrap);if(i===n)return;const o=this._getItemIndex(i),s=t=>_t.trigger(this._element,t,{relatedTarget:i,direction:this._orderToDirection(e),from:this._getItemIndex(n),to:o});if(s(Xt).defaultPrevented)return;if(!n||!i)return;const a=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(o),this._activeElement=i;const l=r?"carousel-item-start":"carousel-item-end",c=r?"carousel-item-next":"carousel-item-prev";i.classList.add(c),Xe(i),n.classList.add(l),i.classList.add(l);this._queueCallback((()=>{i.classList.remove(l,c),i.classList.add(rn),n.classList.remove(rn,c,l),this._isSliding=!1,s(Vt)}),n,this._isAnimated()),a&&this.cycle()}_isAnimated(){return this._element.classList.contains("slide")}_getActive(){return St.findOne(an,this._element)}_getItems(){return St.find(sn,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(e){return Ke()?e===Qt?Yt:Wt:e===Qt?Wt:Yt}_orderToDirection(e){return Ke()?e===Yt?Qt:Zt:e===Yt?Zt:Qt}static jQueryInterface(e){return this.each((function(){const t=fn.getOrCreateInstance(this,e);if("number"!=typeof e){if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]()}}else t.to(e)}))}}_t.on(document,tn,"[data-bs-slide], [data-bs-slide-to]",(function(e){const t=St.getElementFromSelector(this);if(!t||!t.classList.contains(nn))return;e.preventDefault();const n=fn.getOrCreateInstance(t),r=this.getAttribute("data-bs-slide-to");return r?(n.to(r),void n._maybeEnableCycle()):"next"===wt.getDataAttribute(this,"slide")?(n.next(),void n._maybeEnableCycle()):(n.prev(),void n._maybeEnableCycle())})),_t.on(window,en,(()=>{const e=St.find('[data-bs-ride="carousel"]');for(const t of e)fn.getOrCreateInstance(t)})),Je(fn);const dn=".bs.collapse",hn=`show${dn}`,pn=`shown${dn}`,gn=`hide${dn}`,mn=`hidden${dn}`,_n=`click${dn}.data-api`,vn="show",bn="collapse",yn="collapsing",wn=`:scope .${bn} .${bn}`,xn='[data-bs-toggle="collapse"]',En={parent:null,toggle:!0},An={parent:"(null|element)",toggle:"boolean"};class Sn extends Et{constructor(e,t){super(e,t),this._isTransitioning=!1,this._triggerArray=[];const n=St.find(xn);for(const e of n){const t=St.getSelectorFromElement(e),n=St.find(t).filter((e=>e===this._element));null!==t&&n.length&&this._triggerArray.push(e)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return En}static get DefaultType(){return An}static get NAME(){return"collapse"}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let e=[];if(this._config.parent&&(e=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter((e=>e!==this._element)).map((e=>Sn.getOrCreateInstance(e,{toggle:!1})))),e.length&&e[0]._isTransitioning)return;if(_t.trigger(this._element,hn).defaultPrevented)return;for(const t of e)t.hide();const t=this._getDimension();this._element.classList.remove(bn),this._element.classList.add(yn),this._element.style[t]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const n=`scroll${t[0].toUpperCase()+t.slice(1)}`;this._queueCallback((()=>{this._isTransitioning=!1,this._element.classList.remove(yn),this._element.classList.add(bn,vn),this._element.style[t]="",_t.trigger(this._element,pn)}),this._element,!0),this._element.style[t]=`${this._element[n]}px`}hide(){if(this._isTransitioning||!this._isShown())return;if(_t.trigger(this._element,gn).defaultPrevented)return;const e=this._getDimension();this._element.style[e]=`${this._element.getBoundingClientRect()[e]}px`,Xe(this._element),this._element.classList.add(yn),this._element.classList.remove(bn,vn);for(const e of this._triggerArray){const t=St.getElementFromSelector(e);t&&!this._isShown(t)&&this._addAriaAndCollapsedClass([e],!1)}this._isTransitioning=!0;this._element.style[e]="",this._queueCallback((()=>{this._isTransitioning=!1,this._element.classList.remove(yn),this._element.classList.add(bn),_t.trigger(this._element,mn)}),this._element,!0)}_isShown(e=this._element){return e.classList.contains(vn)}_configAfterMerge(e){return e.toggle=Boolean(e.toggle),e.parent=Be(e.parent),e}_getDimension(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}_initializeChildren(){if(!this._config.parent)return;const e=this._getFirstLevelChildren(xn);for(const t of e){const e=St.getElementFromSelector(t);e&&this._addAriaAndCollapsedClass([t],this._isShown(e))}}_getFirstLevelChildren(e){const t=St.find(wn,this._config.parent);return St.find(e,this._config.parent).filter((e=>!t.includes(e)))}_addAriaAndCollapsedClass(e,t){if(e.length)for(const n of e)n.classList.toggle("collapsed",!t),n.setAttribute("aria-expanded",t)}static jQueryInterface(e){const t={};return"string"==typeof e&&/show|hide/.test(e)&&(t.toggle=!1),this.each((function(){const n=Sn.getOrCreateInstance(this,t);if("string"==typeof e){if(void 0===n[e])throw new TypeError(`No method named "${e}"`);n[e]()}}))}}_t.on(document,_n,xn,(function(e){("A"===e.target.tagName||e.delegateTarget&&"A"===e.delegateTarget.tagName)&&e.preventDefault();for(const e of St.getMultipleElementsFromSelector(this))Sn.getOrCreateInstance(e,{toggle:!1}).toggle()})),Je(Sn);const Cn="dropdown",Tn=".bs.dropdown",kn=".data-api",On="ArrowUp",Ln="ArrowDown",In=`hide${Tn}`,Dn=`hidden${Tn}`,Nn=`show${Tn}`,Mn=`shown${Tn}`,Pn=`click${Tn}${kn}`,qn=`keydown${Tn}${kn}`,$n=`keyup${Tn}${kn}`,Rn="show",Hn='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',jn=`${Hn}.${Rn}`,Fn=".dropdown-menu",zn=Ke()?"top-end":"top-start",Bn=Ke()?"top-start":"top-end",Wn=Ke()?"bottom-end":"bottom-start",Yn=Ke()?"bottom-start":"bottom-end",Qn=Ke()?"left-start":"right-start",Zn=Ke()?"right-start":"left-start",Xn={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},Vn={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class Un extends Et{constructor(e,t){super(e,t),this._popper=null,this._parent=this._element.parentNode,this._menu=St.next(this._element,Fn)[0]||St.prev(this._element,Fn)[0]||St.findOne(Fn,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return Xn}static get DefaultType(){return Vn}static get NAME(){return Cn}toggle(){return this._isShown()?this.hide():this.show()}show(){if(Ye(this._element)||this._isShown())return;const e={relatedTarget:this._element};if(!_t.trigger(this._element,Nn,e).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(".navbar-nav"))for(const e of[].concat(...document.body.children))_t.on(e,"mouseover",Ze);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(Rn),this._element.classList.add(Rn),_t.trigger(this._element,Mn,e)}}hide(){if(Ye(this._element)||!this._isShown())return;const e={relatedTarget:this._element};this._completeHide(e)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(e){if(!_t.trigger(this._element,In,e).defaultPrevented){if("ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))_t.off(e,"mouseover",Ze);this._popper&&this._popper.destroy(),this._menu.classList.remove(Rn),this._element.classList.remove(Rn),this._element.setAttribute("aria-expanded","false"),wt.removeDataAttribute(this._menu,"popper"),_t.trigger(this._element,Dn,e)}}_getConfig(e){if("object"==typeof(e=super._getConfig(e)).reference&&!ze(e.reference)&&"function"!=typeof e.reference.getBoundingClientRect)throw new TypeError(`${Cn.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return e}_createPopper(){if(void 0===r)throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");let e=this._element;"parent"===this._config.reference?e=this._parent:ze(this._config.reference)?e=Be(this._config.reference):"object"==typeof this._config.reference&&(e=this._config.reference);const t=this._getPopperConfig();this._popper=Pe(e,this._menu,t)}_isShown(){return this._menu.classList.contains(Rn)}_getPlacement(){const e=this._parent;if(e.classList.contains("dropend"))return Qn;if(e.classList.contains("dropstart"))return Zn;if(e.classList.contains("dropup-center"))return"top";if(e.classList.contains("dropdown-center"))return"bottom";const t="end"===getComputedStyle(this._menu).getPropertyValue("--bs-position").trim();return e.classList.contains("dropup")?t?Bn:zn:t?Yn:Wn}_detectNavbar(){return null!==this._element.closest(".navbar")}_getOffset(){const{offset:e}=this._config;return"string"==typeof e?e.split(",").map((e=>Number.parseInt(e,10))):"function"==typeof e?t=>e(t,this._element):e}_getPopperConfig(){const e={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||"static"===this._config.display)&&(wt.setDataAttribute(this._menu,"popper","static"),e.modifiers=[{name:"applyStyles",enabled:!1}]),{...e,...Ge(this._config.popperConfig,[e])}}_selectMenuItem({key:e,target:t}){const n=St.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter((e=>We(e)));n.length&&tt(n,t,e===Ln,!n.includes(t)).focus()}static jQueryInterface(e){return this.each((function(){const t=Un.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}}))}static clearMenus(e){if(2===e.button||"keyup"===e.type&&"Tab"!==e.key)return;const t=St.find(jn);for(const n of t){const t=Un.getInstance(n);if(!t||!1===t._config.autoClose)continue;const r=e.composedPath(),i=r.includes(t._menu);if(r.includes(t._element)||"inside"===t._config.autoClose&&!i||"outside"===t._config.autoClose&&i)continue;if(t._menu.contains(e.target)&&("keyup"===e.type&&"Tab"===e.key||/input|select|option|textarea|form/i.test(e.target.tagName)))continue;const o={relatedTarget:t._element};"click"===e.type&&(o.clickEvent=e),t._completeHide(o)}}static dataApiKeydownHandler(e){const t=/input|textarea/i.test(e.target.tagName),n="Escape"===e.key,r=[On,Ln].includes(e.key);if(!r&&!n)return;if(t&&!n)return;e.preventDefault();const i=this.matches(Hn)?this:St.prev(this,Hn)[0]||St.next(this,Hn)[0]||St.findOne(Hn,e.delegateTarget.parentNode),o=Un.getOrCreateInstance(i);if(r)return e.stopPropagation(),o.show(),void o._selectMenuItem(e);o._isShown()&&(e.stopPropagation(),o.hide(),i.focus())}}_t.on(document,qn,Hn,Un.dataApiKeydownHandler),_t.on(document,qn,Fn,Un.dataApiKeydownHandler),_t.on(document,Pn,Un.clearMenus),_t.on(document,$n,Un.clearMenus),_t.on(document,Pn,Hn,(function(e){e.preventDefault(),Un.getOrCreateInstance(this).toggle()})),Je(Un);const Kn="backdrop",Jn="show",Gn=`mousedown.bs.${Kn}`,er={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},tr={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class nr extends xt{constructor(e){super(),this._config=this._getConfig(e),this._isAppended=!1,this._element=null}static get Default(){return er}static get DefaultType(){return tr}static get NAME(){return Kn}show(e){if(!this._config.isVisible)return void Ge(e);this._append();const t=this._getElement();this._config.isAnimated&&Xe(t),t.classList.add(Jn),this._emulateAnimation((()=>{Ge(e)}))}hide(e){this._config.isVisible?(this._getElement().classList.remove(Jn),this._emulateAnimation((()=>{this.dispose(),Ge(e)}))):Ge(e)}dispose(){this._isAppended&&(_t.off(this._element,Gn),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const e=document.createElement("div");e.className=this._config.className,this._config.isAnimated&&e.classList.add("fade"),this._element=e}return this._element}_configAfterMerge(e){return e.rootElement=Be(e.rootElement),e}_append(){if(this._isAppended)return;const e=this._getElement();this._config.rootElement.append(e),_t.on(e,Gn,(()=>{Ge(this._config.clickCallback)})),this._isAppended=!0}_emulateAnimation(e){et(e,this._getElement(),this._config.isAnimated)}}const rr=".bs.focustrap",ir=`focusin${rr}`,or=`keydown.tab${rr}`,sr="backward",ar={autofocus:!0,trapElement:null},lr={autofocus:"boolean",trapElement:"element"};class cr extends xt{constructor(e){super(),this._config=this._getConfig(e),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return ar}static get DefaultType(){return lr}static get NAME(){return"focustrap"}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),_t.off(document,rr),_t.on(document,ir,(e=>this._handleFocusin(e))),_t.on(document,or,(e=>this._handleKeydown(e))),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,_t.off(document,rr))}_handleFocusin(e){const{trapElement:t}=this._config;if(e.target===document||e.target===t||t.contains(e.target))return;const n=St.focusableChildren(t);0===n.length?t.focus():this._lastTabNavDirection===sr?n[n.length-1].focus():n[0].focus()}_handleKeydown(e){"Tab"===e.key&&(this._lastTabNavDirection=e.shiftKey?sr:"forward")}}const ur=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",fr=".sticky-top",dr="padding-right",hr="margin-right";class pr{constructor(){this._element=document.body}getWidth(){const e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}hide(){const e=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,dr,(t=>t+e)),this._setElementAttributes(ur,dr,(t=>t+e)),this._setElementAttributes(fr,hr,(t=>t-e))}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,dr),this._resetElementAttributes(ur,dr),this._resetElementAttributes(fr,hr)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(e,t,n){const r=this.getWidth();this._applyManipulationCallback(e,(e=>{if(e!==this._element&&window.innerWidth>e.clientWidth+r)return;this._saveInitialAttribute(e,t);const i=window.getComputedStyle(e).getPropertyValue(t);e.style.setProperty(t,`${n(Number.parseFloat(i))}px`)}))}_saveInitialAttribute(e,t){const n=e.style.getPropertyValue(t);n&&wt.setDataAttribute(e,t,n)}_resetElementAttributes(e,t){this._applyManipulationCallback(e,(e=>{const n=wt.getDataAttribute(e,t);null!==n?(wt.removeDataAttribute(e,t),e.style.setProperty(t,n)):e.style.removeProperty(t)}))}_applyManipulationCallback(e,t){if(ze(e))t(e);else for(const n of St.find(e,this._element))t(n)}}const gr=".bs.modal",mr=`hide${gr}`,_r=`hidePrevented${gr}`,vr=`hidden${gr}`,br=`show${gr}`,yr=`shown${gr}`,wr=`resize${gr}`,xr=`click.dismiss${gr}`,Er=`mousedown.dismiss${gr}`,Ar=`keydown.dismiss${gr}`,Sr=`click${gr}.data-api`,Cr="modal-open",Tr="show",kr="modal-static",Or={backdrop:!0,focus:!0,keyboard:!0},Lr={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class Ir extends Et{constructor(e,t){super(e,t),this._dialog=St.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new pr,this._addEventListeners()}static get Default(){return Or}static get DefaultType(){return Lr}static get NAME(){return"modal"}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){if(this._isShown||this._isTransitioning)return;_t.trigger(this._element,br,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(Cr),this._adjustDialog(),this._backdrop.show((()=>this._showElement(e))))}hide(){if(!this._isShown||this._isTransitioning)return;_t.trigger(this._element,mr).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(Tr),this._queueCallback((()=>this._hideModal()),this._element,this._isAnimated()))}dispose(){_t.off(window,gr),_t.off(this._dialog,gr),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new nr({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new cr({trapElement:this._element})}_showElement(e){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const t=St.findOne(".modal-body",this._dialog);t&&(t.scrollTop=0),Xe(this._element),this._element.classList.add(Tr);this._queueCallback((()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,_t.trigger(this._element,yr,{relatedTarget:e})}),this._dialog,this._isAnimated())}_addEventListeners(){_t.on(this._element,Ar,(e=>{"Escape"===e.key&&(this._config.keyboard?this.hide():this._triggerBackdropTransition())})),_t.on(window,wr,(()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()})),_t.on(this._element,Er,(e=>{_t.one(this._element,xr,(t=>{this._element===e.target&&this._element===t.target&&("static"!==this._config.backdrop?this._config.backdrop&&this.hide():this._triggerBackdropTransition())}))}))}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide((()=>{document.body.classList.remove(Cr),this._resetAdjustments(),this._scrollBar.reset(),_t.trigger(this._element,vr)}))}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(_t.trigger(this._element,_r).defaultPrevented)return;const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._element.style.overflowY;"hidden"===t||this._element.classList.contains(kr)||(e||(this._element.style.overflowY="hidden"),this._element.classList.add(kr),this._queueCallback((()=>{this._element.classList.remove(kr),this._queueCallback((()=>{this._element.style.overflowY=t}),this._dialog)}),this._dialog),this._element.focus())}_adjustDialog(){const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._scrollBar.getWidth(),n=t>0;if(n&&!e){const e=Ke()?"paddingLeft":"paddingRight";this._element.style[e]=`${t}px`}if(!n&&e){const e=Ke()?"paddingRight":"paddingLeft";this._element.style[e]=`${t}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(e,t){return this.each((function(){const n=Ir.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===n[e])throw new TypeError(`No method named "${e}"`);n[e](t)}}))}}_t.on(document,Sr,'[data-bs-toggle="modal"]',(function(e){const t=St.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),_t.one(t,br,(e=>{e.defaultPrevented||_t.one(t,vr,(()=>{We(this)&&this.focus()}))}));const n=St.findOne(".modal.show");n&&Ir.getInstance(n).hide();Ir.getOrCreateInstance(t).toggle(this)})),Ct(Ir),Je(Ir);const Dr=".bs.offcanvas",Nr=".data-api",Mr=`load${Dr}${Nr}`,Pr="show",qr="showing",$r="hiding",Rr=".offcanvas.show",Hr=`show${Dr}`,jr=`shown${Dr}`,Fr=`hide${Dr}`,zr=`hidePrevented${Dr}`,Br=`hidden${Dr}`,Wr=`resize${Dr}`,Yr=`click${Dr}${Nr}`,Qr=`keydown.dismiss${Dr}`,Zr={backdrop:!0,keyboard:!0,scroll:!1},Xr={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class Vr extends Et{constructor(e,t){super(e,t),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return Zr}static get DefaultType(){return Xr}static get NAME(){return"offcanvas"}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){if(this._isShown)return;if(_t.trigger(this._element,Hr,{relatedTarget:e}).defaultPrevented)return;this._isShown=!0,this._backdrop.show(),this._config.scroll||(new pr).hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(qr);this._queueCallback((()=>{this._config.scroll&&!this._config.backdrop||this._focustrap.activate(),this._element.classList.add(Pr),this._element.classList.remove(qr),_t.trigger(this._element,jr,{relatedTarget:e})}),this._element,!0)}hide(){if(!this._isShown)return;if(_t.trigger(this._element,Fr).defaultPrevented)return;this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add($r),this._backdrop.hide();this._queueCallback((()=>{this._element.classList.remove(Pr,$r),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||(new pr).reset(),_t.trigger(this._element,Br)}),this._element,!0)}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const e=Boolean(this._config.backdrop);return new nr({className:"offcanvas-backdrop",isVisible:e,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:e?()=>{"static"!==this._config.backdrop?this.hide():_t.trigger(this._element,zr)}:null})}_initializeFocusTrap(){return new cr({trapElement:this._element})}_addEventListeners(){_t.on(this._element,Qr,(e=>{"Escape"===e.key&&(this._config.keyboard?this.hide():_t.trigger(this._element,zr))}))}static jQueryInterface(e){return this.each((function(){const t=Vr.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e](this)}}))}}_t.on(document,Yr,'[data-bs-toggle="offcanvas"]',(function(e){const t=St.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),Ye(this))return;_t.one(t,Br,(()=>{We(this)&&this.focus()}));const n=St.findOne(Rr);n&&n!==t&&Vr.getInstance(n).hide();Vr.getOrCreateInstance(t).toggle(this)})),_t.on(window,Mr,(()=>{for(const e of St.find(Rr))Vr.getOrCreateInstance(e).show()})),_t.on(window,Wr,(()=>{for(const e of St.find("[aria-modal][class*=show][class*=offcanvas-]"))"fixed"!==getComputedStyle(e).position&&Vr.getOrCreateInstance(e).hide()})),Ct(Vr),Je(Vr);const Ur={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},Kr=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),Jr=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,Gr=(e,t)=>{const n=e.nodeName.toLowerCase();return t.includes(n)?!Kr.has(n)||Boolean(Jr.test(e.nodeValue)):t.filter((e=>e instanceof RegExp)).some((e=>e.test(n)))};const ei={allowList:Ur,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"
"},ti={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},ni={entry:"(string|element|function|null)",selector:"(string|element)"};class ri extends xt{constructor(e){super(),this._config=this._getConfig(e)}static get Default(){return ei}static get DefaultType(){return ti}static get NAME(){return"TemplateFactory"}getContent(){return Object.values(this._config.content).map((e=>this._resolvePossibleFunction(e))).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(e){return this._checkContent(e),this._config.content={...this._config.content,...e},this}toHtml(){const e=document.createElement("div");e.innerHTML=this._maybeSanitize(this._config.template);for(const[t,n]of Object.entries(this._config.content))this._setContent(e,n,t);const t=e.children[0],n=this._resolvePossibleFunction(this._config.extraClass);return n&&t.classList.add(...n.split(" ")),t}_typeCheckConfig(e){super._typeCheckConfig(e),this._checkContent(e.content)}_checkContent(e){for(const[t,n]of Object.entries(e))super._typeCheckConfig({selector:t,entry:n},ni)}_setContent(e,t,n){const r=St.findOne(n,e);r&&((t=this._resolvePossibleFunction(t))?ze(t)?this._putElementInTemplate(Be(t),r):this._config.html?r.innerHTML=this._maybeSanitize(t):r.textContent=t:r.remove())}_maybeSanitize(e){return this._config.sanitize?function(e,t,n){if(!e.length)return e;if(n&&"function"==typeof n)return n(e);const r=(new window.DOMParser).parseFromString(e,"text/html"),i=[].concat(...r.body.querySelectorAll("*"));for(const e of i){const n=e.nodeName.toLowerCase();if(!Object.keys(t).includes(n)){e.remove();continue}const r=[].concat(...e.attributes),i=[].concat(t["*"]||[],t[n]||[]);for(const t of r)Gr(t,i)||e.removeAttribute(t.nodeName)}return r.body.innerHTML}(e,this._config.allowList,this._config.sanitizeFn):e}_resolvePossibleFunction(e){return Ge(e,[this])}_putElementInTemplate(e,t){if(this._config.html)return t.innerHTML="",void t.append(e);t.textContent=e.textContent}}const ii=new Set(["sanitize","allowList","sanitizeFn"]),oi="fade",si="show",ai=".modal",li="hide.bs.modal",ci="hover",ui="focus",fi={AUTO:"auto",TOP:"top",RIGHT:Ke()?"left":"right",BOTTOM:"bottom",LEFT:Ke()?"right":"left"},di={allowList:Ur,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'',title:"",trigger:"hover focus"},hi={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class pi extends Et{constructor(e,t){if(void 0===r)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(e,t),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return di}static get DefaultType(){return hi}static get NAME(){return"tooltip"}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),_t.off(this._element.closest(ai),li,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const e=_t.trigger(this._element,this.constructor.eventName("show")),t=(Qe(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(e.defaultPrevented||!t)return;this._disposePopper();const n=this._getTipElement();this._element.setAttribute("aria-describedby",n.getAttribute("id"));const{container:r}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(r.append(n),_t.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(n),n.classList.add(si),"ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))_t.on(e,"mouseover",Ze);this._queueCallback((()=>{_t.trigger(this._element,this.constructor.eventName("shown")),!1===this._isHovered&&this._leave(),this._isHovered=!1}),this.tip,this._isAnimated())}hide(){if(!this._isShown())return;if(_t.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented)return;if(this._getTipElement().classList.remove(si),"ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))_t.off(e,"mouseover",Ze);this._activeTrigger.click=!1,this._activeTrigger[ui]=!1,this._activeTrigger[ci]=!1,this._isHovered=null;this._queueCallback((()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),_t.trigger(this._element,this.constructor.eventName("hidden")))}),this.tip,this._isAnimated())}update(){this._popper&&this._popper.update()}_isWithContent(){return Boolean(this._getTitle())}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(e){const t=this._getTemplateFactory(e).toHtml();if(!t)return null;t.classList.remove(oi,si),t.classList.add(`bs-${this.constructor.NAME}-auto`);const n=(e=>{do{e+=Math.floor(1e6*Math.random())}while(document.getElementById(e));return e})(this.constructor.NAME).toString();return t.setAttribute("id",n),this._isAnimated()&&t.classList.add(oi),t}setContent(e){this._newContent=e,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(e){return this._templateFactory?this._templateFactory.changeContent(e):this._templateFactory=new ri({...this._config,content:e,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{".tooltip-inner":this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(e){return this.constructor.getOrCreateInstance(e.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(oi)}_isShown(){return this.tip&&this.tip.classList.contains(si)}_createPopper(e){const t=Ge(this._config.placement,[this,e,this._element]),n=fi[t.toUpperCase()];return Pe(this._element,e,this._getPopperConfig(n))}_getOffset(){const{offset:e}=this._config;return"string"==typeof e?e.split(",").map((e=>Number.parseInt(e,10))):"function"==typeof e?t=>e(t,this._element):e}_resolvePossibleFunction(e){return Ge(e,[this._element])}_getPopperConfig(e){const t={placement:e,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:e=>{this._getTipElement().setAttribute("data-popper-placement",e.state.placement)}}]};return{...t,...Ge(this._config.popperConfig,[t])}}_setListeners(){const e=this._config.trigger.split(" ");for(const t of e)if("click"===t)_t.on(this._element,this.constructor.eventName("click"),this._config.selector,(e=>{this._initializeOnDelegatedTarget(e).toggle()}));else if("manual"!==t){const e=t===ci?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),n=t===ci?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout");_t.on(this._element,e,this._config.selector,(e=>{const t=this._initializeOnDelegatedTarget(e);t._activeTrigger["focusin"===e.type?ui:ci]=!0,t._enter()})),_t.on(this._element,n,this._config.selector,(e=>{const t=this._initializeOnDelegatedTarget(e);t._activeTrigger["focusout"===e.type?ui:ci]=t._element.contains(e.relatedTarget),t._leave()}))}this._hideModalHandler=()=>{this._element&&this.hide()},_t.on(this._element.closest(ai),li,this._hideModalHandler)}_fixTitle(){const e=this._element.getAttribute("title");e&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",e),this._element.setAttribute("data-bs-original-title",e),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout((()=>{this._isHovered&&this.show()}),this._config.delay.show))}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout((()=>{this._isHovered||this.hide()}),this._config.delay.hide))}_setTimeout(e,t){clearTimeout(this._timeout),this._timeout=setTimeout(e,t)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(e){const t=wt.getDataAttributes(this._element);for(const e of Object.keys(t))ii.has(e)&&delete t[e];return e={...t,..."object"==typeof e&&e?e:{}},e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e.container=!1===e.container?document.body:Be(e.container),"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),"number"==typeof e.title&&(e.title=e.title.toString()),"number"==typeof e.content&&(e.content=e.content.toString()),e}_getDelegateConfig(){const e={};for(const[t,n]of Object.entries(this._config))this.constructor.Default[t]!==n&&(e[t]=n);return e.selector=!1,e.trigger="manual",e}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(e){return this.each((function(){const t=pi.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}}))}}Je(pi);const gi={...pi.Default,content:"",offset:[0,8],placement:"right",template:'',trigger:"click"},mi={...pi.DefaultType,content:"(null|string|element|function)"};class _i extends pi{static get Default(){return gi}static get DefaultType(){return mi}static get NAME(){return"popover"}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{".popover-header":this._getTitle(),".popover-body":this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(e){return this.each((function(){const t=_i.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}}))}}Je(_i);const vi=".bs.scrollspy",bi=`activate${vi}`,yi=`click${vi}`,wi=`load${vi}.data-api`,xi="active",Ei="[href]",Ai=".nav-link",Si=`${Ai}, .nav-item > ${Ai}, .list-group-item`,Ci={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},Ti={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class ki extends Et{constructor(e,t){super(e,t),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement="visible"===getComputedStyle(this._element).overflowY?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return Ci}static get DefaultType(){return Ti}static get NAME(){return"scrollspy"}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const e of this._observableSections.values())this._observer.observe(e)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(e){return e.target=Be(e.target)||document.body,e.rootMargin=e.offset?`${e.offset}px 0px -30%`:e.rootMargin,"string"==typeof e.threshold&&(e.threshold=e.threshold.split(",").map((e=>Number.parseFloat(e)))),e}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(_t.off(this._config.target,yi),_t.on(this._config.target,yi,Ei,(e=>{const t=this._observableSections.get(e.target.hash);if(t){e.preventDefault();const n=this._rootElement||window,r=t.offsetTop-this._element.offsetTop;if(n.scrollTo)return void n.scrollTo({top:r,behavior:"smooth"});n.scrollTop=r}})))}_getNewObserver(){const e={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver((e=>this._observerCallback(e)),e)}_observerCallback(e){const t=e=>this._targetLinks.get(`#${e.target.id}`),n=e=>{this._previousScrollData.visibleEntryTop=e.target.offsetTop,this._process(t(e))},r=(this._rootElement||document.documentElement).scrollTop,i=r>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=r;for(const o of e){if(!o.isIntersecting){this._activeTarget=null,this._clearActiveClass(t(o));continue}const e=o.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(i&&e){if(n(o),!r)return}else i||e||n(o)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const e=St.find(Ei,this._config.target);for(const t of e){if(!t.hash||Ye(t))continue;const e=St.findOne(decodeURI(t.hash),this._element);We(e)&&(this._targetLinks.set(decodeURI(t.hash),t),this._observableSections.set(t.hash,e))}}_process(e){this._activeTarget!==e&&(this._clearActiveClass(this._config.target),this._activeTarget=e,e.classList.add(xi),this._activateParents(e),_t.trigger(this._element,bi,{relatedTarget:e}))}_activateParents(e){if(e.classList.contains("dropdown-item"))St.findOne(".dropdown-toggle",e.closest(".dropdown")).classList.add(xi);else for(const t of St.parents(e,".nav, .list-group"))for(const e of St.prev(t,Si))e.classList.add(xi)}_clearActiveClass(e){e.classList.remove(xi);const t=St.find(`${Ei}.${xi}`,e);for(const e of t)e.classList.remove(xi)}static jQueryInterface(e){return this.each((function(){const t=ki.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]()}}))}}_t.on(window,wi,(()=>{for(const e of St.find('[data-bs-spy="scroll"]'))ki.getOrCreateInstance(e)})),Je(ki);const Oi=".bs.tab",Li=`hide${Oi}`,Ii=`hidden${Oi}`,Di=`show${Oi}`,Ni=`shown${Oi}`,Mi=`click${Oi}`,Pi=`keydown${Oi}`,qi=`load${Oi}`,$i="ArrowLeft",Ri="ArrowRight",Hi="ArrowUp",ji="ArrowDown",Fi="active",zi="fade",Bi="show",Wi=":not(.dropdown-toggle)",Yi='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',Qi=`${`.nav-link${Wi}, .list-group-item${Wi}, [role="tab"]${Wi}`}, ${Yi}`,Zi=`.${Fi}[data-bs-toggle="tab"], .${Fi}[data-bs-toggle="pill"], .${Fi}[data-bs-toggle="list"]`;class Xi extends Et{constructor(e){super(e),this._parent=this._element.closest('.list-group, .nav, [role="tablist"]'),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),_t.on(this._element,Pi,(e=>this._keydown(e))))}static get NAME(){return"tab"}show(){const e=this._element;if(this._elemIsActive(e))return;const t=this._getActiveElem(),n=t?_t.trigger(t,Li,{relatedTarget:e}):null;_t.trigger(e,Di,{relatedTarget:t}).defaultPrevented||n&&n.defaultPrevented||(this._deactivate(t,e),this._activate(e,t))}_activate(e,t){if(!e)return;e.classList.add(Fi),this._activate(St.getElementFromSelector(e));this._queueCallback((()=>{"tab"===e.getAttribute("role")?(e.removeAttribute("tabindex"),e.setAttribute("aria-selected",!0),this._toggleDropDown(e,!0),_t.trigger(e,Ni,{relatedTarget:t})):e.classList.add(Bi)}),e,e.classList.contains(zi))}_deactivate(e,t){if(!e)return;e.classList.remove(Fi),e.blur(),this._deactivate(St.getElementFromSelector(e));this._queueCallback((()=>{"tab"===e.getAttribute("role")?(e.setAttribute("aria-selected",!1),e.setAttribute("tabindex","-1"),this._toggleDropDown(e,!1),_t.trigger(e,Ii,{relatedTarget:t})):e.classList.remove(Bi)}),e,e.classList.contains(zi))}_keydown(e){if(![$i,Ri,Hi,ji].includes(e.key))return;e.stopPropagation(),e.preventDefault();const t=[Ri,ji].includes(e.key),n=tt(this._getChildren().filter((e=>!Ye(e))),e.target,t,!0);n&&(n.focus({preventScroll:!0}),Xi.getOrCreateInstance(n).show())}_getChildren(){return St.find(Qi,this._parent)}_getActiveElem(){return this._getChildren().find((e=>this._elemIsActive(e)))||null}_setInitialAttributes(e,t){this._setAttributeIfNotExists(e,"role","tablist");for(const e of t)this._setInitialAttributesOnChild(e)}_setInitialAttributesOnChild(e){e=this._getInnerElement(e);const t=this._elemIsActive(e),n=this._getOuterElement(e);e.setAttribute("aria-selected",t),n!==e&&this._setAttributeIfNotExists(n,"role","presentation"),t||e.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(e,"role","tab"),this._setInitialAttributesOnTargetPanel(e)}_setInitialAttributesOnTargetPanel(e){const t=St.getElementFromSelector(e);t&&(this._setAttributeIfNotExists(t,"role","tabpanel"),e.id&&this._setAttributeIfNotExists(t,"aria-labelledby",`${e.id}`))}_toggleDropDown(e,t){const n=this._getOuterElement(e);if(!n.classList.contains("dropdown"))return;const r=(e,r)=>{const i=St.findOne(e,n);i&&i.classList.toggle(r,t)};r(".dropdown-toggle",Fi),r(".dropdown-menu",Bi),n.setAttribute("aria-expanded",t)}_setAttributeIfNotExists(e,t,n){e.hasAttribute(t)||e.setAttribute(t,n)}_elemIsActive(e){return e.classList.contains(Fi)}_getInnerElement(e){return e.matches(Qi)?e:St.findOne(Qi,e)}_getOuterElement(e){return e.closest(".nav-item, .list-group-item")||e}static jQueryInterface(e){return this.each((function(){const t=Xi.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]()}}))}}_t.on(document,Mi,Yi,(function(e){["A","AREA"].includes(this.tagName)&&e.preventDefault(),Ye(this)||Xi.getOrCreateInstance(this).show()})),_t.on(window,qi,(()=>{for(const e of St.find(Zi))Xi.getOrCreateInstance(e)})),Je(Xi);const Vi=".bs.toast",Ui=`mouseover${Vi}`,Ki=`mouseout${Vi}`,Ji=`focusin${Vi}`,Gi=`focusout${Vi}`,eo=`hide${Vi}`,to=`hidden${Vi}`,no=`show${Vi}`,ro=`shown${Vi}`,io="hide",oo="show",so="showing",ao={animation:"boolean",autohide:"boolean",delay:"number"},lo={animation:!0,autohide:!0,delay:5e3};class co extends Et{constructor(e,t){super(e,t),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return lo}static get DefaultType(){return ao}static get NAME(){return"toast"}show(){if(_t.trigger(this._element,no).defaultPrevented)return;this._clearTimeout(),this._config.animation&&this._element.classList.add("fade");this._element.classList.remove(io),Xe(this._element),this._element.classList.add(oo,so),this._queueCallback((()=>{this._element.classList.remove(so),_t.trigger(this._element,ro),this._maybeScheduleHide()}),this._element,this._config.animation)}hide(){if(!this.isShown())return;if(_t.trigger(this._element,eo).defaultPrevented)return;this._element.classList.add(so),this._queueCallback((()=>{this._element.classList.add(io),this._element.classList.remove(so,oo),_t.trigger(this._element,to)}),this._element,this._config.animation)}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(oo),super.dispose()}isShown(){return this._element.classList.contains(oo)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout((()=>{this.hide()}),this._config.delay)))}_onInteraction(e,t){switch(e.type){case"mouseover":case"mouseout":this._hasMouseInteraction=t;break;case"focusin":case"focusout":this._hasKeyboardInteraction=t}if(t)return void this._clearTimeout();const n=e.relatedTarget;this._element===n||this._element.contains(n)||this._maybeScheduleHide()}_setListeners(){_t.on(this._element,Ui,(e=>this._onInteraction(e,!0))),_t.on(this._element,Ki,(e=>this._onInteraction(e,!1))),_t.on(this._element,Ji,(e=>this._onInteraction(e,!0))),_t.on(this._element,Gi,(e=>this._onInteraction(e,!1)))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(e){return this.each((function(){const t=co.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e](this)}}))}}function uo(e){e.querySelectorAll("form input[data-upload-progress-target]").forEach((function(e){e.addEventListener("change",(function(){var t=Array.from(e.files);if(t.length){var n=document.getElementById(e.dataset.uploadProgressTarget),r=e.closest("form"),i=document.querySelector("meta[name=csrf-token]").content;t.forEach((function(t,o){var s=document.getElementById("tmpl-upload-progress").content.firstElementChild.cloneNode(!0);s.querySelector(".upload-name").innerText=t.name,n.appendChild(s);var a=function(){var e=s.querySelector(".btn-cancel-upload");null!=e&&e.parentElement.removeChild(e)},l=function(){var e=s.querySelector(".btn-remove-upload");null!=e&&e.classList.remove("d-none")};s.querySelector(".btn-remove-upload").addEventListener("click",(function(){var e=this.closest(".list-group-item");e.parentElement.removeChild(e)}));var c=function(e,t){var n=s.querySelector(".upload-msg"),r="text-muted";"info"==t?r="text-muted":(t="error")&&(r="text-danger"),n.classList.remove("text-muted"),n.classList.add(r),n.innerText=e},u=function(e,t){var n="bg-info";"warning"==t?n="bg-warning":"error"==t&&(n="bg-danger"),e.classList.remove("bg-info"),e.classList.add(n)},f=e.dataset.uploadMaxFileSize;if(!isNaN(f)&&t.size>f)return a(),l(),c(e.dataset.uploadMsgFileTooLarge,"error"),void u(s.querySelector(".progress-bar"),"error");var d=[["X-CSRF-Token",i],["X-HTTP-Method-Override","POST"],["X-Upload-Filename",encodeURIComponent(t.name)],["Content-Type",t.type]],h=new XMLHttpRequest;h.addEventListener("abort",(function(t){c(e.dataset.uploadMsgFileAborted,"error"),u(s.querySelector(".progress-bar"),"error"),a(),l()}),!1),h.upload.addEventListener("progress",(function(t){if(t.lengthComputable){var n=Math.floor(t.loaded/t.total*100);s.querySelector(".upload-size").innerText=function(e){if(e<10)return e+" B";var t=Math.floor(Math.log(e)/Math.log(1e3)),n=fo[t],r=Math.floor(e/Math.pow(1e3,t)*10+.5)/10;if(r<10&&!Number.isInteger(r))return r.toFixed(1)+" "+n;return r.toFixed(0)+" "+n}(t.loaded),s.querySelector(".upload-percent").innerText=n;var r=s.querySelector(".progress-bar");r.style.width="".concat(n,"%"),r.setAttribute("aria-valuenow",n),t.loaded==t.total?(a(),c(e.dataset.uploadMsgFileProcessing,"info")):c(e.dataset.uploadMsgFileUploading,"info")}}),!1),h.addEventListener("readystatechange",(function(t){4===h.readyState&&(a(),200==h.status||201==h.status?(s.parentElement.removeChild(s),htmx.trigger("body","refresh-files")):413==h.status?(l(),c(e.dataset.uploadMsgFileTooLarge,"error"),u(s.querySelector(".progress-bar"),"error")):404==h.status?(l(),c(e.dataset.uploadMsgDirNotFound,"error"),u(s.querySelector(".progress-bar"),"error")):(l(),c(e.dataset.uploadMsgUnexpected,"error"),u(s.querySelector(".progress-bar"),"error")))})),h.open(r.method,r.action);for(var p=0;p