@wilow_app/design-system 0.1.4 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(Q,v){typeof exports=="object"&&typeof module<"u"?v(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],v):(Q=typeof globalThis<"u"?globalThis:Q||self,v(Q["my-react-component"]={},Q.jsxRuntime,Q.React,Q.ReactDOM))})(this,function(Q,v,D,it){"use strict";function Bo(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const _=Bo(D);function G(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 Vo=typeof Symbol=="function"&&Symbol.observable||"@@observable",vn=Vo,yn=()=>Math.random().toString(36).substring(7).split("").join("."),Lo={INIT:`@@redux/INIT${yn()}`,REPLACE:`@@redux/REPLACE${yn()}`},En=Lo;function Ro(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function Mo(e){if(e===void 0)return"undefined";if(e===null)return"null";const t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(ko(e))return"date";if(Go(e))return"error";const n=$o(e);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return Object.prototype.toString.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"")}function $o(e){return typeof e.constructor=="function"?e.constructor.name:null}function Go(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function ko(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function ee(e){let t=typeof e;return process.env.NODE_ENV!=="production"&&(t=Mo(e)),t}function Dn(e,t,n){if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?G(2):`Expected the root reducer to be a function. Instead, received: '${ee(e)}'`);if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?G(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(process.env.NODE_ENV==="production"?G(1):`Expected the enhancer to be a function. Instead, received: '${ee(n)}'`);return n(Dn)(e,t)}let r=e,o=t,i=new Map,s=i,c=0,a=!1;function d(){s===i&&(s=new Map,i.forEach((h,E)=>{s.set(E,h)}))}function p(){if(a)throw new Error(process.env.NODE_ENV==="production"?G(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return o}function l(h){if(typeof h!="function")throw new Error(process.env.NODE_ENV==="production"?G(4):`Expected the listener to be a function. Instead, received: '${ee(h)}'`);if(a)throw new Error(process.env.NODE_ENV==="production"?G(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");let E=!0;d();const y=c++;return s.set(y,h),function(){if(E){if(a)throw new Error(process.env.NODE_ENV==="production"?G(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");E=!1,d(),s.delete(y),i=null}}}function u(h){if(!Ro(h))throw new Error(process.env.NODE_ENV==="production"?G(7):`Actions must be plain objects. Instead, the actual type was: '${ee(h)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);if(typeof h.type>"u")throw new Error(process.env.NODE_ENV==="production"?G(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(typeof h.type!="string")throw new Error(process.env.NODE_ENV==="production"?G(17):`Action "type" property must be a string. Instead, the actual type was: '${ee(h.type)}'. Value was: '${h.type}' (stringified)`);if(a)throw new Error(process.env.NODE_ENV==="production"?G(9):"Reducers may not dispatch actions.");try{a=!0,o=r(o,h)}finally{a=!1}return(i=s).forEach(y=>{y()}),h}function g(h){if(typeof h!="function")throw new Error(process.env.NODE_ENV==="production"?G(10):`Expected the nextReducer to be a function. Instead, received: '${ee(h)}`);r=h,u({type:En.REPLACE})}function m(){const h=l;return{subscribe(E){if(typeof E!="object"||E===null)throw new Error(process.env.NODE_ENV==="production"?G(11):`Expected the observer to be an object. Instead, received: '${ee(E)}'`);function y(){const I=E;I.next&&I.next(p())}return y(),{unsubscribe:h(y)}},[vn](){return this}}}return u({type:En.INIT}),{dispatch:u,subscribe:l,getState:p,replaceReducer:g,[vn]:m}}function Nn(e,t){return function(...n){return t(e.apply(this,n))}}function xn(e,t){if(typeof e=="function")return Nn(e,t);if(typeof e!="object"||e===null)throw new Error(process.env.NODE_ENV==="production"?G(16):`bindActionCreators expected an object or a function, but instead received: '${ee(e)}'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?`);const n={};for(const r in e){const o=e[r];typeof o=="function"&&(n[r]=Nn(o,t))}return n}function In(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function Fo(...e){return t=>(n,r)=>{const o=t(n,r);let i=()=>{throw new Error(process.env.NODE_ENV==="production"?G(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")};const s={getState:o.getState,dispatch:(a,...d)=>i(a,...d)},c=e.map(a=>a(s));return i=In(...c)(o.dispatch),{...o,dispatch:i}}}var st={};/**
1
+ (function(Q,v){typeof exports=="object"&&typeof module<"u"?v(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],v):(Q=typeof globalThis<"u"?globalThis:Q||self,v(Q["my-react-component"]={},Q.jsxRuntime,Q.React,Q.ReactDOM))})(this,function(Q,v,D,it){"use strict";function Po(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const _=Po(D);function G(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 To=typeof Symbol=="function"&&Symbol.observable||"@@observable",vn=To,yn=()=>Math.random().toString(36).substring(7).split("").join("."),Bo={INIT:`@@redux/INIT${yn()}`,REPLACE:`@@redux/REPLACE${yn()}`},En=Bo;function Vo(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function Lo(e){if(e===void 0)return"undefined";if(e===null)return"null";const t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if($o(e))return"date";if(Mo(e))return"error";const n=Ro(e);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return Object.prototype.toString.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"")}function Ro(e){return typeof e.constructor=="function"?e.constructor.name:null}function Mo(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function $o(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function ee(e){let t=typeof e;return process.env.NODE_ENV!=="production"&&(t=Lo(e)),t}function Dn(e,t,n){if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?G(2):`Expected the root reducer to be a function. Instead, received: '${ee(e)}'`);if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?G(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(process.env.NODE_ENV==="production"?G(1):`Expected the enhancer to be a function. Instead, received: '${ee(n)}'`);return n(Dn)(e,t)}let r=e,o=t,i=new Map,s=i,c=0,a=!1;function d(){s===i&&(s=new Map,i.forEach((m,E)=>{s.set(E,m)}))}function p(){if(a)throw new Error(process.env.NODE_ENV==="production"?G(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return o}function l(m){if(typeof m!="function")throw new Error(process.env.NODE_ENV==="production"?G(4):`Expected the listener to be a function. Instead, received: '${ee(m)}'`);if(a)throw new Error(process.env.NODE_ENV==="production"?G(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");let E=!0;d();const y=c++;return s.set(y,m),function(){if(E){if(a)throw new Error(process.env.NODE_ENV==="production"?G(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");E=!1,d(),s.delete(y),i=null}}}function u(m){if(!Vo(m))throw new Error(process.env.NODE_ENV==="production"?G(7):`Actions must be plain objects. Instead, the actual type was: '${ee(m)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);if(typeof m.type>"u")throw new Error(process.env.NODE_ENV==="production"?G(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(typeof m.type!="string")throw new Error(process.env.NODE_ENV==="production"?G(17):`Action "type" property must be a string. Instead, the actual type was: '${ee(m.type)}'. Value was: '${m.type}' (stringified)`);if(a)throw new Error(process.env.NODE_ENV==="production"?G(9):"Reducers may not dispatch actions.");try{a=!0,o=r(o,m)}finally{a=!1}return(i=s).forEach(y=>{y()}),m}function g(m){if(typeof m!="function")throw new Error(process.env.NODE_ENV==="production"?G(10):`Expected the nextReducer to be a function. Instead, received: '${ee(m)}`);r=m,u({type:En.REPLACE})}function h(){const m=l;return{subscribe(E){if(typeof E!="object"||E===null)throw new Error(process.env.NODE_ENV==="production"?G(11):`Expected the observer to be an object. Instead, received: '${ee(E)}'`);function y(){const I=E;I.next&&I.next(p())}return y(),{unsubscribe:m(y)}},[vn](){return this}}}return u({type:En.INIT}),{dispatch:u,subscribe:l,getState:p,replaceReducer:g,[vn]:h}}function Nn(e,t){return function(...n){return t(e.apply(this,n))}}function xn(e,t){if(typeof e=="function")return Nn(e,t);if(typeof e!="object"||e===null)throw new Error(process.env.NODE_ENV==="production"?G(16):`bindActionCreators expected an object or a function, but instead received: '${ee(e)}'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?`);const n={};for(const r in e){const o=e[r];typeof o=="function"&&(n[r]=Nn(o,t))}return n}function In(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function Go(...e){return t=>(n,r)=>{const o=t(n,r);let i=()=>{throw new Error(process.env.NODE_ENV==="production"?G(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")};const s={getState:o.getState,dispatch:(a,...d)=>i(a,...d)},c=e.map(a=>a(s));return i=In(...c)(o.dispatch),{...o,dispatch:i}}}var st={};/**
2
2
  * @license React
3
3
  * use-sync-external-store-with-selector.production.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var Sn;function Wo(){if(Sn)return st;Sn=1;var e=D;function t(a,d){return a===d&&(a!==0||1/a===1/d)||a!==a&&d!==d}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,o=e.useRef,i=e.useEffect,s=e.useMemo,c=e.useDebugValue;return st.useSyncExternalStoreWithSelector=function(a,d,p,l,u){var g=o(null);if(g.current===null){var m={hasValue:!1,value:null};g.current=m}else m=g.current;g=s(function(){function h(N){if(!E){if(E=!0,y=N,N=l(N),u!==void 0&&m.hasValue){var S=m.value;if(u(S,N))return C=S}return C=N}if(S=C,n(y,N))return S;var A=l(N);return u!==void 0&&u(S,A)?(y=N,S):(y=N,C=A)}var E=!1,y,C,I=p===void 0?null:p;return[function(){return h(d())},I===null?void 0:function(){return h(I())}]},[d,p,l,u]);var b=r(a,g[0],g[1]);return i(function(){m.hasValue=!0,m.value=b},[b]),c(b),b},st}var ct={};/**
9
+ */var Cn;function ko(){if(Cn)return st;Cn=1;var e=D;function t(a,d){return a===d&&(a!==0||1/a===1/d)||a!==a&&d!==d}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,o=e.useRef,i=e.useEffect,s=e.useMemo,c=e.useDebugValue;return st.useSyncExternalStoreWithSelector=function(a,d,p,l,u){var g=o(null);if(g.current===null){var h={hasValue:!1,value:null};g.current=h}else h=g.current;g=s(function(){function m(N){if(!E){if(E=!0,y=N,N=l(N),u!==void 0&&h.hasValue){var C=h.value;if(u(C,N))return S=C}return S=N}if(C=S,n(y,N))return C;var A=l(N);return u!==void 0&&u(C,A)?(y=N,C):(y=N,S=A)}var E=!1,y,S,I=p===void 0?null:p;return[function(){return m(d())},I===null?void 0:function(){return m(I())}]},[d,p,l,u]);var b=r(a,g[0],g[1]);return i(function(){h.hasValue=!0,h.value=b},[b]),c(b),b},st}var ct={};/**
10
10
  * @license React
11
11
  * use-sync-external-store-with-selector.development.js
12
12
  *
@@ -14,24 +14,24 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var Cn;function Uo(){return Cn||(Cn=1,process.env.NODE_ENV!=="production"&&function(){function e(a,d){return a===d&&(a!==0||1/a===1/d)||a!==a&&d!==d}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=D,n=typeof Object.is=="function"?Object.is:e,r=t.useSyncExternalStore,o=t.useRef,i=t.useEffect,s=t.useMemo,c=t.useDebugValue;ct.useSyncExternalStoreWithSelector=function(a,d,p,l,u){var g=o(null);if(g.current===null){var m={hasValue:!1,value:null};g.current=m}else m=g.current;g=s(function(){function h(N){if(!E){if(E=!0,y=N,N=l(N),u!==void 0&&m.hasValue){var S=m.value;if(u(S,N))return C=S}return C=N}if(S=C,n(y,N))return S;var A=l(N);return u!==void 0&&u(S,A)?(y=N,S):(y=N,C=A)}var E=!1,y,C,I=p===void 0?null:p;return[function(){return h(d())},I===null?void 0:function(){return h(I())}]},[d,p,l,u]);var b=r(a,g[0],g[1]);return i(function(){m.hasValue=!0,m.value=b},[b]),c(b),b},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),ct}process.env.NODE_ENV==="production"?Wo():Uo();var On=_.version.startsWith("19"),Ho=Symbol.for(On?"react.transitional.element":"react.element"),zo=Symbol.for("react.portal"),wn=Symbol.for("react.fragment"),_n=Symbol.for("react.strict_mode"),An=Symbol.for("react.profiler"),at=Symbol.for("react.consumer"),lt=Symbol.for("react.context"),dt=Symbol.for("react.forward_ref"),Pn=Symbol.for("react.suspense"),Tn=Symbol.for("react.suspense_list"),Me=Symbol.for("react.memo"),Bn=Symbol.for("react.lazy"),qo=Symbol.for("react.offscreen"),jo=Symbol.for("react.client.reference"),Yo=dt,Xo=Me;function Ko(e){return typeof e=="string"||typeof e=="function"||e===wn||e===An||e===_n||e===Pn||e===Tn||e===qo||typeof e=="object"&&e!==null&&(e.$$typeof===Bn||e.$$typeof===Me||e.$$typeof===lt||e.$$typeof===at||e.$$typeof===dt||e.$$typeof===jo||e.getModuleId!==void 0)}function ut(e){if(typeof e=="object"&&e!==null){const{$$typeof:t}=e;switch(t){case Ho:switch(e=e.type,e){case wn:case An:case _n:case Pn:case Tn:return e;default:switch(e=e&&e.$$typeof,e){case lt:case dt:case Bn:case Me:return e;case at:return e;default:return t}}case zo:return t}}}function Jo(e){return On?ut(e)===at:ut(e)===lt}function Zo(e){return ut(e)===Me}function pt(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function ft(e,t){if(e)(t==="mapStateToProps"||t==="mapDispatchToProps")&&(Object.prototype.hasOwnProperty.call(e,"dependsOnOwnProps")||pt(`The selector for ${t} of connect did not specify a value for dependsOnOwnProps.`));else throw new Error(`Unexpected value for ${t} in connect.`)}function Qo(e,t,n){ft(e,"mapStateToProps"),ft(t,"mapDispatchToProps"),ft(n,"mergeProps")}function ei(e,t,n,r,{areStatesEqual:o,areOwnPropsEqual:i,areStatePropsEqual:s}){let c=!1,a,d,p,l,u;function g(y,C){return a=y,d=C,p=e(a,d),l=t(r,d),u=n(p,l,d),c=!0,u}function m(){return p=e(a,d),t.dependsOnOwnProps&&(l=t(r,d)),u=n(p,l,d),u}function b(){return e.dependsOnOwnProps&&(p=e(a,d)),t.dependsOnOwnProps&&(l=t(r,d)),u=n(p,l,d),u}function h(){const y=e(a,d),C=!s(y,p);return p=y,C&&(u=n(p,l,d)),u}function E(y,C){const I=!i(C,d),N=!o(y,a,C,d);return a=y,d=C,I&&N?m():I?b():N?h():u}return function(C,I){return c?E(C,I):g(C,I)}}function ti(e,{initMapStateToProps:t,initMapDispatchToProps:n,initMergeProps:r,...o}){const i=t(e,o),s=n(e,o),c=r(e,o);return process.env.NODE_ENV!=="production"&&Qo(i,s,c),ei(i,s,c,e,o)}function ni(e,t){const n={};for(const r in e){const o=e[r];typeof o=="function"&&(n[r]=(...i)=>t(o(...i)))}return n}function ri(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);if(t===null)return!0;let n=t;for(;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return t===n}function Vn(e,t,n){ri(e)||pt(`${n}() in ${t} must return a plain object. Instead received ${e}.`)}function gt(e){return function(n){const r=e(n);function o(){return r}return o.dependsOnOwnProps=!1,o}}function Ln(e){return e.dependsOnOwnProps?!!e.dependsOnOwnProps:e.length!==1}function Rn(e,t){return function(r,{displayName:o}){const i=function(c,a){return i.dependsOnOwnProps?i.mapToProps(c,a):i.mapToProps(c,void 0)};return i.dependsOnOwnProps=!0,i.mapToProps=function(c,a){i.mapToProps=e,i.dependsOnOwnProps=Ln(e);let d=i(c,a);return typeof d=="function"&&(i.mapToProps=d,i.dependsOnOwnProps=Ln(d),d=i(c,a)),process.env.NODE_ENV!=="production"&&Vn(d,o,t),d},i}}function mt(e,t){return(n,r)=>{throw new Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}function oi(e){return e&&typeof e=="object"?gt(t=>ni(e,t)):e?typeof e=="function"?Rn(e,"mapDispatchToProps"):mt(e,"mapDispatchToProps"):gt(t=>({dispatch:t}))}function ii(e){return e?typeof e=="function"?Rn(e,"mapStateToProps"):mt(e,"mapStateToProps"):gt(()=>({}))}function si(e,t,n){return{...n,...e,...t}}function ci(e){return function(n,{displayName:r,areMergedPropsEqual:o}){let i=!1,s;return function(a,d,p){const l=e(a,d,p);return i?o(l,s)||(s=l):(i=!0,s=l,process.env.NODE_ENV!=="production"&&Vn(s,r,"mergeProps")),s}}}function ai(e){return e?typeof e=="function"?ci(e):mt(e,"mergeProps"):()=>si}function li(e){e()}function di(){let e=null,t=null;return{clear(){e=null,t=null},notify(){li(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const o=t={callback:n,next:null,prev:t};return o.prev?o.prev.next=o:e=o,function(){!r||e===null||(r=!1,o.next?o.next.prev=o.prev:t=o.prev,o.prev?o.prev.next=o.next:e=o.next)}}}}var Mn={notify(){},get:()=>[]};function $n(e,t){let n,r=Mn,o=0,i=!1;function s(b){p();const h=r.subscribe(b);let E=!1;return()=>{E||(E=!0,h(),l())}}function c(){r.notify()}function a(){m.onStateChange&&m.onStateChange()}function d(){return i}function p(){o++,n||(n=t?t.addNestedSub(a):e.subscribe(a),r=di())}function l(){o--,n&&o===0&&(n(),n=void 0,r.clear(),r=Mn)}function u(){i||(i=!0,p())}function g(){i&&(i=!1,l())}const m={addNestedSub:s,notifyNestedSubs:c,handleChangeWrapper:a,isSubscribed:d,trySubscribe:u,tryUnsubscribe:g,getListeners:()=>r};return m}var ui=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",pi=ui(),fi=()=>typeof navigator<"u"&&navigator.product==="ReactNative",gi=fi(),mi=()=>pi||gi?_.useLayoutEffect:_.useEffect,$e=mi();function Gn(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function ht(e,t){if(Gn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let o=0;o<n.length;o++)if(!Object.prototype.hasOwnProperty.call(t,n[o])||!Gn(e[n[o]],t[n[o]]))return!1;return!0}var hi={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},bi={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},vi={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},kn={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},yi={[Yo]:vi,[Xo]:kn};function Fn(e){return Zo(e)?kn:yi[e.$$typeof]||hi}var Ei=Object.defineProperty,Di=Object.getOwnPropertyNames,Wn=Object.getOwnPropertySymbols,Ni=Object.getOwnPropertyDescriptor,xi=Object.getPrototypeOf,Un=Object.prototype;function bt(e,t){if(typeof t!="string"){if(Un){const i=xi(t);i&&i!==Un&&bt(e,i)}let n=Di(t);Wn&&(n=n.concat(Wn(t)));const r=Fn(e),o=Fn(t);for(let i=0;i<n.length;++i){const s=n[i];if(!bi[s]&&!(o&&o[s])&&!(r&&r[s])){const c=Ni(t,s);try{Ei(e,s,c)}catch{}}}}return e}var vt=Symbol.for("react-redux-context"),yt=typeof globalThis<"u"?globalThis:{};function Ii(){if(!_.createContext)return{};const e=yt[vt]??(yt[vt]=new Map);let t=e.get(_.createContext);return t||(t=_.createContext(null),process.env.NODE_ENV!=="production"&&(t.displayName="ReactRedux"),e.set(_.createContext,t)),t}var Hn=Ii(),Si=[null,null],Ci=e=>{try{return JSON.stringify(e)}catch{return String(e)}};function Oi(e,t,n){$e(()=>e(...t),n)}function wi(e,t,n,r,o,i){e.current=r,n.current=!1,o.current&&(o.current=null,i())}function _i(e,t,n,r,o,i,s,c,a,d,p){if(!e)return()=>{};let l=!1,u=null;const g=()=>{if(l||!c.current)return;const b=t.getState();let h,E;try{h=r(b,o.current)}catch(y){E=y,u=y}E||(u=null),h===i.current?s.current||d():(i.current=h,a.current=h,s.current=!0,p())};return n.onStateChange=g,n.trySubscribe(),g(),()=>{if(l=!0,n.tryUnsubscribe(),n.onStateChange=null,u)throw u}}function Ai(e,t){return e===t}var zn=!1;function Pi(e,t,n,{pure:r,areStatesEqual:o=Ai,areOwnPropsEqual:i=ht,areStatePropsEqual:s=ht,areMergedPropsEqual:c=ht,forwardRef:a=!1,context:d=Hn}={}){process.env.NODE_ENV!=="production"&&r!==void 0&&!zn&&(zn=!0,pt('The `pure` option has been removed. `connect` is now always a "pure/memoized" component'));const p=d,l=ii(e),u=oi(t),g=ai(n),m=!!e;return h=>{if(process.env.NODE_ENV!=="production"&&!Ko(h))throw new Error(`You must pass a component to the function returned by connect. Instead received ${Ci(h)}`);const E=h.displayName||h.name||"Component",y=`Connect(${E})`,C={shouldHandleStateChanges:m,displayName:y,wrappedComponentName:E,WrappedComponent:h,initMapStateToProps:l,initMapDispatchToProps:u,initMergeProps:g,areStatesEqual:o,areStatePropsEqual:s,areOwnPropsEqual:i,areMergedPropsEqual:c};function I(A){const[T,H,V]=_.useMemo(()=>{const{reactReduxForwardedRef:q,...ge}=A;return[A.context,q,ge]},[A]),z=_.useMemo(()=>{let q=p;if(T!=null&&T.Consumer&&process.env.NODE_ENV!=="production"){if(!Jo(_.createElement(T.Consumer,null)))throw new Error("You must pass a valid React context consumer as `props.context`");q=T}return q},[T,p]),L=_.useContext(z),J=!!A.store&&!!A.store.getState&&!!A.store.dispatch,fe=!!L&&!!L.store;if(process.env.NODE_ENV!=="production"&&!J&&!fe)throw new Error(`Could not find "store" in the context of "${y}". Either wrap the root component in a <Provider>, or pass a custom React context provider to <Provider> and the corresponding React context consumer to ${y} in connect options.`);const Z=J?A.store:L.store,rt=fe?L.getServerState:Z.getState,pn=_.useMemo(()=>ti(Z.dispatch,C),[Z]),[Le,_o]=_.useMemo(()=>{if(!m)return Si;const q=$n(Z,J?void 0:L.subscription),ge=q.notifyNestedSubs.bind(q);return[q,ge]},[Z,J,L]),Ao=_.useMemo(()=>J?L:{...L,subscription:Le},[J,L,Le]),fn=_.useRef(void 0),gn=_.useRef(V),Re=_.useRef(void 0),Po=_.useRef(!1),mn=_.useRef(!1),hn=_.useRef(void 0);$e(()=>(mn.current=!0,()=>{mn.current=!1}),[]);const To=_.useMemo(()=>()=>Re.current&&V===gn.current?Re.current:pn(Z.getState(),V),[Z,V]),yd=_.useMemo(()=>ge=>Le?_i(m,Z,Le,pn,gn,fn,Po,mn,Re,_o,ge):()=>{},[Le]);Oi(wi,[gn,fn,Po,V,Re,_o]);let ot;try{ot=_.useSyncExternalStore(yd,To,rt?()=>pn(rt(),V):To)}catch(q){throw hn.current&&(q.message+=`
17
+ */var Sn;function Fo(){return Sn||(Sn=1,process.env.NODE_ENV!=="production"&&function(){function e(a,d){return a===d&&(a!==0||1/a===1/d)||a!==a&&d!==d}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=D,n=typeof Object.is=="function"?Object.is:e,r=t.useSyncExternalStore,o=t.useRef,i=t.useEffect,s=t.useMemo,c=t.useDebugValue;ct.useSyncExternalStoreWithSelector=function(a,d,p,l,u){var g=o(null);if(g.current===null){var h={hasValue:!1,value:null};g.current=h}else h=g.current;g=s(function(){function m(N){if(!E){if(E=!0,y=N,N=l(N),u!==void 0&&h.hasValue){var C=h.value;if(u(C,N))return S=C}return S=N}if(C=S,n(y,N))return C;var A=l(N);return u!==void 0&&u(C,A)?(y=N,C):(y=N,S=A)}var E=!1,y,S,I=p===void 0?null:p;return[function(){return m(d())},I===null?void 0:function(){return m(I())}]},[d,p,l,u]);var b=r(a,g[0],g[1]);return i(function(){h.hasValue=!0,h.value=b},[b]),c(b),b},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),ct}process.env.NODE_ENV==="production"?ko():Fo();var On=_.version.startsWith("19"),Wo=Symbol.for(On?"react.transitional.element":"react.element"),Uo=Symbol.for("react.portal"),wn=Symbol.for("react.fragment"),_n=Symbol.for("react.strict_mode"),An=Symbol.for("react.profiler"),at=Symbol.for("react.consumer"),lt=Symbol.for("react.context"),dt=Symbol.for("react.forward_ref"),Pn=Symbol.for("react.suspense"),Tn=Symbol.for("react.suspense_list"),Me=Symbol.for("react.memo"),Bn=Symbol.for("react.lazy"),Ho=Symbol.for("react.offscreen"),zo=Symbol.for("react.client.reference"),qo=dt,jo=Me;function Yo(e){return typeof e=="string"||typeof e=="function"||e===wn||e===An||e===_n||e===Pn||e===Tn||e===Ho||typeof e=="object"&&e!==null&&(e.$$typeof===Bn||e.$$typeof===Me||e.$$typeof===lt||e.$$typeof===at||e.$$typeof===dt||e.$$typeof===zo||e.getModuleId!==void 0)}function ut(e){if(typeof e=="object"&&e!==null){const{$$typeof:t}=e;switch(t){case Wo:switch(e=e.type,e){case wn:case An:case _n:case Pn:case Tn:return e;default:switch(e=e&&e.$$typeof,e){case lt:case dt:case Bn:case Me:return e;case at:return e;default:return t}}case Uo:return t}}}function Xo(e){return On?ut(e)===at:ut(e)===lt}function Ko(e){return ut(e)===Me}function pt(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function ft(e,t){if(e)(t==="mapStateToProps"||t==="mapDispatchToProps")&&(Object.prototype.hasOwnProperty.call(e,"dependsOnOwnProps")||pt(`The selector for ${t} of connect did not specify a value for dependsOnOwnProps.`));else throw new Error(`Unexpected value for ${t} in connect.`)}function Jo(e,t,n){ft(e,"mapStateToProps"),ft(t,"mapDispatchToProps"),ft(n,"mergeProps")}function Zo(e,t,n,r,{areStatesEqual:o,areOwnPropsEqual:i,areStatePropsEqual:s}){let c=!1,a,d,p,l,u;function g(y,S){return a=y,d=S,p=e(a,d),l=t(r,d),u=n(p,l,d),c=!0,u}function h(){return p=e(a,d),t.dependsOnOwnProps&&(l=t(r,d)),u=n(p,l,d),u}function b(){return e.dependsOnOwnProps&&(p=e(a,d)),t.dependsOnOwnProps&&(l=t(r,d)),u=n(p,l,d),u}function m(){const y=e(a,d),S=!s(y,p);return p=y,S&&(u=n(p,l,d)),u}function E(y,S){const I=!i(S,d),N=!o(y,a,S,d);return a=y,d=S,I&&N?h():I?b():N?m():u}return function(S,I){return c?E(S,I):g(S,I)}}function Qo(e,{initMapStateToProps:t,initMapDispatchToProps:n,initMergeProps:r,...o}){const i=t(e,o),s=n(e,o),c=r(e,o);return process.env.NODE_ENV!=="production"&&Jo(i,s,c),Zo(i,s,c,e,o)}function ei(e,t){const n={};for(const r in e){const o=e[r];typeof o=="function"&&(n[r]=(...i)=>t(o(...i)))}return n}function ti(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);if(t===null)return!0;let n=t;for(;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return t===n}function Vn(e,t,n){ti(e)||pt(`${n}() in ${t} must return a plain object. Instead received ${e}.`)}function gt(e){return function(n){const r=e(n);function o(){return r}return o.dependsOnOwnProps=!1,o}}function Ln(e){return e.dependsOnOwnProps?!!e.dependsOnOwnProps:e.length!==1}function Rn(e,t){return function(r,{displayName:o}){const i=function(c,a){return i.dependsOnOwnProps?i.mapToProps(c,a):i.mapToProps(c,void 0)};return i.dependsOnOwnProps=!0,i.mapToProps=function(c,a){i.mapToProps=e,i.dependsOnOwnProps=Ln(e);let d=i(c,a);return typeof d=="function"&&(i.mapToProps=d,i.dependsOnOwnProps=Ln(d),d=i(c,a)),process.env.NODE_ENV!=="production"&&Vn(d,o,t),d},i}}function mt(e,t){return(n,r)=>{throw new Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}function ni(e){return e&&typeof e=="object"?gt(t=>ei(e,t)):e?typeof e=="function"?Rn(e,"mapDispatchToProps"):mt(e,"mapDispatchToProps"):gt(t=>({dispatch:t}))}function ri(e){return e?typeof e=="function"?Rn(e,"mapStateToProps"):mt(e,"mapStateToProps"):gt(()=>({}))}function oi(e,t,n){return{...n,...e,...t}}function ii(e){return function(n,{displayName:r,areMergedPropsEqual:o}){let i=!1,s;return function(a,d,p){const l=e(a,d,p);return i?o(l,s)||(s=l):(i=!0,s=l,process.env.NODE_ENV!=="production"&&Vn(s,r,"mergeProps")),s}}}function si(e){return e?typeof e=="function"?ii(e):mt(e,"mergeProps"):()=>oi}function ci(e){e()}function ai(){let e=null,t=null;return{clear(){e=null,t=null},notify(){ci(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const o=t={callback:n,next:null,prev:t};return o.prev?o.prev.next=o:e=o,function(){!r||e===null||(r=!1,o.next?o.next.prev=o.prev:t=o.prev,o.prev?o.prev.next=o.next:e=o.next)}}}}var Mn={notify(){},get:()=>[]};function $n(e,t){let n,r=Mn,o=0,i=!1;function s(b){p();const m=r.subscribe(b);let E=!1;return()=>{E||(E=!0,m(),l())}}function c(){r.notify()}function a(){h.onStateChange&&h.onStateChange()}function d(){return i}function p(){o++,n||(n=t?t.addNestedSub(a):e.subscribe(a),r=ai())}function l(){o--,n&&o===0&&(n(),n=void 0,r.clear(),r=Mn)}function u(){i||(i=!0,p())}function g(){i&&(i=!1,l())}const h={addNestedSub:s,notifyNestedSubs:c,handleChangeWrapper:a,isSubscribed:d,trySubscribe:u,tryUnsubscribe:g,getListeners:()=>r};return h}var li=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",di=li(),ui=()=>typeof navigator<"u"&&navigator.product==="ReactNative",pi=ui(),fi=()=>di||pi?_.useLayoutEffect:_.useEffect,$e=fi();function Gn(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function ht(e,t){if(Gn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let o=0;o<n.length;o++)if(!Object.prototype.hasOwnProperty.call(t,n[o])||!Gn(e[n[o]],t[n[o]]))return!1;return!0}var gi={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},mi={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},hi={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},kn={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},bi={[qo]:hi,[jo]:kn};function Fn(e){return Ko(e)?kn:bi[e.$$typeof]||gi}var vi=Object.defineProperty,yi=Object.getOwnPropertyNames,Wn=Object.getOwnPropertySymbols,Ei=Object.getOwnPropertyDescriptor,Di=Object.getPrototypeOf,Un=Object.prototype;function bt(e,t){if(typeof t!="string"){if(Un){const i=Di(t);i&&i!==Un&&bt(e,i)}let n=yi(t);Wn&&(n=n.concat(Wn(t)));const r=Fn(e),o=Fn(t);for(let i=0;i<n.length;++i){const s=n[i];if(!mi[s]&&!(o&&o[s])&&!(r&&r[s])){const c=Ei(t,s);try{vi(e,s,c)}catch{}}}}return e}var vt=Symbol.for("react-redux-context"),yt=typeof globalThis<"u"?globalThis:{};function Ni(){if(!_.createContext)return{};const e=yt[vt]??(yt[vt]=new Map);let t=e.get(_.createContext);return t||(t=_.createContext(null),process.env.NODE_ENV!=="production"&&(t.displayName="ReactRedux"),e.set(_.createContext,t)),t}var Hn=Ni(),xi=[null,null],Ii=e=>{try{return JSON.stringify(e)}catch{return String(e)}};function Ci(e,t,n){$e(()=>e(...t),n)}function Si(e,t,n,r,o,i){e.current=r,n.current=!1,o.current&&(o.current=null,i())}function Oi(e,t,n,r,o,i,s,c,a,d,p){if(!e)return()=>{};let l=!1,u=null;const g=()=>{if(l||!c.current)return;const b=t.getState();let m,E;try{m=r(b,o.current)}catch(y){E=y,u=y}E||(u=null),m===i.current?s.current||d():(i.current=m,a.current=m,s.current=!0,p())};return n.onStateChange=g,n.trySubscribe(),g(),()=>{if(l=!0,n.tryUnsubscribe(),n.onStateChange=null,u)throw u}}function wi(e,t){return e===t}var zn=!1;function _i(e,t,n,{pure:r,areStatesEqual:o=wi,areOwnPropsEqual:i=ht,areStatePropsEqual:s=ht,areMergedPropsEqual:c=ht,forwardRef:a=!1,context:d=Hn}={}){process.env.NODE_ENV!=="production"&&r!==void 0&&!zn&&(zn=!0,pt('The `pure` option has been removed. `connect` is now always a "pure/memoized" component'));const p=d,l=ri(e),u=ni(t),g=si(n),h=!!e;return m=>{if(process.env.NODE_ENV!=="production"&&!Yo(m))throw new Error(`You must pass a component to the function returned by connect. Instead received ${Ii(m)}`);const E=m.displayName||m.name||"Component",y=`Connect(${E})`,S={shouldHandleStateChanges:h,displayName:y,wrappedComponentName:E,WrappedComponent:m,initMapStateToProps:l,initMapDispatchToProps:u,initMergeProps:g,areStatesEqual:o,areStatePropsEqual:s,areOwnPropsEqual:i,areMergedPropsEqual:c};function I(A){const[T,H,V]=_.useMemo(()=>{const{reactReduxForwardedRef:q,...ge}=A;return[A.context,q,ge]},[A]),z=_.useMemo(()=>{let q=p;if(T!=null&&T.Consumer&&process.env.NODE_ENV!=="production"){if(!Xo(_.createElement(T.Consumer,null)))throw new Error("You must pass a valid React context consumer as `props.context`");q=T}return q},[T,p]),L=_.useContext(z),J=!!A.store&&!!A.store.getState&&!!A.store.dispatch,fe=!!L&&!!L.store;if(process.env.NODE_ENV!=="production"&&!J&&!fe)throw new Error(`Could not find "store" in the context of "${y}". Either wrap the root component in a <Provider>, or pass a custom React context provider to <Provider> and the corresponding React context consumer to ${y} in connect options.`);const Z=J?A.store:L.store,rt=fe?L.getServerState:Z.getState,pn=_.useMemo(()=>Qo(Z.dispatch,S),[Z]),[Le,Oo]=_.useMemo(()=>{if(!h)return xi;const q=$n(Z,J?void 0:L.subscription),ge=q.notifyNestedSubs.bind(q);return[q,ge]},[Z,J,L]),wo=_.useMemo(()=>J?L:{...L,subscription:Le},[J,L,Le]),fn=_.useRef(void 0),gn=_.useRef(V),Re=_.useRef(void 0),_o=_.useRef(!1),mn=_.useRef(!1),hn=_.useRef(void 0);$e(()=>(mn.current=!0,()=>{mn.current=!1}),[]);const Ao=_.useMemo(()=>()=>Re.current&&V===gn.current?Re.current:pn(Z.getState(),V),[Z,V]),Ed=_.useMemo(()=>ge=>Le?Oi(h,Z,Le,pn,gn,fn,_o,mn,Re,Oo,ge):()=>{},[Le]);Ci(Si,[gn,fn,_o,V,Re,Oo]);let ot;try{ot=_.useSyncExternalStore(Ed,Ao,rt?()=>pn(rt(),V):Ao)}catch(q){throw hn.current&&(q.message+=`
18
18
  The error may be correlated with this previous error:
19
19
  ${hn.current.stack}
20
20
 
21
- `),q}$e(()=>{hn.current=void 0,Re.current=void 0,fn.current=ot});const bn=_.useMemo(()=>_.createElement(h,{...ot,ref:H}),[H,h,ot]);return _.useMemo(()=>m?_.createElement(z.Provider,{value:Ao},bn):bn,[z,bn,Ao])}const S=_.memo(I);if(S.WrappedComponent=h,S.displayName=I.displayName=y,a){const T=_.forwardRef(function(V,z){return _.createElement(S,{...V,reactReduxForwardedRef:z})});return T.displayName=y,T.WrappedComponent=h,bt(T,h)}return bt(S,h)}}var qn=Pi;function Ti(e){const{children:t,context:n,serverState:r,store:o}=e,i=_.useMemo(()=>{const a=$n(o),d={store:o,subscription:a,getServerState:r?()=>r:void 0};if(process.env.NODE_ENV==="production")return d;{const{identityFunctionCheck:p="once",stabilityCheck:l="once"}=e;return Object.assign(d,{stabilityCheck:l,identityFunctionCheck:p})}},[o,r]),s=_.useMemo(()=>o.getState(),[o]);$e(()=>{const{subscription:a}=i;return a.onStateChange=a.notifyNestedSubs,a.trySubscribe(),s!==o.getState()&&a.notifyNestedSubs(),()=>{a.tryUnsubscribe(),a.onStateChange=void 0}},[i,s]);const c=n||Hn;return _.createElement(c.Provider,{value:i},t)}var Bi=Ti,Vi=process.env.NODE_ENV==="production",Et="Invariant failed";function jn(e,t){if(Vi)throw new Error(Et);var n=typeof t=="function"?t():t,r=n?"".concat(Et,": ").concat(n):Et;throw new Error(r)}var K=function(t){var n=t.top,r=t.right,o=t.bottom,i=t.left,s=r-i,c=o-n,a={top:n,right:r,bottom:o,left:i,width:s,height:c,x:i,y:n,center:{x:(r+i)/2,y:(o+n)/2}};return a},Dt=function(t,n){return{top:t.top-n.top,left:t.left-n.left,bottom:t.bottom+n.bottom,right:t.right+n.right}},Yn=function(t,n){return{top:t.top+n.top,left:t.left+n.left,bottom:t.bottom-n.bottom,right:t.right-n.right}},Li=function(t,n){return{top:t.top+n.y,left:t.left+n.x,bottom:t.bottom+n.y,right:t.right+n.x}},Nt={top:0,right:0,bottom:0,left:0},xt=function(t){var n=t.borderBox,r=t.margin,o=r===void 0?Nt:r,i=t.border,s=i===void 0?Nt:i,c=t.padding,a=c===void 0?Nt:c,d=K(Dt(n,o)),p=K(Yn(n,s)),l=K(Yn(p,a));return{marginBox:d,borderBox:K(n),paddingBox:p,contentBox:l,margin:o,border:s,padding:a}},j=function(t){var n=t.slice(0,-2),r=t.slice(-2);if(r!=="px")return 0;var o=Number(n);return isNaN(o)&&(process.env.NODE_ENV!=="production"?jn(!1,"Could not parse value [raw: "+t+", without suffix: "+n+"]"):jn()),o},Ri=function(){return{x:window.pageXOffset,y:window.pageYOffset}},Ge=function(t,n){var r=t.borderBox,o=t.border,i=t.margin,s=t.padding,c=Li(r,n);return xt({borderBox:c,border:o,margin:i,padding:s})},ke=function(t,n){return n===void 0&&(n=Ri()),Ge(t,n)},Xn=function(t,n){var r={top:j(n.marginTop),right:j(n.marginRight),bottom:j(n.marginBottom),left:j(n.marginLeft)},o={top:j(n.paddingTop),right:j(n.paddingRight),bottom:j(n.paddingBottom),left:j(n.paddingLeft)},i={top:j(n.borderTopWidth),right:j(n.borderRightWidth),bottom:j(n.borderBottomWidth),left:j(n.borderLeftWidth)};return xt({borderBox:t,margin:r,padding:o,border:i})},Kn=function(t){var n=t.getBoundingClientRect(),r=window.getComputedStyle(t);return Xn(n,r)},me=function(t){var n=[],r=null,o=function(){for(var s=arguments.length,c=new Array(s),a=0;a<s;a++)c[a]=arguments[a];n=c,!r&&(r=requestAnimationFrame(function(){r=null,t.apply(void 0,n)}))};return o.cancel=function(){r&&(cancelAnimationFrame(r),r=null)},o};function Fe(){return Fe=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},Fe.apply(null,arguments)}const Mi=process.env.NODE_ENV==="production",$i=/[ \t]{2,}/g,Gi=/^[ \t]*/gm,Jn=e=>e.replace($i," ").replace(Gi,"").trim(),ki=e=>Jn(`
21
+ `),q}$e(()=>{hn.current=void 0,Re.current=void 0,fn.current=ot});const bn=_.useMemo(()=>_.createElement(m,{...ot,ref:H}),[H,m,ot]);return _.useMemo(()=>h?_.createElement(z.Provider,{value:wo},bn):bn,[z,bn,wo])}const C=_.memo(I);if(C.WrappedComponent=m,C.displayName=I.displayName=y,a){const T=_.forwardRef(function(V,z){return _.createElement(C,{...V,reactReduxForwardedRef:z})});return T.displayName=y,T.WrappedComponent=m,bt(T,m)}return bt(C,m)}}var qn=_i;function Ai(e){const{children:t,context:n,serverState:r,store:o}=e,i=_.useMemo(()=>{const a=$n(o),d={store:o,subscription:a,getServerState:r?()=>r:void 0};if(process.env.NODE_ENV==="production")return d;{const{identityFunctionCheck:p="once",stabilityCheck:l="once"}=e;return Object.assign(d,{stabilityCheck:l,identityFunctionCheck:p})}},[o,r]),s=_.useMemo(()=>o.getState(),[o]);$e(()=>{const{subscription:a}=i;return a.onStateChange=a.notifyNestedSubs,a.trySubscribe(),s!==o.getState()&&a.notifyNestedSubs(),()=>{a.tryUnsubscribe(),a.onStateChange=void 0}},[i,s]);const c=n||Hn;return _.createElement(c.Provider,{value:i},t)}var Pi=Ai,Ti=process.env.NODE_ENV==="production",Et="Invariant failed";function jn(e,t){if(Ti)throw new Error(Et);var n=typeof t=="function"?t():t,r=n?"".concat(Et,": ").concat(n):Et;throw new Error(r)}var K=function(t){var n=t.top,r=t.right,o=t.bottom,i=t.left,s=r-i,c=o-n,a={top:n,right:r,bottom:o,left:i,width:s,height:c,x:i,y:n,center:{x:(r+i)/2,y:(o+n)/2}};return a},Dt=function(t,n){return{top:t.top-n.top,left:t.left-n.left,bottom:t.bottom+n.bottom,right:t.right+n.right}},Yn=function(t,n){return{top:t.top+n.top,left:t.left+n.left,bottom:t.bottom-n.bottom,right:t.right-n.right}},Bi=function(t,n){return{top:t.top+n.y,left:t.left+n.x,bottom:t.bottom+n.y,right:t.right+n.x}},Nt={top:0,right:0,bottom:0,left:0},xt=function(t){var n=t.borderBox,r=t.margin,o=r===void 0?Nt:r,i=t.border,s=i===void 0?Nt:i,c=t.padding,a=c===void 0?Nt:c,d=K(Dt(n,o)),p=K(Yn(n,s)),l=K(Yn(p,a));return{marginBox:d,borderBox:K(n),paddingBox:p,contentBox:l,margin:o,border:s,padding:a}},j=function(t){var n=t.slice(0,-2),r=t.slice(-2);if(r!=="px")return 0;var o=Number(n);return isNaN(o)&&(process.env.NODE_ENV!=="production"?jn(!1,"Could not parse value [raw: "+t+", without suffix: "+n+"]"):jn()),o},Vi=function(){return{x:window.pageXOffset,y:window.pageYOffset}},Ge=function(t,n){var r=t.borderBox,o=t.border,i=t.margin,s=t.padding,c=Bi(r,n);return xt({borderBox:c,border:o,margin:i,padding:s})},ke=function(t,n){return n===void 0&&(n=Vi()),Ge(t,n)},Xn=function(t,n){var r={top:j(n.marginTop),right:j(n.marginRight),bottom:j(n.marginBottom),left:j(n.marginLeft)},o={top:j(n.paddingTop),right:j(n.paddingRight),bottom:j(n.paddingBottom),left:j(n.paddingLeft)},i={top:j(n.borderTopWidth),right:j(n.borderRightWidth),bottom:j(n.borderBottomWidth),left:j(n.borderLeftWidth)};return xt({borderBox:t,margin:r,padding:o,border:i})},Kn=function(t){var n=t.getBoundingClientRect(),r=window.getComputedStyle(t);return Xn(n,r)},me=function(t){var n=[],r=null,o=function(){for(var s=arguments.length,c=new Array(s),a=0;a<s;a++)c[a]=arguments[a];n=c,!r&&(r=requestAnimationFrame(function(){r=null,t.apply(void 0,n)}))};return o.cancel=function(){r&&(cancelAnimationFrame(r),r=null)},o};function Fe(){return Fe=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},Fe.apply(null,arguments)}const Li=process.env.NODE_ENV==="production",Ri=/[ \t]{2,}/g,Mi=/^[ \t]*/gm,Jn=e=>e.replace(Ri," ").replace(Mi,"").trim(),$i=e=>Jn(`
22
22
  %c@hello-pangea/dnd
23
23
 
24
24
  %c${Jn(e)}
25
25
 
26
26
  %c👷‍ This is a development only message. It will be removed in production builds.
27
- `),Fi=e=>[ki(e),"color: #00C584; font-size: 1.2em; font-weight: bold;","line-height: 1.5","color: #723874;"],Wi="__@hello-pangea/dnd-disable-dev-warnings";function Zn(e,t){Mi||typeof window<"u"&&window[Wi]||console[e](...Fi(t))}const B=Zn.bind(null,"warn"),It=Zn.bind(null,"error");function te(){}function Ui(e,t){return{...e,...t}}function Y(e,t,n){const r=t.map(o=>{const i=Ui(n,o.options);return e.addEventListener(o.eventName,o.fn,i),function(){e.removeEventListener(o.eventName,o.fn,i)}});return function(){r.forEach(i=>{i()})}}const Hi=process.env.NODE_ENV==="production",Qn="Invariant failed";class he extends Error{}he.prototype.toString=function(){return this.message};function f(e,t){throw Hi?new he(Qn):new he(`${Qn}: ${t||""}`)}class zi extends D.Component{constructor(...t){super(...t),this.callbacks=null,this.unbind=te,this.onWindowError=n=>{const r=this.getCallbacks();r.isDragging()&&(r.tryAbort(),process.env.NODE_ENV!=="production"&&B(`
27
+ `),Gi=e=>[$i(e),"color: #00C584; font-size: 1.2em; font-weight: bold;","line-height: 1.5","color: #723874;"],ki="__@hello-pangea/dnd-disable-dev-warnings";function Zn(e,t){Li||typeof window<"u"&&window[ki]||console[e](...Gi(t))}const B=Zn.bind(null,"warn"),It=Zn.bind(null,"error");function te(){}function Fi(e,t){return{...e,...t}}function Y(e,t,n){const r=t.map(o=>{const i=Fi(n,o.options);return e.addEventListener(o.eventName,o.fn,i),function(){e.removeEventListener(o.eventName,o.fn,i)}});return function(){r.forEach(i=>{i()})}}const Wi=process.env.NODE_ENV==="production",Qn="Invariant failed";class he extends Error{}he.prototype.toString=function(){return this.message};function f(e,t){throw Wi?new he(Qn):new he(`${Qn}: ${t||""}`)}class Ui extends D.Component{constructor(...t){super(...t),this.callbacks=null,this.unbind=te,this.onWindowError=n=>{const r=this.getCallbacks();r.isDragging()&&(r.tryAbort(),process.env.NODE_ENV!=="production"&&B(`
28
28
  An error was caught by our window 'error' event listener while a drag was occurring.
29
29
  The active drag has been aborted.
30
- `));const o=n.error;o instanceof he&&(n.preventDefault(),process.env.NODE_ENV!=="production"&&It(o.message))},this.getCallbacks=()=>{if(!this.callbacks)throw new Error("Unable to find AppCallbacks in <ErrorBoundary/>");return this.callbacks},this.setCallbacks=n=>{this.callbacks=n}}componentDidMount(){this.unbind=Y(window,[{eventName:"error",fn:this.onWindowError}])}componentDidCatch(t){if(t instanceof he){process.env.NODE_ENV!=="production"&&It(t.message),this.setState({});return}throw t}componentWillUnmount(){this.unbind()}render(){return this.props.children(this.setCallbacks)}}const qi=`
30
+ `));const o=n.error;o instanceof he&&(n.preventDefault(),process.env.NODE_ENV!=="production"&&It(o.message))},this.getCallbacks=()=>{if(!this.callbacks)throw new Error("Unable to find AppCallbacks in <ErrorBoundary/>");return this.callbacks},this.setCallbacks=n=>{this.callbacks=n}}componentDidMount(){this.unbind=Y(window,[{eventName:"error",fn:this.onWindowError}])}componentDidCatch(t){if(t instanceof he){process.env.NODE_ENV!=="production"&&It(t.message),this.setState({});return}throw t}componentWillUnmount(){this.unbind()}render(){return this.props.children(this.setCallbacks)}}const Hi=`
31
31
  Press space bar to start a drag.
32
32
  When dragging you can use the arrow keys to move the item around and escape to cancel.
33
33
  Some screen readers may require you to be in focus mode or to use your pass through key
34
- `,We=e=>e+1,ji=e=>`
34
+ `,We=e=>e+1,zi=e=>`
35
35
  You have lifted an item in position ${We(e.source.index)}
36
36
  `,er=(e,t)=>{const n=e.droppableId===t.droppableId,r=We(e.index),o=We(t.index);return n?`
37
37
  You have moved the item from position ${r}
@@ -48,10 +48,10 @@ ${hn.current.stack}
48
48
  in list ${t.droppableId}
49
49
  has been combined with ${n.draggableId}
50
50
  in list ${n.droppableId}
51
- `,Yi=e=>{const t=e.destination;if(t)return er(e.source,t);const n=e.combine;return n?tr(e.draggableId,e.source,n):"You are over an area that cannot be dropped on"},nr=e=>`
51
+ `,qi=e=>{const t=e.destination;if(t)return er(e.source,t);const n=e.combine;return n?tr(e.draggableId,e.source,n):"You are over an area that cannot be dropped on"},nr=e=>`
52
52
  The item has returned to its starting position
53
53
  of ${We(e.index)}
54
- `,Ue={dragHandleUsageInstructions:qi,onDragStart:ji,onDragUpdate:Yi,onDragEnd:e=>{if(e.reason==="CANCEL")return`
54
+ `,Ue={dragHandleUsageInstructions:Hi,onDragStart:zi,onDragUpdate:qi,onDragEnd:e=>{if(e.reason==="CANCEL")return`
55
55
  Movement cancelled.
56
56
  ${nr(e.source)}
57
57
  `;const t=e.destination,n=e.combine;return t?`
@@ -63,36 +63,36 @@ ${hn.current.stack}
63
63
  `:`
64
64
  The item has been dropped while not over a drop area.
65
65
  ${nr(e.source)}
66
- `}};function Xi(e,t){return!!(e===t||Number.isNaN(e)&&Number.isNaN(t))}function rr(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Xi(e[n],t[n]))return!1;return!0}function w(e,t){const n=D.useState(()=>({inputs:t,result:e()}))[0],r=D.useRef(!0),o=D.useRef(n),s=r.current||!!(t&&o.current.inputs&&rr(t,o.current.inputs))?o.current:{inputs:t,result:e()};return D.useEffect(()=>{r.current=!1,o.current=s},[s]),s.result}function x(e,t){return w(()=>e,t)}const R={x:0,y:0},$=(e,t)=>({x:e.x+t.x,y:e.y+t.y}),F=(e,t)=>({x:e.x-t.x,y:e.y-t.y}),ne=(e,t)=>e.x===t.x&&e.y===t.y,ae=e=>({x:e.x!==0?-e.x:0,y:e.y!==0?-e.y:0}),oe=(e,t,n=0)=>e==="x"?{x:t,y:n}:{x:n,y:t},be=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),or=(e,t)=>Math.min(...t.map(n=>be(e,n))),ir=e=>t=>({x:e(t.x),y:e(t.y)});var Ki=(e,t)=>{const n=K({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};const ve=(e,t)=>({top:e.top+t.y,left:e.left+t.x,bottom:e.bottom+t.y,right:e.right+t.x}),sr=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}],Ji={top:0,right:0,bottom:0,left:0},Zi=(e,t)=>t?ve(e,t.scroll.diff.displacement):e,Qi=(e,t,n)=>n&&n.increasedBy?{...e,[t.end]:e[t.end]+n.increasedBy[t.line]}:e,es=(e,t)=>t&&t.shouldClipSubject?Ki(t.pageMarginBox,e):K(e);var le=({page:e,withPlaceholder:t,axis:n,frame:r})=>{const o=Zi(e.marginBox,r),i=Qi(o,n,t),s=es(i,r);return{page:e,withPlaceholder:t,active:s}},St=(e,t)=>{e.frame||(process.env.NODE_ENV,f());const n=e.frame,r=F(t,n.scroll.initial),o=ae(r),i={...n,scroll:{initial:n.scroll.initial,current:t,diff:{value:r,displacement:o},max:n.scroll.max}},s=le({page:e.subject.page,withPlaceholder:e.subject.withPlaceholder,axis:e.axis,frame:i});return{...e,frame:i,subject:s}};function M(e,t=rr){let n=null;function r(...o){if(n&&n.lastThis===this&&t(o,n.lastArgs))return n.lastResult;const i=e.apply(this,o);return n={lastResult:i,lastArgs:o,lastThis:this},i}return r.clear=function(){n=null},r}const cr=M(e=>e.reduce((t,n)=>(t[n.descriptor.id]=n,t),{})),ar=M(e=>e.reduce((t,n)=>(t[n.descriptor.id]=n,t),{})),He=M(e=>Object.values(e)),ts=M(e=>Object.values(e));var ie=M((e,t)=>ts(t).filter(r=>e===r.descriptor.droppableId).sort((r,o)=>r.descriptor.index-o.descriptor.index));function Ct(e){return e.at&&e.at.type==="REORDER"?e.at.destination:null}function ze(e){return e.at&&e.at.type==="COMBINE"?e.at.combine:null}var qe=M((e,t)=>t.filter(n=>n.descriptor.id!==e.descriptor.id)),ns=({isMovingForward:e,draggable:t,destination:n,insideDestination:r,previousImpact:o})=>{if(!n.isCombineEnabled||!Ct(o))return null;function s(g){const m={type:"COMBINE",combine:{draggableId:g,droppableId:n.descriptor.id}};return{...o,at:m}}const c=o.displaced.all,a=c.length?c[0]:null;if(e)return a?s(a):null;const d=qe(t,r);if(!a){if(!d.length)return null;const g=d[d.length-1];return s(g.descriptor.id)}const p=d.findIndex(g=>g.descriptor.id===a);p===-1&&(process.env.NODE_ENV!=="production"?f(!1,"Could not find displaced item in set"):f());const l=p-1;if(l<0)return null;const u=d[l];return s(u.descriptor.id)},de=(e,t)=>e.descriptor.droppableId===t.descriptor.id;const lr={point:R,value:0},ye={invisible:{},visible:{},all:[]},rs={displaced:ye,displacedBy:lr,at:null};var X=(e,t)=>n=>e<=n&&n<=t,dr=e=>{const t=X(e.top,e.bottom),n=X(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),s=n(r.left)||n(r.right);if(i&&s)return!0;const a=r.top<e.top&&r.bottom>e.bottom,d=r.left<e.left&&r.right>e.right;return a&&d?!0:a&&s||d&&i}},os=e=>{const t=X(e.top,e.bottom),n=X(e.left,e.right);return r=>t(r.top)&&t(r.bottom)&&n(r.left)&&n(r.right)};const Ot={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},ur={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"};var is=e=>t=>{const n=X(t.top,t.bottom),r=X(t.left,t.right);return o=>e===Ot?n(o.top)&&n(o.bottom):r(o.left)&&r(o.right)};const ss=(e,t)=>{const n=t.frame?t.frame.scroll.diff.displacement:R;return ve(e,n)},cs=(e,t,n)=>t.subject.active?n(t.subject.active)(e):!1,as=(e,t,n)=>n(t)(e),wt=({target:e,destination:t,viewport:n,withDroppableDisplacement:r,isVisibleThroughFrameFn:o})=>{const i=r?ss(e,t):e;return cs(i,t,o)&&as(i,n,o)},ls=e=>wt({...e,isVisibleThroughFrameFn:dr}),pr=e=>wt({...e,isVisibleThroughFrameFn:os}),ds=e=>wt({...e,isVisibleThroughFrameFn:is(e.destination.axis)}),us=(e,t,n)=>{if(typeof n=="boolean")return n;if(!t)return!0;const{invisible:r,visible:o}=t;if(r[e])return!1;const i=o[e];return i?i.shouldAnimate:!0};function ps(e,t){const n=e.page.marginBox,r={top:t.point.y,right:0,bottom:0,left:t.point.x};return K(Dt(n,r))}function Ee({afterDragging:e,destination:t,displacedBy:n,viewport:r,forceShouldAnimate:o,last:i}){return e.reduce(function(c,a){const d=ps(a,n),p=a.descriptor.id;if(c.all.push(p),!ls({target:d,destination:t,viewport:r,withDroppableDisplacement:!0}))return c.invisible[a.descriptor.id]=!0,c;const u=us(p,i,o),g={draggableId:p,shouldAnimate:u};return c.visible[p]=g,c},{all:[],visible:{},invisible:{}})}function fs(e,t){if(!e.length)return 0;const n=e[e.length-1].descriptor.index;return t.inHomeList?n:n+1}function fr({insideDestination:e,inHomeList:t,displacedBy:n,destination:r}){const o=fs(e,{inHomeList:t});return{displaced:ye,displacedBy:n,at:{type:"REORDER",destination:{droppableId:r.descriptor.id,index:o}}}}function je({draggable:e,insideDestination:t,destination:n,viewport:r,displacedBy:o,last:i,index:s,forceShouldAnimate:c}){const a=de(e,n);if(s==null)return fr({insideDestination:t,inHomeList:a,displacedBy:o,destination:n});const d=t.find(m=>m.descriptor.index===s);if(!d)return fr({insideDestination:t,inHomeList:a,displacedBy:o,destination:n});const p=qe(e,t),l=t.indexOf(d),u=p.slice(l);return{displaced:Ee({afterDragging:u,destination:n,displacedBy:o,last:i,viewport:r.frame,forceShouldAnimate:c}),displacedBy:o,at:{type:"REORDER",destination:{droppableId:n.descriptor.id,index:s}}}}function re(e,t){return!!t.effected[e]}var gs=({isMovingForward:e,destination:t,draggables:n,combine:r,afterCritical:o})=>{if(!t.isCombineEnabled)return null;const i=r.draggableId,c=n[i].descriptor.index;return re(i,o)?e?c:c-1:e?c+1:c},ms=({isMovingForward:e,isInHomeList:t,insideDestination:n,location:r})=>{if(!n.length)return null;const o=r.index,i=e?o+1:o-1,s=n[0].descriptor.index,c=n[n.length-1].descriptor.index,a=t?c:c+1;return i<s||i>a?null:i},hs=({isMovingForward:e,isInHomeList:t,draggable:n,draggables:r,destination:o,insideDestination:i,previousImpact:s,viewport:c,afterCritical:a})=>{const d=s.at;if(d||(process.env.NODE_ENV!=="production"?f(!1,"Cannot move in direction without previous impact location"):f()),d.type==="REORDER"){const l=ms({isMovingForward:e,isInHomeList:t,location:d.destination,insideDestination:i});return l==null?null:je({draggable:n,insideDestination:i,destination:o,viewport:c,last:s.displaced,displacedBy:s.displacedBy,index:l})}const p=gs({isMovingForward:e,destination:o,displaced:s.displaced,draggables:r,combine:d.combine,afterCritical:a});return p==null?null:je({draggable:n,insideDestination:i,destination:o,viewport:c,last:s.displaced,displacedBy:s.displacedBy,index:p})},bs=({displaced:e,afterCritical:t,combineWith:n,displacedBy:r})=>{const o=!!(e.visible[n]||e.invisible[n]);return re(n,t)?o?R:ae(r.point):o?r.point:R},vs=({afterCritical:e,impact:t,draggables:n})=>{const r=ze(t);r||(process.env.NODE_ENV,f());const o=r.draggableId,i=n[o].page.borderBox.center,s=bs({displaced:t.displaced,afterCritical:e,combineWith:o,displacedBy:t.displacedBy});return $(i,s)};const gr=(e,t)=>t.margin[e.start]+t.borderBox[e.size]/2,ys=(e,t)=>t.margin[e.end]+t.borderBox[e.size]/2,_t=(e,t,n)=>t[e.crossAxisStart]+n.margin[e.crossAxisStart]+n.borderBox[e.crossAxisSize]/2,mr=({axis:e,moveRelativeTo:t,isMoving:n})=>oe(e.line,t.marginBox[e.end]+gr(e,n),_t(e,t.marginBox,n)),hr=({axis:e,moveRelativeTo:t,isMoving:n})=>oe(e.line,t.marginBox[e.start]-ys(e,n),_t(e,t.marginBox,n)),Es=({axis:e,moveInto:t,isMoving:n})=>oe(e.line,t.contentBox[e.start]+gr(e,n),_t(e,t.contentBox,n));var Ds=({impact:e,draggable:t,draggables:n,droppable:r,afterCritical:o})=>{const i=ie(r.descriptor.id,n),s=t.page,c=r.axis;if(!i.length)return Es({axis:c,moveInto:r.page,isMoving:s});const{displaced:a,displacedBy:d}=e,p=a.all[0];if(p){const u=n[p];if(re(p,o))return hr({axis:c,moveRelativeTo:u.page,isMoving:s});const g=Ge(u.page,d.point);return hr({axis:c,moveRelativeTo:g,isMoving:s})}const l=i[i.length-1];if(l.descriptor.id===t.descriptor.id)return s.borderBox.center;if(re(l.descriptor.id,o)){const u=Ge(l.page,ae(o.displacedBy.point));return mr({axis:c,moveRelativeTo:u,isMoving:s})}return mr({axis:c,moveRelativeTo:l.page,isMoving:s})},At=(e,t)=>{const n=e.frame;return n?$(t,n.scroll.diff.displacement):t};const Ns=({impact:e,draggable:t,droppable:n,draggables:r,afterCritical:o})=>{const i=t.page.borderBox.center,s=e.at;return!n||!s?i:s.type==="REORDER"?Ds({impact:e,draggable:t,draggables:r,droppable:n,afterCritical:o}):vs({impact:e,draggables:r,afterCritical:o})};var Ye=e=>{const t=Ns(e),n=e.droppable;return n?At(n,t):t},br=(e,t)=>{const n=F(t,e.scroll.initial),r=ae(n);return{frame:K({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 vr(e,t){return e.map(n=>t[n])}function xs(e,t){for(let n=0;n<t.length;n++){const r=t[n].visible[e];if(r)return r}return null}var Is=({impact:e,viewport:t,destination:n,draggables:r,maxScrollChange:o})=>{const i=br(t,$(t.scroll.current,o)),s=n.frame?St(n,$(n.frame.scroll.current,o)):n,c=e.displaced,a=Ee({afterDragging:vr(c.all,r),destination:n,displacedBy:e.displacedBy,viewport:i.frame,last:c,forceShouldAnimate:!1}),d=Ee({afterDragging:vr(c.all,r),destination:s,displacedBy:e.displacedBy,viewport:t.frame,last:c,forceShouldAnimate:!1}),p={},l={},u=[c,a,d];return c.all.forEach(m=>{const b=xs(m,u);if(b){l[m]=b;return}p[m]=!0}),{...e,displaced:{all:c.all,invisible:p,visible:l}}},Ss=(e,t)=>$(e.scroll.diff.displacement,t),Pt=({pageBorderBoxCenter:e,draggable:t,viewport:n})=>{const r=Ss(n,e),o=F(r,t.page.borderBox.center);return $(t.client.borderBox.center,o)},yr=({draggable:e,destination:t,newPageBorderBoxCenter:n,viewport:r,withDroppableDisplacement:o,onlyOnMainAxis:i=!1})=>{const s=F(n,e.page.borderBox.center),a={target:ve(e.page.borderBox,s),destination:t,withDroppableDisplacement:o,viewport:r};return i?ds(a):pr(a)},Cs=({isMovingForward:e,draggable:t,destination:n,draggables:r,previousImpact:o,viewport:i,previousPageBorderBoxCenter:s,previousClientSelection:c,afterCritical:a})=>{if(!n.isEnabled)return null;const d=ie(n.descriptor.id,r),p=de(t,n),l=ns({isMovingForward:e,draggable:t,destination:n,insideDestination:d,previousImpact:o})||hs({isMovingForward:e,isInHomeList:p,draggable:t,draggables:r,destination:n,insideDestination:d,previousImpact:o,viewport:i,afterCritical:a});if(!l)return null;const u=Ye({impact:l,draggable:t,droppable:n,draggables:r,afterCritical:a});if(yr({draggable:t,destination:n,newPageBorderBoxCenter:u,viewport:i.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0}))return{clientSelection:Pt({pageBorderBoxCenter:u,draggable:t,viewport:i}),impact:l,scrollJumpRequest:null};const m=F(u,s),b=Is({impact:l,viewport:i,destination:n,draggables:r,maxScrollChange:m});return{clientSelection:c,impact:b,scrollJumpRequest:m}};const k=e=>{const t=e.subject.active;return t||(process.env.NODE_ENV!=="production"?f(!1,"Cannot get clipped area from droppable"):f()),t};var Os=({isMovingForward:e,pageBorderBoxCenter:t,source:n,droppables:r,viewport:o})=>{const i=n.subject.active;if(!i)return null;const s=n.axis,c=X(i[s.start],i[s.end]),a=He(r).filter(p=>p!==n).filter(p=>p.isEnabled).filter(p=>!!p.subject.active).filter(p=>dr(o.frame)(k(p))).filter(p=>{const l=k(p);return e?i[s.crossAxisEnd]<l[s.crossAxisEnd]:l[s.crossAxisStart]<i[s.crossAxisStart]}).filter(p=>{const l=k(p),u=X(l[s.start],l[s.end]);return c(l[s.start])||c(l[s.end])||u(i[s.start])||u(i[s.end])}).sort((p,l)=>{const u=k(p)[s.crossAxisStart],g=k(l)[s.crossAxisStart];return e?u-g:g-u}).filter((p,l,u)=>k(p)[s.crossAxisStart]===k(u[0])[s.crossAxisStart]);if(!a.length)return null;if(a.length===1)return a[0];const d=a.filter(p=>X(k(p)[s.start],k(p)[s.end])(t[s.line]));return d.length===1?d[0]:d.length>1?d.sort((p,l)=>k(p)[s.start]-k(l)[s.start])[0]:a.sort((p,l)=>{const u=or(t,sr(k(p))),g=or(t,sr(k(l)));return u!==g?u-g:k(p)[s.start]-k(l)[s.start]})[0]};const Er=(e,t)=>{const n=e.page.borderBox.center;return re(e.descriptor.id,t)?F(n,t.displacedBy.point):n},ws=(e,t)=>{const n=e.page.borderBox;return re(e.descriptor.id,t)?ve(n,ae(t.displacedBy.point)):n};var _s=({pageBorderBoxCenter:e,viewport:t,destination:n,insideDestination:r,afterCritical:o})=>r.filter(s=>pr({target:ws(s,o),destination:n,viewport:t.frame,withDroppableDisplacement:!0})).sort((s,c)=>{const a=be(e,At(n,Er(s,o))),d=be(e,At(n,Er(c,o)));return a<d?-1:d<a?1:s.descriptor.index-c.descriptor.index})[0]||null,De=M(function(t,n){const r=n[t.line];return{value:r,point:oe(t.line,r)}});const As=(e,t,n)=>{const r=e.axis;if(e.descriptor.mode==="virtual")return oe(r.line,t[r.line]);const o=e.subject.page.contentBox[r.size],a=ie(e.descriptor.id,n).reduce((d,p)=>d+p.client.marginBox[r.size],0)+t[r.line]-o;return a<=0?null:oe(r.line,a)},Dr=(e,t)=>({...e,scroll:{...e.scroll,max:t}}),Nr=(e,t,n)=>{const r=e.frame;de(t,e)&&(process.env.NODE_ENV!=="production"?f(!1,"Should not add placeholder space to home list"):f()),e.subject.withPlaceholder&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot add placeholder size to a subject when it already has one"):f());const o=De(e.axis,t.displaceBy).point,i=As(e,o,n),s={placeholderSize:o,increasedBy:i,oldFrameMaxScroll:e.frame?e.frame.scroll.max:null};if(!r){const p=le({page:e.subject.page,withPlaceholder:s,axis:e.axis,frame:e.frame});return{...e,subject:p}}const c=i?$(r.scroll.max,i):r.scroll.max,a=Dr(r,c),d=le({page:e.subject.page,withPlaceholder:s,axis:e.axis,frame:a});return{...e,subject:d,frame:a}},Ps=e=>{const t=e.subject.withPlaceholder;t||(process.env.NODE_ENV!=="production"?f(!1,"Cannot remove placeholder form subject when there was none"):f());const n=e.frame;if(!n){const s=le({page:e.subject.page,axis:e.axis,frame:null,withPlaceholder:null});return{...e,subject:s}}const r=t.oldFrameMaxScroll;r||(process.env.NODE_ENV!=="production"?f(!1,"Expected droppable with frame to have old max frame scroll when removing placeholder"):f());const o=Dr(n,r),i=le({page:e.subject.page,axis:e.axis,frame:o,withPlaceholder:null});return{...e,subject:i,frame:o}};var Ts=({previousPageBorderBoxCenter:e,moveRelativeTo:t,insideDestination:n,draggable:r,draggables:o,destination:i,viewport:s,afterCritical:c})=>{if(!t){if(n.length)return null;const l={displaced:ye,displacedBy:lr,at:{type:"REORDER",destination:{droppableId:i.descriptor.id,index:0}}},u=Ye({impact:l,draggable:r,droppable:i,draggables:o,afterCritical:c}),g=de(r,i)?i:Nr(i,r,o);return yr({draggable:r,destination:g,newPageBorderBoxCenter:u,viewport:s.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0})?l:null}const a=e[i.axis.line]<=t.page.borderBox.center[i.axis.line],d=(()=>{const l=t.descriptor.index;return t.descriptor.id===r.descriptor.id||a?l:l+1})(),p=De(i.axis,r.displaceBy);return je({draggable:r,insideDestination:n,destination:i,viewport:s,displacedBy:p,last:ye,index:d})},Bs=({isMovingForward:e,previousPageBorderBoxCenter:t,draggable:n,isOver:r,draggables:o,droppables:i,viewport:s,afterCritical:c})=>{const a=Os({isMovingForward:e,pageBorderBoxCenter:t,source:r,droppables:i,viewport:s});if(!a)return null;const d=ie(a.descriptor.id,o),p=_s({pageBorderBoxCenter:t,viewport:s,destination:a,insideDestination:d,afterCritical:c}),l=Ts({previousPageBorderBoxCenter:t,destination:a,draggable:n,draggables:o,moveRelativeTo:p,insideDestination:d,viewport:s,afterCritical:c});if(!l)return null;const u=Ye({impact:l,draggable:n,droppable:a,draggables:o,afterCritical:c});return{clientSelection:Pt({pageBorderBoxCenter:u,draggable:n,viewport:s}),impact:l,scrollJumpRequest:null}},W=e=>{const t=e.at;return t?t.type==="REORDER"?t.destination.droppableId:t.combine.droppableId:null};const Vs=(e,t)=>{const n=W(e);return n?t[n]:null};var Ls=({state:e,type:t})=>{const n=Vs(e.impact,e.dimensions.droppables),r=!!n,o=e.dimensions.droppables[e.critical.droppable.id],i=n||o,s=i.axis.direction,c=s==="vertical"&&(t==="MOVE_UP"||t==="MOVE_DOWN")||s==="horizontal"&&(t==="MOVE_LEFT"||t==="MOVE_RIGHT");if(c&&!r)return null;const a=t==="MOVE_DOWN"||t==="MOVE_RIGHT",d=e.dimensions.draggables[e.critical.draggable.id],p=e.current.page.borderBoxCenter,{draggables:l,droppables:u}=e.dimensions;return c?Cs({isMovingForward:a,previousPageBorderBoxCenter:p,draggable:d,destination:i,draggables:l,viewport:e.viewport,previousClientSelection:e.current.client.selection,previousImpact:e.impact,afterCritical:e.afterCritical}):Bs({isMovingForward:a,previousPageBorderBoxCenter:p,draggable:d,isOver:i,draggables:l,droppables:u,viewport:e.viewport,afterCritical:e.afterCritical})};function se(e){return e.phase==="DRAGGING"||e.phase==="COLLECTING"}function xr(e){const t=X(e.top,e.bottom),n=X(e.left,e.right);return function(o){return t(o.y)&&n(o.x)}}function Rs(e,t){return e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top}function Ms({pageBorderBox:e,draggable:t,candidates:n}){const r=t.page.borderBox.center,o=n.map(i=>{const s=i.axis,c=oe(i.axis.line,e.center[s.line],i.page.borderBox.center[s.crossAxisLine]);return{id:i.descriptor.id,distance:be(r,c)}}).sort((i,s)=>s.distance-i.distance);return o[0]?o[0].id:null}function $s({pageBorderBox:e,draggable:t,droppables:n}){const r=He(n).filter(o=>{if(!o.isEnabled)return!1;const i=o.subject.active;if(!i||!Rs(e,i))return!1;if(xr(i)(e.center))return!0;const s=o.axis,c=i.center[s.crossAxisLine],a=e[s.crossAxisStart],d=e[s.crossAxisEnd],p=X(i[s.crossAxisStart],i[s.crossAxisEnd]),l=p(a),u=p(d);return!l&&!u?!0:l?a<c:d>c});return r.length?r.length===1?r[0].descriptor.id:Ms({pageBorderBox:e,draggable:t,candidates:r}):null}const Ir=(e,t)=>K(ve(e,t));var Gs=(e,t)=>{const n=e.frame;return n?Ir(t,n.scroll.diff.value):t};function Sr({displaced:e,id:t}){return!!(e.visible[t]||e.invisible[t])}function ks({draggable:e,closest:t,inHomeList:n}){return t?n&&t.descriptor.index>e.descriptor.index?t.descriptor.index-1:t.descriptor.index:null}var Fs=({pageBorderBoxWithDroppableScroll:e,draggable:t,destination:n,insideDestination:r,last:o,viewport:i,afterCritical:s})=>{const c=n.axis,a=De(n.axis,t.displaceBy),d=a.value,p=e[c.start],l=e[c.end],g=qe(t,r).find(b=>{const h=b.descriptor.id,E=b.page.borderBox.center[c.line],y=re(h,s),C=Sr({displaced:o,id:h});return y?C?l<=E:p<E-d:C?l<=E+d:p<E})||null,m=ks({draggable:t,closest:g,inHomeList:de(t,n)});return je({draggable:t,insideDestination:r,destination:n,viewport:i,last:o,displacedBy:a,index:m})};const Ws=4;var Us=({draggable:e,pageBorderBoxWithDroppableScroll:t,previousImpact:n,destination:r,insideDestination:o,afterCritical:i})=>{if(!r.isCombineEnabled)return null;const s=r.axis,c=De(r.axis,e.displaceBy),a=c.value,d=t[s.start],p=t[s.end],u=qe(e,o).find(m=>{const b=m.descriptor.id,h=m.page.borderBox,y=h[s.size]/Ws,C=re(b,i),I=Sr({displaced:n.displaced,id:b});return C?I?p>h[s.start]+y&&p<h[s.end]-y:d>h[s.start]-a+y&&d<h[s.end]-a-y:I?p>h[s.start]+a+y&&p<h[s.end]+a-y:d>h[s.start]+y&&d<h[s.end]-y});return u?{displacedBy:c,displaced:n.displaced,at:{type:"COMBINE",combine:{draggableId:u.descriptor.id,droppableId:r.descriptor.id}}}:null},Cr=({pageOffset:e,draggable:t,draggables:n,droppables:r,previousImpact:o,viewport:i,afterCritical:s})=>{const c=Ir(t.page.borderBox,e),a=$s({pageBorderBox:c,draggable:t,droppables:r});if(!a)return rs;const d=r[a],p=ie(d.descriptor.id,n),l=Gs(d,c);return Us({pageBorderBoxWithDroppableScroll:l,draggable:t,previousImpact:o,destination:d,insideDestination:p,afterCritical:s})||Fs({pageBorderBoxWithDroppableScroll:l,draggable:t,destination:d,insideDestination:p,last:o.displaced,viewport:i,afterCritical:s})},Tt=(e,t)=>({...e,[t.descriptor.id]:t});const Hs=({previousImpact:e,impact:t,droppables:n})=>{const r=W(e),o=W(t);if(!r||r===o)return n;const i=n[r];if(!i.subject.withPlaceholder)return n;const s=Ps(i);return Tt(n,s)};var zs=({draggable:e,draggables:t,droppables:n,previousImpact:r,impact:o})=>{const i=Hs({previousImpact:r,impact:o,droppables:n}),s=W(o);if(!s)return i;const c=n[s];if(de(e,c)||c.subject.withPlaceholder)return i;const a=Nr(c,e,t);return Tt(i,a)},Ne=({state:e,clientSelection:t,dimensions:n,viewport:r,impact:o,scrollJumpRequest:i})=>{const s=r||e.viewport,c=n||e.dimensions,a=t||e.current.client.selection,d=F(a,e.initial.client.selection),p={offset:d,selection:a,borderBoxCenter:$(e.initial.client.borderBoxCenter,d)},l={selection:$(p.selection,s.scroll.current),borderBoxCenter:$(p.borderBoxCenter,s.scroll.current),offset:$(p.offset,s.scroll.diff.value)},u={client:p,page:l};if(e.phase==="COLLECTING")return{...e,dimensions:c,viewport:s,current:u};const g=c.draggables[e.critical.draggable.id],m=o||Cr({pageOffset:l.offset,draggable:g,draggables:c.draggables,droppables:c.droppables,previousImpact:e.impact,viewport:s,afterCritical:e.afterCritical}),b=zs({draggable:g,impact:m,previousImpact:e.impact,draggables:c.draggables,droppables:c.droppables});return{...e,current:u,dimensions:{draggables:c.draggables,droppables:b},impact:m,viewport:s,scrollJumpRequest:i||null,forceShouldAnimate:i?!1:null}};function qs(e,t){return e.map(n=>t[n])}var Or=({impact:e,viewport:t,draggables:n,destination:r,forceShouldAnimate:o})=>{const i=e.displaced,s=qs(i.all,n),c=Ee({afterDragging:s,destination:r,displacedBy:e.displacedBy,viewport:t.frame,forceShouldAnimate:o,last:i});return{...e,displaced:c}},wr=({impact:e,draggable:t,droppable:n,draggables:r,viewport:o,afterCritical:i})=>{const s=Ye({impact:e,draggable:t,draggables:r,droppable:n,afterCritical:i});return Pt({pageBorderBoxCenter:s,draggable:t,viewport:o})},_r=({state:e,dimensions:t,viewport:n})=>{e.movementMode!=="SNAP"&&(process.env.NODE_ENV,f());const r=e.impact,o=n||e.viewport,i=t||e.dimensions,{draggables:s,droppables:c}=i,a=s[e.critical.draggable.id],d=W(r);d||(process.env.NODE_ENV!=="production"?f(!1,"Must be over a destination in SNAP movement mode"):f());const p=c[d],l=Or({impact:r,viewport:o,destination:p,draggables:s}),u=wr({impact:l,draggable:a,droppable:p,draggables:s,viewport:o,afterCritical:e.afterCritical});return Ne({impact:l,clientSelection:u,state:e,dimensions:i,viewport:o})},js=e=>({index:e.index,droppableId:e.droppableId}),Ar=({draggable:e,home:t,draggables:n,viewport:r})=>{const o=De(t.axis,e.displaceBy),i=ie(t.descriptor.id,n),s=i.indexOf(e);s===-1&&(process.env.NODE_ENV!=="production"?f(!1,"Expected draggable to be inside home list"):f());const c=i.slice(s+1),a=c.reduce((u,g)=>(u[g.descriptor.id]=!0,u),{}),d={inVirtualList:t.descriptor.mode==="virtual",displacedBy:o,effected:a};return{impact:{displaced:Ee({afterDragging:c,destination:t,displacedBy:o,last:null,viewport:r.frame,forceShouldAnimate:!1}),displacedBy:o,at:{type:"REORDER",destination:js(e.descriptor)}},afterCritical:d}},Ys=(e,t)=>({draggables:e.draggables,droppables:Tt(e.droppables,t)});const xe=e=>{process.env.NODE_ENV},Ie=e=>{process.env.NODE_ENV};var Xs=({draggable:e,offset:t,initialWindowScroll:n})=>{const r=Ge(e.client,t),o=ke(r,n);return{...e,placeholder:{...e.placeholder,client:r},client:r,page:o}},Ks=e=>{const t=e.frame;return t||(process.env.NODE_ENV!=="production"?f(!1,"Expected Droppable to have a frame"):f()),t},Js=({additions:e,updatedDroppables:t,viewport:n})=>{const r=n.scroll.diff.value;return e.map(o=>{const i=o.descriptor.droppableId,s=t[i],a=Ks(s).scroll.diff.value,d=$(r,a);return Xs({draggable:o,offset:d,initialWindowScroll:n.scroll.initial})})},Zs=({state:e,published:t})=>{xe();const n=t.modified.map(E=>{const y=e.dimensions.droppables[E.droppableId];return St(y,E.scroll)}),r={...e.dimensions.droppables,...cr(n)},o=ar(Js({additions:t.additions,updatedDroppables:r,viewport:e.viewport})),i={...e.dimensions.draggables,...o};t.removals.forEach(E=>{delete i[E]});const s={droppables:r,draggables:i},c=W(e.impact),a=c?s.droppables[c]:null,d=s.draggables[e.critical.draggable.id],p=s.droppables[e.critical.droppable.id],{impact:l,afterCritical:u}=Ar({draggable:d,home:p,draggables:i,viewport:e.viewport}),g=a&&a.isCombineEnabled?e.impact:l,m=Cr({pageOffset:e.current.page.offset,draggable:s.draggables[e.critical.draggable.id],draggables:s.draggables,droppables:s.droppables,previousImpact:g,viewport:e.viewport,afterCritical:u});Ie();const b={...e,phase:"DRAGGING",impact:m,onLiftImpact:l,dimensions:s,afterCritical:u,forceShouldAnimate:!1};return e.phase==="COLLECTING"?b:{...b,phase:"DROP_PENDING",reason:e.reason,isWaiting:!1}};const Bt=e=>e.movementMode==="SNAP",Vt=(e,t,n)=>{const r=Ys(e.dimensions,t);return!Bt(e)||n?Ne({state:e,dimensions:r}):_r({state:e,dimensions:r})};function Lt(e){return e.isDragging&&e.movementMode==="SNAP"?{...e,scrollJumpRequest:null}:e}const Pr={phase:"IDLE",completed:null,shouldFlush:!1};var Qs=(e=Pr,t)=>{if(t.type==="FLUSH")return{...Pr,shouldFlush:!0};if(t.type==="INITIAL_PUBLISH"){e.phase!=="IDLE"&&(process.env.NODE_ENV!=="production"?f(!1,"INITIAL_PUBLISH must come after a IDLE phase"):f());const{critical:n,clientSelection:r,viewport:o,dimensions:i,movementMode:s}=t.payload,c=i.draggables[n.draggable.id],a=i.droppables[n.droppable.id],d={selection:r,borderBoxCenter:c.client.borderBox.center,offset:R},p={client:d,page:{selection:$(d.selection,o.scroll.initial),borderBoxCenter:$(d.selection,o.scroll.initial),offset:$(d.selection,o.scroll.diff.value)}},l=He(i.droppables).every(b=>!b.isFixedOnPage),{impact:u,afterCritical:g}=Ar({draggable:c,home:a,draggables:i.draggables,viewport:o});return{phase:"DRAGGING",isDragging:!0,critical:n,movementMode:s,dimensions:i,initial:p,current:p,isWindowScrollAllowed:l,impact:u,afterCritical:g,onLiftImpact:u,viewport:o,scrollJumpRequest:null,forceShouldAnimate:null}}if(t.type==="COLLECTION_STARTING")return e.phase==="COLLECTING"||e.phase==="DROP_PENDING"?e:(e.phase!=="DRAGGING"&&(process.env.NODE_ENV!=="production"?f(!1,`Collection cannot start from phase ${e.phase}`):f()),{...e,phase:"COLLECTING"});if(t.type==="PUBLISH_WHILE_DRAGGING")return e.phase==="COLLECTING"||e.phase==="DROP_PENDING"||(process.env.NODE_ENV!=="production"?f(!1,`Unexpected ${t.type} received in phase ${e.phase}`):f()),Zs({state:e,published:t.payload});if(t.type==="MOVE"){if(e.phase==="DROP_PENDING")return e;se(e)||(process.env.NODE_ENV!=="production"?f(!1,`${t.type} not permitted in phase ${e.phase}`):f());const{client:n}=t.payload;return ne(n,e.current.client.selection)?e:Ne({state:e,clientSelection:n,impact:Bt(e)?e.impact:null})}if(t.type==="UPDATE_DROPPABLE_SCROLL"){if(e.phase==="DROP_PENDING"||e.phase==="COLLECTING")return Lt(e);se(e)||(process.env.NODE_ENV!=="production"?f(!1,`${t.type} not permitted in phase ${e.phase}`):f());const{id:n,newScroll:r}=t.payload,o=e.dimensions.droppables[n];if(!o)return e;const i=St(o,r);return Vt(e,i,!1)}if(t.type==="UPDATE_DROPPABLE_IS_ENABLED"){if(e.phase==="DROP_PENDING")return e;se(e)||(process.env.NODE_ENV!=="production"?f(!1,`Attempting to move in an unsupported phase ${e.phase}`):f());const{id:n,isEnabled:r}=t.payload,o=e.dimensions.droppables[n];o||(process.env.NODE_ENV!=="production"?f(!1,`Cannot find Droppable[id: ${n}] to toggle its enabled state`):f()),o.isEnabled===r&&(process.env.NODE_ENV!=="production"?f(!1,`Trying to set droppable isEnabled to ${String(r)}
66
+ `}};function ji(e,t){return!!(e===t||Number.isNaN(e)&&Number.isNaN(t))}function rr(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!ji(e[n],t[n]))return!1;return!0}function w(e,t){const n=D.useState(()=>({inputs:t,result:e()}))[0],r=D.useRef(!0),o=D.useRef(n),s=r.current||!!(t&&o.current.inputs&&rr(t,o.current.inputs))?o.current:{inputs:t,result:e()};return D.useEffect(()=>{r.current=!1,o.current=s},[s]),s.result}function x(e,t){return w(()=>e,t)}const R={x:0,y:0},$=(e,t)=>({x:e.x+t.x,y:e.y+t.y}),F=(e,t)=>({x:e.x-t.x,y:e.y-t.y}),ne=(e,t)=>e.x===t.x&&e.y===t.y,ae=e=>({x:e.x!==0?-e.x:0,y:e.y!==0?-e.y:0}),oe=(e,t,n=0)=>e==="x"?{x:t,y:n}:{x:n,y:t},be=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),or=(e,t)=>Math.min(...t.map(n=>be(e,n))),ir=e=>t=>({x:e(t.x),y:e(t.y)});var Yi=(e,t)=>{const n=K({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};const ve=(e,t)=>({top:e.top+t.y,left:e.left+t.x,bottom:e.bottom+t.y,right:e.right+t.x}),sr=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}],Xi={top:0,right:0,bottom:0,left:0},Ki=(e,t)=>t?ve(e,t.scroll.diff.displacement):e,Ji=(e,t,n)=>n&&n.increasedBy?{...e,[t.end]:e[t.end]+n.increasedBy[t.line]}:e,Zi=(e,t)=>t&&t.shouldClipSubject?Yi(t.pageMarginBox,e):K(e);var le=({page:e,withPlaceholder:t,axis:n,frame:r})=>{const o=Ki(e.marginBox,r),i=Ji(o,n,t),s=Zi(i,r);return{page:e,withPlaceholder:t,active:s}},Ct=(e,t)=>{e.frame||(process.env.NODE_ENV,f());const n=e.frame,r=F(t,n.scroll.initial),o=ae(r),i={...n,scroll:{initial:n.scroll.initial,current:t,diff:{value:r,displacement:o},max:n.scroll.max}},s=le({page:e.subject.page,withPlaceholder:e.subject.withPlaceholder,axis:e.axis,frame:i});return{...e,frame:i,subject:s}};function M(e,t=rr){let n=null;function r(...o){if(n&&n.lastThis===this&&t(o,n.lastArgs))return n.lastResult;const i=e.apply(this,o);return n={lastResult:i,lastArgs:o,lastThis:this},i}return r.clear=function(){n=null},r}const cr=M(e=>e.reduce((t,n)=>(t[n.descriptor.id]=n,t),{})),ar=M(e=>e.reduce((t,n)=>(t[n.descriptor.id]=n,t),{})),He=M(e=>Object.values(e)),Qi=M(e=>Object.values(e));var ie=M((e,t)=>Qi(t).filter(r=>e===r.descriptor.droppableId).sort((r,o)=>r.descriptor.index-o.descriptor.index));function St(e){return e.at&&e.at.type==="REORDER"?e.at.destination:null}function ze(e){return e.at&&e.at.type==="COMBINE"?e.at.combine:null}var qe=M((e,t)=>t.filter(n=>n.descriptor.id!==e.descriptor.id)),es=({isMovingForward:e,draggable:t,destination:n,insideDestination:r,previousImpact:o})=>{if(!n.isCombineEnabled||!St(o))return null;function s(g){const h={type:"COMBINE",combine:{draggableId:g,droppableId:n.descriptor.id}};return{...o,at:h}}const c=o.displaced.all,a=c.length?c[0]:null;if(e)return a?s(a):null;const d=qe(t,r);if(!a){if(!d.length)return null;const g=d[d.length-1];return s(g.descriptor.id)}const p=d.findIndex(g=>g.descriptor.id===a);p===-1&&(process.env.NODE_ENV!=="production"?f(!1,"Could not find displaced item in set"):f());const l=p-1;if(l<0)return null;const u=d[l];return s(u.descriptor.id)},de=(e,t)=>e.descriptor.droppableId===t.descriptor.id;const lr={point:R,value:0},ye={invisible:{},visible:{},all:[]},ts={displaced:ye,displacedBy:lr,at:null};var X=(e,t)=>n=>e<=n&&n<=t,dr=e=>{const t=X(e.top,e.bottom),n=X(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),s=n(r.left)||n(r.right);if(i&&s)return!0;const a=r.top<e.top&&r.bottom>e.bottom,d=r.left<e.left&&r.right>e.right;return a&&d?!0:a&&s||d&&i}},ns=e=>{const t=X(e.top,e.bottom),n=X(e.left,e.right);return r=>t(r.top)&&t(r.bottom)&&n(r.left)&&n(r.right)};const Ot={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},ur={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"};var rs=e=>t=>{const n=X(t.top,t.bottom),r=X(t.left,t.right);return o=>e===Ot?n(o.top)&&n(o.bottom):r(o.left)&&r(o.right)};const os=(e,t)=>{const n=t.frame?t.frame.scroll.diff.displacement:R;return ve(e,n)},is=(e,t,n)=>t.subject.active?n(t.subject.active)(e):!1,ss=(e,t,n)=>n(t)(e),wt=({target:e,destination:t,viewport:n,withDroppableDisplacement:r,isVisibleThroughFrameFn:o})=>{const i=r?os(e,t):e;return is(i,t,o)&&ss(i,n,o)},cs=e=>wt({...e,isVisibleThroughFrameFn:dr}),pr=e=>wt({...e,isVisibleThroughFrameFn:ns}),as=e=>wt({...e,isVisibleThroughFrameFn:rs(e.destination.axis)}),ls=(e,t,n)=>{if(typeof n=="boolean")return n;if(!t)return!0;const{invisible:r,visible:o}=t;if(r[e])return!1;const i=o[e];return i?i.shouldAnimate:!0};function ds(e,t){const n=e.page.marginBox,r={top:t.point.y,right:0,bottom:0,left:t.point.x};return K(Dt(n,r))}function Ee({afterDragging:e,destination:t,displacedBy:n,viewport:r,forceShouldAnimate:o,last:i}){return e.reduce(function(c,a){const d=ds(a,n),p=a.descriptor.id;if(c.all.push(p),!cs({target:d,destination:t,viewport:r,withDroppableDisplacement:!0}))return c.invisible[a.descriptor.id]=!0,c;const u=ls(p,i,o),g={draggableId:p,shouldAnimate:u};return c.visible[p]=g,c},{all:[],visible:{},invisible:{}})}function us(e,t){if(!e.length)return 0;const n=e[e.length-1].descriptor.index;return t.inHomeList?n:n+1}function fr({insideDestination:e,inHomeList:t,displacedBy:n,destination:r}){const o=us(e,{inHomeList:t});return{displaced:ye,displacedBy:n,at:{type:"REORDER",destination:{droppableId:r.descriptor.id,index:o}}}}function je({draggable:e,insideDestination:t,destination:n,viewport:r,displacedBy:o,last:i,index:s,forceShouldAnimate:c}){const a=de(e,n);if(s==null)return fr({insideDestination:t,inHomeList:a,displacedBy:o,destination:n});const d=t.find(h=>h.descriptor.index===s);if(!d)return fr({insideDestination:t,inHomeList:a,displacedBy:o,destination:n});const p=qe(e,t),l=t.indexOf(d),u=p.slice(l);return{displaced:Ee({afterDragging:u,destination:n,displacedBy:o,last:i,viewport:r.frame,forceShouldAnimate:c}),displacedBy:o,at:{type:"REORDER",destination:{droppableId:n.descriptor.id,index:s}}}}function re(e,t){return!!t.effected[e]}var ps=({isMovingForward:e,destination:t,draggables:n,combine:r,afterCritical:o})=>{if(!t.isCombineEnabled)return null;const i=r.draggableId,c=n[i].descriptor.index;return re(i,o)?e?c:c-1:e?c+1:c},fs=({isMovingForward:e,isInHomeList:t,insideDestination:n,location:r})=>{if(!n.length)return null;const o=r.index,i=e?o+1:o-1,s=n[0].descriptor.index,c=n[n.length-1].descriptor.index,a=t?c:c+1;return i<s||i>a?null:i},gs=({isMovingForward:e,isInHomeList:t,draggable:n,draggables:r,destination:o,insideDestination:i,previousImpact:s,viewport:c,afterCritical:a})=>{const d=s.at;if(d||(process.env.NODE_ENV!=="production"?f(!1,"Cannot move in direction without previous impact location"):f()),d.type==="REORDER"){const l=fs({isMovingForward:e,isInHomeList:t,location:d.destination,insideDestination:i});return l==null?null:je({draggable:n,insideDestination:i,destination:o,viewport:c,last:s.displaced,displacedBy:s.displacedBy,index:l})}const p=ps({isMovingForward:e,destination:o,displaced:s.displaced,draggables:r,combine:d.combine,afterCritical:a});return p==null?null:je({draggable:n,insideDestination:i,destination:o,viewport:c,last:s.displaced,displacedBy:s.displacedBy,index:p})},ms=({displaced:e,afterCritical:t,combineWith:n,displacedBy:r})=>{const o=!!(e.visible[n]||e.invisible[n]);return re(n,t)?o?R:ae(r.point):o?r.point:R},hs=({afterCritical:e,impact:t,draggables:n})=>{const r=ze(t);r||(process.env.NODE_ENV,f());const o=r.draggableId,i=n[o].page.borderBox.center,s=ms({displaced:t.displaced,afterCritical:e,combineWith:o,displacedBy:t.displacedBy});return $(i,s)};const gr=(e,t)=>t.margin[e.start]+t.borderBox[e.size]/2,bs=(e,t)=>t.margin[e.end]+t.borderBox[e.size]/2,_t=(e,t,n)=>t[e.crossAxisStart]+n.margin[e.crossAxisStart]+n.borderBox[e.crossAxisSize]/2,mr=({axis:e,moveRelativeTo:t,isMoving:n})=>oe(e.line,t.marginBox[e.end]+gr(e,n),_t(e,t.marginBox,n)),hr=({axis:e,moveRelativeTo:t,isMoving:n})=>oe(e.line,t.marginBox[e.start]-bs(e,n),_t(e,t.marginBox,n)),vs=({axis:e,moveInto:t,isMoving:n})=>oe(e.line,t.contentBox[e.start]+gr(e,n),_t(e,t.contentBox,n));var ys=({impact:e,draggable:t,draggables:n,droppable:r,afterCritical:o})=>{const i=ie(r.descriptor.id,n),s=t.page,c=r.axis;if(!i.length)return vs({axis:c,moveInto:r.page,isMoving:s});const{displaced:a,displacedBy:d}=e,p=a.all[0];if(p){const u=n[p];if(re(p,o))return hr({axis:c,moveRelativeTo:u.page,isMoving:s});const g=Ge(u.page,d.point);return hr({axis:c,moveRelativeTo:g,isMoving:s})}const l=i[i.length-1];if(l.descriptor.id===t.descriptor.id)return s.borderBox.center;if(re(l.descriptor.id,o)){const u=Ge(l.page,ae(o.displacedBy.point));return mr({axis:c,moveRelativeTo:u,isMoving:s})}return mr({axis:c,moveRelativeTo:l.page,isMoving:s})},At=(e,t)=>{const n=e.frame;return n?$(t,n.scroll.diff.displacement):t};const Es=({impact:e,draggable:t,droppable:n,draggables:r,afterCritical:o})=>{const i=t.page.borderBox.center,s=e.at;return!n||!s?i:s.type==="REORDER"?ys({impact:e,draggable:t,draggables:r,droppable:n,afterCritical:o}):hs({impact:e,draggables:r,afterCritical:o})};var Ye=e=>{const t=Es(e),n=e.droppable;return n?At(n,t):t},br=(e,t)=>{const n=F(t,e.scroll.initial),r=ae(n);return{frame:K({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 vr(e,t){return e.map(n=>t[n])}function Ds(e,t){for(let n=0;n<t.length;n++){const r=t[n].visible[e];if(r)return r}return null}var Ns=({impact:e,viewport:t,destination:n,draggables:r,maxScrollChange:o})=>{const i=br(t,$(t.scroll.current,o)),s=n.frame?Ct(n,$(n.frame.scroll.current,o)):n,c=e.displaced,a=Ee({afterDragging:vr(c.all,r),destination:n,displacedBy:e.displacedBy,viewport:i.frame,last:c,forceShouldAnimate:!1}),d=Ee({afterDragging:vr(c.all,r),destination:s,displacedBy:e.displacedBy,viewport:t.frame,last:c,forceShouldAnimate:!1}),p={},l={},u=[c,a,d];return c.all.forEach(h=>{const b=Ds(h,u);if(b){l[h]=b;return}p[h]=!0}),{...e,displaced:{all:c.all,invisible:p,visible:l}}},xs=(e,t)=>$(e.scroll.diff.displacement,t),Pt=({pageBorderBoxCenter:e,draggable:t,viewport:n})=>{const r=xs(n,e),o=F(r,t.page.borderBox.center);return $(t.client.borderBox.center,o)},yr=({draggable:e,destination:t,newPageBorderBoxCenter:n,viewport:r,withDroppableDisplacement:o,onlyOnMainAxis:i=!1})=>{const s=F(n,e.page.borderBox.center),a={target:ve(e.page.borderBox,s),destination:t,withDroppableDisplacement:o,viewport:r};return i?as(a):pr(a)},Is=({isMovingForward:e,draggable:t,destination:n,draggables:r,previousImpact:o,viewport:i,previousPageBorderBoxCenter:s,previousClientSelection:c,afterCritical:a})=>{if(!n.isEnabled)return null;const d=ie(n.descriptor.id,r),p=de(t,n),l=es({isMovingForward:e,draggable:t,destination:n,insideDestination:d,previousImpact:o})||gs({isMovingForward:e,isInHomeList:p,draggable:t,draggables:r,destination:n,insideDestination:d,previousImpact:o,viewport:i,afterCritical:a});if(!l)return null;const u=Ye({impact:l,draggable:t,droppable:n,draggables:r,afterCritical:a});if(yr({draggable:t,destination:n,newPageBorderBoxCenter:u,viewport:i.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0}))return{clientSelection:Pt({pageBorderBoxCenter:u,draggable:t,viewport:i}),impact:l,scrollJumpRequest:null};const h=F(u,s),b=Ns({impact:l,viewport:i,destination:n,draggables:r,maxScrollChange:h});return{clientSelection:c,impact:b,scrollJumpRequest:h}};const k=e=>{const t=e.subject.active;return t||(process.env.NODE_ENV!=="production"?f(!1,"Cannot get clipped area from droppable"):f()),t};var Cs=({isMovingForward:e,pageBorderBoxCenter:t,source:n,droppables:r,viewport:o})=>{const i=n.subject.active;if(!i)return null;const s=n.axis,c=X(i[s.start],i[s.end]),a=He(r).filter(p=>p!==n).filter(p=>p.isEnabled).filter(p=>!!p.subject.active).filter(p=>dr(o.frame)(k(p))).filter(p=>{const l=k(p);return e?i[s.crossAxisEnd]<l[s.crossAxisEnd]:l[s.crossAxisStart]<i[s.crossAxisStart]}).filter(p=>{const l=k(p),u=X(l[s.start],l[s.end]);return c(l[s.start])||c(l[s.end])||u(i[s.start])||u(i[s.end])}).sort((p,l)=>{const u=k(p)[s.crossAxisStart],g=k(l)[s.crossAxisStart];return e?u-g:g-u}).filter((p,l,u)=>k(p)[s.crossAxisStart]===k(u[0])[s.crossAxisStart]);if(!a.length)return null;if(a.length===1)return a[0];const d=a.filter(p=>X(k(p)[s.start],k(p)[s.end])(t[s.line]));return d.length===1?d[0]:d.length>1?d.sort((p,l)=>k(p)[s.start]-k(l)[s.start])[0]:a.sort((p,l)=>{const u=or(t,sr(k(p))),g=or(t,sr(k(l)));return u!==g?u-g:k(p)[s.start]-k(l)[s.start]})[0]};const Er=(e,t)=>{const n=e.page.borderBox.center;return re(e.descriptor.id,t)?F(n,t.displacedBy.point):n},Ss=(e,t)=>{const n=e.page.borderBox;return re(e.descriptor.id,t)?ve(n,ae(t.displacedBy.point)):n};var Os=({pageBorderBoxCenter:e,viewport:t,destination:n,insideDestination:r,afterCritical:o})=>r.filter(s=>pr({target:Ss(s,o),destination:n,viewport:t.frame,withDroppableDisplacement:!0})).sort((s,c)=>{const a=be(e,At(n,Er(s,o))),d=be(e,At(n,Er(c,o)));return a<d?-1:d<a?1:s.descriptor.index-c.descriptor.index})[0]||null,De=M(function(t,n){const r=n[t.line];return{value:r,point:oe(t.line,r)}});const ws=(e,t,n)=>{const r=e.axis;if(e.descriptor.mode==="virtual")return oe(r.line,t[r.line]);const o=e.subject.page.contentBox[r.size],a=ie(e.descriptor.id,n).reduce((d,p)=>d+p.client.marginBox[r.size],0)+t[r.line]-o;return a<=0?null:oe(r.line,a)},Dr=(e,t)=>({...e,scroll:{...e.scroll,max:t}}),Nr=(e,t,n)=>{const r=e.frame;de(t,e)&&(process.env.NODE_ENV!=="production"?f(!1,"Should not add placeholder space to home list"):f()),e.subject.withPlaceholder&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot add placeholder size to a subject when it already has one"):f());const o=De(e.axis,t.displaceBy).point,i=ws(e,o,n),s={placeholderSize:o,increasedBy:i,oldFrameMaxScroll:e.frame?e.frame.scroll.max:null};if(!r){const p=le({page:e.subject.page,withPlaceholder:s,axis:e.axis,frame:e.frame});return{...e,subject:p}}const c=i?$(r.scroll.max,i):r.scroll.max,a=Dr(r,c),d=le({page:e.subject.page,withPlaceholder:s,axis:e.axis,frame:a});return{...e,subject:d,frame:a}},_s=e=>{const t=e.subject.withPlaceholder;t||(process.env.NODE_ENV!=="production"?f(!1,"Cannot remove placeholder form subject when there was none"):f());const n=e.frame;if(!n){const s=le({page:e.subject.page,axis:e.axis,frame:null,withPlaceholder:null});return{...e,subject:s}}const r=t.oldFrameMaxScroll;r||(process.env.NODE_ENV!=="production"?f(!1,"Expected droppable with frame to have old max frame scroll when removing placeholder"):f());const o=Dr(n,r),i=le({page:e.subject.page,axis:e.axis,frame:o,withPlaceholder:null});return{...e,subject:i,frame:o}};var As=({previousPageBorderBoxCenter:e,moveRelativeTo:t,insideDestination:n,draggable:r,draggables:o,destination:i,viewport:s,afterCritical:c})=>{if(!t){if(n.length)return null;const l={displaced:ye,displacedBy:lr,at:{type:"REORDER",destination:{droppableId:i.descriptor.id,index:0}}},u=Ye({impact:l,draggable:r,droppable:i,draggables:o,afterCritical:c}),g=de(r,i)?i:Nr(i,r,o);return yr({draggable:r,destination:g,newPageBorderBoxCenter:u,viewport:s.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0})?l:null}const a=e[i.axis.line]<=t.page.borderBox.center[i.axis.line],d=(()=>{const l=t.descriptor.index;return t.descriptor.id===r.descriptor.id||a?l:l+1})(),p=De(i.axis,r.displaceBy);return je({draggable:r,insideDestination:n,destination:i,viewport:s,displacedBy:p,last:ye,index:d})},Ps=({isMovingForward:e,previousPageBorderBoxCenter:t,draggable:n,isOver:r,draggables:o,droppables:i,viewport:s,afterCritical:c})=>{const a=Cs({isMovingForward:e,pageBorderBoxCenter:t,source:r,droppables:i,viewport:s});if(!a)return null;const d=ie(a.descriptor.id,o),p=Os({pageBorderBoxCenter:t,viewport:s,destination:a,insideDestination:d,afterCritical:c}),l=As({previousPageBorderBoxCenter:t,destination:a,draggable:n,draggables:o,moveRelativeTo:p,insideDestination:d,viewport:s,afterCritical:c});if(!l)return null;const u=Ye({impact:l,draggable:n,droppable:a,draggables:o,afterCritical:c});return{clientSelection:Pt({pageBorderBoxCenter:u,draggable:n,viewport:s}),impact:l,scrollJumpRequest:null}},W=e=>{const t=e.at;return t?t.type==="REORDER"?t.destination.droppableId:t.combine.droppableId:null};const Ts=(e,t)=>{const n=W(e);return n?t[n]:null};var Bs=({state:e,type:t})=>{const n=Ts(e.impact,e.dimensions.droppables),r=!!n,o=e.dimensions.droppables[e.critical.droppable.id],i=n||o,s=i.axis.direction,c=s==="vertical"&&(t==="MOVE_UP"||t==="MOVE_DOWN")||s==="horizontal"&&(t==="MOVE_LEFT"||t==="MOVE_RIGHT");if(c&&!r)return null;const a=t==="MOVE_DOWN"||t==="MOVE_RIGHT",d=e.dimensions.draggables[e.critical.draggable.id],p=e.current.page.borderBoxCenter,{draggables:l,droppables:u}=e.dimensions;return c?Is({isMovingForward:a,previousPageBorderBoxCenter:p,draggable:d,destination:i,draggables:l,viewport:e.viewport,previousClientSelection:e.current.client.selection,previousImpact:e.impact,afterCritical:e.afterCritical}):Ps({isMovingForward:a,previousPageBorderBoxCenter:p,draggable:d,isOver:i,draggables:l,droppables:u,viewport:e.viewport,afterCritical:e.afterCritical})};function se(e){return e.phase==="DRAGGING"||e.phase==="COLLECTING"}function xr(e){const t=X(e.top,e.bottom),n=X(e.left,e.right);return function(o){return t(o.y)&&n(o.x)}}function Vs(e,t){return e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top}function Ls({pageBorderBox:e,draggable:t,candidates:n}){const r=t.page.borderBox.center,o=n.map(i=>{const s=i.axis,c=oe(i.axis.line,e.center[s.line],i.page.borderBox.center[s.crossAxisLine]);return{id:i.descriptor.id,distance:be(r,c)}}).sort((i,s)=>s.distance-i.distance);return o[0]?o[0].id:null}function Rs({pageBorderBox:e,draggable:t,droppables:n}){const r=He(n).filter(o=>{if(!o.isEnabled)return!1;const i=o.subject.active;if(!i||!Vs(e,i))return!1;if(xr(i)(e.center))return!0;const s=o.axis,c=i.center[s.crossAxisLine],a=e[s.crossAxisStart],d=e[s.crossAxisEnd],p=X(i[s.crossAxisStart],i[s.crossAxisEnd]),l=p(a),u=p(d);return!l&&!u?!0:l?a<c:d>c});return r.length?r.length===1?r[0].descriptor.id:Ls({pageBorderBox:e,draggable:t,candidates:r}):null}const Ir=(e,t)=>K(ve(e,t));var Ms=(e,t)=>{const n=e.frame;return n?Ir(t,n.scroll.diff.value):t};function Cr({displaced:e,id:t}){return!!(e.visible[t]||e.invisible[t])}function $s({draggable:e,closest:t,inHomeList:n}){return t?n&&t.descriptor.index>e.descriptor.index?t.descriptor.index-1:t.descriptor.index:null}var Gs=({pageBorderBoxWithDroppableScroll:e,draggable:t,destination:n,insideDestination:r,last:o,viewport:i,afterCritical:s})=>{const c=n.axis,a=De(n.axis,t.displaceBy),d=a.value,p=e[c.start],l=e[c.end],g=qe(t,r).find(b=>{const m=b.descriptor.id,E=b.page.borderBox.center[c.line],y=re(m,s),S=Cr({displaced:o,id:m});return y?S?l<=E:p<E-d:S?l<=E+d:p<E})||null,h=$s({draggable:t,closest:g,inHomeList:de(t,n)});return je({draggable:t,insideDestination:r,destination:n,viewport:i,last:o,displacedBy:a,index:h})};const ks=4;var Fs=({draggable:e,pageBorderBoxWithDroppableScroll:t,previousImpact:n,destination:r,insideDestination:o,afterCritical:i})=>{if(!r.isCombineEnabled)return null;const s=r.axis,c=De(r.axis,e.displaceBy),a=c.value,d=t[s.start],p=t[s.end],u=qe(e,o).find(h=>{const b=h.descriptor.id,m=h.page.borderBox,y=m[s.size]/ks,S=re(b,i),I=Cr({displaced:n.displaced,id:b});return S?I?p>m[s.start]+y&&p<m[s.end]-y:d>m[s.start]-a+y&&d<m[s.end]-a-y:I?p>m[s.start]+a+y&&p<m[s.end]+a-y:d>m[s.start]+y&&d<m[s.end]-y});return u?{displacedBy:c,displaced:n.displaced,at:{type:"COMBINE",combine:{draggableId:u.descriptor.id,droppableId:r.descriptor.id}}}:null},Sr=({pageOffset:e,draggable:t,draggables:n,droppables:r,previousImpact:o,viewport:i,afterCritical:s})=>{const c=Ir(t.page.borderBox,e),a=Rs({pageBorderBox:c,draggable:t,droppables:r});if(!a)return ts;const d=r[a],p=ie(d.descriptor.id,n),l=Ms(d,c);return Fs({pageBorderBoxWithDroppableScroll:l,draggable:t,previousImpact:o,destination:d,insideDestination:p,afterCritical:s})||Gs({pageBorderBoxWithDroppableScroll:l,draggable:t,destination:d,insideDestination:p,last:o.displaced,viewport:i,afterCritical:s})},Tt=(e,t)=>({...e,[t.descriptor.id]:t});const Ws=({previousImpact:e,impact:t,droppables:n})=>{const r=W(e),o=W(t);if(!r||r===o)return n;const i=n[r];if(!i.subject.withPlaceholder)return n;const s=_s(i);return Tt(n,s)};var Us=({draggable:e,draggables:t,droppables:n,previousImpact:r,impact:o})=>{const i=Ws({previousImpact:r,impact:o,droppables:n}),s=W(o);if(!s)return i;const c=n[s];if(de(e,c)||c.subject.withPlaceholder)return i;const a=Nr(c,e,t);return Tt(i,a)},Ne=({state:e,clientSelection:t,dimensions:n,viewport:r,impact:o,scrollJumpRequest:i})=>{const s=r||e.viewport,c=n||e.dimensions,a=t||e.current.client.selection,d=F(a,e.initial.client.selection),p={offset:d,selection:a,borderBoxCenter:$(e.initial.client.borderBoxCenter,d)},l={selection:$(p.selection,s.scroll.current),borderBoxCenter:$(p.borderBoxCenter,s.scroll.current),offset:$(p.offset,s.scroll.diff.value)},u={client:p,page:l};if(e.phase==="COLLECTING")return{...e,dimensions:c,viewport:s,current:u};const g=c.draggables[e.critical.draggable.id],h=o||Sr({pageOffset:l.offset,draggable:g,draggables:c.draggables,droppables:c.droppables,previousImpact:e.impact,viewport:s,afterCritical:e.afterCritical}),b=Us({draggable:g,impact:h,previousImpact:e.impact,draggables:c.draggables,droppables:c.droppables});return{...e,current:u,dimensions:{draggables:c.draggables,droppables:b},impact:h,viewport:s,scrollJumpRequest:i||null,forceShouldAnimate:i?!1:null}};function Hs(e,t){return e.map(n=>t[n])}var Or=({impact:e,viewport:t,draggables:n,destination:r,forceShouldAnimate:o})=>{const i=e.displaced,s=Hs(i.all,n),c=Ee({afterDragging:s,destination:r,displacedBy:e.displacedBy,viewport:t.frame,forceShouldAnimate:o,last:i});return{...e,displaced:c}},wr=({impact:e,draggable:t,droppable:n,draggables:r,viewport:o,afterCritical:i})=>{const s=Ye({impact:e,draggable:t,draggables:r,droppable:n,afterCritical:i});return Pt({pageBorderBoxCenter:s,draggable:t,viewport:o})},_r=({state:e,dimensions:t,viewport:n})=>{e.movementMode!=="SNAP"&&(process.env.NODE_ENV,f());const r=e.impact,o=n||e.viewport,i=t||e.dimensions,{draggables:s,droppables:c}=i,a=s[e.critical.draggable.id],d=W(r);d||(process.env.NODE_ENV!=="production"?f(!1,"Must be over a destination in SNAP movement mode"):f());const p=c[d],l=Or({impact:r,viewport:o,destination:p,draggables:s}),u=wr({impact:l,draggable:a,droppable:p,draggables:s,viewport:o,afterCritical:e.afterCritical});return Ne({impact:l,clientSelection:u,state:e,dimensions:i,viewport:o})},zs=e=>({index:e.index,droppableId:e.droppableId}),Ar=({draggable:e,home:t,draggables:n,viewport:r})=>{const o=De(t.axis,e.displaceBy),i=ie(t.descriptor.id,n),s=i.indexOf(e);s===-1&&(process.env.NODE_ENV!=="production"?f(!1,"Expected draggable to be inside home list"):f());const c=i.slice(s+1),a=c.reduce((u,g)=>(u[g.descriptor.id]=!0,u),{}),d={inVirtualList:t.descriptor.mode==="virtual",displacedBy:o,effected:a};return{impact:{displaced:Ee({afterDragging:c,destination:t,displacedBy:o,last:null,viewport:r.frame,forceShouldAnimate:!1}),displacedBy:o,at:{type:"REORDER",destination:zs(e.descriptor)}},afterCritical:d}},qs=(e,t)=>({draggables:e.draggables,droppables:Tt(e.droppables,t)});const xe=e=>{process.env.NODE_ENV},Ie=e=>{process.env.NODE_ENV};var js=({draggable:e,offset:t,initialWindowScroll:n})=>{const r=Ge(e.client,t),o=ke(r,n);return{...e,placeholder:{...e.placeholder,client:r},client:r,page:o}},Ys=e=>{const t=e.frame;return t||(process.env.NODE_ENV!=="production"?f(!1,"Expected Droppable to have a frame"):f()),t},Xs=({additions:e,updatedDroppables:t,viewport:n})=>{const r=n.scroll.diff.value;return e.map(o=>{const i=o.descriptor.droppableId,s=t[i],a=Ys(s).scroll.diff.value,d=$(r,a);return js({draggable:o,offset:d,initialWindowScroll:n.scroll.initial})})},Ks=({state:e,published:t})=>{xe();const n=t.modified.map(E=>{const y=e.dimensions.droppables[E.droppableId];return Ct(y,E.scroll)}),r={...e.dimensions.droppables,...cr(n)},o=ar(Xs({additions:t.additions,updatedDroppables:r,viewport:e.viewport})),i={...e.dimensions.draggables,...o};t.removals.forEach(E=>{delete i[E]});const s={droppables:r,draggables:i},c=W(e.impact),a=c?s.droppables[c]:null,d=s.draggables[e.critical.draggable.id],p=s.droppables[e.critical.droppable.id],{impact:l,afterCritical:u}=Ar({draggable:d,home:p,draggables:i,viewport:e.viewport}),g=a&&a.isCombineEnabled?e.impact:l,h=Sr({pageOffset:e.current.page.offset,draggable:s.draggables[e.critical.draggable.id],draggables:s.draggables,droppables:s.droppables,previousImpact:g,viewport:e.viewport,afterCritical:u});Ie();const b={...e,phase:"DRAGGING",impact:h,onLiftImpact:l,dimensions:s,afterCritical:u,forceShouldAnimate:!1};return e.phase==="COLLECTING"?b:{...b,phase:"DROP_PENDING",reason:e.reason,isWaiting:!1}};const Bt=e=>e.movementMode==="SNAP",Vt=(e,t,n)=>{const r=qs(e.dimensions,t);return!Bt(e)||n?Ne({state:e,dimensions:r}):_r({state:e,dimensions:r})};function Lt(e){return e.isDragging&&e.movementMode==="SNAP"?{...e,scrollJumpRequest:null}:e}const Pr={phase:"IDLE",completed:null,shouldFlush:!1};var Js=(e=Pr,t)=>{if(t.type==="FLUSH")return{...Pr,shouldFlush:!0};if(t.type==="INITIAL_PUBLISH"){e.phase!=="IDLE"&&(process.env.NODE_ENV!=="production"?f(!1,"INITIAL_PUBLISH must come after a IDLE phase"):f());const{critical:n,clientSelection:r,viewport:o,dimensions:i,movementMode:s}=t.payload,c=i.draggables[n.draggable.id],a=i.droppables[n.droppable.id],d={selection:r,borderBoxCenter:c.client.borderBox.center,offset:R},p={client:d,page:{selection:$(d.selection,o.scroll.initial),borderBoxCenter:$(d.selection,o.scroll.initial),offset:$(d.selection,o.scroll.diff.value)}},l=He(i.droppables).every(b=>!b.isFixedOnPage),{impact:u,afterCritical:g}=Ar({draggable:c,home:a,draggables:i.draggables,viewport:o});return{phase:"DRAGGING",isDragging:!0,critical:n,movementMode:s,dimensions:i,initial:p,current:p,isWindowScrollAllowed:l,impact:u,afterCritical:g,onLiftImpact:u,viewport:o,scrollJumpRequest:null,forceShouldAnimate:null}}if(t.type==="COLLECTION_STARTING")return e.phase==="COLLECTING"||e.phase==="DROP_PENDING"?e:(e.phase!=="DRAGGING"&&(process.env.NODE_ENV!=="production"?f(!1,`Collection cannot start from phase ${e.phase}`):f()),{...e,phase:"COLLECTING"});if(t.type==="PUBLISH_WHILE_DRAGGING")return e.phase==="COLLECTING"||e.phase==="DROP_PENDING"||(process.env.NODE_ENV!=="production"?f(!1,`Unexpected ${t.type} received in phase ${e.phase}`):f()),Ks({state:e,published:t.payload});if(t.type==="MOVE"){if(e.phase==="DROP_PENDING")return e;se(e)||(process.env.NODE_ENV!=="production"?f(!1,`${t.type} not permitted in phase ${e.phase}`):f());const{client:n}=t.payload;return ne(n,e.current.client.selection)?e:Ne({state:e,clientSelection:n,impact:Bt(e)?e.impact:null})}if(t.type==="UPDATE_DROPPABLE_SCROLL"){if(e.phase==="DROP_PENDING"||e.phase==="COLLECTING")return Lt(e);se(e)||(process.env.NODE_ENV!=="production"?f(!1,`${t.type} not permitted in phase ${e.phase}`):f());const{id:n,newScroll:r}=t.payload,o=e.dimensions.droppables[n];if(!o)return e;const i=Ct(o,r);return Vt(e,i,!1)}if(t.type==="UPDATE_DROPPABLE_IS_ENABLED"){if(e.phase==="DROP_PENDING")return e;se(e)||(process.env.NODE_ENV!=="production"?f(!1,`Attempting to move in an unsupported phase ${e.phase}`):f());const{id:n,isEnabled:r}=t.payload,o=e.dimensions.droppables[n];o||(process.env.NODE_ENV!=="production"?f(!1,`Cannot find Droppable[id: ${n}] to toggle its enabled state`):f()),o.isEnabled===r&&(process.env.NODE_ENV!=="production"?f(!1,`Trying to set droppable isEnabled to ${String(r)}
67
67
  but it is already ${String(o.isEnabled)}`):f());const i={...o,isEnabled:r};return Vt(e,i,!0)}if(t.type==="UPDATE_DROPPABLE_IS_COMBINE_ENABLED"){if(e.phase==="DROP_PENDING")return e;se(e)||(process.env.NODE_ENV!=="production"?f(!1,`Attempting to move in an unsupported phase ${e.phase}`):f());const{id:n,isCombineEnabled:r}=t.payload,o=e.dimensions.droppables[n];o||(process.env.NODE_ENV!=="production"?f(!1,`Cannot find Droppable[id: ${n}] to toggle its isCombineEnabled state`):f()),o.isCombineEnabled===r&&(process.env.NODE_ENV!=="production"?f(!1,`Trying to set droppable isCombineEnabled to ${String(r)}
68
- but it is already ${String(o.isCombineEnabled)}`):f());const i={...o,isCombineEnabled:r};return Vt(e,i,!0)}if(t.type==="MOVE_BY_WINDOW_SCROLL"){if(e.phase==="DROP_PENDING"||e.phase==="DROP_ANIMATING")return e;se(e)||(process.env.NODE_ENV!=="production"?f(!1,`Cannot move by window in phase ${e.phase}`):f()),e.isWindowScrollAllowed||(process.env.NODE_ENV!=="production"?f(!1,"Window scrolling is currently not supported for fixed lists"):f());const n=t.payload.newScroll;if(ne(e.viewport.scroll.current,n))return Lt(e);const r=br(e.viewport,n);return Bt(e)?_r({state:e,viewport:r}):Ne({state:e,viewport:r})}if(t.type==="UPDATE_VIEWPORT_MAX_SCROLL"){if(!se(e))return e;const n=t.payload.maxScroll;if(ne(n,e.viewport.scroll.max))return e;const r={...e.viewport,scroll:{...e.viewport.scroll,max:n}};return{...e,viewport:r}}if(t.type==="MOVE_UP"||t.type==="MOVE_DOWN"||t.type==="MOVE_LEFT"||t.type==="MOVE_RIGHT"){if(e.phase==="COLLECTING"||e.phase==="DROP_PENDING")return e;e.phase!=="DRAGGING"&&(process.env.NODE_ENV!=="production"?f(!1,`${t.type} received while not in DRAGGING phase`):f());const n=Ls({state:e,type:t.type});return n?Ne({state:e,impact:n.impact,clientSelection:n.clientSelection,scrollJumpRequest:n.scrollJumpRequest}):e}if(t.type==="DROP_PENDING"){const n=t.payload.reason;return e.phase!=="COLLECTING"&&(process.env.NODE_ENV!=="production"?f(!1,"Can only move into the DROP_PENDING phase from the COLLECTING phase"):f()),{...e,phase:"DROP_PENDING",isWaiting:!0,reason:n}}if(t.type==="DROP_ANIMATE"){const{completed:n,dropDuration:r,newHomeClientOffset:o}=t.payload;return e.phase==="DRAGGING"||e.phase==="DROP_PENDING"||(process.env.NODE_ENV!=="production"?f(!1,`Cannot animate drop from phase ${e.phase}`):f()),{phase:"DROP_ANIMATING",completed:n,dropDuration:r,newHomeClientOffset:o,dimensions:e.dimensions}}if(t.type==="DROP_COMPLETE"){const{completed:n}=t.payload;return{phase:"IDLE",completed:n,shouldFlush:!1}}return e};function P(e,t){return e instanceof Object&&"type"in e&&e.type===t}const ec=e=>({type:"BEFORE_INITIAL_CAPTURE",payload:e}),tc=e=>({type:"LIFT",payload:e}),nc=e=>({type:"INITIAL_PUBLISH",payload:e}),rc=e=>({type:"PUBLISH_WHILE_DRAGGING",payload:e}),oc=()=>({type:"COLLECTION_STARTING",payload:null}),ic=e=>({type:"UPDATE_DROPPABLE_SCROLL",payload:e}),sc=e=>({type:"UPDATE_DROPPABLE_IS_ENABLED",payload:e}),cc=e=>({type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:e}),Tr=e=>({type:"MOVE",payload:e}),ac=e=>({type:"MOVE_BY_WINDOW_SCROLL",payload:e}),lc=e=>({type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:e}),dc=()=>({type:"MOVE_UP",payload:null}),uc=()=>({type:"MOVE_DOWN",payload:null}),pc=()=>({type:"MOVE_RIGHT",payload:null}),fc=()=>({type:"MOVE_LEFT",payload:null}),Rt=()=>({type:"FLUSH",payload:null}),gc=e=>({type:"DROP_ANIMATE",payload:e}),Mt=e=>({type:"DROP_COMPLETE",payload:e}),Br=e=>({type:"DROP",payload:e}),mc=e=>({type:"DROP_PENDING",payload:e}),Vr=()=>({type:"DROP_ANIMATION_FINISHED",payload:null});function hc(e){if(e.length<=1)return;const t=e.map(o=>o.descriptor.index),n={};for(let o=1;o<t.length;o++){const i=t[o],s=t[o-1];i!==s+1&&(n[i]=!0)}if(!Object.keys(n).length)return;const r=t.map(o=>!!n[o]?`[🔥${o}]`:`${o}`).join(", ");process.env.NODE_ENV!=="production"&&B(`
68
+ but it is already ${String(o.isCombineEnabled)}`):f());const i={...o,isCombineEnabled:r};return Vt(e,i,!0)}if(t.type==="MOVE_BY_WINDOW_SCROLL"){if(e.phase==="DROP_PENDING"||e.phase==="DROP_ANIMATING")return e;se(e)||(process.env.NODE_ENV!=="production"?f(!1,`Cannot move by window in phase ${e.phase}`):f()),e.isWindowScrollAllowed||(process.env.NODE_ENV!=="production"?f(!1,"Window scrolling is currently not supported for fixed lists"):f());const n=t.payload.newScroll;if(ne(e.viewport.scroll.current,n))return Lt(e);const r=br(e.viewport,n);return Bt(e)?_r({state:e,viewport:r}):Ne({state:e,viewport:r})}if(t.type==="UPDATE_VIEWPORT_MAX_SCROLL"){if(!se(e))return e;const n=t.payload.maxScroll;if(ne(n,e.viewport.scroll.max))return e;const r={...e.viewport,scroll:{...e.viewport.scroll,max:n}};return{...e,viewport:r}}if(t.type==="MOVE_UP"||t.type==="MOVE_DOWN"||t.type==="MOVE_LEFT"||t.type==="MOVE_RIGHT"){if(e.phase==="COLLECTING"||e.phase==="DROP_PENDING")return e;e.phase!=="DRAGGING"&&(process.env.NODE_ENV!=="production"?f(!1,`${t.type} received while not in DRAGGING phase`):f());const n=Bs({state:e,type:t.type});return n?Ne({state:e,impact:n.impact,clientSelection:n.clientSelection,scrollJumpRequest:n.scrollJumpRequest}):e}if(t.type==="DROP_PENDING"){const n=t.payload.reason;return e.phase!=="COLLECTING"&&(process.env.NODE_ENV!=="production"?f(!1,"Can only move into the DROP_PENDING phase from the COLLECTING phase"):f()),{...e,phase:"DROP_PENDING",isWaiting:!0,reason:n}}if(t.type==="DROP_ANIMATE"){const{completed:n,dropDuration:r,newHomeClientOffset:o}=t.payload;return e.phase==="DRAGGING"||e.phase==="DROP_PENDING"||(process.env.NODE_ENV!=="production"?f(!1,`Cannot animate drop from phase ${e.phase}`):f()),{phase:"DROP_ANIMATING",completed:n,dropDuration:r,newHomeClientOffset:o,dimensions:e.dimensions}}if(t.type==="DROP_COMPLETE"){const{completed:n}=t.payload;return{phase:"IDLE",completed:n,shouldFlush:!1}}return e};function P(e,t){return e instanceof Object&&"type"in e&&e.type===t}const Zs=e=>({type:"BEFORE_INITIAL_CAPTURE",payload:e}),Qs=e=>({type:"LIFT",payload:e}),ec=e=>({type:"INITIAL_PUBLISH",payload:e}),tc=e=>({type:"PUBLISH_WHILE_DRAGGING",payload:e}),nc=()=>({type:"COLLECTION_STARTING",payload:null}),rc=e=>({type:"UPDATE_DROPPABLE_SCROLL",payload:e}),oc=e=>({type:"UPDATE_DROPPABLE_IS_ENABLED",payload:e}),ic=e=>({type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:e}),Tr=e=>({type:"MOVE",payload:e}),sc=e=>({type:"MOVE_BY_WINDOW_SCROLL",payload:e}),cc=e=>({type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:e}),ac=()=>({type:"MOVE_UP",payload:null}),lc=()=>({type:"MOVE_DOWN",payload:null}),dc=()=>({type:"MOVE_RIGHT",payload:null}),uc=()=>({type:"MOVE_LEFT",payload:null}),Rt=()=>({type:"FLUSH",payload:null}),pc=e=>({type:"DROP_ANIMATE",payload:e}),Mt=e=>({type:"DROP_COMPLETE",payload:e}),Br=e=>({type:"DROP",payload:e}),fc=e=>({type:"DROP_PENDING",payload:e}),Vr=()=>({type:"DROP_ANIMATION_FINISHED",payload:null});function gc(e){if(e.length<=1)return;const t=e.map(o=>o.descriptor.index),n={};for(let o=1;o<t.length;o++){const i=t[o],s=t[o-1];i!==s+1&&(n[i]=!0)}if(!Object.keys(n).length)return;const r=t.map(o=>!!n[o]?`[🔥${o}]`:`${o}`).join(", ");process.env.NODE_ENV!=="production"&&B(`
69
69
  Detected non-consecutive <Draggable /> indexes.
70
70
 
71
71
  (This can cause unexpected bugs)
72
72
 
73
73
  ${r}
74
- `)}function bc(e,t){if(process.env.NODE_ENV!=="production"){const n=ie(e.droppable.id,t.draggables);hc(n)}}var vc=e=>({getState:t,dispatch:n})=>r=>o=>{if(!P(o,"LIFT")){r(o);return}const{id:i,clientSelection:s,movementMode:c}=o.payload,a=t();a.phase==="DROP_ANIMATING"&&n(Mt({completed:a.completed})),t().phase!=="IDLE"&&(process.env.NODE_ENV!=="production"?f(!1,"Unexpected phase to start a drag"):f()),n(Rt()),n(ec({draggableId:i,movementMode:c}));const p={draggableId:i,scrollOptions:{shouldPublishImmediately:c==="SNAP"}},{critical:l,dimensions:u,viewport:g}=e.startPublishing(p);bc(l,u),n(nc({critical:l,dimensions:u,clientSelection:s,movementMode:c,viewport:g}))},yc=e=>()=>t=>n=>{P(n,"INITIAL_PUBLISH")&&e.dragging(),P(n,"DROP_ANIMATE")&&e.dropping(n.payload.completed.result.reason),(P(n,"FLUSH")||P(n,"DROP_COMPLETE"))&&e.resting(),t(n)};const $t={outOfTheWay:"cubic-bezier(0.2, 0, 0, 1)",drop:"cubic-bezier(.2,1,.1,1)"},Se={opacity:{drop:0,combining:.7},scale:{drop:.75}},Lr={outOfTheWay:.2,minDropTime:.33,maxDropTime:.55},ce=`${Lr.outOfTheWay}s ${$t.outOfTheWay}`,Ce={fluid:`opacity ${ce}`,snap:`transform ${ce}, opacity ${ce}`,drop:e=>{const t=`${e}s ${$t.drop}`;return`transform ${t}, opacity ${t}`},outOfTheWay:`transform ${ce}`,placeholder:`height ${ce}, width ${ce}, margin ${ce}`},Rr=e=>ne(e,R)?void 0:`translate(${e.x}px, ${e.y}px)`,Gt={moveTo:Rr,drop:(e,t)=>{const n=Rr(e);if(n)return t?`${n} scale(${Se.scale.drop})`:n}},{minDropTime:kt,maxDropTime:Mr}=Lr,Ec=Mr-kt,$r=1500,Dc=.6;var Nc=({current:e,destination:t,reason:n})=>{const r=be(e,t);if(r<=0)return kt;if(r>=$r)return Mr;const o=r/$r,i=kt+Ec*o,s=n==="CANCEL"?i*Dc:i;return Number(s.toFixed(2))},xc=({impact:e,draggable:t,dimensions:n,viewport:r,afterCritical:o})=>{const{draggables:i,droppables:s}=n,c=W(e),a=c?s[c]:null,d=s[t.descriptor.droppableId],p=wr({impact:e,draggable:t,draggables:i,afterCritical:o,droppable:a||d,viewport:r});return F(p,t.client.borderBox.center)},Ic=({draggables:e,reason:t,lastImpact:n,home:r,viewport:o,onLiftImpact:i})=>!n.at||t!=="DROP"?{impact:Or({draggables:e,impact:i,destination:r,viewport:o,forceShouldAnimate:!0}),didDropInsideDroppable:!1}:n.at.type==="REORDER"?{impact:n,didDropInsideDroppable:!0}:{impact:{...n,displaced:ye},didDropInsideDroppable:!0};const Sc=({getState:e,dispatch:t})=>n=>r=>{if(!P(r,"DROP")){n(r);return}const o=e(),i=r.payload.reason;if(o.phase==="COLLECTING"){t(mc({reason:i}));return}if(o.phase==="IDLE")return;o.phase==="DROP_PENDING"&&o.isWaiting&&(process.env.NODE_ENV!=="production"?f(!1,"A DROP action occurred while DROP_PENDING and still waiting"):f()),o.phase==="DRAGGING"||o.phase==="DROP_PENDING"||(process.env.NODE_ENV!=="production"?f(!1,`Cannot drop in phase: ${o.phase}`):f());const c=o.critical,a=o.dimensions,d=a.draggables[o.critical.draggable.id],{impact:p,didDropInsideDroppable:l}=Ic({reason:i,lastImpact:o.impact,afterCritical:o.afterCritical,onLiftImpact:o.onLiftImpact,home:o.dimensions.droppables[o.critical.droppable.id],viewport:o.viewport,draggables:o.dimensions.draggables}),u=l?Ct(p):null,g=l?ze(p):null,m={index:c.draggable.index,droppableId:c.droppable.id},b={draggableId:d.descriptor.id,type:d.descriptor.type,source:m,reason:i,mode:o.movementMode,destination:u,combine:g},h=xc({impact:p,draggable:d,dimensions:a,viewport:o.viewport,afterCritical:o.afterCritical}),E={critical:o.critical,afterCritical:o.afterCritical,result:b,impact:p};if(!(!ne(o.current.client.offset,h)||!!b.combine)){t(Mt({completed:E}));return}const C=Nc({current:o.current.client.offset,destination:h,reason:i});t(gc({newHomeClientOffset:h,dropDuration:C,completed:E}))};var Gr=()=>({x:window.pageXOffset,y:window.pageYOffset});function Cc(e){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:t=>{t.target!==window&&t.target!==window.document||e()}}}function Oc({onWindowScroll:e}){function t(){e(Gr())}const n=me(t),r=Cc(n);let o=te;function i(){return o!==te}function s(){i()&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot start scroll listener when already active"):f()),o=Y(window,[r])}function c(){i()||(process.env.NODE_ENV!=="production"?f(!1,"Cannot stop scroll listener when not active"):f()),n.cancel(),o(),o=te}return{start:s,stop:c,isActive:i}}const wc=e=>P(e,"DROP_COMPLETE")||P(e,"DROP_ANIMATE")||P(e,"FLUSH"),_c=e=>{const t=Oc({onWindowScroll:n=>{e.dispatch(ac({newScroll:n}))}});return n=>r=>{!t.isActive()&&P(r,"INITIAL_PUBLISH")&&t.start(),t.isActive()&&wc(r)&&t.stop(),n(r)}};var Ac=e=>{let t=!1,n=!1;const r=setTimeout(()=>{n=!0}),o=i=>{if(t){process.env.NODE_ENV!=="production"&&B("Announcement already made. Not making a second announcement");return}if(n){process.env.NODE_ENV!=="production"&&B(`
74
+ `)}function mc(e,t){if(process.env.NODE_ENV!=="production"){const n=ie(e.droppable.id,t.draggables);gc(n)}}var hc=e=>({getState:t,dispatch:n})=>r=>o=>{if(!P(o,"LIFT")){r(o);return}const{id:i,clientSelection:s,movementMode:c}=o.payload,a=t();a.phase==="DROP_ANIMATING"&&n(Mt({completed:a.completed})),t().phase!=="IDLE"&&(process.env.NODE_ENV!=="production"?f(!1,"Unexpected phase to start a drag"):f()),n(Rt()),n(Zs({draggableId:i,movementMode:c}));const p={draggableId:i,scrollOptions:{shouldPublishImmediately:c==="SNAP"}},{critical:l,dimensions:u,viewport:g}=e.startPublishing(p);mc(l,u),n(ec({critical:l,dimensions:u,clientSelection:s,movementMode:c,viewport:g}))},bc=e=>()=>t=>n=>{P(n,"INITIAL_PUBLISH")&&e.dragging(),P(n,"DROP_ANIMATE")&&e.dropping(n.payload.completed.result.reason),(P(n,"FLUSH")||P(n,"DROP_COMPLETE"))&&e.resting(),t(n)};const $t={outOfTheWay:"cubic-bezier(0.2, 0, 0, 1)",drop:"cubic-bezier(.2,1,.1,1)"},Ce={opacity:{drop:0,combining:.7},scale:{drop:.75}},Lr={outOfTheWay:.2,minDropTime:.33,maxDropTime:.55},ce=`${Lr.outOfTheWay}s ${$t.outOfTheWay}`,Se={fluid:`opacity ${ce}`,snap:`transform ${ce}, opacity ${ce}`,drop:e=>{const t=`${e}s ${$t.drop}`;return`transform ${t}, opacity ${t}`},outOfTheWay:`transform ${ce}`,placeholder:`height ${ce}, width ${ce}, margin ${ce}`},Rr=e=>ne(e,R)?void 0:`translate(${e.x}px, ${e.y}px)`,Gt={moveTo:Rr,drop:(e,t)=>{const n=Rr(e);if(n)return t?`${n} scale(${Ce.scale.drop})`:n}},{minDropTime:kt,maxDropTime:Mr}=Lr,vc=Mr-kt,$r=1500,yc=.6;var Ec=({current:e,destination:t,reason:n})=>{const r=be(e,t);if(r<=0)return kt;if(r>=$r)return Mr;const o=r/$r,i=kt+vc*o,s=n==="CANCEL"?i*yc:i;return Number(s.toFixed(2))},Dc=({impact:e,draggable:t,dimensions:n,viewport:r,afterCritical:o})=>{const{draggables:i,droppables:s}=n,c=W(e),a=c?s[c]:null,d=s[t.descriptor.droppableId],p=wr({impact:e,draggable:t,draggables:i,afterCritical:o,droppable:a||d,viewport:r});return F(p,t.client.borderBox.center)},Nc=({draggables:e,reason:t,lastImpact:n,home:r,viewport:o,onLiftImpact:i})=>!n.at||t!=="DROP"?{impact:Or({draggables:e,impact:i,destination:r,viewport:o,forceShouldAnimate:!0}),didDropInsideDroppable:!1}:n.at.type==="REORDER"?{impact:n,didDropInsideDroppable:!0}:{impact:{...n,displaced:ye},didDropInsideDroppable:!0};const xc=({getState:e,dispatch:t})=>n=>r=>{if(!P(r,"DROP")){n(r);return}const o=e(),i=r.payload.reason;if(o.phase==="COLLECTING"){t(fc({reason:i}));return}if(o.phase==="IDLE")return;o.phase==="DROP_PENDING"&&o.isWaiting&&(process.env.NODE_ENV!=="production"?f(!1,"A DROP action occurred while DROP_PENDING and still waiting"):f()),o.phase==="DRAGGING"||o.phase==="DROP_PENDING"||(process.env.NODE_ENV!=="production"?f(!1,`Cannot drop in phase: ${o.phase}`):f());const c=o.critical,a=o.dimensions,d=a.draggables[o.critical.draggable.id],{impact:p,didDropInsideDroppable:l}=Nc({reason:i,lastImpact:o.impact,afterCritical:o.afterCritical,onLiftImpact:o.onLiftImpact,home:o.dimensions.droppables[o.critical.droppable.id],viewport:o.viewport,draggables:o.dimensions.draggables}),u=l?St(p):null,g=l?ze(p):null,h={index:c.draggable.index,droppableId:c.droppable.id},b={draggableId:d.descriptor.id,type:d.descriptor.type,source:h,reason:i,mode:o.movementMode,destination:u,combine:g},m=Dc({impact:p,draggable:d,dimensions:a,viewport:o.viewport,afterCritical:o.afterCritical}),E={critical:o.critical,afterCritical:o.afterCritical,result:b,impact:p};if(!(!ne(o.current.client.offset,m)||!!b.combine)){t(Mt({completed:E}));return}const S=Ec({current:o.current.client.offset,destination:m,reason:i});t(pc({newHomeClientOffset:m,dropDuration:S,completed:E}))};var Gr=()=>({x:window.pageXOffset,y:window.pageYOffset});function Ic(e){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:t=>{t.target!==window&&t.target!==window.document||e()}}}function Cc({onWindowScroll:e}){function t(){e(Gr())}const n=me(t),r=Ic(n);let o=te;function i(){return o!==te}function s(){i()&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot start scroll listener when already active"):f()),o=Y(window,[r])}function c(){i()||(process.env.NODE_ENV!=="production"?f(!1,"Cannot stop scroll listener when not active"):f()),n.cancel(),o(),o=te}return{start:s,stop:c,isActive:i}}const Sc=e=>P(e,"DROP_COMPLETE")||P(e,"DROP_ANIMATE")||P(e,"FLUSH"),Oc=e=>{const t=Cc({onWindowScroll:n=>{e.dispatch(sc({newScroll:n}))}});return n=>r=>{!t.isActive()&&P(r,"INITIAL_PUBLISH")&&t.start(),t.isActive()&&Sc(r)&&t.stop(),n(r)}};var wc=e=>{let t=!1,n=!1;const r=setTimeout(()=>{n=!0}),o=i=>{if(t){process.env.NODE_ENV!=="production"&&B("Announcement already made. Not making a second announcement");return}if(n){process.env.NODE_ENV!=="production"&&B(`
75
75
  Announcements cannot be made asynchronously.
76
76
  Default message has already been announced.
77
- `);return}t=!0,e(i),clearTimeout(r)};return o.wasCalled=()=>t,o},Pc=()=>{const e=[],t=o=>{const i=e.findIndex(c=>c.timerId===o);i===-1&&(process.env.NODE_ENV!=="production"?f(!1,"Could not find timer"):f());const[s]=e.splice(i,1);s.callback()};return{add:o=>{const i=setTimeout(()=>t(i)),s={timerId:i,callback:o};e.push(s)},flush:()=>{if(!e.length)return;const o=[...e];e.length=0,o.forEach(i=>{clearTimeout(i.timerId),i.callback()})}}};const Tc=(e,t)=>e==null&&t==null?!0:e==null||t==null?!1:e.droppableId===t.droppableId&&e.index===t.index,Bc=(e,t)=>e==null&&t==null?!0:e==null||t==null?!1:e.draggableId===t.draggableId&&e.droppableId===t.droppableId,Vc=(e,t)=>{if(e===t)return!0;const n=e.draggable.id===t.draggable.id&&e.draggable.droppableId===t.draggable.droppableId&&e.draggable.type===t.draggable.type&&e.draggable.index===t.draggable.index,r=e.droppable.id===t.droppable.id&&e.droppable.type===t.droppable.type;return n&&r},Oe=(e,t)=>{xe(),t(),Ie()},Xe=(e,t)=>({draggableId:e.draggable.id,type:e.droppable.type,source:{droppableId:e.droppable.id,index:e.draggable.index},mode:t});function Ft(e,t,n,r){if(!e){n(r(t));return}const o=Ac(n);e(t,{announce:o}),o.wasCalled()||n(r(t))}var Lc=(e,t)=>{const n=Pc();let r=null;const o=(l,u)=>{r&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot fire onBeforeCapture as a drag start has already been published"):f()),Oe("onBeforeCapture",()=>{const g=e().onBeforeCapture;g&&g({draggableId:l,mode:u})})},i=(l,u)=>{r&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot fire onBeforeDragStart as a drag start has already been published"):f()),Oe("onBeforeDragStart",()=>{const g=e().onBeforeDragStart;g&&g(Xe(l,u))})},s=(l,u)=>{r&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot fire onBeforeDragStart as a drag start has already been published"):f());const g=Xe(l,u);r={mode:u,lastCritical:l,lastLocation:g.source,lastCombine:null},n.add(()=>{Oe("onDragStart",()=>Ft(e().onDragStart,g,t,Ue.onDragStart))})},c=(l,u)=>{const g=Ct(u),m=ze(u);r||(process.env.NODE_ENV!=="production"?f(!1,"Cannot fire onDragMove when onDragStart has not been called"):f());const b=!Vc(l,r.lastCritical);b&&(r.lastCritical=l);const h=!Tc(r.lastLocation,g);h&&(r.lastLocation=g);const E=!Bc(r.lastCombine,m);if(E&&(r.lastCombine=m),!b&&!h&&!E)return;const y={...Xe(l,r.mode),combine:m,destination:g};n.add(()=>{Oe("onDragUpdate",()=>Ft(e().onDragUpdate,y,t,Ue.onDragUpdate))})},a=()=>{r||(process.env.NODE_ENV!=="production"?f(!1,"Can only flush responders while dragging"):f()),n.flush()},d=l=>{r||(process.env.NODE_ENV!=="production"?f(!1,"Cannot fire onDragEnd when there is no matching onDragStart"):f()),r=null,Oe("onDragEnd",()=>Ft(e().onDragEnd,l,t,Ue.onDragEnd))};return{beforeCapture:o,beforeStart:i,start:s,update:c,flush:a,drop:d,abort:()=>{if(!r)return;const l={...Xe(r.lastCritical,r.mode),combine:null,destination:null,reason:"CANCEL"};d(l)}}},Rc=(e,t)=>{const n=Lc(e,t);return r=>o=>i=>{if(P(i,"BEFORE_INITIAL_CAPTURE")){n.beforeCapture(i.payload.draggableId,i.payload.movementMode);return}if(P(i,"INITIAL_PUBLISH")){const c=i.payload.critical;n.beforeStart(c,i.payload.movementMode),o(i),n.start(c,i.payload.movementMode);return}if(P(i,"DROP_COMPLETE")){const c=i.payload.completed.result;n.flush(),o(i),n.drop(c);return}if(o(i),P(i,"FLUSH")){n.abort();return}const s=r.getState();s.phase==="DRAGGING"&&n.update(s.critical,s.impact)}};const Mc=e=>t=>n=>{if(!P(n,"DROP_ANIMATION_FINISHED")){t(n);return}const r=e.getState();r.phase!=="DROP_ANIMATING"&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot finish a drop animating when no drop is occurring"):f()),e.dispatch(Mt({completed:r.completed}))},$c=e=>{let t=null,n=null;function r(){n&&(cancelAnimationFrame(n),n=null),t&&(t(),t=null)}return o=>i=>{if((P(i,"FLUSH")||P(i,"DROP_COMPLETE")||P(i,"DROP_ANIMATION_FINISHED"))&&r(),o(i),!P(i,"DROP_ANIMATE"))return;const s={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){e.getState().phase==="DROP_ANIMATING"&&e.dispatch(Vr())}};n=requestAnimationFrame(()=>{n=null,t=Y(window,[s])})}};var Gc=e=>()=>t=>n=>{(P(n,"DROP_COMPLETE")||P(n,"FLUSH")||P(n,"DROP_ANIMATE"))&&e.stopPublishing(),t(n)},kc=e=>{let t=!1;return()=>n=>r=>{if(P(r,"INITIAL_PUBLISH")){t=!0,e.tryRecordFocus(r.payload.critical.draggable.id),n(r),e.tryRestoreFocusRecorded();return}if(n(r),!!t){if(P(r,"FLUSH")){t=!1,e.tryRestoreFocusRecorded();return}if(P(r,"DROP_COMPLETE")){t=!1;const o=r.payload.completed.result;o.combine&&e.tryShiftRecord(o.draggableId,o.combine.draggableId),e.tryRestoreFocusRecorded()}}}};const Fc=e=>P(e,"DROP_COMPLETE")||P(e,"DROP_ANIMATE")||P(e,"FLUSH");var Wc=e=>t=>n=>r=>{if(Fc(r)){e.stop(),n(r);return}if(P(r,"INITIAL_PUBLISH")){n(r);const o=t.getState();o.phase!=="DRAGGING"&&(process.env.NODE_ENV!=="production"?f(!1,"Expected phase to be DRAGGING after INITIAL_PUBLISH"):f()),e.start(o);return}n(r),e.scroll(t.getState())};const Uc=e=>t=>n=>{if(t(n),!P(n,"PUBLISH_WHILE_DRAGGING"))return;const r=e.getState();r.phase==="DROP_PENDING"&&(r.isWaiting||e.dispatch(Br({reason:r.reason})))},Hc=process.env.NODE_ENV!=="production"&&typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({name:"@hello-pangea/dnd"}):In;var zc=({dimensionMarshal:e,focusMarshal:t,styleMarshal:n,getResponders:r,announce:o,autoScroller:i})=>Dn(Qs,Hc(Fo(yc(n),Gc(e),vc(e),Sc,Mc,$c,Uc,Wc(i),_c,kc(t),Rc(r,o))));const Wt=()=>({additions:{},removals:{},modified:{}});function qc({registry:e,callbacks:t}){let n=Wt(),r=null;const o=()=>{r||(t.collectionStarting(),r=requestAnimationFrame(()=>{r=null,xe();const{additions:a,removals:d,modified:p}=n,l=Object.keys(a).map(m=>e.draggable.getById(m).getDimension(R)).sort((m,b)=>m.descriptor.index-b.descriptor.index),u=Object.keys(p).map(m=>{const h=e.droppable.getById(m).callbacks.getScrollWhileDragging();return{droppableId:m,scroll:h}}),g={additions:l,removals:Object.keys(d),modified:u};n=Wt(),Ie(),t.publish(g)}))};return{add:a=>{const d=a.descriptor.id;n.additions[d]=a,n.modified[a.descriptor.droppableId]=!0,n.removals[d]&&delete n.removals[d],o()},remove:a=>{const d=a.descriptor;n.removals[d.id]=!0,n.modified[d.droppableId]=!0,n.additions[d.id]&&delete n.additions[d.id],o()},stop:()=>{r&&(cancelAnimationFrame(r),r=null,n=Wt())}}}var kr=({scrollHeight:e,scrollWidth:t,height:n,width:r})=>{const o=F({x:t,y:e},{x:r,y:n});return{x:Math.max(0,o.x),y:Math.max(0,o.y)}},Fr=()=>{const e=document.documentElement;return e||(process.env.NODE_ENV!=="production"?f(!1,"Cannot find document.documentElement"):f()),e},Wr=()=>{const e=Fr();return kr({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,width:e.clientWidth,height:e.clientHeight})},jc=()=>{const e=Gr(),t=Wr(),n=e.y,r=e.x,o=Fr(),i=o.clientWidth,s=o.clientHeight,c=r+i,a=n+s;return{frame:K({top:n,left:r,right:c,bottom:a}),scroll:{initial:e,current:e,max:t,diff:{value:R,displacement:R}}}},Yc=({critical:e,scrollOptions:t,registry:n})=>{xe();const r=jc(),o=r.scroll.current,i=e.droppable,s=n.droppable.getAllByType(i.type).map(p=>p.callbacks.getDimensionAndWatchScroll(o,t)),c=n.draggable.getAllByType(e.draggable.type).map(p=>p.getDimension(o)),a={draggables:ar(c),droppables:cr(s)};return Ie(),{dimensions:a,critical:e,viewport:r}};function Ur(e,t,n){return n.descriptor.id===t.id||n.descriptor.type!==t.type?!1:e.droppable.getById(n.descriptor.droppableId).descriptor.mode!=="virtual"?(process.env.NODE_ENV!=="production"&&B(`
77
+ `);return}t=!0,e(i),clearTimeout(r)};return o.wasCalled=()=>t,o},_c=()=>{const e=[],t=o=>{const i=e.findIndex(c=>c.timerId===o);i===-1&&(process.env.NODE_ENV!=="production"?f(!1,"Could not find timer"):f());const[s]=e.splice(i,1);s.callback()};return{add:o=>{const i=setTimeout(()=>t(i)),s={timerId:i,callback:o};e.push(s)},flush:()=>{if(!e.length)return;const o=[...e];e.length=0,o.forEach(i=>{clearTimeout(i.timerId),i.callback()})}}};const Ac=(e,t)=>e==null&&t==null?!0:e==null||t==null?!1:e.droppableId===t.droppableId&&e.index===t.index,Pc=(e,t)=>e==null&&t==null?!0:e==null||t==null?!1:e.draggableId===t.draggableId&&e.droppableId===t.droppableId,Tc=(e,t)=>{if(e===t)return!0;const n=e.draggable.id===t.draggable.id&&e.draggable.droppableId===t.draggable.droppableId&&e.draggable.type===t.draggable.type&&e.draggable.index===t.draggable.index,r=e.droppable.id===t.droppable.id&&e.droppable.type===t.droppable.type;return n&&r},Oe=(e,t)=>{xe(),t(),Ie()},Xe=(e,t)=>({draggableId:e.draggable.id,type:e.droppable.type,source:{droppableId:e.droppable.id,index:e.draggable.index},mode:t});function Ft(e,t,n,r){if(!e){n(r(t));return}const o=wc(n);e(t,{announce:o}),o.wasCalled()||n(r(t))}var Bc=(e,t)=>{const n=_c();let r=null;const o=(l,u)=>{r&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot fire onBeforeCapture as a drag start has already been published"):f()),Oe("onBeforeCapture",()=>{const g=e().onBeforeCapture;g&&g({draggableId:l,mode:u})})},i=(l,u)=>{r&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot fire onBeforeDragStart as a drag start has already been published"):f()),Oe("onBeforeDragStart",()=>{const g=e().onBeforeDragStart;g&&g(Xe(l,u))})},s=(l,u)=>{r&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot fire onBeforeDragStart as a drag start has already been published"):f());const g=Xe(l,u);r={mode:u,lastCritical:l,lastLocation:g.source,lastCombine:null},n.add(()=>{Oe("onDragStart",()=>Ft(e().onDragStart,g,t,Ue.onDragStart))})},c=(l,u)=>{const g=St(u),h=ze(u);r||(process.env.NODE_ENV!=="production"?f(!1,"Cannot fire onDragMove when onDragStart has not been called"):f());const b=!Tc(l,r.lastCritical);b&&(r.lastCritical=l);const m=!Ac(r.lastLocation,g);m&&(r.lastLocation=g);const E=!Pc(r.lastCombine,h);if(E&&(r.lastCombine=h),!b&&!m&&!E)return;const y={...Xe(l,r.mode),combine:h,destination:g};n.add(()=>{Oe("onDragUpdate",()=>Ft(e().onDragUpdate,y,t,Ue.onDragUpdate))})},a=()=>{r||(process.env.NODE_ENV!=="production"?f(!1,"Can only flush responders while dragging"):f()),n.flush()},d=l=>{r||(process.env.NODE_ENV!=="production"?f(!1,"Cannot fire onDragEnd when there is no matching onDragStart"):f()),r=null,Oe("onDragEnd",()=>Ft(e().onDragEnd,l,t,Ue.onDragEnd))};return{beforeCapture:o,beforeStart:i,start:s,update:c,flush:a,drop:d,abort:()=>{if(!r)return;const l={...Xe(r.lastCritical,r.mode),combine:null,destination:null,reason:"CANCEL"};d(l)}}},Vc=(e,t)=>{const n=Bc(e,t);return r=>o=>i=>{if(P(i,"BEFORE_INITIAL_CAPTURE")){n.beforeCapture(i.payload.draggableId,i.payload.movementMode);return}if(P(i,"INITIAL_PUBLISH")){const c=i.payload.critical;n.beforeStart(c,i.payload.movementMode),o(i),n.start(c,i.payload.movementMode);return}if(P(i,"DROP_COMPLETE")){const c=i.payload.completed.result;n.flush(),o(i),n.drop(c);return}if(o(i),P(i,"FLUSH")){n.abort();return}const s=r.getState();s.phase==="DRAGGING"&&n.update(s.critical,s.impact)}};const Lc=e=>t=>n=>{if(!P(n,"DROP_ANIMATION_FINISHED")){t(n);return}const r=e.getState();r.phase!=="DROP_ANIMATING"&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot finish a drop animating when no drop is occurring"):f()),e.dispatch(Mt({completed:r.completed}))},Rc=e=>{let t=null,n=null;function r(){n&&(cancelAnimationFrame(n),n=null),t&&(t(),t=null)}return o=>i=>{if((P(i,"FLUSH")||P(i,"DROP_COMPLETE")||P(i,"DROP_ANIMATION_FINISHED"))&&r(),o(i),!P(i,"DROP_ANIMATE"))return;const s={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){e.getState().phase==="DROP_ANIMATING"&&e.dispatch(Vr())}};n=requestAnimationFrame(()=>{n=null,t=Y(window,[s])})}};var Mc=e=>()=>t=>n=>{(P(n,"DROP_COMPLETE")||P(n,"FLUSH")||P(n,"DROP_ANIMATE"))&&e.stopPublishing(),t(n)},$c=e=>{let t=!1;return()=>n=>r=>{if(P(r,"INITIAL_PUBLISH")){t=!0,e.tryRecordFocus(r.payload.critical.draggable.id),n(r),e.tryRestoreFocusRecorded();return}if(n(r),!!t){if(P(r,"FLUSH")){t=!1,e.tryRestoreFocusRecorded();return}if(P(r,"DROP_COMPLETE")){t=!1;const o=r.payload.completed.result;o.combine&&e.tryShiftRecord(o.draggableId,o.combine.draggableId),e.tryRestoreFocusRecorded()}}}};const Gc=e=>P(e,"DROP_COMPLETE")||P(e,"DROP_ANIMATE")||P(e,"FLUSH");var kc=e=>t=>n=>r=>{if(Gc(r)){e.stop(),n(r);return}if(P(r,"INITIAL_PUBLISH")){n(r);const o=t.getState();o.phase!=="DRAGGING"&&(process.env.NODE_ENV!=="production"?f(!1,"Expected phase to be DRAGGING after INITIAL_PUBLISH"):f()),e.start(o);return}n(r),e.scroll(t.getState())};const Fc=e=>t=>n=>{if(t(n),!P(n,"PUBLISH_WHILE_DRAGGING"))return;const r=e.getState();r.phase==="DROP_PENDING"&&(r.isWaiting||e.dispatch(Br({reason:r.reason})))},Wc=process.env.NODE_ENV!=="production"&&typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({name:"@hello-pangea/dnd"}):In;var Uc=({dimensionMarshal:e,focusMarshal:t,styleMarshal:n,getResponders:r,announce:o,autoScroller:i})=>Dn(Js,Wc(Go(bc(n),Mc(e),hc(e),xc,Lc,Rc,Fc,kc(i),Oc,$c(t),Vc(r,o))));const Wt=()=>({additions:{},removals:{},modified:{}});function Hc({registry:e,callbacks:t}){let n=Wt(),r=null;const o=()=>{r||(t.collectionStarting(),r=requestAnimationFrame(()=>{r=null,xe();const{additions:a,removals:d,modified:p}=n,l=Object.keys(a).map(h=>e.draggable.getById(h).getDimension(R)).sort((h,b)=>h.descriptor.index-b.descriptor.index),u=Object.keys(p).map(h=>{const m=e.droppable.getById(h).callbacks.getScrollWhileDragging();return{droppableId:h,scroll:m}}),g={additions:l,removals:Object.keys(d),modified:u};n=Wt(),Ie(),t.publish(g)}))};return{add:a=>{const d=a.descriptor.id;n.additions[d]=a,n.modified[a.descriptor.droppableId]=!0,n.removals[d]&&delete n.removals[d],o()},remove:a=>{const d=a.descriptor;n.removals[d.id]=!0,n.modified[d.droppableId]=!0,n.additions[d.id]&&delete n.additions[d.id],o()},stop:()=>{r&&(cancelAnimationFrame(r),r=null,n=Wt())}}}var kr=({scrollHeight:e,scrollWidth:t,height:n,width:r})=>{const o=F({x:t,y:e},{x:r,y:n});return{x:Math.max(0,o.x),y:Math.max(0,o.y)}},Fr=()=>{const e=document.documentElement;return e||(process.env.NODE_ENV!=="production"?f(!1,"Cannot find document.documentElement"):f()),e},Wr=()=>{const e=Fr();return kr({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,width:e.clientWidth,height:e.clientHeight})},zc=()=>{const e=Gr(),t=Wr(),n=e.y,r=e.x,o=Fr(),i=o.clientWidth,s=o.clientHeight,c=r+i,a=n+s;return{frame:K({top:n,left:r,right:c,bottom:a}),scroll:{initial:e,current:e,max:t,diff:{value:R,displacement:R}}}},qc=({critical:e,scrollOptions:t,registry:n})=>{xe();const r=zc(),o=r.scroll.current,i=e.droppable,s=n.droppable.getAllByType(i.type).map(p=>p.callbacks.getDimensionAndWatchScroll(o,t)),c=n.draggable.getAllByType(e.draggable.type).map(p=>p.getDimension(o)),a={draggables:ar(c),droppables:cr(s)};return Ie(),{dimensions:a,critical:e,viewport:r}};function Ur(e,t,n){return n.descriptor.id===t.id||n.descriptor.type!==t.type?!1:e.droppable.getById(n.descriptor.droppableId).descriptor.mode!=="virtual"?(process.env.NODE_ENV!=="production"&&B(`
78
78
  You are attempting to add or remove a Draggable [id: ${n.descriptor.id}]
79
79
  while a drag is occurring. This is only supported for virtual lists.
80
80
 
81
81
  See https://github.com/hello-pangea/dnd/blob/main/docs/patterns/virtual-lists.md
82
- `),!1):!0}var Xc=(e,t)=>{let n=null;const r=qc({callbacks:{publish:t.publishWhileDragging,collectionStarting:t.collectionStarting},registry:e}),o=(u,g)=>{e.droppable.exists(u)||(process.env.NODE_ENV!=="production"?f(!1,`Cannot update is enabled flag of Droppable ${u} as it is not registered`):f()),n&&t.updateDroppableIsEnabled({id:u,isEnabled:g})},i=(u,g)=>{n&&(e.droppable.exists(u)||(process.env.NODE_ENV!=="production"?f(!1,`Cannot update isCombineEnabled flag of Droppable ${u} as it is not registered`):f()),t.updateDroppableIsCombineEnabled({id:u,isCombineEnabled:g}))},s=(u,g)=>{n&&(e.droppable.exists(u)||(process.env.NODE_ENV!=="production"?f(!1,`Cannot update the scroll on Droppable ${u} as it is not registered`):f()),t.updateDroppableScroll({id:u,newScroll:g}))},c=(u,g)=>{n&&e.droppable.getById(u).callbacks.scroll(g)},a=()=>{if(!n)return;r.stop();const u=n.critical.droppable;e.droppable.getAllByType(u.type).forEach(g=>g.callbacks.dragStopped()),n.unsubscribe(),n=null},d=u=>{n||(process.env.NODE_ENV!=="production"?f(!1,"Should only be subscribed when a collection is occurring"):f());const g=n.critical.draggable;u.type==="ADDITION"&&Ur(e,g,u.value)&&r.add(u.value),u.type==="REMOVAL"&&Ur(e,g,u.value)&&r.remove(u.value)};return{updateDroppableIsEnabled:o,updateDroppableIsCombineEnabled:i,scrollDroppable:c,updateDroppableScroll:s,startPublishing:u=>{n&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot start capturing critical dimensions as there is already a collection"):f());const g=e.draggable.getById(u.draggableId),m=e.droppable.getById(g.descriptor.droppableId),b={draggable:g.descriptor,droppable:m.descriptor},h=e.subscribe(d);return n={critical:b,unsubscribe:h},Yc({critical:b,registry:e,scrollOptions:u.scrollOptions})},stopPublishing:a}},Hr=(e,t)=>e.phase==="IDLE"?!0:e.phase!=="DROP_ANIMATING"||e.completed.result.draggableId===t?!1:e.completed.result.reason==="DROP",Kc=e=>{window.scrollBy(e.x,e.y)};const Jc=M(e=>He(e).filter(t=>!(!t.isEnabled||!t.frame))),Zc=(e,t)=>Jc(t).find(r=>(r.frame||(process.env.NODE_ENV!=="production"?f(!1,"Invalid result"):f()),xr(r.frame.pageMarginBox)(e)))||null;var Qc=({center:e,destination:t,droppables:n})=>{if(t){const o=n[t];return o.frame?o:null}return Zc(e,n)};const we={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:e=>e**2,durationDampening:{stopDampeningAt:1200,accelerateAt:360},disabled:!1};var ea=(e,t,n=()=>we)=>{const r=n(),o=e[t.size]*r.startFromPercentage,i=e[t.size]*r.maxScrollAtPercentage;return{startScrollingFrom:o,maxScrollValueAt:i}},zr=({startOfRange:e,endOfRange:t,current:n})=>{const r=t-e;return r===0?(process.env.NODE_ENV!=="production"&&B(`
82
+ `),!1):!0}var jc=(e,t)=>{let n=null;const r=Hc({callbacks:{publish:t.publishWhileDragging,collectionStarting:t.collectionStarting},registry:e}),o=(u,g)=>{e.droppable.exists(u)||(process.env.NODE_ENV!=="production"?f(!1,`Cannot update is enabled flag of Droppable ${u} as it is not registered`):f()),n&&t.updateDroppableIsEnabled({id:u,isEnabled:g})},i=(u,g)=>{n&&(e.droppable.exists(u)||(process.env.NODE_ENV!=="production"?f(!1,`Cannot update isCombineEnabled flag of Droppable ${u} as it is not registered`):f()),t.updateDroppableIsCombineEnabled({id:u,isCombineEnabled:g}))},s=(u,g)=>{n&&(e.droppable.exists(u)||(process.env.NODE_ENV!=="production"?f(!1,`Cannot update the scroll on Droppable ${u} as it is not registered`):f()),t.updateDroppableScroll({id:u,newScroll:g}))},c=(u,g)=>{n&&e.droppable.getById(u).callbacks.scroll(g)},a=()=>{if(!n)return;r.stop();const u=n.critical.droppable;e.droppable.getAllByType(u.type).forEach(g=>g.callbacks.dragStopped()),n.unsubscribe(),n=null},d=u=>{n||(process.env.NODE_ENV!=="production"?f(!1,"Should only be subscribed when a collection is occurring"):f());const g=n.critical.draggable;u.type==="ADDITION"&&Ur(e,g,u.value)&&r.add(u.value),u.type==="REMOVAL"&&Ur(e,g,u.value)&&r.remove(u.value)};return{updateDroppableIsEnabled:o,updateDroppableIsCombineEnabled:i,scrollDroppable:c,updateDroppableScroll:s,startPublishing:u=>{n&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot start capturing critical dimensions as there is already a collection"):f());const g=e.draggable.getById(u.draggableId),h=e.droppable.getById(g.descriptor.droppableId),b={draggable:g.descriptor,droppable:h.descriptor},m=e.subscribe(d);return n={critical:b,unsubscribe:m},qc({critical:b,registry:e,scrollOptions:u.scrollOptions})},stopPublishing:a}},Hr=(e,t)=>e.phase==="IDLE"?!0:e.phase!=="DROP_ANIMATING"||e.completed.result.draggableId===t?!1:e.completed.result.reason==="DROP",Yc=e=>{window.scrollBy(e.x,e.y)};const Xc=M(e=>He(e).filter(t=>!(!t.isEnabled||!t.frame))),Kc=(e,t)=>Xc(t).find(r=>(r.frame||(process.env.NODE_ENV!=="production"?f(!1,"Invalid result"):f()),xr(r.frame.pageMarginBox)(e)))||null;var Jc=({center:e,destination:t,droppables:n})=>{if(t){const o=n[t];return o.frame?o:null}return Kc(e,n)};const we={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:e=>e**2,durationDampening:{stopDampeningAt:1200,accelerateAt:360},disabled:!1};var Zc=(e,t,n=()=>we)=>{const r=n(),o=e[t.size]*r.startFromPercentage,i=e[t.size]*r.maxScrollAtPercentage;return{startScrollingFrom:o,maxScrollValueAt:i}},zr=({startOfRange:e,endOfRange:t,current:n})=>{const r=t-e;return r===0?(process.env.NODE_ENV!=="production"&&B(`
83
83
  Detected distance range of 0 in the fluid auto scroller
84
84
  This is unexpected and would cause a divide by 0 issue.
85
85
  Not allowing an auto scroll
86
- `),0):(n-e)/r},Ut=1,ta=(e,t,n=()=>we)=>{const r=n();if(e>t.startScrollingFrom)return 0;if(e<=t.maxScrollValueAt)return r.maxPixelScroll;if(e===t.startScrollingFrom)return Ut;const i=1-zr({startOfRange:t.maxScrollValueAt,endOfRange:t.startScrollingFrom,current:e}),s=r.maxPixelScroll*r.ease(i);return Math.ceil(s)},na=(e,t,n)=>{const r=n(),o=r.durationDampening.accelerateAt,i=r.durationDampening.stopDampeningAt,s=t,c=i,d=Date.now()-s;if(d>=i)return e;if(d<o)return Ut;const p=zr({startOfRange:o,endOfRange:c,current:d}),l=e*r.ease(p);return Math.ceil(l)},qr=({distanceToEdge:e,thresholds:t,dragStartTime:n,shouldUseTimeDampening:r,getAutoScrollerOptions:o})=>{const i=ta(e,t,o);return i===0?0:r?Math.max(na(i,n,o),Ut):i},jr=({container:e,distanceToEdges:t,dragStartTime:n,axis:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const s=ea(e,r,i);return t[r.end]<t[r.start]?qr({distanceToEdge:t[r.end],thresholds:s,dragStartTime:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i}):-1*qr({distanceToEdge:t[r.start],thresholds:s,dragStartTime:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i})},ra=({container:e,subject:t,proposedScroll:n})=>{const r=t.height>e.height,o=t.width>e.width;return!o&&!r?n:o&&r?null:{x:o?0:n.x,y:r?0:n.y}};const oa=ir(e=>e===0?0:e);var Yr=({dragStartTime:e,container:t,subject:n,center:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const s={top:r.y-t.top,right:t.right-r.x,bottom:t.bottom-r.y,left:r.x-t.left},c=jr({container:t,distanceToEdges:s,dragStartTime:e,axis:Ot,shouldUseTimeDampening:o,getAutoScrollerOptions:i}),a=jr({container:t,distanceToEdges:s,dragStartTime:e,axis:ur,shouldUseTimeDampening:o,getAutoScrollerOptions:i}),d=oa({x:a,y:c});if(ne(d,R))return null;const p=ra({container:t,subject:n,proposedScroll:d});return p?ne(p,R)?null:p:null};const ia=ir(e=>e===0?0:e>0?1:-1),Ht=(()=>{const e=(t,n)=>t<0?t:t>n?t-n:0;return({current:t,max:n,change:r})=>{const o=$(t,r),i={x:e(o.x,n.x),y:e(o.y,n.y)};return ne(i,R)?null:i}})(),Xr=({max:e,current:t,change:n})=>{const r={x:Math.max(t.x,e.x),y:Math.max(t.y,e.y)},o=ia(n),i=Ht({max:r,current:t,change:o});return!i||o.x!==0&&i.x===0||o.y!==0&&i.y===0},zt=(e,t)=>Xr({current:e.scroll.current,max:e.scroll.max,change:t}),sa=(e,t)=>{if(!zt(e,t))return null;const n=e.scroll.max,r=e.scroll.current;return Ht({current:r,max:n,change:t})},qt=(e,t)=>{const n=e.frame;return n?Xr({current:n.scroll.current,max:n.scroll.max,change:t}):!1},ca=(e,t)=>{const n=e.frame;return!n||!qt(e,t)?null:Ht({current:n.scroll.current,max:n.scroll.max,change:t})};var aa=({viewport:e,subject:t,center:n,dragStartTime:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const s=Yr({dragStartTime:r,container:e.frame,subject:t,center:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i});return s&&zt(e,s)?s:null},la=({droppable:e,subject:t,center:n,dragStartTime:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const s=e.frame;if(!s)return null;const c=Yr({dragStartTime:r,container:s.pageMarginBox,subject:t,center:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i});return c&&qt(e,c)?c:null},Kr=({state:e,dragStartTime:t,shouldUseTimeDampening:n,scrollWindow:r,scrollDroppable:o,getAutoScrollerOptions:i})=>{const s=e.current.page.borderBoxCenter,a=e.dimensions.draggables[e.critical.draggable.id].page.marginBox;if(e.isWindowScrollAllowed){const l=e.viewport,u=aa({dragStartTime:t,viewport:l,subject:a,center:s,shouldUseTimeDampening:n,getAutoScrollerOptions:i});if(u){r(u);return}}const d=Qc({center:s,destination:W(e.impact),droppables:e.dimensions.droppables});if(!d)return;const p=la({dragStartTime:t,droppable:d,subject:a,center:s,shouldUseTimeDampening:n,getAutoScrollerOptions:i});p&&o(d.descriptor.id,p)},da=({scrollWindow:e,scrollDroppable:t,getAutoScrollerOptions:n=()=>we})=>{const r=me(e),o=me(t);let i=null;const s=d=>{i||(process.env.NODE_ENV!=="production"?f(!1,"Cannot fluid scroll if not dragging"):f());const{shouldUseTimeDampening:p,dragStartTime:l}=i;Kr({state:d,scrollWindow:r,scrollDroppable:o,dragStartTime:l,shouldUseTimeDampening:p,getAutoScrollerOptions:n})};return{start:d=>{xe(),i&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot start auto scrolling when already started"):f());const p=Date.now();let l=!1;const u=()=>{l=!0};Kr({state:d,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:u,scrollDroppable:u,getAutoScrollerOptions:n}),i={dragStartTime:p,shouldUseTimeDampening:l},Ie(),l&&s(d)},stop:()=>{i&&(r.cancel(),o.cancel(),i=null)},scroll:s}},ua=({move:e,scrollDroppable:t,scrollWindow:n})=>{const r=(c,a)=>{const d=$(c.current.client.selection,a);e({client:d})},o=(c,a)=>{if(!qt(c,a))return a;const d=ca(c,a);if(!d)return t(c.descriptor.id,a),null;const p=F(a,d);return t(c.descriptor.id,p),F(a,p)},i=(c,a,d)=>{if(!c||!zt(a,d))return d;const p=sa(a,d);if(!p)return n(d),null;const l=F(d,p);return n(l),F(d,l)};return c=>{const a=c.scrollJumpRequest;if(!a)return;const d=W(c.impact);d||(process.env.NODE_ENV!=="production"?f(!1,"Cannot perform a jump scroll when there is no destination"):f());const p=o(c.dimensions.droppables[d],a);if(!p)return;const l=c.viewport,u=i(c.isWindowScrollAllowed,l,p);u&&r(c,u)}},pa=({scrollDroppable:e,scrollWindow:t,move:n,getAutoScrollerOptions:r})=>{const o=da({scrollWindow:t,scrollDroppable:e,getAutoScrollerOptions:r}),i=ua({move:n,scrollWindow:t,scrollDroppable:e});return{scroll:a=>{if(!(r().disabled||a.phase!=="DRAGGING")){if(a.movementMode==="FLUID"){o.scroll(a);return}a.scrollJumpRequest&&i(a)}},start:o.start,stop:o.stop}};const ue="data-rfd",pe=(()=>{const e=`${ue}-drag-handle`;return{base:e,draggableId:`${e}-draggable-id`,contextId:`${e}-context-id`}})(),jt=(()=>{const e=`${ue}-draggable`;return{base:e,contextId:`${e}-context-id`,id:`${e}-id`}})(),fa=(()=>{const e=`${ue}-droppable`;return{base:e,contextId:`${e}-context-id`,id:`${e}-id`}})(),Jr={contextId:`${ue}-scroll-container-context-id`},ga=e=>t=>`[${t}="${e}"]`,_e=(e,t)=>e.map(n=>{const r=n.styles[t];return r?`${n.selector} { ${r} }`:""}).join(" "),ma="pointer-events: none;";var ha=e=>{const t=ga(e),n=(()=>{const c=`
86
+ `),0):(n-e)/r},Ut=1,Qc=(e,t,n=()=>we)=>{const r=n();if(e>t.startScrollingFrom)return 0;if(e<=t.maxScrollValueAt)return r.maxPixelScroll;if(e===t.startScrollingFrom)return Ut;const i=1-zr({startOfRange:t.maxScrollValueAt,endOfRange:t.startScrollingFrom,current:e}),s=r.maxPixelScroll*r.ease(i);return Math.ceil(s)},ea=(e,t,n)=>{const r=n(),o=r.durationDampening.accelerateAt,i=r.durationDampening.stopDampeningAt,s=t,c=i,d=Date.now()-s;if(d>=i)return e;if(d<o)return Ut;const p=zr({startOfRange:o,endOfRange:c,current:d}),l=e*r.ease(p);return Math.ceil(l)},qr=({distanceToEdge:e,thresholds:t,dragStartTime:n,shouldUseTimeDampening:r,getAutoScrollerOptions:o})=>{const i=Qc(e,t,o);return i===0?0:r?Math.max(ea(i,n,o),Ut):i},jr=({container:e,distanceToEdges:t,dragStartTime:n,axis:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const s=Zc(e,r,i);return t[r.end]<t[r.start]?qr({distanceToEdge:t[r.end],thresholds:s,dragStartTime:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i}):-1*qr({distanceToEdge:t[r.start],thresholds:s,dragStartTime:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i})},ta=({container:e,subject:t,proposedScroll:n})=>{const r=t.height>e.height,o=t.width>e.width;return!o&&!r?n:o&&r?null:{x:o?0:n.x,y:r?0:n.y}};const na=ir(e=>e===0?0:e);var Yr=({dragStartTime:e,container:t,subject:n,center:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const s={top:r.y-t.top,right:t.right-r.x,bottom:t.bottom-r.y,left:r.x-t.left},c=jr({container:t,distanceToEdges:s,dragStartTime:e,axis:Ot,shouldUseTimeDampening:o,getAutoScrollerOptions:i}),a=jr({container:t,distanceToEdges:s,dragStartTime:e,axis:ur,shouldUseTimeDampening:o,getAutoScrollerOptions:i}),d=na({x:a,y:c});if(ne(d,R))return null;const p=ta({container:t,subject:n,proposedScroll:d});return p?ne(p,R)?null:p:null};const ra=ir(e=>e===0?0:e>0?1:-1),Ht=(()=>{const e=(t,n)=>t<0?t:t>n?t-n:0;return({current:t,max:n,change:r})=>{const o=$(t,r),i={x:e(o.x,n.x),y:e(o.y,n.y)};return ne(i,R)?null:i}})(),Xr=({max:e,current:t,change:n})=>{const r={x:Math.max(t.x,e.x),y:Math.max(t.y,e.y)},o=ra(n),i=Ht({max:r,current:t,change:o});return!i||o.x!==0&&i.x===0||o.y!==0&&i.y===0},zt=(e,t)=>Xr({current:e.scroll.current,max:e.scroll.max,change:t}),oa=(e,t)=>{if(!zt(e,t))return null;const n=e.scroll.max,r=e.scroll.current;return Ht({current:r,max:n,change:t})},qt=(e,t)=>{const n=e.frame;return n?Xr({current:n.scroll.current,max:n.scroll.max,change:t}):!1},ia=(e,t)=>{const n=e.frame;return!n||!qt(e,t)?null:Ht({current:n.scroll.current,max:n.scroll.max,change:t})};var sa=({viewport:e,subject:t,center:n,dragStartTime:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const s=Yr({dragStartTime:r,container:e.frame,subject:t,center:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i});return s&&zt(e,s)?s:null},ca=({droppable:e,subject:t,center:n,dragStartTime:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const s=e.frame;if(!s)return null;const c=Yr({dragStartTime:r,container:s.pageMarginBox,subject:t,center:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i});return c&&qt(e,c)?c:null},Kr=({state:e,dragStartTime:t,shouldUseTimeDampening:n,scrollWindow:r,scrollDroppable:o,getAutoScrollerOptions:i})=>{const s=e.current.page.borderBoxCenter,a=e.dimensions.draggables[e.critical.draggable.id].page.marginBox;if(e.isWindowScrollAllowed){const l=e.viewport,u=sa({dragStartTime:t,viewport:l,subject:a,center:s,shouldUseTimeDampening:n,getAutoScrollerOptions:i});if(u){r(u);return}}const d=Jc({center:s,destination:W(e.impact),droppables:e.dimensions.droppables});if(!d)return;const p=ca({dragStartTime:t,droppable:d,subject:a,center:s,shouldUseTimeDampening:n,getAutoScrollerOptions:i});p&&o(d.descriptor.id,p)},aa=({scrollWindow:e,scrollDroppable:t,getAutoScrollerOptions:n=()=>we})=>{const r=me(e),o=me(t);let i=null;const s=d=>{i||(process.env.NODE_ENV!=="production"?f(!1,"Cannot fluid scroll if not dragging"):f());const{shouldUseTimeDampening:p,dragStartTime:l}=i;Kr({state:d,scrollWindow:r,scrollDroppable:o,dragStartTime:l,shouldUseTimeDampening:p,getAutoScrollerOptions:n})};return{start:d=>{xe(),i&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot start auto scrolling when already started"):f());const p=Date.now();let l=!1;const u=()=>{l=!0};Kr({state:d,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:u,scrollDroppable:u,getAutoScrollerOptions:n}),i={dragStartTime:p,shouldUseTimeDampening:l},Ie(),l&&s(d)},stop:()=>{i&&(r.cancel(),o.cancel(),i=null)},scroll:s}},la=({move:e,scrollDroppable:t,scrollWindow:n})=>{const r=(c,a)=>{const d=$(c.current.client.selection,a);e({client:d})},o=(c,a)=>{if(!qt(c,a))return a;const d=ia(c,a);if(!d)return t(c.descriptor.id,a),null;const p=F(a,d);return t(c.descriptor.id,p),F(a,p)},i=(c,a,d)=>{if(!c||!zt(a,d))return d;const p=oa(a,d);if(!p)return n(d),null;const l=F(d,p);return n(l),F(d,l)};return c=>{const a=c.scrollJumpRequest;if(!a)return;const d=W(c.impact);d||(process.env.NODE_ENV!=="production"?f(!1,"Cannot perform a jump scroll when there is no destination"):f());const p=o(c.dimensions.droppables[d],a);if(!p)return;const l=c.viewport,u=i(c.isWindowScrollAllowed,l,p);u&&r(c,u)}},da=({scrollDroppable:e,scrollWindow:t,move:n,getAutoScrollerOptions:r})=>{const o=aa({scrollWindow:t,scrollDroppable:e,getAutoScrollerOptions:r}),i=la({move:n,scrollWindow:t,scrollDroppable:e});return{scroll:a=>{if(!(r().disabled||a.phase!=="DRAGGING")){if(a.movementMode==="FLUID"){o.scroll(a);return}a.scrollJumpRequest&&i(a)}},start:o.start,stop:o.stop}};const ue="data-rfd",pe=(()=>{const e=`${ue}-drag-handle`;return{base:e,draggableId:`${e}-draggable-id`,contextId:`${e}-context-id`}})(),jt=(()=>{const e=`${ue}-draggable`;return{base:e,contextId:`${e}-context-id`,id:`${e}-id`}})(),ua=(()=>{const e=`${ue}-droppable`;return{base:e,contextId:`${e}-context-id`,id:`${e}-id`}})(),Jr={contextId:`${ue}-scroll-container-context-id`},pa=e=>t=>`[${t}="${e}"]`,_e=(e,t)=>e.map(n=>{const r=n.styles[t];return r?`${n.selector} { ${r} }`:""}).join(" "),fa="pointer-events: none;";var ga=e=>{const t=pa(e),n=(()=>{const c=`
87
87
  cursor: -webkit-grab;
88
88
  cursor: grab;
89
89
  `;return{selector:t(pe.contextId),styles:{always:`
90
90
  -webkit-touch-callout: none;
91
91
  -webkit-tap-highlight-color: rgba(0,0,0,0);
92
92
  touch-action: manipulation;
93
- `,resting:c,dragging:ma,dropAnimating:c}}})(),r=(()=>{const c=`
94
- transition: ${Ce.outOfTheWay};
95
- `;return{selector:t(jt.contextId),styles:{dragging:c,dropAnimating:c,userCancel:c}}})(),o={selector:t(fa.contextId),styles:{always:"overflow-anchor: none;"}},s=[r,n,o,{selector:"body",styles:{dragging:`
93
+ `,resting:c,dragging:fa,dropAnimating:c}}})(),r=(()=>{const c=`
94
+ transition: ${Se.outOfTheWay};
95
+ `;return{selector:t(jt.contextId),styles:{dragging:c,dropAnimating:c,userCancel:c}}})(),o={selector:t(ua.contextId),styles:{always:"overflow-anchor: none;"}},s=[r,n,o,{selector:"body",styles:{dragging:`
96
96
  cursor: grabbing;
97
97
  cursor: -webkit-grabbing;
98
98
  user-select: none;
@@ -100,7 +100,7 @@ ${hn.current.stack}
100
100
  -moz-user-select: none;
101
101
  -ms-user-select: none;
102
102
  overflow-anchor: none;
103
- `}}];return{always:_e(s,"always"),resting:_e(s,"resting"),dragging:_e(s,"dragging"),dropAnimating:_e(s,"dropAnimating"),userCancel:_e(s,"userCancel")}};const U=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?D.useLayoutEffect:D.useEffect,Yt=()=>{const e=document.querySelector("head");return e||(process.env.NODE_ENV!=="production"?f(!1,"Cannot find the head to append a style to"):f()),e},Zr=e=>{const t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.type="text/css",t};function ba(e,t){const n=w(()=>ha(e),[e]),r=D.useRef(null),o=D.useRef(null),i=x(M(l=>{const u=o.current;u||(process.env.NODE_ENV!=="production"?f(!1,"Cannot set dynamic style element if it is not set"):f()),u.textContent=l}),[]),s=x(l=>{const u=r.current;u||(process.env.NODE_ENV!=="production"?f(!1,"Cannot set dynamic style element if it is not set"):f()),u.textContent=l},[]);U(()=>{!r.current&&!o.current||(process.env.NODE_ENV!=="production"?f(!1,"style elements already mounted"):f());const l=Zr(t),u=Zr(t);return r.current=l,o.current=u,l.setAttribute(`${ue}-always`,e),u.setAttribute(`${ue}-dynamic`,e),Yt().appendChild(l),Yt().appendChild(u),s(n.always),i(n.resting),()=>{const g=m=>{const b=m.current;b||(process.env.NODE_ENV!=="production"?f(!1,"Cannot unmount ref as it is not set"):f()),Yt().removeChild(b),m.current=null};g(r),g(o)}},[t,s,i,n.always,n.resting,e]);const c=x(()=>i(n.dragging),[i,n.dragging]),a=x(l=>{if(l==="DROP"){i(n.dropAnimating);return}i(n.userCancel)},[i,n.dropAnimating,n.userCancel]),d=x(()=>{o.current&&i(n.resting)},[i,n.resting]);return w(()=>({dragging:c,dropping:a,resting:d}),[c,a,d])}function Qr(e,t){return Array.from(e.querySelectorAll(t))}var eo=e=>e&&e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView:window;function Ae(e){return e instanceof eo(e).HTMLElement}function to(e,t){const n=`[${pe.contextId}="${e}"]`,r=Qr(document,n);if(!r.length)return process.env.NODE_ENV!=="production"&&B(`Unable to find any drag handles in the context "${e}"`),null;const o=r.find(i=>i.getAttribute(pe.draggableId)===t);return o?Ae(o)?o:(process.env.NODE_ENV!=="production"&&B("drag handle needs to be a HTMLElement"),null):(process.env.NODE_ENV!=="production"&&B(`Unable to find drag handle with id "${t}" as no handle with a matching id was found`),null)}function va(e){const t=D.useRef({}),n=D.useRef(null),r=D.useRef(null),o=D.useRef(!1),i=x(function(u,g){const m={id:u,focus:g};return t.current[u]=m,function(){const h=t.current;h[u]!==m&&delete h[u]}},[]),s=x(function(u){const g=to(e,u);g&&g!==document.activeElement&&g.focus()},[e]),c=x(function(u,g){n.current===u&&(n.current=g)},[]),a=x(function(){r.current||o.current&&(r.current=requestAnimationFrame(()=>{r.current=null;const u=n.current;u&&s(u)}))},[s]),d=x(function(u){n.current=null;const g=document.activeElement;g&&g.getAttribute(pe.draggableId)===u&&(n.current=u)},[]);return U(()=>(o.current=!0,function(){o.current=!1;const u=r.current;u&&cancelAnimationFrame(u)}),[]),w(()=>({register:i,tryRecordFocus:d,tryRestoreFocusRecorded:a,tryShiftRecord:c}),[i,d,a,c])}function ya(){const e={draggables:{},droppables:{}},t=[];function n(l){return t.push(l),function(){const g=t.indexOf(l);g!==-1&&t.splice(g,1)}}function r(l){t.length&&t.forEach(u=>u(l))}function o(l){return e.draggables[l]||null}function i(l){const u=o(l);return u||(process.env.NODE_ENV!=="production"?f(!1,`Cannot find draggable entry with id [${l}]`):f()),u}const s={register:l=>{e.draggables[l.descriptor.id]=l,r({type:"ADDITION",value:l})},update:(l,u)=>{const g=e.draggables[u.descriptor.id];g&&g.uniqueId===l.uniqueId&&(delete e.draggables[u.descriptor.id],e.draggables[l.descriptor.id]=l)},unregister:l=>{const u=l.descriptor.id,g=o(u);g&&l.uniqueId===g.uniqueId&&(delete e.draggables[u],e.droppables[l.descriptor.droppableId]&&r({type:"REMOVAL",value:l}))},getById:i,findById:o,exists:l=>!!o(l),getAllByType:l=>Object.values(e.draggables).filter(u=>u.descriptor.type===l)};function c(l){return e.droppables[l]||null}function a(l){const u=c(l);return u||(process.env.NODE_ENV!=="production"?f(!1,`Cannot find droppable entry with id [${l}]`):f()),u}const d={register:l=>{e.droppables[l.descriptor.id]=l},unregister:l=>{const u=c(l.descriptor.id);u&&l.uniqueId===u.uniqueId&&delete e.droppables[l.descriptor.id]},getById:a,findById:c,exists:l=>!!c(l),getAllByType:l=>Object.values(e.droppables).filter(u=>u.descriptor.type===l)};function p(){e.draggables={},e.droppables={},t.length=0}return{draggable:s,droppable:d,subscribe:n,clean:p}}function Ea(){const e=w(ya,[]);return D.useEffect(()=>function(){e.clean()},[e]),e}var Xt=D.createContext(null),Pe=()=>{const e=document.body;return e||(process.env.NODE_ENV!=="production"?f(!1,"Cannot find document.body"):f()),e};const Da={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},Na=e=>`rfd-announcement-${e}`;function xa(e){const t=w(()=>Na(e),[e]),n=D.useRef(null);return D.useEffect(function(){const i=document.createElement("div");return n.current=i,i.id=t,i.setAttribute("aria-live","assertive"),i.setAttribute("aria-atomic","true"),Fe(i.style,Da),Pe().appendChild(i),function(){setTimeout(function(){const a=Pe();a.contains(i)&&a.removeChild(i),i===n.current&&(n.current=null)})}},[t]),x(o=>{const i=n.current;if(i){i.textContent=o;return}process.env.NODE_ENV!=="production"&&B(`
103
+ `}}];return{always:_e(s,"always"),resting:_e(s,"resting"),dragging:_e(s,"dragging"),dropAnimating:_e(s,"dropAnimating"),userCancel:_e(s,"userCancel")}};const U=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?D.useLayoutEffect:D.useEffect,Yt=()=>{const e=document.querySelector("head");return e||(process.env.NODE_ENV!=="production"?f(!1,"Cannot find the head to append a style to"):f()),e},Zr=e=>{const t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.type="text/css",t};function ma(e,t){const n=w(()=>ga(e),[e]),r=D.useRef(null),o=D.useRef(null),i=x(M(l=>{const u=o.current;u||(process.env.NODE_ENV!=="production"?f(!1,"Cannot set dynamic style element if it is not set"):f()),u.textContent=l}),[]),s=x(l=>{const u=r.current;u||(process.env.NODE_ENV!=="production"?f(!1,"Cannot set dynamic style element if it is not set"):f()),u.textContent=l},[]);U(()=>{!r.current&&!o.current||(process.env.NODE_ENV!=="production"?f(!1,"style elements already mounted"):f());const l=Zr(t),u=Zr(t);return r.current=l,o.current=u,l.setAttribute(`${ue}-always`,e),u.setAttribute(`${ue}-dynamic`,e),Yt().appendChild(l),Yt().appendChild(u),s(n.always),i(n.resting),()=>{const g=h=>{const b=h.current;b||(process.env.NODE_ENV!=="production"?f(!1,"Cannot unmount ref as it is not set"):f()),Yt().removeChild(b),h.current=null};g(r),g(o)}},[t,s,i,n.always,n.resting,e]);const c=x(()=>i(n.dragging),[i,n.dragging]),a=x(l=>{if(l==="DROP"){i(n.dropAnimating);return}i(n.userCancel)},[i,n.dropAnimating,n.userCancel]),d=x(()=>{o.current&&i(n.resting)},[i,n.resting]);return w(()=>({dragging:c,dropping:a,resting:d}),[c,a,d])}function Qr(e,t){return Array.from(e.querySelectorAll(t))}var eo=e=>e&&e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView:window;function Ae(e){return e instanceof eo(e).HTMLElement}function to(e,t){const n=`[${pe.contextId}="${e}"]`,r=Qr(document,n);if(!r.length)return process.env.NODE_ENV!=="production"&&B(`Unable to find any drag handles in the context "${e}"`),null;const o=r.find(i=>i.getAttribute(pe.draggableId)===t);return o?Ae(o)?o:(process.env.NODE_ENV!=="production"&&B("drag handle needs to be a HTMLElement"),null):(process.env.NODE_ENV!=="production"&&B(`Unable to find drag handle with id "${t}" as no handle with a matching id was found`),null)}function ha(e){const t=D.useRef({}),n=D.useRef(null),r=D.useRef(null),o=D.useRef(!1),i=x(function(u,g){const h={id:u,focus:g};return t.current[u]=h,function(){const m=t.current;m[u]!==h&&delete m[u]}},[]),s=x(function(u){const g=to(e,u);g&&g!==document.activeElement&&g.focus()},[e]),c=x(function(u,g){n.current===u&&(n.current=g)},[]),a=x(function(){r.current||o.current&&(r.current=requestAnimationFrame(()=>{r.current=null;const u=n.current;u&&s(u)}))},[s]),d=x(function(u){n.current=null;const g=document.activeElement;g&&g.getAttribute(pe.draggableId)===u&&(n.current=u)},[]);return U(()=>(o.current=!0,function(){o.current=!1;const u=r.current;u&&cancelAnimationFrame(u)}),[]),w(()=>({register:i,tryRecordFocus:d,tryRestoreFocusRecorded:a,tryShiftRecord:c}),[i,d,a,c])}function ba(){const e={draggables:{},droppables:{}},t=[];function n(l){return t.push(l),function(){const g=t.indexOf(l);g!==-1&&t.splice(g,1)}}function r(l){t.length&&t.forEach(u=>u(l))}function o(l){return e.draggables[l]||null}function i(l){const u=o(l);return u||(process.env.NODE_ENV!=="production"?f(!1,`Cannot find draggable entry with id [${l}]`):f()),u}const s={register:l=>{e.draggables[l.descriptor.id]=l,r({type:"ADDITION",value:l})},update:(l,u)=>{const g=e.draggables[u.descriptor.id];g&&g.uniqueId===l.uniqueId&&(delete e.draggables[u.descriptor.id],e.draggables[l.descriptor.id]=l)},unregister:l=>{const u=l.descriptor.id,g=o(u);g&&l.uniqueId===g.uniqueId&&(delete e.draggables[u],e.droppables[l.descriptor.droppableId]&&r({type:"REMOVAL",value:l}))},getById:i,findById:o,exists:l=>!!o(l),getAllByType:l=>Object.values(e.draggables).filter(u=>u.descriptor.type===l)};function c(l){return e.droppables[l]||null}function a(l){const u=c(l);return u||(process.env.NODE_ENV!=="production"?f(!1,`Cannot find droppable entry with id [${l}]`):f()),u}const d={register:l=>{e.droppables[l.descriptor.id]=l},unregister:l=>{const u=c(l.descriptor.id);u&&l.uniqueId===u.uniqueId&&delete e.droppables[l.descriptor.id]},getById:a,findById:c,exists:l=>!!c(l),getAllByType:l=>Object.values(e.droppables).filter(u=>u.descriptor.type===l)};function p(){e.draggables={},e.droppables={},t.length=0}return{draggable:s,droppable:d,subscribe:n,clean:p}}function va(){const e=w(ba,[]);return D.useEffect(()=>function(){e.clean()},[e]),e}var Xt=D.createContext(null),Pe=()=>{const e=document.body;return e||(process.env.NODE_ENV!=="production"?f(!1,"Cannot find document.body"):f()),e};const ya={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},Ea=e=>`rfd-announcement-${e}`;function Da(e){const t=w(()=>Ea(e),[e]),n=D.useRef(null);return D.useEffect(function(){const i=document.createElement("div");return n.current=i,i.id=t,i.setAttribute("aria-live","assertive"),i.setAttribute("aria-atomic","true"),Fe(i.style,ya),Pe().appendChild(i),function(){setTimeout(function(){const a=Pe();a.contains(i)&&a.removeChild(i),i===n.current&&(n.current=null)})}},[t]),x(o=>{const i=n.current;if(i){i.textContent=o;return}process.env.NODE_ENV!=="production"&&B(`
104
104
  A screen reader message was trying to be announced but it was unable to do so.
105
105
  This can occur if you unmount your <DragDropContext /> in your onDragEnd.
106
106
  Consider calling provided.announce() before the unmount so that the instruction will
@@ -109,7 +109,7 @@ ${hn.current.stack}
109
109
  Message not passed to screen reader:
110
110
 
111
111
  "${o}"
112
- `)},[])}const Ia={separator:"::"};function Kt(e,t=Ia){const n=D.useId();return w(()=>`${e}${t.separator}${n}`,[t.separator,e,n])}function Sa({contextId:e,uniqueId:t}){return`rfd-hidden-text-${e}-${t}`}function Ca({contextId:e,text:t}){const n=Kt("hidden-text",{separator:"-"}),r=w(()=>Sa({contextId:e,uniqueId:n}),[n,e]);return D.useEffect(function(){const i=document.createElement("div");return i.id=r,i.textContent=t,i.style.display="none",Pe().appendChild(i),function(){const c=Pe();c.contains(i)&&c.removeChild(i)}},[r,t]),r}var Ke=D.createContext(null),Oa={react:"^18.0.0 || ^19.0.0"};const wa=/(\d+)\.(\d+)\.(\d+)/,no=e=>{const t=wa.exec(e);t==null&&(process.env.NODE_ENV!=="production"?f(!1,`Unable to parse React version ${e}`):f());const n=Number(t[1]),r=Number(t[2]),o=Number(t[3]);return{major:n,minor:r,patch:o,raw:e}},_a=(e,t)=>t.major>e.major?!0:t.major<e.major?!1:t.minor>e.minor?!0:t.minor<e.minor?!1:t.patch>=e.patch;var Aa=(e,t)=>{const n=no(e),r=no(t);_a(n,r)||process.env.NODE_ENV!=="production"&&B(`
112
+ `)},[])}const Na={separator:"::"};function Kt(e,t=Na){const n=D.useId();return w(()=>`${e}${t.separator}${n}`,[t.separator,e,n])}function xa({contextId:e,uniqueId:t}){return`rfd-hidden-text-${e}-${t}`}function Ia({contextId:e,text:t}){const n=Kt("hidden-text",{separator:"-"}),r=w(()=>xa({contextId:e,uniqueId:n}),[n,e]);return D.useEffect(function(){const i=document.createElement("div");return i.id=r,i.textContent=t,i.style.display="none",Pe().appendChild(i),function(){const c=Pe();c.contains(i)&&c.removeChild(i)}},[r,t]),r}var Ke=D.createContext(null),Ca={react:"^18.0.0 || ^19.0.0"};const Sa=/(\d+)\.(\d+)\.(\d+)/,no=e=>{const t=Sa.exec(e);t==null&&(process.env.NODE_ENV!=="production"?f(!1,`Unable to parse React version ${e}`):f());const n=Number(t[1]),r=Number(t[2]),o=Number(t[3]);return{major:n,minor:r,patch:o,raw:e}},Oa=(e,t)=>t.major>e.major?!0:t.major<e.major?!1:t.minor>e.minor?!0:t.minor<e.minor?!1:t.patch>=e.patch;var wa=(e,t)=>{const n=no(e),r=no(t);Oa(n,r)||process.env.NODE_ENV!=="production"&&B(`
113
113
  React version: [${r.raw}]
114
114
  does not satisfy expected peer dependency version: [${n.raw}]
115
115
 
@@ -119,7 +119,7 @@ ${hn.current.stack}
119
119
  This is to ensure consistent browser layout and measurement
120
120
 
121
121
  More information: https://github.com/hello-pangea/dnd/blob/main/docs/guides/doctype.md
122
- `;var Pa=e=>{const t=e.doctype;if(!t){process.env.NODE_ENV!=="production"&&B(`
122
+ `;var _a=e=>{const t=e.doctype;if(!t){process.env.NODE_ENV!=="production"&&B(`
123
123
  No <!doctype html> found.
124
124
 
125
125
  ${Jt}
@@ -136,7 +136,7 @@ ${hn.current.stack}
136
136
  A setup problem was encountered.
137
137
 
138
138
  > ${n.message}
139
- `)}},t)})}function Ta(){Te(()=>{Aa(Oa.react,D.version),Pa(document)},[])}function Qt(e){const t=D.useRef(e);return D.useEffect(()=>{t.current=e}),t}function Ba(){let e=null;function t(){return!!e}function n(s){return s===e}function r(s){e&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot claim lock as it is already claimed"):f());const c={abandon:s};return e=c,c}function o(){e||(process.env.NODE_ENV!=="production"?f(!1,"Cannot release lock when there is no lock"):f()),e=null}function i(){e&&(e.abandon(),o())}return{isClaimed:t,isActive:n,claim:r,release:o,tryAbandon:i}}function Be(e){return e.phase==="IDLE"||e.phase==="DROP_ANIMATING"?!1:e.isDragging}const Va=9,La=13,en=27,ro=32,Ra=33,Ma=34,$a=35,Ga=36,ka=37,Fa=38,Wa=39,Ua=40,Ha={[La]:!0,[Va]:!0};var oo=e=>{Ha[e.keyCode]&&e.preventDefault()};const Je=(()=>{const e="visibilitychange";return typeof document>"u"?e:[e,`ms${e}`,`webkit${e}`,`moz${e}`,`o${e}`].find(r=>`on${r}`in document)||e})(),io=0,so=5;function za(e,t){return Math.abs(t.x-e.x)>=so||Math.abs(t.y-e.y)>=so}const co={type:"IDLE"};function qa({cancel:e,completed:t,getPhase:n,setPhase:r}){return[{eventName:"mousemove",fn:o=>{const{button:i,clientX:s,clientY:c}=o;if(i!==io)return;const a={x:s,y:c},d=n();if(d.type==="DRAGGING"){o.preventDefault(),d.actions.move(a);return}d.type!=="PENDING"&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot be IDLE"):f());const p=d.point;if(!za(p,a))return;o.preventDefault();const l=d.actions.fluidLift(a);r({type:"DRAGGING",actions:l})}},{eventName:"mouseup",fn:o=>{const i=n();if(i.type!=="DRAGGING"){e();return}o.preventDefault(),i.actions.drop({shouldBlockNextClick:!0}),t()}},{eventName:"mousedown",fn:o=>{n().type==="DRAGGING"&&o.preventDefault(),e()}},{eventName:"keydown",fn:o=>{if(n().type==="PENDING"){e();return}if(o.keyCode===en){o.preventDefault(),e();return}oo(o)}},{eventName:"resize",fn:e},{eventName:"scroll",options:{passive:!0,capture:!1},fn:()=>{n().type==="PENDING"&&e()}},{eventName:"webkitmouseforcedown",fn:o=>{const i=n();if(i.type==="IDLE"&&(process.env.NODE_ENV!=="production"?f(!1,"Unexpected phase"):f()),i.actions.shouldRespectForcePress()){e();return}o.preventDefault()}},{eventName:Je,fn:e}]}function ja(e){const t=D.useRef(co),n=D.useRef(te),r=w(()=>({eventName:"mousedown",fn:function(l){if(l.defaultPrevented||l.button!==io||l.ctrlKey||l.metaKey||l.shiftKey||l.altKey)return;const u=e.findClosestDraggableId(l);if(!u)return;const g=e.tryGetLock(u,s,{sourceEvent:l});if(!g)return;l.preventDefault();const m={x:l.clientX,y:l.clientY};n.current(),d(g,m)}}),[e]),o=w(()=>({eventName:"webkitmouseforcewillbegin",fn:p=>{if(p.defaultPrevented)return;const l=e.findClosestDraggableId(p);if(!l)return;const u=e.findOptionsForDraggable(l);u&&(u.shouldRespectForcePress||e.canGetLock(l)&&p.preventDefault())}}),[e]),i=x(function(){const l={passive:!1,capture:!0};n.current=Y(window,[o,r],l)},[o,r]),s=x(()=>{t.current.type!=="IDLE"&&(t.current=co,n.current(),i())},[i]),c=x(()=>{const p=t.current;s(),p.type==="DRAGGING"&&p.actions.cancel({shouldBlockNextClick:!0}),p.type==="PENDING"&&p.actions.abort()},[s]),a=x(function(){const l={capture:!0,passive:!1},u=qa({cancel:c,completed:s,getPhase:()=>t.current,setPhase:g=>{t.current=g}});n.current=Y(window,u,l)},[c,s]),d=x(function(l,u){t.current.type!=="IDLE"&&(process.env.NODE_ENV!=="production"?f(!1,"Expected to move from IDLE to PENDING drag"):f()),t.current={type:"PENDING",point:u,actions:l},a()},[a]);U(function(){return i(),function(){n.current()}},[i])}function Ya(){}const Xa={[Ma]:!0,[Ra]:!0,[Ga]:!0,[$a]:!0};function Ka(e,t){function n(){t(),e.cancel()}function r(){t(),e.drop()}return[{eventName:"keydown",fn:o=>{if(o.keyCode===en){o.preventDefault(),n();return}if(o.keyCode===ro){o.preventDefault(),r();return}if(o.keyCode===Ua){o.preventDefault(),e.moveDown();return}if(o.keyCode===Fa){o.preventDefault(),e.moveUp();return}if(o.keyCode===Wa){o.preventDefault(),e.moveRight();return}if(o.keyCode===ka){o.preventDefault(),e.moveLeft();return}if(Xa[o.keyCode]){o.preventDefault();return}oo(o)}},{eventName:"mousedown",fn:n},{eventName:"mouseup",fn:n},{eventName:"click",fn:n},{eventName:"touchstart",fn:n},{eventName:"resize",fn:n},{eventName:"wheel",fn:n,options:{passive:!0}},{eventName:Je,fn:n}]}function Ja(e){const t=D.useRef(Ya),n=w(()=>({eventName:"keydown",fn:function(i){if(i.defaultPrevented||i.keyCode!==ro)return;const s=e.findClosestDraggableId(i);if(!s)return;const c=e.tryGetLock(s,p,{sourceEvent:i});if(!c)return;i.preventDefault();let a=!0;const d=c.snapLift();t.current();function p(){a||(process.env.NODE_ENV!=="production"?f(!1,"Cannot stop capturing a keyboard drag when not capturing"):f()),a=!1,t.current(),r()}t.current=Y(window,Ka(d,p),{capture:!0,passive:!1})}}),[e]),r=x(function(){const i={passive:!1,capture:!0};t.current=Y(window,[n],i)},[n]);U(function(){return r(),function(){t.current()}},[r])}const tn={type:"IDLE"},Za=120,Qa=.15;function el({cancel:e,getPhase:t}){return[{eventName:"orientationchange",fn:e},{eventName:"resize",fn:e},{eventName:"contextmenu",fn:n=>{n.preventDefault()}},{eventName:"keydown",fn:n=>{if(t().type!=="DRAGGING"){e();return}n.keyCode===en&&n.preventDefault(),e()}},{eventName:Je,fn:e}]}function tl({cancel:e,completed:t,getPhase:n}){return[{eventName:"touchmove",options:{capture:!1},fn:r=>{const o=n();if(o.type!=="DRAGGING"){e();return}o.hasMoved=!0;const{clientX:i,clientY:s}=r.touches[0],c={x:i,y:s};r.preventDefault(),o.actions.move(c)}},{eventName:"touchend",fn:r=>{const o=n();if(o.type!=="DRAGGING"){e();return}r.preventDefault(),o.actions.drop({shouldBlockNextClick:!0}),t()}},{eventName:"touchcancel",fn:r=>{if(n().type!=="DRAGGING"){e();return}r.preventDefault(),e()}},{eventName:"touchforcechange",fn:r=>{const o=n();o.type==="IDLE"&&(process.env.NODE_ENV,f());const i=r.touches[0];if(!i||!(i.force>=Qa))return;const c=o.actions.shouldRespectForcePress();if(o.type==="PENDING"){c&&e();return}if(c){if(o.hasMoved){r.preventDefault();return}e();return}r.preventDefault()}},{eventName:Je,fn:e}]}function nl(e){const t=D.useRef(tn),n=D.useRef(te),r=x(function(){return t.current},[]),o=x(function(g){t.current=g},[]),i=w(()=>({eventName:"touchstart",fn:function(g){if(g.defaultPrevented)return;const m=e.findClosestDraggableId(g);if(!m)return;const b=e.tryGetLock(m,c,{sourceEvent:g});if(!b)return;const h=g.touches[0],{clientX:E,clientY:y}=h,C={x:E,y};n.current(),l(b,C)}}),[e]),s=x(function(){const g={capture:!0,passive:!1};n.current=Y(window,[i],g)},[i]),c=x(()=>{const u=t.current;u.type!=="IDLE"&&(u.type==="PENDING"&&clearTimeout(u.longPressTimerId),o(tn),n.current(),s())},[s,o]),a=x(()=>{const u=t.current;c(),u.type==="DRAGGING"&&u.actions.cancel({shouldBlockNextClick:!0}),u.type==="PENDING"&&u.actions.abort()},[c]),d=x(function(){const g={capture:!0,passive:!1},m={cancel:a,completed:c,getPhase:r},b=Y(window,tl(m),g),h=Y(window,el(m),g);n.current=function(){b(),h()}},[a,r,c]),p=x(function(){const g=r();g.type!=="PENDING"&&(process.env.NODE_ENV!=="production"?f(!1,`Cannot start dragging from phase ${g.type}`):f());const m=g.actions.fluidLift(g.point);o({type:"DRAGGING",actions:m,hasMoved:!1})},[r,o]),l=x(function(g,m){r().type!=="IDLE"&&(process.env.NODE_ENV!=="production"?f(!1,"Expected to move from IDLE to PENDING drag"):f());const b=setTimeout(p,Za);o({type:"PENDING",point:m,actions:g,longPressTimerId:b}),d()},[d,r,o,p]);U(function(){return s(),function(){n.current();const m=r();m.type==="PENDING"&&(clearTimeout(m.longPressTimerId),o(tn))}},[r,s,o]),U(function(){return Y(window,[{eventName:"touchmove",fn:()=>{},options:{capture:!1,passive:!1}}])},[])}function rl(e){Zt(()=>{const t=Qt(e);Te(()=>{t.current.length!==e.length&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot change the amount of sensor hooks after mounting"):f(!1))})})}const ol=["input","button","textarea","select","option","optgroup","video","audio"];function ao(e,t){if(t==null)return!1;if(ol.includes(t.tagName.toLowerCase()))return!0;const r=t.getAttribute("contenteditable");return r==="true"||r===""?!0:t===e?!1:ao(e,t.parentElement)}function il(e,t){const n=t.target;return Ae(n)?ao(e,n):!1}var sl=e=>K(e.getBoundingClientRect()).center;function cl(e){return e instanceof eo(e).Element}const al=(()=>{const e="matches";return typeof document>"u"?e:[e,"msMatchesSelector","webkitMatchesSelector"].find(r=>r in Element.prototype)||e})();function lo(e,t){return e==null?null:e[al](t)?e:lo(e.parentElement,t)}function ll(e,t){return e.closest?e.closest(t):lo(e,t)}function dl(e){return`[${pe.contextId}="${e}"]`}function ul(e,t){const n=t.target;if(!cl(n))return process.env.NODE_ENV!=="production"&&B("event.target must be a Element"),null;const r=dl(e),o=ll(n,r);return o?Ae(o)?o:(process.env.NODE_ENV!=="production"&&B("drag handle must be a HTMLElement"),null):null}function pl(e,t){const n=ul(e,t);return n?n.getAttribute(pe.draggableId):null}function fl(e,t){const n=`[${jt.contextId}="${e}"]`,o=Qr(document,n).find(i=>i.getAttribute(jt.id)===t);return o?Ae(o)?o:(process.env.NODE_ENV!=="production"&&B("Draggable element is not a HTMLElement"),null):null}function gl(e){e.preventDefault()}function Ze({expected:e,phase:t,isLockActive:n,shouldWarn:r}){return n()?e!==t?(r&&process.env.NODE_ENV!=="production"&&B(`
139
+ `)}},t)})}function Aa(){Te(()=>{wa(Ca.react,D.version),_a(document)},[])}function Qt(e){const t=D.useRef(e);return D.useEffect(()=>{t.current=e}),t}function Pa(){let e=null;function t(){return!!e}function n(s){return s===e}function r(s){e&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot claim lock as it is already claimed"):f());const c={abandon:s};return e=c,c}function o(){e||(process.env.NODE_ENV!=="production"?f(!1,"Cannot release lock when there is no lock"):f()),e=null}function i(){e&&(e.abandon(),o())}return{isClaimed:t,isActive:n,claim:r,release:o,tryAbandon:i}}function Be(e){return e.phase==="IDLE"||e.phase==="DROP_ANIMATING"?!1:e.isDragging}const Ta=9,Ba=13,en=27,ro=32,Va=33,La=34,Ra=35,Ma=36,$a=37,Ga=38,ka=39,Fa=40,Wa={[Ba]:!0,[Ta]:!0};var oo=e=>{Wa[e.keyCode]&&e.preventDefault()};const Je=(()=>{const e="visibilitychange";return typeof document>"u"?e:[e,`ms${e}`,`webkit${e}`,`moz${e}`,`o${e}`].find(r=>`on${r}`in document)||e})(),io=0,so=5;function Ua(e,t){return Math.abs(t.x-e.x)>=so||Math.abs(t.y-e.y)>=so}const co={type:"IDLE"};function Ha({cancel:e,completed:t,getPhase:n,setPhase:r}){return[{eventName:"mousemove",fn:o=>{const{button:i,clientX:s,clientY:c}=o;if(i!==io)return;const a={x:s,y:c},d=n();if(d.type==="DRAGGING"){o.preventDefault(),d.actions.move(a);return}d.type!=="PENDING"&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot be IDLE"):f());const p=d.point;if(!Ua(p,a))return;o.preventDefault();const l=d.actions.fluidLift(a);r({type:"DRAGGING",actions:l})}},{eventName:"mouseup",fn:o=>{const i=n();if(i.type!=="DRAGGING"){e();return}o.preventDefault(),i.actions.drop({shouldBlockNextClick:!0}),t()}},{eventName:"mousedown",fn:o=>{n().type==="DRAGGING"&&o.preventDefault(),e()}},{eventName:"keydown",fn:o=>{if(n().type==="PENDING"){e();return}if(o.keyCode===en){o.preventDefault(),e();return}oo(o)}},{eventName:"resize",fn:e},{eventName:"scroll",options:{passive:!0,capture:!1},fn:()=>{n().type==="PENDING"&&e()}},{eventName:"webkitmouseforcedown",fn:o=>{const i=n();if(i.type==="IDLE"&&(process.env.NODE_ENV!=="production"?f(!1,"Unexpected phase"):f()),i.actions.shouldRespectForcePress()){e();return}o.preventDefault()}},{eventName:Je,fn:e}]}function za(e){const t=D.useRef(co),n=D.useRef(te),r=w(()=>({eventName:"mousedown",fn:function(l){if(l.defaultPrevented||l.button!==io||l.ctrlKey||l.metaKey||l.shiftKey||l.altKey)return;const u=e.findClosestDraggableId(l);if(!u)return;const g=e.tryGetLock(u,s,{sourceEvent:l});if(!g)return;l.preventDefault();const h={x:l.clientX,y:l.clientY};n.current(),d(g,h)}}),[e]),o=w(()=>({eventName:"webkitmouseforcewillbegin",fn:p=>{if(p.defaultPrevented)return;const l=e.findClosestDraggableId(p);if(!l)return;const u=e.findOptionsForDraggable(l);u&&(u.shouldRespectForcePress||e.canGetLock(l)&&p.preventDefault())}}),[e]),i=x(function(){const l={passive:!1,capture:!0};n.current=Y(window,[o,r],l)},[o,r]),s=x(()=>{t.current.type!=="IDLE"&&(t.current=co,n.current(),i())},[i]),c=x(()=>{const p=t.current;s(),p.type==="DRAGGING"&&p.actions.cancel({shouldBlockNextClick:!0}),p.type==="PENDING"&&p.actions.abort()},[s]),a=x(function(){const l={capture:!0,passive:!1},u=Ha({cancel:c,completed:s,getPhase:()=>t.current,setPhase:g=>{t.current=g}});n.current=Y(window,u,l)},[c,s]),d=x(function(l,u){t.current.type!=="IDLE"&&(process.env.NODE_ENV!=="production"?f(!1,"Expected to move from IDLE to PENDING drag"):f()),t.current={type:"PENDING",point:u,actions:l},a()},[a]);U(function(){return i(),function(){n.current()}},[i])}function qa(){}const ja={[La]:!0,[Va]:!0,[Ma]:!0,[Ra]:!0};function Ya(e,t){function n(){t(),e.cancel()}function r(){t(),e.drop()}return[{eventName:"keydown",fn:o=>{if(o.keyCode===en){o.preventDefault(),n();return}if(o.keyCode===ro){o.preventDefault(),r();return}if(o.keyCode===Fa){o.preventDefault(),e.moveDown();return}if(o.keyCode===Ga){o.preventDefault(),e.moveUp();return}if(o.keyCode===ka){o.preventDefault(),e.moveRight();return}if(o.keyCode===$a){o.preventDefault(),e.moveLeft();return}if(ja[o.keyCode]){o.preventDefault();return}oo(o)}},{eventName:"mousedown",fn:n},{eventName:"mouseup",fn:n},{eventName:"click",fn:n},{eventName:"touchstart",fn:n},{eventName:"resize",fn:n},{eventName:"wheel",fn:n,options:{passive:!0}},{eventName:Je,fn:n}]}function Xa(e){const t=D.useRef(qa),n=w(()=>({eventName:"keydown",fn:function(i){if(i.defaultPrevented||i.keyCode!==ro)return;const s=e.findClosestDraggableId(i);if(!s)return;const c=e.tryGetLock(s,p,{sourceEvent:i});if(!c)return;i.preventDefault();let a=!0;const d=c.snapLift();t.current();function p(){a||(process.env.NODE_ENV!=="production"?f(!1,"Cannot stop capturing a keyboard drag when not capturing"):f()),a=!1,t.current(),r()}t.current=Y(window,Ya(d,p),{capture:!0,passive:!1})}}),[e]),r=x(function(){const i={passive:!1,capture:!0};t.current=Y(window,[n],i)},[n]);U(function(){return r(),function(){t.current()}},[r])}const tn={type:"IDLE"},Ka=120,Ja=.15;function Za({cancel:e,getPhase:t}){return[{eventName:"orientationchange",fn:e},{eventName:"resize",fn:e},{eventName:"contextmenu",fn:n=>{n.preventDefault()}},{eventName:"keydown",fn:n=>{if(t().type!=="DRAGGING"){e();return}n.keyCode===en&&n.preventDefault(),e()}},{eventName:Je,fn:e}]}function Qa({cancel:e,completed:t,getPhase:n}){return[{eventName:"touchmove",options:{capture:!1},fn:r=>{const o=n();if(o.type!=="DRAGGING"){e();return}o.hasMoved=!0;const{clientX:i,clientY:s}=r.touches[0],c={x:i,y:s};r.preventDefault(),o.actions.move(c)}},{eventName:"touchend",fn:r=>{const o=n();if(o.type!=="DRAGGING"){e();return}r.preventDefault(),o.actions.drop({shouldBlockNextClick:!0}),t()}},{eventName:"touchcancel",fn:r=>{if(n().type!=="DRAGGING"){e();return}r.preventDefault(),e()}},{eventName:"touchforcechange",fn:r=>{const o=n();o.type==="IDLE"&&(process.env.NODE_ENV,f());const i=r.touches[0];if(!i||!(i.force>=Ja))return;const c=o.actions.shouldRespectForcePress();if(o.type==="PENDING"){c&&e();return}if(c){if(o.hasMoved){r.preventDefault();return}e();return}r.preventDefault()}},{eventName:Je,fn:e}]}function el(e){const t=D.useRef(tn),n=D.useRef(te),r=x(function(){return t.current},[]),o=x(function(g){t.current=g},[]),i=w(()=>({eventName:"touchstart",fn:function(g){if(g.defaultPrevented)return;const h=e.findClosestDraggableId(g);if(!h)return;const b=e.tryGetLock(h,c,{sourceEvent:g});if(!b)return;const m=g.touches[0],{clientX:E,clientY:y}=m,S={x:E,y};n.current(),l(b,S)}}),[e]),s=x(function(){const g={capture:!0,passive:!1};n.current=Y(window,[i],g)},[i]),c=x(()=>{const u=t.current;u.type!=="IDLE"&&(u.type==="PENDING"&&clearTimeout(u.longPressTimerId),o(tn),n.current(),s())},[s,o]),a=x(()=>{const u=t.current;c(),u.type==="DRAGGING"&&u.actions.cancel({shouldBlockNextClick:!0}),u.type==="PENDING"&&u.actions.abort()},[c]),d=x(function(){const g={capture:!0,passive:!1},h={cancel:a,completed:c,getPhase:r},b=Y(window,Qa(h),g),m=Y(window,Za(h),g);n.current=function(){b(),m()}},[a,r,c]),p=x(function(){const g=r();g.type!=="PENDING"&&(process.env.NODE_ENV!=="production"?f(!1,`Cannot start dragging from phase ${g.type}`):f());const h=g.actions.fluidLift(g.point);o({type:"DRAGGING",actions:h,hasMoved:!1})},[r,o]),l=x(function(g,h){r().type!=="IDLE"&&(process.env.NODE_ENV!=="production"?f(!1,"Expected to move from IDLE to PENDING drag"):f());const b=setTimeout(p,Ka);o({type:"PENDING",point:h,actions:g,longPressTimerId:b}),d()},[d,r,o,p]);U(function(){return s(),function(){n.current();const h=r();h.type==="PENDING"&&(clearTimeout(h.longPressTimerId),o(tn))}},[r,s,o]),U(function(){return Y(window,[{eventName:"touchmove",fn:()=>{},options:{capture:!1,passive:!1}}])},[])}function tl(e){Zt(()=>{const t=Qt(e);Te(()=>{t.current.length!==e.length&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot change the amount of sensor hooks after mounting"):f(!1))})})}const nl=["input","button","textarea","select","option","optgroup","video","audio"];function ao(e,t){if(t==null)return!1;if(nl.includes(t.tagName.toLowerCase()))return!0;const r=t.getAttribute("contenteditable");return r==="true"||r===""?!0:t===e?!1:ao(e,t.parentElement)}function rl(e,t){const n=t.target;return Ae(n)?ao(e,n):!1}var ol=e=>K(e.getBoundingClientRect()).center;function il(e){return e instanceof eo(e).Element}const sl=(()=>{const e="matches";return typeof document>"u"?e:[e,"msMatchesSelector","webkitMatchesSelector"].find(r=>r in Element.prototype)||e})();function lo(e,t){return e==null?null:e[sl](t)?e:lo(e.parentElement,t)}function cl(e,t){return e.closest?e.closest(t):lo(e,t)}function al(e){return`[${pe.contextId}="${e}"]`}function ll(e,t){const n=t.target;if(!il(n))return process.env.NODE_ENV!=="production"&&B("event.target must be a Element"),null;const r=al(e),o=cl(n,r);return o?Ae(o)?o:(process.env.NODE_ENV!=="production"&&B("drag handle must be a HTMLElement"),null):null}function dl(e,t){const n=ll(e,t);return n?n.getAttribute(pe.draggableId):null}function ul(e,t){const n=`[${jt.contextId}="${e}"]`,o=Qr(document,n).find(i=>i.getAttribute(jt.id)===t);return o?Ae(o)?o:(process.env.NODE_ENV!=="production"&&B("Draggable element is not a HTMLElement"),null):null}function pl(e){e.preventDefault()}function Ze({expected:e,phase:t,isLockActive:n,shouldWarn:r}){return n()?e!==t?(r&&process.env.NODE_ENV!=="production"&&B(`
140
140
  Cannot perform action.
141
141
  The actions you used belong to an outdated phase
142
142
 
@@ -154,13 +154,13 @@ ${hn.current.stack}
154
154
 
155
155
  - Throw away your action handlers when forceStop() is called
156
156
  - Check actions.isActive() if you really need to
157
- `),!1)}function uo({lockAPI:e,store:t,registry:n,draggableId:r}){if(e.isClaimed())return!1;const o=n.draggable.findById(r);return o?!(!o.options.isEnabled||!Hr(t.getState(),r)):(process.env.NODE_ENV!=="production"&&B(`Unable to find draggable with id: ${r}`),!1)}function ml({lockAPI:e,contextId:t,store:n,registry:r,draggableId:o,forceSensorStop:i,sourceEvent:s}){if(!uo({lockAPI:e,store:n,registry:r,draggableId:o}))return null;const a=r.draggable.getById(o),d=fl(t,a.descriptor.id);if(!d)return process.env.NODE_ENV!=="production"&&B(`Unable to find draggable element with id: ${o}`),null;if(s&&!a.options.canDragInteractiveElements&&il(d,s))return null;const p=e.claim(i||te);let l="PRE_DRAG";function u(){return a.options.shouldRespectForcePress}function g(){return e.isActive(p)}function m(N,S){Ze({expected:N,phase:l,isLockActive:g,shouldWarn:!0})&&n.dispatch(S())}const b=m.bind(null,"DRAGGING");function h(N){function S(){e.release(),l="COMPLETED"}l!=="PRE_DRAG"&&(S(),process.env.NODE_ENV!=="production"?f(!1,`Cannot lift in phase ${l}`):f()),n.dispatch(tc(N.liftActionArgs)),l="DRAGGING";function A(T,H={shouldBlockNextClick:!1}){if(N.cleanup(),H.shouldBlockNextClick){const V=Y(window,[{eventName:"click",fn:gl,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(V)}S(),n.dispatch(Br({reason:T}))}return{isActive:()=>Ze({expected:"DRAGGING",phase:l,isLockActive:g,shouldWarn:!1}),shouldRespectForcePress:u,drop:T=>A("DROP",T),cancel:T=>A("CANCEL",T),...N.actions}}function E(N){const S=me(T=>{b(()=>Tr({client:T}))});return{...h({liftActionArgs:{id:o,clientSelection:N,movementMode:"FLUID"},cleanup:()=>S.cancel(),actions:{move:S}}),move:S}}function y(){const N={moveUp:()=>b(dc),moveRight:()=>b(pc),moveDown:()=>b(uc),moveLeft:()=>b(fc)};return h({liftActionArgs:{id:o,clientSelection:sl(d),movementMode:"SNAP"},cleanup:te,actions:N})}function C(){Ze({expected:"PRE_DRAG",phase:l,isLockActive:g,shouldWarn:!0})&&e.release()}return{isActive:()=>Ze({expected:"PRE_DRAG",phase:l,isLockActive:g,shouldWarn:!1}),shouldRespectForcePress:u,fluidLift:E,snapLift:y,abort:C}}const hl=[ja,Ja,nl];function bl({contextId:e,store:t,registry:n,customSensors:r,enableDefaultSensors:o}){const i=[...o?hl:[],...r||[]],s=D.useState(()=>Ba())[0],c=x(function(h,E){Be(h)&&!Be(E)&&s.tryAbandon()},[s]);U(function(){let h=t.getState();return t.subscribe(()=>{const y=t.getState();c(h,y),h=y})},[s,t,c]),U(()=>s.tryAbandon,[s.tryAbandon]);const a=x(b=>uo({lockAPI:s,registry:n,store:t,draggableId:b}),[s,n,t]),d=x((b,h,E)=>ml({lockAPI:s,registry:n,contextId:e,store:t,draggableId:b,forceSensorStop:h||null,sourceEvent:E&&E.sourceEvent?E.sourceEvent:null}),[e,s,n,t]),p=x(b=>pl(e,b),[e]),l=x(b=>{const h=n.draggable.findById(b);return h?h.options:null},[n.draggable]),u=x(function(){s.isClaimed()&&(s.tryAbandon(),t.getState().phase!=="IDLE"&&t.dispatch(Rt()))},[s,t]),g=x(()=>s.isClaimed(),[s]),m=w(()=>({canGetLock:a,tryGetLock:d,findClosestDraggableId:p,findOptionsForDraggable:l,tryReleaseLock:u,isLockClaimed:g}),[a,d,p,l,u,g]);rl(i);for(let b=0;b<i.length;b++)i[b](m)}const vl=e=>({onBeforeCapture:t=>{const n=()=>{e.onBeforeCapture&&e.onBeforeCapture(t)};it.flushSync(n)},onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragEnd:e.onDragEnd,onDragUpdate:e.onDragUpdate}),yl=e=>({...we,...e.autoScrollerOptions,durationDampening:{...we.durationDampening,...e.autoScrollerOptions}});function Ve(e){return e.current||(process.env.NODE_ENV!=="production"?f(!1,"Could not find store from lazy ref"):f()),e.current}function El(e){const{contextId:t,setCallbacks:n,sensors:r,nonce:o,dragHandleUsageInstructions:i}=e,s=D.useRef(null);Ta();const c=Qt(e),a=x(()=>vl(c.current),[c]),d=x(()=>yl(c.current),[c]),p=xa(t),l=Ca({contextId:t,text:i}),u=ba(t,o),g=x(V=>{Ve(s).dispatch(V)},[]),m=w(()=>xn({publishWhileDragging:rc,updateDroppableScroll:ic,updateDroppableIsEnabled:sc,updateDroppableIsCombineEnabled:cc,collectionStarting:oc},g),[g]),b=Ea(),h=w(()=>Xc(b,m),[b,m]),E=w(()=>pa({scrollWindow:Kc,scrollDroppable:h.scrollDroppable,getAutoScrollerOptions:d,...xn({move:Tr},g)}),[h.scrollDroppable,g,d]),y=va(t),C=w(()=>zc({announce:p,autoScroller:E,dimensionMarshal:h,focusMarshal:y,getResponders:a,styleMarshal:u}),[p,E,h,y,a,u]);process.env.NODE_ENV!=="production"&&s.current&&s.current!==C&&process.env.NODE_ENV!=="production"&&B("unexpected store change"),s.current=C;const I=x(()=>{const V=Ve(s);V.getState().phase!=="IDLE"&&V.dispatch(Rt())},[]),N=x(()=>{const V=Ve(s).getState();return V.phase==="DROP_ANIMATING"?!0:V.phase==="IDLE"?!1:V.isDragging},[]),S=w(()=>({isDragging:N,tryAbort:I}),[N,I]);n(S);const A=x(V=>Hr(Ve(s).getState(),V),[]),T=x(()=>se(Ve(s).getState()),[]),H=w(()=>({marshal:h,focus:y,contextId:t,canLift:A,isMovementAllowed:T,dragHandleUsageInstructionsId:l,registry:b}),[t,h,l,y,A,T,b]);return bl({contextId:t,store:C,registry:b,customSensors:r||null,enableDefaultSensors:e.enableDefaultSensors!==!1}),D.useEffect(()=>I,[I]),D.createElement(Ke.Provider,{value:H},D.createElement(Bi,{context:Xt,store:C},e.children))}function Dl(){return D.useId()}function Nl(e){const t=Dl(),n=e.dragHandleUsageInstructions||Ue.dragHandleUsageInstructions;return D.createElement(zi,null,r=>D.createElement(El,{nonce:e.nonce,contextId:t,setCallbacks:r,dragHandleUsageInstructions:n,enableDefaultSensors:e.enableDefaultSensors,sensors:e.sensors,onBeforeCapture:e.onBeforeCapture,onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragUpdate:e.onDragUpdate,onDragEnd:e.onDragEnd,autoScrollerOptions:e.autoScrollerOptions},e.children))}const po={dragging:5e3,dropAnimating:4500},xl=(e,t)=>t?Ce.drop(t.duration):e?Ce.snap:Ce.fluid,Il=(e,t)=>{if(e)return t?Se.opacity.drop:Se.opacity.combining},Sl=e=>e.forceShouldAnimate!=null?e.forceShouldAnimate:e.mode==="SNAP";function Cl(e){const n=e.dimension.client,{offset:r,combineWith:o,dropping:i}=e,s=!!o,c=Sl(e),a=!!i,d=a?Gt.drop(r,s):Gt.moveTo(r);return{position:"fixed",top:n.marginBox.top,left:n.marginBox.left,boxSizing:"border-box",width:n.borderBox.width,height:n.borderBox.height,transition:xl(c,i),transform:d,opacity:Il(s,a),zIndex:a?po.dropAnimating:po.dragging,pointerEvents:"none"}}function Ol(e){return{transform:Gt.moveTo(e.offset),transition:e.shouldAnimateDisplacement?void 0:"none"}}function wl(e){return e.type==="DRAGGING"?Cl(e):Ol(e)}function _l(e,t,n=R){const r=window.getComputedStyle(t),o=t.getBoundingClientRect(),i=Xn(o,r),s=ke(i,n),c={client:i,tagName:t.tagName.toLowerCase(),display:r.display},a={x:i.marginBox.width,y:i.marginBox.height};return{descriptor:e,placeholder:c,displaceBy:a,client:i,page:s}}function Al(e){const t=Kt("draggable"),{descriptor:n,registry:r,getDraggableRef:o,canDragInteractiveElements:i,shouldRespectForcePress:s,isEnabled:c}=e,a=w(()=>({canDragInteractiveElements:i,shouldRespectForcePress:s,isEnabled:c}),[i,c,s]),d=x(g=>{const m=o();return m||(process.env.NODE_ENV!=="production"?f(!1,"Cannot get dimension when no ref is set"):f()),_l(n,m,g)},[n,o]),p=w(()=>({uniqueId:t,descriptor:n,options:a,getDimension:d}),[n,d,a,t]),l=D.useRef(p),u=D.useRef(!0);U(()=>(r.draggable.register(l.current),()=>r.draggable.unregister(l.current)),[r.draggable]),U(()=>{if(u.current){u.current=!1;return}const g=l.current;l.current=p,r.draggable.update(p,g)},[p,r.draggable])}var nn=D.createContext(null);function fo(e){e&&Ae(e)||(process.env.NODE_ENV!=="production"?f(!1,`
157
+ `),!1)}function uo({lockAPI:e,store:t,registry:n,draggableId:r}){if(e.isClaimed())return!1;const o=n.draggable.findById(r);return o?!(!o.options.isEnabled||!Hr(t.getState(),r)):(process.env.NODE_ENV!=="production"&&B(`Unable to find draggable with id: ${r}`),!1)}function fl({lockAPI:e,contextId:t,store:n,registry:r,draggableId:o,forceSensorStop:i,sourceEvent:s}){if(!uo({lockAPI:e,store:n,registry:r,draggableId:o}))return null;const a=r.draggable.getById(o),d=ul(t,a.descriptor.id);if(!d)return process.env.NODE_ENV!=="production"&&B(`Unable to find draggable element with id: ${o}`),null;if(s&&!a.options.canDragInteractiveElements&&rl(d,s))return null;const p=e.claim(i||te);let l="PRE_DRAG";function u(){return a.options.shouldRespectForcePress}function g(){return e.isActive(p)}function h(N,C){Ze({expected:N,phase:l,isLockActive:g,shouldWarn:!0})&&n.dispatch(C())}const b=h.bind(null,"DRAGGING");function m(N){function C(){e.release(),l="COMPLETED"}l!=="PRE_DRAG"&&(C(),process.env.NODE_ENV!=="production"?f(!1,`Cannot lift in phase ${l}`):f()),n.dispatch(Qs(N.liftActionArgs)),l="DRAGGING";function A(T,H={shouldBlockNextClick:!1}){if(N.cleanup(),H.shouldBlockNextClick){const V=Y(window,[{eventName:"click",fn:pl,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(V)}C(),n.dispatch(Br({reason:T}))}return{isActive:()=>Ze({expected:"DRAGGING",phase:l,isLockActive:g,shouldWarn:!1}),shouldRespectForcePress:u,drop:T=>A("DROP",T),cancel:T=>A("CANCEL",T),...N.actions}}function E(N){const C=me(T=>{b(()=>Tr({client:T}))});return{...m({liftActionArgs:{id:o,clientSelection:N,movementMode:"FLUID"},cleanup:()=>C.cancel(),actions:{move:C}}),move:C}}function y(){const N={moveUp:()=>b(ac),moveRight:()=>b(dc),moveDown:()=>b(lc),moveLeft:()=>b(uc)};return m({liftActionArgs:{id:o,clientSelection:ol(d),movementMode:"SNAP"},cleanup:te,actions:N})}function S(){Ze({expected:"PRE_DRAG",phase:l,isLockActive:g,shouldWarn:!0})&&e.release()}return{isActive:()=>Ze({expected:"PRE_DRAG",phase:l,isLockActive:g,shouldWarn:!1}),shouldRespectForcePress:u,fluidLift:E,snapLift:y,abort:S}}const gl=[za,Xa,el];function ml({contextId:e,store:t,registry:n,customSensors:r,enableDefaultSensors:o}){const i=[...o?gl:[],...r||[]],s=D.useState(()=>Pa())[0],c=x(function(m,E){Be(m)&&!Be(E)&&s.tryAbandon()},[s]);U(function(){let m=t.getState();return t.subscribe(()=>{const y=t.getState();c(m,y),m=y})},[s,t,c]),U(()=>s.tryAbandon,[s.tryAbandon]);const a=x(b=>uo({lockAPI:s,registry:n,store:t,draggableId:b}),[s,n,t]),d=x((b,m,E)=>fl({lockAPI:s,registry:n,contextId:e,store:t,draggableId:b,forceSensorStop:m||null,sourceEvent:E&&E.sourceEvent?E.sourceEvent:null}),[e,s,n,t]),p=x(b=>dl(e,b),[e]),l=x(b=>{const m=n.draggable.findById(b);return m?m.options:null},[n.draggable]),u=x(function(){s.isClaimed()&&(s.tryAbandon(),t.getState().phase!=="IDLE"&&t.dispatch(Rt()))},[s,t]),g=x(()=>s.isClaimed(),[s]),h=w(()=>({canGetLock:a,tryGetLock:d,findClosestDraggableId:p,findOptionsForDraggable:l,tryReleaseLock:u,isLockClaimed:g}),[a,d,p,l,u,g]);tl(i);for(let b=0;b<i.length;b++)i[b](h)}const hl=e=>({onBeforeCapture:t=>{const n=()=>{e.onBeforeCapture&&e.onBeforeCapture(t)};it.flushSync(n)},onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragEnd:e.onDragEnd,onDragUpdate:e.onDragUpdate}),bl=e=>({...we,...e.autoScrollerOptions,durationDampening:{...we.durationDampening,...e.autoScrollerOptions}});function Ve(e){return e.current||(process.env.NODE_ENV!=="production"?f(!1,"Could not find store from lazy ref"):f()),e.current}function vl(e){const{contextId:t,setCallbacks:n,sensors:r,nonce:o,dragHandleUsageInstructions:i}=e,s=D.useRef(null);Aa();const c=Qt(e),a=x(()=>hl(c.current),[c]),d=x(()=>bl(c.current),[c]),p=Da(t),l=Ia({contextId:t,text:i}),u=ma(t,o),g=x(V=>{Ve(s).dispatch(V)},[]),h=w(()=>xn({publishWhileDragging:tc,updateDroppableScroll:rc,updateDroppableIsEnabled:oc,updateDroppableIsCombineEnabled:ic,collectionStarting:nc},g),[g]),b=va(),m=w(()=>jc(b,h),[b,h]),E=w(()=>da({scrollWindow:Yc,scrollDroppable:m.scrollDroppable,getAutoScrollerOptions:d,...xn({move:Tr},g)}),[m.scrollDroppable,g,d]),y=ha(t),S=w(()=>Uc({announce:p,autoScroller:E,dimensionMarshal:m,focusMarshal:y,getResponders:a,styleMarshal:u}),[p,E,m,y,a,u]);process.env.NODE_ENV!=="production"&&s.current&&s.current!==S&&process.env.NODE_ENV!=="production"&&B("unexpected store change"),s.current=S;const I=x(()=>{const V=Ve(s);V.getState().phase!=="IDLE"&&V.dispatch(Rt())},[]),N=x(()=>{const V=Ve(s).getState();return V.phase==="DROP_ANIMATING"?!0:V.phase==="IDLE"?!1:V.isDragging},[]),C=w(()=>({isDragging:N,tryAbort:I}),[N,I]);n(C);const A=x(V=>Hr(Ve(s).getState(),V),[]),T=x(()=>se(Ve(s).getState()),[]),H=w(()=>({marshal:m,focus:y,contextId:t,canLift:A,isMovementAllowed:T,dragHandleUsageInstructionsId:l,registry:b}),[t,m,l,y,A,T,b]);return ml({contextId:t,store:S,registry:b,customSensors:r||null,enableDefaultSensors:e.enableDefaultSensors!==!1}),D.useEffect(()=>I,[I]),D.createElement(Ke.Provider,{value:H},D.createElement(Pi,{context:Xt,store:S},e.children))}function yl(){return D.useId()}function El(e){const t=yl(),n=e.dragHandleUsageInstructions||Ue.dragHandleUsageInstructions;return D.createElement(Ui,null,r=>D.createElement(vl,{nonce:e.nonce,contextId:t,setCallbacks:r,dragHandleUsageInstructions:n,enableDefaultSensors:e.enableDefaultSensors,sensors:e.sensors,onBeforeCapture:e.onBeforeCapture,onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragUpdate:e.onDragUpdate,onDragEnd:e.onDragEnd,autoScrollerOptions:e.autoScrollerOptions},e.children))}const po={dragging:5e3,dropAnimating:4500},Dl=(e,t)=>t?Se.drop(t.duration):e?Se.snap:Se.fluid,Nl=(e,t)=>{if(e)return t?Ce.opacity.drop:Ce.opacity.combining},xl=e=>e.forceShouldAnimate!=null?e.forceShouldAnimate:e.mode==="SNAP";function Il(e){const n=e.dimension.client,{offset:r,combineWith:o,dropping:i}=e,s=!!o,c=xl(e),a=!!i,d=a?Gt.drop(r,s):Gt.moveTo(r);return{position:"fixed",top:n.marginBox.top,left:n.marginBox.left,boxSizing:"border-box",width:n.borderBox.width,height:n.borderBox.height,transition:Dl(c,i),transform:d,opacity:Nl(s,a),zIndex:a?po.dropAnimating:po.dragging,pointerEvents:"none"}}function Cl(e){return{transform:Gt.moveTo(e.offset),transition:e.shouldAnimateDisplacement?void 0:"none"}}function Sl(e){return e.type==="DRAGGING"?Il(e):Cl(e)}function Ol(e,t,n=R){const r=window.getComputedStyle(t),o=t.getBoundingClientRect(),i=Xn(o,r),s=ke(i,n),c={client:i,tagName:t.tagName.toLowerCase(),display:r.display},a={x:i.marginBox.width,y:i.marginBox.height};return{descriptor:e,placeholder:c,displaceBy:a,client:i,page:s}}function wl(e){const t=Kt("draggable"),{descriptor:n,registry:r,getDraggableRef:o,canDragInteractiveElements:i,shouldRespectForcePress:s,isEnabled:c}=e,a=w(()=>({canDragInteractiveElements:i,shouldRespectForcePress:s,isEnabled:c}),[i,c,s]),d=x(g=>{const h=o();return h||(process.env.NODE_ENV!=="production"?f(!1,"Cannot get dimension when no ref is set"):f()),Ol(n,h,g)},[n,o]),p=w(()=>({uniqueId:t,descriptor:n,options:a,getDimension:d}),[n,d,a,t]),l=D.useRef(p),u=D.useRef(!0);U(()=>(r.draggable.register(l.current),()=>r.draggable.unregister(l.current)),[r.draggable]),U(()=>{if(u.current){u.current=!1;return}const g=l.current;l.current=p,r.draggable.update(p,g)},[p,r.draggable])}var nn=D.createContext(null);function fo(e){e&&Ae(e)||(process.env.NODE_ENV!=="production"?f(!1,`
158
158
  provided.innerRef has not been provided with a HTMLElement.
159
159
 
160
160
  You can find a guide on using the innerRef callback functions at:
161
161
  https://github.com/hello-pangea/dnd/blob/main/docs/guides/using-inner-ref.md
162
- `):f())}function Pl(e,t,n){Te(()=>{function r(i){return`Draggable[id: ${i}]: `}const o=e.draggableId;o||(process.env.NODE_ENV!=="production"?f(!1,"Draggable requires a draggableId"):f(!1)),typeof o!="string"&&(process.env.NODE_ENV!=="production"?f(!1,`Draggable requires a [string] draggableId.
163
- Provided: [type: ${typeof o}] (value: ${o})`):f(!1)),Number.isInteger(e.index)||(process.env.NODE_ENV!=="production"?f(!1,`${r(o)} requires an integer index prop`):f(!1)),e.mapped.type!=="DRAGGING"&&(fo(n()),e.isEnabled&&(to(t,o)||(process.env.NODE_ENV!=="production"?f(!1,`${r(o)} Unable to find drag handle`):f(!1))))})}function Tl(e){Zt(()=>{const t=D.useRef(e);Te(()=>{e!==t.current&&(process.env.NODE_ENV!=="production"?f(!1,"Draggable isClone prop value changed during component life"):f(!1))},[e])})}function Qe(e){const t=D.useContext(e);return t||(process.env.NODE_ENV!=="production"?f(!1,"Could not find required context"):f()),t}function Bl(e){e.preventDefault()}const Vl=e=>{const t=D.useRef(null),n=x((S=null)=>{t.current=S},[]),r=x(()=>t.current,[]),{contextId:o,dragHandleUsageInstructionsId:i,registry:s}=Qe(Ke),{type:c,droppableId:a}=Qe(nn),d=w(()=>({id:e.draggableId,index:e.index,type:c,droppableId:a}),[e.draggableId,e.index,c,a]),{children:p,draggableId:l,isEnabled:u,shouldRespectForcePress:g,canDragInteractiveElements:m,isClone:b,mapped:h,dropAnimationFinished:E}=e;if(Pl(e,o,r),Tl(b),!b){const S=w(()=>({descriptor:d,registry:s,getDraggableRef:r,canDragInteractiveElements:m,shouldRespectForcePress:g,isEnabled:u}),[d,s,r,m,g,u]);Al(S)}const y=w(()=>u?{tabIndex:0,role:"button","aria-describedby":i,"data-rfd-drag-handle-draggable-id":l,"data-rfd-drag-handle-context-id":o,draggable:!1,onDragStart:Bl}:null,[o,i,l,u]),C=x(S=>{h.type==="DRAGGING"&&h.dropping&&S.propertyName==="transform"&&it.flushSync(E)},[E,h]),I=w(()=>{const S=wl(h),A=h.type==="DRAGGING"&&h.dropping?C:void 0;return{innerRef:n,draggableProps:{"data-rfd-draggable-context-id":o,"data-rfd-draggable-id":l,style:S,onTransitionEnd:A},dragHandleProps:y}},[o,y,l,h,C,n]),N=w(()=>({draggableId:d.id,type:d.type,source:{index:d.index,droppableId:d.droppableId}}),[d.droppableId,d.id,d.index,d.type]);return D.createElement(D.Fragment,null,p(I,h.snapshot,N))};var go=(e,t)=>e===t,mo=e=>{const{combine:t,destination:n}=e;return n?n.droppableId:t?t.droppableId:null};const Ll=e=>e.combine?e.combine.draggableId:null,Rl=e=>e.at&&e.at.type==="COMBINE"?e.at.combine.draggableId:null;function Ml(){const e=M((o,i)=>({x:o,y:i})),t=M((o,i,s=null,c=null,a=null)=>({isDragging:!0,isClone:i,isDropAnimating:!!a,dropAnimation:a,mode:o,draggingOver:s,combineWith:c,combineTargetFor:null})),n=M((o,i,s,c,a=null,d=null,p=null)=>({mapped:{type:"DRAGGING",dropping:null,draggingOver:a,combineWith:d,mode:i,offset:o,dimension:s,forceShouldAnimate:p,snapshot:t(i,c,a,d,null)}}));return(o,i)=>{if(Be(o)){if(o.critical.draggable.id!==i.draggableId)return null;const s=o.current.client.offset,c=o.dimensions.draggables[i.draggableId],a=W(o.impact),d=Rl(o.impact),p=o.forceShouldAnimate;return n(e(s.x,s.y),o.movementMode,c,i.isClone,a,d,p)}if(o.phase==="DROP_ANIMATING"){const s=o.completed;if(s.result.draggableId!==i.draggableId)return null;const c=i.isClone,a=o.dimensions.draggables[i.draggableId],d=s.result,p=d.mode,l=mo(d),u=Ll(d),m={duration:o.dropDuration,curve:$t.drop,moveTo:o.newHomeClientOffset,opacity:u?Se.opacity.drop:null,scale:u?Se.scale.drop:null};return{mapped:{type:"DRAGGING",offset:o.newHomeClientOffset,dimension:a,dropping:m,draggingOver:l,combineWith:u,mode:p,forceShouldAnimate:null,snapshot:t(p,c,l,u,m)}}}return null}}function ho(e=null){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:e,combineWith:null}}const $l={mapped:{type:"SECONDARY",offset:R,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:ho(null)}};function Gl(){const e=M((s,c)=>({x:s,y:c})),t=M(ho),n=M((s,c=null,a)=>({mapped:{type:"SECONDARY",offset:s,combineTargetFor:c,shouldAnimateDisplacement:a,snapshot:t(c)}})),r=s=>s?n(R,s,!0):null,o=(s,c,a,d)=>{const p=a.displaced.visible[s],l=!!(d.inVirtualList&&d.effected[s]),u=ze(a),g=u&&u.draggableId===s?c:null;if(!p){if(!l)return r(g);if(a.displaced.invisible[s])return null;const h=ae(d.displacedBy.point),E=e(h.x,h.y);return n(E,g,!0)}if(l)return r(g);const m=a.displacedBy.point,b=e(m.x,m.y);return n(b,g,p.shouldAnimate)};return(s,c)=>{if(Be(s))return s.critical.draggable.id===c.draggableId?null:o(c.draggableId,s.critical.draggable.id,s.impact,s.afterCritical);if(s.phase==="DROP_ANIMATING"){const a=s.completed;return a.result.draggableId===c.draggableId?null:o(c.draggableId,a.result.draggableId,a.impact,a.afterCritical)}return null}}const kl=qn(()=>{const e=Ml(),t=Gl();return(r,o)=>e(r,o)||t(r,o)||$l},{dropAnimationFinished:Vr},null,{context:Xt,areStatePropsEqual:go})(Vl);function bo(e){return Qe(nn).isUsingCloneFor===e.draggableId&&!e.isClone?null:D.createElement(kl,e)}function Fl(e){const t=typeof e.isDragDisabled=="boolean"?!e.isDragDisabled:!0,n=!!e.disableInteractiveElementBlocking,r=!!e.shouldRespectForcePress;return D.createElement(bo,Fe({},e,{isClone:!1,isEnabled:t,canDragInteractiveElements:n,shouldRespectForcePress:r}))}const rn=e=>t=>e===t,Wl=rn("scroll"),Ul=rn("auto"),Hl=rn("visible"),vo=(e,t)=>t(e.overflowX)||t(e.overflowY),zl=(e,t)=>t(e.overflowX)&&t(e.overflowY),yo=e=>{const t=window.getComputedStyle(e),n={overflowX:t.overflowX,overflowY:t.overflowY};return vo(n,Wl)||vo(n,Ul)},ql=()=>{if(process.env.NODE_ENV==="production")return!1;const e=Pe(),t=document.documentElement;if(t||(process.env.NODE_ENV,f()),!yo(e))return!1;const n=window.getComputedStyle(t),r={overflowX:n.overflowX,overflowY:n.overflowY};return zl(r,Hl)||process.env.NODE_ENV!=="production"&&B(`
162
+ `):f())}function _l(e,t,n){Te(()=>{function r(i){return`Draggable[id: ${i}]: `}const o=e.draggableId;o||(process.env.NODE_ENV!=="production"?f(!1,"Draggable requires a draggableId"):f(!1)),typeof o!="string"&&(process.env.NODE_ENV!=="production"?f(!1,`Draggable requires a [string] draggableId.
163
+ Provided: [type: ${typeof o}] (value: ${o})`):f(!1)),Number.isInteger(e.index)||(process.env.NODE_ENV!=="production"?f(!1,`${r(o)} requires an integer index prop`):f(!1)),e.mapped.type!=="DRAGGING"&&(fo(n()),e.isEnabled&&(to(t,o)||(process.env.NODE_ENV!=="production"?f(!1,`${r(o)} Unable to find drag handle`):f(!1))))})}function Al(e){Zt(()=>{const t=D.useRef(e);Te(()=>{e!==t.current&&(process.env.NODE_ENV!=="production"?f(!1,"Draggable isClone prop value changed during component life"):f(!1))},[e])})}function Qe(e){const t=D.useContext(e);return t||(process.env.NODE_ENV!=="production"?f(!1,"Could not find required context"):f()),t}function Pl(e){e.preventDefault()}const Tl=e=>{const t=D.useRef(null),n=x((C=null)=>{t.current=C},[]),r=x(()=>t.current,[]),{contextId:o,dragHandleUsageInstructionsId:i,registry:s}=Qe(Ke),{type:c,droppableId:a}=Qe(nn),d=w(()=>({id:e.draggableId,index:e.index,type:c,droppableId:a}),[e.draggableId,e.index,c,a]),{children:p,draggableId:l,isEnabled:u,shouldRespectForcePress:g,canDragInteractiveElements:h,isClone:b,mapped:m,dropAnimationFinished:E}=e;if(_l(e,o,r),Al(b),!b){const C=w(()=>({descriptor:d,registry:s,getDraggableRef:r,canDragInteractiveElements:h,shouldRespectForcePress:g,isEnabled:u}),[d,s,r,h,g,u]);wl(C)}const y=w(()=>u?{tabIndex:0,role:"button","aria-describedby":i,"data-rfd-drag-handle-draggable-id":l,"data-rfd-drag-handle-context-id":o,draggable:!1,onDragStart:Pl}:null,[o,i,l,u]),S=x(C=>{m.type==="DRAGGING"&&m.dropping&&C.propertyName==="transform"&&it.flushSync(E)},[E,m]),I=w(()=>{const C=Sl(m),A=m.type==="DRAGGING"&&m.dropping?S:void 0;return{innerRef:n,draggableProps:{"data-rfd-draggable-context-id":o,"data-rfd-draggable-id":l,style:C,onTransitionEnd:A},dragHandleProps:y}},[o,y,l,m,S,n]),N=w(()=>({draggableId:d.id,type:d.type,source:{index:d.index,droppableId:d.droppableId}}),[d.droppableId,d.id,d.index,d.type]);return D.createElement(D.Fragment,null,p(I,m.snapshot,N))};var go=(e,t)=>e===t,mo=e=>{const{combine:t,destination:n}=e;return n?n.droppableId:t?t.droppableId:null};const Bl=e=>e.combine?e.combine.draggableId:null,Vl=e=>e.at&&e.at.type==="COMBINE"?e.at.combine.draggableId:null;function Ll(){const e=M((o,i)=>({x:o,y:i})),t=M((o,i,s=null,c=null,a=null)=>({isDragging:!0,isClone:i,isDropAnimating:!!a,dropAnimation:a,mode:o,draggingOver:s,combineWith:c,combineTargetFor:null})),n=M((o,i,s,c,a=null,d=null,p=null)=>({mapped:{type:"DRAGGING",dropping:null,draggingOver:a,combineWith:d,mode:i,offset:o,dimension:s,forceShouldAnimate:p,snapshot:t(i,c,a,d,null)}}));return(o,i)=>{if(Be(o)){if(o.critical.draggable.id!==i.draggableId)return null;const s=o.current.client.offset,c=o.dimensions.draggables[i.draggableId],a=W(o.impact),d=Vl(o.impact),p=o.forceShouldAnimate;return n(e(s.x,s.y),o.movementMode,c,i.isClone,a,d,p)}if(o.phase==="DROP_ANIMATING"){const s=o.completed;if(s.result.draggableId!==i.draggableId)return null;const c=i.isClone,a=o.dimensions.draggables[i.draggableId],d=s.result,p=d.mode,l=mo(d),u=Bl(d),h={duration:o.dropDuration,curve:$t.drop,moveTo:o.newHomeClientOffset,opacity:u?Ce.opacity.drop:null,scale:u?Ce.scale.drop:null};return{mapped:{type:"DRAGGING",offset:o.newHomeClientOffset,dimension:a,dropping:h,draggingOver:l,combineWith:u,mode:p,forceShouldAnimate:null,snapshot:t(p,c,l,u,h)}}}return null}}function ho(e=null){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:e,combineWith:null}}const Rl={mapped:{type:"SECONDARY",offset:R,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:ho(null)}};function Ml(){const e=M((s,c)=>({x:s,y:c})),t=M(ho),n=M((s,c=null,a)=>({mapped:{type:"SECONDARY",offset:s,combineTargetFor:c,shouldAnimateDisplacement:a,snapshot:t(c)}})),r=s=>s?n(R,s,!0):null,o=(s,c,a,d)=>{const p=a.displaced.visible[s],l=!!(d.inVirtualList&&d.effected[s]),u=ze(a),g=u&&u.draggableId===s?c:null;if(!p){if(!l)return r(g);if(a.displaced.invisible[s])return null;const m=ae(d.displacedBy.point),E=e(m.x,m.y);return n(E,g,!0)}if(l)return r(g);const h=a.displacedBy.point,b=e(h.x,h.y);return n(b,g,p.shouldAnimate)};return(s,c)=>{if(Be(s))return s.critical.draggable.id===c.draggableId?null:o(c.draggableId,s.critical.draggable.id,s.impact,s.afterCritical);if(s.phase==="DROP_ANIMATING"){const a=s.completed;return a.result.draggableId===c.draggableId?null:o(c.draggableId,a.result.draggableId,a.impact,a.afterCritical)}return null}}const $l=qn(()=>{const e=Ll(),t=Ml();return(r,o)=>e(r,o)||t(r,o)||Rl},{dropAnimationFinished:Vr},null,{context:Xt,areStatePropsEqual:go})(Tl);function bo(e){return Qe(nn).isUsingCloneFor===e.draggableId&&!e.isClone?null:D.createElement($l,e)}function Gl(e){const t=typeof e.isDragDisabled=="boolean"?!e.isDragDisabled:!0,n=!!e.disableInteractiveElementBlocking,r=!!e.shouldRespectForcePress;return D.createElement(bo,Fe({},e,{isClone:!1,isEnabled:t,canDragInteractiveElements:n,shouldRespectForcePress:r}))}const rn=e=>t=>e===t,kl=rn("scroll"),Fl=rn("auto"),Wl=rn("visible"),vo=(e,t)=>t(e.overflowX)||t(e.overflowY),Ul=(e,t)=>t(e.overflowX)&&t(e.overflowY),yo=e=>{const t=window.getComputedStyle(e),n={overflowX:t.overflowX,overflowY:t.overflowY};return vo(n,kl)||vo(n,Fl)},Hl=()=>{if(process.env.NODE_ENV==="production")return!1;const e=Pe(),t=document.documentElement;if(t||(process.env.NODE_ENV,f()),!yo(e))return!1;const n=window.getComputedStyle(t),r={overflowX:n.overflowX,overflowY:n.overflowY};return Ul(r,Wl)||process.env.NODE_ENV!=="production"&&B(`
164
164
  We have detected that your <body> element might be a scroll container.
165
165
  We have found no reliable way of detecting whether the <body> element is a scroll container.
166
166
  Under most circumstances a <body> scroll bar will be on the <html> element (document.documentElement)
@@ -169,16 +169,16 @@ ${hn.current.stack}
169
169
  we will be treating the <body> as *not* a scroll container
170
170
 
171
171
  More information: https://github.com/hello-pangea/dnd/blob/main/docs/guides/how-we-detect-scroll-containers.md
172
- `),!1},on=e=>e==null?null:e===document.body?ql()?e:null:e===document.documentElement?null:yo(e)?e:on(e.parentElement);var jl=e=>{!e||!on(e.parentElement)||process.env.NODE_ENV!=="production"&&B(`
172
+ `),!1},on=e=>e==null?null:e===document.body?Hl()?e:null:e===document.documentElement?null:yo(e)?e:on(e.parentElement);var zl=e=>{!e||!on(e.parentElement)||process.env.NODE_ENV!=="production"&&B(`
173
173
  Droppable: unsupported nested scroll container detected.
174
174
  A Droppable can only have one scroll parent (which can be itself)
175
175
  Nested scroll containers are currently not supported.
176
176
 
177
177
  We hope to support nested scroll containers soon: https://github.com/atlassian/react-beautiful-dnd/issues/131
178
- `)},sn=e=>({x:e.scrollLeft,y:e.scrollTop});const Eo=e=>e?window.getComputedStyle(e).position==="fixed"?!0:Eo(e.parentElement):!1;var Yl=e=>{const t=on(e),n=Eo(e);return{closestScrollable:t,isFixedOnPage:n}},Xl=({descriptor:e,isEnabled:t,isCombineEnabled:n,isFixedOnPage:r,direction:o,client:i,page:s,closest:c})=>{const a=(()=>{if(!c)return null;const{scrollSize:u,client:g}=c,m=kr({scrollHeight:u.scrollHeight,scrollWidth:u.scrollWidth,height:g.paddingBox.height,width:g.paddingBox.width});return{pageMarginBox:c.page.marginBox,frameClient:g,scrollSize:u,shouldClipSubject:c.shouldClipSubject,scroll:{initial:c.scroll,current:c.scroll,max:m,diff:{value:R,displacement:R}}}})(),d=o==="vertical"?Ot:ur,p=le({page:s,withPlaceholder:null,axis:d,frame:a});return{descriptor:e,isCombineEnabled:n,isFixedOnPage:r,axis:d,isEnabled:t,client:i,page:s,frame:a,subject:p}};const Kl=(e,t)=>{const n=Kn(e);if(!t||e!==t)return n;const r=n.paddingBox.top-t.scrollTop,o=n.paddingBox.left-t.scrollLeft,i=r+t.scrollHeight,s=o+t.scrollWidth,a=Dt({top:r,right:s,bottom:i,left:o},n.border);return xt({borderBox:a,margin:n.margin,border:n.border,padding:n.padding})};var Jl=({ref:e,descriptor:t,env:n,windowScroll:r,direction:o,isDropDisabled:i,isCombineEnabled:s,shouldClipSubject:c})=>{const a=n.closestScrollable,d=Kl(e,a),p=ke(d,r),l=(()=>{if(!a)return null;const g=Kn(a),m={scrollHeight:a.scrollHeight,scrollWidth:a.scrollWidth};return{client:g,page:ke(g,r),scroll:sn(a),scrollSize:m,shouldClipSubject:c}})();return Xl({descriptor:t,isEnabled:!i,isCombineEnabled:s,isFixedOnPage:n.isFixedOnPage,direction:o,client:d,page:p,closest:l})};const Zl={passive:!1},Ql={passive:!0};var Do=e=>e.shouldPublishImmediately?Zl:Ql;const et=e=>e&&e.env.closestScrollable||null;function ed(e){const t=D.useRef(null),n=Qe(Ke),r=Kt("droppable"),{registry:o,marshal:i}=n,s=Qt(e),c=w(()=>({id:e.droppableId,type:e.type,mode:e.mode}),[e.droppableId,e.mode,e.type]),a=D.useRef(c),d=w(()=>M((I,N)=>{t.current||(process.env.NODE_ENV!=="production"?f(!1,"Can only update scroll when dragging"):f());const S={x:I,y:N};i.updateDroppableScroll(c.id,S)}),[c.id,i]),p=x(()=>{const I=t.current;return!I||!I.env.closestScrollable?R:sn(I.env.closestScrollable)},[]),l=x(()=>{const I=p();d(I.x,I.y)},[p,d]),u=w(()=>me(l),[l]),g=x(()=>{const I=t.current,N=et(I);if(I&&N||(process.env.NODE_ENV!=="production"?f(!1,"Could not find scroll options while scrolling"):f()),I.scrollOptions.shouldPublishImmediately){l();return}u()},[u,l]),m=x((I,N)=>{t.current&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot collect a droppable while a drag is occurring"):f());const S=s.current,A=S.getDroppableRef();A||(process.env.NODE_ENV!=="production"?f(!1,"Cannot collect without a droppable ref"):f());const T=Yl(A),H={ref:A,descriptor:c,env:T,scrollOptions:N};t.current=H;const V=Jl({ref:A,descriptor:c,env:T,windowScroll:I,direction:S.direction,isDropDisabled:S.isDropDisabled,isCombineEnabled:S.isCombineEnabled,shouldClipSubject:!S.ignoreContainerClipping}),z=T.closestScrollable;return z&&(z.setAttribute(Jr.contextId,n.contextId),z.addEventListener("scroll",g,Do(H.scrollOptions)),process.env.NODE_ENV!=="production"&&jl(z)),V},[n.contextId,c,g,s]),b=x(()=>{const I=t.current,N=et(I);return I&&N||(process.env.NODE_ENV!=="production"?f(!1,"Can only recollect Droppable client for Droppables that have a scroll container"):f()),sn(N)},[]),h=x(()=>{const I=t.current;I||(process.env.NODE_ENV!=="production"?f(!1,"Cannot stop drag when no active drag"):f());const N=et(I);t.current=null,N&&(u.cancel(),N.removeAttribute(Jr.contextId),N.removeEventListener("scroll",g,Do(I.scrollOptions)))},[g,u]),E=x(I=>{const N=t.current;N||(process.env.NODE_ENV!=="production"?f(!1,"Cannot scroll when there is no drag"):f());const S=et(N);S||(process.env.NODE_ENV!=="production"?f(!1,"Cannot scroll a droppable with no closest scrollable"):f()),S.scrollTop+=I.y,S.scrollLeft+=I.x},[]),y=w(()=>({getDimensionAndWatchScroll:m,getScrollWhileDragging:b,dragStopped:h,scroll:E}),[h,m,b,E]),C=w(()=>({uniqueId:r,descriptor:c,callbacks:y}),[y,c,r]);U(()=>(a.current=C.descriptor,o.droppable.register(C),()=>{t.current&&(process.env.NODE_ENV!=="production"&&B("Unsupported: changing the droppableId or type of a Droppable during a drag"),h()),o.droppable.unregister(C)}),[y,c,h,C,i,o.droppable]),U(()=>{t.current&&i.updateDroppableIsEnabled(a.current.id,!e.isDropDisabled)},[e.isDropDisabled,i]),U(()=>{t.current&&i.updateDroppableIsCombineEnabled(a.current.id,e.isCombineEnabled)},[e.isCombineEnabled,i])}function cn(){}const No={width:0,height:0,margin:Ji},td=({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>e||n==="close"?No:{height:t.client.borderBox.height,width:t.client.borderBox.width,margin:t.client.margin},nd=({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>{const r=td({isAnimatingOpenOnMount:e,placeholder:t,animate:n});return{display:t.display,boxSizing:"border-box",width:r.width,height:r.height,marginTop:r.margin.top,marginRight:r.margin.right,marginBottom:r.margin.bottom,marginLeft:r.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:n!=="none"?Ce.placeholder:null}},rd=e=>{const t=D.useRef(null),n=x(()=>{t.current&&(clearTimeout(t.current),t.current=null)},[]),{animate:r,onTransitionEnd:o,onClose:i,contextId:s}=e,[c,a]=D.useState(e.animate==="open");D.useEffect(()=>c?r!=="open"?(n(),a(!1),cn):t.current?cn:(t.current=setTimeout(()=>{t.current=null,a(!1)}),n):cn,[r,c,n]);const d=x(l=>{l.propertyName==="height"&&(o(),r==="close"&&i())},[r,i,o]),p=nd({isAnimatingOpenOnMount:c,animate:e.animate,placeholder:e.placeholder});return D.createElement(e.placeholder.tagName,{style:p,"data-rfd-placeholder-context-id":s,onTransitionEnd:d,ref:e.innerRef})};var od=D.memo(rd);function an(e){return typeof e=="boolean"}function ln(e,t){t.forEach(n=>n(e))}const id=[function({props:t}){t.droppableId||(process.env.NODE_ENV!=="production"?f(!1,"A Droppable requires a droppableId prop"):f()),typeof t.droppableId!="string"&&(process.env.NODE_ENV!=="production"?f(!1,`A Droppable requires a [string] droppableId. Provided: [${typeof t.droppableId}]`):f())},function({props:t}){an(t.isDropDisabled)||(process.env.NODE_ENV!=="production"?f(!1,"isDropDisabled must be a boolean"):f()),an(t.isCombineEnabled)||(process.env.NODE_ENV!=="production"?f(!1,"isCombineEnabled must be a boolean"):f()),an(t.ignoreContainerClipping)||(process.env.NODE_ENV!=="production"?f(!1,"ignoreContainerClipping must be a boolean"):f())},function({getDroppableRef:t}){fo(t())}],sd=[function({props:t,getPlaceholderRef:n}){!t.placeholder||n()||process.env.NODE_ENV!=="production"&&B(`
178
+ `)},sn=e=>({x:e.scrollLeft,y:e.scrollTop});const Eo=e=>e?window.getComputedStyle(e).position==="fixed"?!0:Eo(e.parentElement):!1;var ql=e=>{const t=on(e),n=Eo(e);return{closestScrollable:t,isFixedOnPage:n}},jl=({descriptor:e,isEnabled:t,isCombineEnabled:n,isFixedOnPage:r,direction:o,client:i,page:s,closest:c})=>{const a=(()=>{if(!c)return null;const{scrollSize:u,client:g}=c,h=kr({scrollHeight:u.scrollHeight,scrollWidth:u.scrollWidth,height:g.paddingBox.height,width:g.paddingBox.width});return{pageMarginBox:c.page.marginBox,frameClient:g,scrollSize:u,shouldClipSubject:c.shouldClipSubject,scroll:{initial:c.scroll,current:c.scroll,max:h,diff:{value:R,displacement:R}}}})(),d=o==="vertical"?Ot:ur,p=le({page:s,withPlaceholder:null,axis:d,frame:a});return{descriptor:e,isCombineEnabled:n,isFixedOnPage:r,axis:d,isEnabled:t,client:i,page:s,frame:a,subject:p}};const Yl=(e,t)=>{const n=Kn(e);if(!t||e!==t)return n;const r=n.paddingBox.top-t.scrollTop,o=n.paddingBox.left-t.scrollLeft,i=r+t.scrollHeight,s=o+t.scrollWidth,a=Dt({top:r,right:s,bottom:i,left:o},n.border);return xt({borderBox:a,margin:n.margin,border:n.border,padding:n.padding})};var Xl=({ref:e,descriptor:t,env:n,windowScroll:r,direction:o,isDropDisabled:i,isCombineEnabled:s,shouldClipSubject:c})=>{const a=n.closestScrollable,d=Yl(e,a),p=ke(d,r),l=(()=>{if(!a)return null;const g=Kn(a),h={scrollHeight:a.scrollHeight,scrollWidth:a.scrollWidth};return{client:g,page:ke(g,r),scroll:sn(a),scrollSize:h,shouldClipSubject:c}})();return jl({descriptor:t,isEnabled:!i,isCombineEnabled:s,isFixedOnPage:n.isFixedOnPage,direction:o,client:d,page:p,closest:l})};const Kl={passive:!1},Jl={passive:!0};var Do=e=>e.shouldPublishImmediately?Kl:Jl;const et=e=>e&&e.env.closestScrollable||null;function Zl(e){const t=D.useRef(null),n=Qe(Ke),r=Kt("droppable"),{registry:o,marshal:i}=n,s=Qt(e),c=w(()=>({id:e.droppableId,type:e.type,mode:e.mode}),[e.droppableId,e.mode,e.type]),a=D.useRef(c),d=w(()=>M((I,N)=>{t.current||(process.env.NODE_ENV!=="production"?f(!1,"Can only update scroll when dragging"):f());const C={x:I,y:N};i.updateDroppableScroll(c.id,C)}),[c.id,i]),p=x(()=>{const I=t.current;return!I||!I.env.closestScrollable?R:sn(I.env.closestScrollable)},[]),l=x(()=>{const I=p();d(I.x,I.y)},[p,d]),u=w(()=>me(l),[l]),g=x(()=>{const I=t.current,N=et(I);if(I&&N||(process.env.NODE_ENV!=="production"?f(!1,"Could not find scroll options while scrolling"):f()),I.scrollOptions.shouldPublishImmediately){l();return}u()},[u,l]),h=x((I,N)=>{t.current&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot collect a droppable while a drag is occurring"):f());const C=s.current,A=C.getDroppableRef();A||(process.env.NODE_ENV!=="production"?f(!1,"Cannot collect without a droppable ref"):f());const T=ql(A),H={ref:A,descriptor:c,env:T,scrollOptions:N};t.current=H;const V=Xl({ref:A,descriptor:c,env:T,windowScroll:I,direction:C.direction,isDropDisabled:C.isDropDisabled,isCombineEnabled:C.isCombineEnabled,shouldClipSubject:!C.ignoreContainerClipping}),z=T.closestScrollable;return z&&(z.setAttribute(Jr.contextId,n.contextId),z.addEventListener("scroll",g,Do(H.scrollOptions)),process.env.NODE_ENV!=="production"&&zl(z)),V},[n.contextId,c,g,s]),b=x(()=>{const I=t.current,N=et(I);return I&&N||(process.env.NODE_ENV!=="production"?f(!1,"Can only recollect Droppable client for Droppables that have a scroll container"):f()),sn(N)},[]),m=x(()=>{const I=t.current;I||(process.env.NODE_ENV!=="production"?f(!1,"Cannot stop drag when no active drag"):f());const N=et(I);t.current=null,N&&(u.cancel(),N.removeAttribute(Jr.contextId),N.removeEventListener("scroll",g,Do(I.scrollOptions)))},[g,u]),E=x(I=>{const N=t.current;N||(process.env.NODE_ENV!=="production"?f(!1,"Cannot scroll when there is no drag"):f());const C=et(N);C||(process.env.NODE_ENV!=="production"?f(!1,"Cannot scroll a droppable with no closest scrollable"):f()),C.scrollTop+=I.y,C.scrollLeft+=I.x},[]),y=w(()=>({getDimensionAndWatchScroll:h,getScrollWhileDragging:b,dragStopped:m,scroll:E}),[m,h,b,E]),S=w(()=>({uniqueId:r,descriptor:c,callbacks:y}),[y,c,r]);U(()=>(a.current=S.descriptor,o.droppable.register(S),()=>{t.current&&(process.env.NODE_ENV!=="production"&&B("Unsupported: changing the droppableId or type of a Droppable during a drag"),m()),o.droppable.unregister(S)}),[y,c,m,S,i,o.droppable]),U(()=>{t.current&&i.updateDroppableIsEnabled(a.current.id,!e.isDropDisabled)},[e.isDropDisabled,i]),U(()=>{t.current&&i.updateDroppableIsCombineEnabled(a.current.id,e.isCombineEnabled)},[e.isCombineEnabled,i])}function cn(){}const No={width:0,height:0,margin:Xi},Ql=({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>e||n==="close"?No:{height:t.client.borderBox.height,width:t.client.borderBox.width,margin:t.client.margin},ed=({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>{const r=Ql({isAnimatingOpenOnMount:e,placeholder:t,animate:n});return{display:t.display,boxSizing:"border-box",width:r.width,height:r.height,marginTop:r.margin.top,marginRight:r.margin.right,marginBottom:r.margin.bottom,marginLeft:r.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:n!=="none"?Se.placeholder:null}},td=e=>{const t=D.useRef(null),n=x(()=>{t.current&&(clearTimeout(t.current),t.current=null)},[]),{animate:r,onTransitionEnd:o,onClose:i,contextId:s}=e,[c,a]=D.useState(e.animate==="open");D.useEffect(()=>c?r!=="open"?(n(),a(!1),cn):t.current?cn:(t.current=setTimeout(()=>{t.current=null,a(!1)}),n):cn,[r,c,n]);const d=x(l=>{l.propertyName==="height"&&(o(),r==="close"&&i())},[r,i,o]),p=ed({isAnimatingOpenOnMount:c,animate:e.animate,placeholder:e.placeholder});return D.createElement(e.placeholder.tagName,{style:p,"data-rfd-placeholder-context-id":s,onTransitionEnd:d,ref:e.innerRef})};var nd=D.memo(td);function an(e){return typeof e=="boolean"}function ln(e,t){t.forEach(n=>n(e))}const rd=[function({props:t}){t.droppableId||(process.env.NODE_ENV!=="production"?f(!1,"A Droppable requires a droppableId prop"):f()),typeof t.droppableId!="string"&&(process.env.NODE_ENV!=="production"?f(!1,`A Droppable requires a [string] droppableId. Provided: [${typeof t.droppableId}]`):f())},function({props:t}){an(t.isDropDisabled)||(process.env.NODE_ENV!=="production"?f(!1,"isDropDisabled must be a boolean"):f()),an(t.isCombineEnabled)||(process.env.NODE_ENV!=="production"?f(!1,"isCombineEnabled must be a boolean"):f()),an(t.ignoreContainerClipping)||(process.env.NODE_ENV!=="production"?f(!1,"ignoreContainerClipping must be a boolean"):f())},function({getDroppableRef:t}){fo(t())}],od=[function({props:t,getPlaceholderRef:n}){!t.placeholder||n()||process.env.NODE_ENV!=="production"&&B(`
179
179
  Droppable setup issue [droppableId: "${t.droppableId}"]:
180
180
  DroppableProvided > placeholder could not be found.
181
181
 
182
182
  Please be sure to add the {provided.placeholder} React Node as a child of your Droppable.
183
183
  More information: https://github.com/hello-pangea/dnd/blob/main/docs/api/droppable.md
184
- `)}],cd=[function({props:t}){t.renderClone||(process.env.NODE_ENV!=="production"?f(!1,"Must provide a clone render function (renderClone) for virtual lists"):f())},function({getPlaceholderRef:t}){t()&&(process.env.NODE_ENV!=="production"?f(!1,"Expected virtual list to not have a placeholder"):f())}];function ad(e){Te(()=>{ln(e,id),e.props.mode==="standard"&&ln(e,sd),e.props.mode==="virtual"&&ln(e,cd)})}class ld extends D.PureComponent{constructor(...t){super(...t),this.state={isVisible:!!this.props.on,data:this.props.on,animate:this.props.shouldAnimate&&this.props.on?"open":"none"},this.onClose=()=>{this.state.animate==="close"&&this.setState({isVisible:!1})}}static getDerivedStateFromProps(t,n){return t.shouldAnimate?t.on?{isVisible:!0,data:t.on,animate:"open"}:n.isVisible?{isVisible:!0,data:n.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:!!t.on,data:t.on,animate:"none"}}render(){if(!this.state.isVisible)return null;const t={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(t)}}const dd=e=>{const t=D.useContext(Ke);t||(process.env.NODE_ENV!=="production"?f(!1,"Could not find app context"):f());const{contextId:n,isMovementAllowed:r}=t,o=D.useRef(null),i=D.useRef(null),{children:s,droppableId:c,type:a,mode:d,direction:p,ignoreContainerClipping:l,isDropDisabled:u,isCombineEnabled:g,snapshot:m,useClone:b,updateViewportMaxScroll:h,getContainerForClone:E}=e,y=x(()=>o.current,[]),C=x((L=null)=>{o.current=L},[]),I=x(()=>i.current,[]),N=x((L=null)=>{i.current=L},[]);ad({props:e,getDroppableRef:y,getPlaceholderRef:I});const S=x(()=>{r()&&h({maxScroll:Wr()})},[r,h]);ed({droppableId:c,type:a,mode:d,direction:p,isDropDisabled:u,isCombineEnabled:g,ignoreContainerClipping:l,getDroppableRef:y});const A=w(()=>D.createElement(ld,{on:e.placeholder,shouldAnimate:e.shouldAnimatePlaceholder},({onClose:L,data:J,animate:fe})=>D.createElement(od,{placeholder:J,onClose:L,innerRef:N,animate:fe,contextId:n,onTransitionEnd:S})),[n,S,e.placeholder,e.shouldAnimatePlaceholder,N]),T=w(()=>({innerRef:C,placeholder:A,droppableProps:{"data-rfd-droppable-id":c,"data-rfd-droppable-context-id":n}}),[n,c,A,C]),H=b?b.dragging.draggableId:null,V=w(()=>({droppableId:c,type:a,isUsingCloneFor:H}),[c,H,a]);function z(){if(!b)return null;const{dragging:L,render:J}=b,fe=D.createElement(bo,{draggableId:L.draggableId,index:L.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},(Z,rt)=>J(Z,rt,L));return it.createPortal(fe,E())}return D.createElement(nn.Provider,{value:V},s(T,m),z())};function ud(){return document.body||(process.env.NODE_ENV!=="production"?f(!1,"document.body is not ready"):f()),document.body}const xo={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:ud},Io=e=>{let t={...e},n;for(n in xo)e[n]===void 0&&(t={...t,[n]:xo[n]});return t},dn=(e,t)=>e===t.droppable.type,So=(e,t)=>t.draggables[e.draggable.id],pd=qn(()=>{const e={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},t={...e,shouldAnimatePlaceholder:!1},n=M(i=>({draggableId:i.id,type:i.type,source:{index:i.index,droppableId:i.droppableId}})),r=M((i,s,c,a,d,p)=>{const l=d.descriptor.id;if(d.descriptor.droppableId===i){const m=p?{render:p,dragging:n(d.descriptor)}:null,b={isDraggingOver:c,draggingOverWith:c?l:null,draggingFromThisWith:l,isUsingPlaceholder:!0};return{placeholder:d.placeholder,shouldAnimatePlaceholder:!1,snapshot:b,useClone:m}}if(!s)return t;if(!a)return e;const g={isDraggingOver:c,draggingOverWith:l,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:d.placeholder,shouldAnimatePlaceholder:!0,snapshot:g,useClone:null}});return(i,s)=>{const c=Io(s),a=c.droppableId,d=c.type,p=!c.isDropDisabled,l=c.renderClone;if(Be(i)){const u=i.critical;if(!dn(d,u))return t;const g=So(u,i.dimensions),m=W(i.impact)===a;return r(a,p,m,m,g,l)}if(i.phase==="DROP_ANIMATING"){const u=i.completed;if(!dn(d,u.critical))return t;const g=So(u.critical,i.dimensions);return r(a,p,mo(u.result)===a,W(u.impact)===a,g,l)}if(i.phase==="IDLE"&&i.completed&&!i.shouldFlush){const u=i.completed;if(!dn(d,u.critical))return t;const g=W(u.impact)===a,m=!!(u.impact.at&&u.impact.at.type==="COMBINE"),b=u.critical.droppable.id===a;return g?m?e:t:b?e:t}return t}},{updateViewportMaxScroll:lc},(e,t,n)=>({...Io(n),...e,...t}),{context:Xt,areStatePropsEqual:go})(dd),fd=()=>v.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[v.jsx("path",{d:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"}),v.jsx("circle",{cx:"12",cy:"10",r:"3"})]}),Co=()=>v.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[v.jsx("circle",{cx:"12",cy:"12",r:"10"}),v.jsx("polyline",{points:"12 6 12 12 16 14"})]}),gd=()=>v.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#9ca3af",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{cursor:"grab"},children:[v.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),v.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),v.jsx("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]}),Oo=()=>v.jsxs("svg",{width:"25",height:"25",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[v.jsx("polyline",{points:"15 3 21 3 21 9"}),v.jsx("polyline",{points:"9 21 3 21 3 15"}),v.jsx("line",{x1:"21",y1:"3",x2:"14",y2:"10"}),v.jsx("line",{x1:"3",y1:"21",x2:"10",y2:"14"})]}),wo=()=>v.jsxs("svg",{width:"25",height:"25",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[v.jsx("polyline",{points:"4 14 10 14 10 20"}),v.jsx("polyline",{points:"20 10 14 10 14 4"}),v.jsx("line",{x1:"14",y1:"10",x2:"21",y2:"3"}),v.jsx("line",{x1:"3",y1:"21",x2:"10",y2:"14"})]}),tt=e=>{var s;if(!e)return"--:--";const t=(s=e.split("T")[1])==null?void 0:s.slice(0,5);if(!t)return"--:--";const[n,r]=t.split(":").map(Number),o=n>=12?"PM":"AM";return`${n%12||12}:${r.toString().padStart(2,"0")} ${o}`},un=e=>typeof e=="object"&&(e!=null&&e.name)?e.name:e,nt=e=>{var t;return e?typeof e=="string"?e.toLowerCase()==="completed":((t=e==null?void 0:e.code)==null?void 0:t.toLowerCase())==="completed":!1},md=e=>{const t=[];return[...e].sort((r,o)=>r.sequence_rank-o.sequence_rank).forEach(r=>{const o=t[t.length-1];o&&o.stop_id===r.stop_id?o.orders.push(r):t.push({stop_id:r.stop_id,sequence_rank:r.sequence_rank,orders:[r]})}),t},hd=({order:e,pathPeriod:t,isFirst:n,isDone:r,renderOrderExtraData:o})=>{var a,d,p,l,u,g;const[i,s]=D.useState(!1),c=(d=(a=e.customer)==null?void 0:a.address)!=null&&d.lat&&((l=(p=e.customer)==null?void 0:p.address)!=null&&l.long)?`https://maps.google.com/?q=${e.customer.address.lat},${e.customer.address.long}`:"#";return v.jsxs("div",{style:{...O.orderBlock,borderTop:n?"none":"1px solid #f3f4f6",backgroundColor:r?"#fafafa":"transparent"},children:[v.jsxs("div",{style:O.orderHeader,children:[v.jsxs("div",{style:O.gridItem,children:[v.jsxs("div",{style:O.gridLabel,children:["ORDER"," ",r&&v.jsx("span",{style:{color:"#16a34a",marginLeft:"4px"},children:"✓ DONE"})]}),v.jsxs("div",{style:O.gridValue,children:["#",e.order_id]})]}),o&&v.jsx("button",{onClick:()=>s(!i),style:O.expandButton,children:i?v.jsx(wo,{}):v.jsx(Oo,{})})]}),v.jsxs("div",{style:O.detailsGrid,children:[v.jsxs("div",{style:O.gridItem,children:[v.jsx("div",{style:O.gridLabel,children:"LOCATION"}),v.jsxs("div",{style:O.gridValueWithIcon,children:[v.jsx(fd,{}),v.jsx("a",{href:c,target:"_blank",rel:"noopener noreferrer",style:O.addressLink,children:((g=(u=e.customer)==null?void 0:u.address)==null?void 0:g.street_area)||"N/A"})]})]}),v.jsxs("div",{style:O.gridItem,children:[v.jsx("div",{style:O.gridLabel,children:"PERIOD"}),v.jsx("div",{style:O.gridValue,children:t})]}),v.jsxs("div",{style:O.gridItem,children:[v.jsx("div",{style:O.gridLabel,children:"TIME WINDOW"}),v.jsxs("div",{style:O.gridValueWithIcon,children:[v.jsx(Co,{})," ",v.jsxs("span",{style:O.direction,children:[tt(e.eta_start)," - ",tt(e.eta_end)]})]})]}),e.completed_at&&v.jsxs("div",{style:O.gridItem,children:[v.jsx("div",{style:O.gridLabel,children:"COMPLETED AT"}),v.jsxs("div",{style:O.gridValueWithIcon,children:[v.jsx(Co,{})," ",v.jsx("span",{style:O.direction,children:tt(e.completed_at)})]})]})]}),i&&o&&v.jsx("div",{style:O.extraDataContainer,children:o(e)})]})},bd=({stopGroup:e,index:t,pathType:n,pathPeriod:r,canEditPath:o,isPathCompleted:i,renderStopActions:s,renderOrderExtraData:c})=>{const a=e.status?nt(e.status):e.orders.every(g=>nt(g.status)),[d,p]=D.useState(!a),l=e.status?un(e.status):a?"Completed":"Pending",u=!o||i||a;return v.jsx(Fl,{draggableId:e.stop_id.toString(),index:t,isDragDisabled:u,children:g=>{var m,b;return v.jsxs("div",{ref:g.innerRef,...g.draggableProps,style:{...O.timelineItem,...g.draggableProps.style},children:[v.jsx("div",{style:{...O.bubble,...a?O.bubbleCompleted:O.bubblePending},children:t+1}),v.jsxs("div",{style:O.card,children:[v.jsxs("div",{style:O.cardHeader,children:[v.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[v.jsxs("span",{style:O.title,children:[n," #",e.sequence_rank]}),v.jsx("span",{style:a?O.badgeCompleted:O.badgePending,children:l}),e.completed_at&&v.jsxs("span",{style:{fontSize:"12px",color:"#6b7280"},children:["(",tt(e.completed_at),")"]})]}),v.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[v.jsx("button",{onClick:()=>p(!d),style:O.expandButton,children:d?v.jsx(wo,{}):v.jsx(Oo,{})}),!u&&v.jsx("div",{...g.dragHandleProps,children:v.jsx(gd,{})})]})]}),d&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{style:O.customerName,children:["Customer: ",(b=(m=e.orders[0])==null?void 0:m.customer)==null?void 0:b.name]}),v.jsx("div",{style:O.ordersList,children:e.orders.map((h,E)=>v.jsx(hd,{order:h,pathPeriod:r,isFirst:E===0,isDone:nt(h.status),renderOrderExtraData:c},h.id))}),s&&v.jsx("div",{style:O.actionsSlot,children:s(e)})]})]})]})}})},vd=({path:e,onReorder:t,renderStopActions:n,renderOrderExtraData:r,canEditPath:o=!0})=>{const[i,s]=D.useState([]);D.useEffect(()=>{if(e)if(e.stops&&e.stops.length>0){const d=e.stops.map(p=>({stop_id:p.id,sequence_rank:p.sequence_rank,status:p.status,completed_at:p.completed_at,orders:(e.path_orders||[]).filter(l=>l.stop_id===p.id).sort((l,u)=>l.sequence_rank-u.sequence_rank)})).sort((p,l)=>p.sequence_rank-l.sequence_rank);s(d)}else e.path_orders&&s(md(e.path_orders))},[e]);const c=d=>{if(!d.destination)return;const p=Array.from(i),[l]=p.splice(d.source.index,1);p.splice(d.destination.index,0,l),s(p),t&&t(e.id,p.map(u=>u.stop_id))};if(!e||!i.length)return v.jsx("div",{children:"No Path Data"});const a=nt(e.status);return v.jsx("div",{style:O.container,children:v.jsx(Nl,{onDragEnd:c,children:v.jsx(pd,{droppableId:"path-list",children:d=>v.jsxs("div",{ref:d.innerRef,...d.droppableProps,style:O.timelineWrapper,children:[v.jsx("div",{style:O.verticalLine}),v.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"24px"},children:i.map((p,l)=>v.jsx(bd,{stopGroup:p,index:l,pathType:un(e.type),pathPeriod:un(e.period),canEditPath:o,isPathCompleted:a,renderStopActions:n,renderOrderExtraData:r},p.stop_id))}),d.placeholder]})})})})},O={container:{fontFamily:"sans-serif",maxWidth:"800px",margin:"0 auto"},timelineWrapper:{position:"relative",padding:"20px 0"},verticalLine:{position:"absolute",right:"19px",top:"40px",bottom:"40px",width:"2px",backgroundColor:"#f3f4f6"},direction:{direction:"ltr"},timelineItem:{display:"flex",gap:"16px",marginBottom:"24px",position:"relative",zIndex:1},bubble:{width:"40px",height:"40px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:"bold",backgroundColor:"#fff",border:"2px solid",flexShrink:0},bubblePending:{borderColor:"#f3f4f6",color:"#9ca3af"},bubbleCompleted:{borderColor:"#dcfce7",color:"#16a34a",backgroundColor:"#f0fdf4"},card:{flex:1,backgroundColor:"#fff",border:"1px solid #f3f4f6",borderRadius:"12px",padding:"16px",boxShadow:"0 1px 3px rgba(0,0,0,0.1)"},cardHeader:{display:"flex",justifyContent:"space-between",marginBottom:"8px",alignItems:"center"},title:{fontSize:"16px",fontWeight:"bold"},badgePending:{fontSize:"11px",padding:"2px 8px",borderRadius:"12px",backgroundColor:"#f3f4f6",color:"#4b5563",fontWeight:"600"},badgeCompleted:{fontSize:"11px",padding:"2px 8px",borderRadius:"12px",backgroundColor:"#dcfce7",color:"#16a34a",fontWeight:"600"},customerName:{fontSize:"14px",color:"#6b7280",marginBottom:"12px"},ordersList:{backgroundColor:"#f9fafb",borderRadius:"8px",overflow:"hidden"},orderBlock:{padding:"12px",transition:"background-color 0.2s"},orderHeader:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"8px"},detailsGrid:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"12px"},gridItem:{display:"flex",flexDirection:"column"},gridLabel:{fontSize:"10px",color:"#9ca3af",fontWeight:"bold"},gridValue:{fontSize:"13px",fontWeight:"600"},gridValueWithIcon:{fontSize:"13px",display:"flex",alignItems:"flex-start",gap:"4px",color:"#374151"},addressLink:{color:"#3b82f6",textDecoration:"underline",wordBreak:"break-word",lineHeight:"1.4"},expandButton:{color:"#fff",border:"none",cursor:"pointer",backgroundColor:"#d1d1d1",borderRadius:"5px",padding:"4px",display:"flex",alignItems:"center",justifyContent:"center"},extraDataContainer:{marginTop:"12px",padding:"12px",borderTop:"1px dashed #e5e7eb",backgroundColor:"#fff",borderRadius:"4px"},actionsSlot:{marginTop:"16px"}};Q.LogisticsDashboard=vd,Object.defineProperty(Q,Symbol.toStringTag,{value:"Module"})});
184
+ `)}],id=[function({props:t}){t.renderClone||(process.env.NODE_ENV!=="production"?f(!1,"Must provide a clone render function (renderClone) for virtual lists"):f())},function({getPlaceholderRef:t}){t()&&(process.env.NODE_ENV!=="production"?f(!1,"Expected virtual list to not have a placeholder"):f())}];function sd(e){Te(()=>{ln(e,rd),e.props.mode==="standard"&&ln(e,od),e.props.mode==="virtual"&&ln(e,id)})}class cd extends D.PureComponent{constructor(...t){super(...t),this.state={isVisible:!!this.props.on,data:this.props.on,animate:this.props.shouldAnimate&&this.props.on?"open":"none"},this.onClose=()=>{this.state.animate==="close"&&this.setState({isVisible:!1})}}static getDerivedStateFromProps(t,n){return t.shouldAnimate?t.on?{isVisible:!0,data:t.on,animate:"open"}:n.isVisible?{isVisible:!0,data:n.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:!!t.on,data:t.on,animate:"none"}}render(){if(!this.state.isVisible)return null;const t={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(t)}}const ad=e=>{const t=D.useContext(Ke);t||(process.env.NODE_ENV!=="production"?f(!1,"Could not find app context"):f());const{contextId:n,isMovementAllowed:r}=t,o=D.useRef(null),i=D.useRef(null),{children:s,droppableId:c,type:a,mode:d,direction:p,ignoreContainerClipping:l,isDropDisabled:u,isCombineEnabled:g,snapshot:h,useClone:b,updateViewportMaxScroll:m,getContainerForClone:E}=e,y=x(()=>o.current,[]),S=x((L=null)=>{o.current=L},[]),I=x(()=>i.current,[]),N=x((L=null)=>{i.current=L},[]);sd({props:e,getDroppableRef:y,getPlaceholderRef:I});const C=x(()=>{r()&&m({maxScroll:Wr()})},[r,m]);Zl({droppableId:c,type:a,mode:d,direction:p,isDropDisabled:u,isCombineEnabled:g,ignoreContainerClipping:l,getDroppableRef:y});const A=w(()=>D.createElement(cd,{on:e.placeholder,shouldAnimate:e.shouldAnimatePlaceholder},({onClose:L,data:J,animate:fe})=>D.createElement(nd,{placeholder:J,onClose:L,innerRef:N,animate:fe,contextId:n,onTransitionEnd:C})),[n,C,e.placeholder,e.shouldAnimatePlaceholder,N]),T=w(()=>({innerRef:S,placeholder:A,droppableProps:{"data-rfd-droppable-id":c,"data-rfd-droppable-context-id":n}}),[n,c,A,S]),H=b?b.dragging.draggableId:null,V=w(()=>({droppableId:c,type:a,isUsingCloneFor:H}),[c,H,a]);function z(){if(!b)return null;const{dragging:L,render:J}=b,fe=D.createElement(bo,{draggableId:L.draggableId,index:L.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},(Z,rt)=>J(Z,rt,L));return it.createPortal(fe,E())}return D.createElement(nn.Provider,{value:V},s(T,h),z())};function ld(){return document.body||(process.env.NODE_ENV!=="production"?f(!1,"document.body is not ready"):f()),document.body}const xo={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:ld},Io=e=>{let t={...e},n;for(n in xo)e[n]===void 0&&(t={...t,[n]:xo[n]});return t},dn=(e,t)=>e===t.droppable.type,Co=(e,t)=>t.draggables[e.draggable.id],dd=qn(()=>{const e={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},t={...e,shouldAnimatePlaceholder:!1},n=M(i=>({draggableId:i.id,type:i.type,source:{index:i.index,droppableId:i.droppableId}})),r=M((i,s,c,a,d,p)=>{const l=d.descriptor.id;if(d.descriptor.droppableId===i){const h=p?{render:p,dragging:n(d.descriptor)}:null,b={isDraggingOver:c,draggingOverWith:c?l:null,draggingFromThisWith:l,isUsingPlaceholder:!0};return{placeholder:d.placeholder,shouldAnimatePlaceholder:!1,snapshot:b,useClone:h}}if(!s)return t;if(!a)return e;const g={isDraggingOver:c,draggingOverWith:l,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:d.placeholder,shouldAnimatePlaceholder:!0,snapshot:g,useClone:null}});return(i,s)=>{const c=Io(s),a=c.droppableId,d=c.type,p=!c.isDropDisabled,l=c.renderClone;if(Be(i)){const u=i.critical;if(!dn(d,u))return t;const g=Co(u,i.dimensions),h=W(i.impact)===a;return r(a,p,h,h,g,l)}if(i.phase==="DROP_ANIMATING"){const u=i.completed;if(!dn(d,u.critical))return t;const g=Co(u.critical,i.dimensions);return r(a,p,mo(u.result)===a,W(u.impact)===a,g,l)}if(i.phase==="IDLE"&&i.completed&&!i.shouldFlush){const u=i.completed;if(!dn(d,u.critical))return t;const g=W(u.impact)===a,h=!!(u.impact.at&&u.impact.at.type==="COMBINE"),b=u.critical.droppable.id===a;return g?h?e:t:b?e:t}return t}},{updateViewportMaxScroll:cc},(e,t,n)=>({...Io(n),...e,...t}),{context:Xt,areStatePropsEqual:go})(ad),ud=()=>v.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[v.jsx("path",{d:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"}),v.jsx("circle",{cx:"12",cy:"10",r:"3"})]}),So=()=>v.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[v.jsx("circle",{cx:"12",cy:"12",r:"10"}),v.jsx("polyline",{points:"12 6 12 12 16 14"})]}),pd=()=>v.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#9ca3af",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{cursor:"grab"},children:[v.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),v.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),v.jsx("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]}),fd=()=>v.jsx("svg",{width:"25",height:"25",viewBox:"0 0 90 90",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:v.jsxs("g",{children:[v.jsx("polygon",{points:"37.95,64.44 23.78,50.27 30.85,43.2 37.95,50.3 59.15,29.1 66.22,36.17",fill:"#009E04"}),v.jsx("path",{d:"M45 90C20.187 90 0 69.813 0 45C0 20.187 20.187 0 45 0C69.813 0 90 20.187 90 45C90 69.813 69.813 90 45 90ZM45 10C25.701 10 10 25.701 10 45C10 64.299 25.701 80 45 80C64.299 80 80 64.299 80 45C80 25.701 64.299 10 45 10Z",fill:"#009E04",strokeLinecap:"round"})]})}),gd=()=>v.jsxs("svg",{width:"25",height:"25",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[v.jsx("polyline",{points:"15 3 21 3 21 9"}),v.jsx("polyline",{points:"9 21 3 21 3 15"}),v.jsx("line",{x1:"21",y1:"3",x2:"14",y2:"10"}),v.jsx("line",{x1:"3",y1:"21",x2:"10",y2:"14"})]}),md=()=>v.jsxs("svg",{width:"25",height:"25",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[v.jsx("polyline",{points:"4 14 10 14 10 20"}),v.jsx("polyline",{points:"20 10 14 10 14 4"}),v.jsx("line",{x1:"14",y1:"10",x2:"21",y2:"3"}),v.jsx("line",{x1:"3",y1:"21",x2:"10",y2:"14"})]}),tt=e=>{var s;if(!e)return"--:--";const t=(s=e.split("T")[1])==null?void 0:s.slice(0,5);if(!t)return"--:--";const[n,r]=t.split(":").map(Number),o=n>=12?"PM":"AM";return`${n%12||12}:${r.toString().padStart(2,"0")} ${o}`},un=e=>typeof e=="object"&&(e!=null&&e.name)?e.name:e,nt=e=>{var t;return e?typeof e=="string"?e.toLowerCase()==="completed":((t=e==null?void 0:e.code)==null?void 0:t.toLowerCase())==="completed":!1},hd=e=>{const t=[];return[...e].sort((r,o)=>r.sequence_rank-o.sequence_rank).forEach(r=>{const o=t[t.length-1];o&&o.stop_id===r.stop_id?o.orders.push(r):t.push({stop_id:r.stop_id,sequence_rank:r.sequence_rank,orders:[r]})}),t},bd=({order:e,pathPeriod:t,isFirst:n,isDone:r,renderOrderExtraData:o})=>{var a,d,p,l,u,g;const[i,s]=D.useState(!1),c=(d=(a=e.customer)==null?void 0:a.address)!=null&&d.lat&&((l=(p=e.customer)==null?void 0:p.address)!=null&&l.long)?`https://maps.google.com/?q=${e.customer.address.lat},${e.customer.address.long}`:"#";return v.jsxs("div",{style:{...O.orderBlock,borderTop:n?"none":"1px solid #f3f4f6",backgroundColor:r?"#fafafa":"transparent"},children:[v.jsxs("div",{style:O.orderHeader,children:[v.jsxs("div",{style:O.gridItem,children:[v.jsxs("div",{style:O.gridLabel,children:["ORDER"," ",r&&v.jsx("span",{style:{color:"#16a34a",marginLeft:"4px"},children:"✓ DONE"})]}),v.jsxs("div",{style:O.gridValue,children:["#",e.order_id]})]}),o&&v.jsx("button",{onClick:()=>s(!i),style:O.expandButton,children:i?v.jsx(md,{}):v.jsx(gd,{})})]}),v.jsxs("div",{style:O.detailsGrid,children:[v.jsxs("div",{style:O.gridItem,children:[v.jsx("div",{style:O.gridLabel,children:"LOCATION"}),v.jsxs("div",{style:O.gridValueWithIcon,children:[v.jsx(ud,{}),v.jsx("a",{href:c,target:"_blank",rel:"noopener noreferrer",style:O.addressLink,children:((g=(u=e.customer)==null?void 0:u.address)==null?void 0:g.street_area)||"N/A"})]})]}),v.jsxs("div",{style:O.gridItem,children:[v.jsx("div",{style:O.gridLabel,children:"PERIOD"}),v.jsx("div",{style:O.gridValue,children:t})]}),v.jsxs("div",{style:O.gridItem,children:[v.jsx("div",{style:O.gridLabel,children:"TIME WINDOW"}),v.jsxs("div",{style:O.gridValueWithIcon,children:[v.jsx(So,{})," ",v.jsxs("span",{style:O.direction,children:[tt(e.eta_start)," - ",tt(e.eta_end)]})]})]}),e.completed_at&&v.jsxs("div",{style:O.gridItem,children:[v.jsx("div",{style:O.gridLabel,children:"COMPLETED AT"}),v.jsxs("div",{style:O.gridValueWithIcon,children:[v.jsx(So,{})," ",v.jsx("span",{style:O.direction,children:tt(e.completed_at)})]})]})]}),i&&o&&v.jsx("div",{style:O.extraDataContainer,children:o(e)})]})},vd=({stopGroup:e,index:t,pathType:n,pathPeriod:r,canEditPath:o,isPathCompleted:i,renderStopActions:s,renderOrderExtraData:c})=>{const a=e.status?nt(e.status):e.orders.every(g=>nt(g.status)),[d,p]=D.useState(!a),l=e.status?un(e.status):a?"Completed":"Pending",u=!o||i||a;return v.jsx(Gl,{draggableId:e.stop_id.toString(),index:t,isDragDisabled:u,children:g=>{var h,b;return v.jsxs("div",{ref:g.innerRef,...g.draggableProps,style:{...O.timelineItem,...g.draggableProps.style},children:[v.jsx("div",{style:{...O.bubble,...a?O.bubbleCompleted:O.bubblePending},children:t+1}),v.jsxs("div",{style:O.card,children:[v.jsxs("div",{style:O.cardHeader,children:[v.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[v.jsxs("span",{style:O.title,children:[n," #",e.sequence_rank]}),v.jsx("span",{style:a?O.badgeCompleted:O.badgePending,children:l}),e.completed_at&&v.jsxs("span",{style:{fontSize:"12px",color:"#6b7280"},children:["(",tt(e.completed_at),")"]})]}),v.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[v.jsx("button",{onClick:()=>{a&&p(m=>!m)},children:a&&v.jsx(fd,{})}),!u&&v.jsx("div",{...g.dragHandleProps,children:v.jsx(pd,{})})]})]}),d&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{style:O.customerName,children:["Customer: ",(b=(h=e.orders[0])==null?void 0:h.customer)==null?void 0:b.name]}),v.jsx("div",{style:O.ordersList,children:e.orders.map((m,E)=>v.jsx(bd,{order:m,pathPeriod:r,isFirst:E===0,isDone:nt(m.status),renderOrderExtraData:c},m.id))}),s&&v.jsx("div",{style:O.actionsSlot,children:s(e)})]})]})]})}})},yd=({path:e,onReorder:t,renderStopActions:n,renderOrderExtraData:r,canEditPath:o=!0})=>{const[i,s]=D.useState([]);D.useEffect(()=>{if(e)if(e.stops&&e.stops.length>0){const d=e.stops.map(p=>({stop_id:p.id,sequence_rank:p.sequence_rank,status:p.status,completed_at:p.completed_at,orders:(e.path_orders||[]).filter(l=>l.stop_id===p.id).sort((l,u)=>l.sequence_rank-u.sequence_rank)})).sort((p,l)=>p.sequence_rank-l.sequence_rank);s(d)}else e.path_orders&&s(hd(e.path_orders))},[e]);const c=d=>{if(!d.destination)return;const p=Array.from(i),[l]=p.splice(d.source.index,1);p.splice(d.destination.index,0,l),s(p),t&&t(e.id,p.map(u=>u.stop_id))};if(!e||!i.length)return v.jsx("div",{children:"No Path Data"});const a=nt(e.status);return v.jsx("div",{style:O.container,children:v.jsx(El,{onDragEnd:c,children:v.jsx(dd,{droppableId:"path-list",children:d=>v.jsxs("div",{ref:d.innerRef,...d.droppableProps,style:O.timelineWrapper,children:[v.jsx("div",{style:O.verticalLine}),v.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"24px"},children:i.map((p,l)=>v.jsx(vd,{stopGroup:p,index:l,pathType:un(e.type),pathPeriod:un(e.period),canEditPath:o,isPathCompleted:a,renderStopActions:n,renderOrderExtraData:r},p.stop_id))}),d.placeholder]})})})})},O={container:{fontFamily:"sans-serif",maxWidth:"800px",margin:"0 auto"},timelineWrapper:{position:"relative",padding:"20px 0"},verticalLine:{position:"absolute",right:"19px",top:"40px",bottom:"40px",width:"2px",backgroundColor:"#f3f4f6"},direction:{direction:"ltr"},timelineItem:{display:"flex",gap:"16px",marginBottom:"24px",position:"relative",zIndex:1},bubble:{width:"40px",height:"40px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:"bold",backgroundColor:"#fff",border:"2px solid",flexShrink:0},bubblePending:{borderColor:"#f3f4f6",color:"#9ca3af"},bubbleCompleted:{borderColor:"#dcfce7",color:"#16a34a",backgroundColor:"#f0fdf4"},card:{flex:1,backgroundColor:"#fff",border:"1px solid #f3f4f6",borderRadius:"12px",padding:"16px",boxShadow:"0 1px 3px rgba(0,0,0,0.1)"},cardHeader:{display:"flex",justifyContent:"space-between",marginBottom:"8px",alignItems:"center"},title:{fontSize:"16px",fontWeight:"bold"},badgePending:{fontSize:"11px",padding:"2px 8px",borderRadius:"12px",backgroundColor:"#f3f4f6",color:"#4b5563",fontWeight:"600"},badgeCompleted:{fontSize:"11px",padding:"2px 8px",borderRadius:"12px",backgroundColor:"#dcfce7",color:"#16a34a",fontWeight:"600"},customerName:{fontSize:"14px",color:"#6b7280",marginBottom:"12px"},ordersList:{backgroundColor:"#f9fafb",borderRadius:"8px",overflow:"hidden"},orderBlock:{padding:"12px",transition:"background-color 0.2s"},orderHeader:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"8px"},detailsGrid:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"12px"},gridItem:{display:"flex",flexDirection:"column"},gridLabel:{fontSize:"10px",color:"#9ca3af",fontWeight:"bold"},gridValue:{fontSize:"13px",fontWeight:"600"},gridValueWithIcon:{fontSize:"13px",display:"flex",alignItems:"flex-start",gap:"4px",color:"#374151"},addressLink:{color:"#3b82f6",textDecoration:"underline",wordBreak:"break-word",lineHeight:"1.4"},expandButton:{color:"#fff",border:"none",cursor:"pointer",backgroundColor:"#d1d1d1",borderRadius:"5px",padding:"4px",display:"flex",alignItems:"center",justifyContent:"center"},extraDataContainer:{marginTop:"12px",padding:"12px",borderTop:"1px dashed #e5e7eb",backgroundColor:"#fff",borderRadius:"4px"},actionsSlot:{marginTop:"16px"}};Q.LogisticsDashboard=yd,Object.defineProperty(Q,Symbol.toStringTag,{value:"Module"})});