(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5341],{EZ1R:function(){},YvcI:function(e,t,n){"use strict";n.d(t,{ht:function(){return tabbable}});var i='input:not([inert]),select:not([inert]),textarea:not([inert]),a[href]:not([inert]),button:not([inert]),[tabindex]:not(slot):not([inert]),audio[controls]:not([inert]),video[controls]:not([inert]),[contenteditable]:not([contenteditable="false"]):not([inert]),details>summary:first-of-type:not([inert]),details:not([inert])',o="undefined"==typeof Element,u=o?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,s=!o&&Element.prototype.getRootNode?function(e){var t;return null==e?void 0:null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},isInert=function isInert(e,t){void 0===t&&(t=!0);var n,i=null==e?void 0:null===(n=e.getAttribute)||void 0===n?void 0:n.call(e,"inert");return""===i||"true"===i||t&&e&&isInert(e.parentNode)},isContentEditable=function(e){var t,n=null==e?void 0:null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n},getCandidates=function(e,t,n){if(isInert(e))return[];var o=Array.prototype.slice.apply(e.querySelectorAll(i));return t&&u.call(e,i)&&o.unshift(e),o=o.filter(n)},getCandidatesIteratively=function getCandidatesIteratively(e,t,n){for(var o=[],s=Array.from(e);s.length;){var l=s.shift();if(!isInert(l,!1)){if("SLOT"===l.tagName){var c=l.assignedElements(),d=getCandidatesIteratively(c.length?c:l.children,!0,n);n.flatten?o.push.apply(o,d):o.push({scopeParent:l,candidates:d})}else{u.call(l,i)&&n.filter(l)&&(t||!e.includes(l))&&o.push(l);var f=l.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(l),p=!isInert(f,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(l));if(f&&p){var m=getCandidatesIteratively(!0===f?l.children:f.children,!0,n);n.flatten?o.push.apply(o,m):o.push({scopeParent:l,candidates:m})}else s.unshift.apply(s,l.children)}}}return o},hasTabIndex=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},getTabIndex=function(e){if(!e)throw Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||isContentEditable(e))&&!hasTabIndex(e)?0:e.tabIndex},getSortOrderTabIndex=function(e,t){var n=getTabIndex(e);return n<0&&t&&!hasTabIndex(e)?0:n},sortOrderedTabbables=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},isInput=function(e){return"INPUT"===e.tagName},getCheckedRadio=function(e,t){for(var n=0;nsummary:first-of-type")?e.parentElement:e;if(u.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return isZeroArea(e)}else{if("function"==typeof i){for(var l=e;e;){var c=e.parentElement,d=s(e);if(c&&!c.shadowRoot&&!0===i(c))return isZeroArea(e);e=e.assignedSlot?e.assignedSlot:c||d===e.ownerDocument?c:d.host}e=l}if(isNodeAttached(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},isDisabledFromFieldset=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;ngetTabIndex(t))&&(i=e,!((o=t).disabled||isInert(o)||isInput(o)&&"hidden"===o.type||isHidden(o,i)||"DETAILS"===o.tagName&&Array.prototype.slice.apply(o.children).some(function(e){return"SUMMARY"===e.tagName})||isDisabledFromFieldset(o)))},isValidShadowRootTabbable=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!isNaN(t)||t>=0},sortByOrder=function sortByOrder(e){var t=[],n=[];return e.forEach(function(e,i){var o=!!e.scopeParent,u=o?e.scopeParent:e,s=getSortOrderTabIndex(u,o),l=o?sortByOrder(e.candidates):u;0===s?o?t.push.apply(t,l):t.push(u):n.push({documentOrder:i,tabIndex:s,item:e,isScope:o,content:l})}),n.sort(sortOrderedTabbables).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},tabbable=function(e,t){return sortByOrder((t=t||{}).getShadowRoot?getCandidatesIteratively([e],t.includeContainer,{filter:isNodeMatchingSelectorTabbable.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:isValidShadowRootTabbable}):getCandidates(e,t.includeContainer,isNodeMatchingSelectorTabbable.bind(null,t)))}},"lGx/":function(e){let t=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,words=e=>e.match(t)||[],upperFirst=e=>e[0].toUpperCase()+e.slice(1),join=(e,t)=>words(e).join(t).toLowerCase(),camelCase=e=>words(e).reduce((e,t)=>`${e}${e?t[0].toUpperCase()+t.slice(1).toLowerCase():t.toLowerCase()}`,"");e.exports={words,upperFirst,camelCase,pascalCase:e=>upperFirst(camelCase(e)),snakeCase:e=>join(e,"_"),kebabCase:e=>join(e,"-"),sentenceCase:e=>upperFirst(join(e," ")),titleCase:e=>words(e).map(upperFirst).join(" ")}},r5xO:function(e){function toposort(e,t){var n=e.length,i=Array(n),o={},u=n,s=function(e){for(var t=new Map,n=0,i=e.length;nc);return is.undefined(i)||(d=d&&c===i),is.undefined(u)||(d=d&&l===u),d}function compareValues(e,t,n){var o,u=n.key,s=n.type,l=n.value,c=nested(e,u),d=nested(t,u),f="added"===s?c:d,p="added"===s?d:c;return is.nullOrUndefined(l)?[c,d].every(is.array)?!p.every(isEqualPredicate(f)):[c,d].every(is.plainObject)?(o=Object.keys(f),Object.keys(p).some(function(e){return!o.includes(e)})):![c,d].every(function(e){return is.primitive(e)&&is.defined(e)})&&("added"===s?!is.defined(c)&&is.defined(d):is.defined(c)&&!is.defined(d)):is.defined(f)?!!(is.array(f)||is.plainObject(f))&&!!isSameType(f,p)&&([f,p].every(is.array)?!f.some(hasValue(l))&&p.some(hasValue(l)):[f,p].every(is.plainObject)?!Object.entries(f).some(hasEntry(l))&&Object.entries(p).some(hasEntry(l)):p===l):(0,i.Z)(p,l)}function getIterables(e,t,n){var i=(void 0===n?{}:n).key,o=nested(e,i),u=nested(t,i);if(!isSameType(o,u))throw TypeError("Inputs have different types");if(!function(){for(var e=[],t=0;t0&&!Number.isNaN(Number(e))},is.object=function(e){return!is.nullOrUndefined(e)&&(is.function(e)||"object"==typeof e)},is.oneOf=function(e,t){return!!is.array(e)&&e.indexOf(t)>-1},is.plainFunction=isObjectOfType("Function"),is.plainObject=function(e){if("Object"!==getObjectType(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.getPrototypeOf({})},is.primitive=function(e){var t;return is.null(e)||(t=typeof e,s.includes(t))},is.promise=isObjectOfType("Promise"),is.propertyOf=function(e,t,n){if(!is.object(e)||!t)return!1;var i=e[t];return is.function(n)?n(i):is.defined(i)},is.regexp=isObjectOfType("RegExp"),is.set=isObjectOfType("Set"),is.string=isOfType("string"),is.symbol=isOfType("symbol"),is.undefined=isOfType("undefined"),is.weakMap=isObjectOfType("WeakMap"),is.weakSet=isObjectOfType("WeakSet")},DDpl:function(e,t,n){"use strict";n.d(t,{q:function(){return useMergeRefs}});var i=n("q1tI");function useMergeRefs(e,t){var n,o,u;return n=t||null,o=function(t){return e.forEach(function(e){return"function"==typeof e?e(t):e&&(e.current=t),e})},(u=(0,i.useState)(function(){return{value:n,callback:o,facade:{get current(){return u.value},set current(value){var e=u.value;e!==value&&(u.value=value,u.callback(value,e))}}}})[0]).callback=o,u.facade}},"Wi+2":function(e,t,n){"use strict";var i=n("q1tI"),updateRef=function(e,t){if("function"==typeof e){e(t);return}e.current=t};t.Z=function(e,t){var n=(0,i.useRef)();return(0,i.useCallback)(function(i){e.current=i,n.current&&updateRef(n.current,null),n.current=t,t&&updateRef(t,i)},[t])}},uMYp:function(e,t,n){"use strict";n.d(t,{Z:function(){return useLatest}});var i=n("q1tI"),o=i.useLayoutEffect,useLatest=function(e){var t=i.useRef(e);return o(function(){t.current=e}),t}},"uA/v":function(e,t,n){"use strict";n.d(t,{L:function(){return exportSidecar}});var i=n("Istr"),o=n("q1tI"),SideCar=function(e){var t=e.sideCar,n=(0,i._T)(e,["sideCar"]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var u=t.read();if(!u)throw Error("Sidecar medium not found");return o.createElement(u,(0,i.pi)({},n))};function exportSidecar(e,t){return e.useMedium(t),SideCar}SideCar.isSideCarExport=!0},"+8i8":function(e,t,n){"use strict";n.d(t,{_:function(){return createSidecarMedium}});var i=n("Istr");function ItoI(e){return e}function createSidecarMedium(e){void 0===e&&(e={});var t,n,o,u=(void 0===t&&(t=ItoI),n=[],o=!1,{read:function(){if(o)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:null},useMedium:function(e){var i=t(e,o);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(o=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){o=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var executeQueue=function(){var n=t;t=[],n.forEach(e)},cycle=function(){return Promise.resolve().then(executeQueue)};cycle(),n={push:function(e){t.push(e),cycle()},filter:function(e){return t=t.filter(e),n}}}});return u.options=(0,i.pi)({async:!0,ssr:!1},e),u}},lKJe:function(e,t,n){"use strict";/** * @license React * use-sync-external-store-shim.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var i=n("q1tI"),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},u=i.useState,s=i.useEffect,l=i.useLayoutEffect,c=i.useDebugValue;function r(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}var d="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),i=u({inst:{value:n,getSnapshot:t}}),o=i[0].inst,d=i[1];return l(function(){o.value=n,o.getSnapshot=t,r(o)&&d({inst:o})},[e,n,t]),s(function(){return r(o)&&d({inst:o}),e(function(){r(o)&&d({inst:o})})},[e]),c(n),n};t.useSyncExternalStore=void 0!==i.useSyncExternalStore?i.useSyncExternalStore:d},AB4A:function(e,t,n){"use strict";/** * @license React * use-sync-external-store-shim/with-selector.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var i=n("q1tI"),o=n("at8e"),u="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=o.useSyncExternalStore,l=i.useRef,c=i.useEffect,d=i.useMemo,f=i.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,i,o){var p=l(null);if(null===p.current){var m={hasValue:!1,value:null};p.current=m}else m=p.current;var v=s(e,(p=d(function(){function a(t){if(!l){if(l=!0,e=t,t=i(t),void 0!==o&&m.hasValue){var n=m.value;if(o(n,t))return s=n}return s=t}if(n=s,u(e,t))return n;var c=i(t);return void 0!==o&&o(n,c)?n:(e=t,s=c)}var e,s,l=!1,c=void 0===n?null:n;return[function(){return a(t())},null===c?void 0:function(){return a(c())}]},[t,n,i,o]))[0],p[1]);return c(function(){m.hasValue=!0,m.value=v},[v]),f(v),v}},at8e:function(e,t,n){"use strict";e.exports=n("lKJe")},ejks:function(e,t,n){"use strict";e.exports=n("AB4A")},WM9j:function(e,t,n){"use strict";for(var i=n("b/2l"),o=[],u=0;u<256;++u)o.push((u+256).toString(16).substr(1));t.Z=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(o[e[t+0]]+o[e[t+1]]+o[e[t+2]]+o[e[t+3]]+"-"+o[e[t+4]]+o[e[t+5]]+"-"+o[e[t+6]]+o[e[t+7]]+"-"+o[e[t+8]]+o[e[t+9]]+"-"+o[e[t+10]]+o[e[t+11]]+o[e[t+12]]+o[e[t+13]]+o[e[t+14]]+o[e[t+15]]).toLowerCase();if(!(0,i.Z)(n))throw TypeError("Stringified UUID is invalid");return n}},Q6jF:function(e,t,n){"use strict";n.d(t,{Z:function(){return esm_browser_v4}});var i,o=new Uint8Array(16),u=n("WM9j"),esm_browser_v4=function(e,t,n){var s=(e=e||{}).random||(e.rng||function(){if(!i&&!(i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return i(o)})();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t){n=n||0;for(var l=0;l<16;++l)t[n+l]=s[l];return t}return(0,u.Z)(s)}},VB12:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var i=n("WM9j"),o=n("b/2l"),esm_browser_parse=function(e){if(!(0,o.Z)(e))throw TypeError("Invalid UUID");var t,n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n};function ROTL(e,t){return e<>>32-t}var u=function(e,t,n){function generateUUID(e,t,o,u){if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));for(var t=[],n=0;n>>0;w=b,b=g,g=ROTL(y,30)>>>0,y=h,h=E}n[0]=n[0]+h>>>0,n[1]=n[1]+y>>>0,n[2]=n[2]+g>>>0,n[3]=n[3]+b>>>0,n[4]=n[4]+w>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]})},"b/2l":function(e,t,n){"use strict";n.d(t,{Z:function(){return esm_browser_validate}});var i=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,esm_browser_validate=function(e){return"string"==typeof e&&i.test(e)}},DLHL:function(e,t,n){"use strict";function _interop_require_default(e){return e&&e.__esModule?e:{default:e}}n.r(t),n.d(t,{_:function(){return _interop_require_default},_interop_require_default:function(){return _interop_require_default}})},"9iJc":function(e,t,n){"use strict";function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(_getRequireWildcardCache=function(e){return e?n:t})(e)}function _interop_require_wildcard(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=_getRequireWildcardCache(t);if(n&&n.has(e))return n.get(e);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var s=o?Object.getOwnPropertyDescriptor(e,u):null;s&&(s.get||s.set)?Object.defineProperty(i,u,s):i[u]=e[u]}return i.default=e,n&&n.set(e,i),i}n.r(t),n.d(t,{_:function(){return _interop_require_wildcard},_interop_require_wildcard:function(){return _interop_require_wildcard}})},"1R4W":function(e,t,n){"use strict";function _tagged_template_literal(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}n.d(t,{_:function(){return _tagged_template_literal}})},Istr:function(e,t,n){"use strict";n.d(t,{CR:function(){return __read},XA:function(){return __values},ZT:function(){return __extends},_T:function(){return __rest},ev:function(){return __spreadArray},pi:function(){return __assign}});var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function __extends(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}var __assign=function(){return(__assign=Object.assign||function(e){for(var t,n=1,i=arguments.length;nt.indexOf(i)&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,i=Object.getOwnPropertySymbols(e);ot.indexOf(i[o])&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]]);return n}function __values(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function __read(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,u=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(i=u.next()).done;)s.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=u.return)&&n.call(u)}finally{if(o)throw o.error}}return s}function __spreadArray(e,t,n){if(n||2==arguments.length)for(var i,o=0,u=t.length;o{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),useDrawerContext=()=>{let e=u.useContext(s);if(!e)throw Error("useDrawerContext must be used within a Drawer.Root");return e};function isSafari(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function isIOS(){return testPlatform(/^iPhone/)||testPlatform(/^iPad/)||testPlatform(/^Mac/)&&navigator.maxTouchPoints>1}function testPlatform(e){return"undefined"!=typeof window&&null!=window.navigator?e.test(window.navigator.platform):void 0}!function(e){if(!e||"undefined"==typeof document)return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}("[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(\n[data-state=closed]\n){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}");let l="undefined"!=typeof window?u.useLayoutEffect:u.useEffect;function chain$1(...e){return(...t)=>{for(let n of e)"function"==typeof n&&n(...t)}}let c="undefined"!=typeof document&&window.visualViewport;function isScrollable(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function getScrollParent(e){for(isScrollable(e)&&(e=e.parentElement);e&&!isScrollable(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}let d=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]),f=0;function addEvent(e,t,n,i){return e.addEventListener(t,n,i),()=>{e.removeEventListener(t,n,i)}}function scrollIntoView(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let t=getScrollParent(e);if(t!==document.documentElement&&t!==document.body&&t!==e){let n=t.getBoundingClientRect().top,i=e.getBoundingClientRect().top,o=e.getBoundingClientRect().bottom,u=t.getBoundingClientRect().bottom+24;o>u&&(t.scrollTop+=i-n)}e=t.parentElement}}function isInput(e){return e instanceof HTMLInputElement&&!d.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function useComposedRefs(...e){return u.useCallback(function(...e){return t=>e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}(...e),e)}let p=new WeakMap;function set(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let i={};Object.entries(t).forEach(([t,n])=>{if(t.startsWith("--")){e.style.setProperty(t,n);return}i[t]=e.style[t],e.style[t]=n}),n||p.set(e,i)}let isVertical=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function getTranslate(e,t){if(!e)return null;let n=window.getComputedStyle(e),i=n.transform||n.webkitTransform||n.mozTransform,o=i.match(/^matrix3d\((.+)\)$/);return o?parseFloat(o[1].split(", ")[isVertical(t)?13:12]):(o=i.match(/^matrix\((.+)\)$/))?parseFloat(o[1].split(", ")[isVertical(t)?5:4]):null}function assignStyle(e,t){if(!e)return()=>{};let n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}let m={DURATION:.5,EASE:[.32,.72,0,1]},v="vaul-dragging";function useCallbackRef(e){let t=u.useRef(e);return u.useEffect(()=>{t.current=e}),u.useMemo(()=>(...e)=>null==t.current?void 0:t.current.call(t,...e),[])}function useControllableState({prop:e,defaultProp:t,onChange:n=()=>{}}){let[i,o]=function({defaultProp:e,onChange:t}){let n=u.useState(e),[i]=n,o=u.useRef(i),s=useCallbackRef(t);return u.useEffect(()=>{o.current!==i&&(s(i),o.current=i)},[i,o,s]),n}({defaultProp:t,onChange:n}),s=void 0!==e,l=s?e:i,c=useCallbackRef(n),d=u.useCallback(t=>{if(s){let n="function"==typeof t?t(e):t;n!==e&&c(n)}else o(t)},[s,e,o,c]);return[l,d]}let noop=()=>()=>{},h=null;function Root({open:e,onOpenChange:t,children:n,onDrag:d,onRelease:y,snapPoints:g,shouldScaleBackground:b=!1,setBackgroundColorOnScale:w=!0,closeThreshold:x=.25,scrollLockTimeout:O=100,dismissible:E=!0,handleOnly:S=!1,fadeFromIndex:T=g&&g.length-1,activeSnapPoint:R,setActiveSnapPoint:C,fixed:I,modal:D=!0,onClose:A,nested:_,noBodyStyles:j=!1,direction:M="bottom",defaultOpen:k=!1,disablePreventScroll:P=!0,snapToSequentialPoint:N=!1,preventScrollRestoration:$=!1,repositionInputs:V=!0,onAnimationEnd:F,container:U,autoFocus:L=!1}){var q,B;let[W=!1,Z]=useControllableState({defaultProp:k,prop:e,onChange:e=>{null==t||t(e),e||_||eO(),setTimeout(()=>{null==F||F(e)},1e3*m.DURATION),e&&!D&&"undefined"!=typeof window&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),e||(document.body.style.pointerEvents="auto")}}),[z,H]=u.useState(!1),[Y,G]=u.useState(!1),[X,J]=u.useState(!1),Q=u.useRef(null),K=u.useRef(null),ee=u.useRef(null),et=u.useRef(null),en=u.useRef(null),er=u.useRef(!1),ea=u.useRef(null),ei=u.useRef(0),eo=u.useRef(!1),eu=u.useRef(!k),es=u.useRef(0),el=u.useRef(null),ec=u.useRef((null==(q=el.current)?void 0:q.getBoundingClientRect().height)||0),ed=u.useRef((null==(B=el.current)?void 0:B.getBoundingClientRect().width)||0),ef=u.useRef(0),ep=u.useCallback(e=>{g&&e===eg.length-1&&(K.current=new Date)},[]),{activeSnapPoint:em,activeSnapPointIndex:ev,setActiveSnapPoint:eh,onRelease:ey,snapPointsOffset:eg,onDrag:eb,shouldFade:ew,getPercentageDragged:ex}=function({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:i,overlayRef:o,fadeFromIndex:s,onSnapPointChange:l,direction:c="bottom",container:d,snapToSequentialPoint:f}){let[p,v]=useControllableState({prop:e,defaultProp:null==n?void 0:n[0],onChange:t}),[h,y]=u.useState("undefined"!=typeof window?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);u.useEffect(()=>{function onResize(){y({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",onResize),()=>window.removeEventListener("resize",onResize)},[]);let g=u.useMemo(()=>p===(null==n?void 0:n[n.length-1])||null,[n,p]),b=u.useMemo(()=>{var e;return null!=(e=null==n?void 0:n.findIndex(e=>e===p))?e:null},[n,p]),w=n&&n.length>0&&(s||0===s)&&!Number.isNaN(s)&&n[s]===p||!n,x=u.useMemo(()=>{var e;let t=d?{width:d.getBoundingClientRect().width,height:d.getBoundingClientRect().height}:"undefined"!=typeof window?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};return null!=(e=null==n?void 0:n.map(e=>{let n="string"==typeof e,i=0;if(n&&(i=parseInt(e,10)),isVertical(c)){let o=n?i:h?e*t.height:0;return h?"bottom"===c?t.height-o:-t.height+o:o}let o=n?i:h?e*t.width:0;return h?"right"===c?t.width-o:-t.width+o:o}))?e:[]},[n,h,d]),O=u.useMemo(()=>null!==b?null==x?void 0:x[b]:null,[x,b]),E=u.useCallback(e=>{var t;let u=null!=(t=null==x?void 0:x.findIndex(t=>t===e))?t:null;l(u),set(i.current,{transition:`transform ${m.DURATION}s cubic-bezier(${m.EASE.join(",")})`,transform:isVertical(c)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`}),x&&u!==x.length-1&&void 0!==s&&u!==s&&u{if(p||e){var t;let i=null!=(t=null==n?void 0:n.findIndex(t=>t===e||t===p))?t:-1;x&&-1!==i&&"number"==typeof x[i]&&E(x[i])}},[p,e,n,x,E]),{isLastSnapPoint:g,activeSnapPoint:p,shouldFade:w,getPercentageDragged:function(e,t){if(!n||"number"!=typeof b||!x||void 0===s)return null;let i=b===s-1,o=b>=s;if(o&&t)return 0;if(i&&!t)return 1;if(!w&&!i)return null;let u=i?b+1:b-1,l=i?x[u]-x[u-1]:x[u+1]-x[u],c=e/Math.abs(l);return i?1-c:c},setActiveSnapPoint:v,activeSnapPointIndex:b,onRelease:function({draggedDistance:e,closeDrawer:t,velocity:i,dismissible:u}){if(void 0===s)return;let l="bottom"===c||"right"===c?(null!=O?O:0)-e:(null!=O?O:0)+e,d=b===s-1,p=0===b,v=e>0;if(d&&set(o.current,{transition:`opacity ${m.DURATION}s cubic-bezier(${m.EASE.join(",")})`}),!f&&i>2&&!v){u?t():E(x[0]);return}if(!f&&i>2&&v&&x&&n){E(x[n.length-1]);return}let h=null==x?void 0:x.reduce((e,t)=>"number"!=typeof e||"number"!=typeof t?e:Math.abs(t-l).4&&Math.abs(e)<.4*y){let e=v?1:-1;if(e>0&&g&&n){E(x[n.length-1]);return}if(p&&e<0&&u&&t(),null===b)return;E(x[b+e]);return}E(h)},onDrag:function({draggedDistance:e}){if(null===O)return;let t="bottom"===c||"right"===c?O-e:O+e;("bottom"===c||"right"===c)&&tx[x.length-1]||set(i.current,{transform:isVertical(c)?`translate3d(0, ${t}px, 0)`:`translate3d(${t}px, 0, 0)`})},snapPointsOffset:x}}({snapPoints:g,activeSnapPointProp:R,setActiveSnapPointProp:C,drawerRef:el,fadeFromIndex:T,overlayRef:Q,onSnapPointChange:ep,direction:M,container:U,snapToSequentialPoint:N});!function(e={}){let{isDisabled:t}=e;l(()=>{if(!t){var e,n,o;let t,u,s,l,d,p,m;return 1==++f&&isIOS()&&(s=0,l=window.pageXOffset,d=window.pageYOffset,p=chain$1((e=document.documentElement,n="paddingRight",o=`${window.innerWidth-document.documentElement.clientWidth}px`,u=e.style[n],e.style[n]=o,()=>{e.style[n]=u})),window.scrollTo(0,0),m=chain$1(addEvent(document,"touchstart",e=>{((t=getScrollParent(e.target))!==document.documentElement||t!==document.body)&&(s=e.changedTouches[0].pageY)},{passive:!1,capture:!0}),addEvent(document,"touchmove",e=>{if(!t||t===document.documentElement||t===document.body){e.preventDefault();return}let n=e.changedTouches[0].pageY,i=t.scrollTop,o=t.scrollHeight-t.clientHeight;0!==o&&((i<=0&&n>s||i>=o&&n{let t=e.target;isInput(t)&&t!==document.activeElement&&(e.preventDefault(),t.style.transform="translateY(-2000px)",t.focus(),requestAnimationFrame(()=>{t.style.transform=""}))},{passive:!1,capture:!0}),addEvent(document,"focus",e=>{let t=e.target;isInput(t)&&(t.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{t.style.transform="",c&&(c.height{scrollIntoView(t)}):c.addEventListener("resize",()=>scrollIntoView(t),{once:!0}))}))},!0),addEvent(window,"scroll",()=>{window.scrollTo(0,0)})),i=()=>{p(),m(),window.scrollTo(l,d)}),()=>{0==--f&&(null==i||i())}}},[t])}({isDisabled:!W||Y||!D||X||!z||!V||!P});let{restorePositionSetting:eO}=function({isOpen:e,modal:t,nested:n,hasBeenOpened:i,preventScrollRestoration:o,noBodyStyles:s}){let[l,c]=u.useState(()=>"undefined"!=typeof window?window.location.href:""),d=u.useRef(0),f=u.useCallback(()=>{if(isSafari()&&null===h&&e&&!s){h={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};let{scrollX:e,innerHeight:t}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-d.current}px`,left:`${-e}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{let e=t-window.innerHeight;e&&d.current>=t&&(document.body.style.top=`${-(d.current+e)}px`)}),300)}},[e]),p=u.useCallback(()=>{if(isSafari()&&null!==h&&!s){let e=-parseInt(document.body.style.top,10),t=-parseInt(document.body.style.left,10);Object.assign(document.body.style,h),window.requestAnimationFrame(()=>{if(o&&l!==window.location.href){c(window.location.href);return}window.scrollTo(t,e)}),h=null}},[l]);return u.useEffect(()=>{function onScroll(){d.current=window.scrollY}return onScroll(),window.addEventListener("scroll",onScroll),()=>{window.removeEventListener("scroll",onScroll)}},[]),u.useEffect(()=>{if(t)return()=>{if("undefined"==typeof document)return;let e=!!document.querySelector("[data-vaul-drawer]");e||p()}},[t,p]),u.useEffect(()=>{if(!n&&i){if(e){let e=window.matchMedia("(display-mode: standalone)").matches;e||f(),t||window.setTimeout(()=>{p()},500)}else p()}},[e,i,l,t,n,f,p]),{restorePositionSetting:p}}({isOpen:W,modal:D,nested:null!=_&&_,hasBeenOpened:z,preventScrollRestoration:$,noBodyStyles:j});function getScale(){return(window.innerWidth-26)/window.innerWidth}function shouldDrag(e,t){var n;let i=e,o=null==(n=window.getSelection())?void 0:n.toString(),u=el.current?getTranslate(el.current,M):null,s=new Date;if("SELECT"===i.tagName||i.hasAttribute("data-vaul-no-drag")||i.closest("[data-vaul-no-drag]"))return!1;if("right"===M||"left"===M)return!0;if(K.current&&s.getTime()-K.current.getTime()<500)return!1;if(null!==u&&("bottom"===M?u>0:u<0))return!0;if(o&&o.length>0)return!1;if(en.current&&s.getTime()-en.current.getTime()i.clientHeight){if(0!==i.scrollTop)return en.current=new Date,!1;if("dialog"===i.getAttribute("role"))break}i=i.parentNode}return!0}function closeDrawer(e){Y&&el.current&&(el.current.classList.remove(v),er.current=!1,G(!1),et.current=new Date),null==A||A(),e||Z(!1),setTimeout(()=>{g&&eh(g[0])},1e3*m.DURATION)}function resetDrawer(){if(!el.current)return;let e=document.querySelector("[data-vaul-drawer-wrapper]"),t=getTranslate(el.current,M);set(el.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${m.DURATION}s cubic-bezier(${m.EASE.join(",")})`}),set(Q.current,{transition:`opacity ${m.DURATION}s cubic-bezier(${m.EASE.join(",")})`,opacity:"1"}),b&&t&&t>0&&W&&set(e,{borderRadius:"8px",overflow:"hidden",...isVertical(M)?{transform:`scale(${getScale()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${getScale()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${m.DURATION}s`,transitionTimingFunction:`cubic-bezier(${m.EASE.join(",")})`},!0)}return u.useEffect(()=>{window.requestAnimationFrame(()=>{eu.current=!0})},[]),u.useEffect(()=>{var e;function onVisualViewportChange(){if(!el.current||!V)return;let e=document.activeElement;if(isInput(e)||eo.current){var t;let e=(null==(t=window.visualViewport)?void 0:t.height)||0,n=window.innerHeight,i=n-e,o=el.current.getBoundingClientRect().height||0;ef.current||(ef.current=o);let u=el.current.getBoundingClientRect().top;if(Math.abs(es.current-i)>60&&(eo.current=!eo.current),g&&g.length>0&&eg&&ev){let e=eg[ev]||0;i+=e}if(es.current=i,o>e||eo.current){let t=el.current.getBoundingClientRect().height,s=t;t>e&&(s=e-(o>.8*n?u:26)),I?el.current.style.height=`${t-Math.max(i,0)}px`:el.current.style.height=`${Math.max(s,e-u)}px`}else!function(){let e=navigator.userAgent;return"undefined"!=typeof window&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}()&&(el.current.style.height=`${ef.current}px`);g&&g.length>0&&!eo.current?el.current.style.bottom="0px":el.current.style.bottom=`${Math.max(i,0)}px`}}return null==(e=window.visualViewport)||e.addEventListener("resize",onVisualViewportChange),()=>{var e;return null==(e=window.visualViewport)?void 0:e.removeEventListener("resize",onVisualViewportChange)}},[ev,g,eg]),u.useEffect(()=>(W&&(set(document.documentElement,{scrollBehavior:"auto"}),K.current=new Date),()=>{!function(e,t){if(!e||!(e instanceof HTMLElement))return;let n=p.get(e);n&&(e.style[t]=n[t])}(document.documentElement,"scrollBehavior")}),[W]),u.useEffect(()=>{D||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[D]),u.createElement(o.fC,{defaultOpen:k,onOpenChange:e=>{(E||e)&&(e?H(!0):closeDrawer(!0),Z(e))},open:W},u.createElement(s.Provider,{value:{activeSnapPoint:em,snapPoints:g,setActiveSnapPoint:eh,drawerRef:el,overlayRef:Q,onOpenChange:t,onPress:function(e){var t,n;(E||g)&&(!el.current||el.current.contains(e.target))&&(ec.current=(null==(t=el.current)?void 0:t.getBoundingClientRect().height)||0,ed.current=(null==(n=el.current)?void 0:n.getBoundingClientRect().width)||0,G(!0),ee.current=new Date,isIOS()&&window.addEventListener("touchend",()=>er.current=!1,{once:!0}),e.target.setPointerCapture(e.pointerId),ei.current=isVertical(M)?e.pageY:e.pageX)},onRelease:function(e){var t,n;if(!Y||!el.current)return;el.current.classList.remove(v),er.current=!1,G(!1),et.current=new Date;let i=getTranslate(el.current,M);if(!e||!shouldDrag(e.target,!1)||!i||Number.isNaN(i)||null===ee.current)return;let o=et.current.getTime()-ee.current.getTime(),u=ei.current-(isVertical(M)?e.pageY:e.pageX),s=Math.abs(u)/o;if(s>.05&&(J(!0),setTimeout(()=>{J(!1)},200)),g){let t="bottom"===M||"right"===M?1:-1;ey({draggedDistance:u*t,closeDrawer,velocity:s,dismissible:E}),null==y||y(e,!0);return}if("bottom"===M||"right"===M?u>0:u<0){resetDrawer(),null==y||y(e,!0);return}if(s>.4){closeDrawer(),null==y||y(e,!1);return}let l=Math.min(null!=(t=el.current.getBoundingClientRect().height)?t:0,window.innerHeight),c=Math.min(null!=(n=el.current.getBoundingClientRect().width)?n:0,window.innerWidth),d="left"===M||"right"===M;if(Math.abs(i)>=(d?c:l)*x){closeDrawer(),null==y||y(e,!1);return}null==y||y(e,!0),resetDrawer()},onDrag:function(e){if(el.current&&Y){let t="bottom"===M||"right"===M?1:-1,n=(ei.current-(isVertical(M)?e.pageY:e.pageX))*t,i=n>0,o=g&&!E&&!i;if(o&&0===ev)return;let u=Math.abs(n),s=document.querySelector("[data-vaul-drawer-wrapper]"),l="bottom"===M||"top"===M?ec.current:ed.current,c=u/l,f=ex(u,i);if(null!==f&&(c=f),o&&c>=1||!er.current&&!shouldDrag(e.target,i))return;if(el.current.classList.add(v),er.current=!0,set(el.current,{transition:"none"}),set(Q.current,{transition:"none"}),g&&eb({draggedDistance:n}),i&&!g){let e=8*(Math.log(n+1)-2),i=Math.min(-1*e,0)*t;set(el.current,{transform:isVertical(M)?`translate3d(0, ${i}px, 0)`:`translate3d(${i}px, 0, 0)`});return}let p=1-c;if((ew||T&&ev===T-1)&&(null==d||d(e,c),set(Q.current,{opacity:`${p}`,transition:"none"},!0)),s&&Q.current&&b){let e=Math.min(getScale()+c*(1-getScale()),1),t=8-8*c,n=Math.max(0,14-14*c);set(s,{borderRadius:`${t}px`,transform:isVertical(M)?`scale(${e}) translate3d(0, ${n}px, 0)`:`scale(${e}) translate3d(${n}px, 0, 0)`,transition:"none"},!0)}if(!g){let e=u*t;set(el.current,{transform:isVertical(M)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})}}},dismissible:E,shouldAnimate:eu,handleOnly:S,isOpen:W,isDragging:Y,shouldFade:ew,closeDrawer,onNestedDrag:function(e,t){if(t<0)return;let n=(window.innerWidth-16)/window.innerWidth,i=n+t*(1-n),o=-16+16*t;set(el.current,{transform:isVertical(M)?`scale(${i}) translate3d(0, ${o}px, 0)`:`scale(${i}) translate3d(${o}px, 0, 0)`,transition:"none"})},onNestedOpenChange:function(e){let t=e?(window.innerWidth-16)/window.innerWidth:1,n=e?-16:0;ea.current&&window.clearTimeout(ea.current),set(el.current,{transition:`transform ${m.DURATION}s cubic-bezier(${m.EASE.join(",")})`,transform:isVertical(M)?`scale(${t}) translate3d(0, ${n}px, 0)`:`scale(${t}) translate3d(${n}, 0, 0)`}),!e&&el.current&&(ea.current=setTimeout(()=>{let e=getTranslate(el.current,M);set(el.current,{transition:"none",transform:isVertical(M)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})},500))},onNestedRelease:function(e,t){let n=isVertical(M)?window.innerHeight:window.innerWidth,i=t?(n-16)/n:1,o=t?-16:0;t&&set(el.current,{transition:`transform ${m.DURATION}s cubic-bezier(${m.EASE.join(",")})`,transform:isVertical(M)?`scale(${i}) translate3d(0, ${o}px, 0)`:`scale(${i}) translate3d(${o}px, 0, 0)`})},keyboardIsOpen:eo,modal:D,snapPointsOffset:eg,activeSnapPointIndex:ev,direction:M,shouldScaleBackground:b,setBackgroundColorOnScale:w,noBodyStyles:j,container:U,autoFocus:L}},n))}let y=u.forwardRef(function({...e},t){let{overlayRef:n,snapPoints:i,onRelease:s,shouldFade:l,isOpen:c,modal:d,shouldAnimate:f}=useDrawerContext(),p=useComposedRefs(t,n),m=i&&i.length>0;if(!d)return null;let v=u.useCallback(e=>s(e),[s]);return u.createElement(o.aV,{onMouseUp:v,ref:p,"data-vaul-overlay":"","data-vaul-snap-points":c&&m?"true":"false","data-vaul-snap-points-overlay":c&&l?"true":"false","data-vaul-animate":(null==f?void 0:f.current)?"true":"false",...e})});y.displayName="Drawer.Overlay";let g=u.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...i},s){let{drawerRef:l,onPress:c,onRelease:d,onDrag:f,keyboardIsOpen:p,snapPointsOffset:v,activeSnapPointIndex:h,modal:y,isOpen:g,direction:b,snapPoints:w,container:x,handleOnly:O,shouldAnimate:E,autoFocus:S}=useDrawerContext(),[T,R]=u.useState(!1),C=useComposedRefs(s,l),I=u.useRef(null),D=u.useRef(null),A=u.useRef(!1),_=w&&w.length>0;!function(){let{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:i,noBodyStyles:o}=useDrawerContext(),s=u.useRef(null),l=(0,u.useMemo)(()=>document.body.style.backgroundColor,[]);function getScale(){return(window.innerWidth-26)/window.innerWidth}u.useEffect(()=>{if(t&&n){s.current&&clearTimeout(s.current);let t=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!t)return;!function(...e){}(i&&!o?assignStyle(document.body,{background:"black"}):noop,assignStyle(t,{transformOrigin:isVertical(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${m.DURATION}s`,transitionTimingFunction:`cubic-bezier(${m.EASE.join(",")})`}));let n=assignStyle(t,{borderRadius:"8px",overflow:"hidden",...isVertical(e)?{transform:`scale(${getScale()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${getScale()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{n(),s.current=window.setTimeout(()=>{l?document.body.style.background=l:document.body.style.removeProperty("background")},1e3*m.DURATION)}}},[t,n,l])}();let isDeltaInDirection=(e,t,n=0)=>{if(A.current)return!0;let i=Math.abs(e.y),o=Math.abs(e.x),u=o>i,s=["bottom","right"].includes(t)?1:-1;if("left"===t||"right"===t){let t=e.x*s<0;if(!t&&o>=0&&o<=n)return u}else{let t=e.y*s<0;if(!t&&i>=0&&i<=n)return!u}return A.current=!0,!0};function handleOnPointerUp(e){I.current=null,A.current=!1,d(e)}return u.useEffect(()=>{_&&window.requestAnimationFrame(()=>{R(!0)})},[]),u.createElement(o.VY,{"data-vaul-drawer-direction":b,"data-vaul-drawer":"","data-vaul-delayed-snap-points":T?"true":"false","data-vaul-snap-points":g&&_?"true":"false","data-vaul-custom-container":x?"true":"false","data-vaul-animate":(null==E?void 0:E.current)?"true":"false",...i,ref:C,style:v&&v.length>0?{"--snap-point-height":`${v[null!=h?h:0]}px`,...t}:t,onPointerDown:e=>{O||(null==i.onPointerDown||i.onPointerDown.call(i,e),I.current={x:e.pageX,y:e.pageY},c(e))},onOpenAutoFocus:e=>{null==n||n(e),S||e.preventDefault()},onPointerDownOutside:t=>{if(null==e||e(t),!y||t.defaultPrevented){t.preventDefault();return}p.current&&(p.current=!1)},onFocusOutside:e=>{if(!y){e.preventDefault();return}},onPointerMove:e=>{if(D.current=e,O||(null==i.onPointerMove||i.onPointerMove.call(i,e),!I.current))return;let t=e.pageY-I.current.y,n=e.pageX-I.current.x,o="touch"===e.pointerType?10:2,u=isDeltaInDirection({x:n,y:t},b,o);u?f(e):(Math.abs(n)>o||Math.abs(t)>o)&&(I.current=null)},onPointerUp:e=>{null==i.onPointerUp||i.onPointerUp.call(i,e),I.current=null,A.current=!1,d(e)},onPointerOut:e=>{null==i.onPointerOut||i.onPointerOut.call(i,e),handleOnPointerUp(D.current)},onContextMenu:e=>{null==i.onContextMenu||i.onContextMenu.call(i,e),D.current&&handleOnPointerUp(D.current)}})});g.displayName="Drawer.Content";let b=u.forwardRef(function({preventCycle:e=!1,children:t,...n},i){let{closeDrawer:o,isDragging:s,snapPoints:l,activeSnapPoint:c,setActiveSnapPoint:d,dismissible:f,handleOnly:p,isOpen:m,onPress:v,onDrag:h}=useDrawerContext(),y=u.useRef(null),g=u.useRef(!1);function handleCancelInteraction(){y.current&&window.clearTimeout(y.current),g.current=!1}return u.createElement("div",{onClick:function(){if(g.current){handleCancelInteraction();return}window.setTimeout(()=>{!function(){if(s||e||g.current){handleCancelInteraction();return}if(handleCancelInteraction(),!l||0===l.length){f||o();return}let t=c===l[l.length-1];if(t&&f){o();return}let n=l.findIndex(e=>e===c);if(-1===n)return;let i=l[n+1];d(i)}()},120)},onPointerCancel:handleCancelInteraction,onPointerDown:e=>{p&&v(e),y.current=window.setTimeout(()=>{g.current=!0},250)},onPointerMove:e=>{p&&h(e)},ref:i,"data-vaul-drawer-visible":m?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},u.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});b.displayName="Drawer.Handle";let w={Root,NestedRoot:function({onDrag:e,onOpenChange:t,...n}){let{onNestedDrag:i,onNestedOpenChange:o,onNestedRelease:s}=useDrawerContext();if(!i)throw Error("Drawer.NestedRoot must be placed in another drawer");return u.createElement(Root,{nested:!0,onClose:()=>{o(!1)},onDrag:(t,n)=>{i(t,n),null==e||e(t,n)},onOpenChange:e=>{e&&o(e)},onRelease:s,...n})},Content:g,Overlay:y,Trigger:o.xz,Portal:function(e){let t=useDrawerContext(),{container:n=t.container,...i}=e;return u.createElement(o.h_,{container:n,...i})},Handle:b,Close:o.x8,Title:o.Dx,Description:o.dk}}}]);