@luciodale/swipe-bar 1.2.2 → 1.2.3

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.
@@ -1,4 +1,4 @@
1
- (function(k,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],l):(k=typeof globalThis<"u"?globalThis:k||self,l(k.LucioDaleSwipeBar={},k.React))})(this,function(k,l){"use strict";var he={exports:{}},ce={};/**
1
+ (function(F,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],l):(F=typeof globalThis<"u"?globalThis:F||self,l(F.LucioDaleSwipeBar={},F.React))})(this,function(F,l){"use strict";var he={exports:{}},ce={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.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 Ae;function qe(){if(Ae)return ce;Ae=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(i,s,o){var d=null;if(o!==void 0&&(d=""+o),s.key!==void 0&&(d=""+s.key),"key"in s){o={};for(var a in s)a!=="key"&&(o[a]=s[a])}else o=s;return s=o.ref,{$$typeof:e,type:i,key:d,ref:s!==void 0?s:null,props:o}}return ce.Fragment=t,ce.jsx=n,ce.jsxs=n,ce}var le={};/**
9
+ */var Oe;function qe(){if(Oe)return ce;Oe=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(i,s,o){var d=null;if(o!==void 0&&(d=""+o),s.key!==void 0&&(d=""+s.key),"key"in s){o={};for(var a in s)a!=="key"&&(o[a]=s[a])}else o=s;return s=o.ref,{$$typeof:e,type:i,key:d,ref:s!==void 0?s:null,props:o}}return ce.Fragment=t,ce.jsx=n,ce.jsxs=n,ce}var le={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,9 +14,9 @@
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 Oe;function et(){return Oe||(Oe=1,process.env.NODE_ENV!=="production"&&function(){function e(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===J?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case I:return"Fragment";case _:return"Profiler";case D:return"StrictMode";case j:return"Suspense";case b:return"SuspenseList";case P:return"Activity"}if(typeof r=="object")switch(typeof r.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),r.$$typeof){case R:return"Portal";case B:return r.displayName||"Context";case L:return(r._context.displayName||"Context")+".Consumer";case N:var g=r.render;return r=r.displayName,r||(r=g.displayName||g.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case p:return g=r.displayName||null,g!==null?g:e(r.type)||"Memo";case E:g=r._payload,r=r._init;try{return e(r(g))}catch{}}return null}function t(r){return""+r}function n(r){try{t(r);var g=!1}catch{g=!0}if(g){g=console;var A=g.error,C=typeof Symbol=="function"&&Symbol.toStringTag&&r[Symbol.toStringTag]||r.constructor.name||"Object";return A.call(g,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",C),t(r)}}function i(r){if(r===I)return"<>";if(typeof r=="object"&&r!==null&&r.$$typeof===E)return"<...>";try{var g=e(r);return g?"<"+g+">":"<...>"}catch{return"<...>"}}function s(){var r=H.A;return r===null?null:r.getOwner()}function o(){return Error("react-stack-top-frame")}function d(r){if(G.call(r,"key")){var g=Object.getOwnPropertyDescriptor(r,"key").get;if(g&&g.isReactWarning)return!1}return r.key!==void 0}function a(r,g){function A(){K||(K=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",g))}A.isReactWarning=!0,Object.defineProperty(r,"key",{get:A,configurable:!0})}function u(){var r=e(this.type);return $[r]||($[r]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),r=this.props.ref,r!==void 0?r:null}function c(r,g,A,C,Q,z){var X=A.ref;return r={$$typeof:M,type:r,key:g,props:A,_owner:C},(X!==void 0?X:null)!==null?Object.defineProperty(r,"ref",{enumerable:!1,get:u}):Object.defineProperty(r,"ref",{enumerable:!1,value:null}),r._store={},Object.defineProperty(r._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(r,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(r,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Q}),Object.defineProperty(r,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:z}),Object.freeze&&(Object.freeze(r.props),Object.freeze(r)),r}function x(r,g,A,C,Q,z){var X=g.children;if(X!==void 0)if(C)if(U(X)){for(C=0;C<X.length;C++)S(X[C]);Object.freeze&&Object.freeze(X)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else S(X);if(G.call(g,"key")){X=e(r);var ne=Object.keys(g).filter(function(Ee){return Ee!=="key"});C=0<ne.length?"{key: someKey, "+ne.join(": ..., ")+": ...}":"{key: someKey}",F[X+C]||(ne=0<ne.length?"{"+ne.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
17
+ */var Ae;function et(){return Ae||(Ae=1,process.env.NODE_ENV!=="production"&&function(){function e(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===X?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case P:return"Fragment";case _:return"Profiler";case L:return"StrictMode";case H:return"Suspense";case g:return"SuspenseList";case Y:return"Activity"}if(typeof r=="object")switch(typeof r.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),r.$$typeof){case R:return"Portal";case D:return r.displayName||"Context";case W:return(r._context.displayName||"Context")+".Consumer";case j:var h=r.render;return r=r.displayName,r||(r=h.displayName||h.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case x:return h=r.displayName||null,h!==null?h:e(r.type)||"Memo";case w:h=r._payload,r=r._init;try{return e(r(h))}catch{}}return null}function t(r){return""+r}function n(r){try{t(r);var h=!1}catch{h=!0}if(h){h=console;var O=h.error,C=typeof Symbol=="function"&&Symbol.toStringTag&&r[Symbol.toStringTag]||r.constructor.name||"Object";return O.call(h,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",C),t(r)}}function i(r){if(r===P)return"<>";if(typeof r=="object"&&r!==null&&r.$$typeof===w)return"<...>";try{var h=e(r);return h?"<"+h+">":"<...>"}catch{return"<...>"}}function s(){var r=V.A;return r===null?null:r.getOwner()}function o(){return Error("react-stack-top-frame")}function d(r){if(G.call(r,"key")){var h=Object.getOwnPropertyDescriptor(r,"key").get;if(h&&h.isReactWarning)return!1}return r.key!==void 0}function a(r,h){function O(){Z||(Z=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",h))}O.isReactWarning=!0,Object.defineProperty(r,"key",{get:O,configurable:!0})}function u(){var r=e(this.type);return Q[r]||(Q[r]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),r=this.props.ref,r!==void 0?r:null}function c(r,h,O,C,K,$){var M=O.ref;return r={$$typeof:I,type:r,key:h,props:O,_owner:C},(M!==void 0?M:null)!==null?Object.defineProperty(r,"ref",{enumerable:!1,get:u}):Object.defineProperty(r,"ref",{enumerable:!1,value:null}),r._store={},Object.defineProperty(r._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(r,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(r,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:K}),Object.defineProperty(r,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:$}),Object.freeze&&(Object.freeze(r.props),Object.freeze(r)),r}function T(r,h,O,C,K,$){var M=h.children;if(M!==void 0)if(C)if(U(M)){for(C=0;C<M.length;C++)p(M[C]);Object.freeze&&Object.freeze(M)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else p(M);if(G.call(h,"key")){M=e(r);var ne=Object.keys(h).filter(function(Ee){return Ee!=="key"});C=0<ne.length?"{key: someKey, "+ne.join(": ..., ")+": ...}":"{key: someKey}",te[M+C]||(ne=0<ne.length?"{"+ne.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
18
  let props = %s;
19
19
  <%s {...props} />
20
20
  React keys must be passed directly to JSX without using spread:
21
21
  let props = %s;
22
- <%s key={someKey} {...props} />`,C,X,ne,X),F[X+C]=!0)}if(X=null,A!==void 0&&(n(A),X=""+A),d(g)&&(n(g.key),X=""+g.key),"key"in g){A={};for(var de in g)de!=="key"&&(A[de]=g[de])}else A=g;return X&&a(A,typeof r=="function"?r.displayName||r.name||"Unknown":r),c(r,X,A,s(),Q,z)}function S(r){v(r)?r._store&&(r._store.validated=1):typeof r=="object"&&r!==null&&r.$$typeof===E&&(r._payload.status==="fulfilled"?v(r._payload.value)&&r._payload.value._store&&(r._payload.value._store.validated=1):r._store&&(r._store.validated=1))}function v(r){return typeof r=="object"&&r!==null&&r.$$typeof===M}var w=l,M=Symbol.for("react.transitional.element"),R=Symbol.for("react.portal"),I=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),L=Symbol.for("react.consumer"),B=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),b=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),J=Symbol.for("react.client.reference"),H=w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=Object.prototype.hasOwnProperty,U=Array.isArray,Z=console.createTask?console.createTask:function(){return null};w={react_stack_bottom_frame:function(r){return r()}};var K,$={},Y=w.react_stack_bottom_frame.bind(w,o)(),te=Z(i(o)),F={};le.Fragment=I,le.jsx=function(r,g,A){var C=1e4>H.recentlyCreatedOwnerStacks++;return x(r,g,A,!1,C?Error("react-stack-top-frame"):Y,C?Z(i(r)):te)},le.jsxs=function(r,g,A){var C=1e4>H.recentlyCreatedOwnerStacks++;return x(r,g,A,!0,C?Error("react-stack-top-frame"):Y,C?Z(i(r)):te)}}()),le}process.env.NODE_ENV==="production"?he.exports=qe():he.exports=et();var T=he.exports;const Pe=l.createContext(null),me=e=>{throw new Error(`Unhandled sidebar side: ${e}`)},be={isOpen:!1,anchorState:"closed"},tt=({children:e,sidebarWidthPx:t,transitionMs:n,edgeActivationWidthPx:i,dragActivationDeltaPx:s,showOverlay:o,isAbsolute:d,overlayBackgroundColor:a,toggleIconColor:u,toggleIconSizePx:c,toggleIconEdgeDistancePx:x,showToggle:S,mediaQueryWidth:v,swipeBarZIndex:w,toggleZIndex:M,overlayZIndex:R,fadeContent:I,fadeContentTransitionMs:D})=>{var Je,Ke;const[_,L]=l.useState(null),[B,N]=l.useState(!1),[j,b]=l.useState(!1),[p,E]=l.useState({}),[P,J]=l.useState({}),H=l.useRef(null),G=l.useRef(null),U=l.useRef(null),Z=l.useRef(null),[K,$]=l.useState({}),[Y,te]=l.useState({}),F=l.useRef(new Map),r=l.useRef(null),g=l.useRef([]),A=((Je=K.primary)==null?void 0:Je.isOpen)??!1,C=((Ke=K.primary)==null?void 0:Ke.anchorState)??"closed",Q=l.useMemo(()=>Object.values(K).some(f=>f.isOpen),[K]),z=F.current.get("primary"),X=(z==null?void 0:z.sidebarRef)??{current:null},ne=(z==null?void 0:z.toggleRef)??{current:null},de=Y.primary??{},[Ee,kt]=l.useState({sidebarWidthPx:t??ot,sidebarHeightPx:Ie,transitionMs:n??nt,edgeActivationWidthPx:i??rt,dragActivationDeltaPx:s??it,showOverlay:o??st,isAbsolute:d??at,overlayBackgroundColor:a??Ce,toggleIconColor:u??ct,toggleIconSizePx:c??lt,toggleIconEdgeDistancePx:x??ut,showToggle:S??dt,mediaQueryWidth:v??ve,swipeBarZIndex:w??ft,toggleZIndex:M??gt,overlayZIndex:R??ht,fadeContent:I??pt,fadeContentTransitionMs:D??bt,swipeToOpen:vt,swipeToClose:wt,midAnchorPoint:St,midAnchorPointPx:Ie/3,disabled:!1}),Nt=l.useCallback((f,h)=>{F.current.set(f,h),$(m=>m[f]?m:{...m,[f]:{...be}})},[]),Ft=l.useCallback(f=>{F.current.delete(f),$(h=>{const m={...h};return delete m[f],m}),te(h=>{const m={...h};return delete m[f],m})},[]),Ht=l.useCallback(f=>F.current.get(f),[]),Gt=l.useCallback((f,h)=>{te(m=>m[f]===h?m:{...m,[f]:h})},[]),q=l.useCallback((f,h)=>{$(m=>{const y=m[f]??be;return y.isOpen===h?m:{...m,[f]:{...y,isOpen:h}}})},[]),ee=l.useCallback((f,h)=>{$(m=>{const y=m[f]??be;return y.anchorState===h?m:{...m,[f]:{...y,anchorState:h}}})},[]);l.useEffect(()=>(B||j||Q?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[B,j,Q]),l.useEffect(()=>{var f;if(p.fadeContent===!1){const h=(f=H.current)==null?void 0:f.firstElementChild;h&&(h.style.opacity="1")}},[p.fadeContent]),l.useEffect(()=>{var f;if(P.fadeContent===!1){const h=(f=G.current)==null?void 0:f.firstElementChild;h&&(h.style.opacity="1")}},[P.fadeContent]),l.useEffect(()=>{var f;for(const[h,m]of Object.entries(Y))if(m.fadeContent===!1){const y=F.current.get(h),O=(f=y==null?void 0:y.sidebarRef.current)==null?void 0:f.firstElementChild;O&&(O.style.opacity="1")}},[Y]);const Ut=l.useCallback(f=>{kt(h=>({...h,...f}))},[]),oe=l.useCallback(f=>{const h=g.current,m=h.indexOf(f);m!==-1&&h.splice(m,1),h.push(f),L("bottom")},[]),Ve=l.useCallback(f=>{const h=g.current,m=h.indexOf(f);m!==-1&&h.splice(m,1),$(y=>(Object.entries(y).some(([W,re])=>W!==f&&re.isOpen)||L(null),y))},[]),Zt=l.useCallback((f,h)=>{const m=(y,O,W,re)=>{Se({side:f,ref:y,options:O,toggleRef:W,afterApply:()=>{re(!0),L(f)}})};if(f==="left"){if(p.disabled)return;m(H,p,U,N)}else if(f==="right"){if(P.disabled)return;m(G,P,Z,b)}else if(f==="bottom"){const y=(h==null?void 0:h.id)??"primary",O=Y[y],W=F.current.get(y);if(!O||!W||O.disabled)return;const re=O.sidebarHeightPx??0,Kt=O.mediaQueryWidth??640,$e=window.innerWidth<Kt,$t=$e?O.midAnchorPointPx??0:re;$e&&O.midAnchorPoint&&!O.swipeToOpen&&$t<re?Xe({ref:W.sidebarRef,options:O,toggleRef:W.toggleRef,afterApply:()=>{q(y,!0),ee(y,"midAnchor"),oe(y)}}):Se({side:f,ref:W.sidebarRef,options:O,toggleRef:W.toggleRef,afterApply:()=>{q(y,!0),ee(y,"open"),oe(y)}})}else me(f)},[p,P,Y,q,ee,oe]),zt=l.useCallback((f,h)=>{if(f!=="bottom")return;const m=(h==null?void 0:h.id)??"primary",y=Y[m],O=F.current.get(m);!y||!O||y.disabled||Xe({ref:O.sidebarRef,options:y,toggleRef:O.toggleRef,afterApply:()=>{q(m,!0),ee(m,"midAnchor"),oe(m)}})},[Y,q,ee,oe]),Qt=l.useCallback((f,h)=>{if(f!=="bottom")return;const m=(h==null?void 0:h.id)??"primary",y=Y[m],O=F.current.get(m);!y||!O||y.disabled||Se({side:f,ref:O.sidebarRef,options:y,toggleRef:O.toggleRef,afterApply:()=>{q(m,!0),ee(m,"open"),oe(m)}})},[Y,q,ee,oe]),Vt=l.useCallback((f,h)=>{const m=(y,O,W,re)=>{De({ref:y,options:O,toggleRef:W,side:f,afterApply:()=>{re(!1),L(null)}})};if(f==="left"){if(p.disabled)return;m(H,p,U,N)}else if(f==="right"){if(P.disabled)return;m(G,P,Z,b)}else if(f==="bottom"){const y=(h==null?void 0:h.id)??"primary",O=Y[y],W=F.current.get(y);if(!O||!W||O.disabled)return;De({ref:W.sidebarRef,options:O,toggleRef:W.toggleRef,side:f,afterApply:()=>{q(y,!1),ee(y,"closed"),Ve(y)}})}else me(f)},[p,P,Y,q,ee,Ve]),Jt=l.useCallback((f,h,m)=>{if(f==="left")Ye({ref:H,toggleRef:U,options:p,translateX:h});else if(f==="right")Ye({ref:G,toggleRef:Z,options:P,translateX:h});else if(f==="bottom"){const y=(m==null?void 0:m.id)??"primary",O=Y[y],W=F.current.get(y);if(!O||!W)return;_t({ref:W.sidebarRef,toggleRef:W.toggleRef,options:O,translateY:h})}else me(f)},[p,P,Y]);return T.jsx(Pe.Provider,{value:{lockedSidebar:_,setLockedSidebar:L,leftSidebarRef:H,rightSidebarRef:G,isLeftOpen:B,isRightOpen:j,isBottomOpen:A,bottomAnchorState:C,bottomSidebarRef:X,bottomToggleRef:ne,bottomSidebarOptions:de,bottomSidebars:K,bottomSidebarOptionsMap:Y,registerBottomSidebar:Nt,unregisterBottomSidebar:Ft,getBottomSidebarRefs:Ht,activeBottomDragIdRef:r,bottomFocusStackRef:g,openSidebar:Zt,openSidebarFully:Qt,openSidebarToMidAnchor:zt,closeSidebar:Vt,dragSidebar:Jt,globalOptions:Ee,setGlobalOptions:Ut,leftSidebarOptions:p,rightSidebarOptions:P,setLeftSidebarOptions:E,setRightSidebarOptions:J,setBottomSidebarOptionsById:Gt,leftToggleRef:U,rightToggleRef:Z},children:e})},V=()=>{const e=l.useContext(Pe);if(!e)throw new Error("useSwipeBarContext must be used within SwipeBarProvider");return e},nt=300,rt=40,it=20,ot=320,Ie=window.innerHeight,st=!0,at=!1,Ce="rgba(0, 0, 0, 0.5)",pe="rgb(36,36,36)",ct="white",lt=40,ut=40,dt=!0,ve=640,ft=30,gt=15,ht=20,Me=.6,mt=200,bt=100,pt=!1,vt=!0,wt=!0,St=!1,se="cubic-bezier(0.22, 1, 0.36, 1)",_e={width:0,top:0,bottom:0,flexShrink:0,overflowX:"hidden",willChange:"transform"},yt={transform:"translateX(-100%)"},Rt={transform:"translateX(100%)"},xt={position:"fixed",left:0,top:0,bottom:0},Tt={position:"fixed",right:0,top:0,bottom:0},Et={height:0,left:0,right:0,flexShrink:0,overflowY:"hidden",willChange:"transform"},At={transform:"translateY(100%)"},Ot={position:"fixed",bottom:0,left:0,right:0},Pt={position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:Ce,transitionProperty:"opacity",pointerEvents:"none",opacity:0},It={opacity:1,pointerEvents:"auto"},Le={position:"fixed",top:"50%",transform:"translateY(-50%)",width:"1px",display:"flex",justifyContent:"center"},Ct={position:"fixed",bottom:0,left:"50%",transform:"translateX(-50%)",height:"1px",display:"flex",alignItems:"center"},Mt={position:"relative",cursor:"pointer",display:"flex",height:"72px",alignItems:"center",justifyContent:"center"},we=e=>{throw new Error(`Unhandled sidebar side: ${e}`)},ue=e=>{var t;return(t=e.current)==null?void 0:t.firstElementChild},Se=({ref:e,side:t,options:n,toggleRef:i,afterApply:s})=>{const o=ue(e),d=n.transitionMs?n.transitionMs/2:0;o&&n.fadeContent&&(o.style.opacity="0");let a,u;t==="left"||t==="right"?(a="width",u=n.sidebarWidthPx,o&&u&&(o.style.minWidth=`${u}px`)):t==="bottom"?(a="height",u=n.sidebarHeightPx,o&&u&&(o.style.minHeight=`${u}px`)):we(t),requestAnimationFrame(()=>{if(!e.current)return;const c=`transform ${n.transitionMs}ms ${se}`,x=n.isAbsolute?"":`, ${a} ${n.transitionMs}ms ${se}`;e.current.style.transition=`${c}${x}`,o&&n.fadeContent&&(o.style.transition=`opacity ${n.fadeContentTransitionMs}ms ease`),requestAnimationFrame(()=>{if(e.current){if(e.current.style.transform=t==="bottom"?"translateY(0px)":"translateX(0px)",!n.isAbsolute)e.current.style[a]=`${u}px`;else if(e.current.style[a]!==`${u}px`){const S=e.current.style.transition;e.current.style.transition=c,e.current.style[a]=`${u}px`,e.current.style.transition=S}i.current&&u&&(i.current.style.opacity="1",t==="left"?i.current.style.transform=`translateY(-50%) translateX(${u}px)`:t==="right"?i.current.style.transform=`translateY(-50%) translateX(-${u}px)`:t==="bottom"&&(i.current.style.transform=`translateX(-50%) translateY(-${u}px)`)),o&&n.fadeContent&&setTimeout(()=>{o.style.opacity="1"},d),s()}})}),setTimeout(()=>{},0)},De=({ref:e,options:t,side:n,toggleRef:i,afterApply:s})=>{const o=ue(e);let d;n==="left"||n==="right"?(d="width",o&&t.sidebarWidthPx&&(o.style.minWidth=`${t.sidebarWidthPx}px`)):n==="bottom"?(d="height",o&&t.sidebarHeightPx&&(o.style.minHeight=`${t.sidebarHeightPx}px`)):we(n),requestAnimationFrame(()=>{if(!e.current)return;const a=`transform ${t.transitionMs}ms ${se}`,u=t.isAbsolute?"":`, ${d} ${t.transitionMs}ms ${se}`;e.current.style.transition=`${a}${u}`,o&&t.fadeContent&&(o.style.transition=`opacity ${t.fadeContentTransitionMs}ms ease`),requestAnimationFrame(()=>{e.current&&(n==="left"?(e.current.style.transform="translateX(-100%)",t.isAbsolute||(e.current.style.width="0px")):n==="right"?(e.current.style.transform="translateX(100%)",t.isAbsolute||(e.current.style.width="0px")):n==="bottom"&&(e.current.style.transform="translateY(100%)",t.isAbsolute||(e.current.style.height="0px")),i.current&&(i.current.style.opacity="1",n==="left"||n==="right"?i.current.style.transform="translateY(-50%)":n==="bottom"&&(i.current.style.transform="translateX(-50%)")),o&&t.fadeContent&&(o.style.opacity="0"),s())})})},Xe=({ref:e,options:t,toggleRef:n,afterApply:i})=>{const s=ue(e),o=t.transitionMs?t.transitionMs/2:0;s&&t.fadeContent&&(s.style.opacity="0"),s&&t.midAnchorPointPx&&(s.style.minHeight=`${t.sidebarHeightPx}px`),requestAnimationFrame(()=>{if(!e.current)return;const d=`transform ${t.transitionMs}ms ${se}`,a=t.isAbsolute?"":`, height ${t.transitionMs}ms ${se}`;e.current.style.transition=`${d}${a}`,s&&t.fadeContent&&(s.style.transition=`opacity ${t.fadeContentTransitionMs}ms ease`),requestAnimationFrame(()=>{if(!e.current)return;const u=t.midAnchorPointPx??0,c=t.sidebarHeightPx??0,x=c-u;if(e.current.style.transform=`translateY(${x}px)`,!t.isAbsolute)e.current.style.height=`${c}px`;else if(e.current.style.height!==`${c}px`){const S=e.current.style.transition;e.current.style.transition=d,e.current.style.height=`${c}px`,e.current.style.transition=S}n.current&&(n.current.style.opacity="1",n.current.style.transform=`translateX(-50%) translateY(-${u}px)`),s&&t.fadeContent&&setTimeout(()=>{s.style.opacity="1"},o),i()})}),setTimeout(()=>{},0)},Ye=({ref:e,toggleRef:t,options:n,translateX:i})=>{!e.current||i===null||(e.current.style.transition="none",requestAnimationFrame(()=>{const s=ue(e);if(e.current){if(s&&n.fadeContent&&(s.style.opacity="0"),s&&n.sidebarWidthPx&&(s.style.minWidth=`${n.sidebarWidthPx}px`),!n.isAbsolute){const o=`${n.sidebarWidthPx}px`;e.current.style.width!==o&&(e.current.style.width=o)}e.current.style.transform=`translateX(${i}px)`,t.current&&(t.current.style.opacity="0",t.current.style.transform=`translateY(-50%) translateX(${i}px)`)}}))},_t=({ref:e,toggleRef:t,options:n,translateY:i})=>{!e.current||i===null||(e.current.style.transition="none",requestAnimationFrame(()=>{const s=ue(e);if(e.current){if(s&&n.fadeContent&&(s.style.opacity="0"),s&&n.sidebarHeightPx&&(s.style.minHeight=`${n.sidebarHeightPx}px`),!n.isAbsolute){const o=`${n.sidebarHeightPx}px`;e.current.style.height!==o&&(e.current.style.height=o)}e.current.style.transform=`translateY(${i}px)`,t.current&&(t.current.style.opacity="0",t.current.style.transform=`translateX(-50%) translateY(${i}px)`)}}))},fe=({refs:e,clientX:t,clientY:n,touchId:i,isMouse:s})=>{e.draggingRef.current={startX:t,startY:n,activeTouchId:i,isMouse:s,isActivated:!1},e.currentXRef.current=t,e.prevXRef.current=t},Be=({refs:e,clientX:t,clientY:n,touchId:i,isMouse:s})=>{e.draggingRef.current={startX:t,startY:n,activeTouchId:i,isMouse:s,isActivated:!1},e.currentYRef.current=n,e.prevYRef.current=n},We=({refs:e,dragSidebar:t,onDeactivate:n})=>{e.draggingRef.current=null,e.currentXRef.current=null,e.prevXRef.current=null,t(null),n()},Lt=({refs:e,dragSidebar:t,onDeactivate:n})=>{e.draggingRef.current=null,e.currentYRef.current=null,e.prevYRef.current=null,t(null)},ae=e=>e instanceof Element?!!e.closest("input, textarea, [contenteditable='true']"):!1;function je(e){let t=e instanceof HTMLElement?e:null;for(;t;){const n=getComputedStyle(t);if((n.overflowY==="auto"||n.overflowY==="scroll")&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return null}const ye=(e,t)=>{for(let n=0;n<e.length;n++){const i=e[n];if(t==null||i.identifier===t)return i}return null},Re=(e,t)=>{for(let n=0;n<e.length;n++)if(e[n].identifier===t)return!0;return!1},xe=(e,t,n)=>{const{globalOptions:i,setLeftSidebarOptions:s,setRightSidebarOptions:o,setBottomSidebarOptionsById:d}=V(),{sidebarWidthPx:a,sidebarHeightPx:u,transitionMs:c,edgeActivationWidthPx:x,dragActivationDeltaPx:S,showOverlay:v,isAbsolute:w,overlayBackgroundColor:M,toggleIconColor:R,toggleIconSizePx:I,toggleIconEdgeDistancePx:D,showToggle:_,mediaQueryWidth:L,swipeBarZIndex:B,toggleZIndex:N,overlayZIndex:j,fadeContent:b,fadeContentTransitionMs:p,swipeToOpen:E,swipeToClose:P,midAnchorPoint:J,midAnchorPointPx:H,disabled:G}=t,U=l.useMemo(()=>{const Z=u??i.sidebarHeightPx;return{sidebarWidthPx:a??i.sidebarWidthPx,sidebarHeightPx:Z,transitionMs:c??i.transitionMs,edgeActivationWidthPx:x??i.edgeActivationWidthPx,dragActivationDeltaPx:S??i.dragActivationDeltaPx,showOverlay:v??i.showOverlay,isAbsolute:w??i.isAbsolute,overlayBackgroundColor:M??i.overlayBackgroundColor,toggleIconColor:R??i.toggleIconColor,toggleIconSizePx:I??i.toggleIconSizePx,toggleIconEdgeDistancePx:D??i.toggleIconEdgeDistancePx,showToggle:_??i.showToggle,mediaQueryWidth:L??i.mediaQueryWidth,swipeBarZIndex:B??i.swipeBarZIndex,toggleZIndex:N??i.toggleZIndex,overlayZIndex:j??i.overlayZIndex,fadeContent:b??i.fadeContent,fadeContentTransitionMs:p??i.fadeContentTransitionMs,swipeToOpen:E??i.swipeToOpen,swipeToClose:P??i.swipeToClose,midAnchorPoint:J??i.midAnchorPoint,midAnchorPointPx:H??i.midAnchorPointPx??Math.floor(Z/3),disabled:G??i.disabled}},[a,u,c,x,S,v,w,M,R,I,D,_,i,L,B,N,j,b,p,E,P,J,H,G]);return l.useEffect(()=>{e==="left"?s(U):e==="right"?o(U):e==="bottom"?d(n??"primary",U):we(e)},[e,n,U,s,o,d]),U};function ge({isCollapsed:e,setCollapsed:t,closeSidebarOnClick:n=!0,transitionMs:i,overlayBackgroundColor:s,overlayZIndex:o}){return T.jsx("div",{style:{transitionDuration:`${i}ms`,...Pt,...e?{}:It,...s?{backgroundColor:s}:{},zIndex:o},onMouseDown:d=>{n&&(d.stopPropagation(),t())}})}function Te({size:e,color:t}){const n=l.useRef(null);return l.useEffect(()=>{const i=()=>{n.current&&(n.current.style.opacity="1")},s=()=>{n.current&&(n.current.style.opacity=`${Me}`)};n.current&&(n.current.addEventListener("mouseenter",i),n.current.addEventListener("mouseleave",s))},[]),T.jsx("div",{style:{...Mt},children:T.jsxs("svg",{style:{transition:`opacity ${mt}ms ease`,opacity:`${Me}`},ref:n,"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:e,children:[T.jsx("g",{strokeWidth:"0"}),T.jsx("g",{strokeLinecap:"round",strokeLinejoin:"round",children:T.jsx("g",{children:T.jsx("path",{clipRule:"evenodd",d:"m9.46967 5.46967c.29289-.29289.76773-.29289 1.06063 0l2.6286 2.62858c.5748.57477 1.0384 1.03835 1.3831 1.44443.355.41812.6278.82432.7818 1.29852.2447.7531.2447 1.5645 0 2.3176-.154.4742-.4268.8804-.7818 1.2985-.3447.4061-.8083.8697-1.3831 1.4444l-2.6286 2.6286c-.2929.2929-.76774.2929-1.06063 0s-.29289-.7677 0-1.0606l2.60593-2.6059c.6027-.6028 1.0225-1.0234 1.3229-1.3773.2947-.3471.4302-.5804.4987-.7912.1469-.4519.1469-.9387 0-1.3906-.0685-.2108-.204-.4441-.4987-.7912-.3004-.3539-.7202-.77451-1.3229-1.37728l-2.60593-2.60589c-.29289-.29289-.29289-.76777 0-1.06066z",fill:t,fillRule:"evenodd"})})})]})})}function ke({id:e,toggleRef:t,options:n,showToggle:i=!0,ToggleComponent:s}){var c;const{openSidebar:o,closeSidebar:d,bottomSidebars:a}=V(),u=((c=a[e])==null?void 0:c.isOpen)??!1;return i?T.jsx("div",{ref:t,style:{...Ct,transition:`transform ${n.transitionMs}ms ease, opacity ${n.transitionMs}ms ease`,zIndex:n.toggleZIndex},children:(!u||u&&!n.showOverlay)&&T.jsx("button",{type:"button",onClick:()=>{n.disabled||(u?d("bottom",{id:e}):o("bottom",{id:e}))},disabled:n.disabled,style:{marginBottom:`${n.toggleIconEdgeDistancePx}px`,transform:u?"rotate(90deg)":"rotate(-90deg)"},children:s??T.jsx(Te,{size:n.toggleIconSizePx,color:n.toggleIconColor})})}):null}function ie(e=ve){const t=`(max-width: ${Math.min(e,ve)}px)`,n=()=>typeof window>"u"||typeof window.matchMedia>"u"?!1:window.matchMedia(t).matches,[i,s]=l.useState(n);return l.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia>"u")return;const o=window.matchMedia(t),d=()=>s(o.matches);return d(),o.addEventListener("change",d),()=>o.removeEventListener("change",d)},[t]),i}const Ne=({refs:e,callbacks:t,currentY:n,preventDefault:i,lockPane:s,options:o,scrollableAncestor:d,initialScrollTop:a})=>{if(!e.draggingRef.current)return;const u=n-e.draggingRef.current.startY;if(!e.draggingRef.current.isActivated&&Math.abs(u)>=o.dragActivationDeltaPx){if(d&&t.getIsOpen()){if(d.scrollTop!==a){e.draggingRef.current=null,t.dragSidebar(null);return}const{scrollTop:R,scrollHeight:I,clientHeight:D}=d,_=R>1,L=R+D<I-1;if(u>0&&_||u<0&&L){e.draggingRef.current=null,t.dragSidebar(null);return}}e.draggingRef.current.isActivated=!0,s()}if(!e.draggingRef.current.isActivated)return;e.prevYRef.current=e.currentYRef.current,e.currentYRef.current=n;const c=t.getIsOpen(),x=window.innerHeight;let S=!1;if((c||e.draggingRef.current.startY>=x-o.edgeActivationWidthPx)&&(S=!0),!S){e.draggingRef.current=null,t.dragSidebar(null);return}i();const v=o.sidebarHeightPx,w=o.midAnchorPointPx,M=o.midAnchorPoint&&!o.swipeToOpen&&w<v;if(c)if(M){const R=t.getBottomAnchorState();if(R==="open"){const I=Math.max(0,Math.min(v,u-o.dragActivationDeltaPx));t.dragSidebar(I)}else if(R==="midAnchor"){const I=v-w,D=Math.max(0,Math.min(v,I+u-o.dragActivationDeltaPx));t.dragSidebar(D)}}else{const R=Math.max(0,Math.min(v,u-o.dragActivationDeltaPx));t.dragSidebar(R)}else if(e.draggingRef.current.startY>=x-o.edgeActivationWidthPx)if(M){const R=v-w,I=Math.max(R,Math.min(v,v+u+o.dragActivationDeltaPx));t.dragSidebar(I)}else{const R=Math.max(0,Math.min(v,v+u+o.dragActivationDeltaPx));t.dragSidebar(R)}},Fe=({refs:e,callbacks:t,options:n,onDragEnd:i})=>{if(!e.draggingRef.current)return;if(!e.draggingRef.current.isActivated){e.draggingRef.current=null,e.currentYRef.current=null,e.prevYRef.current=null;return}const s=e.currentYRef.current??e.draggingRef.current.startY,o=e.prevYRef.current??e.draggingRef.current.startY,d=e.draggingRef.current.startY,a=t.getIsOpen(),u=window.innerHeight;e.draggingRef.current=null,e.currentYRef.current=null,e.prevYRef.current=null,i();const c=s<o,x=s>=o,S=d>=u-n.edgeActivationWidthPx,v=n.midAnchorPointPx,w=n.sidebarHeightPx,M=n.midAnchorPoint&&!n.swipeToOpen&&v<w;if(a)if(M){const R=t.getBottomAnchorState(),I=w-v;if(R==="open"){const D=Math.max(0,s-d);x?D>I?t.closeSidebar():t.openToMidAnchor():D<I?t.openSidebarFully():t.openToMidAnchor(),t.dragSidebar(null)}else if(R==="midAnchor"){const D=w-v,_=Math.max(0,Math.min(w,D+(s-d)));if(c)_<I?t.openSidebarFully():t.openToMidAnchor();else{const L=(w+D)/2;_>L?t.closeSidebar():t.openToMidAnchor()}t.dragSidebar(null)}}else x?t.closeSidebar():t.openSidebar(),t.dragSidebar(null);else S&&c?(M?t.openToMidAnchor():t.openSidebar(),t.dragSidebar(null)):(t.closeSidebar(),t.dragSidebar(null))};function Dt(e,t){var j,b;const n=ie(e.mediaQueryWidth),{lockedSidebar:i,setLockedSidebar:s,bottomSidebars:o,openSidebar:d,openSidebarFully:a,closeSidebar:u,dragSidebar:c,openSidebarToMidAnchor:x,activeBottomDragIdRef:S,bottomFocusStackRef:v}=V(),w=((j=o[t])==null?void 0:j.isOpen)??!1,M=((b=o[t])==null?void 0:b.anchorState)??"closed",R=l.useRef(null),I=l.useRef(null),D=l.useRef(null),_=l.useRef(null),L=l.useRef(0),B=l.useRef(null),N=l.useRef(M);l.useEffect(()=>{N.current=M},[M]),l.useEffect(()=>{if(!n||i&&i!=="bottom"||e.disabled)return;const p={getIsOpen:()=>w,openSidebar:()=>d("bottom",{id:t}),openSidebarFully:()=>a("bottom",{id:t}),closeSidebar:()=>u("bottom",{id:t}),dragSidebar:r=>c("bottom",r,{id:t}),getBottomAnchorState:()=>N.current,openToMidAnchor:()=>x("bottom",{id:t})},E={draggingRef:R,currentYRef:I,prevYRef:D},P=()=>S.current!==null&&S.current!==t,J=()=>{const r=v.current;return r.length===0?!0:r[r.length-1]===t},H=()=>{if(P()){R.current=null;return}S.current=t,s("bottom");const r=_.current;r&&(B.current=r.style.overflowY,r.style.overflowY="hidden")},G=()=>{S.current===t&&(S.current=null);const r=_.current;r&&B.current!==null&&(r.style.overflowY=B.current,B.current=null)};function U(r){var z;if(i&&i!=="bottom"||P()||!J()||ae(r.target)||r.changedTouches.length===0)return;const g=r.changedTouches[0],A=window.innerHeight,C=p.getIsOpen(),Q=g.clientY>=A-e.edgeActivationWidthPx;C&&!e.swipeToClose||!C&&!e.swipeToOpen||(C||Q)&&(_.current=je(r.target),L.current=((z=_.current)==null?void 0:z.scrollTop)??0,Be({refs:E,clientX:g.clientX,clientY:g.clientY,touchId:g.identifier,isMouse:!1}))}function Z(r){if(i&&i!=="bottom")return;if(P()){R.current=null;return}if(!R.current||R.current.isMouse)return;const g=R.current.activeTouchId,A=ye(r.changedTouches,g);A&&Ne({refs:E,callbacks:p,currentY:A.clientY,preventDefault:()=>r.preventDefault(),lockPane:H,options:e,scrollableAncestor:_.current,initialScrollTop:L.current})}function K(r){if(i&&i!=="bottom"||!R.current||R.current.isMouse)return;const g=R.current.activeTouchId;Re(r.changedTouches,g)&&Fe({refs:E,callbacks:p,options:e,onDragEnd:G})}function $(){i&&i!=="bottom"||!R.current||R.current.isMouse||(G(),Lt({refs:E,dragSidebar:p.dragSidebar,onDeactivate:()=>{}}))}function Y(r){var Q;if(i&&i!=="bottom"||P()||!J()||ae(r.target)||r.button!==0)return;const g=window.innerHeight,A=p.getIsOpen(),C=r.clientY>=g-e.edgeActivationWidthPx;A&&!e.swipeToClose||!A&&!e.swipeToOpen||(A||C)&&(_.current=je(r.target),L.current=((Q=_.current)==null?void 0:Q.scrollTop)??0,Be({refs:E,clientX:r.clientX,clientY:r.clientY,touchId:null,isMouse:!0}))}function te(r){if(!(i&&i!=="bottom")){if(P()){R.current=null;return}!R.current||!R.current.isMouse||Ne({refs:E,callbacks:p,currentY:r.clientY,preventDefault:()=>r.preventDefault(),lockPane:H,options:e,scrollableAncestor:_.current,initialScrollTop:L.current})}}function F(){i&&i!=="bottom"||!R.current||!R.current.isMouse||Fe({refs:E,callbacks:p,options:e,onDragEnd:G})}return window.addEventListener("touchstart",U,{passive:!0}),window.addEventListener("touchmove",Z,{passive:!1}),window.addEventListener("touchend",K,{passive:!0}),window.addEventListener("touchcancel",$,{passive:!0}),window.addEventListener("mousedown",Y,{passive:!0}),window.addEventListener("mousemove",te,{passive:!1}),window.addEventListener("mouseup",F,{passive:!0}),()=>{window.removeEventListener("touchstart",U),window.removeEventListener("touchmove",Z),window.removeEventListener("touchend",K),window.removeEventListener("touchcancel",$),window.removeEventListener("mousedown",Y),window.removeEventListener("mousemove",te),window.removeEventListener("mouseup",F)}},[t,n,w,d,a,u,c,i,s,e,x,S,v])}function Xt({id:e="primary",className:t,children:n,ToggleComponent:i,...s}){var M;if((n==null?void 0:n.type)===T.Fragment)throw new Error("Fragments is not allowed in SwipeBarBottom");const{bottomSidebars:o,closeSidebar:d,registerBottomSidebar:a,unregisterBottomSidebar:u}=V(),c=l.useRef(null),x=l.useRef(null);l.useEffect(()=>(a(e,{sidebarRef:c,toggleRef:x}),()=>u(e)),[e,a,u]);const S=xe("bottom",s,e),v=ie(S.mediaQueryWidth);Dt(S,e);const w=((M=o[e])==null?void 0:M.isOpen)??!1;return T.jsxs(T.Fragment,{children:[S.showOverlay&&T.jsx(ge,{isCollapsed:!w,setCollapsed:()=>d("bottom",{id:e}),transitionMs:S.transitionMs,overlayBackgroundColor:S.overlayBackgroundColor,overlayZIndex:S.overlayZIndex}),T.jsx(ke,{id:e,toggleRef:x,options:S,showToggle:S.showToggle,ToggleComponent:i}),T.jsx("div",{ref:c,style:{...Et,...At,...S.isAbsolute||v?Ot:{},...t?{}:{backgroundColor:pe},zIndex:S.swipeBarZIndex},className:t,children:n})]})}function He({options:e,showToggle:t=!0,ToggleComponent:n}){const{openSidebar:i,leftToggleRef:s,isLeftOpen:o,closeSidebar:d}=V();return t?T.jsx("div",{ref:s,style:{...Le,transition:`transform ${e.transitionMs}ms ease, opacity ${e.transitionMs}ms ease`,left:0,zIndex:e.toggleZIndex},children:(!o||o&&!e.showOverlay)&&T.jsx("button",{type:"button",onClick:()=>{e.disabled||(o?d("left"):i("left"))},disabled:e.disabled,style:{marginLeft:`${e.toggleIconEdgeDistancePx}px`,...o?{transform:"rotate(180deg)"}:{}},children:n??T.jsx(Te,{size:e.toggleIconSizePx,color:e.toggleIconColor})})}):null}const Ge=({refs:e,callbacks:t,currentX:n,preventDefault:i,lockPane:s,options:o})=>{if(!e.draggingRef.current)return;const d=n-e.draggingRef.current.startX;if(!e.draggingRef.current.isActivated&&Math.abs(d)>=o.dragActivationDeltaPx&&(e.draggingRef.current.isActivated=!0,s()),!e.draggingRef.current.isActivated)return;e.prevXRef.current=e.currentXRef.current,e.currentXRef.current=n;const a=t.getIsOpen();let u=!1;if((a||e.draggingRef.current.startX<=o.edgeActivationWidthPx)&&(u=!0),!u){e.draggingRef.current=null,t.dragSidebar(null);return}i();const c=o.sidebarWidthPx;if(a){const x=Math.min(0,Math.max(-c,d+o.dragActivationDeltaPx));t.dragSidebar(x)}else if(e.draggingRef.current.startX<=o.edgeActivationWidthPx){const x=Math.min(0,Math.max(-c,-c+d-o.dragActivationDeltaPx));t.dragSidebar(x)}},Ue=({refs:e,callbacks:t,options:n})=>{if(!e.draggingRef.current)return;if(!e.draggingRef.current.isActivated){e.draggingRef.current=null,e.currentXRef.current=null,e.prevXRef.current=null;return}const i=e.currentXRef.current??e.draggingRef.current.startX,s=e.prevXRef.current??e.draggingRef.current.startX,o=e.draggingRef.current.startX,d=t.getIsOpen();e.draggingRef.current=null,e.currentXRef.current=null,e.prevXRef.current=null;const a=i>=s,u=i<s,c=o<=n.edgeActivationWidthPx;d?(u?t.closeSidebar():t.openSidebar(),t.dragSidebar(null)):c&&a?(t.openSidebar(),t.dragSidebar(null)):(t.closeSidebar(),t.dragSidebar(null))};function Yt(e){const t=ie(e.mediaQueryWidth),{lockedSidebar:n,setLockedSidebar:i,isLeftOpen:s,openSidebar:o,closeSidebar:d,dragSidebar:a,leftSidebarRef:u}=V(),c=l.useRef(null),x=l.useRef(null),S=l.useRef(null);l.useEffect(()=>{if(!t||n&&n!=="left"||e.disabled)return;const v={getIsOpen:()=>s,openSidebar:()=>o("left"),closeSidebar:()=>d("left"),dragSidebar:b=>a("left",b)},w={draggingRef:c,currentXRef:x,prevXRef:S},M=()=>i("left"),R=()=>i(null);function I(b){if(n&&n!=="left"||ae(b.target)||b.changedTouches.length===0)return;const p=b.changedTouches[0],E=v.getIsOpen(),P=p.clientX<=e.edgeActivationWidthPx;E&&!e.swipeToClose||!E&&!e.swipeToOpen||(E||P)&&fe({refs:w,clientX:p.clientX,clientY:p.clientY,touchId:p.identifier,isMouse:!1})}function D(b){if(n&&n!=="left"||!c.current||c.current.isMouse)return;const p=c.current.activeTouchId,E=ye(b.changedTouches,p);E&&Ge({refs:w,callbacks:v,currentX:E.clientX,preventDefault:()=>b.preventDefault(),lockPane:M,options:e})}function _(b){if(n&&n!=="left"||!c.current||c.current.isMouse)return;const p=c.current.activeTouchId;Re(b.changedTouches,p)&&Ue({refs:w,callbacks:v,options:e})}function L(){n&&n!=="left"||!c.current||c.current.isMouse||We({refs:w,dragSidebar:v.dragSidebar,onDeactivate:R})}function B(b){if(n&&n!=="left"||ae(b.target)||b.button!==0)return;const p=v.getIsOpen(),E=b.clientX<=e.edgeActivationWidthPx;p&&!e.swipeToClose||!p&&!e.swipeToOpen||(p||E)&&fe({refs:w,clientX:b.clientX,clientY:b.clientY,touchId:null,isMouse:!0})}function N(b){n&&n!=="left"||!c.current||!c.current.isMouse||Ge({refs:w,callbacks:v,currentX:b.clientX,preventDefault:()=>b.preventDefault(),lockPane:M,options:e})}function j(){n&&n!=="left"||!c.current||!c.current.isMouse||Ue({refs:w,callbacks:v,options:e})}return window.addEventListener("touchstart",I,{passive:!0}),window.addEventListener("touchmove",D,{passive:!1}),window.addEventListener("touchend",_,{passive:!0}),window.addEventListener("touchcancel",L,{passive:!0}),window.addEventListener("mousedown",B,{passive:!0}),window.addEventListener("mousemove",N,{passive:!1}),window.addEventListener("mouseup",j,{passive:!0}),()=>{window.removeEventListener("touchstart",I),window.removeEventListener("touchmove",D),window.removeEventListener("touchend",_),window.removeEventListener("touchcancel",L),window.removeEventListener("mousedown",B),window.removeEventListener("mousemove",N),window.removeEventListener("mouseup",j)}},[t,s,o,d,a,n,i,u,e])}function Bt({className:e,children:t,ToggleComponent:n,...i}){if((t==null?void 0:t.type)===T.Fragment)throw new Error("Fragments is not allowed in SwipeBarLeft");const{isLeftOpen:s,closeSidebar:o,leftSidebarRef:d}=V(),a=xe("left",i),u=ie(a.mediaQueryWidth);return Yt(a),T.jsxs(T.Fragment,{children:[a.showOverlay&&T.jsx(ge,{isCollapsed:!s,setCollapsed:()=>o("left"),transitionMs:a.transitionMs,overlayBackgroundColor:a.overlayBackgroundColor,overlayZIndex:a.overlayZIndex}),T.jsx(He,{options:a,showToggle:a.showToggle,ToggleComponent:n}),T.jsx("div",{ref:d,style:{..._e,...yt,...a.isAbsolute||u?xt:{},...e?{}:{backgroundColor:pe},zIndex:a.swipeBarZIndex},className:e,children:t})]})}function Ze({options:e,showToggle:t=!0,ToggleComponent:n}){const{openSidebar:i,rightToggleRef:s,isRightOpen:o,closeSidebar:d}=V();return t?T.jsx("div",{ref:s,style:{...Le,transition:`transform ${e.transitionMs}ms ease, opacity ${e.transitionMs}ms ease`,right:0,zIndex:e.toggleZIndex},children:(!o||o&&!e.showOverlay)&&T.jsx("button",{type:"button",onClick:()=>{e.disabled||(o?d("right"):i("right"))},disabled:e.disabled,style:{marginRight:`${e.toggleIconEdgeDistancePx}px`,...o?{}:{transform:"rotate(180deg)"}},children:n??T.jsx(Te,{size:e.toggleIconSizePx,color:e.toggleIconColor})})}):null}const ze=({refs:e,callbacks:t,currentX:n,preventDefault:i,lockPane:s,options:o})=>{if(!e.draggingRef.current)return;const d=window.innerWidth,a=n-e.draggingRef.current.startX,u=e.draggingRef.current.startX>=d-o.edgeActivationWidthPx,c=e.draggingRef.current.isActivated;if(!c&&Math.abs(a)>=o.dragActivationDeltaPx&&(e.draggingRef.current.isActivated=!0,s()),!c)return;e.prevXRef.current=e.currentXRef.current,e.currentXRef.current=n;const x=t.getIsOpen();let S=!1;if((x||u)&&(S=!0),!S){e.draggingRef.current=null,t.dragSidebar(null);return}i();const v=o.sidebarWidthPx;if(x){const w=Math.max(0,Math.min(v,a-o.dragActivationDeltaPx));t.dragSidebar(w)}else{const w=Math.max(0,Math.min(v,v+a+o.dragActivationDeltaPx));t.dragSidebar(w)}},Qe=({refs:e,callbacks:t,options:n})=>{if(!e.draggingRef.current)return;if(!e.draggingRef.current.isActivated){e.draggingRef.current=null,e.currentXRef.current=null,e.prevXRef.current=null;return}const i=e.currentXRef.current??e.draggingRef.current.startX,s=e.prevXRef.current??e.draggingRef.current.startX,o=e.draggingRef.current.startX,d=t.getIsOpen(),a=window.innerWidth;e.draggingRef.current=null,e.currentXRef.current=null,e.prevXRef.current=null;const u=i>s,c=i<s,x=o>=a-n.edgeActivationWidthPx;d?(u?t.closeSidebar():t.openSidebar(),t.dragSidebar(null)):x&&c?(t.openSidebar(),t.dragSidebar(null)):(t.closeSidebar(),t.dragSidebar(null))};function Wt(e){const t=ie(e.mediaQueryWidth),{lockedSidebar:n,setLockedSidebar:i,isRightOpen:s,openSidebar:o,closeSidebar:d,dragSidebar:a,rightSidebarRef:u}=V(),c=l.useRef(null),x=l.useRef(null),S=l.useRef(null);l.useEffect(()=>{if(!t||n&&n!=="right"||e.disabled)return;const v={getIsOpen:()=>s,openSidebar:()=>o("right"),closeSidebar:()=>d("right"),dragSidebar:b=>a("right",b)},w={draggingRef:c,currentXRef:x,prevXRef:S},M=()=>i("right"),R=()=>i(null);function I(b){if(n&&n!=="right"||ae(b.target)||b.changedTouches.length===0)return;const p=b.changedTouches[0],E=window.innerWidth,P=v.getIsOpen(),J=p.clientX>=E-e.edgeActivationWidthPx;P&&!e.swipeToClose||!P&&!e.swipeToOpen||(P||J)&&fe({refs:w,clientX:p.clientX,clientY:p.clientY,touchId:p.identifier,isMouse:!1})}function D(b){if(n&&n!=="right"||!c.current||c.current.isMouse)return;const p=c.current.activeTouchId,E=ye(b.changedTouches,p);E&&ze({refs:w,callbacks:v,currentX:E.clientX,preventDefault:()=>b.preventDefault(),lockPane:M,options:e})}function _(b){if(n&&n!=="right"||!c.current||c.current.isMouse)return;const p=c.current.activeTouchId;Re(b.changedTouches,p)&&Qe({refs:w,callbacks:v,options:e})}function L(){n&&n!=="right"||!c.current||c.current.isMouse||We({refs:w,dragSidebar:v.dragSidebar,onDeactivate:R})}function B(b){if(n&&n!=="right"||ae(b.target)||b.button!==0)return;const p=window.innerWidth,E=v.getIsOpen(),P=b.clientX>=p-e.edgeActivationWidthPx;E&&!e.swipeToClose||!E&&!e.swipeToOpen||(E||P)&&fe({refs:w,clientX:b.clientX,clientY:b.clientY,touchId:null,isMouse:!0})}function N(b){n&&n!=="right"||!c.current||!c.current.isMouse||ze({refs:w,callbacks:v,currentX:b.clientX,preventDefault:()=>b.preventDefault(),lockPane:M,options:e})}function j(){n&&n!=="right"||!c.current||!c.current.isMouse||Qe({refs:w,callbacks:v,options:e})}return window.addEventListener("touchstart",I,{passive:!0}),window.addEventListener("touchmove",D,{passive:!1}),window.addEventListener("touchend",_,{passive:!0}),window.addEventListener("touchcancel",L,{passive:!0}),window.addEventListener("mousedown",B,{passive:!0}),window.addEventListener("mousemove",N,{passive:!1}),window.addEventListener("mouseup",j,{passive:!0}),()=>{window.removeEventListener("touchstart",I),window.removeEventListener("touchmove",D),window.removeEventListener("touchend",_),window.removeEventListener("touchcancel",L),window.removeEventListener("mousedown",B),window.removeEventListener("mousemove",N),window.removeEventListener("mouseup",j)}},[t,s,o,d,a,n,i,u,e])}function jt({className:e,children:t,ToggleComponent:n,...i}){if((t==null?void 0:t.type)===T.Fragment)throw new Error("Fragments is not allowed in SwipeBarRight");const{isRightOpen:s,closeSidebar:o,rightSidebarRef:d}=V(),a=xe("right",i),u=ie(a.mediaQueryWidth);return Wt(a),T.jsxs(T.Fragment,{children:[a.showOverlay&&T.jsx(ge,{isCollapsed:!s,setCollapsed:()=>o("right"),transitionMs:a.transitionMs,overlayBackgroundColor:a.overlayBackgroundColor,overlayZIndex:a.overlayZIndex}),T.jsx(Ze,{options:a,showToggle:a.showToggle,ToggleComponent:n}),T.jsx("div",{ref:d,style:{..._e,...Rt,...a.isAbsolute||u?Tt:{},...e?{}:{backgroundColor:pe},zIndex:a.swipeBarZIndex},className:e,children:t})]})}k.Overlay=ge,k.SwipeBarBottom=Xt,k.SwipeBarLeft=Bt,k.SwipeBarProvider=tt,k.SwipeBarRight=jt,k.ToggleBottom=ke,k.ToggleLeft=He,k.ToggleRight=Ze,k.useMediaQuery=ie,k.useSwipeBarContext=V,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})});
22
+ <%s key={someKey} {...props} />`,C,M,ne,M),te[M+C]=!0)}if(M=null,O!==void 0&&(n(O),M=""+O),d(h)&&(n(h.key),M=""+h.key),"key"in h){O={};for(var de in h)de!=="key"&&(O[de]=h[de])}else O=h;return M&&a(O,typeof r=="function"?r.displayName||r.name||"Unknown":r),c(r,M,O,s(),K,$)}function p(r){v(r)?r._store&&(r._store.validated=1):typeof r=="object"&&r!==null&&r.$$typeof===w&&(r._payload.status==="fulfilled"?v(r._payload.value)&&r._payload.value._store&&(r._payload.value._store.validated=1):r._store&&(r._store.validated=1))}function v(r){return typeof r=="object"&&r!==null&&r.$$typeof===I}var S=l,I=Symbol.for("react.transitional.element"),R=Symbol.for("react.portal"),P=Symbol.for("react.fragment"),L=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),W=Symbol.for("react.consumer"),D=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),H=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),x=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),Y=Symbol.for("react.activity"),X=Symbol.for("react.client.reference"),V=S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=Object.prototype.hasOwnProperty,U=Array.isArray,N=console.createTask?console.createTask:function(){return null};S={react_stack_bottom_frame:function(r){return r()}};var Z,Q={},J=S.react_stack_bottom_frame.bind(S,o)(),B=N(i(o)),te={};le.Fragment=P,le.jsx=function(r,h,O){var C=1e4>V.recentlyCreatedOwnerStacks++;return T(r,h,O,!1,C?Error("react-stack-top-frame"):J,C?N(i(r)):B)},le.jsxs=function(r,h,O){var C=1e4>V.recentlyCreatedOwnerStacks++;return T(r,h,O,!0,C?Error("react-stack-top-frame"):J,C?N(i(r)):B)}}()),le}process.env.NODE_ENV==="production"?he.exports=qe():he.exports=et();var E=he.exports;const Pe=l.createContext(null),me=e=>{throw new Error(`Unhandled sidebar side: ${e}`)},be={isOpen:!1,anchorState:"closed"},tt=({children:e,sidebarWidthPx:t,transitionMs:n,edgeActivationWidthPx:i,dragActivationDeltaPx:s,showOverlay:o,isAbsolute:d,overlayBackgroundColor:a,toggleIconColor:u,toggleIconSizePx:c,toggleIconEdgeDistancePx:T,showToggle:p,mediaQueryWidth:v,swipeBarZIndex:S,toggleZIndex:I,overlayZIndex:R,fadeContent:P,fadeContentTransitionMs:L,closeSidebarOnOverlayClick:_})=>{var Je,Ke;const[W,D]=l.useState(null),[j,H]=l.useState(!1),[g,x]=l.useState(!1),[w,Y]=l.useState({}),[X,V]=l.useState({}),G=l.useRef(null),U=l.useRef(null),N=l.useRef(null),Z=l.useRef(null),[Q,J]=l.useState({}),[B,te]=l.useState({}),r=l.useRef(new Map),h=l.useRef(null),O=l.useRef([]),C=((Je=Q.primary)==null?void 0:Je.isOpen)??!1,K=((Ke=Q.primary)==null?void 0:Ke.anchorState)??"closed",$=l.useMemo(()=>Object.values(Q).some(f=>f.isOpen),[Q]),M=r.current.get("primary"),ne=(M==null?void 0:M.sidebarRef)??{current:null},de=(M==null?void 0:M.toggleRef)??{current:null},Ee=B.primary??{},[Nt,Ft]=l.useState({sidebarWidthPx:t??ot,sidebarHeightPx:Ce,transitionMs:n??nt,edgeActivationWidthPx:i??rt,dragActivationDeltaPx:s??it,showOverlay:o??st,isAbsolute:d??ct,overlayBackgroundColor:a??Ie,toggleIconColor:u??lt,toggleIconSizePx:c??ut,toggleIconEdgeDistancePx:T??dt,showToggle:p??ft,mediaQueryWidth:v??pe,swipeBarZIndex:S??gt,toggleZIndex:I??ht,overlayZIndex:R??mt,fadeContent:P??pt,fadeContentTransitionMs:L??vt,swipeToOpen:wt,swipeToClose:St,midAnchorPoint:yt,midAnchorPointPx:Ce/3,disabled:!1,closeSidebarOnOverlayClick:_??at}),Ht=l.useCallback((f,m)=>{r.current.set(f,m),J(b=>b[f]?b:{...b,[f]:{...be}})},[]),Gt=l.useCallback(f=>{r.current.delete(f),J(m=>{const b={...m};return delete b[f],b}),te(m=>{const b={...m};return delete b[f],b})},[]),Ut=l.useCallback(f=>r.current.get(f),[]),Zt=l.useCallback((f,m)=>{te(b=>b[f]===m?b:{...b,[f]:m})},[]),q=l.useCallback((f,m)=>{J(b=>{const y=b[f]??be;return y.isOpen===m?b:{...b,[f]:{...y,isOpen:m}}})},[]),ee=l.useCallback((f,m)=>{J(b=>{const y=b[f]??be;return y.anchorState===m?b:{...b,[f]:{...y,anchorState:m}}})},[]);l.useEffect(()=>(j||g||$?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[j,g,$]),l.useEffect(()=>{var f;if(w.fadeContent===!1){const m=(f=G.current)==null?void 0:f.firstElementChild;m&&(m.style.opacity="1")}},[w.fadeContent]),l.useEffect(()=>{var f;if(X.fadeContent===!1){const m=(f=U.current)==null?void 0:f.firstElementChild;m&&(m.style.opacity="1")}},[X.fadeContent]),l.useEffect(()=>{var f;for(const[m,b]of Object.entries(B))if(b.fadeContent===!1){const y=r.current.get(m),A=(f=y==null?void 0:y.sidebarRef.current)==null?void 0:f.firstElementChild;A&&(A.style.opacity="1")}},[B]);const zt=l.useCallback(f=>{Ft(m=>({...m,...f}))},[]),oe=l.useCallback(f=>{const m=O.current,b=m.indexOf(f);b!==-1&&m.splice(b,1),m.push(f),D("bottom")},[]),Qe=l.useCallback(f=>{const m=O.current,b=m.indexOf(f);b!==-1&&m.splice(b,1),J(y=>(Object.entries(y).some(([k,re])=>k!==f&&re.isOpen)||D(null),y))},[]),Vt=l.useCallback((f,m)=>{const b=(y,A,k,re)=>{Se({side:f,ref:y,options:A,toggleRef:k,afterApply:()=>{re(!0),D(f)}})};if(f==="left"){if(w.disabled)return;b(G,w,N,H)}else if(f==="right"){if(X.disabled)return;b(U,X,Z,x)}else if(f==="bottom"){const y=(m==null?void 0:m.id)??"primary",A=B[y],k=r.current.get(y);if(!A||!k||A.disabled)return;const re=A.sidebarHeightPx??0,qt=A.mediaQueryWidth??640,$e=window.innerWidth<qt,en=$e?A.midAnchorPointPx??0:re;$e&&A.midAnchorPoint&&!A.swipeToOpen&&en<re?Xe({ref:k.sidebarRef,options:A,toggleRef:k.toggleRef,afterApply:()=>{q(y,!0),ee(y,"midAnchor"),oe(y)}}):Se({side:f,ref:k.sidebarRef,options:A,toggleRef:k.toggleRef,afterApply:()=>{q(y,!0),ee(y,"open"),oe(y)}})}else me(f)},[w,X,B,q,ee,oe]),Qt=l.useCallback((f,m)=>{if(f!=="bottom")return;const b=(m==null?void 0:m.id)??"primary",y=B[b],A=r.current.get(b);!y||!A||y.disabled||Xe({ref:A.sidebarRef,options:y,toggleRef:A.toggleRef,afterApply:()=>{q(b,!0),ee(b,"midAnchor"),oe(b)}})},[B,q,ee,oe]),Jt=l.useCallback((f,m)=>{if(f!=="bottom")return;const b=(m==null?void 0:m.id)??"primary",y=B[b],A=r.current.get(b);!y||!A||y.disabled||Se({side:f,ref:A.sidebarRef,options:y,toggleRef:A.toggleRef,afterApply:()=>{q(b,!0),ee(b,"open"),oe(b)}})},[B,q,ee,oe]),Kt=l.useCallback((f,m)=>{const b=(y,A,k,re)=>{De({ref:y,options:A,toggleRef:k,side:f,afterApply:()=>{re(!1),D(null)}})};if(f==="left"){if(w.disabled)return;b(G,w,N,H)}else if(f==="right"){if(X.disabled)return;b(U,X,Z,x)}else if(f==="bottom"){const y=(m==null?void 0:m.id)??"primary",A=B[y],k=r.current.get(y);if(!A||!k||A.disabled)return;De({ref:k.sidebarRef,options:A,toggleRef:k.toggleRef,side:f,afterApply:()=>{q(y,!1),ee(y,"closed"),Qe(y)}})}else me(f)},[w,X,B,q,ee,Qe]),$t=l.useCallback((f,m,b)=>{if(f==="left")Ye({ref:G,toggleRef:N,options:w,translateX:m});else if(f==="right")Ye({ref:U,toggleRef:Z,options:X,translateX:m});else if(f==="bottom"){const y=(b==null?void 0:b.id)??"primary",A=B[y],k=r.current.get(y);if(!A||!k)return;Lt({ref:k.sidebarRef,toggleRef:k.toggleRef,options:A,translateY:m})}else me(f)},[w,X,B]);return E.jsx(Pe.Provider,{value:{lockedSidebar:W,setLockedSidebar:D,leftSidebarRef:G,rightSidebarRef:U,isLeftOpen:j,isRightOpen:g,isBottomOpen:C,bottomAnchorState:K,bottomSidebarRef:ne,bottomToggleRef:de,bottomSidebarOptions:Ee,bottomSidebars:Q,bottomSidebarOptionsMap:B,registerBottomSidebar:Ht,unregisterBottomSidebar:Gt,getBottomSidebarRefs:Ut,activeBottomDragIdRef:h,bottomFocusStackRef:O,openSidebar:Vt,openSidebarFully:Jt,openSidebarToMidAnchor:Qt,closeSidebar:Kt,dragSidebar:$t,globalOptions:Nt,setGlobalOptions:zt,leftSidebarOptions:w,rightSidebarOptions:X,setLeftSidebarOptions:Y,setRightSidebarOptions:V,setBottomSidebarOptionsById:Zt,leftToggleRef:N,rightToggleRef:Z},children:e})},z=()=>{const e=l.useContext(Pe);if(!e)throw new Error("useSwipeBarContext must be used within SwipeBarProvider");return e},nt=300,rt=40,it=20,ot=320,Ce=window.innerHeight,st=!0,at=!0,ct=!1,Ie="rgba(0, 0, 0, 0.5)",ve="rgb(36,36,36)",lt="white",ut=40,dt=40,ft=!0,pe=640,gt=30,ht=15,mt=20,Me=.6,bt=200,vt=100,pt=!1,wt=!0,St=!0,yt=!1,se="cubic-bezier(0.22, 1, 0.36, 1)",_e={width:0,top:0,bottom:0,flexShrink:0,overflowX:"hidden",willChange:"transform"},Rt={transform:"translateX(-100%)"},xt={transform:"translateX(100%)"},Tt={position:"fixed",left:0,top:0,bottom:0},Et={position:"fixed",right:0,top:0,bottom:0},Ot={height:0,left:0,right:0,flexShrink:0,overflowY:"hidden",willChange:"transform"},At={transform:"translateY(100%)"},Pt={position:"fixed",bottom:0,left:0,right:0},Ct={position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:Ie,transitionProperty:"opacity",pointerEvents:"none",opacity:0},It={opacity:1,pointerEvents:"auto"},Le={position:"fixed",top:"50%",transform:"translateY(-50%)",width:"1px",display:"flex",justifyContent:"center"},Mt={position:"fixed",bottom:0,left:"50%",transform:"translateX(-50%)",height:"1px",display:"flex",alignItems:"center"},_t={position:"relative",cursor:"pointer",display:"flex",height:"72px",alignItems:"center",justifyContent:"center"},we=e=>{throw new Error(`Unhandled sidebar side: ${e}`)},ue=e=>{var t;return(t=e.current)==null?void 0:t.firstElementChild},Se=({ref:e,side:t,options:n,toggleRef:i,afterApply:s})=>{const o=ue(e),d=n.transitionMs?n.transitionMs/2:0;o&&n.fadeContent&&(o.style.opacity="0");let a,u;t==="left"||t==="right"?(a="width",u=n.sidebarWidthPx,o&&u&&(o.style.minWidth=`${u}px`)):t==="bottom"?(a="height",u=n.sidebarHeightPx,o&&u&&(o.style.minHeight=`${u}px`)):we(t),requestAnimationFrame(()=>{if(!e.current)return;const c=`transform ${n.transitionMs}ms ${se}`,T=n.isAbsolute?"":`, ${a} ${n.transitionMs}ms ${se}`;e.current.style.transition=`${c}${T}`,o&&n.fadeContent&&(o.style.transition=`opacity ${n.fadeContentTransitionMs}ms ease`),requestAnimationFrame(()=>{if(e.current){if(e.current.style.transform=t==="bottom"?"translateY(0px)":"translateX(0px)",!n.isAbsolute)e.current.style[a]=`${u}px`;else if(e.current.style[a]!==`${u}px`){const p=e.current.style.transition;e.current.style.transition=c,e.current.style[a]=`${u}px`,e.current.style.transition=p}i.current&&u&&(i.current.style.opacity="1",t==="left"?i.current.style.transform=`translateY(-50%) translateX(${u}px)`:t==="right"?i.current.style.transform=`translateY(-50%) translateX(-${u}px)`:t==="bottom"&&(i.current.style.transform=`translateX(-50%) translateY(-${u}px)`)),o&&n.fadeContent&&setTimeout(()=>{o.style.opacity="1"},d),s()}})}),setTimeout(()=>{},0)},De=({ref:e,options:t,side:n,toggleRef:i,afterApply:s})=>{const o=ue(e);let d;n==="left"||n==="right"?(d="width",o&&t.sidebarWidthPx&&(o.style.minWidth=`${t.sidebarWidthPx}px`)):n==="bottom"?(d="height",o&&t.sidebarHeightPx&&(o.style.minHeight=`${t.sidebarHeightPx}px`)):we(n),requestAnimationFrame(()=>{if(!e.current)return;const a=`transform ${t.transitionMs}ms ${se}`,u=t.isAbsolute?"":`, ${d} ${t.transitionMs}ms ${se}`;e.current.style.transition=`${a}${u}`,o&&t.fadeContent&&(o.style.transition=`opacity ${t.fadeContentTransitionMs}ms ease`),requestAnimationFrame(()=>{e.current&&(n==="left"?(e.current.style.transform="translateX(-100%)",t.isAbsolute||(e.current.style.width="0px")):n==="right"?(e.current.style.transform="translateX(100%)",t.isAbsolute||(e.current.style.width="0px")):n==="bottom"&&(e.current.style.transform="translateY(100%)",t.isAbsolute||(e.current.style.height="0px")),i.current&&(i.current.style.opacity="1",n==="left"||n==="right"?i.current.style.transform="translateY(-50%)":n==="bottom"&&(i.current.style.transform="translateX(-50%)")),o&&t.fadeContent&&(o.style.opacity="0"),s())})})},Xe=({ref:e,options:t,toggleRef:n,afterApply:i})=>{const s=ue(e),o=t.transitionMs?t.transitionMs/2:0;s&&t.fadeContent&&(s.style.opacity="0"),s&&t.midAnchorPointPx&&(s.style.minHeight=`${t.sidebarHeightPx}px`),requestAnimationFrame(()=>{if(!e.current)return;const d=`transform ${t.transitionMs}ms ${se}`,a=t.isAbsolute?"":`, height ${t.transitionMs}ms ${se}`;e.current.style.transition=`${d}${a}`,s&&t.fadeContent&&(s.style.transition=`opacity ${t.fadeContentTransitionMs}ms ease`),requestAnimationFrame(()=>{if(!e.current)return;const u=t.midAnchorPointPx??0,c=t.sidebarHeightPx??0,T=c-u;if(e.current.style.transform=`translateY(${T}px)`,!t.isAbsolute)e.current.style.height=`${c}px`;else if(e.current.style.height!==`${c}px`){const p=e.current.style.transition;e.current.style.transition=d,e.current.style.height=`${c}px`,e.current.style.transition=p}n.current&&(n.current.style.opacity="1",n.current.style.transform=`translateX(-50%) translateY(-${u}px)`),s&&t.fadeContent&&setTimeout(()=>{s.style.opacity="1"},o),i()})}),setTimeout(()=>{},0)},Ye=({ref:e,toggleRef:t,options:n,translateX:i})=>{!e.current||i===null||(e.current.style.transition="none",requestAnimationFrame(()=>{const s=ue(e);if(e.current){if(s&&n.fadeContent&&(s.style.opacity="0"),s&&n.sidebarWidthPx&&(s.style.minWidth=`${n.sidebarWidthPx}px`),!n.isAbsolute){const o=`${n.sidebarWidthPx}px`;e.current.style.width!==o&&(e.current.style.width=o)}e.current.style.transform=`translateX(${i}px)`,t.current&&(t.current.style.opacity="0",t.current.style.transform=`translateY(-50%) translateX(${i}px)`)}}))},Lt=({ref:e,toggleRef:t,options:n,translateY:i})=>{!e.current||i===null||(e.current.style.transition="none",requestAnimationFrame(()=>{const s=ue(e);if(e.current){if(s&&n.fadeContent&&(s.style.opacity="0"),s&&n.sidebarHeightPx&&(s.style.minHeight=`${n.sidebarHeightPx}px`),!n.isAbsolute){const o=`${n.sidebarHeightPx}px`;e.current.style.height!==o&&(e.current.style.height=o)}e.current.style.transform=`translateY(${i}px)`,t.current&&(t.current.style.opacity="0",t.current.style.transform=`translateX(-50%) translateY(${i}px)`)}}))},fe=({refs:e,clientX:t,clientY:n,touchId:i,isMouse:s})=>{e.draggingRef.current={startX:t,startY:n,activeTouchId:i,isMouse:s,isActivated:!1},e.currentXRef.current=t,e.prevXRef.current=t},Be=({refs:e,clientX:t,clientY:n,touchId:i,isMouse:s})=>{e.draggingRef.current={startX:t,startY:n,activeTouchId:i,isMouse:s,isActivated:!1},e.currentYRef.current=n,e.prevYRef.current=n},We=({refs:e,dragSidebar:t,onDeactivate:n})=>{e.draggingRef.current=null,e.currentXRef.current=null,e.prevXRef.current=null,t(null),n()},Dt=({refs:e,dragSidebar:t,onDeactivate:n})=>{e.draggingRef.current=null,e.currentYRef.current=null,e.prevYRef.current=null,t(null)},ae=e=>e instanceof Element?!!e.closest("input, textarea, [contenteditable='true']"):!1;function ke(e){let t=e instanceof HTMLElement?e:null;for(;t;){const n=getComputedStyle(t);if((n.overflowY==="auto"||n.overflowY==="scroll")&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return null}const ye=(e,t)=>{for(let n=0;n<e.length;n++){const i=e[n];if(t==null||i.identifier===t)return i}return null},Re=(e,t)=>{for(let n=0;n<e.length;n++)if(e[n].identifier===t)return!0;return!1},xe=(e,t,n)=>{const{globalOptions:i,setLeftSidebarOptions:s,setRightSidebarOptions:o,setBottomSidebarOptionsById:d}=z(),{sidebarWidthPx:a,sidebarHeightPx:u,transitionMs:c,edgeActivationWidthPx:T,dragActivationDeltaPx:p,showOverlay:v,isAbsolute:S,overlayBackgroundColor:I,toggleIconColor:R,toggleIconSizePx:P,toggleIconEdgeDistancePx:L,showToggle:_,mediaQueryWidth:W,swipeBarZIndex:D,toggleZIndex:j,overlayZIndex:H,fadeContent:g,fadeContentTransitionMs:x,swipeToOpen:w,swipeToClose:Y,midAnchorPoint:X,midAnchorPointPx:V,disabled:G,closeSidebarOnOverlayClick:U}=t,N=l.useMemo(()=>{const Z=u??i.sidebarHeightPx;return{sidebarWidthPx:a??i.sidebarWidthPx,sidebarHeightPx:Z,transitionMs:c??i.transitionMs,edgeActivationWidthPx:T??i.edgeActivationWidthPx,dragActivationDeltaPx:p??i.dragActivationDeltaPx,showOverlay:v??i.showOverlay,isAbsolute:S??i.isAbsolute,overlayBackgroundColor:I??i.overlayBackgroundColor,toggleIconColor:R??i.toggleIconColor,toggleIconSizePx:P??i.toggleIconSizePx,toggleIconEdgeDistancePx:L??i.toggleIconEdgeDistancePx,showToggle:_??i.showToggle,mediaQueryWidth:W??i.mediaQueryWidth,swipeBarZIndex:D??i.swipeBarZIndex,toggleZIndex:j??i.toggleZIndex,overlayZIndex:H??i.overlayZIndex,fadeContent:g??i.fadeContent,fadeContentTransitionMs:x??i.fadeContentTransitionMs,swipeToOpen:w??i.swipeToOpen,swipeToClose:Y??i.swipeToClose,midAnchorPoint:X??i.midAnchorPoint,midAnchorPointPx:V??i.midAnchorPointPx??Math.floor(Z/3),disabled:G??i.disabled,closeSidebarOnOverlayClick:U??i.closeSidebarOnOverlayClick}},[a,u,c,T,p,v,S,I,R,P,L,_,i,W,D,j,H,g,x,w,Y,X,V,G,U]);return l.useEffect(()=>{e==="left"?s(N):e==="right"?o(N):e==="bottom"?d(n??"primary",N):we(e)},[e,n,N,s,o,d]),N};function ge({isCollapsed:e,setCollapsed:t,closeSidebarOnClick:n=!0,transitionMs:i,overlayBackgroundColor:s,overlayZIndex:o}){return E.jsx("div",{style:{transitionDuration:`${i}ms`,...Ct,...e?{}:It,...s?{backgroundColor:s}:{},zIndex:o},onMouseDown:d=>{n&&(d.stopPropagation(),t())}})}function Te({size:e,color:t}){const n=l.useRef(null);return l.useEffect(()=>{const i=()=>{n.current&&(n.current.style.opacity="1")},s=()=>{n.current&&(n.current.style.opacity=`${Me}`)};n.current&&(n.current.addEventListener("mouseenter",i),n.current.addEventListener("mouseleave",s))},[]),E.jsx("div",{style:{..._t},children:E.jsxs("svg",{style:{transition:`opacity ${bt}ms ease`,opacity:`${Me}`},ref:n,"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:e,children:[E.jsx("g",{strokeWidth:"0"}),E.jsx("g",{strokeLinecap:"round",strokeLinejoin:"round",children:E.jsx("g",{children:E.jsx("path",{clipRule:"evenodd",d:"m9.46967 5.46967c.29289-.29289.76773-.29289 1.06063 0l2.6286 2.62858c.5748.57477 1.0384 1.03835 1.3831 1.44443.355.41812.6278.82432.7818 1.29852.2447.7531.2447 1.5645 0 2.3176-.154.4742-.4268.8804-.7818 1.2985-.3447.4061-.8083.8697-1.3831 1.4444l-2.6286 2.6286c-.2929.2929-.76774.2929-1.06063 0s-.29289-.7677 0-1.0606l2.60593-2.6059c.6027-.6028 1.0225-1.0234 1.3229-1.3773.2947-.3471.4302-.5804.4987-.7912.1469-.4519.1469-.9387 0-1.3906-.0685-.2108-.204-.4441-.4987-.7912-.3004-.3539-.7202-.77451-1.3229-1.37728l-2.60593-2.60589c-.29289-.29289-.29289-.76777 0-1.06066z",fill:t,fillRule:"evenodd"})})})]})})}function je({id:e,toggleRef:t,options:n,showToggle:i=!0,ToggleComponent:s}){var c;const{openSidebar:o,closeSidebar:d,bottomSidebars:a}=z(),u=((c=a[e])==null?void 0:c.isOpen)??!1;return i?E.jsx("div",{ref:t,style:{...Mt,transition:`transform ${n.transitionMs}ms ease, opacity ${n.transitionMs}ms ease`,zIndex:n.toggleZIndex},children:(!u||u&&!n.showOverlay)&&E.jsx("button",{type:"button",onClick:()=>{n.disabled||(u?d("bottom",{id:e}):o("bottom",{id:e}))},disabled:n.disabled,style:{marginBottom:`${n.toggleIconEdgeDistancePx}px`,transform:u?"rotate(90deg)":"rotate(-90deg)"},children:s??E.jsx(Te,{size:n.toggleIconSizePx,color:n.toggleIconColor})})}):null}function ie(e=pe){const t=`(max-width: ${Math.min(e,pe)}px)`,n=()=>typeof window>"u"||typeof window.matchMedia>"u"?!1:window.matchMedia(t).matches,[i,s]=l.useState(n);return l.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia>"u")return;const o=window.matchMedia(t),d=()=>s(o.matches);return d(),o.addEventListener("change",d),()=>o.removeEventListener("change",d)},[t]),i}const Ne=({refs:e,callbacks:t,currentY:n,preventDefault:i,lockPane:s,options:o,scrollableAncestor:d,initialScrollTop:a})=>{if(!e.draggingRef.current)return;const u=n-e.draggingRef.current.startY;if(!e.draggingRef.current.isActivated&&Math.abs(u)>=o.dragActivationDeltaPx){if(d&&t.getIsOpen()){if(d.scrollTop!==a){e.draggingRef.current=null,t.dragSidebar(null);return}const{scrollTop:R,scrollHeight:P,clientHeight:L}=d,_=R>1,W=R+L<P-1;if(u>0&&_||u<0&&W){e.draggingRef.current=null,t.dragSidebar(null);return}}e.draggingRef.current.isActivated=!0,s()}if(!e.draggingRef.current.isActivated)return;e.prevYRef.current=e.currentYRef.current,e.currentYRef.current=n;const c=t.getIsOpen(),T=window.innerHeight;let p=!1;if((c||e.draggingRef.current.startY>=T-o.edgeActivationWidthPx)&&(p=!0),!p){e.draggingRef.current=null,t.dragSidebar(null);return}i();const v=o.sidebarHeightPx,S=o.midAnchorPointPx,I=o.midAnchorPoint&&!o.swipeToOpen&&S<v;if(c)if(I){const R=t.getBottomAnchorState();if(R==="open"){const P=Math.max(0,Math.min(v,u-o.dragActivationDeltaPx));t.dragSidebar(P)}else if(R==="midAnchor"){const P=v-S,L=Math.max(0,Math.min(v,P+u-o.dragActivationDeltaPx));t.dragSidebar(L)}}else{const R=Math.max(0,Math.min(v,u-o.dragActivationDeltaPx));t.dragSidebar(R)}else if(e.draggingRef.current.startY>=T-o.edgeActivationWidthPx)if(I){const R=v-S,P=Math.max(R,Math.min(v,v+u+o.dragActivationDeltaPx));t.dragSidebar(P)}else{const R=Math.max(0,Math.min(v,v+u+o.dragActivationDeltaPx));t.dragSidebar(R)}},Fe=({refs:e,callbacks:t,options:n,onDragEnd:i})=>{if(!e.draggingRef.current)return;if(!e.draggingRef.current.isActivated){e.draggingRef.current=null,e.currentYRef.current=null,e.prevYRef.current=null;return}const s=e.currentYRef.current??e.draggingRef.current.startY,o=e.prevYRef.current??e.draggingRef.current.startY,d=e.draggingRef.current.startY,a=t.getIsOpen(),u=window.innerHeight;e.draggingRef.current=null,e.currentYRef.current=null,e.prevYRef.current=null,i();const c=s<o,T=s>=o,p=d>=u-n.edgeActivationWidthPx,v=n.midAnchorPointPx,S=n.sidebarHeightPx,I=n.midAnchorPoint&&!n.swipeToOpen&&v<S;if(a)if(I){const R=t.getBottomAnchorState(),P=S-v;if(R==="open"){const L=Math.max(0,s-d);T?L>P?t.closeSidebar():t.openToMidAnchor():L<P?t.openSidebarFully():t.closeSidebar(),t.dragSidebar(null)}else if(R==="midAnchor"){const L=S-v,_=Math.max(0,Math.min(S,L+(s-d)));c&&_<P?t.openSidebarFully():t.closeSidebar(),t.dragSidebar(null)}}else T?t.closeSidebar():t.openSidebar(),t.dragSidebar(null);else p&&c?(I?t.openToMidAnchor():t.openSidebar(),t.dragSidebar(null)):(t.closeSidebar(),t.dragSidebar(null))};function Xt(e,t){var H,g;const n=ie(e.mediaQueryWidth),{lockedSidebar:i,setLockedSidebar:s,bottomSidebars:o,openSidebar:d,openSidebarFully:a,closeSidebar:u,dragSidebar:c,openSidebarToMidAnchor:T,activeBottomDragIdRef:p,bottomFocusStackRef:v}=z(),S=((H=o[t])==null?void 0:H.isOpen)??!1,I=((g=o[t])==null?void 0:g.anchorState)??"closed",R=l.useRef(null),P=l.useRef(null),L=l.useRef(null),_=l.useRef(null),W=l.useRef(0),D=l.useRef(null),j=l.useRef(I);l.useEffect(()=>{j.current=I},[I]),l.useEffect(()=>{if(!n||i&&i!=="bottom"||e.disabled)return;const x={getIsOpen:()=>S,openSidebar:()=>d("bottom",{id:t}),openSidebarFully:()=>a("bottom",{id:t}),closeSidebar:()=>u("bottom",{id:t}),dragSidebar:r=>c("bottom",r,{id:t}),getBottomAnchorState:()=>j.current,openToMidAnchor:()=>T("bottom",{id:t})},w={draggingRef:R,currentYRef:P,prevYRef:L},Y=()=>p.current!==null&&p.current!==t,X=()=>{const r=v.current;return r.length===0?!0:r[r.length-1]===t},V=()=>{if(Y()){R.current=null;return}p.current=t,s("bottom");const r=_.current;r&&(D.current=r.style.overflowY,r.style.overflowY="hidden")},G=()=>{p.current===t&&(p.current=null);const r=_.current;r&&D.current!==null&&(r.style.overflowY=D.current,D.current=null)};function U(r){var $;if(i&&i!=="bottom"||Y()||!X()||ae(r.target)||r.changedTouches.length===0)return;const h=r.changedTouches[0],O=window.innerHeight,C=x.getIsOpen(),K=h.clientY>=O-e.edgeActivationWidthPx;C&&!e.swipeToClose||!C&&!e.swipeToOpen||(C||K)&&(_.current=ke(r.target),W.current=(($=_.current)==null?void 0:$.scrollTop)??0,Be({refs:w,clientX:h.clientX,clientY:h.clientY,touchId:h.identifier,isMouse:!1}))}function N(r){if(i&&i!=="bottom")return;if(Y()){R.current=null;return}if(!R.current||R.current.isMouse)return;const h=R.current.activeTouchId,O=ye(r.changedTouches,h);O&&Ne({refs:w,callbacks:x,currentY:O.clientY,preventDefault:()=>r.preventDefault(),lockPane:V,options:e,scrollableAncestor:_.current,initialScrollTop:W.current})}function Z(r){if(i&&i!=="bottom"||!R.current||R.current.isMouse)return;const h=R.current.activeTouchId;Re(r.changedTouches,h)&&Fe({refs:w,callbacks:x,options:e,onDragEnd:G})}function Q(){i&&i!=="bottom"||!R.current||R.current.isMouse||(G(),Dt({refs:w,dragSidebar:x.dragSidebar,onDeactivate:()=>{}}))}function J(r){var K;if(i&&i!=="bottom"||Y()||!X()||ae(r.target)||r.button!==0)return;const h=window.innerHeight,O=x.getIsOpen(),C=r.clientY>=h-e.edgeActivationWidthPx;O&&!e.swipeToClose||!O&&!e.swipeToOpen||(O||C)&&(_.current=ke(r.target),W.current=((K=_.current)==null?void 0:K.scrollTop)??0,Be({refs:w,clientX:r.clientX,clientY:r.clientY,touchId:null,isMouse:!0}))}function B(r){if(!(i&&i!=="bottom")){if(Y()){R.current=null;return}!R.current||!R.current.isMouse||Ne({refs:w,callbacks:x,currentY:r.clientY,preventDefault:()=>r.preventDefault(),lockPane:V,options:e,scrollableAncestor:_.current,initialScrollTop:W.current})}}function te(){i&&i!=="bottom"||!R.current||!R.current.isMouse||Fe({refs:w,callbacks:x,options:e,onDragEnd:G})}return window.addEventListener("touchstart",U,{passive:!0}),window.addEventListener("touchmove",N,{passive:!1}),window.addEventListener("touchend",Z,{passive:!0}),window.addEventListener("touchcancel",Q,{passive:!0}),window.addEventListener("mousedown",J,{passive:!0}),window.addEventListener("mousemove",B,{passive:!1}),window.addEventListener("mouseup",te,{passive:!0}),()=>{window.removeEventListener("touchstart",U),window.removeEventListener("touchmove",N),window.removeEventListener("touchend",Z),window.removeEventListener("touchcancel",Q),window.removeEventListener("mousedown",J),window.removeEventListener("mousemove",B),window.removeEventListener("mouseup",te)}},[t,n,S,d,a,u,c,i,s,e,T,p,v])}function Yt({id:e="primary",className:t,children:n,ToggleComponent:i,...s}){var I;if((n==null?void 0:n.type)===E.Fragment)throw new Error("Fragments is not allowed in SwipeBarBottom");const{bottomSidebars:o,closeSidebar:d,registerBottomSidebar:a,unregisterBottomSidebar:u}=z(),c=l.useRef(null),T=l.useRef(null);l.useEffect(()=>(a(e,{sidebarRef:c,toggleRef:T}),()=>u(e)),[e,a,u]);const p=xe("bottom",s,e),v=ie(p.mediaQueryWidth);Xt(p,e);const S=((I=o[e])==null?void 0:I.isOpen)??!1;return E.jsxs(E.Fragment,{children:[p.showOverlay&&E.jsx(ge,{isCollapsed:!S,setCollapsed:()=>d("bottom",{id:e}),closeSidebarOnClick:p.closeSidebarOnOverlayClick,transitionMs:p.transitionMs,overlayBackgroundColor:p.overlayBackgroundColor,overlayZIndex:p.overlayZIndex}),E.jsx(je,{id:e,toggleRef:T,options:p,showToggle:p.showToggle,ToggleComponent:i}),E.jsx("div",{ref:c,style:{...Ot,...At,...p.isAbsolute||v?Pt:{},...t?{}:{backgroundColor:ve},zIndex:p.swipeBarZIndex},className:t,children:n})]})}function He({options:e,showToggle:t=!0,ToggleComponent:n}){const{openSidebar:i,leftToggleRef:s,isLeftOpen:o,closeSidebar:d}=z();return t?E.jsx("div",{ref:s,style:{...Le,transition:`transform ${e.transitionMs}ms ease, opacity ${e.transitionMs}ms ease`,left:0,zIndex:e.toggleZIndex},children:(!o||o&&!e.showOverlay)&&E.jsx("button",{type:"button",onClick:()=>{e.disabled||(o?d("left"):i("left"))},disabled:e.disabled,style:{marginLeft:`${e.toggleIconEdgeDistancePx}px`,...o?{transform:"rotate(180deg)"}:{}},children:n??E.jsx(Te,{size:e.toggleIconSizePx,color:e.toggleIconColor})})}):null}const Ge=({refs:e,callbacks:t,currentX:n,preventDefault:i,lockPane:s,options:o})=>{if(!e.draggingRef.current)return;const d=n-e.draggingRef.current.startX;if(!e.draggingRef.current.isActivated&&Math.abs(d)>=o.dragActivationDeltaPx&&(e.draggingRef.current.isActivated=!0,s()),!e.draggingRef.current.isActivated)return;e.prevXRef.current=e.currentXRef.current,e.currentXRef.current=n;const a=t.getIsOpen();let u=!1;if((a||e.draggingRef.current.startX<=o.edgeActivationWidthPx)&&(u=!0),!u){e.draggingRef.current=null,t.dragSidebar(null);return}i();const c=o.sidebarWidthPx;if(a){const T=Math.min(0,Math.max(-c,d+o.dragActivationDeltaPx));t.dragSidebar(T)}else if(e.draggingRef.current.startX<=o.edgeActivationWidthPx){const T=Math.min(0,Math.max(-c,-c+d-o.dragActivationDeltaPx));t.dragSidebar(T)}},Ue=({refs:e,callbacks:t,options:n})=>{if(!e.draggingRef.current)return;if(!e.draggingRef.current.isActivated){e.draggingRef.current=null,e.currentXRef.current=null,e.prevXRef.current=null;return}const i=e.currentXRef.current??e.draggingRef.current.startX,s=e.prevXRef.current??e.draggingRef.current.startX,o=e.draggingRef.current.startX,d=t.getIsOpen();e.draggingRef.current=null,e.currentXRef.current=null,e.prevXRef.current=null;const a=i>=s,u=i<s,c=o<=n.edgeActivationWidthPx;d?(u?t.closeSidebar():t.openSidebar(),t.dragSidebar(null)):c&&a?(t.openSidebar(),t.dragSidebar(null)):(t.closeSidebar(),t.dragSidebar(null))};function Bt(e){const t=ie(e.mediaQueryWidth),{lockedSidebar:n,setLockedSidebar:i,isLeftOpen:s,openSidebar:o,closeSidebar:d,dragSidebar:a,leftSidebarRef:u}=z(),c=l.useRef(null),T=l.useRef(null),p=l.useRef(null);l.useEffect(()=>{if(!t||n&&n!=="left"||e.disabled)return;const v={getIsOpen:()=>s,openSidebar:()=>o("left"),closeSidebar:()=>d("left"),dragSidebar:g=>a("left",g)},S={draggingRef:c,currentXRef:T,prevXRef:p},I=()=>i("left"),R=()=>i(null);function P(g){if(n&&n!=="left"||ae(g.target)||g.changedTouches.length===0)return;const x=g.changedTouches[0],w=v.getIsOpen(),Y=x.clientX<=e.edgeActivationWidthPx;w&&!e.swipeToClose||!w&&!e.swipeToOpen||(w||Y)&&fe({refs:S,clientX:x.clientX,clientY:x.clientY,touchId:x.identifier,isMouse:!1})}function L(g){if(n&&n!=="left"||!c.current||c.current.isMouse)return;const x=c.current.activeTouchId,w=ye(g.changedTouches,x);w&&Ge({refs:S,callbacks:v,currentX:w.clientX,preventDefault:()=>g.preventDefault(),lockPane:I,options:e})}function _(g){if(n&&n!=="left"||!c.current||c.current.isMouse)return;const x=c.current.activeTouchId;Re(g.changedTouches,x)&&Ue({refs:S,callbacks:v,options:e})}function W(){n&&n!=="left"||!c.current||c.current.isMouse||We({refs:S,dragSidebar:v.dragSidebar,onDeactivate:R})}function D(g){if(n&&n!=="left"||ae(g.target)||g.button!==0)return;const x=v.getIsOpen(),w=g.clientX<=e.edgeActivationWidthPx;x&&!e.swipeToClose||!x&&!e.swipeToOpen||(x||w)&&fe({refs:S,clientX:g.clientX,clientY:g.clientY,touchId:null,isMouse:!0})}function j(g){n&&n!=="left"||!c.current||!c.current.isMouse||Ge({refs:S,callbacks:v,currentX:g.clientX,preventDefault:()=>g.preventDefault(),lockPane:I,options:e})}function H(){n&&n!=="left"||!c.current||!c.current.isMouse||Ue({refs:S,callbacks:v,options:e})}return window.addEventListener("touchstart",P,{passive:!0}),window.addEventListener("touchmove",L,{passive:!1}),window.addEventListener("touchend",_,{passive:!0}),window.addEventListener("touchcancel",W,{passive:!0}),window.addEventListener("mousedown",D,{passive:!0}),window.addEventListener("mousemove",j,{passive:!1}),window.addEventListener("mouseup",H,{passive:!0}),()=>{window.removeEventListener("touchstart",P),window.removeEventListener("touchmove",L),window.removeEventListener("touchend",_),window.removeEventListener("touchcancel",W),window.removeEventListener("mousedown",D),window.removeEventListener("mousemove",j),window.removeEventListener("mouseup",H)}},[t,s,o,d,a,n,i,u,e])}function Wt({className:e,children:t,ToggleComponent:n,...i}){if((t==null?void 0:t.type)===E.Fragment)throw new Error("Fragments is not allowed in SwipeBarLeft");const{isLeftOpen:s,closeSidebar:o,leftSidebarRef:d}=z(),a=xe("left",i),u=ie(a.mediaQueryWidth);return Bt(a),E.jsxs(E.Fragment,{children:[a.showOverlay&&E.jsx(ge,{isCollapsed:!s,setCollapsed:()=>o("left"),closeSidebarOnClick:a.closeSidebarOnOverlayClick,transitionMs:a.transitionMs,overlayBackgroundColor:a.overlayBackgroundColor,overlayZIndex:a.overlayZIndex}),E.jsx(He,{options:a,showToggle:a.showToggle,ToggleComponent:n}),E.jsx("div",{ref:d,style:{..._e,...Rt,...a.isAbsolute||u?Tt:{},...e?{}:{backgroundColor:ve},zIndex:a.swipeBarZIndex},className:e,children:t})]})}function Ze({options:e,showToggle:t=!0,ToggleComponent:n}){const{openSidebar:i,rightToggleRef:s,isRightOpen:o,closeSidebar:d}=z();return t?E.jsx("div",{ref:s,style:{...Le,transition:`transform ${e.transitionMs}ms ease, opacity ${e.transitionMs}ms ease`,right:0,zIndex:e.toggleZIndex},children:(!o||o&&!e.showOverlay)&&E.jsx("button",{type:"button",onClick:()=>{e.disabled||(o?d("right"):i("right"))},disabled:e.disabled,style:{marginRight:`${e.toggleIconEdgeDistancePx}px`,...o?{}:{transform:"rotate(180deg)"}},children:n??E.jsx(Te,{size:e.toggleIconSizePx,color:e.toggleIconColor})})}):null}const ze=({refs:e,callbacks:t,currentX:n,preventDefault:i,lockPane:s,options:o})=>{if(!e.draggingRef.current)return;const d=window.innerWidth,a=n-e.draggingRef.current.startX,u=e.draggingRef.current.startX>=d-o.edgeActivationWidthPx,c=e.draggingRef.current.isActivated;if(!c&&Math.abs(a)>=o.dragActivationDeltaPx&&(e.draggingRef.current.isActivated=!0,s()),!c)return;e.prevXRef.current=e.currentXRef.current,e.currentXRef.current=n;const T=t.getIsOpen();let p=!1;if((T||u)&&(p=!0),!p){e.draggingRef.current=null,t.dragSidebar(null);return}i();const v=o.sidebarWidthPx;if(T){const S=Math.max(0,Math.min(v,a-o.dragActivationDeltaPx));t.dragSidebar(S)}else{const S=Math.max(0,Math.min(v,v+a+o.dragActivationDeltaPx));t.dragSidebar(S)}},Ve=({refs:e,callbacks:t,options:n})=>{if(!e.draggingRef.current)return;if(!e.draggingRef.current.isActivated){e.draggingRef.current=null,e.currentXRef.current=null,e.prevXRef.current=null;return}const i=e.currentXRef.current??e.draggingRef.current.startX,s=e.prevXRef.current??e.draggingRef.current.startX,o=e.draggingRef.current.startX,d=t.getIsOpen(),a=window.innerWidth;e.draggingRef.current=null,e.currentXRef.current=null,e.prevXRef.current=null;const u=i>s,c=i<s,T=o>=a-n.edgeActivationWidthPx;d?(u?t.closeSidebar():t.openSidebar(),t.dragSidebar(null)):T&&c?(t.openSidebar(),t.dragSidebar(null)):(t.closeSidebar(),t.dragSidebar(null))};function kt(e){const t=ie(e.mediaQueryWidth),{lockedSidebar:n,setLockedSidebar:i,isRightOpen:s,openSidebar:o,closeSidebar:d,dragSidebar:a,rightSidebarRef:u}=z(),c=l.useRef(null),T=l.useRef(null),p=l.useRef(null);l.useEffect(()=>{if(!t||n&&n!=="right"||e.disabled)return;const v={getIsOpen:()=>s,openSidebar:()=>o("right"),closeSidebar:()=>d("right"),dragSidebar:g=>a("right",g)},S={draggingRef:c,currentXRef:T,prevXRef:p},I=()=>i("right"),R=()=>i(null);function P(g){if(n&&n!=="right"||ae(g.target)||g.changedTouches.length===0)return;const x=g.changedTouches[0],w=window.innerWidth,Y=v.getIsOpen(),X=x.clientX>=w-e.edgeActivationWidthPx;Y&&!e.swipeToClose||!Y&&!e.swipeToOpen||(Y||X)&&fe({refs:S,clientX:x.clientX,clientY:x.clientY,touchId:x.identifier,isMouse:!1})}function L(g){if(n&&n!=="right"||!c.current||c.current.isMouse)return;const x=c.current.activeTouchId,w=ye(g.changedTouches,x);w&&ze({refs:S,callbacks:v,currentX:w.clientX,preventDefault:()=>g.preventDefault(),lockPane:I,options:e})}function _(g){if(n&&n!=="right"||!c.current||c.current.isMouse)return;const x=c.current.activeTouchId;Re(g.changedTouches,x)&&Ve({refs:S,callbacks:v,options:e})}function W(){n&&n!=="right"||!c.current||c.current.isMouse||We({refs:S,dragSidebar:v.dragSidebar,onDeactivate:R})}function D(g){if(n&&n!=="right"||ae(g.target)||g.button!==0)return;const x=window.innerWidth,w=v.getIsOpen(),Y=g.clientX>=x-e.edgeActivationWidthPx;w&&!e.swipeToClose||!w&&!e.swipeToOpen||(w||Y)&&fe({refs:S,clientX:g.clientX,clientY:g.clientY,touchId:null,isMouse:!0})}function j(g){n&&n!=="right"||!c.current||!c.current.isMouse||ze({refs:S,callbacks:v,currentX:g.clientX,preventDefault:()=>g.preventDefault(),lockPane:I,options:e})}function H(){n&&n!=="right"||!c.current||!c.current.isMouse||Ve({refs:S,callbacks:v,options:e})}return window.addEventListener("touchstart",P,{passive:!0}),window.addEventListener("touchmove",L,{passive:!1}),window.addEventListener("touchend",_,{passive:!0}),window.addEventListener("touchcancel",W,{passive:!0}),window.addEventListener("mousedown",D,{passive:!0}),window.addEventListener("mousemove",j,{passive:!1}),window.addEventListener("mouseup",H,{passive:!0}),()=>{window.removeEventListener("touchstart",P),window.removeEventListener("touchmove",L),window.removeEventListener("touchend",_),window.removeEventListener("touchcancel",W),window.removeEventListener("mousedown",D),window.removeEventListener("mousemove",j),window.removeEventListener("mouseup",H)}},[t,s,o,d,a,n,i,u,e])}function jt({className:e,children:t,ToggleComponent:n,...i}){if((t==null?void 0:t.type)===E.Fragment)throw new Error("Fragments is not allowed in SwipeBarRight");const{isRightOpen:s,closeSidebar:o,rightSidebarRef:d}=z(),a=xe("right",i),u=ie(a.mediaQueryWidth);return kt(a),E.jsxs(E.Fragment,{children:[a.showOverlay&&E.jsx(ge,{isCollapsed:!s,setCollapsed:()=>o("right"),closeSidebarOnClick:a.closeSidebarOnOverlayClick,transitionMs:a.transitionMs,overlayBackgroundColor:a.overlayBackgroundColor,overlayZIndex:a.overlayZIndex}),E.jsx(Ze,{options:a,showToggle:a.showToggle,ToggleComponent:n}),E.jsx("div",{ref:d,style:{..._e,...xt,...a.isAbsolute||u?Et:{},...e?{}:{backgroundColor:ve},zIndex:a.swipeBarZIndex},className:e,children:t})]})}F.Overlay=ge,F.SwipeBarBottom=Yt,F.SwipeBarLeft=Wt,F.SwipeBarProvider=tt,F.SwipeBarRight=jt,F.ToggleBottom=je,F.ToggleLeft=He,F.ToggleRight=Ze,F.useMediaQuery=ie,F.useSwipeBarContext=z,Object.defineProperty(F,Symbol.toStringTag,{value:"Module"})});
@@ -47,6 +47,7 @@ export type TSwipeBarOptions = {
47
47
  midAnchorPoint?: boolean;
48
48
  midAnchorPointPx?: number;
49
49
  disabled?: boolean;
50
+ closeSidebarOnOverlayClick?: boolean;
50
51
  };
51
52
  export type TSwipeSidebar = TSwipeBarOptions & {
52
53
  id?: string;
@@ -265,6 +266,7 @@ export declare const useSetMergedOptions: (side: TSidebarSide, options: TSwipeBa
265
266
  midAnchorPoint: boolean;
266
267
  midAnchorPointPx: number;
267
268
  disabled: boolean;
269
+ closeSidebarOnOverlayClick: boolean;
268
270
  };
269
271
  export {};
270
272
  //# sourceMappingURL=swipeSidebarShared.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"swipeSidebarShared.d.ts","sourceRoot":"","sources":["../src/swipeSidebarShared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,YAAY,EAAE,KAAK,SAAS,EAAsB,MAAM,OAAO,CAAC;AAGlG,MAAM,MAAM,iBAAiB,GAAG;IAC/B,SAAS,EAAE,MAAM,OAAO,CAAC;IACzB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,WAAW,EAAE,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACxB,MAAM,EAAE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AAS,EACzB,WAAW,MAAM,GAAG,IAAI,KACtB,OAOF,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,MAAM,YAAY,EAAE,SAAS,gBAAgB,EAAE,KAAK,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;CAyG7F,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { TDragRefs, TDragRefsY, TSwipeBarOptions } from './swipeSidebarShared';
2
+
3
+ export declare function makeDragRefs(overrides?: {
4
+ startX?: number;
5
+ currentX?: number;
6
+ prevX?: number;
7
+ isActivated?: boolean;
8
+ }): TDragRefs;
9
+ export declare function makeDragRefsY(overrides?: {
10
+ startY?: number;
11
+ currentY?: number;
12
+ prevY?: number;
13
+ isActivated?: boolean;
14
+ }): TDragRefsY;
15
+ export declare function makeCallbacks(): {
16
+ getIsOpen: import('vitest').Mock<() => boolean>;
17
+ openSidebar: import('vitest').Mock<(...args: any[]) => any>;
18
+ closeSidebar: import('vitest').Mock<(...args: any[]) => any>;
19
+ dragSidebar: import('vitest').Mock<(...args: any[]) => any>;
20
+ };
21
+ export declare function makeBottomCallbacks(): {
22
+ getBottomAnchorState: import('vitest').Mock<() => "closed" | "midAnchor" | "open">;
23
+ openToMidAnchor: import('vitest').Mock<(...args: any[]) => any>;
24
+ openSidebarFully: import('vitest').Mock<(...args: any[]) => any>;
25
+ getIsOpen: import('vitest').Mock<() => boolean>;
26
+ openSidebar: import('vitest').Mock<(...args: any[]) => any>;
27
+ closeSidebar: import('vitest').Mock<(...args: any[]) => any>;
28
+ dragSidebar: import('vitest').Mock<(...args: any[]) => any>;
29
+ };
30
+ export declare function makeOptions(overrides?: Partial<TSwipeBarOptions>): Required<TSwipeBarOptions>;
31
+ export declare function makeTouchList(...touches: Array<{
32
+ identifier: number;
33
+ clientX: number;
34
+ clientY: number;
35
+ }>): TouchList;
36
+ //# sourceMappingURL=test-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-utils.d.ts","sourceRoot":"","sources":["../src/test-utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAc,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAEhG,wBAAgB,YAAY,CAAC,SAAS,CAAC,EAAE;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;CACtB,GAAG,SAAS,CAeZ;AAED,wBAAgB,aAAa,CAAC,SAAS,CAAC,EAAE;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;CACtB,GAAG,UAAU,CAeb;AAED,wBAAgB,aAAa;;;;;EAO5B;AAED,wBAAgB,mBAAmB;sDAGW,QAAQ,GAAG,WAAW,GAAG,MAAM;;;;;;;EAI5E;AAED,wBAAgB,WAAW,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,QAAQ,CAAC,gBAAgB,CAAC,CA4B7F;AAED,wBAAgB,aAAa,CAC5B,GAAG,OAAO,EAAE,KAAK,CAAC;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,GACzE,SAAS,CAmBX"}
@@ -1 +1 @@
1
- {"version":3,"file":"useSwipeBarContext.d.ts","sourceRoot":"","sources":["../src/useSwipeBarContext.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;yEAOw0D,CAAC;8EAAqE,CAAC;oFAA2E,CAAC;0EAAiE,CAAC;mGAA0F,CAAC;;;;;;;;;;CADtpE,CAAC"}
1
+ {"version":3,"file":"useSwipeBarContext.d.ts","sourceRoot":"","sources":["../src/useSwipeBarContext.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;yEAOy2D,CAAC;8EAAqE,CAAC;oFAA2E,CAAC;0EAAiE,CAAC;mGAA0F,CAAC;;;;;;;;;;CADvrE,CAAC"}
@@ -1,4 +1,28 @@
1
- import { TSwipeBarOptions } from './swipeSidebarShared';
1
+ import { TDragRefsY, TSidebarCallbacks, TSwipeBarOptions } from './swipeSidebarShared';
2
2
 
3
+ export type HandleBottomDragMoveProps = {
4
+ refs: TDragRefsY;
5
+ callbacks: TSidebarCallbacks & {
6
+ getBottomAnchorState: () => "closed" | "midAnchor" | "open";
7
+ };
8
+ currentY: number;
9
+ preventDefault: () => void;
10
+ lockPane: () => void;
11
+ options: Required<TSwipeBarOptions>;
12
+ scrollableAncestor: HTMLElement | null;
13
+ initialScrollTop: number;
14
+ };
15
+ export declare const handleBottomDragMove: ({ refs, callbacks, currentY, preventDefault, lockPane, options, scrollableAncestor, initialScrollTop, }: HandleBottomDragMoveProps) => void;
16
+ export type HandleBottomDragEndProps = {
17
+ refs: TDragRefsY;
18
+ callbacks: TSidebarCallbacks & {
19
+ getBottomAnchorState: () => "closed" | "midAnchor" | "open";
20
+ openToMidAnchor: () => void;
21
+ openSidebarFully: () => void;
22
+ };
23
+ options: Required<TSwipeBarOptions>;
24
+ onDragEnd: () => void;
25
+ };
26
+ export declare const handleBottomDragEnd: ({ refs, callbacks, options, onDragEnd, }: HandleBottomDragEndProps) => void;
3
27
  export declare function useSwipeBottomSidebar(options: Required<TSwipeBarOptions>, id: string): void;
4
28
  //# sourceMappingURL=useSwipeBottomSidebar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSwipeBottomSidebar.d.ts","sourceRoot":"","sources":["../src/useSwipeBottomSidebar.ts"],"names":[],"mappings":"AACA,OAAO,EAIN,KAAK,gBAAgB,EAOrB,MAAM,sBAAsB,CAAC;AAkR9B,wBAAgB,qBAAq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C,EAAE,EAAE,EAAE,MAAM,QAwQpF"}
@@ -1,4 +1,20 @@
1
- import { TSwipeBarOptions } from './swipeSidebarShared';
1
+ import { TDragRefs, TSidebarCallbacks, TSwipeBarOptions } from './swipeSidebarShared';
2
2
 
3
+ export type HandleLeftDragMoveProps = {
4
+ refs: TDragRefs;
5
+ callbacks: TSidebarCallbacks;
6
+ currentX: number;
7
+ preventDefault: () => void;
8
+ lockPane: () => void;
9
+ options: Required<TSwipeBarOptions>;
10
+ };
11
+ export declare const handleLeftDragMove: ({ refs, callbacks, currentX, preventDefault, lockPane, options, }: HandleLeftDragMoveProps) => void;
12
+ export type HandleLeftDragEndProps = {
13
+ refs: TDragRefs;
14
+ leftSidebarRef: React.RefObject<HTMLDivElement | null>;
15
+ callbacks: TSidebarCallbacks;
16
+ options: Required<TSwipeBarOptions>;
17
+ };
18
+ export declare const handleLeftDragEnd: ({ refs, callbacks, options, }: HandleLeftDragEndProps) => void;
3
19
  export declare function useSwipeLeftSidebar(options: Required<TSwipeBarOptions>): void;
4
20
  //# sourceMappingURL=useSwipeLeftSidebar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSwipeLeftSidebar.d.ts","sourceRoot":"","sources":["../src/useSwipeLeftSidebar.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,gBAAgB,EAMtB,MAAM,sBAAsB,CAAC;AAuI9B,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,QAAQ,CAAC,gBAAgB,CAAC,QAsLtE"}
1
+ {"version":3,"file":"useSwipeLeftSidebar.d.ts","sourceRoot":"","sources":["../src/useSwipeLeftSidebar.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,SAAS,EAEd,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EAMtB,MAAM,sBAAsB,CAAC;AAI9B,MAAM,MAAM,uBAAuB,GAAG;IACpC,IAAI,EAAE,SAAS,CAAC;IAChB,SAAS,EAAE,iBAAiB,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,EAAE,QAAQ,CAAC,gBAAgB,CAAC,CAAC;CACrC,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,mEAOhC,uBAAuB,SA4DzB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,EAAE,SAAS,CAAC;IAChB,cAAc,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IACvD,SAAS,EAAE,iBAAiB,CAAC;IAC7B,OAAO,EAAE,QAAQ,CAAC,gBAAgB,CAAC,CAAC;CACrC,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,+BAI/B,sBAAsB,SAwCxB,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,QAAQ,CAAC,gBAAgB,CAAC,QAsLtE"}
@@ -1,4 +1,20 @@
1
- import { TSwipeBarOptions } from './swipeSidebarShared';
1
+ import { TDragRefs, TSidebarCallbacks, TSwipeBarOptions } from './swipeSidebarShared';
2
2
 
3
+ export type HandleRightDragMoveProps = {
4
+ refs: TDragRefs;
5
+ callbacks: TSidebarCallbacks;
6
+ currentX: number;
7
+ preventDefault: () => void;
8
+ lockPane: () => void;
9
+ options: Required<TSwipeBarOptions>;
10
+ };
11
+ export declare const handleRightDragMove: ({ refs, callbacks, currentX, preventDefault, lockPane, options, }: HandleRightDragMoveProps) => void;
12
+ export type HandleRightDragEndProps = {
13
+ refs: TDragRefs;
14
+ rightSidebarRef: React.RefObject<HTMLDivElement | null>;
15
+ callbacks: TSidebarCallbacks;
16
+ options: Required<TSwipeBarOptions>;
17
+ };
18
+ export declare const handleRightDragEnd: ({ refs, callbacks, options }: HandleRightDragEndProps) => void;
3
19
  export declare function useSwipeRightSidebar(options: Required<TSwipeBarOptions>): void;
4
20
  //# sourceMappingURL=useSwipeRightSidebar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSwipeRightSidebar.d.ts","sourceRoot":"","sources":["../src/useSwipeRightSidebar.ts"],"names":[],"mappings":"AACA,OAAO,EAIN,KAAK,gBAAgB,EAMrB,MAAM,sBAAsB,CAAC;AAsJ9B,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,QAAQ,CAAC,gBAAgB,CAAC,QAuLvE"}
1
+ {"version":3,"file":"useSwipeRightSidebar.d.ts","sourceRoot":"","sources":["../src/useSwipeRightSidebar.ts"],"names":[],"mappings":"AACA,OAAO,EACN,KAAK,SAAS,EAEd,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EAMrB,MAAM,sBAAsB,CAAC;AAI9B,MAAM,MAAM,wBAAwB,GAAG;IACtC,IAAI,EAAE,SAAS,CAAC;IAChB,SAAS,EAAE,iBAAiB,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,EAAE,QAAQ,CAAC,gBAAgB,CAAC,CAAC;CACpC,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,mEAOjC,wBAAwB,SA6E1B,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACrC,IAAI,EAAE,SAAS,CAAC;IAChB,eAAe,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IACxD,SAAS,EAAE,iBAAiB,CAAC;IAC7B,OAAO,EAAE,QAAQ,CAAC,gBAAgB,CAAC,CAAC;CACpC,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,8BAA8B,uBAAuB,SA0CvF,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,QAAQ,CAAC,gBAAgB,CAAC,QAuLvE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luciodale/swipe-bar",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "author": "Lucio D'Alessandro",
5
5
  "repository": {
6
6
  "type": "git",