-
Notifications
You must be signed in to change notification settings - Fork 0
/
4882.df433294.iframe.bundle.js
1 lines (1 loc) · 26.9 KB
/
4882.df433294.iframe.bundle.js
1
"use strict";(self.webpackChunk_leather_io_ui=self.webpackChunk_leather_io_ui||[]).push([[4882],{"../../node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/@radix-ui/react-toast/dist/index.mjs":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Kq:()=>$054eb8030ebde76e$export$2881499e37b75b9a,LM:()=>$054eb8030ebde76e$export$d5c6c08dc2d3ca7,bL:()=>$054eb8030ebde76e$export$be92b6f5f03c0fe9,hE:()=>$054eb8030ebde76e$export$f99233281efd08a0});var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("../../node_modules/.pnpm/@[email protected]/node_modules/@babel/runtime/helpers/esm/extends.js"),react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("../../node_modules/.pnpm/[email protected]/node_modules/react/index.js"),react_dom__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/index.js"),_radix_ui_primitive__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("../../node_modules/.pnpm/@[email protected]/node_modules/@radix-ui/primitive/dist/index.mjs"),_radix_ui_react_compose_refs__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("../../node_modules/.pnpm/@[email protected]_@[email protected][email protected]/node_modules/@radix-ui/react-compose-refs/dist/index.mjs"),_radix_ui_react_collection__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("../../node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected]_s5ea4qejjnve37kxbr3xbca2xy/node_modules/@radix-ui/react-collection/dist/index.mjs"),_radix_ui_react_context__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("../../node_modules/.pnpm/@[email protected]_@[email protected][email protected]/node_modules/@radix-ui/react-context/dist/index.mjs"),_radix_ui_react_dismissable_layer__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("../../node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_react-d_j6oxuu3amfkyaikjq4hrxc5pfy/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs"),_radix_ui_react_portal__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__("../../node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/@radix-ui/react-portal/dist/index.mjs"),_radix_ui_react_presence__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("../../node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/@radix-ui/react-presence/dist/index.mjs"),_radix_ui_react_primitive__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("../../node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected]._q2hdzynczbqlprxkwgklkdriia/node_modules/@radix-ui/react-primitive/dist/index.mjs"),_radix_ui_react_use_callback_ref__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("../../node_modules/.pnpm/@[email protected]_@[email protected][email protected]/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs"),_radix_ui_react_use_controllable_state__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("../../node_modules/.pnpm/@[email protected]_@[email protected][email protected]/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs"),_radix_ui_react_use_layout_effect__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__("../../node_modules/.pnpm/@[email protected]_@[email protected][email protected]/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs"),_radix_ui_react_visually_hidden__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("../../node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_react-dom_t562yqnlh5v4kitdumi3rcu3ne/node_modules/@radix-ui/react-visually-hidden/dist/index.mjs");const[$054eb8030ebde76e$var$Collection,$054eb8030ebde76e$var$useCollection,$054eb8030ebde76e$var$createCollectionScope]=(0,_radix_ui_react_collection__WEBPACK_IMPORTED_MODULE_2__.N)("Toast"),[$054eb8030ebde76e$var$createToastContext,$054eb8030ebde76e$export$8a359da18fbc9073]=(0,_radix_ui_react_context__WEBPACK_IMPORTED_MODULE_3__.A)("Toast",[$054eb8030ebde76e$var$createCollectionScope]),[$054eb8030ebde76e$var$ToastProviderProvider,$054eb8030ebde76e$var$useToastProviderContext]=$054eb8030ebde76e$var$createToastContext("ToastProvider"),$054eb8030ebde76e$export$f5d03d415824e0e=props=>{const{__scopeToast,label="Notification",duration=5e3,swipeDirection="right",swipeThreshold=50,children}=props,[viewport,setViewport]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),[toastCount,setToastCount]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0),isFocusedToastEscapeKeyDownRef=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(!1),isClosePausedRef=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(!1);return(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)($054eb8030ebde76e$var$Collection.Provider,{scope:__scopeToast},(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)($054eb8030ebde76e$var$ToastProviderProvider,{scope:__scopeToast,label,duration,swipeDirection,swipeThreshold,toastCount,viewport,onViewportChange:setViewport,onToastAdd:(0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((()=>setToastCount((prevCount=>prevCount+1))),[]),onToastRemove:(0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((()=>setToastCount((prevCount=>prevCount-1))),[]),isFocusedToastEscapeKeyDownRef,isClosePausedRef},children))};$054eb8030ebde76e$export$f5d03d415824e0e.propTypes={label(props){if(props.label&&"string"==typeof props.label&&!props.label.trim()){return new Error("Invalid prop `label` supplied to `ToastProvider`. Expected non-empty `string`.")}return null}};const $054eb8030ebde76e$var$VIEWPORT_DEFAULT_HOTKEY=["F8"],$054eb8030ebde76e$export$6192c2425ecfd989=(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(((props,forwardedRef)=>{const{__scopeToast,hotkey=$054eb8030ebde76e$var$VIEWPORT_DEFAULT_HOTKEY,label="Notifications ({hotkey})",...viewportProps}=props,context=$054eb8030ebde76e$var$useToastProviderContext("ToastViewport",__scopeToast),getItems=$054eb8030ebde76e$var$useCollection(__scopeToast),wrapperRef=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null),headFocusProxyRef=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null),tailFocusProxyRef=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null),ref=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null),composedRefs=(0,_radix_ui_react_compose_refs__WEBPACK_IMPORTED_MODULE_4__.s)(forwardedRef,ref,context.onViewportChange),hotkeyLabel=hotkey.join("+").replace(/Key/g,"").replace(/Digit/g,""),hasToasts=context.toastCount>0;(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{const handleKeyDown=event=>{var _ref$current;hotkey.every((key=>event[key]||event.code===key))&&(null===(_ref$current=ref.current)||void 0===_ref$current||_ref$current.focus())};return document.addEventListener("keydown",handleKeyDown),()=>document.removeEventListener("keydown",handleKeyDown)}),[hotkey]),(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{const wrapper=wrapperRef.current,viewport=ref.current;if(hasToasts&&wrapper&&viewport){const handlePause=()=>{if(!context.isClosePausedRef.current){const pauseEvent=new CustomEvent("toast.viewportPause");viewport.dispatchEvent(pauseEvent),context.isClosePausedRef.current=!0}},handleResume=()=>{if(context.isClosePausedRef.current){const resumeEvent=new CustomEvent("toast.viewportResume");viewport.dispatchEvent(resumeEvent),context.isClosePausedRef.current=!1}},handleFocusOutResume=event=>{!wrapper.contains(event.relatedTarget)&&handleResume()},handlePointerLeaveResume=()=>{wrapper.contains(document.activeElement)||handleResume()};return wrapper.addEventListener("focusin",handlePause),wrapper.addEventListener("focusout",handleFocusOutResume),wrapper.addEventListener("pointermove",handlePause),wrapper.addEventListener("pointerleave",handlePointerLeaveResume),window.addEventListener("blur",handlePause),window.addEventListener("focus",handleResume),()=>{wrapper.removeEventListener("focusin",handlePause),wrapper.removeEventListener("focusout",handleFocusOutResume),wrapper.removeEventListener("pointermove",handlePause),wrapper.removeEventListener("pointerleave",handlePointerLeaveResume),window.removeEventListener("blur",handlePause),window.removeEventListener("focus",handleResume)}}}),[hasToasts,context.isClosePausedRef]);const getSortedTabbableCandidates=(0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((({tabbingDirection})=>{const tabbableCandidates=getItems().map((toastItem=>{const toastNode=toastItem.ref.current,toastTabbableCandidates=[toastNode,...$054eb8030ebde76e$var$getTabbableCandidates(toastNode)];return"forwards"===tabbingDirection?toastTabbableCandidates:toastTabbableCandidates.reverse()}));return("forwards"===tabbingDirection?tabbableCandidates.reverse():tabbableCandidates).flat()}),[getItems]);return(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{const viewport=ref.current;if(viewport){const handleKeyDown=event=>{const isMetaKey=event.altKey||event.ctrlKey||event.metaKey;if("Tab"===event.key&&!isMetaKey){const focusedElement=document.activeElement,isTabbingBackwards=event.shiftKey;var _headFocusProxyRef$cu;if(event.target===viewport&&isTabbingBackwards)return void(null===(_headFocusProxyRef$cu=headFocusProxyRef.current)||void 0===_headFocusProxyRef$cu||_headFocusProxyRef$cu.focus());const sortedCandidates=getSortedTabbableCandidates({tabbingDirection:isTabbingBackwards?"backwards":"forwards"}),index=sortedCandidates.findIndex((candidate=>candidate===focusedElement));var _headFocusProxyRef$cu2,_tailFocusProxyRef$cu;if($054eb8030ebde76e$var$focusFirst(sortedCandidates.slice(index+1)))event.preventDefault();else isTabbingBackwards?null===(_headFocusProxyRef$cu2=headFocusProxyRef.current)||void 0===_headFocusProxyRef$cu2||_headFocusProxyRef$cu2.focus():null===(_tailFocusProxyRef$cu=tailFocusProxyRef.current)||void 0===_tailFocusProxyRef$cu||_tailFocusProxyRef$cu.focus()}};return viewport.addEventListener("keydown",handleKeyDown),()=>viewport.removeEventListener("keydown",handleKeyDown)}}),[getItems,getSortedTabbableCandidates]),(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_radix_ui_react_dismissable_layer__WEBPACK_IMPORTED_MODULE_5__.lg,{ref:wrapperRef,role:"region","aria-label":label.replace("{hotkey}",hotkeyLabel),tabIndex:-1,style:{pointerEvents:hasToasts?void 0:"none"}},hasToasts&&(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)($054eb8030ebde76e$var$FocusProxy,{ref:headFocusProxyRef,onFocusFromOutsideViewport:()=>{$054eb8030ebde76e$var$focusFirst(getSortedTabbableCandidates({tabbingDirection:"forwards"}))}}),(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)($054eb8030ebde76e$var$Collection.Slot,{scope:__scopeToast},(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_radix_ui_react_primitive__WEBPACK_IMPORTED_MODULE_6__.sG.ol,(0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_7__.A)({tabIndex:-1},viewportProps,{ref:composedRefs}))),hasToasts&&(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)($054eb8030ebde76e$var$FocusProxy,{ref:tailFocusProxyRef,onFocusFromOutsideViewport:()=>{$054eb8030ebde76e$var$focusFirst(getSortedTabbableCandidates({tabbingDirection:"backwards"}))}}))})),$054eb8030ebde76e$var$FocusProxy=(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(((props,forwardedRef)=>{const{__scopeToast,onFocusFromOutsideViewport,...proxyProps}=props,context=$054eb8030ebde76e$var$useToastProviderContext("ToastFocusProxy",__scopeToast);return(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_radix_ui_react_visually_hidden__WEBPACK_IMPORTED_MODULE_8__.s,(0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_7__.A)({"aria-hidden":!0,tabIndex:0},proxyProps,{ref:forwardedRef,style:{position:"fixed"},onFocus:event=>{var _context$viewport;const prevFocusedElement=event.relatedTarget;!(null!==(_context$viewport=context.viewport)&&void 0!==_context$viewport&&_context$viewport.contains(prevFocusedElement))&&onFocusFromOutsideViewport()}}))})),$054eb8030ebde76e$export$8d8dc7d5f743331b=(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(((props,forwardedRef)=>{const{forceMount,open:openProp,defaultOpen,onOpenChange,...toastProps}=props,[open=!0,setOpen]=(0,_radix_ui_react_use_controllable_state__WEBPACK_IMPORTED_MODULE_9__.i)({prop:openProp,defaultProp:defaultOpen,onChange:onOpenChange});return(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_radix_ui_react_presence__WEBPACK_IMPORTED_MODULE_10__.C,{present:forceMount||open},(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)($054eb8030ebde76e$var$ToastImpl,(0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_7__.A)({open},toastProps,{ref:forwardedRef,onClose:()=>setOpen(!1),onPause:(0,_radix_ui_react_use_callback_ref__WEBPACK_IMPORTED_MODULE_11__.c)(props.onPause),onResume:(0,_radix_ui_react_use_callback_ref__WEBPACK_IMPORTED_MODULE_11__.c)(props.onResume),onSwipeStart:(0,_radix_ui_primitive__WEBPACK_IMPORTED_MODULE_12__.m)(props.onSwipeStart,(event=>{event.currentTarget.setAttribute("data-swipe","start")})),onSwipeMove:(0,_radix_ui_primitive__WEBPACK_IMPORTED_MODULE_12__.m)(props.onSwipeMove,(event=>{const{x,y}=event.detail.delta;event.currentTarget.setAttribute("data-swipe","move"),event.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${x}px`),event.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${y}px`)})),onSwipeCancel:(0,_radix_ui_primitive__WEBPACK_IMPORTED_MODULE_12__.m)(props.onSwipeCancel,(event=>{event.currentTarget.setAttribute("data-swipe","cancel"),event.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),event.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),event.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),event.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")})),onSwipeEnd:(0,_radix_ui_primitive__WEBPACK_IMPORTED_MODULE_12__.m)(props.onSwipeEnd,(event=>{const{x,y}=event.detail.delta;event.currentTarget.setAttribute("data-swipe","end"),event.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),event.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),event.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${x}px`),event.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${y}px`),setOpen(!1)}))})))})),[$054eb8030ebde76e$var$ToastInteractiveProvider,$054eb8030ebde76e$var$useToastInteractiveContext]=$054eb8030ebde76e$var$createToastContext("Toast",{onClose(){}}),$054eb8030ebde76e$var$ToastImpl=(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(((props,forwardedRef)=>{const{__scopeToast,type="foreground",duration:durationProp,open,onClose,onEscapeKeyDown,onPause,onResume,onSwipeStart,onSwipeMove,onSwipeCancel,onSwipeEnd,...toastProps}=props,context=$054eb8030ebde76e$var$useToastProviderContext("Toast",__scopeToast),[node1,setNode]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),composedRefs=(0,_radix_ui_react_compose_refs__WEBPACK_IMPORTED_MODULE_4__.s)(forwardedRef,(node=>setNode(node))),pointerStartRef=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null),swipeDeltaRef=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null),duration1=durationProp||context.duration,closeTimerStartTimeRef=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(0),closeTimerRemainingTimeRef=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(duration1),closeTimerRef=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(0),{onToastAdd,onToastRemove}=context,handleClose=(0,_radix_ui_react_use_callback_ref__WEBPACK_IMPORTED_MODULE_11__.c)((()=>{var _context$viewport2;(null==node1?void 0:node1.contains(document.activeElement))&&(null===(_context$viewport2=context.viewport)||void 0===_context$viewport2||_context$viewport2.focus()),onClose()})),startTimer=(0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((duration=>{duration&&duration!==1/0&&(window.clearTimeout(closeTimerRef.current),closeTimerStartTimeRef.current=(new Date).getTime(),closeTimerRef.current=window.setTimeout(handleClose,duration))}),[handleClose]);(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{const viewport=context.viewport;if(viewport){const handleResume=()=>{startTimer(closeTimerRemainingTimeRef.current),null==onResume||onResume()},handlePause=()=>{const elapsedTime=(new Date).getTime()-closeTimerStartTimeRef.current;closeTimerRemainingTimeRef.current=closeTimerRemainingTimeRef.current-elapsedTime,window.clearTimeout(closeTimerRef.current),null==onPause||onPause()};return viewport.addEventListener("toast.viewportPause",handlePause),viewport.addEventListener("toast.viewportResume",handleResume),()=>{viewport.removeEventListener("toast.viewportPause",handlePause),viewport.removeEventListener("toast.viewportResume",handleResume)}}}),[context.viewport,duration1,onPause,onResume,startTimer]),(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{open&&!context.isClosePausedRef.current&&startTimer(duration1)}),[open,duration1,context.isClosePausedRef,startTimer]),(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>(onToastAdd(),()=>onToastRemove())),[onToastAdd,onToastRemove]);const announceTextContent=(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>node1?$054eb8030ebde76e$var$getAnnounceTextContent(node1):null),[node1]);return context.viewport?(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment,null,announceTextContent&&(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)($054eb8030ebde76e$var$ToastAnnounce,{__scopeToast,role:"status","aria-live":"foreground"===type?"assertive":"polite","aria-atomic":!0},announceTextContent),(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)($054eb8030ebde76e$var$ToastInteractiveProvider,{scope:__scopeToast,onClose:handleClose},(0,react_dom__WEBPACK_IMPORTED_MODULE_1__.createPortal)((0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)($054eb8030ebde76e$var$Collection.ItemSlot,{scope:__scopeToast},(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_radix_ui_react_dismissable_layer__WEBPACK_IMPORTED_MODULE_5__.bL,{asChild:!0,onEscapeKeyDown:(0,_radix_ui_primitive__WEBPACK_IMPORTED_MODULE_12__.m)(onEscapeKeyDown,(()=>{context.isFocusedToastEscapeKeyDownRef.current||handleClose(),context.isFocusedToastEscapeKeyDownRef.current=!1}))},(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_radix_ui_react_primitive__WEBPACK_IMPORTED_MODULE_6__.sG.li,(0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_7__.A)({role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":open?"open":"closed","data-swipe-direction":context.swipeDirection},toastProps,{ref:composedRefs,style:{userSelect:"none",touchAction:"none",...props.style},onKeyDown:(0,_radix_ui_primitive__WEBPACK_IMPORTED_MODULE_12__.m)(props.onKeyDown,(event=>{"Escape"===event.key&&(null==onEscapeKeyDown||onEscapeKeyDown(event.nativeEvent),event.nativeEvent.defaultPrevented||(context.isFocusedToastEscapeKeyDownRef.current=!0,handleClose()))})),onPointerDown:(0,_radix_ui_primitive__WEBPACK_IMPORTED_MODULE_12__.m)(props.onPointerDown,(event=>{0===event.button&&(pointerStartRef.current={x:event.clientX,y:event.clientY})})),onPointerMove:(0,_radix_ui_primitive__WEBPACK_IMPORTED_MODULE_12__.m)(props.onPointerMove,(event=>{if(!pointerStartRef.current)return;const x=event.clientX-pointerStartRef.current.x,y=event.clientY-pointerStartRef.current.y,hasSwipeMoveStarted=Boolean(swipeDeltaRef.current),isHorizontalSwipe=["left","right"].includes(context.swipeDirection),clamp=["left","up"].includes(context.swipeDirection)?Math.min:Math.max,clampedX=isHorizontalSwipe?clamp(0,x):0,clampedY=isHorizontalSwipe?0:clamp(0,y),moveStartBuffer="touch"===event.pointerType?10:2,delta={x:clampedX,y:clampedY},eventDetail={originalEvent:event,delta};hasSwipeMoveStarted?(swipeDeltaRef.current=delta,$054eb8030ebde76e$var$handleAndDispatchCustomEvent("toast.swipeMove",onSwipeMove,eventDetail,{discrete:!1})):$054eb8030ebde76e$var$isDeltaInDirection(delta,context.swipeDirection,moveStartBuffer)?(swipeDeltaRef.current=delta,$054eb8030ebde76e$var$handleAndDispatchCustomEvent("toast.swipeStart",onSwipeStart,eventDetail,{discrete:!1}),event.target.setPointerCapture(event.pointerId)):(Math.abs(x)>moveStartBuffer||Math.abs(y)>moveStartBuffer)&&(pointerStartRef.current=null)})),onPointerUp:(0,_radix_ui_primitive__WEBPACK_IMPORTED_MODULE_12__.m)(props.onPointerUp,(event1=>{const delta=swipeDeltaRef.current,target=event1.target;if(target.hasPointerCapture(event1.pointerId)&&target.releasePointerCapture(event1.pointerId),swipeDeltaRef.current=null,pointerStartRef.current=null,delta){const toast=event1.currentTarget,eventDetail={originalEvent:event1,delta};$054eb8030ebde76e$var$isDeltaInDirection(delta,context.swipeDirection,context.swipeThreshold)?$054eb8030ebde76e$var$handleAndDispatchCustomEvent("toast.swipeEnd",onSwipeEnd,eventDetail,{discrete:!0}):$054eb8030ebde76e$var$handleAndDispatchCustomEvent("toast.swipeCancel",onSwipeCancel,eventDetail,{discrete:!0}),toast.addEventListener("click",(event=>event.preventDefault()),{once:!0})}}))})))),context.viewport))):null}));$054eb8030ebde76e$var$ToastImpl.propTypes={type(props){if(props.type&&!["foreground","background"].includes(props.type)){return new Error("Invalid prop `type` supplied to `Toast`. Expected `foreground | background`.")}return null}};const $054eb8030ebde76e$var$ToastAnnounce=props=>{const{__scopeToast,children,...announceProps}=props,context=$054eb8030ebde76e$var$useToastProviderContext("Toast",__scopeToast),[renderAnnounceText,setRenderAnnounceText]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1),[isAnnounced,setIsAnnounced]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1);return function $054eb8030ebde76e$var$useNextFrame(callback=()=>{}){const fn=(0,_radix_ui_react_use_callback_ref__WEBPACK_IMPORTED_MODULE_11__.c)(callback);(0,_radix_ui_react_use_layout_effect__WEBPACK_IMPORTED_MODULE_14__.N)((()=>{let raf1=0,raf2=0;return raf1=window.requestAnimationFrame((()=>raf2=window.requestAnimationFrame(fn))),()=>{window.cancelAnimationFrame(raf1),window.cancelAnimationFrame(raf2)}}),[fn])}((()=>setRenderAnnounceText(!0))),(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{const timer=window.setTimeout((()=>setIsAnnounced(!0)),1e3);return()=>window.clearTimeout(timer)}),[]),isAnnounced?null:(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_radix_ui_react_portal__WEBPACK_IMPORTED_MODULE_13__.Z,{asChild:!0},(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_radix_ui_react_visually_hidden__WEBPACK_IMPORTED_MODULE_8__.s,announceProps,renderAnnounceText&&(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment,null,context.label," ",children)))},$054eb8030ebde76e$export$16d42d7c29b95a4=(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(((props,forwardedRef)=>{const{__scopeToast,...titleProps}=props;return(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_radix_ui_react_primitive__WEBPACK_IMPORTED_MODULE_6__.sG.div,(0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_7__.A)({},titleProps,{ref:forwardedRef}))})),$054eb8030ebde76e$export$3019feecfda683d2=(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(((props,forwardedRef)=>{const{altText,...actionProps}=props;return altText?(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)($054eb8030ebde76e$var$ToastAnnounceExclude,{altText,asChild:!0},(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)($054eb8030ebde76e$export$811e70f61c205839,(0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_7__.A)({},actionProps,{ref:forwardedRef}))):null}));$054eb8030ebde76e$export$3019feecfda683d2.propTypes={altText:props=>props.altText?null:new Error("Missing prop `altText` expected on `ToastAction`")};const $054eb8030ebde76e$export$811e70f61c205839=(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(((props,forwardedRef)=>{const{__scopeToast,...closeProps}=props,interactiveContext=$054eb8030ebde76e$var$useToastInteractiveContext("ToastClose",__scopeToast);return(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)($054eb8030ebde76e$var$ToastAnnounceExclude,{asChild:!0},(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_radix_ui_react_primitive__WEBPACK_IMPORTED_MODULE_6__.sG.button,(0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_7__.A)({type:"button"},closeProps,{ref:forwardedRef,onClick:(0,_radix_ui_primitive__WEBPACK_IMPORTED_MODULE_12__.m)(props.onClick,interactiveContext.onClose)})))})),$054eb8030ebde76e$var$ToastAnnounceExclude=(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(((props,forwardedRef)=>{const{__scopeToast,altText,...announceExcludeProps}=props;return(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_radix_ui_react_primitive__WEBPACK_IMPORTED_MODULE_6__.sG.div,(0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_7__.A)({"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":altText||void 0},announceExcludeProps,{ref:forwardedRef}))}));function $054eb8030ebde76e$var$getAnnounceTextContent(container){const textContent=[];return Array.from(container.childNodes).forEach((node=>{if(node.nodeType===node.TEXT_NODE&&node.textContent&&textContent.push(node.textContent),function $054eb8030ebde76e$var$isHTMLElement(node){return node.nodeType===node.ELEMENT_NODE}(node)){const isHidden=node.ariaHidden||node.hidden||"none"===node.style.display,isExcluded=""===node.dataset.radixToastAnnounceExclude;if(!isHidden)if(isExcluded){const altText=node.dataset.radixToastAnnounceAlt;altText&&textContent.push(altText)}else textContent.push(...$054eb8030ebde76e$var$getAnnounceTextContent(node))}})),textContent}function $054eb8030ebde76e$var$handleAndDispatchCustomEvent(name,handler,detail,{discrete}){const currentTarget=detail.originalEvent.currentTarget,event=new CustomEvent(name,{bubbles:!0,cancelable:!0,detail});handler&¤tTarget.addEventListener(name,handler,{once:!0}),discrete?(0,_radix_ui_react_primitive__WEBPACK_IMPORTED_MODULE_6__.hO)(currentTarget,event):currentTarget.dispatchEvent(event)}const $054eb8030ebde76e$var$isDeltaInDirection=(delta,direction,threshold=0)=>{const deltaX=Math.abs(delta.x),deltaY=Math.abs(delta.y),isDeltaX=deltaX>deltaY;return"left"===direction||"right"===direction?isDeltaX&&deltaX>threshold:!isDeltaX&&deltaY>threshold};function $054eb8030ebde76e$var$getTabbableCandidates(container){const nodes=[],walker=document.createTreeWalker(container,NodeFilter.SHOW_ELEMENT,{acceptNode:node=>{const isHiddenInput="INPUT"===node.tagName&&"hidden"===node.type;return node.disabled||node.hidden||isHiddenInput?NodeFilter.FILTER_SKIP:node.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;walker.nextNode();)nodes.push(walker.currentNode);return nodes}function $054eb8030ebde76e$var$focusFirst(candidates){const previouslyFocusedElement=document.activeElement;return candidates.some((candidate=>candidate===previouslyFocusedElement||(candidate.focus(),document.activeElement!==previouslyFocusedElement)))}const $054eb8030ebde76e$export$2881499e37b75b9a=$054eb8030ebde76e$export$f5d03d415824e0e,$054eb8030ebde76e$export$d5c6c08dc2d3ca7=$054eb8030ebde76e$export$6192c2425ecfd989,$054eb8030ebde76e$export$be92b6f5f03c0fe9=$054eb8030ebde76e$export$8d8dc7d5f743331b,$054eb8030ebde76e$export$f99233281efd08a0=$054eb8030ebde76e$export$16d42d7c29b95a4}}]);