UNPKG

@selfcommunity/react-templates

Version:

React Templates Components to integrate a Community created with SelfCommunity.

2 lines • 2.99 MB
/*! For license information please see 234.js.LICENSE.txt */ (self.webpackChunkSelfCommunityReactTemplates=self.webpackChunkSelfCommunityReactTemplates||[]).push([[234],{9254(e,t,n){"use strict";n.r(t),n.d(t,{arrow:()=>Ie,autoPlacement:()=>xe,autoUpdate:()=>Ce,computePosition:()=>Ne,detectOverflow:()=>ke,flip:()=>Ae,getOverflowAncestors:()=>ce,hide:()=>Me,inline:()=>Re,limitShift:()=>De,offset:()=>Te,platform:()=>_e,shift:()=>Pe,size:()=>Oe});const r=["top","right","bottom","left"],i=["start","end"],o=r.reduce((e,t)=>e.concat(t,t+"-"+i[0],t+"-"+i[1]),[]),a=Math.min,s=Math.max,c=Math.round,l=Math.floor,u=e=>({x:e,y:e}),d={left:"right",right:"left",bottom:"top",top:"bottom"},f={start:"end",end:"start"};function h(e,t,n){return s(e,a(t,n))}function p(e,t){return"function"==typeof e?e(t):e}function m(e){return e.split("-")[0]}function g(e){return e.split("-")[1]}function v(e){return"x"===e?"y":"x"}function b(e){return"y"===e?"height":"width"}const y=new Set(["top","bottom"]);function w(e){return y.has(m(e))?"y":"x"}function S(e){return v(w(e))}function E(e,t,n){void 0===n&&(n=!1);const r=g(e),i=S(e),o=b(i);let a="x"===i?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=P(a)),[a,P(a)]}function _(e){return e.replace(/start|end/g,e=>f[e])}const C=["left","right"],k=["right","left"],T=["top","bottom"],x=["bottom","top"];function P(e){return e.replace(/left|right|bottom|top/g,e=>d[e])}function A(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function O(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function M(e,t,n){let{reference:r,floating:i}=e;const o=w(t),a=S(t),s=b(a),c=m(t),l="y"===o,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2;let h;switch(c){case"top":h={x:u,y:r.y-i.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-i.width,y:d};break;default:h={x:r.x,y:r.y}}switch(g(t)){case"start":h[a]-=f*(n&&l?-1:1);break;case"end":h[a]+=f*(n&&l?-1:1)}return h}async function I(e,t){var n;void 0===t&&(t={});const{x:r,y:i,platform:o,rects:a,elements:s,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=p(t,e),m=A(h),g=s[f?"floating"===d?"reference":"floating":d],v=O(await o.getClippingRect({element:null==(n=await(null==o.isElement?void 0:o.isElement(g)))||n?g:g.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(s.floating)),boundary:l,rootBoundary:u,strategy:c})),b="floating"===d?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,y=await(null==o.getOffsetParent?void 0:o.getOffsetParent(s.floating)),w=await(null==o.isElement?void 0:o.isElement(y))&&await(null==o.getScale?void 0:o.getScale(y))||{x:1,y:1},S=O(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:b,offsetParent:y,strategy:c}):b);return{top:(v.top-S.top+m.top)/w.y,bottom:(S.bottom-v.bottom+m.bottom)/w.y,left:(v.left-S.left+m.left)/w.x,right:(S.right-v.right+m.right)/w.x}}function R(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function D(e){return r.some(t=>e[t]>=0)}function N(e){const t=a(...e.map(e=>e.left)),n=a(...e.map(e=>e.top));return{x:t,y:n,width:s(...e.map(e=>e.right))-t,height:s(...e.map(e=>e.bottom))-n}}const L=new Set(["left","top"]);function F(){return"undefined"!=typeof window}function $(e){return U(e)?(e.nodeName||"").toLowerCase():"#document"}function j(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function B(e){var t;return null==(t=(U(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function U(e){return!!F()&&(e instanceof Node||e instanceof j(e).Node)}function z(e){return!!F()&&(e instanceof Element||e instanceof j(e).Element)}function H(e){return!!F()&&(e instanceof HTMLElement||e instanceof j(e).HTMLElement)}function W(e){return!(!F()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof j(e).ShadowRoot)}const V=new Set(["inline","contents"]);function G(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=ie(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!V.has(i)}const K=new Set(["table","td","th"]);function q(e){return K.has($(e))}const Y=[":popover-open",":modal"];function J(e){return Y.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const X=["transform","translate","scale","rotate","perspective"],Q=["transform","translate","scale","rotate","perspective","filter"],Z=["paint","layout","strict","content"];function ee(e){const t=te(),n=z(e)?ie(e):e;return X.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||Q.some(e=>(n.willChange||"").includes(e))||Z.some(e=>(n.contain||"").includes(e))}function te(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const ne=new Set(["html","body","#document"]);function re(e){return ne.has($(e))}function ie(e){return j(e).getComputedStyle(e)}function oe(e){return z(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ae(e){if("html"===$(e))return e;const t=e.assignedSlot||e.parentNode||W(e)&&e.host||B(e);return W(t)?t.host:t}function se(e){const t=ae(e);return re(t)?e.ownerDocument?e.ownerDocument.body:e.body:H(t)&&G(t)?t:se(t)}function ce(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const i=se(e),o=i===(null==(r=e.ownerDocument)?void 0:r.body),a=j(i);if(o){const e=le(a);return t.concat(a,a.visualViewport||[],G(i)?i:[],e&&n?ce(e):[])}return t.concat(i,ce(i,[],n))}function le(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ue(e){const t=ie(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=H(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,s=c(n)!==o||c(r)!==a;return s&&(n=o,r=a),{width:n,height:r,$:s}}function de(e){return z(e)?e:e.contextElement}function fe(e){const t=de(e);if(!H(t))return u(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=ue(t);let a=(o?c(n.width):n.width)/r,s=(o?c(n.height):n.height)/i;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const he=u(0);function pe(e){const t=j(e);return te()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:he}function me(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const i=e.getBoundingClientRect(),o=de(e);let a=u(1);t&&(r?z(r)&&(a=fe(r)):a=fe(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==j(e))&&t}(o,n,r)?pe(o):u(0);let c=(i.left+s.x)/a.x,l=(i.top+s.y)/a.y,d=i.width/a.x,f=i.height/a.y;if(o){const e=j(o),t=r&&z(r)?j(r):r;let n=e,i=le(n);for(;i&&r&&t!==n;){const e=fe(i),t=i.getBoundingClientRect(),r=ie(i),o=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,d*=e.x,f*=e.y,c+=o,l+=a,n=j(i),i=le(n)}}return O({width:d,height:f,x:c,y:l})}function ge(e,t){const n=oe(e).scrollLeft;return t?t.left+n:me(B(e)).left+n}function ve(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=j(e),r=B(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,c=0;if(i){o=i.width,a=i.height;const e=te();(!e||e&&"fixed"===t)&&(s=i.offsetLeft,c=i.offsetTop)}return{width:o,height:a,x:s,y:c}}(e,n);else if("document"===t)r=function(e){const t=B(e),n=oe(e),r=e.ownerDocument.body,i=s(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=s(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+ge(e);const c=-n.scrollTop;return"rtl"===ie(r).direction&&(a+=s(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:c}}(B(e));else if(z(t))r=function(e,t){const n=me(e,!0,"fixed"===t),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=H(e)?fe(e):u(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:i*o.x,y:r*o.y}}(t,n);else{const n=pe(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return O(r)}function be(e,t){const n=ae(e);return!(n===t||!z(n)||re(n))&&("fixed"===ie(n).position||be(n,t))}function ye(e,t,n){const r=H(t),i=B(t),o="fixed"===n,a=me(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const c=u(0);if(r||!r&&!o)if(("body"!==$(t)||G(i))&&(s=oe(t)),r){const e=me(t,!0,o,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&(c.x=ge(i));let l=0,d=0;if(i&&!r&&!o){const e=i.getBoundingClientRect();d=e.top+s.scrollTop,l=e.left+s.scrollLeft-ge(i,e)}return{x:a.left+s.scrollLeft-c.x-l,y:a.top+s.scrollTop-c.y-d,width:a.width,height:a.height}}function we(e){return"static"===ie(e).position}function Se(e,t){if(!H(e)||"fixed"===ie(e).position)return null;if(t)return t(e);let n=e.offsetParent;return B(e)===n&&(n=n.ownerDocument.body),n}function Ee(e,t){const n=j(e);if(J(e))return n;if(!H(e)){let t=ae(e);for(;t&&!re(t);){if(z(t)&&!we(t))return t;t=ae(t)}return n}let r=Se(e,t);for(;r&&q(r)&&we(r);)r=Se(r,t);return r&&re(r)&&we(r)&&!ee(r)?n:r||function(e){let t=ae(e);for(;H(t)&&!re(t);){if(ee(t))return t;if(J(t))return null;t=ae(t)}return null}(e)||n}const _e={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o="fixed"===i,a=B(r),s=!!t&&J(t.floating);if(r===a||s&&o)return n;let c={scrollLeft:0,scrollTop:0},l=u(1);const d=u(0),f=H(r);if((f||!f&&!o)&&(("body"!==$(r)||G(a))&&(c=oe(r)),H(r))){const e=me(r);l=fe(r),d.x=e.x+r.clientLeft,d.y=e.y+r.clientTop}return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+d.x,y:n.y*l.y-c.scrollTop*l.y+d.y}},getDocumentElement:B,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[..."clippingAncestors"===n?J(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=ce(e,[],!1).filter(e=>z(e)&&"body"!==$(e)),i=null;const o="fixed"===ie(e).position;let a=o?ae(e):e;for(;z(a)&&!re(a);){const t=ie(a),n=ee(a);n||"fixed"!==t.position||(i=null),(o?!n&&!i:!n&&"static"===t.position&&i&&["absolute","fixed"].includes(i.position)||G(a)&&!n&&be(e,a))?r=r.filter(e=>e!==a):i=t,a=ae(a)}return t.set(e,r),r}(t,this._c):[].concat(n),r],c=o[0],l=o.reduce((e,n)=>{const r=ve(t,n,i);return e.top=s(r.top,e.top),e.right=a(r.right,e.right),e.bottom=a(r.bottom,e.bottom),e.left=s(r.left,e.left),e},ve(t,c,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:Ee,getElementRects:async function(e){const t=this.getOffsetParent||Ee,n=this.getDimensions,r=await n(e.floating);return{reference:ye(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=ue(e);return{width:t,height:n}},getScale:fe,isElement:z,isRTL:function(e){return"rtl"===ie(e).direction}};function Ce(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:c="function"==typeof ResizeObserver,layoutShift:u="function"==typeof IntersectionObserver,animationFrame:d=!1}=r,f=de(e),h=i||o?[...f?ce(f):[],...ce(t)]:[];h.forEach(e=>{i&&e.addEventListener("scroll",n,{passive:!0}),o&&e.addEventListener("resize",n)});const p=f&&u?function(e,t){let n,r=null;const i=B(e);function o(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function c(u,d){void 0===u&&(u=!1),void 0===d&&(d=1),o();const{left:f,top:h,width:p,height:m}=e.getBoundingClientRect();if(u||t(),!p||!m)return;const g={rootMargin:-l(h)+"px "+-l(i.clientWidth-(f+p))+"px "+-l(i.clientHeight-(h+m))+"px "+-l(f)+"px",threshold:s(0,a(1,d))||1};let v=!0;function b(e){const t=e[0].intersectionRatio;if(t!==d){if(!v)return c();t?c(!1,t):n=setTimeout(()=>{c(!1,1e-7)},1e3)}v=!1}try{r=new IntersectionObserver(b,{...g,root:i.ownerDocument})}catch(e){r=new IntersectionObserver(b,g)}r.observe(e)}(!0),o}(f,n):null;let m,g=-1,v=null;c&&(v=new ResizeObserver(e=>{let[r]=e;r&&r.target===f&&v&&(v.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var e;null==(e=v)||e.observe(t)})),n()}),f&&!d&&v.observe(f),v.observe(t));let b=d?me(e):null;return d&&function t(){const r=me(e);!b||r.x===b.x&&r.y===b.y&&r.width===b.width&&r.height===b.height||n(),b=r,m=requestAnimationFrame(t)}(),n(),()=>{var e;h.forEach(e=>{i&&e.removeEventListener("scroll",n),o&&e.removeEventListener("resize",n)}),null==p||p(),null==(e=v)||e.disconnect(),v=null,d&&cancelAnimationFrame(m)}}const ke=I,Te=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:a,middlewareData:s}=t,c=await async function(e,t){const{placement:n,platform:r,elements:i}=e,o=await(null==r.isRTL?void 0:r.isRTL(i.floating)),a=m(n),s=g(n),c="y"===w(n),l=L.has(a)?-1:1,u=o&&c?-1:1,d=p(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:v}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof v&&(h="end"===s?-1*v:v),c?{x:h*u,y:f*l}:{x:f*l,y:h*u}}(t,e);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:i+c.x,y:o+c.y,data:{...c,placement:a}}}}},xe=function(e){return void 0===e&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,r,i;const{rects:a,middlewareData:s,placement:c,platform:l,elements:u}=t,{crossAxis:d=!1,alignment:f,allowedPlacements:h=o,autoAlignment:v=!0,...b}=p(e,t),y=void 0!==f||h===o?function(e,t,n){return(e?[...n.filter(t=>g(t)===e),...n.filter(t=>g(t)!==e)]:n.filter(e=>m(e)===e)).filter(n=>!e||g(n)===e||!!t&&_(n)!==n)}(f||null,v,h):h,w=await l.detectOverflow(t,b),S=(null==(n=s.autoPlacement)?void 0:n.index)||0,C=y[S];if(null==C)return{};const k=E(C,a,await(null==l.isRTL?void 0:l.isRTL(u.floating)));if(c!==C)return{reset:{placement:y[0]}};const T=[w[m(C)],w[k[0]],w[k[1]]],x=[...(null==(r=s.autoPlacement)?void 0:r.overflows)||[],{placement:C,overflows:T}],P=y[S+1];if(P)return{data:{index:S+1,overflows:x},reset:{placement:P}};const A=x.map(e=>{const t=g(e.placement);return[e.placement,t&&d?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),O=(null==(i=A.filter(e=>e[2].slice(0,g(e[0])?2:3).every(e=>e<=0))[0])?void 0:i[0])||A[0][0];return O!==c?{data:{index:S+1,overflows:x},reset:{placement:O}}:{}}}},Pe=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i,platform:o}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=p(e,t),u={x:n,y:r},d=await o.detectOverflow(t,l),f=w(m(i)),g=v(f);let b=u[g],y=u[f];if(a){const e="y"===g?"bottom":"right";b=h(b+d["y"===g?"top":"left"],b,b-d[e])}if(s){const e="y"===f?"bottom":"right";y=h(y+d["y"===f?"top":"left"],y,y-d[e])}const S=c.fn({...t,[g]:b,[f]:y});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[g]:a,[f]:s}}}}}},Ae=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:a,initialPlacement:s,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:b=!0,...y}=p(e,t);if(null!=(n=o.arrow)&&n.alignmentOffset)return{};const S=m(i),A=w(s),O=m(s)===s,M=await(null==c.isRTL?void 0:c.isRTL(l.floating)),I=f||(O||!b?[P(s)]:function(e){const t=P(e);return[_(e),t,_(t)]}(s)),R="none"!==v;!f&&R&&I.push(...function(e,t,n,r){const i=g(e);let o=function(e,t,n){switch(e){case"top":case"bottom":return n?t?k:C:t?C:k;case"left":case"right":return t?T:x;default:return[]}}(m(e),"start"===n,r);return i&&(o=o.map(e=>e+"-"+i),t&&(o=o.concat(o.map(_)))),o}(s,b,v,M));const D=[s,...I],N=await c.detectOverflow(t,y),L=[];let F=(null==(r=o.flip)?void 0:r.overflows)||[];if(u&&L.push(N[S]),d){const e=E(i,a,M);L.push(N[e[0]],N[e[1]])}if(F=[...F,{placement:i,overflows:L}],!L.every(e=>e<=0)){var $,j;const e=((null==($=o.flip)?void 0:$.index)||0)+1,t=D[e];if(t&&("alignment"!==d||A===w(t)||F.every(e=>w(e.placement)!==A||e.overflows[0]>0)))return{data:{index:e,overflows:F},reset:{placement:t}};let n=null==(j=F.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:j.placement;if(!n)switch(h){case"bestFit":{var B;const e=null==(B=F.filter(e=>{if(R){const t=w(e.placement);return t===A||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:B[0];e&&(n=e);break}case"initialPlacement":n=s}if(i!==n)return{reset:{placement:n}}}return{}}}},Oe=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:c,elements:l}=t,{apply:u=()=>{},...d}=p(e,t),f=await c.detectOverflow(t,d),h=m(i),v=g(i),b="y"===w(i),{width:y,height:S}=o.floating;let E,_;"top"===h||"bottom"===h?(E=h,_=v===(await(null==c.isRTL?void 0:c.isRTL(l.floating))?"start":"end")?"left":"right"):(_=h,E="end"===v?"top":"bottom");const C=S-f.top-f.bottom,k=y-f.left-f.right,T=a(S-f[E],C),x=a(y-f[_],k),P=!t.middlewareData.shift;let A=T,O=x;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(O=k),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(A=C),P&&!v){const e=s(f.left,0),t=s(f.right,0),n=s(f.top,0),r=s(f.bottom,0);b?O=y-2*(0!==e||0!==t?e+t:s(f.left,f.right)):A=S-2*(0!==n||0!==r?n+r:s(f.top,f.bottom))}await u({...t,availableWidth:O,availableHeight:A});const M=await c.getDimensions(l.floating);return y!==M.width||S!==M.height?{reset:{rects:!0}}:{}}}},Me=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:i="referenceHidden",...o}=p(e,t);switch(i){case"referenceHidden":{const e=R(await r.detectOverflow(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:D(e)}}}case"escaped":{const e=R(await r.detectOverflow(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:D(e)}}}default:return{}}}}},Ie=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:s,elements:c,middlewareData:l}=t,{element:u,padding:d=0}=p(e,t)||{};if(null==u)return{};const f=A(d),m={x:n,y:r},v=S(i),y=b(v),w=await s.getDimensions(u),E="y"===v,_=E?"top":"left",C=E?"bottom":"right",k=E?"clientHeight":"clientWidth",T=o.reference[y]+o.reference[v]-m[v]-o.floating[y],x=m[v]-o.reference[v],P=await(null==s.getOffsetParent?void 0:s.getOffsetParent(u));let O=P?P[k]:0;O&&await(null==s.isElement?void 0:s.isElement(P))||(O=c.floating[k]||o.floating[y]);const M=T/2-x/2,I=O/2-w[y]/2-1,R=a(f[_],I),D=a(f[C],I),N=R,L=O-w[y]-D,F=O/2-w[y]/2+M,$=h(N,F,L),j=!l.arrow&&null!=g(i)&&F!==$&&o.reference[y]/2-(F<N?R:D)-w[y]/2<0,B=j?F<N?F-N:F-L:0;return{[v]:m[v]+B,data:{[v]:$,centerOffset:F-$-B,...j&&{alignmentOffset:B}},reset:j}}}),Re=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:i,platform:o,strategy:c}=t,{padding:l=2,x:u,y:d}=p(e,t),f=Array.from(await(null==o.getClientRects?void 0:o.getClientRects(r.reference))||[]),h=function(e){const t=e.slice().sort((e,t)=>e.y-t.y),n=[];let r=null;for(let e=0;e<t.length;e++){const i=t[e];!r||i.y-r.y>r.height/2?n.push([i]):n[n.length-1].push(i),r=i}return n.map(e=>O(N(e)))}(f),g=O(N(f)),v=A(l),b=await o.getElementRects({reference:{getBoundingClientRect:function(){if(2===h.length&&h[0].left>h[1].right&&null!=u&&null!=d)return h.find(e=>u>e.left-v.left&&u<e.right+v.right&&d>e.top-v.top&&d<e.bottom+v.bottom)||g;if(h.length>=2){if("y"===w(n)){const e=h[0],t=h[h.length-1],r="top"===m(n),i=e.top,o=t.bottom,a=r?e.left:t.left,s=r?e.right:t.right;return{top:i,bottom:o,left:a,right:s,width:s-a,height:o-i,x:a,y:i}}const e="left"===m(n),t=s(...h.map(e=>e.right)),r=a(...h.map(e=>e.left)),i=h.filter(n=>e?n.left===r:n.right===t),o=i[0].top,c=i[i.length-1].bottom;return{top:o,bottom:c,left:r,right:t,width:t-r,height:c-o,x:r,y:o}}return g}},floating:r.floating,strategy:c});return i.reference.x!==b.reference.x||i.reference.y!==b.reference.y||i.reference.width!==b.reference.width||i.reference.height!==b.reference.height?{reset:{rects:b}}:{}}}},De=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=p(e,t),u={x:n,y:r},d=w(i),f=v(d);let h=u[f],g=u[d];const b=p(s,t),y="number"==typeof b?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(c){const e="y"===f?"height":"width",t=o.reference[f]-o.floating[e]+y.mainAxis,n=o.reference[f]+o.reference[e]-y.mainAxis;h<t?h=t:h>n&&(h=n)}if(l){var S,E;const e="y"===f?"width":"height",t=L.has(m(i)),n=o.reference[d]-o.floating[e]+(t&&(null==(S=a.offset)?void 0:S[d])||0)+(t?0:y.crossAxis),r=o.reference[d]+o.reference[e]+(t?0:(null==(E=a.offset)?void 0:E[d])||0)-(t?y.crossAxis:0);g<n?g=n:g>r&&(g=r)}return{[f]:h,[d]:g}}}},Ne=(e,t,n)=>{const r=new Map,i={platform:_e,...n},o={...i.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=o.filter(Boolean),c=await(null==a.isRTL?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=M(l,r,c),f=r,h={},p=0;for(let n=0;n<s.length;n++){var m;const{name:o,fn:g}=s[n],{x:v,y:b,data:y,reset:w}=await g({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:h,rects:l,platform:{...a,detectOverflow:null!=(m=a.detectOverflow)?m:I},elements:{reference:e,floating:t}});u=null!=v?v:u,d=null!=b?b:d,h={...h,[o]:{...h[o],...y}},w&&p<=50&&(p++,"object"==typeof w&&(w.placement&&(f=w.placement),w.rects&&(l=!0===w.rects?await a.getElementRects({reference:e,floating:t,strategy:i}):w.rects),({x:u,y:d}=M(l,f,c))),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:h}})(e,t,{...i,platform:o})}},56708(e,t,n){"use strict";n.r(t),n.d(t,{DragDropContext:()=>hr,Draggable:()=>xr,Droppable:()=>qr,useKeyboardSensor:()=>Jn,useMouseSensor:()=>Kn,useTouchSensor:()=>Qn});var r=n(39155),i=n.n(r),o=n(69514),a=n.n(o);function s(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var c=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),l=()=>Math.random().toString(36).substring(7).split("").join("."),u={INIT:`@@redux/INIT${l()}`,REPLACE:`@@redux/REPLACE${l()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${l()}`};function d(e,t,n){if("function"!=typeof e)throw new Error(s(2));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(s(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(s(1));return n(d)(e,t)}let r=e,i=t,o=new Map,a=o,l=0,f=!1;function h(){a===o&&(a=new Map,o.forEach((e,t)=>{a.set(t,e)}))}function p(){if(f)throw new Error(s(3));return i}function m(e){if("function"!=typeof e)throw new Error(s(4));if(f)throw new Error(s(5));let t=!0;h();const n=l++;return a.set(n,e),function(){if(t){if(f)throw new Error(s(6));t=!1,h(),a.delete(n),o=null}}}function g(e){if(!function(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}(e))throw new Error(s(7));if(void 0===e.type)throw new Error(s(8));if("string"!=typeof e.type)throw new Error(s(17));if(f)throw new Error(s(9));try{f=!0,i=r(i,e)}finally{f=!1}return(o=a).forEach(e=>{e()}),e}return g({type:u.INIT}),{dispatch:g,subscribe:m,getState:p,replaceReducer:function(e){if("function"!=typeof e)throw new Error(s(10));r=e,g({type:u.REPLACE})},[c]:function(){const e=m;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(s(11));function n(){const e=t;e.next&&e.next(p())}return n(),{unsubscribe:e(n)}},[c](){return this}}}}}function f(e,t){return function(...n){return t(e.apply(this,n))}}function h(e,t){if("function"==typeof e)return f(e,t);if("object"!=typeof e||null===e)throw new Error(s(16));const n={};for(const r in e){const i=e[r];"function"==typeof i&&(n[r]=f(i,t))}return n}function p(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}var m=n(12148),g=function(e){var t=e.top,n=e.right,r=e.bottom,i=e.left;return{top:t,right:n,bottom:r,left:i,width:n-i,height:r-t,x:i,y:t,center:{x:(n+i)/2,y:(r+t)/2}}},v=function(e,t){return{top:e.top-t.top,left:e.left-t.left,bottom:e.bottom+t.bottom,right:e.right+t.right}},b=function(e,t){return{top:e.top+t.top,left:e.left+t.left,bottom:e.bottom-t.bottom,right:e.right-t.right}},y={top:0,right:0,bottom:0,left:0},w=function(e){var t=e.borderBox,n=e.margin,r=void 0===n?y:n,i=e.border,o=void 0===i?y:i,a=e.padding,s=void 0===a?y:a,c=g(v(t,r)),l=g(b(t,o)),u=g(b(l,s));return{marginBox:c,borderBox:g(t),paddingBox:l,contentBox:u,margin:r,border:o,padding:s}},S=function(e){var t=e.slice(0,-2);if("px"!==e.slice(-2))return 0;var n=Number(t);return isNaN(n)&&function(){throw new Error("Invariant failed")}(),n},E=function(e,t){var n,r,i=e.borderBox,o=e.border,a=e.margin,s=e.padding,c=(r=t,{top:(n=i).top+r.y,left:n.left+r.x,bottom:n.bottom+r.y,right:n.right+r.x});return w({borderBox:c,border:o,margin:a,padding:s})},_=function(e,t){return void 0===t&&(t={x:window.pageXOffset,y:window.pageYOffset}),E(e,t)},C=function(e,t){var n={top:S(t.marginTop),right:S(t.marginRight),bottom:S(t.marginBottom),left:S(t.marginLeft)},r={top:S(t.paddingTop),right:S(t.paddingRight),bottom:S(t.paddingBottom),left:S(t.paddingLeft)},i={top:S(t.borderTopWidth),right:S(t.borderRightWidth),bottom:S(t.borderBottomWidth),left:S(t.borderLeftWidth)};return w({borderBox:e,margin:n,padding:r,border:i})},k=function(e){var t=e.getBoundingClientRect(),n=window.getComputedStyle(e);return C(t,n)};const T=function(e){var t=[],n=null,r=function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];t=i,n||(n=requestAnimationFrame(function(){n=null,e.apply(void 0,t)}))};return r.cancel=function(){n&&(cancelAnimationFrame(n),n=null)},r};function x(){return x=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},x.apply(null,arguments)}function P(e,t){}function A(){}function O(e,t,n){const r=t.map(t=>{const r=(i=n,o=t.options,{...i,...o});var i,o;return e.addEventListener(t.eventName,t.fn,r),function(){e.removeEventListener(t.eventName,t.fn,r)}});return function(){r.forEach(e=>{e()})}}P.bind(null,"warn"),P.bind(null,"error");class M extends Error{}function I(e,t){throw new M("Invariant failed")}M.prototype.toString=function(){return this.message};class R extends i().Component{constructor(...e){super(...e),this.callbacks=null,this.unbind=A,this.onWindowError=e=>{const t=this.getCallbacks();t.isDragging()&&t.tryAbort(),e.error instanceof M&&e.preventDefault()},this.getCallbacks=()=>{if(!this.callbacks)throw new Error("Unable to find AppCallbacks in <ErrorBoundary/>");return this.callbacks},this.setCallbacks=e=>{this.callbacks=e}}componentDidMount(){this.unbind=O(window,[{eventName:"error",fn:this.onWindowError}])}componentDidCatch(e){if(!(e instanceof M))throw e;this.setState({})}componentWillUnmount(){this.unbind()}render(){return this.props.children(this.setCallbacks)}}const D=e=>e+1,N=(e,t)=>{const n=e.droppableId===t.droppableId,r=D(e.index),i=D(t.index);return n?`\n You have moved the item from position ${r}\n to position ${i}\n `:`\n You have moved the item from position ${r}\n in list ${e.droppableId}\n to list ${t.droppableId}\n in position ${i}\n `},L=(e,t,n)=>t.droppableId===n.droppableId?`\n The item ${e}\n has been combined with ${n.draggableId}`:`\n The item ${e}\n in list ${t.droppableId}\n has been combined with ${n.draggableId}\n in list ${n.droppableId}\n `,F=e=>`\n The item has returned to its starting position\n of ${D(e.index)}\n`,$="\n Press space bar to start a drag.\n When dragging you can use the arrow keys to move the item around and escape to cancel.\n Some screen readers may require you to be in focus mode or to use your pass through key\n",j=e=>`\n You have lifted an item in position ${D(e.source.index)}\n`,B=e=>{const t=e.destination;if(t)return N(e.source,t);const n=e.combine;return n?L(e.draggableId,e.source,n):"You are over an area that cannot be dropped on"},U=e=>{if("CANCEL"===e.reason)return`\n Movement cancelled.\n ${F(e.source)}\n `;const t=e.destination,n=e.combine;return t?`\n You have dropped the item.\n ${N(e.source,t)}\n `:n?`\n You have dropped the item.\n ${L(e.draggableId,e.source,n)}\n `:`\n The item has been dropped while not over a drop area.\n ${F(e.source)}\n `};function z(e,t){return e===t||!(!Number.isNaN(e)||!Number.isNaN(t))}function H(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!z(e[n],t[n]))return!1;return!0}function W(e,t){const n=(0,r.useState)(()=>({inputs:t,result:e()}))[0],i=(0,r.useRef)(!0),o=(0,r.useRef)(n),a=i.current||Boolean(t&&o.current.inputs&&H(t,o.current.inputs))?o.current:{inputs:t,result:e()};return(0,r.useEffect)(()=>{i.current=!1,o.current=a},[a]),a.result}function V(e,t){return W(()=>e,t)}const G={x:0,y:0},K=(e,t)=>({x:e.x+t.x,y:e.y+t.y}),q=(e,t)=>({x:e.x-t.x,y:e.y-t.y}),Y=(e,t)=>e.x===t.x&&e.y===t.y,J=e=>({x:0!==e.x?-e.x:0,y:0!==e.y?-e.y:0}),X=(e,t,n=0)=>"x"===e?{x:t,y:n}:{x:n,y:t},Q=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),Z=(e,t)=>Math.min(...t.map(t=>Q(e,t))),ee=e=>t=>({x:e(t.x),y:e(t.y)}),te=(e,t)=>({top:e.top+t.y,left:e.left+t.x,bottom:e.bottom+t.y,right:e.right+t.x}),ne=e=>[{x:e.left,y:e.top},{x:e.right,y:e.top},{x:e.left,y:e.bottom},{x:e.right,y:e.bottom}],re=(e,t)=>t&&t.shouldClipSubject?((e,t)=>{const n=g({top:Math.max(t.top,e.top),right:Math.min(t.right,e.right),bottom:Math.min(t.bottom,e.bottom),left:Math.max(t.left,e.left)});return n.width<=0||n.height<=0?null:n})(t.pageMarginBox,e):g(e);var ie=({page:e,withPlaceholder:t,axis:n,frame:r})=>{const i=((e,t)=>t?te(e,t.scroll.diff.displacement):e)(e.marginBox,r),o=((e,t,n)=>n&&n.increasedBy?{...e,[t.end]:e[t.end]+n.increasedBy[t.line]}:e)(i,n,t);return{page:e,withPlaceholder:t,active:re(o,r)}},oe=(e,t)=>{e.frame||I();const n=e.frame,r=q(t,n.scroll.initial),i=J(r),o={...n,scroll:{initial:n.scroll.initial,current:t,diff:{value:r,displacement:i},max:n.scroll.max}},a=ie({page:e.subject.page,withPlaceholder:e.subject.withPlaceholder,axis:e.axis,frame:o});return{...e,frame:o,subject:a}};function ae(e,t=H){let n=null;function r(...r){if(n&&n.lastThis===this&&t(r,n.lastArgs))return n.lastResult;const i=e.apply(this,r);return n={lastResult:i,lastArgs:r,lastThis:this},i}return r.clear=function(){n=null},r}const se=ae(e=>e.reduce((e,t)=>(e[t.descriptor.id]=t,e),{})),ce=ae(e=>e.reduce((e,t)=>(e[t.descriptor.id]=t,e),{})),le=ae(e=>Object.values(e)),ue=ae(e=>Object.values(e));var de=ae((e,t)=>{const n=ue(t).filter(t=>e===t.descriptor.droppableId).sort((e,t)=>e.descriptor.index-t.descriptor.index);return n});function fe(e){return e.at&&"REORDER"===e.at.type?e.at.destination:null}function he(e){return e.at&&"COMBINE"===e.at.type?e.at.combine:null}var pe=ae((e,t)=>t.filter(t=>t.descriptor.id!==e.descriptor.id)),me=(e,t)=>e.descriptor.droppableId===t.descriptor.id;const ge={point:G,value:0},ve={invisible:{},visible:{},all:[]},be={displaced:ve,displacedBy:ge,at:null};var ye=(e,t)=>n=>e<=n&&n<=t,we=e=>{const t=ye(e.top,e.bottom),n=ye(e.left,e.right);return r=>{if(t(r.top)&&t(r.bottom)&&n(r.left)&&n(r.right))return!0;const i=t(r.top)||t(r.bottom),o=n(r.left)||n(r.right);if(i&&o)return!0;const a=r.top<e.top&&r.bottom>e.bottom,s=r.left<e.left&&r.right>e.right;return!(!a||!s)||(a&&o||s&&i)}},Se=e=>{const t=ye(e.top,e.bottom),n=ye(e.left,e.right);return e=>t(e.top)&&t(e.bottom)&&n(e.left)&&n(e.right)};const Ee={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},_e={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"},Ce=({target:e,destination:t,viewport:n,withDroppableDisplacement:r,isVisibleThroughFrameFn:i})=>{const o=r?((e,t)=>{const n=t.frame?t.frame.scroll.diff.displacement:G;return te(e,n)})(e,t):e;return((e,t,n)=>!!t.subject.active&&n(t.subject.active)(e))(o,t,i)&&((e,t,n)=>n(t)(e))(o,n,i)},ke=e=>Ce({...e,isVisibleThroughFrameFn:Se});function Te({afterDragging:e,destination:t,displacedBy:n,viewport:r,forceShouldAnimate:i,last:o}){return e.reduce(function(e,a){const s=function(e,t){const n=e.page.marginBox,r={top:t.point.y,right:0,bottom:0,left:t.point.x};return g(v(n,r))}(a,n),c=a.descriptor.id;var l;if(e.all.push(c),l={target:s,destination:t,viewport:r,withDroppableDisplacement:!0},!Ce({...l,isVisibleThroughFrameFn:we}))return e.invisible[a.descriptor.id]=!0,e;const u=((e,t,n)=>{if("boolean"==typeof n)return n;if(!t)return!0;const{invisible:r,visible:i}=t;if(r[e])return!1;const o=i[e];return!o||o.shouldAnimate})(c,o,i),d={draggableId:c,shouldAnimate:u};return e.visible[c]=d,e},{all:[],visible:{},invisible:{}})}function xe({insideDestination:e,inHomeList:t,displacedBy:n,destination:r}){const i=function(e,t){if(!e.length)return 0;const n=e[e.length-1].descriptor.index;return t.inHomeList?n:n+1}(e,{inHomeList:t});return{displaced:ve,displacedBy:n,at:{type:"REORDER",destination:{droppableId:r.descriptor.id,index:i}}}}function Pe({draggable:e,insideDestination:t,destination:n,viewport:r,displacedBy:i,last:o,index:a,forceShouldAnimate:s}){const c=me(e,n);if(null==a)return xe({insideDestination:t,inHomeList:c,displacedBy:i,destination:n});const l=t.find(e=>e.descriptor.index===a);if(!l)return xe({insideDestination:t,inHomeList:c,displacedBy:i,destination:n});const u=pe(e,t),d=t.indexOf(l);return{displaced:Te({afterDragging:u.slice(d),destination:n,displacedBy:i,last:o,viewport:r.frame,forceShouldAnimate:s}),displacedBy:i,at:{type:"REORDER",destination:{droppableId:n.descriptor.id,index:a}}}}function Ae(e,t){return Boolean(t.effected[e])}const Oe=(e,t)=>t.margin[e.start]+t.borderBox[e.size]/2,Me=(e,t,n)=>t[e.crossAxisStart]+n.margin[e.crossAxisStart]+n.borderBox[e.crossAxisSize]/2,Ie=({axis:e,moveRelativeTo:t,isMoving:n})=>X(e.line,t.marginBox[e.end]+Oe(e,n),Me(e,t.marginBox,n)),Re=({axis:e,moveRelativeTo:t,isMoving:n})=>X(e.line,t.marginBox[e.start]-((e,t)=>t.margin[e.end]+t.borderBox[e.size]/2)(e,n),Me(e,t.marginBox,n));var De=(e,t)=>{const n=e.frame;return n?K(t,n.scroll.diff.displacement):t},Ne=e=>{const t=(({impact:e,draggable:t,droppable:n,draggables:r,afterCritical:i})=>{const o=t.page.borderBox.center,a=e.at;return n&&a?"REORDER"===a.type?(({impact:e,draggable:t,draggables:n,droppable:r,afterCritical:i})=>{const o=de(r.descriptor.id,n),a=t.page,s=r.axis;if(!o.length)return(({axis:e,moveInto:t,isMoving:n})=>X(e.line,t.contentBox[e.start]+Oe(e,n),Me(e,t.contentBox,n)))({axis:s,moveInto:r.page,isMoving:a});const{displaced:c,displacedBy:l}=e,u=c.all[0];if(u){const e=n[u];if(Ae(u,i))return Re({axis:s,moveRelativeTo:e.page,isMoving:a});const t=E(e.page,l.point);return Re({axis:s,moveRelativeTo:t,isMoving:a})}const d=o[o.length-1];if(d.descriptor.id===t.descriptor.id)return a.borderBox.center;if(Ae(d.descriptor.id,i)){const e=E(d.page,J(i.displacedBy.point));return Ie({axis:s,moveRelativeTo:e,isMoving:a})}return Ie({axis:s,moveRelativeTo:d.page,isMoving:a})})({impact:e,draggable:t,draggables:r,droppable:n,afterCritical:i}):(({afterCritical:e,impact:t,draggables:n})=>{const r=he(t);r||I();const i=r.draggableId,o=n[i].page.borderBox.center,a=(({displaced:e,afterCritical:t,combineWith:n,displacedBy:r})=>{const i=Boolean(e.visible[n]||e.invisible[n]);return Ae(n,t)?i?G:J(r.point):i?r.point:G})({displaced:t.displaced,afterCritical:e,combineWith:i,displacedBy:t.displacedBy});return K(o,a)})({impact:e,draggables:r,afterCritical:i}):o})(e),n=e.droppable;return n?De(n,t):t},Le=(e,t)=>{const n=q(t,e.scroll.initial),r=J(n);return{frame:g({top:t.y,bottom:t.y+e.frame.height,left:t.x,right:t.x+e.frame.width}),scroll:{initial:e.scroll.initial,max:e.scroll.max,current:t,diff:{value:n,displacement:r}}}};function Fe(e,t){return e.map(e=>t[e])}var $e=({pageBorderBoxCenter:e,draggable:t,viewport:n})=>{const r=((e,t)=>K(e.scroll.diff.displacement,t))(n,e),i=q(r,t.page.borderBox.center);return K(t.client.borderBox.center,i)},je=({draggable:e,destination:t,newPageBorderBoxCenter:n,viewport:r,withDroppableDisplacement:i,onlyOnMainAxis:o=!1})=>{const a=q(n,e.page.borderBox.center),s={target:te(e.page.borderBox,a),destination:t,withDroppableDisplacement:i,viewport:r};return o?(e=>{return Ce({...e,isVisibleThroughFrameFn:(t=e.destination.axis,e=>{const n=ye(e.top,e.bottom),r=ye(e.left,e.right);return e=>t===Ee?n(e.top)&&n(e.bottom):r(e.left)&&r(e.right)})});var t})(s):ke(s)},Be=({isMovingForward:e,draggable:t,destination:n,draggables:r,previousImpact:i,viewport:o,previousPageBorderBoxCenter:a,previousClientSelection:s,afterCritical:c})=>{if(!n.isEnabled)return null;const l=de(n.descriptor.id,r),u=me(t,n),d=(({isMovingForward:e,draggable:t,destination:n,insideDestination:r,previousImpact:i})=>{if(!n.isCombineEnabled)return null;if(!fe(i))return null;function o(e){const t={type:"COMBINE",combine:{draggableId:e,droppableId:n.descriptor.id}};return{...i,at:t}}const a=i.displaced.all,s=a.length?a[0]:null;if(e)return s?o(s):null;const c=pe(t,r);if(!s)return c.length?o(c[c.length-1].descriptor.id):null;const l=c.findIndex(e=>e.descriptor.id===s);-1===l&&I();const u=l-1;return u<0?null:o(c[u].descriptor.id)})({isMovingForward:e,draggable:t,destination:n,insideDestination:l,previousImpact:i})||(({isMovingForward:e,isInHomeList:t,draggable:n,draggables:r,destination:i,insideDestination:o,previousImpact:a,viewport:s,afterCritical:c})=>{const l=a.at;if(l||I(),"REORDER"===l.type){const r=(({isMovingForward:e,isInHomeList:t,insideDestination:n,location:r})=>{if(!n.length)return null;const i=r.index,o=e?i+1:i-1,a=n[0].descriptor.index,s=n[n.length-1].descriptor.index;return o<a||o>(t?s:s+1)?null:o})({isMovingForward:e,isInHomeList:t,location:l.destination,insideDestination:o});return null==r?null:Pe({draggable:n,insideDestination:o,destination:i,viewport:s,last:a.displaced,displacedBy:a.displacedBy,index:r})}const u=(({isMovingForward:e,destination:t,draggables:n,combine:r,afterCritical:i})=>{if(!t.isCombineEnabled)return null;const o=r.draggableId,a=n[o].descriptor.index;return Ae(o,i)?e?a:a-1:e?a+1:a})({isMovingForward:e,destination:i,displaced:a.displaced,draggables:r,combine:l.combine,afterCritical:c});return null==u?null:Pe({draggable:n,insideDestination:o,destination:i,viewport:s,last:a.displaced,displacedBy:a.displacedBy,index:u})})({isMovingForward:e,isInHomeList:u,draggable:t,draggables:r,destination:n,insideDestination:l,previousImpact:i,viewport:o,afterCritical:c});if(!d)return null;const f=Ne({impact:d,draggable:t,droppable:n,draggables:r,afterCritical:c});if(je({draggable:t,destination:n,newPageBorderBoxCenter:f,viewport:o.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0}))return{clientSelection:$e({pageBorderBoxCenter:f,draggable:t,viewport:o}),impact:d,scrollJumpRequest:null};const h=q(f,a),p=(({impact:e,viewport:t,destination:n,draggables:r,maxScrollChange:i})=>{const o=Le(t,K(t.scroll.current,i)),a=n.frame?oe(n,K(n.frame.scroll.current,i)):n,s=e.displaced,c=Te({afterDragging:Fe(s.all,r),destination:n,displacedBy:e.displacedBy,viewport:o.frame,last:s,forceShouldAnimate:!1}),l=Te({afterDragging:Fe(s.all,r),destination:a,displacedBy:e.displacedBy,viewport:t.frame,last:s,forceShouldAnimate:!1}),u={},d={},f=[s,c,l];return s.all.forEach(e=>{const t=function(e,t){for(let n=0;n<t.length;n++){const r=t[n].visible[e];if(r)return r}return null}(e,f);t?d[e]=t:u[e]=!0}),{...e,displaced:{all:s.all,invisible:u,visible:d}}})({impact:d,viewport:o,destination:n,draggables:r,maxScrollChange:h});return{clientSelection:s,impact:p,scrollJumpRequest:h}};const Ue=e=>{const t=e.subject.active;return t||I(),t},ze=(e,t)=>{const n=e.page.borderBox.center;return Ae(e.descriptor.id,t)?q(n,t.displacedBy.point):n},He=(e,t)=>{const n=e.page.borderBox;return Ae(e.descriptor.id,t)?te(n,J(t.displacedBy.point)):n};var We=ae(function(e,t){const n=t[e.line];return{value:n,point:X(e.line,n)}});const Ve=(e,t)=>({...e,scroll:{...e.scroll,max:t}}),Ge=(e,t,n)=>{const r=e.frame;me(t,e)&&I(),e.subject.withPlaceholder&&I();const i=We(e.axis,t.displaceBy).point,o=((e,t,n)=>{const r=e.axis;if("virtual"===e.descriptor.mode)return X(r.line,t[r.line]);const i=e.subject.page.contentBox[r.size],o=de(e.descriptor.id,n).reduce((e,t)=>e+t.client.marginBox[r.size],0)+t[r.line]-i;return o<=0?null:X(r.line,o)})(e,i,n),a={placeholderSize:i,increasedBy:o,oldFrameMaxScroll:e.frame?e.frame.scroll.max:null};if(!r){const t=ie({page:e.subject.page,withPlaceholder:a,axis:e.axis,frame:e.frame});return{...e,subject:t}}const s=o?K(r.scroll.max,o):r.scroll.max,c=Ve(r,s),l=ie({page:e.subject.page,withPlaceholder:a,axis:e.axis,frame:c});return{...e,subject:l,frame:c}};var Ke=e=>{const t=e.at;return t?"REORDER"===t.type?t.destination.droppableId:t.combine.droppableId:null},qe=({state:e,type:t})=>{const n=((e,t)=>{const n=Ke(e);return n?t[n]:null})(e.impact,e.dimensions.droppables),r=Boolean(n),i=e.dimensions.droppables[e.critical.droppable.id],o=n||i,a=o.axis.direction,s="vertical"===a&&("MOVE_UP"===t||"MOVE_DOWN"===t)||"horizontal"===a&&("MOVE_LEFT"===t||"MOVE_RIGHT"===t);if(s&&!r)return null;const c="MOVE_DOWN"===t||"MOVE_RIGHT"===t,l=e.dimensions.draggables[e.critical.draggable.id],u=e.current.page.borderBoxCenter,{draggables:d,droppables:f}=e.dimensions;return s?Be({isMovingForward:c,previousPageBorderBoxCenter:u,draggable:l,destination:o,draggables:d,viewport:e.viewport,previousClientSelection:e.current.client.selection,previousImpact:e.impact,afterCritical:e.afterCritical}):(({isMovingForward:e,previousPageBorderBoxCenter:t,draggable:n,isOver:r,draggables:i,droppables:o,viewport:a,afterCritical:s})=>{const c=(({isMovingForward:e,pageBorderBoxCenter:t,source:n,droppables:r,viewport:i})=>{const o=n.subject.active;if(!o)return null;const a=n.axis,s=ye(o[a.start],o[a.end]),c=le(r).filter(e=>e!==n).filter(e=>e.isEnabled).filter(e=>Boolean(e.subject.active)).filter(e=>we(i.frame)(Ue(e))).filter(t=>{const n=Ue(t);return e?o[a.crossAxisEnd]<n[a.crossAxisEnd]:n[a.crossAxisStart]<o[a.crossAxisStart]}).filter(e=>{const t=Ue(e),n=ye(t[a.start],t[a.end]);return s(t[a.start])||s(t[a.end])||n(o[a.start])||n(o[a.end])}).sort((t,n)=>{const r=Ue(t)[a.crossAxisStart],i=Ue(n)[a.crossAxisStart];return e?r-i:i-r}).filter((e,t,n)=>Ue(e)[a.crossAxisStart]===Ue(n[0])[a.crossAxisStart]);if(!c.length)return null;if(1===c.length)return c[0];const l=c.filter(e=>ye(Ue(e)[a.start],Ue(e)[a.end])(t[a.line]));return 1===l.length?l[0]:l.length>1?l.sort((e,t)=>Ue(e)[a.start]-Ue(t)[a.start])[0]:c.sort((e,n)=>{const r=Z(t,ne(Ue(e))),i=Z(t,ne(Ue(n)));return r!==i?r-i:Ue(e)[a.start]-Ue(n)[a.start]})[0]})({isMovingForward:e,pageBorderBoxCenter:t,source:r,droppables:o,viewport:a});if(!c)return null;const l=de(c.descriptor.id,i),u=(({pageBorderBoxCenter:e,viewport:t,destination:n,insideDestination:r,afterCritical:i})=>{const o=r.filter(e=>ke({target:He(e,i),destination:n,viewport:t.frame,withDroppableDisplacement:!0})).sort((t,r)=>{const o=Q(e,De(n,ze(t,i))),a=Q(e,De(n,ze(r,i)));return o<a?-1:a<o?1:t.descriptor.index-r.descriptor.index});return o[0]||null})({pageBorderBoxCenter:t,viewport:a,destination:c,insideDestination:l,afterCritical:s}),d=(({previousPageBorderBoxCenter:e,moveRelativeTo:t,insideDestination:n,draggable:r,draggables:i,destination:o,viewport:a,afterCritical:s})=>{if(!t){if(n.length)return null;const e={displaced:ve,displacedBy:ge,at:{type:"REORDER",destination:{droppableId:o.descriptor.id,index:0}}},t=Ne({impact:e,draggable:r,droppable:o,draggables:i,afterCritical:s}),c=me(r,o)?o:Ge(o,r,i);return je({draggable:r,destination:c,newPageBorderBoxCenter:t,viewport:a.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0})?e:null}const c=Boolean(e[o.axis.line]<=t.page.borderBox.center[o.axis.line]),l=(()=>{const e=t.descriptor.index;return t.descriptor.id===r.descriptor.id||c?e:e+1})(),u=We(o.axis,r.displaceBy);return Pe({draggable:r,insideDestination:n,destination:o,viewport:a,displacedBy:u,last:ve,index:l})})({previousPageBorderBoxCenter:t,destination:c,draggable:n,draggables:i,moveRelativeTo:u,insideDestination:l,viewport:a,afterCritical:s});if(!d)return null;const f=Ne({impact:d,draggable:n,droppable:c,draggables:i,afterCritical:s});return{clientSelection:$e({pageBorderBoxCenter:f,draggable:n,viewport:a}),impact:d,scrollJumpRequest:null}})({isMovingForward:c,previousPageBorderBoxCenter:u,draggable:l,isOver:o,draggables:d,droppables:f,viewport:e.viewport,afterCritical:e.afterCritical})};function Ye(e){return"DRAGGING"===e.phase||"COLLECTING"===e.phase}function Je(e){const t=ye(e.top,e.bottom),n=ye(e.left,e.right);return function(e){return t(e.y)&&n(e.x)}}const Xe=(e,t)=>g(te(e,t));function Qe({displaced:e,id:t}){return Boolean(e.visible[t]||e.invisible[t])}var Ze=({pageOffset:e,draggable:t,draggables:n,droppables:r,previousImpact:i,viewport:o,afterCritical:a})=>{const s=Xe(t.page.borderBox,e),c=function({pageBorderBox:e,draggable:t,droppables:n}){const r=le(n).filter(t=>{if(!t.isEnabled)return!1;const n=t.subject.active;if(!n)return!1;if(i=n,!((r=e).left<i.right&&r.right>i.left&&r.top<i.bottom&&r.bottom>i.top))return!1;var r,i;if(Je(n)(e.center))return!0;const o=t.axis,a=n.center[o.crossAxisLine],s=e[o.crossAxisStart],c=e[o.crossAxisEnd],l=ye(n[o.crossAxisStart],n[o.crossAxisEnd]),u=l(s),d=l(c);return!u&&!d||(u?s<a:c>a)});return r.length?1===r.length?r[0].descriptor.id:function({pageBorderBox:e,draggable:t,candidates:n}){const r=t.page.borderBox.center,i=n.map(t=>{const n=t.axis,i=X(t.axis.line,e.center[n.line],t.page.borderBox.center[n.crossAxisLine]);return{id:t.descriptor.id,distance:Q(r,i)}}).sort((e,t)=>t.distance-e.distance);return i[0]?i[0].id:null}({pageBorderBox:e,draggable:t,candidates:r}):null}({pageBorderBox:s,draggable:t,droppables:r});if(!c)return be;const l=r[c],u=de(l.descriptor.id,n),d=((e,t)=>{const n=e.frame;return n?Xe(t,n.scroll.diff.value):t})(l,s);return(({draggable:e,pageBorderBoxWithDroppableScroll:t,previousImpact:n,destination:r,insideDestination:i,afterCritical:o})=>{if(!r.isCombineEnabled)return null;const a=r.axis,s=We(r.axis,e.displaceBy),c=s.value,l=t[a.start],u=t[a.end],d=pe(e,i).find(e=>{const t=e.descriptor.id,r=e.page.borderBox,i=r[a.size]/4,s=Ae(t,o),d=Qe({displaced:n.displaced,id:t});return s?d?u>r[a.start]+i&&u<r[a.end]-i:l>r[a.start]-c+i&&l<r[a.end]-c-i:d?u>r[a.start]+c+i&&u<r[a.end]+c-i:l>r[a.start]+i&&l<r[a.end]-i});return d?{displacedBy:s,displaced:n.displaced,at:{type:"COMBINE",combine:{draggableId:d.descriptor.id,droppableId:r.descriptor.id}}}:null})({pageBorderBoxWithDroppableScroll:d,draggable:t,previousImpact:i,destination:l,insideDestination:u,afterCritical:a})||(({pageBorderBoxWithDroppableScroll:e,draggable:t,destination:n,insideDestination:r,last:i,viewport:o,afterCritical:a})=>{const s=n.axis,c=We(n.axis,t.displaceBy),l=c.value,u=e[s.start],d=e[s.end],f=function({draggable:e,closest:t,inHomeList:n}){return t?n&&t.descriptor.index>e.descriptor.index?t.descriptor.index-1:t.descriptor.index:null}({draggable:t,closest:pe(t,r).find(e=>{const t=e.descriptor.id,n=e.page.borderBox.center[s.line],r=Ae(t,a),o=Qe({displaced:i,id:t});return r?o?d<=n:u<n-l:o?d<=n+l:u<n})||null,inHomeList:me(t,n)});return Pe({draggable:t,insideDestination:r,destination:n,viewport:o,last:i,displacedBy:c,index:f})})({pageBorderBoxWithDroppableScroll:d,draggable:t,destination:l,insideDestination:u,last:i.displaced,viewport:o,afterCritical:a})},et=(e,t)=>({...e,[t.descriptor.id]:t});var tt=({state:e,clientSelection:t,dimensions:n,viewport:r,impact:i,scrollJumpRequest:o})=>{const a=r||e.viewport,s=n||e.dimensions,c=t||e.current.client.selection,l=q(c,e.initial.client.selection),u={offset:l,selection:c,borderBoxCenter:K(e.initial.client.borderBoxCenter,l)},d={selection:K(u.selection,a.scroll.current),borderBoxCenter:K(u.borderBoxCenter,a.scroll.current),offset:K(u.offset,a.scroll.diff.value)},f={client:u,page:d};if("COLLECTING"===e.phase)return{...e,dimensions:s,viewport:a,current:f};const h=s.draggables[e.critical.draggable.id],p=i||Ze({pageOffset:d.offset,draggable:h,draggables:s.draggables,droppables:s.droppables,previousImpact:e.impact,viewport:a,afterCritical:e.afterCritical}),m=(({draggable:e,draggables:t,droppables:n,previousImpact:r,impact:i})=>{const o=(({previousImpact:e,impact:t,droppables:n})=>{const r=Ke(e),i=Ke(t);if(!r)return n;if(r===i)return n;const o=n[r];if(!o.subject.withPlaceholder)return n;const a=(e=>{const t=e.subject.withPlaceholder;t||I();const n=e.frame;if(!n){const t=ie({page:e.subject.page,axis:e.axis,frame:null,withPlaceholder:null});return{...e,subject:t}}const r=t.oldFrameMaxScroll;r||I();const i=Ve(n,r),o=ie({page:e.subject.page,axis:e.axis,frame:i,withPlaceholder:null});return{...e,subject:o,frame:i}})(o);return et(n,a)})({previousImpact:r,impact:i,droppables:n}),a=Ke(i);if(!a)return o;const s=n[a];if(me(e,s))return o;if(s.subject.withPlaceholder)return o;const c=Ge(s,e,t);return et(o,c)})({draggable:h,impact:p,previousImpact:e.impact,draggables:s.draggables,droppables:s.droppables});return{...e,current:f,dimensions:{draggables:s.draggables,droppables:m},impact:p,viewport:a,scrollJumpRequest:o||null,forceShouldAnimate:!o&&null}},nt=({impact:e,viewport:t,draggables:n,destination:r,forceShouldAnimate:i})=>{const o=e.displaced,a=function(e,t){return e.map(e=>t[e])}(o.all,n),s=Te({afterDragging:a,destination:r,displacedBy:e.displacedBy,viewport:t.frame,forceShouldAnimate:i,last:o});return{...e,displaced:s}},rt=({impact:e,draggable:t,drop