@airporting/tech-app 0.0.128 → 0.0.129

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.
Files changed (44) hide show
  1. package/dist/mf/1.js +1 -1
  2. package/dist/mf/1659.js +1 -1
  3. package/dist/mf/2880.js +1 -1
  4. package/dist/mf/3080.js +1 -1
  5. package/dist/mf/3364.js +2 -2
  6. package/dist/mf/3429.js +3 -3
  7. package/dist/mf/3724.js +1 -1
  8. package/dist/mf/6548.js +1 -1
  9. package/dist/mf/7364.js +1 -1
  10. package/dist/mf/7380.js +1 -1
  11. package/dist/mf/7541.js +1 -1
  12. package/dist/mf/7906.js +1 -1
  13. package/dist/mf/8119.js +1 -1
  14. package/dist/mf/9439.js +2 -2
  15. package/dist/mf/9669.js +1 -1
  16. package/dist/mf/__federation_expose_amex.js +1 -1
  17. package/dist/mf/__federation_expose_bnpp.js +1 -1
  18. package/dist/mf/__federation_expose_credmut.js +1 -1
  19. package/dist/mf/__federation_expose_dashboard.js +1 -1
  20. package/dist/mf/__federation_expose_etat_saisie.js +1 -1
  21. package/dist/mf/__federation_expose_finance_jobs.js +1 -1
  22. package/dist/mf/__federation_expose_github.js +1 -1
  23. package/dist/mf/__federation_expose_mcp_access.js +1 -1
  24. package/dist/mf/__federation_expose_payfit.js +1 -1
  25. package/dist/mf/__federation_expose_pipeline.js +1 -1
  26. package/dist/mf/__federation_expose_sales.js +1 -1
  27. package/dist/mf/__federation_expose_scrapers.js +1 -1
  28. package/dist/mf/__federation_expose_spendesk.js +1 -1
  29. package/dist/mf/__federation_expose_spreadsheet.js +1 -1
  30. package/dist/mf/__federation_expose_synchro.js +1 -1
  31. package/dist/mf/__federation_expose_usage.js +1 -1
  32. package/dist/mf/__federation_expose_wise.js +1 -1
  33. package/dist/mf/index.css +73 -73
  34. package/dist/mf/index.js +4 -4
  35. package/dist/mf/mf-manifest.json +20 -25
  36. package/dist/mf/mf-stats.json +24 -29
  37. package/dist/mf/tech_app.js +3 -3
  38. package/package.json +2 -2
  39. package/dist/mf/4153.js +0 -10
  40. package/dist/mf/4153.js.LICENSE.txt +0 -9
  41. package/dist/mf/5182.js +0 -10
  42. package/dist/mf/5182.js.LICENSE.txt +0 -9
  43. package/dist/mf/9622.js +0 -10
  44. package/dist/mf/9622.js.LICENSE.txt +0 -9
package/dist/mf/7541.js CHANGED
@@ -1 +1 @@
1
- "use strict";(globalThis["chunk_tech_app"]=globalThis["chunk_tech_app"]||[]).push([["7541"],{281:function(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{useOrientation:()=>useOrientation,clamp:()=>clamp,useDebouncedValue:()=>useDebouncedValue,useMutationObserver:()=>useMutationObserver,useResizeObserver:()=>useResizeObserver,useSet:()=>useSet,randomId:()=>randomId,useShallowEffect:()=>useShallowEffect,useThrottledState:()=>useThrottledState,mergeRefs:()=>mergeRefs,usePrevious:()=>usePrevious,useLongPress:()=>useLongPress,useReducedMotion:()=>useReducedMotion,useSetState:()=>useSetState,readLocalStorageValue:()=>readLocalStorageValue,useCounter:()=>useCounter,useValidatedState:()=>useValidatedState,useDebouncedState:()=>useDebouncedState,useMove:()=>useMove,useFileDialog:()=>useFileDialog,useClipboard:()=>useClipboard,useIsomorphicEffect:()=>useIsomorphicEffect,useLogger:()=>useLogger,useIdle:()=>useIdle,useElementSize:()=>useElementSize,useClickOutside:()=>useClickOutside,shallowEqual:()=>shallowEqual,useNetwork:()=>useNetwork,useEyeDropper:()=>useEyeDropper,useId:()=>useId,range:()=>range,useMediaQuery:()=>useMediaQuery,useRadialMove:()=>useRadialMove,useHotkeys:()=>useHotkeys,useSelection:()=>useSelection,useWindowEvent:()=>useWindowEvent,useInterval:()=>useInterval,useHeadroom:()=>useHeadroom,useSessionStorage:()=>useSessionStorage,useDebouncedCallback:()=>useDebouncedCallback,useDocumentTitle:()=>useDocumentTitle,useFocusTrap:()=>useFocusTrap,useHash:()=>useHash,upperFirst:()=>upperFirst,useThrottledValue:()=>useThrottledValue,useOs:()=>useOs,normalizeRadialValue:()=>normalizeRadialValue,useDocumentVisibility:()=>useDocumentVisibility,useHover:()=>useHover,useMap:()=>useMap,useScrollIntoView:()=>useScrollIntoView,useFocusReturn:()=>useFocusReturn,usePageLeave:()=>usePageLeave,useMergedRef:()=>useMergedRef,useDidUpdate:()=>useDidUpdate,useInViewport:()=>useInViewport,useIsFirstRender:()=>useIsFirstRender,usePagination:()=>usePagination,useMouse:()=>useMouse,useFavicon:()=>useFavicon,useQueue:()=>useQueue,useTimeout:()=>useTimeout,useToggle:()=>useToggle,useColorScheme:()=>useColorScheme,useEventListener:()=>useEventListener,useFullscreen:()=>useFullscreen,useIntersection:()=>useIntersection,useLocalStorage:()=>useLocalStorage,useFocusWithin:()=>useFocusWithin,useMounted:()=>useMounted,assignRef:()=>assignRef,useThrottledCallback:()=>useThrottledCallback,useStateHistory:()=>useStateHistory,useViewportSize:()=>useViewportSize,getHotkeyHandler:()=>getHotkeyHandler,useCallbackRef:()=>useCallbackRef,useTextSelection:()=>useTextSelection,useWindowScroll:()=>useWindowScroll,useDisclosure:()=>useDisclosure,readSessionStorageValue:()=>readSessionStorageValue,clampUseMovePosition:()=>clampUseMovePosition,useInputState:()=>useInputState,useForceUpdate:()=>useForceUpdate,useFetch:()=>useFetch,useListState:()=>useListState,lowerFirst:()=>lowerFirst,useScrollSpy:()=>useScrollSpy,useUncontrolled:()=>useUncontrolled});"use client";function clamp(value,min,max){if(void 0===min&&void 0===max)return value;if(void 0!==min&&void 0===max)return Math.max(value,min);if(void 0===min&&void 0!==max)return Math.min(value,max);return Math.min(Math.max(value,min),max)}"use client";function lowerFirst(value){return"string"!=typeof value?"":value.charAt(0).toLowerCase()+value.slice(1)}"use client";function randomId(prefix="mantine-"){return`${prefix}${Math.random().toString(36).slice(2,11)}`}"use client";function range(start,end){const length=Math.abs(end-start)+1;const reversed=start>end;if(!reversed)return Array.from({length},(_,index)=>index+start);return Array.from({length},(_,index)=>start-index)}"use client";function shallowEqual(a,b){if(a===b)return true;if(Number.isNaN(a)&&Number.isNaN(b))return true;if(!(a instanceof Object)||!(b instanceof Object))return false;const keys=Object.keys(a);const{length}=keys;if(length!==Object.keys(b).length)return false;for(let i=0;i<length;i+=1){const key=keys[i];if(!(key in b))return false;if(a[key]!==b[key]&&!(Number.isNaN(a[key])&&Number.isNaN(b[key])))return false}return true}"use client";function upperFirst(value){return"string"!=typeof value?"":value.charAt(0).toUpperCase()+value.slice(1)}var index_js_=__webpack_require__(9735);"use client";function useCallbackRef(callback){const callbackRef=(0,index_js_.useRef)(callback);(0,index_js_.useEffect)(()=>{callbackRef.current=callback});return(0,index_js_.useMemo)(()=>(...args)=>callbackRef.current?.(...args),[])}"use client";function useDebouncedCallback(callback,options){const{delay,flushOnUnmount,leading}="number"==typeof options?{delay:options,flushOnUnmount:false,leading:false}:options;const handleCallback=useCallbackRef(callback);const debounceTimerRef=(0,index_js_.useRef)(0);const lastCallback=(0,index_js_.useMemo)(()=>{const currentCallback=Object.assign((...args)=>{window.clearTimeout(debounceTimerRef.current);const isFirstCall=currentCallback._isFirstCall;currentCallback._isFirstCall=false;function clearTimeoutAndLeadingRef(){window.clearTimeout(debounceTimerRef.current);debounceTimerRef.current=0;currentCallback._isFirstCall=true}if(leading&&isFirstCall){handleCallback(...args);const resetLeadingState=()=>{clearTimeoutAndLeadingRef()};const flush2=()=>{if(0!==debounceTimerRef.current){clearTimeoutAndLeadingRef();handleCallback(...args)}};const cancel2=()=>{clearTimeoutAndLeadingRef()};currentCallback.flush=flush2;currentCallback.cancel=cancel2;debounceTimerRef.current=window.setTimeout(resetLeadingState,delay);return}if(leading&&!isFirstCall){const flush2=()=>{if(0!==debounceTimerRef.current){clearTimeoutAndLeadingRef();handleCallback(...args)}};const cancel2=()=>{clearTimeoutAndLeadingRef()};currentCallback.flush=flush2;currentCallback.cancel=cancel2;const resetLeadingState=()=>{clearTimeoutAndLeadingRef()};debounceTimerRef.current=window.setTimeout(resetLeadingState,delay);return}const flush=()=>{if(0!==debounceTimerRef.current){clearTimeoutAndLeadingRef();handleCallback(...args)}};const cancel=()=>{clearTimeoutAndLeadingRef()};currentCallback.flush=flush;currentCallback.cancel=cancel;debounceTimerRef.current=window.setTimeout(flush,delay)},{flush:()=>{},cancel:()=>{},_isFirstCall:true});return currentCallback},[handleCallback,delay,leading]);(0,index_js_.useEffect)(()=>()=>{if(flushOnUnmount)lastCallback.flush();else lastCallback.cancel()},[lastCallback,flushOnUnmount]);return lastCallback}"use client";const DEFAULT_EVENTS=["mousedown","touchstart"];function useClickOutside(callback,events,nodes){const ref=(0,index_js_.useRef)(null);const eventsList=events||DEFAULT_EVENTS;(0,index_js_.useEffect)(()=>{const listener=event=>{const{target}=event??{};if(Array.isArray(nodes)){const shouldIgnore=!document.body.contains(target)&&"HTML"!==target.tagName;const shouldTrigger=nodes.every(node=>!!node&&!event.composedPath().includes(node));shouldTrigger&&!shouldIgnore&&callback()}else if(ref.current&&!ref.current.contains(target))callback()};eventsList.forEach(fn=>document.addEventListener(fn,listener));return()=>{eventsList.forEach(fn=>document.removeEventListener(fn,listener))}},[ref,callback,nodes]);return ref}"use client";function useClipboard(options={timeout:2e3}){const[error,setError]=(0,index_js_.useState)(null);const[copied,setCopied]=(0,index_js_.useState)(false);const[copyTimeout,setCopyTimeout]=(0,index_js_.useState)(null);const handleCopyResult=value=>{window.clearTimeout(copyTimeout);setCopyTimeout(window.setTimeout(()=>setCopied(false),options.timeout));setCopied(value)};const copy=value=>{if("clipboard"in navigator)navigator.clipboard.writeText(value).then(()=>handleCopyResult(true)).catch(err=>setError(err));else setError(new Error("useClipboard: navigator.clipboard is not supported"))};const reset=()=>{setCopied(false);setError(null);window.clearTimeout(copyTimeout)};return{copy,reset,error,copied}}"use client";function attachMediaListener(query,callback){try{query.addEventListener("change",callback);return()=>query.removeEventListener("change",callback)}catch(e){query.addListener(callback);return()=>query.removeListener(callback)}}function getInitialValue(query,initialValue){if("undefined"!=typeof window&&"matchMedia"in window)return window.matchMedia(query).matches;return false}function useMediaQuery(query,initialValue,{getInitialValueInEffect}={getInitialValueInEffect:true}){const[matches,setMatches]=(0,index_js_.useState)(getInitialValueInEffect?initialValue:getInitialValue(query));const queryRef=(0,index_js_.useRef)(null);(0,index_js_.useEffect)(()=>{if("matchMedia"in window){queryRef.current=window.matchMedia(query);setMatches(queryRef.current.matches);return attachMediaListener(queryRef.current,event=>setMatches(event.matches))}},[query]);return matches||false}"use client";function useColorScheme(initialValue,options){return useMediaQuery("(prefers-color-scheme: dark)","dark"===initialValue,options)?"dark":"light"}"use client";const DEFAULT_OPTIONS={min:-1/0,max:1/0};function useCounter(initialValue=0,options){const{min,max}={...DEFAULT_OPTIONS,...options};const[count,setCount]=(0,index_js_.useState)(clamp(initialValue,min,max));const increment=(0,index_js_.useCallback)(()=>setCount(current=>clamp(current+1,min,max)),[min,max]);const decrement=(0,index_js_.useCallback)(()=>setCount(current=>clamp(current-1,min,max)),[min,max]);const set=(0,index_js_.useCallback)(value=>setCount(clamp(value,min,max)),[min,max]);const reset=(0,index_js_.useCallback)(()=>setCount(clamp(initialValue,min,max)),[initialValue,min,max]);return[count,{increment,decrement,set,reset}]}"use client";function useDebouncedState(defaultValue,wait,options={leading:false}){const[value,setValue]=(0,index_js_.useState)(defaultValue);const timeoutRef=(0,index_js_.useRef)(null);const leadingRef=(0,index_js_.useRef)(true);const clearTimeout1=()=>window.clearTimeout(timeoutRef.current);(0,index_js_.useEffect)(()=>clearTimeout1,[]);const debouncedSetValue=(0,index_js_.useCallback)(newValue=>{clearTimeout1();if(leadingRef.current&&options.leading)setValue(newValue);else timeoutRef.current=window.setTimeout(()=>{leadingRef.current=true;setValue(newValue)},wait);leadingRef.current=false},[options.leading]);return[value,debouncedSetValue]}"use client";function useDebouncedValue(value,wait,options={leading:false}){const[_value,setValue]=(0,index_js_.useState)(value);const mountedRef=(0,index_js_.useRef)(false);const timeoutRef=(0,index_js_.useRef)(null);const cooldownRef=(0,index_js_.useRef)(false);const cancel=()=>window.clearTimeout(timeoutRef.current);(0,index_js_.useEffect)(()=>{if(mountedRef.current)if(!cooldownRef.current&&options.leading){cooldownRef.current=true;setValue(value)}else{cancel();timeoutRef.current=window.setTimeout(()=>{cooldownRef.current=false;setValue(value)},wait)}},[value,options.leading,wait]);(0,index_js_.useEffect)(()=>{mountedRef.current=true;return cancel},[]);return[_value,cancel]}"use client";const useIsomorphicEffect="undefined"!=typeof document?index_js_.useLayoutEffect:index_js_.useEffect;"use client";function useDocumentTitle(title){useIsomorphicEffect(()=>{if("string"==typeof title&&title.trim().length>0)document.title=title.trim()},[title])}"use client";function useDocumentVisibility(){const[documentVisibility,setDocumentVisibility]=(0,index_js_.useState)("visible");(0,index_js_.useEffect)(()=>{const listener=()=>setDocumentVisibility(document.visibilityState);document.addEventListener("visibilitychange",listener);return()=>document.removeEventListener("visibilitychange",listener)},[]);return documentVisibility}"use client";function useDidUpdate(fn,dependencies){const mounted=(0,index_js_.useRef)(false);(0,index_js_.useEffect)(()=>()=>{mounted.current=false},[]);(0,index_js_.useEffect)(()=>{if(mounted.current)return fn();mounted.current=true},dependencies)}"use client";function useFocusReturn({opened,shouldReturnFocus=true}){const lastActiveElement=(0,index_js_.useRef)(null);const returnFocus=()=>{if(lastActiveElement.current&&"focus"in lastActiveElement.current&&"function"==typeof lastActiveElement.current.focus)lastActiveElement.current?.focus({preventScroll:true})};useDidUpdate(()=>{let timeout=-1;const clearFocusTimeout=event=>{if("Tab"===event.key)window.clearTimeout(timeout)};document.addEventListener("keydown",clearFocusTimeout);if(opened)lastActiveElement.current=document.activeElement;else if(shouldReturnFocus)timeout=window.setTimeout(returnFocus,10);return()=>{window.clearTimeout(timeout);document.removeEventListener("keydown",clearFocusTimeout)}},[opened,shouldReturnFocus]);return returnFocus}"use client";const TABBABLE_NODES=/input|select|textarea|button|object/;const FOCUS_SELECTOR="a, input, select, textarea, button, object, [tabindex]";function tabbable_hidden(element){return"none"===element.style.display}function visible(element){const isHidden=element.getAttribute("aria-hidden")||element.getAttribute("hidden")||"hidden"===element.getAttribute("type");if(isHidden)return false;let parentElement=element;while(parentElement){if(parentElement===document.body||11===parentElement.nodeType)break;if(tabbable_hidden(parentElement))return false;parentElement=parentElement.parentNode}return true}function getElementTabIndex(element){let tabIndex=element.getAttribute("tabindex");if(null===tabIndex)tabIndex=void 0;return parseInt(tabIndex,10)}function focusable(element){const nodeName=element.nodeName.toLowerCase();const isTabIndexNotNaN=!Number.isNaN(getElementTabIndex(element));const res=TABBABLE_NODES.test(nodeName)&&!element.disabled||(element instanceof HTMLAnchorElement?element.href||isTabIndexNotNaN:isTabIndexNotNaN);return res&&visible(element)}function tabbable_tabbable(element){const tabIndex=getElementTabIndex(element);const isTabIndexNaN=Number.isNaN(tabIndex);return(isTabIndexNaN||tabIndex>=0)&&focusable(element)}function findTabbableDescendants(element){return Array.from(element.querySelectorAll(FOCUS_SELECTOR)).filter(tabbable_tabbable)}"use client";function scopeTab(node,event){const tabbable=findTabbableDescendants(node);if(!tabbable.length)return void event.preventDefault();const finalTabbable=tabbable[event.shiftKey?0:tabbable.length-1];const root=node.getRootNode();let leavingFinalTabbable=finalTabbable===root.activeElement||node===root.activeElement;const activeElement=root.activeElement;const activeElementIsRadio="INPUT"===activeElement.tagName&&"radio"===activeElement.getAttribute("type");if(activeElementIsRadio){const activeRadioGroup=tabbable.filter(element=>"radio"===element.getAttribute("type")&&element.getAttribute("name")===activeElement.getAttribute("name"));leavingFinalTabbable=activeRadioGroup.includes(finalTabbable)}if(!leavingFinalTabbable)return;event.preventDefault();const target=tabbable[event.shiftKey?tabbable.length-1:0];if(target)target.focus()}"use client";function useFocusTrap(active=true){const ref=(0,index_js_.useRef)(null);const focusNode=node=>{let focusElement=node.querySelector("[data-autofocus]");if(!focusElement){const children=Array.from(node.querySelectorAll(FOCUS_SELECTOR));focusElement=children.find(tabbable_tabbable)||children.find(focusable)||null;if(!focusElement&&focusable(node))focusElement=node}if(focusElement)focusElement.focus({preventScroll:true})};const setRef=(0,index_js_.useCallback)(node=>{if(!active)return;if(null===node)return;if(ref.current===node)return;if(node){setTimeout(()=>{if(node.getRootNode())focusNode(node)});ref.current=node}else ref.current=null},[active]);(0,index_js_.useEffect)(()=>{if(!active)return;ref.current&&setTimeout(()=>focusNode(ref.current));const handleKeyDown=event=>{if("Tab"===event.key&&ref.current)scopeTab(ref.current,event)};document.addEventListener("keydown",handleKeyDown);return()=>document.removeEventListener("keydown",handleKeyDown)},[active]);return setRef}"use client";const reducer=value=>(value+1)%1e6;function useForceUpdate(){const[,update]=(0,index_js_.useReducer)(reducer,0);return update}"use client";const __useId=index_js_["useId".toString()]||(()=>void 0);function useReactId(){const id=__useId();return id?`mantine-${id.replace(/:/g,"")}`:""}"use client";function useId(staticId){const reactId=useReactId();const[uuid,setUuid]=(0,index_js_.useState)(reactId);useIsomorphicEffect(()=>{setUuid(randomId())},[]);if("string"==typeof staticId)return staticId;if("undefined"==typeof window)return reactId;return uuid}"use client";const use_idle_DEFAULT_OPTIONS={events:["keydown","mousemove","touchmove","click","scroll","wheel"],initialState:true};function useIdle(timeout,options){const{events,initialState}={...use_idle_DEFAULT_OPTIONS,...options};const[idle,setIdle]=(0,index_js_.useState)(initialState);const timer=(0,index_js_.useRef)(-1);(0,index_js_.useEffect)(()=>{const handleEvents=()=>{setIdle(false);if(timer.current)window.clearTimeout(timer.current);timer.current=window.setTimeout(()=>{setIdle(true)},timeout)};events.forEach(event=>document.addEventListener(event,handleEvents));timer.current=window.setTimeout(()=>{setIdle(true)},timeout);return()=>{events.forEach(event=>document.removeEventListener(event,handleEvents));window.clearTimeout(timer.current);timer.current=-1}},[timeout]);return idle}"use client";function useInterval(fn,interval,{autoInvoke=false}={}){const[active,setActive]=(0,index_js_.useState)(false);const intervalRef=(0,index_js_.useRef)(null);const fnRef=(0,index_js_.useRef)(null);const start=(0,index_js_.useCallback)(()=>{setActive(old=>{if(!old&&(!intervalRef.current||-1===intervalRef.current))intervalRef.current=window.setInterval(fnRef.current,interval);return true})},[]);const stop=(0,index_js_.useCallback)(()=>{setActive(false);window.clearInterval(intervalRef.current||-1);intervalRef.current=-1},[]);const toggle=(0,index_js_.useCallback)(()=>{if(active)stop();else start()},[active]);(0,index_js_.useEffect)(()=>{fnRef.current=fn;active&&start();return stop},[fn,active,interval]);(0,index_js_.useEffect)(()=>{if(autoInvoke)start()},[]);return{start,stop,toggle,active}}"use client";function useListState(initialValue=[]){const[state,setState]=(0,index_js_.useState)(initialValue);const append=(...items)=>setState(current=>[...current,...items]);const prepend=(...items)=>setState(current=>[...items,...current]);const insert=(index,...items)=>setState(current=>[...current.slice(0,index),...items,...current.slice(index)]);const apply=fn=>setState(current=>current.map((item,index)=>fn(item,index)));const remove=(...indices)=>setState(current=>current.filter((_,index)=>!indices.includes(index)));const pop=()=>setState(current=>{const cloned=[...current];cloned.pop();return cloned});const shift=()=>setState(current=>{const cloned=[...current];cloned.shift();return cloned});const reorder=({from,to})=>setState(current=>{const cloned=[...current];const item=current[from];cloned.splice(from,1);cloned.splice(to,0,item);return cloned});const swap=({from,to})=>setState(current=>{const cloned=[...current];const fromItem=cloned[from];const toItem=cloned[to];cloned.splice(to,1,fromItem);cloned.splice(from,1,toItem);return cloned});const setItem=(index,item)=>setState(current=>{const cloned=[...current];cloned[index]=item;return cloned});const setItemProp=(index,prop,value)=>setState(current=>{const cloned=[...current];cloned[index]={...cloned[index],[prop]:value};return cloned});const applyWhere=(condition,fn)=>setState(current=>current.map((item,index)=>condition(item,index)?fn(item,index):item));const filter=fn=>{setState(current=>current.filter(fn))};return[state,{setState,append,prepend,insert,pop,shift,apply,applyWhere,remove,reorder,swap,setItem,setItemProp,filter}]}"use client";function useWindowEvent(type,listener,options){(0,index_js_.useEffect)(()=>{window.addEventListener(type,listener,options);return()=>window.removeEventListener(type,listener,options)},[type,listener])}"use client";function serializeJSON(value,hookName="use-local-storage"){try{return JSON.stringify(value)}catch(error){throw new Error(`@mantine/hooks ${hookName}: Failed to serialize the value`)}}function deserializeJSON(value){try{return value&&JSON.parse(value)}catch{return value}}function createStorageHandler(type){const getItem=key=>{try{return window[type].getItem(key)}catch(error){console.warn("use-local-storage: Failed to get value from storage, localStorage is blocked");return null}};const setItem=(key,value)=>{try{window[type].setItem(key,value)}catch(error){console.warn("use-local-storage: Failed to set value to storage, localStorage is blocked")}};const removeItem=key=>{try{window[type].removeItem(key)}catch(error){console.warn("use-local-storage: Failed to remove value from storage, localStorage is blocked")}};return{getItem,setItem,removeItem}}function createStorage(type,hookName){const eventName="localStorage"===type?"mantine-local-storage":"mantine-session-storage";const{getItem,setItem,removeItem}=createStorageHandler(type);return function({key,defaultValue,getInitialValueInEffect=true,sync=true,deserialize=deserializeJSON,serialize=value=>serializeJSON(value,hookName)}){const readStorageValue=(0,index_js_.useCallback)(skipStorage=>{let storageBlockedOrSkipped;try{storageBlockedOrSkipped="undefined"==typeof window||!(type in window)||null===window[type]||!!skipStorage}catch(_e){storageBlockedOrSkipped=true}if(storageBlockedOrSkipped)return defaultValue;const storageValue=getItem(key);return null!==storageValue?deserialize(storageValue):defaultValue},[key,defaultValue]);const[value,setValue]=(0,index_js_.useState)(readStorageValue(getInitialValueInEffect));const setStorageValue=(0,index_js_.useCallback)(val=>{if(val instanceof Function)setValue(current=>{const result=val(current);setItem(key,serialize(result));queueMicrotask(()=>{window.dispatchEvent(new CustomEvent(eventName,{detail:{key,value:val(current)}}))});return result});else{setItem(key,serialize(val));window.dispatchEvent(new CustomEvent(eventName,{detail:{key,value:val}}));setValue(val)}},[key]);const removeStorageValue=(0,index_js_.useCallback)(()=>{removeItem(key);window.dispatchEvent(new CustomEvent(eventName,{detail:{key,value:defaultValue}}))},[]);useWindowEvent("storage",event=>{if(sync){if(event.storageArea===window[type]&&event.key===key)setValue(deserialize(event.newValue??void 0))}});useWindowEvent(eventName,event=>{if(sync){if(event.detail.key===key)setValue(event.detail.value)}});(0,index_js_.useEffect)(()=>{if(void 0!==defaultValue&&void 0===value)setStorageValue(defaultValue)},[defaultValue,value,setStorageValue]);(0,index_js_.useEffect)(()=>{const val=readStorageValue();void 0!==val&&setStorageValue(val)},[key]);return[void 0===value?defaultValue:value,setStorageValue,removeStorageValue]}}function readValue(type){const{getItem}=createStorageHandler(type);return function({key,defaultValue,deserialize=deserializeJSON}){let storageBlockedOrSkipped;try{storageBlockedOrSkipped="undefined"==typeof window||!(type in window)||null===window[type]}catch(_e){storageBlockedOrSkipped=true}if(storageBlockedOrSkipped)return defaultValue;const storageValue=getItem(key);return null!==storageValue?deserialize(storageValue):defaultValue}}"use client";function useLocalStorage(props){return createStorage("localStorage","use-local-storage")(props)}const readLocalStorageValue=readValue("localStorage");"use client";function useSessionStorage(props){return createStorage("sessionStorage","use-session-storage")(props)}const readSessionStorageValue=readValue("sessionStorage");"use client";function assignRef(ref,value){if("function"==typeof ref)return ref(value);if("object"==typeof ref&&null!==ref&&"current"in ref)ref.current=value}function mergeRefs(...refs){const cleanupMap=/* @__PURE__ */new Map;return node=>{refs.forEach(ref=>{const cleanup=assignRef(ref,node);if(cleanup)cleanupMap.set(ref,cleanup)});if(cleanupMap.size>0)return()=>{refs.forEach(ref=>{const cleanup=cleanupMap.get(ref);if(cleanup&&"function"==typeof cleanup)cleanup();else assignRef(ref,null)});cleanupMap.clear()}}}function useMergedRef(...refs){return(0,index_js_.useCallback)(mergeRefs(...refs),refs)}"use client";function useMouse(options={resetOnExit:false}){const[position,setPosition]=(0,index_js_.useState)({x:0,y:0});const ref=(0,index_js_.useRef)(null);const setMousePosition=event=>{if(ref.current){const rect=event.currentTarget.getBoundingClientRect();const x=Math.max(0,Math.round(event.pageX-rect.left-(window.scrollX||window.scrollX)));const y=Math.max(0,Math.round(event.pageY-rect.top-(window.scrollY||window.scrollY)));setPosition({x,y})}else setPosition({x:event.clientX,y:event.clientY})};const resetMousePosition=()=>setPosition({x:0,y:0});(0,index_js_.useEffect)(()=>{const element=ref?.current?ref.current:document;element.addEventListener("mousemove",setMousePosition);if(options.resetOnExit)element.addEventListener("mouseleave",resetMousePosition);return()=>{element.removeEventListener("mousemove",setMousePosition);if(options.resetOnExit)element.removeEventListener("mouseleave",resetMousePosition)}},[ref.current]);return{ref,...position}}"use client";function clampUseMovePosition(position){return{x:clamp(position.x,0,1),y:clamp(position.y,0,1)}}function useMove(onChange,handlers,dir="ltr"){const mounted=(0,index_js_.useRef)(false);const isSliding=(0,index_js_.useRef)(false);const frame=(0,index_js_.useRef)(0);const[active,setActive]=(0,index_js_.useState)(false);const cleanupRef=(0,index_js_.useRef)(null);(0,index_js_.useEffect)(()=>{mounted.current=true},[]);const refCallback=(0,index_js_.useCallback)(node=>{if(cleanupRef.current){cleanupRef.current();cleanupRef.current=null}if(!node)return;const onScrub=({x,y})=>{cancelAnimationFrame(frame.current);frame.current=requestAnimationFrame(()=>{if(mounted.current&&node){node.style.userSelect="none";const rect=node.getBoundingClientRect();if(rect.width&&rect.height){const _x=clamp((x-rect.left)/rect.width,0,1);onChange({x:"ltr"===dir?_x:1-_x,y:clamp((y-rect.top)/rect.height,0,1)})}}})};const bindEvents=()=>{document.addEventListener("mousemove",onMouseMove);document.addEventListener("mouseup",stopScrubbing);document.addEventListener("touchmove",onTouchMove,{passive:false});document.addEventListener("touchend",stopScrubbing)};const unbindEvents=()=>{document.removeEventListener("mousemove",onMouseMove);document.removeEventListener("mouseup",stopScrubbing);document.removeEventListener("touchmove",onTouchMove);document.removeEventListener("touchend",stopScrubbing)};const startScrubbing=()=>{if(!isSliding.current&&mounted.current){isSliding.current=true;"function"==typeof handlers?.onScrubStart&&handlers.onScrubStart();setActive(true);bindEvents()}};const stopScrubbing=()=>{if(isSliding.current&&mounted.current){isSliding.current=false;setActive(false);unbindEvents();setTimeout(()=>{"function"==typeof handlers?.onScrubEnd&&handlers.onScrubEnd()},0)}};const onMouseDown=event=>{startScrubbing();event.preventDefault();onMouseMove(event)};const onMouseMove=event=>onScrub({x:event.clientX,y:event.clientY});const onTouchStart=event=>{if(event.cancelable)event.preventDefault();startScrubbing();onTouchMove(event)};const onTouchMove=event=>{if(event.cancelable)event.preventDefault();onScrub({x:event.changedTouches[0].clientX,y:event.changedTouches[0].clientY})};node.addEventListener("mousedown",onMouseDown);node.addEventListener("touchstart",onTouchStart,{passive:false});cleanupRef.current=()=>{node.removeEventListener("mousedown",onMouseDown);node.removeEventListener("touchstart",onTouchStart)}},[dir,onChange]);return{ref:refCallback,active}}"use client";function useUncontrolled({value,defaultValue,finalValue,onChange=()=>{}}){const[uncontrolledValue,setUncontrolledValue]=(0,index_js_.useState)(void 0!==defaultValue?defaultValue:finalValue);const handleUncontrolledChange=(val,...payload)=>{setUncontrolledValue(val);onChange?.(val,...payload)};if(void 0!==value)return[value,onChange,true];return[uncontrolledValue,handleUncontrolledChange,false]}"use client";function use_pagination_range(start,end){const length=end-start+1;return Array.from({length},(_,index)=>index+start)}const DOTS="dots";function usePagination({total,siblings=1,boundaries=1,page,initialPage=1,onChange}){const _total=Math.max(Math.trunc(total),0);const[activePage,setActivePage]=useUncontrolled({value:page,onChange,defaultValue:initialPage,finalValue:initialPage});const setPage=pageNumber=>{if(pageNumber<=0)setActivePage(1);else pageNumber>_total?setActivePage(_total):setActivePage(pageNumber)};const next=()=>setPage(activePage+1);const previous=()=>setPage(activePage-1);const first=()=>setPage(1);const last=()=>setPage(_total);const paginationRange=(0,index_js_.useMemo)(()=>{const totalPageNumbers=2*siblings+3+2*boundaries;if(totalPageNumbers>=_total)return use_pagination_range(1,_total);const leftSiblingIndex=Math.max(activePage-siblings,boundaries);const rightSiblingIndex=Math.min(activePage+siblings,_total-boundaries);const shouldShowLeftDots=leftSiblingIndex>boundaries+2;const shouldShowRightDots=rightSiblingIndex<_total-(boundaries+1);if(!shouldShowLeftDots&&shouldShowRightDots){const leftItemCount=2*siblings+boundaries+2;return[...use_pagination_range(1,leftItemCount),DOTS,...use_pagination_range(_total-(boundaries-1),_total)]}if(shouldShowLeftDots&&!shouldShowRightDots){const rightItemCount=boundaries+1+2*siblings;return[...use_pagination_range(1,boundaries),DOTS,...use_pagination_range(_total-rightItemCount,_total)]}return[...use_pagination_range(1,boundaries),DOTS,...use_pagination_range(leftSiblingIndex,rightSiblingIndex),DOTS,...use_pagination_range(_total-boundaries+1,_total)]},[_total,siblings,activePage]);return{range:paginationRange,active:activePage,setPage,next,previous,first,last}}"use client";function useQueue({initialValues=[],limit}){const[state,setState]=(0,index_js_.useState)({state:initialValues.slice(0,limit),queue:initialValues.slice(limit)});const add=(...items)=>setState(current=>{const results=[...current.state,...current.queue,...items];return{state:results.slice(0,limit),queue:results.slice(limit)}});const update=fn=>setState(current=>{const results=fn([...current.state,...current.queue]);return{state:results.slice(0,limit),queue:results.slice(limit)}});const cleanQueue=()=>setState(current=>({state:current.state,queue:[]}));return{state:state.state,queue:state.queue,add,update,cleanQueue}}"use client";function usePageLeave(onPageLeave){(0,index_js_.useEffect)(()=>{document.documentElement.addEventListener("mouseleave",onPageLeave);return()=>document.documentElement.removeEventListener("mouseleave",onPageLeave)},[])}"use client";function useReducedMotion(initialValue,options){return useMediaQuery("(prefers-reduced-motion: reduce)",initialValue,options)}"use client";function useScrollIntoView({duration=1250,axis="y",onScrollFinish,easing=easeInOutQuad,offset=0,cancelable=true,isList=false}={}){const frameID=(0,index_js_.useRef)(0);const startTime=(0,index_js_.useRef)(0);const shouldStop=(0,index_js_.useRef)(false);const scrollableRef=(0,index_js_.useRef)(null);const targetRef=(0,index_js_.useRef)(null);const reducedMotion=useReducedMotion();const cancel=()=>{if(frameID.current)cancelAnimationFrame(frameID.current)};const scrollIntoView=(0,index_js_.useCallback)(({alignment="start"}={})=>{shouldStop.current=false;if(frameID.current)cancel();const start=getScrollStart({parent:scrollableRef.current,axis})??0;const change=getRelativePosition({parent:scrollableRef.current,target:targetRef.current,axis,alignment,offset,isList})-(scrollableRef.current?0:start);function animateScroll(){if(0===startTime.current)startTime.current=performance.now();const now=performance.now();const elapsed=now-startTime.current;const t=reducedMotion||0===duration?1:elapsed/duration;const distance=start+change*easing(t);setScrollParam({parent:scrollableRef.current,axis,distance});if(!shouldStop.current&&t<1)frameID.current=requestAnimationFrame(animateScroll);else{"function"==typeof onScrollFinish&&onScrollFinish();startTime.current=0;frameID.current=0;cancel()}}animateScroll()},[axis,duration,easing,isList,offset,onScrollFinish,reducedMotion]);const handleStop=()=>{if(cancelable)shouldStop.current=true};useWindowEvent("wheel",handleStop,{passive:true});useWindowEvent("touchmove",handleStop,{passive:true});(0,index_js_.useEffect)(()=>cancel,[]);return{scrollableRef,targetRef,scrollIntoView,cancel}}function easeInOutQuad(t){return t<.5?2*t*t:-1+(4-2*t)*t}function getRelativePosition({axis,target,parent,alignment,offset,isList}){if(!target||!parent&&"undefined"==typeof document)return 0;const isCustomParent=!!parent;const parentElement=parent||document.body;const parentPosition=parentElement.getBoundingClientRect();const targetPosition=target.getBoundingClientRect();const getDiff=property=>targetPosition[property]-parentPosition[property];if("y"===axis){const diff=getDiff("top");if(0===diff)return 0;if("start"===alignment){const distance=diff-offset;const shouldScroll=distance<=targetPosition.height*(isList?0:1)||!isList;return shouldScroll?distance:0}const parentHeight=isCustomParent?parentPosition.height:window.innerHeight;if("end"===alignment){const distance=diff+offset-parentHeight+targetPosition.height;const shouldScroll=distance>=-targetPosition.height*(isList?0:1)||!isList;return shouldScroll?distance:0}if("center"===alignment)return diff-parentHeight/2+targetPosition.height/2;return 0}if("x"===axis){const diff=getDiff("left");if(0===diff)return 0;if("start"===alignment){const distance=diff-offset;const shouldScroll=distance<=targetPosition.width||!isList;return shouldScroll?distance:0}const parentWidth=isCustomParent?parentPosition.width:window.innerWidth;if("end"===alignment){const distance=diff+offset-parentWidth+targetPosition.width;const shouldScroll=distance>=-targetPosition.width||!isList;return shouldScroll?distance:0}if("center"===alignment)return diff-parentWidth/2+targetPosition.width/2}return 0}function getScrollStart({axis,parent}){if(!parent&&"undefined"==typeof document)return 0;const method="y"===axis?"scrollTop":"scrollLeft";if(parent)return parent[method];const{body,documentElement}=document;return body[method]+documentElement[method]}function setScrollParam({axis,parent,distance}){if(!parent&&"undefined"==typeof document)return;const method="y"===axis?"scrollTop":"scrollLeft";if(parent)parent[method]=distance;else{const{body,documentElement}=document;body[method]=distance;documentElement[method]=distance}}"use client";const defaultState={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};function useResizeObserver(options){const frameID=(0,index_js_.useRef)(0);const ref=(0,index_js_.useRef)(null);const[rect,setRect]=(0,index_js_.useState)(defaultState);const observer=(0,index_js_.useMemo)(()=>"undefined"!=typeof window?new ResizeObserver(entries=>{const entry=entries[0];if(entry){cancelAnimationFrame(frameID.current);frameID.current=requestAnimationFrame(()=>{if(ref.current){const boxSize=entry.borderBoxSize?.[0]||entry.contentBoxSize?.[0];if(boxSize){const width=boxSize.inlineSize;const height=boxSize.blockSize;setRect({width,height,x:entry.contentRect.x,y:entry.contentRect.y,top:entry.contentRect.top,left:entry.contentRect.left,bottom:entry.contentRect.bottom,right:entry.contentRect.right})}else setRect(entry.contentRect)}})}}):null,[]);(0,index_js_.useEffect)(()=>{if(ref.current)observer?.observe(ref.current,options);return()=>{observer?.disconnect();if(frameID.current)cancelAnimationFrame(frameID.current)}},[ref.current]);return[ref,rect]}function useElementSize(options){const[ref,{width,height}]=useResizeObserver(options);return{ref,width,height}}"use client";function shallowCompare(prevValue,currValue){if(!prevValue||!currValue)return false;if(prevValue===currValue)return true;if(prevValue.length!==currValue.length)return false;for(let i=0;i<prevValue.length;i+=1)if(!shallowEqual(prevValue[i],currValue[i]))return false;return true}function useShallowCompare(dependencies){const ref=(0,index_js_.useRef)([]);const updateRef=(0,index_js_.useRef)(0);if(!shallowCompare(ref.current,dependencies)){ref.current=dependencies;updateRef.current+=1}return[updateRef.current]}function useShallowEffect(cb,dependencies){(0,index_js_.useEffect)(cb,useShallowCompare(dependencies))}"use client";function useToggle(options=[false,true]){const[[option],toggle]=(0,index_js_.useReducer)((state,action)=>{const value=action instanceof Function?action(state[0]):action;const index=Math.abs(state.indexOf(value));return state.slice(index).concat(state.slice(0,index))},options);return[option,toggle]}"use client";const eventListerOptions={passive:true};function useViewportSize(){const[windowSize,setWindowSize]=(0,index_js_.useState)({width:0,height:0});const setSize=(0,index_js_.useCallback)(()=>{setWindowSize({width:window.innerWidth||0,height:window.innerHeight||0})},[]);useWindowEvent("resize",setSize,eventListerOptions);useWindowEvent("orientationchange",setSize,eventListerOptions);(0,index_js_.useEffect)(setSize,[]);return windowSize}"use client";function getScrollPosition(){return"undefined"!=typeof window?{x:window.scrollX,y:window.scrollY}:{x:0,y:0}}function scrollTo({x,y}){if("undefined"!=typeof window){const scrollOptions={behavior:"smooth"};if("number"==typeof x)scrollOptions.left=x;if("number"==typeof y)scrollOptions.top=y;window.scrollTo(scrollOptions)}}function useWindowScroll(){const[position,setPosition]=(0,index_js_.useState)({x:0,y:0});useWindowEvent("scroll",()=>setPosition(getScrollPosition()));useWindowEvent("resize",()=>setPosition(getScrollPosition()));(0,index_js_.useEffect)(()=>{setPosition(getScrollPosition())},[]);return[position,scrollTo]}"use client";function useIntersection(options){const[entry,setEntry]=(0,index_js_.useState)(null);const observer=(0,index_js_.useRef)(null);const ref=(0,index_js_.useCallback)(element=>{if(observer.current){observer.current.disconnect();observer.current=null}if(null===element)return void setEntry(null);observer.current=new IntersectionObserver(([_entry])=>{setEntry(_entry)},options);observer.current.observe(element)},[options?.rootMargin,options?.root,options?.threshold]);return{ref,entry}}"use client";function useHash({getInitialValueInEffect=true}={}){const[hash,setHash]=(0,index_js_.useState)(getInitialValueInEffect?"":window.location.hash||"");const setHashHandler=value=>{const valueWithHash=value.startsWith("#")?value:`#${value}`;window.location.hash=valueWithHash;setHash(valueWithHash)};useWindowEvent("hashchange",()=>{const newHash=window.location.hash;if(hash!==newHash)setHash(newHash)});(0,index_js_.useEffect)(()=>{if(getInitialValueInEffect)setHash(window.location.hash)},[]);return[hash,setHashHandler]}"use client";const keyNameMap={" ":"space",ArrowLeft:"arrowleft",ArrowRight:"arrowright",ArrowUp:"arrowup",ArrowDown:"arrowdown",Escape:"escape",Esc:"escape",esc:"escape",Enter:"enter",Tab:"tab",Backspace:"backspace",Delete:"delete",Insert:"insert",Home:"home",End:"end",PageUp:"pageup",PageDown:"pagedown","+":"plus","-":"minus","*":"asterisk","/":"slash"};function normalizeKey(key){const lowerKey=key.replace("Key","").toLowerCase();return keyNameMap[key]||lowerKey}function parseHotkey(hotkey){const keys=hotkey.toLowerCase().split("+").map(part=>part.trim());const modifiers={alt:keys.includes("alt"),ctrl:keys.includes("ctrl"),meta:keys.includes("meta"),mod:keys.includes("mod"),shift:keys.includes("shift"),plus:keys.includes("[plus]")};const reservedKeys=["alt","ctrl","meta","shift","mod"];const freeKey=keys.find(key=>!reservedKeys.includes(key));return{...modifiers,key:"[plus]"===freeKey?"+":freeKey}}function isExactHotkey(hotkey,event,usePhysicalKeys){const{alt,ctrl,meta,mod,shift,key}=hotkey;const{altKey,ctrlKey,metaKey,shiftKey,key:pressedKey,code:pressedCode}=event;if(alt!==altKey)return false;if(mod){if(!ctrlKey&&!metaKey)return false}else{if(ctrl!==ctrlKey)return false;if(meta!==metaKey)return false}if(shift!==shiftKey)return false;if(key&&(usePhysicalKeys?normalizeKey(pressedCode)===normalizeKey(key):normalizeKey(pressedKey??pressedCode)===normalizeKey(key)))return true;return false}function getHotkeyMatcher(hotkey,usePhysicalKeys){return event=>isExactHotkey(parseHotkey(hotkey),event,usePhysicalKeys)}function getHotkeyHandler(hotkeys){return event=>{const _event="nativeEvent"in event?event.nativeEvent:event;hotkeys.forEach(([hotkey,handler,options={preventDefault:true,usePhysicalKeys:false}])=>{if(getHotkeyMatcher(hotkey,options.usePhysicalKeys)(_event)){if(options.preventDefault)event.preventDefault();handler(_event)}})}}"use client";function shouldFireEvent(event,tagsToIgnore,triggerOnContentEditable=false){if(event.target instanceof HTMLElement){if(triggerOnContentEditable)return!tagsToIgnore.includes(event.target.tagName);return!event.target.isContentEditable&&!tagsToIgnore.includes(event.target.tagName)}return true}function useHotkeys(hotkeys,tagsToIgnore=["INPUT","TEXTAREA","SELECT"],triggerOnContentEditable=false){(0,index_js_.useEffect)(()=>{const keydownListener=event=>{hotkeys.forEach(([hotkey,handler,options={preventDefault:true,usePhysicalKeys:false}])=>{if(getHotkeyMatcher(hotkey,options.usePhysicalKeys)(event)&&shouldFireEvent(event,tagsToIgnore,triggerOnContentEditable)){if(options.preventDefault)event.preventDefault();handler(event)}})};document.documentElement.addEventListener("keydown",keydownListener);return()=>document.documentElement.removeEventListener("keydown",keydownListener)},[hotkeys])}"use client";function getFullscreenElement(){const _document=window.document;const fullscreenElement=_document.fullscreenElement||_document.webkitFullscreenElement||_document.mozFullScreenElement||_document.msFullscreenElement;return fullscreenElement}function exitFullscreen(){const _document=window.document;if("function"==typeof _document.exitFullscreen)return _document.exitFullscreen();if("function"==typeof _document.msExitFullscreen)return _document.msExitFullscreen();if("function"==typeof _document.webkitExitFullscreen)return _document.webkitExitFullscreen();if("function"==typeof _document.mozCancelFullScreen)return _document.mozCancelFullScreen();return null}function enterFullScreen(element){const _element=element;return _element.requestFullscreen?.()||_element.msRequestFullscreen?.()||_element.webkitEnterFullscreen?.()||_element.webkitRequestFullscreen?.()||_element.mozRequestFullscreen?.()}const prefixes=["","webkit","moz","ms"];function addEvents(element,{onFullScreen,onError}){prefixes.forEach(prefix=>{element.addEventListener(`${prefix}fullscreenchange`,onFullScreen);element.addEventListener(`${prefix}fullscreenerror`,onError)});return()=>{prefixes.forEach(prefix=>{element.removeEventListener(`${prefix}fullscreenchange`,onFullScreen);element.removeEventListener(`${prefix}fullscreenerror`,onError)})}}function useFullscreen(){const[fullscreen,setFullscreen]=(0,index_js_.useState)(false);const _ref=(0,index_js_.useRef)(null);const handleFullscreenChange=(0,index_js_.useCallback)(event=>{setFullscreen(event.target===getFullscreenElement())},[setFullscreen]);const handleFullscreenError=(0,index_js_.useCallback)(event=>{setFullscreen(false);console.error(`[@mantine/hooks] use-fullscreen: Error attempting full-screen mode method: ${event} (${event.target})`)},[setFullscreen]);const toggle=(0,index_js_.useCallback)(async()=>{if(getFullscreenElement())await exitFullscreen();else await enterFullScreen(_ref.current)},[]);const ref=(0,index_js_.useCallback)(element=>{if(null===element)_ref.current=window.document.documentElement;else _ref.current=element},[]);(0,index_js_.useEffect)(()=>{if(!_ref.current&&window.document){_ref.current=window.document.documentElement;return addEvents(_ref.current,{onFullScreen:handleFullscreenChange,onError:handleFullscreenError})}if(_ref.current)return addEvents(_ref.current,{onFullScreen:handleFullscreenChange,onError:handleFullscreenError})},[_ref.current]);return{ref,toggle,fullscreen}}"use client";function useLogger(componentName,props){(0,index_js_.useEffect)(()=>{console.log(`${componentName} mounted`,...props);return()=>console.log(`${componentName} unmounted`)},[]);useDidUpdate(()=>{console.log(`${componentName} updated`,...props)},props);return null}"use client";function useHover(){const[hovered,setHovered]=(0,index_js_.useState)(false);const previousNode=(0,index_js_.useRef)(null);const handleMouseEnter=(0,index_js_.useCallback)(()=>{setHovered(true)},[]);const handleMouseLeave=(0,index_js_.useCallback)(()=>{setHovered(false)},[]);const ref=(0,index_js_.useCallback)(node=>{if(previousNode.current){previousNode.current.removeEventListener("mouseenter",handleMouseEnter);previousNode.current.removeEventListener("mouseleave",handleMouseLeave)}if(node){node.addEventListener("mouseenter",handleMouseEnter);node.addEventListener("mouseleave",handleMouseLeave)}previousNode.current=node},[handleMouseEnter,handleMouseLeave]);return{ref,hovered}}"use client";function useValidatedState(initialValue,validate,initialValidationState){const[value,setValue]=(0,index_js_.useState)(initialValue);const[lastValidValue,setLastValidValue]=(0,index_js_.useState)(validate(initialValue)?initialValue:void 0);const[valid,setValid]=(0,index_js_.useState)("boolean"==typeof initialValidationState?initialValidationState:validate(initialValue));const onChange=val=>{if(validate(val)){setLastValidValue(val);setValid(true)}else setValid(false);setValue(val)};return[{value,lastValidValue,valid},onChange]}"use client";function isMacOS(userAgent){const macosPattern=/(Macintosh)|(MacIntel)|(MacPPC)|(Mac68K)/i;return macosPattern.test(userAgent)}function isIOS(userAgent){const iosPattern=/(iPhone)|(iPad)|(iPod)/i;return iosPattern.test(userAgent)}function isWindows(userAgent){const windowsPattern=/(Win32)|(Win64)|(Windows)|(WinCE)/i;return windowsPattern.test(userAgent)}function isAndroid(userAgent){const androidPattern=/Android/i;return androidPattern.test(userAgent)}function isLinux(userAgent){const linuxPattern=/Linux/i;return linuxPattern.test(userAgent)}function isChromeOS(userAgent){const chromePattern=/CrOS/i;return chromePattern.test(userAgent)}function getOS(){if("undefined"==typeof window)return"undetermined";const{userAgent}=window.navigator;if(isIOS(userAgent)||isMacOS(userAgent)&&"ontouchend"in document)return"ios";if(isMacOS(userAgent))return"macos";if(isWindows(userAgent))return"windows";if(isAndroid(userAgent))return"android";if(isLinux(userAgent))return"linux";if(isChromeOS(userAgent))return"chromeos";return"undetermined"}function useOs(options={getValueInEffect:true}){const[value,setValue]=(0,index_js_.useState)(options.getValueInEffect?"undetermined":getOS());useIsomorphicEffect(()=>{if(options.getValueInEffect)setValue(getOS)},[]);return value}"use client";function useSetState(initialState){const[state,setState]=(0,index_js_.useState)(initialState);const _setState=(0,index_js_.useCallback)(statePartial=>setState(current=>({...current,..."function"==typeof statePartial?statePartial(current):statePartial})),[]);return[state,_setState]}"use client";function getInputOnChange(setValue){return val=>{if(val)if("function"==typeof val)setValue(val);else if("object"==typeof val&&"nativeEvent"in val){const{currentTarget}=val;"checkbox"===currentTarget.type?setValue(currentTarget.checked):setValue(currentTarget.value)}else setValue(val);else setValue(val)}}function useInputState(initialState){const[value,setValue]=(0,index_js_.useState)(initialState);return[value,getInputOnChange(setValue)]}"use client";function useEventListener(type,listener,options){const previousListener=(0,index_js_.useRef)(null);const previousNode=(0,index_js_.useRef)(null);const callbackRef=(0,index_js_.useCallback)(node=>{if(!node)return;if(previousNode.current&&previousListener.current)previousNode.current.removeEventListener(type,previousListener.current,options);node.addEventListener(type,listener,options);previousNode.current=node;previousListener.current=listener},[type,listener,options]);(0,index_js_.useEffect)(()=>()=>{if(previousNode.current&&previousListener.current)previousNode.current.removeEventListener(type,previousListener.current,options)},[type,options]);return callbackRef}"use client";function useDisclosure(initialState=false,options={}){const[opened,setOpened]=(0,index_js_.useState)(initialState);const open=(0,index_js_.useCallback)(()=>{setOpened(isOpened=>{if(!isOpened){options.onOpen?.();return true}return isOpened})},[options.onOpen]);const close=(0,index_js_.useCallback)(()=>{setOpened(isOpened=>{if(isOpened){options.onClose?.();return false}return isOpened})},[options.onClose]);const toggle=(0,index_js_.useCallback)(()=>{opened?close():open()},[close,open,opened]);return[opened,{open,close,toggle}]}"use client";function containsRelatedTarget(event){if(event.currentTarget instanceof HTMLElement&&event.relatedTarget instanceof HTMLElement)return event.currentTarget.contains(event.relatedTarget);return false}function useFocusWithin({onBlur,onFocus}={}){const[focused,setFocused]=(0,index_js_.useState)(false);const focusedRef=(0,index_js_.useRef)(false);const previousNode=(0,index_js_.useRef)(null);const _setFocused=(0,index_js_.useCallback)(value=>{setFocused(value);focusedRef.current=value},[]);const handleFocusIn=(0,index_js_.useCallback)(event=>{if(!focusedRef.current){_setFocused(true);onFocus?.(event)}},[onFocus]);const handleFocusOut=(0,index_js_.useCallback)(event=>{if(focusedRef.current&&!containsRelatedTarget(event)){_setFocused(false);onBlur?.(event)}},[onBlur]);const callbackRef=(0,index_js_.useCallback)(node=>{if(!node)return;if(previousNode.current){previousNode.current.removeEventListener("focusin",handleFocusIn);previousNode.current.removeEventListener("focusout",handleFocusOut)}node.addEventListener("focusin",handleFocusIn);node.addEventListener("focusout",handleFocusOut)},[handleFocusIn,handleFocusOut]);(0,index_js_.useEffect)(()=>()=>{if(previousNode.current){previousNode.current.removeEventListener("focusin",handleFocusIn);previousNode.current.removeEventListener("focusout",handleFocusOut)}},[]);return{ref:callbackRef,focused}}"use client";function getConnection(){if("undefined"==typeof navigator)return{};const _navigator=navigator;const connection=_navigator.connection||_navigator.mozConnection||_navigator.webkitConnection;if(!connection)return{};return{downlink:connection?.downlink,downlinkMax:connection?.downlinkMax,effectiveType:connection?.effectiveType,rtt:connection?.rtt,saveData:connection?.saveData,type:connection?.type}}function useNetwork(){const[status,setStatus]=(0,index_js_.useState)({online:true});const handleConnectionChange=(0,index_js_.useCallback)(()=>setStatus(current=>({...current,...getConnection()})),[]);useWindowEvent("online",()=>setStatus({online:true,...getConnection()}));useWindowEvent("offline",()=>setStatus({online:false,...getConnection()}));(0,index_js_.useEffect)(()=>{const _navigator=navigator;if(_navigator.connection){setStatus({online:_navigator.onLine,...getConnection()});_navigator.connection.addEventListener("change",handleConnectionChange);return()=>_navigator.connection.removeEventListener("change",handleConnectionChange)}if("boolean"==typeof _navigator.onLine)setStatus(current=>({...current,online:_navigator.onLine}))},[]);return status}"use client";function useTimeout(callback,delay,options={autoInvoke:false}){const timeoutRef=(0,index_js_.useRef)(null);const start=(0,index_js_.useCallback)((...args)=>{if(!timeoutRef.current)timeoutRef.current=window.setTimeout(()=>{callback(args);timeoutRef.current=null},delay)},[delay]);const clear=(0,index_js_.useCallback)(()=>{if(timeoutRef.current){window.clearTimeout(timeoutRef.current);timeoutRef.current=null}},[]);(0,index_js_.useEffect)(()=>{if(options.autoInvoke)start();return clear},[clear,start]);return{start,clear}}"use client";function useTextSelection(){const forceUpdate=useForceUpdate();const[selection,setSelection]=(0,index_js_.useState)(null);const handleSelectionChange=()=>{setSelection(document.getSelection());forceUpdate()};(0,index_js_.useEffect)(()=>{setSelection(document.getSelection());document.addEventListener("selectionchange",handleSelectionChange);return()=>document.removeEventListener("selectionchange",handleSelectionChange)},[]);return selection}"use client";function usePrevious(value){const ref=(0,index_js_.useRef)(void 0);(0,index_js_.useEffect)(()=>{ref.current=value},[value]);return ref.current}"use client";const MIME_TYPES={ico:"image/x-icon",png:"image/png",svg:"image/svg+xml",gif:"image/gif"};function useFavicon(url){const link=(0,index_js_.useRef)(null);useIsomorphicEffect(()=>{if(!url)return;if(!link.current){const existingElements=document.querySelectorAll('link[rel*="icon"]');existingElements.forEach(element2=>document.head.removeChild(element2));const element=document.createElement("link");element.rel="shortcut icon";link.current=element;document.querySelector("head").appendChild(element)}const splittedUrl=url.split(".");link.current.setAttribute("type",MIME_TYPES[splittedUrl[splittedUrl.length-1].toLowerCase()]);link.current.setAttribute("href",url)},[url])}"use client";const isFixed=(current,fixedAt)=>current<=fixedAt;const isPinnedOrReleased=(current,fixedAt,isCurrentlyPinnedRef,isScrollingUp,onPin,onRelease)=>{const isInFixedPosition=isFixed(current,fixedAt);if(isInFixedPosition&&!isCurrentlyPinnedRef.current){isCurrentlyPinnedRef.current=true;onPin?.()}else if(isInFixedPosition||!isScrollingUp||isCurrentlyPinnedRef.current){if(!isInFixedPosition&&isCurrentlyPinnedRef.current){isCurrentlyPinnedRef.current=false;onRelease?.()}}else{isCurrentlyPinnedRef.current=true;onPin?.()}};const useScrollDirection=()=>{const[lastScrollTop,setLastScrollTop]=(0,index_js_.useState)(0);const[isScrollingUp,setIsScrollingUp]=(0,index_js_.useState)(false);const[isResizing,setIsResizing]=(0,index_js_.useState)(false);(0,index_js_.useEffect)(()=>{let resizeTimer;const onResize=()=>{setIsResizing(true);clearTimeout(resizeTimer);resizeTimer=setTimeout(()=>{setIsResizing(false)},300)};const onScroll=()=>{if(isResizing)return;const currentScrollTop=window.scrollY||document.documentElement.scrollTop;setIsScrollingUp(currentScrollTop<lastScrollTop);setLastScrollTop(currentScrollTop)};window.addEventListener("scroll",onScroll);window.addEventListener("resize",onResize);return()=>{window.removeEventListener("scroll",onScroll);window.removeEventListener("resize",onResize)}},[lastScrollTop,isResizing]);return isScrollingUp};function useHeadroom({fixedAt=0,onPin,onFix,onRelease}={}){const isCurrentlyPinnedRef=(0,index_js_.useRef)(false);const isScrollingUp=useScrollDirection();const[{y:scrollPosition}]=useWindowScroll();useIsomorphicEffect(()=>{isPinnedOrReleased(scrollPosition,fixedAt,isCurrentlyPinnedRef,isScrollingUp,onPin,onRelease)},[scrollPosition]);useIsomorphicEffect(()=>{if(isFixed(scrollPosition,fixedAt))onFix?.()},[scrollPosition,fixedAt,onFix]);if(isFixed(scrollPosition,fixedAt)||isScrollingUp)return true;return false}"use client";function useEyeDropper(){const[supported,setSupported]=(0,index_js_.useState)(false);useIsomorphicEffect(()=>{setSupported("undefined"!=typeof window&&!isOpera()&&"EyeDropper"in window)},[]);const open=(0,index_js_.useCallback)((options={})=>{if(supported){const eyeDropper=new window.EyeDropper;return eyeDropper.open(options)}return Promise.resolve(void 0)},[supported]);return{supported,open}}function isOpera(){return navigator.userAgent.includes("OPR")}"use client";function useInViewport(){const observer=(0,index_js_.useRef)(null);const[inViewport,setInViewport]=(0,index_js_.useState)(false);const ref=(0,index_js_.useCallback)(node=>{if("undefined"!=typeof IntersectionObserver){if(node&&!observer.current)observer.current=new IntersectionObserver(entries=>setInViewport(entries.some(entry=>entry.isIntersecting)));else observer.current?.disconnect();if(node)observer.current?.observe(node);else setInViewport(false)}},[]);return{ref,inViewport}}"use client";function useMutationObserver(callback,options,target){const observer=(0,index_js_.useRef)(null);const ref=(0,index_js_.useRef)(null);(0,index_js_.useEffect)(()=>{const targetElement="function"==typeof target?target():target;if(targetElement||ref.current){observer.current=new MutationObserver(callback);observer.current.observe(targetElement||ref.current,options)}return()=>{observer.current?.disconnect()}},[callback,options]);return ref}"use client";function useMounted(){const[mounted,setMounted]=(0,index_js_.useState)(false);(0,index_js_.useEffect)(()=>setMounted(true),[]);return mounted}"use client";function useStateHistory(initialValue){const[state,setState]=(0,index_js_.useState)({history:[initialValue],current:0});const set=(0,index_js_.useCallback)(val=>setState(currentState=>{const nextState=[...currentState.history.slice(0,currentState.current+1),val];return{history:nextState,current:nextState.length-1}}),[]);const back=(0,index_js_.useCallback)((steps=1)=>setState(currentState=>({history:currentState.history,current:Math.max(0,currentState.current-steps)})),[]);const forward=(0,index_js_.useCallback)((steps=1)=>setState(currentState=>({history:currentState.history,current:Math.min(currentState.history.length-1,currentState.current+steps)})),[]);const reset=(0,index_js_.useCallback)(()=>{setState({history:[initialValue],current:0})},[initialValue]);const handlers=(0,index_js_.useMemo)(()=>({back,forward,reset,set}),[back,forward,reset,set]);return[state.history[state.current],handlers,state]}"use client";function useMap(initialState){const mapRef=(0,index_js_.useRef)(new Map(initialState));const forceUpdate=useForceUpdate();mapRef.current.set=(...args)=>{Map.prototype.set.apply(mapRef.current,args);forceUpdate();return mapRef.current};mapRef.current.clear=(...args)=>{Map.prototype.clear.apply(mapRef.current,args);forceUpdate()};mapRef.current.delete=(...args)=>{const res=Map.prototype.delete.apply(mapRef.current,args);forceUpdate();return res};return mapRef.current}"use client";function readonlySetLikeToSet(input){if(input instanceof Set)return input;const result=/* @__PURE__ */new Set;for(const item of input)result.add(item);return result}function useSet(values){const setRef=(0,index_js_.useRef)(new Set(values));const forceUpdate=useForceUpdate();setRef.current.add=(...args)=>{const res=Set.prototype.add.apply(setRef.current,args);forceUpdate();return res};setRef.current.clear=(...args)=>{Set.prototype.clear.apply(setRef.current,args);forceUpdate()};setRef.current.delete=(...args)=>{const res=Set.prototype.delete.apply(setRef.current,args);forceUpdate();return res};setRef.current.union=other=>{const result=new Set(setRef.current);readonlySetLikeToSet(other).forEach(item=>result.add(item));return result};setRef.current.intersection=other=>{const result=/* @__PURE__ */new Set;const otherSet=readonlySetLikeToSet(other);setRef.current.forEach(item=>{if(otherSet.has(item))result.add(item)});return result};setRef.current.difference=other=>{const result=/* @__PURE__ */new Set;const otherSet=readonlySetLikeToSet(other);setRef.current.forEach(item=>{if(!otherSet.has(item))result.add(item)});return result};setRef.current.symmetricDifference=other=>{const result=/* @__PURE__ */new Set;const otherSet=readonlySetLikeToSet(other);setRef.current.forEach(item=>{if(!otherSet.has(item))result.add(item)});otherSet.forEach(item=>{if(!setRef.current.has(item))result.add(item)});return result};return setRef.current}"use client";function useThrottledCallbackWithClearTimeout(callback,wait){const handleCallback=useCallbackRef(callback);const latestInArgsRef=(0,index_js_.useRef)(null);const latestOutArgsRef=(0,index_js_.useRef)(null);const active=(0,index_js_.useRef)(true);const waitRef=(0,index_js_.useRef)(wait);const timeoutRef=(0,index_js_.useRef)(-1);const clearTimeout1=()=>window.clearTimeout(timeoutRef.current);const callThrottledCallback=(0,index_js_.useCallback)((...args)=>{handleCallback(...args);latestInArgsRef.current=args;latestOutArgsRef.current=args;active.current=false},[handleCallback]);const timerCallback=(0,index_js_.useCallback)(()=>{if(latestInArgsRef.current&&latestInArgsRef.current!==latestOutArgsRef.current){callThrottledCallback(...latestInArgsRef.current);timeoutRef.current=window.setTimeout(timerCallback,waitRef.current)}else active.current=true},[callThrottledCallback]);const throttled=(0,index_js_.useCallback)((...args)=>{if(active.current){callThrottledCallback(...args);timeoutRef.current=window.setTimeout(timerCallback,waitRef.current)}else latestInArgsRef.current=args},[callThrottledCallback,timerCallback]);(0,index_js_.useEffect)(()=>{waitRef.current=wait},[wait]);return[throttled,clearTimeout1]}function useThrottledCallback(callback,wait){return useThrottledCallbackWithClearTimeout(callback,wait)[0]}"use client";function useThrottledState(defaultValue,wait){const[value,setValue]=(0,index_js_.useState)(defaultValue);const[setThrottledValue,clearTimeout1]=useThrottledCallbackWithClearTimeout(setValue,wait);(0,index_js_.useEffect)(()=>clearTimeout1,[]);return[value,setThrottledValue]}"use client";function useThrottledValue(value,wait){const[throttledValue,setThrottledValue]=(0,index_js_.useState)(value);const valueRef=(0,index_js_.useRef)(value);const[throttledSetValue,clearTimeout1]=useThrottledCallbackWithClearTimeout(setThrottledValue,wait);(0,index_js_.useEffect)(()=>{if(value!==valueRef.current){valueRef.current=value;throttledSetValue(value)}},[throttledSetValue,value]);(0,index_js_.useEffect)(()=>clearTimeout1,[]);return throttledValue}"use client";function useIsFirstRender(){const renderRef=(0,index_js_.useRef)(true);if(true===renderRef.current){renderRef.current=false;return true}return renderRef.current}"use client";function use_orientation_getInitialValue(initialValue,getInitialValueInEffect){if(getInitialValueInEffect)return initialValue;if("undefined"!=typeof window&&"screen"in window)return{angle:window.screen.orientation?.angle??initialValue.angle,type:window.screen.orientation?.type??initialValue.type};return initialValue}function useOrientation({defaultAngle=0,defaultType="landscape-primary",getInitialValueInEffect=true}={}){const[orientation,setOrientation]=(0,index_js_.useState)(use_orientation_getInitialValue({angle:defaultAngle,type:defaultType},getInitialValueInEffect));const handleOrientationChange=event=>{const target=event.currentTarget;setOrientation({angle:target?.angle||0,type:target?.type||"landscape-primary"})};useIsomorphicEffect(()=>{window.screen.orientation?.addEventListener("change",handleOrientationChange);return()=>window.screen.orientation?.removeEventListener("change",handleOrientationChange)},[]);return orientation}"use client";function useFetch(url,{autoInvoke=true,...options}={}){const[data,setData]=(0,index_js_.useState)(null);const[loading,setLoading]=(0,index_js_.useState)(false);const[error,setError]=(0,index_js_.useState)(null);const controller=(0,index_js_.useRef)(null);const refetch=(0,index_js_.useCallback)(()=>{if(controller.current)controller.current.abort();controller.current=new AbortController;setLoading(true);return fetch(url,{signal:controller.current.signal,...options}).then(res=>res.json()).then(res=>{setData(res);setLoading(false);return res}).catch(err=>{setLoading(false);if("AbortError"!==err.name)setError(err);return err})},[url]);const abort=(0,index_js_.useCallback)(()=>{if(controller.current)controller.current?.abort("")},[]);(0,index_js_.useEffect)(()=>{if(autoInvoke)refetch();return()=>{if(controller.current)controller.current.abort("")}},[refetch,autoInvoke]);return{data,loading,error,refetch,abort}}"use client";function radiansToDegrees(radians){return 180/Math.PI*radians}function getElementCenter(element){const rect=element.getBoundingClientRect();return[rect.left+rect.width/2,rect.top+rect.height/2]}function getAngle(coordinates,element){const center=getElementCenter(element);const x=coordinates[0]-center[0];const y=coordinates[1]-center[1];const deg=radiansToDegrees(Math.atan2(x,y))+180;return 360-deg}function toFixed(value,digits){return parseFloat(value.toFixed(digits))}function getDigitsAfterDot(value){return value.toString().split(".")[1]?.length||0}function normalizeRadialValue(degree,step){const clamped=clamp(degree,0,360);const high=Math.ceil(clamped/step);const low=Math.round(clamped/step);return toFixed(high>=clamped/step?high*step===360?0:high*step:low*step,getDigitsAfterDot(step))}function useRadialMove(onChange,{step=.01,onChangeEnd,onScrubStart,onScrubEnd}={}){const mounted=(0,index_js_.useRef)(false);const[active,setActive]=(0,index_js_.useState)(false);(0,index_js_.useEffect)(()=>{mounted.current=true},[]);const refCallback=(0,index_js_.useCallback)(node=>{const update=(event,done=false)=>{if(node){node.style.userSelect="none";const deg=getAngle([event.clientX,event.clientY],node);const newValue=normalizeRadialValue(deg,step||1);onChange(newValue);done&&onChangeEnd?.(newValue)}};const beginTracking=()=>{onScrubStart?.();setActive(true);document.addEventListener("mousemove",handleMouseMove,false);document.addEventListener("mouseup",handleMouseUp,false);document.addEventListener("touchmove",handleTouchMove,{passive:false});document.addEventListener("touchend",handleTouchEnd,false)};const endTracking=()=>{onScrubEnd?.();setActive(false);document.removeEventListener("mousemove",handleMouseMove,false);document.removeEventListener("mouseup",handleMouseUp,false);document.removeEventListener("touchmove",handleTouchMove,false);document.removeEventListener("touchend",handleTouchEnd,false)};const onMouseDown=event=>{beginTracking();update(event)};const handleMouseMove=event=>{update(event)};const handleMouseUp=event=>{update(event,true);endTracking()};const handleTouchMove=event=>{event.preventDefault();update(event.touches[0])};const handleTouchEnd=event=>{update(event.changedTouches[0],true);endTracking()};const handleTouchStart=event=>{event.preventDefault();beginTracking();update(event.touches[0])};node?.addEventListener("mousedown",onMouseDown);node?.addEventListener("touchstart",handleTouchStart,{passive:false});return()=>{if(node){node.removeEventListener("mousedown",onMouseDown);node.removeEventListener("touchstart",handleTouchStart)}}},[onChange]);return{ref:refCallback,active}}"use client";function getHeadingsData(headings,getDepth,getValue){const result=[];for(let i=0;i<headings.length;i+=1){const heading=headings[i];result.push({depth:getDepth(heading),value:getValue(heading),id:heading.id||randomId(),getNode:()=>heading.id?document.getElementById(heading.id):heading})}return result}function getActiveElement(rects){if(0===rects.length)return -1;const closest=rects.reduce((acc,item,index)=>{if(Math.abs(acc.position)<Math.abs(item.y))return acc;return{index,position:item.y}},{index:0,position:rects[0].y});return closest.index}function getDefaultDepth(element){return Number(element.tagName[1])}function getDefaultValue(element){return element.textContent||""}function useScrollSpy({selector="h1, h2, h3, h4, h5, h6",getDepth=getDefaultDepth,getValue=getDefaultValue,scrollHost}={}){const[active,setActive]=(0,index_js_.useState)(-1);const[initialized,setInitialized]=(0,index_js_.useState)(false);const[data,setData]=(0,index_js_.useState)([]);const headingsRef=(0,index_js_.useRef)([]);const handleScroll=()=>{setActive(getActiveElement(headingsRef.current.map(d=>d.getNode().getBoundingClientRect())))};const initialize=()=>{const headings=getHeadingsData(Array.from(document.querySelectorAll(selector)),getDepth,getValue);headingsRef.current=headings;setInitialized(true);setData(headings);setActive(getActiveElement(headings.map(d=>d.getNode().getBoundingClientRect())))};(0,index_js_.useEffect)(()=>{initialize();const _scrollHost=scrollHost||window;_scrollHost.addEventListener("scroll",handleScroll);return()=>_scrollHost.removeEventListener("scroll",handleScroll)},[]);return{reinitialize:initialize,active,initialized,data}}"use client";const defaultOptions={multiple:true,accept:"*"};function getInitialFilesList(files){if(!files)return null;if(files instanceof FileList)return files;const result=new DataTransfer;for(const file of files)result.items.add(file);return result.files}function createInput(options){if("undefined"==typeof document)return null;const input=document.createElement("input");input.type="file";if(options.accept)input.accept=options.accept;if(options.multiple)input.multiple=options.multiple;if(options.capture)input.capture=options.capture;if(options.directory)input.webkitdirectory=options.directory;input.style.display="none";return input}function useFileDialog(input={}){const options={...defaultOptions,...input};const[files,setFiles]=(0,index_js_.useState)(getInitialFilesList(options.initialFiles));const inputRef=(0,index_js_.useRef)(null);const handleChange=(0,index_js_.useCallback)(event=>{const target=event.target;if(target?.files){setFiles(target.files);options.onChange?.(target.files)}},[options.onChange]);const createAndSetupInput=(0,index_js_.useCallback)(()=>{inputRef.current?.remove();inputRef.current=createInput(options);if(inputRef.current){inputRef.current.addEventListener("change",handleChange,{once:true});document.body.appendChild(inputRef.current)}},[options,handleChange]);useIsomorphicEffect(()=>{createAndSetupInput();return()=>inputRef.current?.remove()},[]);const reset=(0,index_js_.useCallback)(()=>{setFiles(null);options.onChange?.(null)},[options.onChange]);const open=(0,index_js_.useCallback)(()=>{if(options.resetOnOpen)reset();createAndSetupInput();inputRef.current?.click()},[options.resetOnOpen,reset,createAndSetupInput]);return{files,open,reset}}"use client";function useLongPress(onLongPress,options={}){const{threshold=400,onStart,onFinish,onCancel}=options;const isLongPressActive=(0,index_js_.useRef)(false);const isPressed=(0,index_js_.useRef)(false);const timeout=(0,index_js_.useRef)(-1);(0,index_js_.useEffect)(()=>()=>window.clearTimeout(timeout.current),[]);return(0,index_js_.useMemo)(()=>{if("function"!=typeof onLongPress)return{};const start=event=>{if(!isMouseEvent(event)&&!isTouchEvent(event))return;if(onStart)onStart(event);isPressed.current=true;timeout.current=window.setTimeout(()=>{onLongPress(event);isLongPressActive.current=true},threshold)};const cancel=event=>{if(!isMouseEvent(event)&&!isTouchEvent(event))return;if(isLongPressActive.current){if(onFinish)onFinish(event)}else if(isPressed.current){if(onCancel)onCancel(event)}isLongPressActive.current=false;isPressed.current=false;if(timeout.current)window.clearTimeout(timeout.current)};return{onMouseDown:start,onMouseUp:cancel,onMouseLeave:cancel,onTouchStart:start,onTouchEnd:cancel}},[onLongPress,threshold,onCancel,onFinish,onStart])}function isTouchEvent(event){return window.TouchEvent?event.nativeEvent instanceof TouchEvent:"touches"in event.nativeEvent}function isMouseEvent(event){return event.nativeEvent instanceof MouseEvent}"use client";function useSelection(input){const[selectionSet,setSelectionSet]=(0,index_js_.useState)(new Set(input.defaultSelection||[]));useDidUpdate(()=>{if(input.resetSelectionOnDataChange)setSelectionSet(/* @__PURE__ */new Set)},[input.data,input.resetSelectionOnDataChange]);const select=(0,index_js_.useCallback)(selected=>{setSelectionSet(state=>{if(!state.has(selected)){const newSet=new Set(state);newSet.add(selected);return newSet}return state})},[]);const deselect=(0,index_js_.useCallback)(deselected=>{setSelectionSet(state=>{if(state.has(deselected)){const newSet=new Set(state);newSet.delete(deselected);return newSet}return state})},[]);const toggle=(0,index_js_.useCallback)(toggled=>{setSelectionSet(state=>{const newSet=new Set(state);if(state.has(toggled))newSet.delete(toggled);else newSet.add(toggled);return newSet})},[]);const resetSelection=(0,index_js_.useCallback)(()=>{setSelectionSet(/* @__PURE__ */new Set)},[]);const setSelection=(0,index_js_.useCallback)(selection=>{setSelectionSet(new Set(selection))},[]);const isAllSelected=(0,index_js_.useCallback)(()=>{if(0===input.data.length)return false;return input.data.every(item=>selectionSet.has(item))},[selectionSet,input.data]);const isSomeSelected=(0,index_js_.useCallback)(()=>input.data.some(item=>selectionSet.has(item)),[selectionSet,input.data]);return[Array.from(selectionSet),{select,deselect,toggle,isAllSelected,isSomeSelected,setSelection,resetSelection}]}}}]);
1
+ "use strict";(globalThis["chunk_tech_app"]=globalThis["chunk_tech_app"]||[]).push([["7541"],{281:function(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{useOrientation:()=>useOrientation,clamp:()=>clamp,useDebouncedValue:()=>useDebouncedValue,useMutationObserver:()=>useMutationObserver,useResizeObserver:()=>useResizeObserver,useSet:()=>useSet,randomId:()=>randomId,useShallowEffect:()=>useShallowEffect,useThrottledState:()=>useThrottledState,mergeRefs:()=>mergeRefs,usePrevious:()=>usePrevious,useLongPress:()=>useLongPress,useReducedMotion:()=>useReducedMotion,useSetState:()=>useSetState,readLocalStorageValue:()=>readLocalStorageValue,useCounter:()=>useCounter,useValidatedState:()=>useValidatedState,useDebouncedState:()=>useDebouncedState,useMove:()=>useMove,useFileDialog:()=>useFileDialog,useClipboard:()=>useClipboard,useIsomorphicEffect:()=>useIsomorphicEffect,useLogger:()=>useLogger,useIdle:()=>useIdle,useElementSize:()=>useElementSize,useClickOutside:()=>useClickOutside,shallowEqual:()=>shallowEqual,useNetwork:()=>useNetwork,useEyeDropper:()=>useEyeDropper,useId:()=>useId,range:()=>range,useMediaQuery:()=>useMediaQuery,useRadialMove:()=>useRadialMove,useHotkeys:()=>useHotkeys,useSelection:()=>useSelection,useWindowEvent:()=>useWindowEvent,useInterval:()=>useInterval,useHeadroom:()=>useHeadroom,useSessionStorage:()=>useSessionStorage,useDebouncedCallback:()=>useDebouncedCallback,useDocumentTitle:()=>useDocumentTitle,useFocusTrap:()=>useFocusTrap,useHash:()=>useHash,upperFirst:()=>upperFirst,useThrottledValue:()=>useThrottledValue,useOs:()=>useOs,normalizeRadialValue:()=>normalizeRadialValue,useDocumentVisibility:()=>useDocumentVisibility,useHover:()=>useHover,useMap:()=>useMap,useScrollIntoView:()=>useScrollIntoView,useFocusReturn:()=>useFocusReturn,usePageLeave:()=>usePageLeave,useMergedRef:()=>useMergedRef,useDidUpdate:()=>useDidUpdate,useInViewport:()=>useInViewport,useIsFirstRender:()=>useIsFirstRender,usePagination:()=>usePagination,useMouse:()=>useMouse,useFavicon:()=>useFavicon,useQueue:()=>useQueue,useTimeout:()=>useTimeout,useToggle:()=>useToggle,useColorScheme:()=>useColorScheme,useEventListener:()=>useEventListener,useFullscreen:()=>useFullscreen,useIntersection:()=>useIntersection,useLocalStorage:()=>useLocalStorage,useFocusWithin:()=>useFocusWithin,useMounted:()=>useMounted,assignRef:()=>assignRef,useThrottledCallback:()=>useThrottledCallback,useStateHistory:()=>useStateHistory,useViewportSize:()=>useViewportSize,getHotkeyHandler:()=>getHotkeyHandler,useCallbackRef:()=>useCallbackRef,useTextSelection:()=>useTextSelection,useWindowScroll:()=>useWindowScroll,useDisclosure:()=>useDisclosure,readSessionStorageValue:()=>readSessionStorageValue,clampUseMovePosition:()=>clampUseMovePosition,useInputState:()=>useInputState,useForceUpdate:()=>useForceUpdate,useFetch:()=>useFetch,useListState:()=>useListState,lowerFirst:()=>lowerFirst,useScrollSpy:()=>useScrollSpy,useUncontrolled:()=>useUncontrolled});"use client";function clamp(value,min,max){if(void 0===min&&void 0===max)return value;if(void 0!==min&&void 0===max)return Math.max(value,min);if(void 0===min&&void 0!==max)return Math.min(value,max);return Math.min(Math.max(value,min),max)}"use client";function lowerFirst(value){return"string"!=typeof value?"":value.charAt(0).toLowerCase()+value.slice(1)}"use client";function randomId(prefix="mantine-"){return`${prefix}${Math.random().toString(36).slice(2,11)}`}"use client";function range(start,end){const length=Math.abs(end-start)+1;const reversed=start>end;if(!reversed)return Array.from({length},(_,index)=>index+start);return Array.from({length},(_,index)=>start-index)}"use client";function shallowEqual(a,b){if(a===b)return true;if(Number.isNaN(a)&&Number.isNaN(b))return true;if(!(a instanceof Object)||!(b instanceof Object))return false;const keys=Object.keys(a);const{length}=keys;if(length!==Object.keys(b).length)return false;for(let i=0;i<length;i+=1){const key=keys[i];if(!(key in b))return false;if(a[key]!==b[key]&&!(Number.isNaN(a[key])&&Number.isNaN(b[key])))return false}return true}"use client";function upperFirst(value){return"string"!=typeof value?"":value.charAt(0).toUpperCase()+value.slice(1)}var consume_shared_module_default_react_strict_=__webpack_require__(5850);"use client";function useCallbackRef(callback){const callbackRef=(0,consume_shared_module_default_react_strict_.useRef)(callback);(0,consume_shared_module_default_react_strict_.useEffect)(()=>{callbackRef.current=callback});return(0,consume_shared_module_default_react_strict_.useMemo)(()=>(...args)=>callbackRef.current?.(...args),[])}"use client";function useDebouncedCallback(callback,options){const{delay,flushOnUnmount,leading}="number"==typeof options?{delay:options,flushOnUnmount:false,leading:false}:options;const handleCallback=useCallbackRef(callback);const debounceTimerRef=(0,consume_shared_module_default_react_strict_.useRef)(0);const lastCallback=(0,consume_shared_module_default_react_strict_.useMemo)(()=>{const currentCallback=Object.assign((...args)=>{window.clearTimeout(debounceTimerRef.current);const isFirstCall=currentCallback._isFirstCall;currentCallback._isFirstCall=false;function clearTimeoutAndLeadingRef(){window.clearTimeout(debounceTimerRef.current);debounceTimerRef.current=0;currentCallback._isFirstCall=true}if(leading&&isFirstCall){handleCallback(...args);const resetLeadingState=()=>{clearTimeoutAndLeadingRef()};const flush2=()=>{if(0!==debounceTimerRef.current){clearTimeoutAndLeadingRef();handleCallback(...args)}};const cancel2=()=>{clearTimeoutAndLeadingRef()};currentCallback.flush=flush2;currentCallback.cancel=cancel2;debounceTimerRef.current=window.setTimeout(resetLeadingState,delay);return}if(leading&&!isFirstCall){const flush2=()=>{if(0!==debounceTimerRef.current){clearTimeoutAndLeadingRef();handleCallback(...args)}};const cancel2=()=>{clearTimeoutAndLeadingRef()};currentCallback.flush=flush2;currentCallback.cancel=cancel2;const resetLeadingState=()=>{clearTimeoutAndLeadingRef()};debounceTimerRef.current=window.setTimeout(resetLeadingState,delay);return}const flush=()=>{if(0!==debounceTimerRef.current){clearTimeoutAndLeadingRef();handleCallback(...args)}};const cancel=()=>{clearTimeoutAndLeadingRef()};currentCallback.flush=flush;currentCallback.cancel=cancel;debounceTimerRef.current=window.setTimeout(flush,delay)},{flush:()=>{},cancel:()=>{},_isFirstCall:true});return currentCallback},[handleCallback,delay,leading]);(0,consume_shared_module_default_react_strict_.useEffect)(()=>()=>{if(flushOnUnmount)lastCallback.flush();else lastCallback.cancel()},[lastCallback,flushOnUnmount]);return lastCallback}"use client";const DEFAULT_EVENTS=["mousedown","touchstart"];function useClickOutside(callback,events,nodes){const ref=(0,consume_shared_module_default_react_strict_.useRef)(null);const eventsList=events||DEFAULT_EVENTS;(0,consume_shared_module_default_react_strict_.useEffect)(()=>{const listener=event=>{const{target}=event??{};if(Array.isArray(nodes)){const shouldIgnore=!document.body.contains(target)&&"HTML"!==target.tagName;const shouldTrigger=nodes.every(node=>!!node&&!event.composedPath().includes(node));shouldTrigger&&!shouldIgnore&&callback()}else if(ref.current&&!ref.current.contains(target))callback()};eventsList.forEach(fn=>document.addEventListener(fn,listener));return()=>{eventsList.forEach(fn=>document.removeEventListener(fn,listener))}},[ref,callback,nodes]);return ref}"use client";function useClipboard(options={timeout:2e3}){const[error,setError]=(0,consume_shared_module_default_react_strict_.useState)(null);const[copied,setCopied]=(0,consume_shared_module_default_react_strict_.useState)(false);const[copyTimeout,setCopyTimeout]=(0,consume_shared_module_default_react_strict_.useState)(null);const handleCopyResult=value=>{window.clearTimeout(copyTimeout);setCopyTimeout(window.setTimeout(()=>setCopied(false),options.timeout));setCopied(value)};const copy=value=>{if("clipboard"in navigator)navigator.clipboard.writeText(value).then(()=>handleCopyResult(true)).catch(err=>setError(err));else setError(new Error("useClipboard: navigator.clipboard is not supported"))};const reset=()=>{setCopied(false);setError(null);window.clearTimeout(copyTimeout)};return{copy,reset,error,copied}}"use client";function attachMediaListener(query,callback){try{query.addEventListener("change",callback);return()=>query.removeEventListener("change",callback)}catch(e){query.addListener(callback);return()=>query.removeListener(callback)}}function getInitialValue(query,initialValue){if("undefined"!=typeof window&&"matchMedia"in window)return window.matchMedia(query).matches;return false}function useMediaQuery(query,initialValue,{getInitialValueInEffect}={getInitialValueInEffect:true}){const[matches,setMatches]=(0,consume_shared_module_default_react_strict_.useState)(getInitialValueInEffect?initialValue:getInitialValue(query));const queryRef=(0,consume_shared_module_default_react_strict_.useRef)(null);(0,consume_shared_module_default_react_strict_.useEffect)(()=>{if("matchMedia"in window){queryRef.current=window.matchMedia(query);setMatches(queryRef.current.matches);return attachMediaListener(queryRef.current,event=>setMatches(event.matches))}},[query]);return matches||false}"use client";function useColorScheme(initialValue,options){return useMediaQuery("(prefers-color-scheme: dark)","dark"===initialValue,options)?"dark":"light"}"use client";const DEFAULT_OPTIONS={min:-1/0,max:1/0};function useCounter(initialValue=0,options){const{min,max}={...DEFAULT_OPTIONS,...options};const[count,setCount]=(0,consume_shared_module_default_react_strict_.useState)(clamp(initialValue,min,max));const increment=(0,consume_shared_module_default_react_strict_.useCallback)(()=>setCount(current=>clamp(current+1,min,max)),[min,max]);const decrement=(0,consume_shared_module_default_react_strict_.useCallback)(()=>setCount(current=>clamp(current-1,min,max)),[min,max]);const set=(0,consume_shared_module_default_react_strict_.useCallback)(value=>setCount(clamp(value,min,max)),[min,max]);const reset=(0,consume_shared_module_default_react_strict_.useCallback)(()=>setCount(clamp(initialValue,min,max)),[initialValue,min,max]);return[count,{increment,decrement,set,reset}]}"use client";function useDebouncedState(defaultValue,wait,options={leading:false}){const[value,setValue]=(0,consume_shared_module_default_react_strict_.useState)(defaultValue);const timeoutRef=(0,consume_shared_module_default_react_strict_.useRef)(null);const leadingRef=(0,consume_shared_module_default_react_strict_.useRef)(true);const clearTimeout1=()=>window.clearTimeout(timeoutRef.current);(0,consume_shared_module_default_react_strict_.useEffect)(()=>clearTimeout1,[]);const debouncedSetValue=(0,consume_shared_module_default_react_strict_.useCallback)(newValue=>{clearTimeout1();if(leadingRef.current&&options.leading)setValue(newValue);else timeoutRef.current=window.setTimeout(()=>{leadingRef.current=true;setValue(newValue)},wait);leadingRef.current=false},[options.leading]);return[value,debouncedSetValue]}"use client";function useDebouncedValue(value,wait,options={leading:false}){const[_value,setValue]=(0,consume_shared_module_default_react_strict_.useState)(value);const mountedRef=(0,consume_shared_module_default_react_strict_.useRef)(false);const timeoutRef=(0,consume_shared_module_default_react_strict_.useRef)(null);const cooldownRef=(0,consume_shared_module_default_react_strict_.useRef)(false);const cancel=()=>window.clearTimeout(timeoutRef.current);(0,consume_shared_module_default_react_strict_.useEffect)(()=>{if(mountedRef.current)if(!cooldownRef.current&&options.leading){cooldownRef.current=true;setValue(value)}else{cancel();timeoutRef.current=window.setTimeout(()=>{cooldownRef.current=false;setValue(value)},wait)}},[value,options.leading,wait]);(0,consume_shared_module_default_react_strict_.useEffect)(()=>{mountedRef.current=true;return cancel},[]);return[_value,cancel]}"use client";const useIsomorphicEffect="undefined"!=typeof document?consume_shared_module_default_react_strict_.useLayoutEffect:consume_shared_module_default_react_strict_.useEffect;"use client";function useDocumentTitle(title){useIsomorphicEffect(()=>{if("string"==typeof title&&title.trim().length>0)document.title=title.trim()},[title])}"use client";function useDocumentVisibility(){const[documentVisibility,setDocumentVisibility]=(0,consume_shared_module_default_react_strict_.useState)("visible");(0,consume_shared_module_default_react_strict_.useEffect)(()=>{const listener=()=>setDocumentVisibility(document.visibilityState);document.addEventListener("visibilitychange",listener);return()=>document.removeEventListener("visibilitychange",listener)},[]);return documentVisibility}"use client";function useDidUpdate(fn,dependencies){const mounted=(0,consume_shared_module_default_react_strict_.useRef)(false);(0,consume_shared_module_default_react_strict_.useEffect)(()=>()=>{mounted.current=false},[]);(0,consume_shared_module_default_react_strict_.useEffect)(()=>{if(mounted.current)return fn();mounted.current=true},dependencies)}"use client";function useFocusReturn({opened,shouldReturnFocus=true}){const lastActiveElement=(0,consume_shared_module_default_react_strict_.useRef)(null);const returnFocus=()=>{if(lastActiveElement.current&&"focus"in lastActiveElement.current&&"function"==typeof lastActiveElement.current.focus)lastActiveElement.current?.focus({preventScroll:true})};useDidUpdate(()=>{let timeout=-1;const clearFocusTimeout=event=>{if("Tab"===event.key)window.clearTimeout(timeout)};document.addEventListener("keydown",clearFocusTimeout);if(opened)lastActiveElement.current=document.activeElement;else if(shouldReturnFocus)timeout=window.setTimeout(returnFocus,10);return()=>{window.clearTimeout(timeout);document.removeEventListener("keydown",clearFocusTimeout)}},[opened,shouldReturnFocus]);return returnFocus}"use client";const TABBABLE_NODES=/input|select|textarea|button|object/;const FOCUS_SELECTOR="a, input, select, textarea, button, object, [tabindex]";function tabbable_hidden(element){return"none"===element.style.display}function visible(element){const isHidden=element.getAttribute("aria-hidden")||element.getAttribute("hidden")||"hidden"===element.getAttribute("type");if(isHidden)return false;let parentElement=element;while(parentElement){if(parentElement===document.body||11===parentElement.nodeType)break;if(tabbable_hidden(parentElement))return false;parentElement=parentElement.parentNode}return true}function getElementTabIndex(element){let tabIndex=element.getAttribute("tabindex");if(null===tabIndex)tabIndex=void 0;return parseInt(tabIndex,10)}function focusable(element){const nodeName=element.nodeName.toLowerCase();const isTabIndexNotNaN=!Number.isNaN(getElementTabIndex(element));const res=TABBABLE_NODES.test(nodeName)&&!element.disabled||(element instanceof HTMLAnchorElement?element.href||isTabIndexNotNaN:isTabIndexNotNaN);return res&&visible(element)}function tabbable_tabbable(element){const tabIndex=getElementTabIndex(element);const isTabIndexNaN=Number.isNaN(tabIndex);return(isTabIndexNaN||tabIndex>=0)&&focusable(element)}function findTabbableDescendants(element){return Array.from(element.querySelectorAll(FOCUS_SELECTOR)).filter(tabbable_tabbable)}"use client";function scopeTab(node,event){const tabbable=findTabbableDescendants(node);if(!tabbable.length)return void event.preventDefault();const finalTabbable=tabbable[event.shiftKey?0:tabbable.length-1];const root=node.getRootNode();let leavingFinalTabbable=finalTabbable===root.activeElement||node===root.activeElement;const activeElement=root.activeElement;const activeElementIsRadio="INPUT"===activeElement.tagName&&"radio"===activeElement.getAttribute("type");if(activeElementIsRadio){const activeRadioGroup=tabbable.filter(element=>"radio"===element.getAttribute("type")&&element.getAttribute("name")===activeElement.getAttribute("name"));leavingFinalTabbable=activeRadioGroup.includes(finalTabbable)}if(!leavingFinalTabbable)return;event.preventDefault();const target=tabbable[event.shiftKey?tabbable.length-1:0];if(target)target.focus()}"use client";function useFocusTrap(active=true){const ref=(0,consume_shared_module_default_react_strict_.useRef)(null);const focusNode=node=>{let focusElement=node.querySelector("[data-autofocus]");if(!focusElement){const children=Array.from(node.querySelectorAll(FOCUS_SELECTOR));focusElement=children.find(tabbable_tabbable)||children.find(focusable)||null;if(!focusElement&&focusable(node))focusElement=node}if(focusElement)focusElement.focus({preventScroll:true})};const setRef=(0,consume_shared_module_default_react_strict_.useCallback)(node=>{if(!active)return;if(null===node)return;if(ref.current===node)return;if(node){setTimeout(()=>{if(node.getRootNode())focusNode(node)});ref.current=node}else ref.current=null},[active]);(0,consume_shared_module_default_react_strict_.useEffect)(()=>{if(!active)return;ref.current&&setTimeout(()=>focusNode(ref.current));const handleKeyDown=event=>{if("Tab"===event.key&&ref.current)scopeTab(ref.current,event)};document.addEventListener("keydown",handleKeyDown);return()=>document.removeEventListener("keydown",handleKeyDown)},[active]);return setRef}"use client";const reducer=value=>(value+1)%1e6;function useForceUpdate(){const[,update]=(0,consume_shared_module_default_react_strict_.useReducer)(reducer,0);return update}"use client";const __useId=consume_shared_module_default_react_strict_["useId".toString()]||(()=>void 0);function useReactId(){const id=__useId();return id?`mantine-${id.replace(/:/g,"")}`:""}"use client";function useId(staticId){const reactId=useReactId();const[uuid,setUuid]=(0,consume_shared_module_default_react_strict_.useState)(reactId);useIsomorphicEffect(()=>{setUuid(randomId())},[]);if("string"==typeof staticId)return staticId;if("undefined"==typeof window)return reactId;return uuid}"use client";const use_idle_DEFAULT_OPTIONS={events:["keydown","mousemove","touchmove","click","scroll","wheel"],initialState:true};function useIdle(timeout,options){const{events,initialState}={...use_idle_DEFAULT_OPTIONS,...options};const[idle,setIdle]=(0,consume_shared_module_default_react_strict_.useState)(initialState);const timer=(0,consume_shared_module_default_react_strict_.useRef)(-1);(0,consume_shared_module_default_react_strict_.useEffect)(()=>{const handleEvents=()=>{setIdle(false);if(timer.current)window.clearTimeout(timer.current);timer.current=window.setTimeout(()=>{setIdle(true)},timeout)};events.forEach(event=>document.addEventListener(event,handleEvents));timer.current=window.setTimeout(()=>{setIdle(true)},timeout);return()=>{events.forEach(event=>document.removeEventListener(event,handleEvents));window.clearTimeout(timer.current);timer.current=-1}},[timeout]);return idle}"use client";function useInterval(fn,interval,{autoInvoke=false}={}){const[active,setActive]=(0,consume_shared_module_default_react_strict_.useState)(false);const intervalRef=(0,consume_shared_module_default_react_strict_.useRef)(null);const fnRef=(0,consume_shared_module_default_react_strict_.useRef)(null);const start=(0,consume_shared_module_default_react_strict_.useCallback)(()=>{setActive(old=>{if(!old&&(!intervalRef.current||-1===intervalRef.current))intervalRef.current=window.setInterval(fnRef.current,interval);return true})},[]);const stop=(0,consume_shared_module_default_react_strict_.useCallback)(()=>{setActive(false);window.clearInterval(intervalRef.current||-1);intervalRef.current=-1},[]);const toggle=(0,consume_shared_module_default_react_strict_.useCallback)(()=>{if(active)stop();else start()},[active]);(0,consume_shared_module_default_react_strict_.useEffect)(()=>{fnRef.current=fn;active&&start();return stop},[fn,active,interval]);(0,consume_shared_module_default_react_strict_.useEffect)(()=>{if(autoInvoke)start()},[]);return{start,stop,toggle,active}}"use client";function useListState(initialValue=[]){const[state,setState]=(0,consume_shared_module_default_react_strict_.useState)(initialValue);const append=(...items)=>setState(current=>[...current,...items]);const prepend=(...items)=>setState(current=>[...items,...current]);const insert=(index,...items)=>setState(current=>[...current.slice(0,index),...items,...current.slice(index)]);const apply=fn=>setState(current=>current.map((item,index)=>fn(item,index)));const remove=(...indices)=>setState(current=>current.filter((_,index)=>!indices.includes(index)));const pop=()=>setState(current=>{const cloned=[...current];cloned.pop();return cloned});const shift=()=>setState(current=>{const cloned=[...current];cloned.shift();return cloned});const reorder=({from,to})=>setState(current=>{const cloned=[...current];const item=current[from];cloned.splice(from,1);cloned.splice(to,0,item);return cloned});const swap=({from,to})=>setState(current=>{const cloned=[...current];const fromItem=cloned[from];const toItem=cloned[to];cloned.splice(to,1,fromItem);cloned.splice(from,1,toItem);return cloned});const setItem=(index,item)=>setState(current=>{const cloned=[...current];cloned[index]=item;return cloned});const setItemProp=(index,prop,value)=>setState(current=>{const cloned=[...current];cloned[index]={...cloned[index],[prop]:value};return cloned});const applyWhere=(condition,fn)=>setState(current=>current.map((item,index)=>condition(item,index)?fn(item,index):item));const filter=fn=>{setState(current=>current.filter(fn))};return[state,{setState,append,prepend,insert,pop,shift,apply,applyWhere,remove,reorder,swap,setItem,setItemProp,filter}]}"use client";function useWindowEvent(type,listener,options){(0,consume_shared_module_default_react_strict_.useEffect)(()=>{window.addEventListener(type,listener,options);return()=>window.removeEventListener(type,listener,options)},[type,listener])}"use client";function serializeJSON(value,hookName="use-local-storage"){try{return JSON.stringify(value)}catch(error){throw new Error(`@mantine/hooks ${hookName}: Failed to serialize the value`)}}function deserializeJSON(value){try{return value&&JSON.parse(value)}catch{return value}}function createStorageHandler(type){const getItem=key=>{try{return window[type].getItem(key)}catch(error){console.warn("use-local-storage: Failed to get value from storage, localStorage is blocked");return null}};const setItem=(key,value)=>{try{window[type].setItem(key,value)}catch(error){console.warn("use-local-storage: Failed to set value to storage, localStorage is blocked")}};const removeItem=key=>{try{window[type].removeItem(key)}catch(error){console.warn("use-local-storage: Failed to remove value from storage, localStorage is blocked")}};return{getItem,setItem,removeItem}}function createStorage(type,hookName){const eventName="localStorage"===type?"mantine-local-storage":"mantine-session-storage";const{getItem,setItem,removeItem}=createStorageHandler(type);return function({key,defaultValue,getInitialValueInEffect=true,sync=true,deserialize=deserializeJSON,serialize=value=>serializeJSON(value,hookName)}){const readStorageValue=(0,consume_shared_module_default_react_strict_.useCallback)(skipStorage=>{let storageBlockedOrSkipped;try{storageBlockedOrSkipped="undefined"==typeof window||!(type in window)||null===window[type]||!!skipStorage}catch(_e){storageBlockedOrSkipped=true}if(storageBlockedOrSkipped)return defaultValue;const storageValue=getItem(key);return null!==storageValue?deserialize(storageValue):defaultValue},[key,defaultValue]);const[value,setValue]=(0,consume_shared_module_default_react_strict_.useState)(readStorageValue(getInitialValueInEffect));const setStorageValue=(0,consume_shared_module_default_react_strict_.useCallback)(val=>{if(val instanceof Function)setValue(current=>{const result=val(current);setItem(key,serialize(result));queueMicrotask(()=>{window.dispatchEvent(new CustomEvent(eventName,{detail:{key,value:val(current)}}))});return result});else{setItem(key,serialize(val));window.dispatchEvent(new CustomEvent(eventName,{detail:{key,value:val}}));setValue(val)}},[key]);const removeStorageValue=(0,consume_shared_module_default_react_strict_.useCallback)(()=>{removeItem(key);window.dispatchEvent(new CustomEvent(eventName,{detail:{key,value:defaultValue}}))},[]);useWindowEvent("storage",event=>{if(sync){if(event.storageArea===window[type]&&event.key===key)setValue(deserialize(event.newValue??void 0))}});useWindowEvent(eventName,event=>{if(sync){if(event.detail.key===key)setValue(event.detail.value)}});(0,consume_shared_module_default_react_strict_.useEffect)(()=>{if(void 0!==defaultValue&&void 0===value)setStorageValue(defaultValue)},[defaultValue,value,setStorageValue]);(0,consume_shared_module_default_react_strict_.useEffect)(()=>{const val=readStorageValue();void 0!==val&&setStorageValue(val)},[key]);return[void 0===value?defaultValue:value,setStorageValue,removeStorageValue]}}function readValue(type){const{getItem}=createStorageHandler(type);return function({key,defaultValue,deserialize=deserializeJSON}){let storageBlockedOrSkipped;try{storageBlockedOrSkipped="undefined"==typeof window||!(type in window)||null===window[type]}catch(_e){storageBlockedOrSkipped=true}if(storageBlockedOrSkipped)return defaultValue;const storageValue=getItem(key);return null!==storageValue?deserialize(storageValue):defaultValue}}"use client";function useLocalStorage(props){return createStorage("localStorage","use-local-storage")(props)}const readLocalStorageValue=readValue("localStorage");"use client";function useSessionStorage(props){return createStorage("sessionStorage","use-session-storage")(props)}const readSessionStorageValue=readValue("sessionStorage");"use client";function assignRef(ref,value){if("function"==typeof ref)return ref(value);if("object"==typeof ref&&null!==ref&&"current"in ref)ref.current=value}function mergeRefs(...refs){const cleanupMap=/* @__PURE__ */new Map;return node=>{refs.forEach(ref=>{const cleanup=assignRef(ref,node);if(cleanup)cleanupMap.set(ref,cleanup)});if(cleanupMap.size>0)return()=>{refs.forEach(ref=>{const cleanup=cleanupMap.get(ref);if(cleanup&&"function"==typeof cleanup)cleanup();else assignRef(ref,null)});cleanupMap.clear()}}}function useMergedRef(...refs){return(0,consume_shared_module_default_react_strict_.useCallback)(mergeRefs(...refs),refs)}"use client";function useMouse(options={resetOnExit:false}){const[position,setPosition]=(0,consume_shared_module_default_react_strict_.useState)({x:0,y:0});const ref=(0,consume_shared_module_default_react_strict_.useRef)(null);const setMousePosition=event=>{if(ref.current){const rect=event.currentTarget.getBoundingClientRect();const x=Math.max(0,Math.round(event.pageX-rect.left-(window.scrollX||window.scrollX)));const y=Math.max(0,Math.round(event.pageY-rect.top-(window.scrollY||window.scrollY)));setPosition({x,y})}else setPosition({x:event.clientX,y:event.clientY})};const resetMousePosition=()=>setPosition({x:0,y:0});(0,consume_shared_module_default_react_strict_.useEffect)(()=>{const element=ref?.current?ref.current:document;element.addEventListener("mousemove",setMousePosition);if(options.resetOnExit)element.addEventListener("mouseleave",resetMousePosition);return()=>{element.removeEventListener("mousemove",setMousePosition);if(options.resetOnExit)element.removeEventListener("mouseleave",resetMousePosition)}},[ref.current]);return{ref,...position}}"use client";function clampUseMovePosition(position){return{x:clamp(position.x,0,1),y:clamp(position.y,0,1)}}function useMove(onChange,handlers,dir="ltr"){const mounted=(0,consume_shared_module_default_react_strict_.useRef)(false);const isSliding=(0,consume_shared_module_default_react_strict_.useRef)(false);const frame=(0,consume_shared_module_default_react_strict_.useRef)(0);const[active,setActive]=(0,consume_shared_module_default_react_strict_.useState)(false);const cleanupRef=(0,consume_shared_module_default_react_strict_.useRef)(null);(0,consume_shared_module_default_react_strict_.useEffect)(()=>{mounted.current=true},[]);const refCallback=(0,consume_shared_module_default_react_strict_.useCallback)(node=>{if(cleanupRef.current){cleanupRef.current();cleanupRef.current=null}if(!node)return;const onScrub=({x,y})=>{cancelAnimationFrame(frame.current);frame.current=requestAnimationFrame(()=>{if(mounted.current&&node){node.style.userSelect="none";const rect=node.getBoundingClientRect();if(rect.width&&rect.height){const _x=clamp((x-rect.left)/rect.width,0,1);onChange({x:"ltr"===dir?_x:1-_x,y:clamp((y-rect.top)/rect.height,0,1)})}}})};const bindEvents=()=>{document.addEventListener("mousemove",onMouseMove);document.addEventListener("mouseup",stopScrubbing);document.addEventListener("touchmove",onTouchMove,{passive:false});document.addEventListener("touchend",stopScrubbing)};const unbindEvents=()=>{document.removeEventListener("mousemove",onMouseMove);document.removeEventListener("mouseup",stopScrubbing);document.removeEventListener("touchmove",onTouchMove);document.removeEventListener("touchend",stopScrubbing)};const startScrubbing=()=>{if(!isSliding.current&&mounted.current){isSliding.current=true;"function"==typeof handlers?.onScrubStart&&handlers.onScrubStart();setActive(true);bindEvents()}};const stopScrubbing=()=>{if(isSliding.current&&mounted.current){isSliding.current=false;setActive(false);unbindEvents();setTimeout(()=>{"function"==typeof handlers?.onScrubEnd&&handlers.onScrubEnd()},0)}};const onMouseDown=event=>{startScrubbing();event.preventDefault();onMouseMove(event)};const onMouseMove=event=>onScrub({x:event.clientX,y:event.clientY});const onTouchStart=event=>{if(event.cancelable)event.preventDefault();startScrubbing();onTouchMove(event)};const onTouchMove=event=>{if(event.cancelable)event.preventDefault();onScrub({x:event.changedTouches[0].clientX,y:event.changedTouches[0].clientY})};node.addEventListener("mousedown",onMouseDown);node.addEventListener("touchstart",onTouchStart,{passive:false});cleanupRef.current=()=>{node.removeEventListener("mousedown",onMouseDown);node.removeEventListener("touchstart",onTouchStart)}},[dir,onChange]);return{ref:refCallback,active}}"use client";function useUncontrolled({value,defaultValue,finalValue,onChange=()=>{}}){const[uncontrolledValue,setUncontrolledValue]=(0,consume_shared_module_default_react_strict_.useState)(void 0!==defaultValue?defaultValue:finalValue);const handleUncontrolledChange=(val,...payload)=>{setUncontrolledValue(val);onChange?.(val,...payload)};if(void 0!==value)return[value,onChange,true];return[uncontrolledValue,handleUncontrolledChange,false]}"use client";function use_pagination_range(start,end){const length=end-start+1;return Array.from({length},(_,index)=>index+start)}const DOTS="dots";function usePagination({total,siblings=1,boundaries=1,page,initialPage=1,onChange}){const _total=Math.max(Math.trunc(total),0);const[activePage,setActivePage]=useUncontrolled({value:page,onChange,defaultValue:initialPage,finalValue:initialPage});const setPage=pageNumber=>{if(pageNumber<=0)setActivePage(1);else pageNumber>_total?setActivePage(_total):setActivePage(pageNumber)};const next=()=>setPage(activePage+1);const previous=()=>setPage(activePage-1);const first=()=>setPage(1);const last=()=>setPage(_total);const paginationRange=(0,consume_shared_module_default_react_strict_.useMemo)(()=>{const totalPageNumbers=2*siblings+3+2*boundaries;if(totalPageNumbers>=_total)return use_pagination_range(1,_total);const leftSiblingIndex=Math.max(activePage-siblings,boundaries);const rightSiblingIndex=Math.min(activePage+siblings,_total-boundaries);const shouldShowLeftDots=leftSiblingIndex>boundaries+2;const shouldShowRightDots=rightSiblingIndex<_total-(boundaries+1);if(!shouldShowLeftDots&&shouldShowRightDots){const leftItemCount=2*siblings+boundaries+2;return[...use_pagination_range(1,leftItemCount),DOTS,...use_pagination_range(_total-(boundaries-1),_total)]}if(shouldShowLeftDots&&!shouldShowRightDots){const rightItemCount=boundaries+1+2*siblings;return[...use_pagination_range(1,boundaries),DOTS,...use_pagination_range(_total-rightItemCount,_total)]}return[...use_pagination_range(1,boundaries),DOTS,...use_pagination_range(leftSiblingIndex,rightSiblingIndex),DOTS,...use_pagination_range(_total-boundaries+1,_total)]},[_total,siblings,activePage]);return{range:paginationRange,active:activePage,setPage,next,previous,first,last}}"use client";function useQueue({initialValues=[],limit}){const[state,setState]=(0,consume_shared_module_default_react_strict_.useState)({state:initialValues.slice(0,limit),queue:initialValues.slice(limit)});const add=(...items)=>setState(current=>{const results=[...current.state,...current.queue,...items];return{state:results.slice(0,limit),queue:results.slice(limit)}});const update=fn=>setState(current=>{const results=fn([...current.state,...current.queue]);return{state:results.slice(0,limit),queue:results.slice(limit)}});const cleanQueue=()=>setState(current=>({state:current.state,queue:[]}));return{state:state.state,queue:state.queue,add,update,cleanQueue}}"use client";function usePageLeave(onPageLeave){(0,consume_shared_module_default_react_strict_.useEffect)(()=>{document.documentElement.addEventListener("mouseleave",onPageLeave);return()=>document.documentElement.removeEventListener("mouseleave",onPageLeave)},[])}"use client";function useReducedMotion(initialValue,options){return useMediaQuery("(prefers-reduced-motion: reduce)",initialValue,options)}"use client";function useScrollIntoView({duration=1250,axis="y",onScrollFinish,easing=easeInOutQuad,offset=0,cancelable=true,isList=false}={}){const frameID=(0,consume_shared_module_default_react_strict_.useRef)(0);const startTime=(0,consume_shared_module_default_react_strict_.useRef)(0);const shouldStop=(0,consume_shared_module_default_react_strict_.useRef)(false);const scrollableRef=(0,consume_shared_module_default_react_strict_.useRef)(null);const targetRef=(0,consume_shared_module_default_react_strict_.useRef)(null);const reducedMotion=useReducedMotion();const cancel=()=>{if(frameID.current)cancelAnimationFrame(frameID.current)};const scrollIntoView=(0,consume_shared_module_default_react_strict_.useCallback)(({alignment="start"}={})=>{shouldStop.current=false;if(frameID.current)cancel();const start=getScrollStart({parent:scrollableRef.current,axis})??0;const change=getRelativePosition({parent:scrollableRef.current,target:targetRef.current,axis,alignment,offset,isList})-(scrollableRef.current?0:start);function animateScroll(){if(0===startTime.current)startTime.current=performance.now();const now=performance.now();const elapsed=now-startTime.current;const t=reducedMotion||0===duration?1:elapsed/duration;const distance=start+change*easing(t);setScrollParam({parent:scrollableRef.current,axis,distance});if(!shouldStop.current&&t<1)frameID.current=requestAnimationFrame(animateScroll);else{"function"==typeof onScrollFinish&&onScrollFinish();startTime.current=0;frameID.current=0;cancel()}}animateScroll()},[axis,duration,easing,isList,offset,onScrollFinish,reducedMotion]);const handleStop=()=>{if(cancelable)shouldStop.current=true};useWindowEvent("wheel",handleStop,{passive:true});useWindowEvent("touchmove",handleStop,{passive:true});(0,consume_shared_module_default_react_strict_.useEffect)(()=>cancel,[]);return{scrollableRef,targetRef,scrollIntoView,cancel}}function easeInOutQuad(t){return t<.5?2*t*t:-1+(4-2*t)*t}function getRelativePosition({axis,target,parent,alignment,offset,isList}){if(!target||!parent&&"undefined"==typeof document)return 0;const isCustomParent=!!parent;const parentElement=parent||document.body;const parentPosition=parentElement.getBoundingClientRect();const targetPosition=target.getBoundingClientRect();const getDiff=property=>targetPosition[property]-parentPosition[property];if("y"===axis){const diff=getDiff("top");if(0===diff)return 0;if("start"===alignment){const distance=diff-offset;const shouldScroll=distance<=targetPosition.height*(isList?0:1)||!isList;return shouldScroll?distance:0}const parentHeight=isCustomParent?parentPosition.height:window.innerHeight;if("end"===alignment){const distance=diff+offset-parentHeight+targetPosition.height;const shouldScroll=distance>=-targetPosition.height*(isList?0:1)||!isList;return shouldScroll?distance:0}if("center"===alignment)return diff-parentHeight/2+targetPosition.height/2;return 0}if("x"===axis){const diff=getDiff("left");if(0===diff)return 0;if("start"===alignment){const distance=diff-offset;const shouldScroll=distance<=targetPosition.width||!isList;return shouldScroll?distance:0}const parentWidth=isCustomParent?parentPosition.width:window.innerWidth;if("end"===alignment){const distance=diff+offset-parentWidth+targetPosition.width;const shouldScroll=distance>=-targetPosition.width||!isList;return shouldScroll?distance:0}if("center"===alignment)return diff-parentWidth/2+targetPosition.width/2}return 0}function getScrollStart({axis,parent}){if(!parent&&"undefined"==typeof document)return 0;const method="y"===axis?"scrollTop":"scrollLeft";if(parent)return parent[method];const{body,documentElement}=document;return body[method]+documentElement[method]}function setScrollParam({axis,parent,distance}){if(!parent&&"undefined"==typeof document)return;const method="y"===axis?"scrollTop":"scrollLeft";if(parent)parent[method]=distance;else{const{body,documentElement}=document;body[method]=distance;documentElement[method]=distance}}"use client";const defaultState={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};function useResizeObserver(options){const frameID=(0,consume_shared_module_default_react_strict_.useRef)(0);const ref=(0,consume_shared_module_default_react_strict_.useRef)(null);const[rect,setRect]=(0,consume_shared_module_default_react_strict_.useState)(defaultState);const observer=(0,consume_shared_module_default_react_strict_.useMemo)(()=>"undefined"!=typeof window?new ResizeObserver(entries=>{const entry=entries[0];if(entry){cancelAnimationFrame(frameID.current);frameID.current=requestAnimationFrame(()=>{if(ref.current){const boxSize=entry.borderBoxSize?.[0]||entry.contentBoxSize?.[0];if(boxSize){const width=boxSize.inlineSize;const height=boxSize.blockSize;setRect({width,height,x:entry.contentRect.x,y:entry.contentRect.y,top:entry.contentRect.top,left:entry.contentRect.left,bottom:entry.contentRect.bottom,right:entry.contentRect.right})}else setRect(entry.contentRect)}})}}):null,[]);(0,consume_shared_module_default_react_strict_.useEffect)(()=>{if(ref.current)observer?.observe(ref.current,options);return()=>{observer?.disconnect();if(frameID.current)cancelAnimationFrame(frameID.current)}},[ref.current]);return[ref,rect]}function useElementSize(options){const[ref,{width,height}]=useResizeObserver(options);return{ref,width,height}}"use client";function shallowCompare(prevValue,currValue){if(!prevValue||!currValue)return false;if(prevValue===currValue)return true;if(prevValue.length!==currValue.length)return false;for(let i=0;i<prevValue.length;i+=1)if(!shallowEqual(prevValue[i],currValue[i]))return false;return true}function useShallowCompare(dependencies){const ref=(0,consume_shared_module_default_react_strict_.useRef)([]);const updateRef=(0,consume_shared_module_default_react_strict_.useRef)(0);if(!shallowCompare(ref.current,dependencies)){ref.current=dependencies;updateRef.current+=1}return[updateRef.current]}function useShallowEffect(cb,dependencies){(0,consume_shared_module_default_react_strict_.useEffect)(cb,useShallowCompare(dependencies))}"use client";function useToggle(options=[false,true]){const[[option],toggle]=(0,consume_shared_module_default_react_strict_.useReducer)((state,action)=>{const value=action instanceof Function?action(state[0]):action;const index=Math.abs(state.indexOf(value));return state.slice(index).concat(state.slice(0,index))},options);return[option,toggle]}"use client";const eventListerOptions={passive:true};function useViewportSize(){const[windowSize,setWindowSize]=(0,consume_shared_module_default_react_strict_.useState)({width:0,height:0});const setSize=(0,consume_shared_module_default_react_strict_.useCallback)(()=>{setWindowSize({width:window.innerWidth||0,height:window.innerHeight||0})},[]);useWindowEvent("resize",setSize,eventListerOptions);useWindowEvent("orientationchange",setSize,eventListerOptions);(0,consume_shared_module_default_react_strict_.useEffect)(setSize,[]);return windowSize}"use client";function getScrollPosition(){return"undefined"!=typeof window?{x:window.scrollX,y:window.scrollY}:{x:0,y:0}}function scrollTo({x,y}){if("undefined"!=typeof window){const scrollOptions={behavior:"smooth"};if("number"==typeof x)scrollOptions.left=x;if("number"==typeof y)scrollOptions.top=y;window.scrollTo(scrollOptions)}}function useWindowScroll(){const[position,setPosition]=(0,consume_shared_module_default_react_strict_.useState)({x:0,y:0});useWindowEvent("scroll",()=>setPosition(getScrollPosition()));useWindowEvent("resize",()=>setPosition(getScrollPosition()));(0,consume_shared_module_default_react_strict_.useEffect)(()=>{setPosition(getScrollPosition())},[]);return[position,scrollTo]}"use client";function useIntersection(options){const[entry,setEntry]=(0,consume_shared_module_default_react_strict_.useState)(null);const observer=(0,consume_shared_module_default_react_strict_.useRef)(null);const ref=(0,consume_shared_module_default_react_strict_.useCallback)(element=>{if(observer.current){observer.current.disconnect();observer.current=null}if(null===element)return void setEntry(null);observer.current=new IntersectionObserver(([_entry])=>{setEntry(_entry)},options);observer.current.observe(element)},[options?.rootMargin,options?.root,options?.threshold]);return{ref,entry}}"use client";function useHash({getInitialValueInEffect=true}={}){const[hash,setHash]=(0,consume_shared_module_default_react_strict_.useState)(getInitialValueInEffect?"":window.location.hash||"");const setHashHandler=value=>{const valueWithHash=value.startsWith("#")?value:`#${value}`;window.location.hash=valueWithHash;setHash(valueWithHash)};useWindowEvent("hashchange",()=>{const newHash=window.location.hash;if(hash!==newHash)setHash(newHash)});(0,consume_shared_module_default_react_strict_.useEffect)(()=>{if(getInitialValueInEffect)setHash(window.location.hash)},[]);return[hash,setHashHandler]}"use client";const keyNameMap={" ":"space",ArrowLeft:"arrowleft",ArrowRight:"arrowright",ArrowUp:"arrowup",ArrowDown:"arrowdown",Escape:"escape",Esc:"escape",esc:"escape",Enter:"enter",Tab:"tab",Backspace:"backspace",Delete:"delete",Insert:"insert",Home:"home",End:"end",PageUp:"pageup",PageDown:"pagedown","+":"plus","-":"minus","*":"asterisk","/":"slash"};function normalizeKey(key){const lowerKey=key.replace("Key","").toLowerCase();return keyNameMap[key]||lowerKey}function parseHotkey(hotkey){const keys=hotkey.toLowerCase().split("+").map(part=>part.trim());const modifiers={alt:keys.includes("alt"),ctrl:keys.includes("ctrl"),meta:keys.includes("meta"),mod:keys.includes("mod"),shift:keys.includes("shift"),plus:keys.includes("[plus]")};const reservedKeys=["alt","ctrl","meta","shift","mod"];const freeKey=keys.find(key=>!reservedKeys.includes(key));return{...modifiers,key:"[plus]"===freeKey?"+":freeKey}}function isExactHotkey(hotkey,event,usePhysicalKeys){const{alt,ctrl,meta,mod,shift,key}=hotkey;const{altKey,ctrlKey,metaKey,shiftKey,key:pressedKey,code:pressedCode}=event;if(alt!==altKey)return false;if(mod){if(!ctrlKey&&!metaKey)return false}else{if(ctrl!==ctrlKey)return false;if(meta!==metaKey)return false}if(shift!==shiftKey)return false;if(key&&(usePhysicalKeys?normalizeKey(pressedCode)===normalizeKey(key):normalizeKey(pressedKey??pressedCode)===normalizeKey(key)))return true;return false}function getHotkeyMatcher(hotkey,usePhysicalKeys){return event=>isExactHotkey(parseHotkey(hotkey),event,usePhysicalKeys)}function getHotkeyHandler(hotkeys){return event=>{const _event="nativeEvent"in event?event.nativeEvent:event;hotkeys.forEach(([hotkey,handler,options={preventDefault:true,usePhysicalKeys:false}])=>{if(getHotkeyMatcher(hotkey,options.usePhysicalKeys)(_event)){if(options.preventDefault)event.preventDefault();handler(_event)}})}}"use client";function shouldFireEvent(event,tagsToIgnore,triggerOnContentEditable=false){if(event.target instanceof HTMLElement){if(triggerOnContentEditable)return!tagsToIgnore.includes(event.target.tagName);return!event.target.isContentEditable&&!tagsToIgnore.includes(event.target.tagName)}return true}function useHotkeys(hotkeys,tagsToIgnore=["INPUT","TEXTAREA","SELECT"],triggerOnContentEditable=false){(0,consume_shared_module_default_react_strict_.useEffect)(()=>{const keydownListener=event=>{hotkeys.forEach(([hotkey,handler,options={preventDefault:true,usePhysicalKeys:false}])=>{if(getHotkeyMatcher(hotkey,options.usePhysicalKeys)(event)&&shouldFireEvent(event,tagsToIgnore,triggerOnContentEditable)){if(options.preventDefault)event.preventDefault();handler(event)}})};document.documentElement.addEventListener("keydown",keydownListener);return()=>document.documentElement.removeEventListener("keydown",keydownListener)},[hotkeys])}"use client";function getFullscreenElement(){const _document=window.document;const fullscreenElement=_document.fullscreenElement||_document.webkitFullscreenElement||_document.mozFullScreenElement||_document.msFullscreenElement;return fullscreenElement}function exitFullscreen(){const _document=window.document;if("function"==typeof _document.exitFullscreen)return _document.exitFullscreen();if("function"==typeof _document.msExitFullscreen)return _document.msExitFullscreen();if("function"==typeof _document.webkitExitFullscreen)return _document.webkitExitFullscreen();if("function"==typeof _document.mozCancelFullScreen)return _document.mozCancelFullScreen();return null}function enterFullScreen(element){const _element=element;return _element.requestFullscreen?.()||_element.msRequestFullscreen?.()||_element.webkitEnterFullscreen?.()||_element.webkitRequestFullscreen?.()||_element.mozRequestFullscreen?.()}const prefixes=["","webkit","moz","ms"];function addEvents(element,{onFullScreen,onError}){prefixes.forEach(prefix=>{element.addEventListener(`${prefix}fullscreenchange`,onFullScreen);element.addEventListener(`${prefix}fullscreenerror`,onError)});return()=>{prefixes.forEach(prefix=>{element.removeEventListener(`${prefix}fullscreenchange`,onFullScreen);element.removeEventListener(`${prefix}fullscreenerror`,onError)})}}function useFullscreen(){const[fullscreen,setFullscreen]=(0,consume_shared_module_default_react_strict_.useState)(false);const _ref=(0,consume_shared_module_default_react_strict_.useRef)(null);const handleFullscreenChange=(0,consume_shared_module_default_react_strict_.useCallback)(event=>{setFullscreen(event.target===getFullscreenElement())},[setFullscreen]);const handleFullscreenError=(0,consume_shared_module_default_react_strict_.useCallback)(event=>{setFullscreen(false);console.error(`[@mantine/hooks] use-fullscreen: Error attempting full-screen mode method: ${event} (${event.target})`)},[setFullscreen]);const toggle=(0,consume_shared_module_default_react_strict_.useCallback)(async()=>{if(getFullscreenElement())await exitFullscreen();else await enterFullScreen(_ref.current)},[]);const ref=(0,consume_shared_module_default_react_strict_.useCallback)(element=>{if(null===element)_ref.current=window.document.documentElement;else _ref.current=element},[]);(0,consume_shared_module_default_react_strict_.useEffect)(()=>{if(!_ref.current&&window.document){_ref.current=window.document.documentElement;return addEvents(_ref.current,{onFullScreen:handleFullscreenChange,onError:handleFullscreenError})}if(_ref.current)return addEvents(_ref.current,{onFullScreen:handleFullscreenChange,onError:handleFullscreenError})},[_ref.current]);return{ref,toggle,fullscreen}}"use client";function useLogger(componentName,props){(0,consume_shared_module_default_react_strict_.useEffect)(()=>{console.log(`${componentName} mounted`,...props);return()=>console.log(`${componentName} unmounted`)},[]);useDidUpdate(()=>{console.log(`${componentName} updated`,...props)},props);return null}"use client";function useHover(){const[hovered,setHovered]=(0,consume_shared_module_default_react_strict_.useState)(false);const previousNode=(0,consume_shared_module_default_react_strict_.useRef)(null);const handleMouseEnter=(0,consume_shared_module_default_react_strict_.useCallback)(()=>{setHovered(true)},[]);const handleMouseLeave=(0,consume_shared_module_default_react_strict_.useCallback)(()=>{setHovered(false)},[]);const ref=(0,consume_shared_module_default_react_strict_.useCallback)(node=>{if(previousNode.current){previousNode.current.removeEventListener("mouseenter",handleMouseEnter);previousNode.current.removeEventListener("mouseleave",handleMouseLeave)}if(node){node.addEventListener("mouseenter",handleMouseEnter);node.addEventListener("mouseleave",handleMouseLeave)}previousNode.current=node},[handleMouseEnter,handleMouseLeave]);return{ref,hovered}}"use client";function useValidatedState(initialValue,validate,initialValidationState){const[value,setValue]=(0,consume_shared_module_default_react_strict_.useState)(initialValue);const[lastValidValue,setLastValidValue]=(0,consume_shared_module_default_react_strict_.useState)(validate(initialValue)?initialValue:void 0);const[valid,setValid]=(0,consume_shared_module_default_react_strict_.useState)("boolean"==typeof initialValidationState?initialValidationState:validate(initialValue));const onChange=val=>{if(validate(val)){setLastValidValue(val);setValid(true)}else setValid(false);setValue(val)};return[{value,lastValidValue,valid},onChange]}"use client";function isMacOS(userAgent){const macosPattern=/(Macintosh)|(MacIntel)|(MacPPC)|(Mac68K)/i;return macosPattern.test(userAgent)}function isIOS(userAgent){const iosPattern=/(iPhone)|(iPad)|(iPod)/i;return iosPattern.test(userAgent)}function isWindows(userAgent){const windowsPattern=/(Win32)|(Win64)|(Windows)|(WinCE)/i;return windowsPattern.test(userAgent)}function isAndroid(userAgent){const androidPattern=/Android/i;return androidPattern.test(userAgent)}function isLinux(userAgent){const linuxPattern=/Linux/i;return linuxPattern.test(userAgent)}function isChromeOS(userAgent){const chromePattern=/CrOS/i;return chromePattern.test(userAgent)}function getOS(){if("undefined"==typeof window)return"undetermined";const{userAgent}=window.navigator;if(isIOS(userAgent)||isMacOS(userAgent)&&"ontouchend"in document)return"ios";if(isMacOS(userAgent))return"macos";if(isWindows(userAgent))return"windows";if(isAndroid(userAgent))return"android";if(isLinux(userAgent))return"linux";if(isChromeOS(userAgent))return"chromeos";return"undetermined"}function useOs(options={getValueInEffect:true}){const[value,setValue]=(0,consume_shared_module_default_react_strict_.useState)(options.getValueInEffect?"undetermined":getOS());useIsomorphicEffect(()=>{if(options.getValueInEffect)setValue(getOS)},[]);return value}"use client";function useSetState(initialState){const[state,setState]=(0,consume_shared_module_default_react_strict_.useState)(initialState);const _setState=(0,consume_shared_module_default_react_strict_.useCallback)(statePartial=>setState(current=>({...current,..."function"==typeof statePartial?statePartial(current):statePartial})),[]);return[state,_setState]}"use client";function getInputOnChange(setValue){return val=>{if(val)if("function"==typeof val)setValue(val);else if("object"==typeof val&&"nativeEvent"in val){const{currentTarget}=val;"checkbox"===currentTarget.type?setValue(currentTarget.checked):setValue(currentTarget.value)}else setValue(val);else setValue(val)}}function useInputState(initialState){const[value,setValue]=(0,consume_shared_module_default_react_strict_.useState)(initialState);return[value,getInputOnChange(setValue)]}"use client";function useEventListener(type,listener,options){const previousListener=(0,consume_shared_module_default_react_strict_.useRef)(null);const previousNode=(0,consume_shared_module_default_react_strict_.useRef)(null);const callbackRef=(0,consume_shared_module_default_react_strict_.useCallback)(node=>{if(!node)return;if(previousNode.current&&previousListener.current)previousNode.current.removeEventListener(type,previousListener.current,options);node.addEventListener(type,listener,options);previousNode.current=node;previousListener.current=listener},[type,listener,options]);(0,consume_shared_module_default_react_strict_.useEffect)(()=>()=>{if(previousNode.current&&previousListener.current)previousNode.current.removeEventListener(type,previousListener.current,options)},[type,options]);return callbackRef}"use client";function useDisclosure(initialState=false,options={}){const[opened,setOpened]=(0,consume_shared_module_default_react_strict_.useState)(initialState);const open=(0,consume_shared_module_default_react_strict_.useCallback)(()=>{setOpened(isOpened=>{if(!isOpened){options.onOpen?.();return true}return isOpened})},[options.onOpen]);const close=(0,consume_shared_module_default_react_strict_.useCallback)(()=>{setOpened(isOpened=>{if(isOpened){options.onClose?.();return false}return isOpened})},[options.onClose]);const toggle=(0,consume_shared_module_default_react_strict_.useCallback)(()=>{opened?close():open()},[close,open,opened]);return[opened,{open,close,toggle}]}"use client";function containsRelatedTarget(event){if(event.currentTarget instanceof HTMLElement&&event.relatedTarget instanceof HTMLElement)return event.currentTarget.contains(event.relatedTarget);return false}function useFocusWithin({onBlur,onFocus}={}){const[focused,setFocused]=(0,consume_shared_module_default_react_strict_.useState)(false);const focusedRef=(0,consume_shared_module_default_react_strict_.useRef)(false);const previousNode=(0,consume_shared_module_default_react_strict_.useRef)(null);const _setFocused=(0,consume_shared_module_default_react_strict_.useCallback)(value=>{setFocused(value);focusedRef.current=value},[]);const handleFocusIn=(0,consume_shared_module_default_react_strict_.useCallback)(event=>{if(!focusedRef.current){_setFocused(true);onFocus?.(event)}},[onFocus]);const handleFocusOut=(0,consume_shared_module_default_react_strict_.useCallback)(event=>{if(focusedRef.current&&!containsRelatedTarget(event)){_setFocused(false);onBlur?.(event)}},[onBlur]);const callbackRef=(0,consume_shared_module_default_react_strict_.useCallback)(node=>{if(!node)return;if(previousNode.current){previousNode.current.removeEventListener("focusin",handleFocusIn);previousNode.current.removeEventListener("focusout",handleFocusOut)}node.addEventListener("focusin",handleFocusIn);node.addEventListener("focusout",handleFocusOut)},[handleFocusIn,handleFocusOut]);(0,consume_shared_module_default_react_strict_.useEffect)(()=>()=>{if(previousNode.current){previousNode.current.removeEventListener("focusin",handleFocusIn);previousNode.current.removeEventListener("focusout",handleFocusOut)}},[]);return{ref:callbackRef,focused}}"use client";function getConnection(){if("undefined"==typeof navigator)return{};const _navigator=navigator;const connection=_navigator.connection||_navigator.mozConnection||_navigator.webkitConnection;if(!connection)return{};return{downlink:connection?.downlink,downlinkMax:connection?.downlinkMax,effectiveType:connection?.effectiveType,rtt:connection?.rtt,saveData:connection?.saveData,type:connection?.type}}function useNetwork(){const[status,setStatus]=(0,consume_shared_module_default_react_strict_.useState)({online:true});const handleConnectionChange=(0,consume_shared_module_default_react_strict_.useCallback)(()=>setStatus(current=>({...current,...getConnection()})),[]);useWindowEvent("online",()=>setStatus({online:true,...getConnection()}));useWindowEvent("offline",()=>setStatus({online:false,...getConnection()}));(0,consume_shared_module_default_react_strict_.useEffect)(()=>{const _navigator=navigator;if(_navigator.connection){setStatus({online:_navigator.onLine,...getConnection()});_navigator.connection.addEventListener("change",handleConnectionChange);return()=>_navigator.connection.removeEventListener("change",handleConnectionChange)}if("boolean"==typeof _navigator.onLine)setStatus(current=>({...current,online:_navigator.onLine}))},[]);return status}"use client";function useTimeout(callback,delay,options={autoInvoke:false}){const timeoutRef=(0,consume_shared_module_default_react_strict_.useRef)(null);const start=(0,consume_shared_module_default_react_strict_.useCallback)((...args)=>{if(!timeoutRef.current)timeoutRef.current=window.setTimeout(()=>{callback(args);timeoutRef.current=null},delay)},[delay]);const clear=(0,consume_shared_module_default_react_strict_.useCallback)(()=>{if(timeoutRef.current){window.clearTimeout(timeoutRef.current);timeoutRef.current=null}},[]);(0,consume_shared_module_default_react_strict_.useEffect)(()=>{if(options.autoInvoke)start();return clear},[clear,start]);return{start,clear}}"use client";function useTextSelection(){const forceUpdate=useForceUpdate();const[selection,setSelection]=(0,consume_shared_module_default_react_strict_.useState)(null);const handleSelectionChange=()=>{setSelection(document.getSelection());forceUpdate()};(0,consume_shared_module_default_react_strict_.useEffect)(()=>{setSelection(document.getSelection());document.addEventListener("selectionchange",handleSelectionChange);return()=>document.removeEventListener("selectionchange",handleSelectionChange)},[]);return selection}"use client";function usePrevious(value){const ref=(0,consume_shared_module_default_react_strict_.useRef)(void 0);(0,consume_shared_module_default_react_strict_.useEffect)(()=>{ref.current=value},[value]);return ref.current}"use client";const MIME_TYPES={ico:"image/x-icon",png:"image/png",svg:"image/svg+xml",gif:"image/gif"};function useFavicon(url){const link=(0,consume_shared_module_default_react_strict_.useRef)(null);useIsomorphicEffect(()=>{if(!url)return;if(!link.current){const existingElements=document.querySelectorAll('link[rel*="icon"]');existingElements.forEach(element2=>document.head.removeChild(element2));const element=document.createElement("link");element.rel="shortcut icon";link.current=element;document.querySelector("head").appendChild(element)}const splittedUrl=url.split(".");link.current.setAttribute("type",MIME_TYPES[splittedUrl[splittedUrl.length-1].toLowerCase()]);link.current.setAttribute("href",url)},[url])}"use client";const isFixed=(current,fixedAt)=>current<=fixedAt;const isPinnedOrReleased=(current,fixedAt,isCurrentlyPinnedRef,isScrollingUp,onPin,onRelease)=>{const isInFixedPosition=isFixed(current,fixedAt);if(isInFixedPosition&&!isCurrentlyPinnedRef.current){isCurrentlyPinnedRef.current=true;onPin?.()}else if(isInFixedPosition||!isScrollingUp||isCurrentlyPinnedRef.current){if(!isInFixedPosition&&isCurrentlyPinnedRef.current){isCurrentlyPinnedRef.current=false;onRelease?.()}}else{isCurrentlyPinnedRef.current=true;onPin?.()}};const useScrollDirection=()=>{const[lastScrollTop,setLastScrollTop]=(0,consume_shared_module_default_react_strict_.useState)(0);const[isScrollingUp,setIsScrollingUp]=(0,consume_shared_module_default_react_strict_.useState)(false);const[isResizing,setIsResizing]=(0,consume_shared_module_default_react_strict_.useState)(false);(0,consume_shared_module_default_react_strict_.useEffect)(()=>{let resizeTimer;const onResize=()=>{setIsResizing(true);clearTimeout(resizeTimer);resizeTimer=setTimeout(()=>{setIsResizing(false)},300)};const onScroll=()=>{if(isResizing)return;const currentScrollTop=window.scrollY||document.documentElement.scrollTop;setIsScrollingUp(currentScrollTop<lastScrollTop);setLastScrollTop(currentScrollTop)};window.addEventListener("scroll",onScroll);window.addEventListener("resize",onResize);return()=>{window.removeEventListener("scroll",onScroll);window.removeEventListener("resize",onResize)}},[lastScrollTop,isResizing]);return isScrollingUp};function useHeadroom({fixedAt=0,onPin,onFix,onRelease}={}){const isCurrentlyPinnedRef=(0,consume_shared_module_default_react_strict_.useRef)(false);const isScrollingUp=useScrollDirection();const[{y:scrollPosition}]=useWindowScroll();useIsomorphicEffect(()=>{isPinnedOrReleased(scrollPosition,fixedAt,isCurrentlyPinnedRef,isScrollingUp,onPin,onRelease)},[scrollPosition]);useIsomorphicEffect(()=>{if(isFixed(scrollPosition,fixedAt))onFix?.()},[scrollPosition,fixedAt,onFix]);if(isFixed(scrollPosition,fixedAt)||isScrollingUp)return true;return false}"use client";function useEyeDropper(){const[supported,setSupported]=(0,consume_shared_module_default_react_strict_.useState)(false);useIsomorphicEffect(()=>{setSupported("undefined"!=typeof window&&!isOpera()&&"EyeDropper"in window)},[]);const open=(0,consume_shared_module_default_react_strict_.useCallback)((options={})=>{if(supported){const eyeDropper=new window.EyeDropper;return eyeDropper.open(options)}return Promise.resolve(void 0)},[supported]);return{supported,open}}function isOpera(){return navigator.userAgent.includes("OPR")}"use client";function useInViewport(){const observer=(0,consume_shared_module_default_react_strict_.useRef)(null);const[inViewport,setInViewport]=(0,consume_shared_module_default_react_strict_.useState)(false);const ref=(0,consume_shared_module_default_react_strict_.useCallback)(node=>{if("undefined"!=typeof IntersectionObserver){if(node&&!observer.current)observer.current=new IntersectionObserver(entries=>setInViewport(entries.some(entry=>entry.isIntersecting)));else observer.current?.disconnect();if(node)observer.current?.observe(node);else setInViewport(false)}},[]);return{ref,inViewport}}"use client";function useMutationObserver(callback,options,target){const observer=(0,consume_shared_module_default_react_strict_.useRef)(null);const ref=(0,consume_shared_module_default_react_strict_.useRef)(null);(0,consume_shared_module_default_react_strict_.useEffect)(()=>{const targetElement="function"==typeof target?target():target;if(targetElement||ref.current){observer.current=new MutationObserver(callback);observer.current.observe(targetElement||ref.current,options)}return()=>{observer.current?.disconnect()}},[callback,options]);return ref}"use client";function useMounted(){const[mounted,setMounted]=(0,consume_shared_module_default_react_strict_.useState)(false);(0,consume_shared_module_default_react_strict_.useEffect)(()=>setMounted(true),[]);return mounted}"use client";function useStateHistory(initialValue){const[state,setState]=(0,consume_shared_module_default_react_strict_.useState)({history:[initialValue],current:0});const set=(0,consume_shared_module_default_react_strict_.useCallback)(val=>setState(currentState=>{const nextState=[...currentState.history.slice(0,currentState.current+1),val];return{history:nextState,current:nextState.length-1}}),[]);const back=(0,consume_shared_module_default_react_strict_.useCallback)((steps=1)=>setState(currentState=>({history:currentState.history,current:Math.max(0,currentState.current-steps)})),[]);const forward=(0,consume_shared_module_default_react_strict_.useCallback)((steps=1)=>setState(currentState=>({history:currentState.history,current:Math.min(currentState.history.length-1,currentState.current+steps)})),[]);const reset=(0,consume_shared_module_default_react_strict_.useCallback)(()=>{setState({history:[initialValue],current:0})},[initialValue]);const handlers=(0,consume_shared_module_default_react_strict_.useMemo)(()=>({back,forward,reset,set}),[back,forward,reset,set]);return[state.history[state.current],handlers,state]}"use client";function useMap(initialState){const mapRef=(0,consume_shared_module_default_react_strict_.useRef)(new Map(initialState));const forceUpdate=useForceUpdate();mapRef.current.set=(...args)=>{Map.prototype.set.apply(mapRef.current,args);forceUpdate();return mapRef.current};mapRef.current.clear=(...args)=>{Map.prototype.clear.apply(mapRef.current,args);forceUpdate()};mapRef.current.delete=(...args)=>{const res=Map.prototype.delete.apply(mapRef.current,args);forceUpdate();return res};return mapRef.current}"use client";function readonlySetLikeToSet(input){if(input instanceof Set)return input;const result=/* @__PURE__ */new Set;for(const item of input)result.add(item);return result}function useSet(values){const setRef=(0,consume_shared_module_default_react_strict_.useRef)(new Set(values));const forceUpdate=useForceUpdate();setRef.current.add=(...args)=>{const res=Set.prototype.add.apply(setRef.current,args);forceUpdate();return res};setRef.current.clear=(...args)=>{Set.prototype.clear.apply(setRef.current,args);forceUpdate()};setRef.current.delete=(...args)=>{const res=Set.prototype.delete.apply(setRef.current,args);forceUpdate();return res};setRef.current.union=other=>{const result=new Set(setRef.current);readonlySetLikeToSet(other).forEach(item=>result.add(item));return result};setRef.current.intersection=other=>{const result=/* @__PURE__ */new Set;const otherSet=readonlySetLikeToSet(other);setRef.current.forEach(item=>{if(otherSet.has(item))result.add(item)});return result};setRef.current.difference=other=>{const result=/* @__PURE__ */new Set;const otherSet=readonlySetLikeToSet(other);setRef.current.forEach(item=>{if(!otherSet.has(item))result.add(item)});return result};setRef.current.symmetricDifference=other=>{const result=/* @__PURE__ */new Set;const otherSet=readonlySetLikeToSet(other);setRef.current.forEach(item=>{if(!otherSet.has(item))result.add(item)});otherSet.forEach(item=>{if(!setRef.current.has(item))result.add(item)});return result};return setRef.current}"use client";function useThrottledCallbackWithClearTimeout(callback,wait){const handleCallback=useCallbackRef(callback);const latestInArgsRef=(0,consume_shared_module_default_react_strict_.useRef)(null);const latestOutArgsRef=(0,consume_shared_module_default_react_strict_.useRef)(null);const active=(0,consume_shared_module_default_react_strict_.useRef)(true);const waitRef=(0,consume_shared_module_default_react_strict_.useRef)(wait);const timeoutRef=(0,consume_shared_module_default_react_strict_.useRef)(-1);const clearTimeout1=()=>window.clearTimeout(timeoutRef.current);const callThrottledCallback=(0,consume_shared_module_default_react_strict_.useCallback)((...args)=>{handleCallback(...args);latestInArgsRef.current=args;latestOutArgsRef.current=args;active.current=false},[handleCallback]);const timerCallback=(0,consume_shared_module_default_react_strict_.useCallback)(()=>{if(latestInArgsRef.current&&latestInArgsRef.current!==latestOutArgsRef.current){callThrottledCallback(...latestInArgsRef.current);timeoutRef.current=window.setTimeout(timerCallback,waitRef.current)}else active.current=true},[callThrottledCallback]);const throttled=(0,consume_shared_module_default_react_strict_.useCallback)((...args)=>{if(active.current){callThrottledCallback(...args);timeoutRef.current=window.setTimeout(timerCallback,waitRef.current)}else latestInArgsRef.current=args},[callThrottledCallback,timerCallback]);(0,consume_shared_module_default_react_strict_.useEffect)(()=>{waitRef.current=wait},[wait]);return[throttled,clearTimeout1]}function useThrottledCallback(callback,wait){return useThrottledCallbackWithClearTimeout(callback,wait)[0]}"use client";function useThrottledState(defaultValue,wait){const[value,setValue]=(0,consume_shared_module_default_react_strict_.useState)(defaultValue);const[setThrottledValue,clearTimeout1]=useThrottledCallbackWithClearTimeout(setValue,wait);(0,consume_shared_module_default_react_strict_.useEffect)(()=>clearTimeout1,[]);return[value,setThrottledValue]}"use client";function useThrottledValue(value,wait){const[throttledValue,setThrottledValue]=(0,consume_shared_module_default_react_strict_.useState)(value);const valueRef=(0,consume_shared_module_default_react_strict_.useRef)(value);const[throttledSetValue,clearTimeout1]=useThrottledCallbackWithClearTimeout(setThrottledValue,wait);(0,consume_shared_module_default_react_strict_.useEffect)(()=>{if(value!==valueRef.current){valueRef.current=value;throttledSetValue(value)}},[throttledSetValue,value]);(0,consume_shared_module_default_react_strict_.useEffect)(()=>clearTimeout1,[]);return throttledValue}"use client";function useIsFirstRender(){const renderRef=(0,consume_shared_module_default_react_strict_.useRef)(true);if(true===renderRef.current){renderRef.current=false;return true}return renderRef.current}"use client";function use_orientation_getInitialValue(initialValue,getInitialValueInEffect){if(getInitialValueInEffect)return initialValue;if("undefined"!=typeof window&&"screen"in window)return{angle:window.screen.orientation?.angle??initialValue.angle,type:window.screen.orientation?.type??initialValue.type};return initialValue}function useOrientation({defaultAngle=0,defaultType="landscape-primary",getInitialValueInEffect=true}={}){const[orientation,setOrientation]=(0,consume_shared_module_default_react_strict_.useState)(use_orientation_getInitialValue({angle:defaultAngle,type:defaultType},getInitialValueInEffect));const handleOrientationChange=event=>{const target=event.currentTarget;setOrientation({angle:target?.angle||0,type:target?.type||"landscape-primary"})};useIsomorphicEffect(()=>{window.screen.orientation?.addEventListener("change",handleOrientationChange);return()=>window.screen.orientation?.removeEventListener("change",handleOrientationChange)},[]);return orientation}"use client";function useFetch(url,{autoInvoke=true,...options}={}){const[data,setData]=(0,consume_shared_module_default_react_strict_.useState)(null);const[loading,setLoading]=(0,consume_shared_module_default_react_strict_.useState)(false);const[error,setError]=(0,consume_shared_module_default_react_strict_.useState)(null);const controller=(0,consume_shared_module_default_react_strict_.useRef)(null);const refetch=(0,consume_shared_module_default_react_strict_.useCallback)(()=>{if(controller.current)controller.current.abort();controller.current=new AbortController;setLoading(true);return fetch(url,{signal:controller.current.signal,...options}).then(res=>res.json()).then(res=>{setData(res);setLoading(false);return res}).catch(err=>{setLoading(false);if("AbortError"!==err.name)setError(err);return err})},[url]);const abort=(0,consume_shared_module_default_react_strict_.useCallback)(()=>{if(controller.current)controller.current?.abort("")},[]);(0,consume_shared_module_default_react_strict_.useEffect)(()=>{if(autoInvoke)refetch();return()=>{if(controller.current)controller.current.abort("")}},[refetch,autoInvoke]);return{data,loading,error,refetch,abort}}"use client";function radiansToDegrees(radians){return 180/Math.PI*radians}function getElementCenter(element){const rect=element.getBoundingClientRect();return[rect.left+rect.width/2,rect.top+rect.height/2]}function getAngle(coordinates,element){const center=getElementCenter(element);const x=coordinates[0]-center[0];const y=coordinates[1]-center[1];const deg=radiansToDegrees(Math.atan2(x,y))+180;return 360-deg}function toFixed(value,digits){return parseFloat(value.toFixed(digits))}function getDigitsAfterDot(value){return value.toString().split(".")[1]?.length||0}function normalizeRadialValue(degree,step){const clamped=clamp(degree,0,360);const high=Math.ceil(clamped/step);const low=Math.round(clamped/step);return toFixed(high>=clamped/step?high*step===360?0:high*step:low*step,getDigitsAfterDot(step))}function useRadialMove(onChange,{step=.01,onChangeEnd,onScrubStart,onScrubEnd}={}){const mounted=(0,consume_shared_module_default_react_strict_.useRef)(false);const[active,setActive]=(0,consume_shared_module_default_react_strict_.useState)(false);(0,consume_shared_module_default_react_strict_.useEffect)(()=>{mounted.current=true},[]);const refCallback=(0,consume_shared_module_default_react_strict_.useCallback)(node=>{const update=(event,done=false)=>{if(node){node.style.userSelect="none";const deg=getAngle([event.clientX,event.clientY],node);const newValue=normalizeRadialValue(deg,step||1);onChange(newValue);done&&onChangeEnd?.(newValue)}};const beginTracking=()=>{onScrubStart?.();setActive(true);document.addEventListener("mousemove",handleMouseMove,false);document.addEventListener("mouseup",handleMouseUp,false);document.addEventListener("touchmove",handleTouchMove,{passive:false});document.addEventListener("touchend",handleTouchEnd,false)};const endTracking=()=>{onScrubEnd?.();setActive(false);document.removeEventListener("mousemove",handleMouseMove,false);document.removeEventListener("mouseup",handleMouseUp,false);document.removeEventListener("touchmove",handleTouchMove,false);document.removeEventListener("touchend",handleTouchEnd,false)};const onMouseDown=event=>{beginTracking();update(event)};const handleMouseMove=event=>{update(event)};const handleMouseUp=event=>{update(event,true);endTracking()};const handleTouchMove=event=>{event.preventDefault();update(event.touches[0])};const handleTouchEnd=event=>{update(event.changedTouches[0],true);endTracking()};const handleTouchStart=event=>{event.preventDefault();beginTracking();update(event.touches[0])};node?.addEventListener("mousedown",onMouseDown);node?.addEventListener("touchstart",handleTouchStart,{passive:false});return()=>{if(node){node.removeEventListener("mousedown",onMouseDown);node.removeEventListener("touchstart",handleTouchStart)}}},[onChange]);return{ref:refCallback,active}}"use client";function getHeadingsData(headings,getDepth,getValue){const result=[];for(let i=0;i<headings.length;i+=1){const heading=headings[i];result.push({depth:getDepth(heading),value:getValue(heading),id:heading.id||randomId(),getNode:()=>heading.id?document.getElementById(heading.id):heading})}return result}function getActiveElement(rects){if(0===rects.length)return -1;const closest=rects.reduce((acc,item,index)=>{if(Math.abs(acc.position)<Math.abs(item.y))return acc;return{index,position:item.y}},{index:0,position:rects[0].y});return closest.index}function getDefaultDepth(element){return Number(element.tagName[1])}function getDefaultValue(element){return element.textContent||""}function useScrollSpy({selector="h1, h2, h3, h4, h5, h6",getDepth=getDefaultDepth,getValue=getDefaultValue,scrollHost}={}){const[active,setActive]=(0,consume_shared_module_default_react_strict_.useState)(-1);const[initialized,setInitialized]=(0,consume_shared_module_default_react_strict_.useState)(false);const[data,setData]=(0,consume_shared_module_default_react_strict_.useState)([]);const headingsRef=(0,consume_shared_module_default_react_strict_.useRef)([]);const handleScroll=()=>{setActive(getActiveElement(headingsRef.current.map(d=>d.getNode().getBoundingClientRect())))};const initialize=()=>{const headings=getHeadingsData(Array.from(document.querySelectorAll(selector)),getDepth,getValue);headingsRef.current=headings;setInitialized(true);setData(headings);setActive(getActiveElement(headings.map(d=>d.getNode().getBoundingClientRect())))};(0,consume_shared_module_default_react_strict_.useEffect)(()=>{initialize();const _scrollHost=scrollHost||window;_scrollHost.addEventListener("scroll",handleScroll);return()=>_scrollHost.removeEventListener("scroll",handleScroll)},[]);return{reinitialize:initialize,active,initialized,data}}"use client";const defaultOptions={multiple:true,accept:"*"};function getInitialFilesList(files){if(!files)return null;if(files instanceof FileList)return files;const result=new DataTransfer;for(const file of files)result.items.add(file);return result.files}function createInput(options){if("undefined"==typeof document)return null;const input=document.createElement("input");input.type="file";if(options.accept)input.accept=options.accept;if(options.multiple)input.multiple=options.multiple;if(options.capture)input.capture=options.capture;if(options.directory)input.webkitdirectory=options.directory;input.style.display="none";return input}function useFileDialog(input={}){const options={...defaultOptions,...input};const[files,setFiles]=(0,consume_shared_module_default_react_strict_.useState)(getInitialFilesList(options.initialFiles));const inputRef=(0,consume_shared_module_default_react_strict_.useRef)(null);const handleChange=(0,consume_shared_module_default_react_strict_.useCallback)(event=>{const target=event.target;if(target?.files){setFiles(target.files);options.onChange?.(target.files)}},[options.onChange]);const createAndSetupInput=(0,consume_shared_module_default_react_strict_.useCallback)(()=>{inputRef.current?.remove();inputRef.current=createInput(options);if(inputRef.current){inputRef.current.addEventListener("change",handleChange,{once:true});document.body.appendChild(inputRef.current)}},[options,handleChange]);useIsomorphicEffect(()=>{createAndSetupInput();return()=>inputRef.current?.remove()},[]);const reset=(0,consume_shared_module_default_react_strict_.useCallback)(()=>{setFiles(null);options.onChange?.(null)},[options.onChange]);const open=(0,consume_shared_module_default_react_strict_.useCallback)(()=>{if(options.resetOnOpen)reset();createAndSetupInput();inputRef.current?.click()},[options.resetOnOpen,reset,createAndSetupInput]);return{files,open,reset}}"use client";function useLongPress(onLongPress,options={}){const{threshold=400,onStart,onFinish,onCancel}=options;const isLongPressActive=(0,consume_shared_module_default_react_strict_.useRef)(false);const isPressed=(0,consume_shared_module_default_react_strict_.useRef)(false);const timeout=(0,consume_shared_module_default_react_strict_.useRef)(-1);(0,consume_shared_module_default_react_strict_.useEffect)(()=>()=>window.clearTimeout(timeout.current),[]);return(0,consume_shared_module_default_react_strict_.useMemo)(()=>{if("function"!=typeof onLongPress)return{};const start=event=>{if(!isMouseEvent(event)&&!isTouchEvent(event))return;if(onStart)onStart(event);isPressed.current=true;timeout.current=window.setTimeout(()=>{onLongPress(event);isLongPressActive.current=true},threshold)};const cancel=event=>{if(!isMouseEvent(event)&&!isTouchEvent(event))return;if(isLongPressActive.current){if(onFinish)onFinish(event)}else if(isPressed.current){if(onCancel)onCancel(event)}isLongPressActive.current=false;isPressed.current=false;if(timeout.current)window.clearTimeout(timeout.current)};return{onMouseDown:start,onMouseUp:cancel,onMouseLeave:cancel,onTouchStart:start,onTouchEnd:cancel}},[onLongPress,threshold,onCancel,onFinish,onStart])}function isTouchEvent(event){return window.TouchEvent?event.nativeEvent instanceof TouchEvent:"touches"in event.nativeEvent}function isMouseEvent(event){return event.nativeEvent instanceof MouseEvent}"use client";function useSelection(input){const[selectionSet,setSelectionSet]=(0,consume_shared_module_default_react_strict_.useState)(new Set(input.defaultSelection||[]));useDidUpdate(()=>{if(input.resetSelectionOnDataChange)setSelectionSet(/* @__PURE__ */new Set)},[input.data,input.resetSelectionOnDataChange]);const select=(0,consume_shared_module_default_react_strict_.useCallback)(selected=>{setSelectionSet(state=>{if(!state.has(selected)){const newSet=new Set(state);newSet.add(selected);return newSet}return state})},[]);const deselect=(0,consume_shared_module_default_react_strict_.useCallback)(deselected=>{setSelectionSet(state=>{if(state.has(deselected)){const newSet=new Set(state);newSet.delete(deselected);return newSet}return state})},[]);const toggle=(0,consume_shared_module_default_react_strict_.useCallback)(toggled=>{setSelectionSet(state=>{const newSet=new Set(state);if(state.has(toggled))newSet.delete(toggled);else newSet.add(toggled);return newSet})},[]);const resetSelection=(0,consume_shared_module_default_react_strict_.useCallback)(()=>{setSelectionSet(/* @__PURE__ */new Set)},[]);const setSelection=(0,consume_shared_module_default_react_strict_.useCallback)(selection=>{setSelectionSet(new Set(selection))},[]);const isAllSelected=(0,consume_shared_module_default_react_strict_.useCallback)(()=>{if(0===input.data.length)return false;return input.data.every(item=>selectionSet.has(item))},[selectionSet,input.data]);const isSomeSelected=(0,consume_shared_module_default_react_strict_.useCallback)(()=>input.data.some(item=>selectionSet.has(item)),[selectionSet,input.data]);return[Array.from(selectionSet),{select,deselect,toggle,isAllSelected,isSomeSelected,setSelection,resetSelection}]}}}]);
package/dist/mf/7906.js CHANGED
@@ -1 +1 @@
1
- "use strict";(globalThis["chunk_tech_app"]=globalThis["chunk_tech_app"]||[]).push([["7906"],{4063:function(module){module.exports=function equal(a,b){if(a===b)return true;if(a&&b&&"object"==typeof a&&"object"==typeof b){if(a.constructor!==b.constructor)return false;var length,i,keys;if(Array.isArray(a)){length=a.length;if(length!=b.length)return false;for(i=length;0!==i--;)if(!equal(a[i],b[i]))return false;return true}if(a.constructor===RegExp)return a.source===b.source&&a.flags===b.flags;if(a.valueOf!==Object.prototype.valueOf)return a.valueOf()===b.valueOf();if(a.toString!==Object.prototype.toString)return a.toString()===b.toString();keys=Object.keys(a);length=keys.length;if(length!==Object.keys(b).length)return false;for(i=length;0!==i--;)if(!Object.prototype.hasOwnProperty.call(b,keys[i]))return false;for(i=length;0!==i--;){var key=keys[i];if(!equal(a[key],b[key]))return false}return true}return a!==a&&b!==b}},6845:function(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{hasLength:()=>hasLength,isNotEmptyHTML:()=>isNotEmptyHTML,createFormContext:()=>createFormContext,FORM_INDEX:()=>FORM_INDEX,formRootRule:()=>formRootRule,createFormActions:()=>createFormActions,superstructResolver:()=>superstructResolver,isEmail:()=>isEmail,useForm:()=>useForm,isJSONString:()=>isJSONString,Form:()=>Form,isInRange:()=>isInRange,useField:()=>useField,zodResolver:()=>zodResolver,matchesField:()=>matchesField,joiResolver:()=>joiResolver,matches:()=>matches,isNotEmpty:()=>isNotEmpty,yupResolver:()=>yupResolver});var index_js_=__webpack_require__(9735);"use client";function dispatchEvent(type,detail){window.dispatchEvent(new CustomEvent(type,{detail}))}function validateFormName(name){if(!/^[0-9a-zA-Z-]+$/.test(name))throw new Error(`[@mantine/use-form] Form name "${name}" is invalid, it should contain only letters, numbers and dashes`)}const useIsomorphicEffect="undefined"!=typeof window?index_js_.useLayoutEffect:index_js_.useEffect;function createFormActions(name){validateFormName(name);const setFieldValue=(path,value)=>dispatchEvent(`mantine-form:${name}:set-field-value`,{path,value});const setValues=values=>dispatchEvent(`mantine-form:${name}:set-values`,values);const setInitialValues=values=>dispatchEvent(`mantine-form:${name}:set-initial-values`,values);const setErrors=errors=>dispatchEvent(`mantine-form:${name}:set-errors`,errors);const setFieldError=(path,error)=>dispatchEvent(`mantine-form:${name}:set-field-error`,{path,error});const clearFieldError=path=>dispatchEvent(`mantine-form:${name}:clear-field-error`,path);const clearErrors=()=>dispatchEvent(`mantine-form:${name}:clear-errors`);const reset=()=>dispatchEvent(`mantine-form:${name}:reset`);const validate=()=>dispatchEvent(`mantine-form:${name}:validate`);const validateField=path=>dispatchEvent(`mantine-form:${name}:validate-field`,path);const reorderListItem=(path,payload)=>dispatchEvent(`mantine-form:${name}:reorder-list-item`,{path,payload});const removeListItem=(path,index)=>dispatchEvent(`mantine-form:${name}:remove-list-item`,{path,index});const insertListItem=(path,item,index)=>dispatchEvent(`mantine-form:${name}:insert-list-item`,{path,index,item});const setDirty=value=>dispatchEvent(`mantine-form:${name}:set-dirty`,value);const setTouched=value=>dispatchEvent(`mantine-form:${name}:set-touched`,value);const resetDirty=values=>dispatchEvent(`mantine-form:${name}:reset-dirty`,values);const resetTouched=()=>dispatchEvent(`mantine-form:${name}:reset-touched`);return{setFieldValue,setValues,setInitialValues,setErrors,setFieldError,clearFieldError,clearErrors,reset,validate,validateField,reorderListItem,removeListItem,insertListItem,setDirty,setTouched,resetDirty,resetTouched}}function useFormEvent(eventKey,handler){useIsomorphicEffect(()=>{if(eventKey){window.addEventListener(eventKey,handler);return()=>window.removeEventListener(eventKey,handler)}},[eventKey])}function useFormActions(name,form){if(name)validateFormName(name);useFormEvent(`mantine-form:${name}:set-field-value`,event=>form.setFieldValue(event.detail.path,event.detail.value));useFormEvent(`mantine-form:${name}:set-values`,event=>form.setValues(event.detail));useFormEvent(`mantine-form:${name}:set-initial-values`,event=>form.setInitialValues(event.detail));useFormEvent(`mantine-form:${name}:set-errors`,event=>form.setErrors(event.detail));useFormEvent(`mantine-form:${name}:set-field-error`,event=>form.setFieldError(event.detail.path,event.detail.error));useFormEvent(`mantine-form:${name}:clear-field-error`,event=>form.clearFieldError(event.detail));useFormEvent(`mantine-form:${name}:clear-errors`,form.clearErrors);useFormEvent(`mantine-form:${name}:reset`,form.reset);useFormEvent(`mantine-form:${name}:validate`,form.validate);useFormEvent(`mantine-form:${name}:validate-field`,event=>form.validateField(event.detail));useFormEvent(`mantine-form:${name}:reorder-list-item`,event=>form.reorderListItem(event.detail.path,event.detail.payload));useFormEvent(`mantine-form:${name}:remove-list-item`,event=>form.removeListItem(event.detail.path,event.detail.index));useFormEvent(`mantine-form:${name}:insert-list-item`,event=>form.insertListItem(event.detail.path,event.detail.item,event.detail.index));useFormEvent(`mantine-form:${name}:set-dirty`,event=>form.setDirty(event.detail));useFormEvent(`mantine-form:${name}:set-touched`,event=>form.setTouched(event.detail));useFormEvent(`mantine-form:${name}:reset-dirty`,event=>form.resetDirty(event.detail));useFormEvent(`mantine-form:${name}:reset-touched`,form.resetTouched)}"use client";function getInputOnChange(setValue){return val=>{if(val)if("function"==typeof val)setValue(val);else if("object"==typeof val&&"nativeEvent"in val){const{currentTarget}=val;if(currentTarget instanceof HTMLInputElement)"checkbox"===currentTarget.type?setValue(currentTarget.checked):setValue(currentTarget.value);else if(currentTarget instanceof HTMLTextAreaElement||currentTarget instanceof HTMLSelectElement)setValue(currentTarget.value)}else setValue(val);else setValue(val)}}"use client";function filterErrors(errors){if(null===errors||"object"!=typeof errors)return{};return Object.keys(errors).reduce((acc,key)=>{const errorValue=errors[key];if(null!=errorValue&&false!==errorValue)acc[key]=errorValue;return acc},{})}"use client";function useFormErrors(initialErrors){const[errorsState,setErrorsState]=(0,index_js_.useState)(filterErrors(initialErrors));const errorsRef=(0,index_js_.useRef)(errorsState);const setErrors=(0,index_js_.useCallback)(errors=>{setErrorsState(current=>{const newErrors=filterErrors("function"==typeof errors?errors(current):errors);errorsRef.current=newErrors;return newErrors})},[]);const clearErrors=(0,index_js_.useCallback)(()=>setErrors({}),[]);const clearFieldError=(0,index_js_.useCallback)(path=>{if(void 0===errorsRef.current[path])return;setErrors(current=>{const errors={...current};delete errors[path];return errors})},[errorsState]);const setFieldError=(0,index_js_.useCallback)((path,error)=>{if(null==error||false===error)clearFieldError(path);else if(errorsRef.current[path]!==error)setErrors(current=>({...current,[path]:error}))},[errorsState]);return{errorsState,setErrors,clearErrors,setFieldError,clearFieldError}}"use client";function clearListState(field,state){if(null===state||"object"!=typeof state)return{};const clone={...state};Object.keys(state).forEach(errorKey=>{if(errorKey.includes(`${String(field)}.`))delete clone[errorKey]});return clone}"use client";function getIndexFromKeyAfterPath(key,path){const split=key.substring(path.length+1).split(".")[0];return parseInt(split,10)}function changeErrorIndices(path,index,errors,change){if(void 0===index)return errors;const pathString=`${String(path)}`;let clearedErrors=errors;if(-1===change)clearedErrors=clearListState(`${pathString}.${index}`,clearedErrors);const cloned={...clearedErrors};const changedKeys=/* @__PURE__ */new Set;Object.entries(clearedErrors).filter(([key])=>{if(!key.startsWith(`${pathString}.`))return false;const currIndex=getIndexFromKeyAfterPath(key,pathString);if(Number.isNaN(currIndex))return false;return currIndex>=index}).forEach(([key,value])=>{const currIndex=getIndexFromKeyAfterPath(key,pathString);const newKey=key.replace(`${pathString}.${currIndex}`,`${pathString}.${currIndex+change}`);cloned[newKey]=value;changedKeys.add(newKey);if(!changedKeys.has(key))delete cloned[key]});return cloned}"use client";function reorderErrors(path,{from,to},errors){const oldKeyStart=`${path}.${from}`;const newKeyStart=`${path}.${to}`;const clone={...errors};const processedKeys=/* @__PURE__ */new Set;Object.keys(errors).forEach(key=>{if(processedKeys.has(key))return;let oldKey;let newKey;if(key.startsWith(oldKeyStart)){oldKey=key;newKey=key.replace(oldKeyStart,newKeyStart)}else if(key.startsWith(newKeyStart)){oldKey=key.replace(newKeyStart,oldKeyStart);newKey=key}if(oldKey&&newKey){const value1=clone[oldKey];const value2=clone[newKey];void 0===value2?delete clone[oldKey]:clone[oldKey]=value2;void 0===value1?delete clone[newKey]:clone[newKey]=value1;processedKeys.add(oldKey);processedKeys.add(newKey)}});return clone}"use client";function getSplittedPath(path){if("string"!=typeof path)return[];return path.split(".")}"use client";function getPath(path,values){const splittedPath=getSplittedPath(path);if(0===splittedPath.length||"object"!=typeof values||null===values)return;let value=values[splittedPath[0]];for(let i=1;i<splittedPath.length;i+=1){if(null==value)break;value=value[splittedPath[i]]}return value}function set(obj,key,val){if("object"==typeof val.value)val.value=klona(val.value);if(val.enumerable&&!val.get&&!val.set&&val.configurable&&val.writable&&"__proto__"!==key)obj[key]=val.value;else Object.defineProperty(obj,key,val)}function klona(x){if("object"!=typeof x)return x;var i=0,k,list,tmp,str=Object.prototype.toString.call(x);if("[object Object]"===str)tmp=Object.create(x.__proto__||null);else if("[object Array]"===str)tmp=Array(x.length);else if("[object Set]"===str){tmp=new Set;x.forEach(function(val){tmp.add(klona(val))})}else if("[object Map]"===str){tmp=new Map;x.forEach(function(val,key){tmp.set(klona(key),klona(val))})}else if("[object Date]"===str)tmp=new Date(+x);else if("[object RegExp]"===str)tmp=new RegExp(x.source,x.flags);else if("[object DataView]"===str)tmp=new x.constructor(klona(x.buffer));else if("[object ArrayBuffer]"===str)tmp=x.slice(0);else if("Array]"===str.slice(-6))tmp=new x.constructor(x);if(tmp){for(list=Object.getOwnPropertySymbols(x);i<list.length;i++)set(tmp,list[i],Object.getOwnPropertyDescriptor(x,list[i]));for(i=0,list=Object.getOwnPropertyNames(x);i<list.length;i++)if(!Object.hasOwnProperty.call(tmp,k=list[i])||tmp[k]!==x[k])set(tmp,k,Object.getOwnPropertyDescriptor(x,k))}return tmp||x}"use client";function setPath(path,value,values){const splittedPath=getSplittedPath(path);if(0===splittedPath.length)return values;const cloned=klona(values);if(1===splittedPath.length){cloned[splittedPath[0]]=value;return cloned}let val=cloned[splittedPath[0]];for(let i=1;i<splittedPath.length-1;i+=1){if(void 0===val)return cloned;val=val[splittedPath[i]]}val[splittedPath[splittedPath.length-1]]=value;return cloned}"use client";function reorderPath(path,{from,to},values){const currentValue=getPath(path,values);if(!Array.isArray(currentValue))return values;const cloned=[...currentValue];const item=currentValue[from];cloned.splice(from,1);cloned.splice(to,0,item);return setPath(path,cloned,values)}"use client";function insertPath(path,value,index,values){const currentValue=getPath(path,values);if(!Array.isArray(currentValue))return values;const cloned=[...currentValue];cloned.splice("number"==typeof index?index:cloned.length,0,value);return setPath(path,cloned,values)}"use client";function removePath(path,index,values){const currentValue=getPath(path,values);if(!Array.isArray(currentValue))return values;return setPath(path,currentValue.filter((_,itemIndex)=>itemIndex!==index),values)}"use client";function replacePath(path,item,index,values){const currentValue=getPath(path,values);if(!Array.isArray(currentValue))return values;if(currentValue.length<=index)return values;const cloned=[...currentValue];cloned[index]=item;return setPath(path,cloned,values)}"use client";function useFormList({$values,$errors,$status}){const reorderListItem=(0,index_js_.useCallback)((path,payload)=>{$status.clearFieldDirty(path);$errors.setErrors(errs=>reorderErrors(path,payload,errs));$values.setValues({values:reorderPath(path,payload,$values.refValues.current),updateState:true})},[]);const removeListItem=(0,index_js_.useCallback)((path,index)=>{$status.clearFieldDirty(path);$errors.setErrors(errs=>changeErrorIndices(path,index,errs,-1));$values.setValues({values:removePath(path,index,$values.refValues.current),updateState:true})},[]);const insertListItem=(0,index_js_.useCallback)((path,item,index)=>{$status.clearFieldDirty(path);$errors.setErrors(errs=>changeErrorIndices(path,index,errs,1));$values.setValues({values:insertPath(path,item,index,$values.refValues.current),updateState:true})},[]);const replaceListItem=(0,index_js_.useCallback)((path,index,item)=>{$status.clearFieldDirty(path);$values.setValues({values:replacePath(path,item,index,$values.refValues.current),updateState:true})},[]);return{reorderListItem,removeListItem,insertListItem,replaceListItem}}var fast_deep_equal=__webpack_require__(4063);"use client";function getStatus(status,path){const paths=Object.keys(status);if("string"==typeof path){const nestedPaths=paths.filter(statusPath=>statusPath.startsWith(`${path}.`));return status[path]||nestedPaths.some(statusPath=>status[statusPath])||false}return paths.some(statusPath=>status[statusPath])}"use client";function useFormStatus({initialDirty,initialTouched,mode,$values}){const[touchedState,setTouchedState]=(0,index_js_.useState)(initialTouched);const[dirtyState,setDirtyState]=(0,index_js_.useState)(initialDirty);const touchedRef=(0,index_js_.useRef)(initialTouched);const dirtyRef=(0,index_js_.useRef)(initialDirty);const setTouched=(0,index_js_.useCallback)(values=>{const resolvedValues="function"==typeof values?values(touchedRef.current):values;touchedRef.current=resolvedValues;if("controlled"===mode)setTouchedState(resolvedValues)},[]);const setDirty=(0,index_js_.useCallback)((values,forceUpdate=false)=>{const resolvedValues="function"==typeof values?values(dirtyRef.current):values;dirtyRef.current=resolvedValues;if("controlled"===mode||forceUpdate)setDirtyState(resolvedValues)},[]);const resetTouched=(0,index_js_.useCallback)(()=>setTouched({}),[]);const resetDirty=(0,index_js_.useCallback)(values=>{const newSnapshot=values?{...$values.refValues.current,...values}:$values.refValues.current;$values.setValuesSnapshot(newSnapshot);setDirty({})},[]);const setFieldTouched=(0,index_js_.useCallback)((path,touched)=>{setTouched(currentTouched=>{if(getStatus(currentTouched,path)===touched)return currentTouched;return{...currentTouched,[path]:touched}})},[]);const setFieldDirty=(0,index_js_.useCallback)((path,dirty,forceUpdate)=>{setDirty(currentDirty=>{if(getStatus(currentDirty,path)===dirty)return currentDirty;return{...currentDirty,[path]:dirty}},forceUpdate)},[]);const setCalculatedFieldDirty=(0,index_js_.useCallback)((path,value)=>{const currentDirty=getStatus(dirtyRef.current,path);const dirty=!fast_deep_equal(getPath(path,$values.getValuesSnapshot()),value);const clearedState=clearListState(path,dirtyRef.current);clearedState[path]=dirty;setDirty(clearedState,currentDirty!==dirty)},[]);const isTouched=(0,index_js_.useCallback)(path=>getStatus(touchedRef.current,path),[]);const clearFieldDirty=(0,index_js_.useCallback)(path=>setDirty(current=>{if("string"!=typeof path)return current;const result=clearListState(path,current);delete result[path];if(fast_deep_equal(result,current))return current;return result}),[]);const isDirty=(0,index_js_.useCallback)(path=>{if(path){const overriddenValue=getPath(path,dirtyRef.current);if("boolean"==typeof overriddenValue)return overriddenValue;const sliceOfValues=getPath(path,$values.refValues.current);const sliceOfInitialValues=getPath(path,$values.valuesSnapshot.current);return!fast_deep_equal(sliceOfValues,sliceOfInitialValues)}const isOverridden=Object.keys(dirtyRef.current).length>0;if(isOverridden)return getStatus(dirtyRef.current);return!fast_deep_equal($values.refValues.current,$values.valuesSnapshot.current)},[]);const getDirty=(0,index_js_.useCallback)(()=>dirtyRef.current,[]);const getTouched=(0,index_js_.useCallback)(()=>touchedRef.current,[]);return{touchedState,dirtyState,touchedRef,dirtyRef,setTouched,setDirty,resetDirty,resetTouched,isTouched,setFieldTouched,setFieldDirty,setTouchedState,setDirtyState,clearFieldDirty,isDirty,getDirty,getTouched,setCalculatedFieldDirty}}"use client";function useFormValues({initialValues,onValuesChange,mode}){const initialized=(0,index_js_.useRef)(false);const[stateValues,setStateValues]=(0,index_js_.useState)(initialValues||{});const refValues=(0,index_js_.useRef)(stateValues);const valuesSnapshot=(0,index_js_.useRef)(stateValues);const setValues=(0,index_js_.useCallback)(({values,subscribers,updateState=true,mergeWithPreviousValues=true})=>{const previousValues=refValues.current;const resolvedValues=values instanceof Function?values(refValues.current):values;const updatedValues=mergeWithPreviousValues?{...previousValues,...resolvedValues}:resolvedValues;refValues.current=updatedValues;if(updateState){setStateValues(updatedValues);if("uncontrolled"===mode)refValues.current=updatedValues}onValuesChange?.(updatedValues,previousValues);subscribers?.filter(Boolean).forEach(subscriber=>subscriber({updatedValues,previousValues}))},[onValuesChange]);const setFieldValue=(0,index_js_.useCallback)(payload=>{const currentValue=getPath(payload.path,refValues.current);const updatedValue=payload.value instanceof Function?payload.value(currentValue):payload.value;if(currentValue!==updatedValue){const previousValues=refValues.current;const updatedValues=setPath(payload.path,updatedValue,refValues.current);setValues({values:updatedValues,updateState:payload.updateState});payload.subscribers?.filter(Boolean).forEach(subscriber=>subscriber({path:payload.path,updatedValues,previousValues}))}},[setValues]);const setValuesSnapshot=(0,index_js_.useCallback)(payload=>{valuesSnapshot.current=payload},[]);const initialize=(0,index_js_.useCallback)((values,onInitialize)=>{if(!initialized.current){initialized.current=true;setValues({values,updateState:"controlled"===mode});setValuesSnapshot(values);onInitialize()}},[setValues]);const resetValues=(0,index_js_.useCallback)(()=>{setValues({values:valuesSnapshot.current,updateState:true,mergeWithPreviousValues:false})},[setValues]);const getValues=(0,index_js_.useCallback)(()=>refValues.current,[]);const getValuesSnapshot=(0,index_js_.useCallback)(()=>valuesSnapshot.current,[]);const resetField=(0,index_js_.useCallback)((path,subscribers)=>{const snapshotValue=getPath(path,valuesSnapshot.current);if(void 0===snapshotValue)return;setFieldValue({path,value:snapshotValue,updateState:"controlled"===mode,subscribers})},[setFieldValue,mode]);return{initialized,stateValues,refValues,valuesSnapshot,setValues,setFieldValue,resetValues,setValuesSnapshot,initialize,getValues,getValuesSnapshot,resetField}}"use client";function useFormWatch({$status,cascadeUpdates}){const subscribers=(0,index_js_.useRef)({});const watch=(0,index_js_.useCallback)((path,callback)=>{(0,index_js_.useEffect)(()=>{subscribers.current[path]=subscribers.current[path]||[];subscribers.current[path].push(callback);return()=>{subscribers.current[path]=subscribers.current[path].filter(cb=>cb!==callback)}},[callback])},[]);const getFieldSubscribers=(0,index_js_.useCallback)(path=>{const result=subscribers.current[path]?.map(callback=>input=>callback({previousValue:getPath(path,input.previousValues),value:getPath(path,input.updatedValues),touched:$status.isTouched(path),dirty:$status.isDirty(path)}))??[];if(cascadeUpdates){for(const subscriptionKey in subscribers.current)if(subscriptionKey.startsWith(`${path}.`)||path.startsWith(`${subscriptionKey}.`))result.push(...subscribers.current[subscriptionKey].map(cb=>input=>cb({previousValue:getPath(subscriptionKey,input.previousValues),value:getPath(subscriptionKey,input.updatedValues),touched:$status.isTouched(subscriptionKey),dirty:$status.isDirty(subscriptionKey)})))}return result},[]);return{subscribers,watch,getFieldSubscribers}}"use client";function getDataPath(formName,fieldPath){return formName?`${formName}-${fieldPath.toString()}`:fieldPath.toString()}"use client";const formRootRule=Symbol("root-rule");function getValidationResults(errors){const filteredErrors=filterErrors(errors);return{hasErrors:Object.keys(filteredErrors).length>0,errors:filteredErrors}}function validateRulesRecord(rules,values,path="",errors={}){if("object"!=typeof rules||null===rules)return errors;return Object.keys(rules).reduce((acc,ruleKey)=>{const rule=rules[ruleKey];const rulePath=`${""===path?"":`${path}.`}${ruleKey}`;const value=getPath(rulePath,values);let arrayValidation=false;if("function"==typeof rule)acc[rulePath]=rule(value,values,rulePath);if("object"==typeof rule&&Array.isArray(value)){arrayValidation=true;value.forEach((_item,index)=>validateRulesRecord(rule,values,`${rulePath}.${index}`,acc));if(formRootRule in rule)acc[rulePath]=rule[formRootRule](value,values,rulePath)}if("object"==typeof rule&&"object"==typeof value&&null!==value){if(!arrayValidation)validateRulesRecord(rule,values,rulePath,acc);if(formRootRule in rule)acc[rulePath]=rule[formRootRule](value,values,rulePath)}return acc},errors)}function validateValues(validate,values){if("function"==typeof validate)return getValidationResults(validate(values));return getValidationResults(validateRulesRecord(validate,values))}"use client";function validateFieldValue(path,rules,values){if("string"!=typeof path)return{hasError:false,error:null};const results=validateValues(rules,values);const pathInError=Object.keys(results.errors).find(errorKey=>path.split(".").every((pathPart,i)=>pathPart===errorKey.split(".")[i]));return{hasError:!!pathInError,error:pathInError?results.errors[pathInError]:null}}"use client";const FORM_INDEX="__MANTINE_FORM_INDEX__";"use client";function shouldValidateOnChange(path,validateInputOnChange){if(!validateInputOnChange)return false;if("boolean"==typeof validateInputOnChange)return validateInputOnChange;if(Array.isArray(validateInputOnChange))return validateInputOnChange.includes(path.replace(/[.][0-9]+/g,`.${FORM_INDEX}`));return false}"use client";function useForm({name,mode="controlled",initialValues,initialErrors={},initialDirty={},initialTouched={},clearInputErrorOnChange=true,validateInputOnChange=false,validateInputOnBlur=false,onValuesChange,transformValues=values=>values,enhanceGetInputProps,validate:rules,onSubmitPreventDefault="always",touchTrigger="change",cascadeUpdates=false}={}){const $errors=useFormErrors(initialErrors);const $values=useFormValues({initialValues,onValuesChange,mode});const $status=useFormStatus({initialDirty,initialTouched,$values,mode});const $list=useFormList({$values,$errors,$status});const $watch=useFormWatch({$status,cascadeUpdates});const[formKey,setFormKey]=(0,index_js_.useState)(0);const[fieldKeys,setFieldKeys]=(0,index_js_.useState)({});const[submitting,setSubmitting]=(0,index_js_.useState)(false);const reset=(0,index_js_.useCallback)(()=>{$values.resetValues();$errors.clearErrors();$status.resetDirty();$status.resetTouched();"uncontrolled"===mode&&setFormKey(key2=>key2+1)},[]);const handleValuesChanges=(0,index_js_.useCallback)(previousValues=>{clearInputErrorOnChange&&$errors.clearErrors();"uncontrolled"===mode&&setFormKey(key2=>key2+1);Object.keys($watch.subscribers.current).forEach(path=>{const value=getPath(path,$values.refValues.current);const previousValue=getPath(path,previousValues);if(value!==previousValue)$watch.getFieldSubscribers(path).forEach(cb=>cb({previousValues,updatedValues:$values.refValues.current}))})},[clearInputErrorOnChange]);const initialize=(0,index_js_.useCallback)(values=>{const previousValues=$values.refValues.current;$values.initialize(values,()=>"uncontrolled"===mode&&setFormKey(key2=>key2+1));handleValuesChanges(previousValues)},[handleValuesChanges]);const setFieldValue=(0,index_js_.useCallback)((path,value,options)=>{const shouldValidate=shouldValidateOnChange(path,validateInputOnChange);const resolvedValue=value instanceof Function?value(getPath(path,$values.refValues.current)):value;$status.setCalculatedFieldDirty(path,resolvedValue);"change"===touchTrigger&&$status.setFieldTouched(path,true);!shouldValidate&&clearInputErrorOnChange&&$errors.clearFieldError(path);$values.setFieldValue({path,value,updateState:"controlled"===mode,subscribers:[...$watch.getFieldSubscribers(path),shouldValidate?payload=>{const validationResults=validateFieldValue(path,rules,payload.updatedValues);validationResults.hasError?$errors.setFieldError(path,validationResults.error):$errors.clearFieldError(path)}:null,options?.forceUpdate!==false&&"controlled"!==mode?()=>setFieldKeys(keys=>({...keys,[path]:(keys[path]||0)+1})):null]})},[onValuesChange,rules]);const setValues=(0,index_js_.useCallback)(values=>{const previousValues=$values.refValues.current;$values.setValues({values,updateState:"controlled"===mode});handleValuesChanges(previousValues)},[onValuesChange,handleValuesChanges]);const validate=(0,index_js_.useCallback)(()=>{const results=validateValues(rules,$values.refValues.current);$errors.setErrors(results.errors);return results},[rules]);const validateField=(0,index_js_.useCallback)(path=>{const results=validateFieldValue(path,rules,$values.refValues.current);results.hasError?$errors.setFieldError(path,results.error):$errors.clearFieldError(path);return results},[rules]);const getInputProps=(path,{type="input",withError=true,withFocus=true,...otherOptions}={})=>{const onChange=getInputOnChange(value=>setFieldValue(path,value,{forceUpdate:false}));const payload={onChange,"data-path":getDataPath(name,path)};if(withError)payload.error=$errors.errorsState[path];if("checkbox"===type)payload["controlled"===mode?"checked":"defaultChecked"]=getPath(path,$values.refValues.current);else payload["controlled"===mode?"value":"defaultValue"]=getPath(path,$values.refValues.current);if(withFocus){payload.onFocus=()=>$status.setFieldTouched(path,true);payload.onBlur=()=>{if(shouldValidateOnChange(path,validateInputOnBlur)){const validationResults=validateFieldValue(path,rules,$values.refValues.current);validationResults.hasError?$errors.setFieldError(path,validationResults.error):$errors.clearFieldError(path)}}}return Object.assign(payload,enhanceGetInputProps?.({inputProps:payload,field:path,options:{type,withError,withFocus,...otherOptions},form}))};const onSubmit=(handleSubmit,handleValidationFailure)=>event=>{if("always"===onSubmitPreventDefault)event?.preventDefault();const results=validate();if(results.hasErrors){if("validation-failed"===onSubmitPreventDefault)event?.preventDefault();handleValidationFailure?.(results.errors,$values.refValues.current,event)}else{const submitResult=handleSubmit?.(transformValues($values.refValues.current),event);if(submitResult instanceof Promise){setSubmitting(true);submitResult.finally(()=>setSubmitting(false))}}};const getTransformedValues=input=>transformValues(input||$values.refValues.current);const onReset=(0,index_js_.useCallback)(event=>{event.preventDefault();reset()},[]);const isValid=(0,index_js_.useCallback)(path=>path?!validateFieldValue(path,rules,$values.refValues.current).hasError:!validateValues(rules,$values.refValues.current).hasErrors,[rules]);const key=path=>`${formKey}-${String(path)}-${fieldKeys[String(path)]||0}`;const getInputNode=(0,index_js_.useCallback)(path=>document.querySelector(`[data-path="${getDataPath(name,path)}"]`),[]);const resetField=(0,index_js_.useCallback)(path=>{$values.resetField(path,["controlled"!==mode?()=>setFieldKeys(keys=>({...keys,[path]:(keys[path]||0)+1})):null])},[$values.resetField,mode,setFieldKeys]);const form={watch:$watch.watch,initialized:$values.initialized.current,values:"uncontrolled"===mode?$values.refValues.current:$values.stateValues,getValues:$values.getValues,getInitialValues:$values.getValuesSnapshot,setInitialValues:$values.setValuesSnapshot,resetField,initialize,setValues,setFieldValue,submitting,setSubmitting,errors:$errors.errorsState,setErrors:$errors.setErrors,setFieldError:$errors.setFieldError,clearFieldError:$errors.clearFieldError,clearErrors:$errors.clearErrors,resetDirty:$status.resetDirty,setTouched:$status.setTouched,setDirty:$status.setDirty,isTouched:$status.isTouched,resetTouched:$status.resetTouched,isDirty:$status.isDirty,getTouched:$status.getTouched,getDirty:$status.getDirty,reorderListItem:$list.reorderListItem,insertListItem:$list.insertListItem,removeListItem:$list.removeListItem,replaceListItem:$list.replaceListItem,reset,validate,validateField,getInputProps,onSubmit,onReset,isValid,getTransformedValues,key,getInputNode};useFormActions(name,form);return form}var jsx_runtime=__webpack_require__(5893);"use client";function createFormContext(){const FormContext=(0,index_js_.createContext)(null);function FormProvider({form,children}){return/* @__PURE__ */(0,jsx_runtime.jsx)(FormContext.Provider,{value:form,children})}function useFormContext(){const ctx=(0,index_js_.useContext)(FormContext);if(!ctx)throw new Error("useFormContext was called outside of FormProvider context");return ctx}return[FormProvider,useFormContext,useForm]}"use client";const Form=(0,index_js_.forwardRef)(({form,onSubmit,onReset,...others},ref)=>/* @__PURE__ */(0,jsx_runtime.jsx)("form",{...others,onSubmit:form.onSubmit("function"==typeof onSubmit?onSubmit:()=>{}),onReset:event=>{onReset?.(event);form.onReset(event)},ref}));Form.displayName="@mantine/use-form/Form";"use client";function isNotEmpty(error){const _error=error||true;return value=>{if("string"==typeof value)return value.trim().length>0?null:_error;if(Array.isArray(value))return value.length>0?null:_error;if(null==value)return _error;if(false===value)return _error;return null}}"use client";function matches(regexp,error){const _error=error||true;return value=>{if("string"!=typeof value)return _error;return regexp.test(value)?null:_error}}"use client";function isEmail(error){return matches(/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,error)}"use client";function isLengthValid(payload,value){if("number"==typeof payload)return value.length===payload;const{max,min}=payload;let valid=true;if("number"==typeof max&&value.length>max)valid=false;if("number"==typeof min&&value.length<min)valid=false;return valid}function hasLength(payload,error){const _error=error||true;return value=>{if("string"==typeof value)return isLengthValid(payload,value.trim())?null:_error;if("object"==typeof value&&null!==value&&"length"in value)return isLengthValid(payload,value)?null:_error;return _error}}"use client";function isInRange({min,max},error){const _error=error||true;return value=>{if("number"!=typeof value)return _error;let valid=true;if("number"==typeof min&&value<min)valid=false;if("number"==typeof max&&value>max)valid=false;return valid?null:_error}}"use client";function matchesField(field,error){const _error=error||true;return(value,values)=>{if(!values||!(field in values))return _error;return value===values[field]?null:_error}}"use client";function removeHtmlTags(input){return input.replace(/<\/?[^>]+(>|$)/g,"")}function isNotEmptyHTML(error){const _error=error||true;return value=>{if("string"==typeof value)return removeHtmlTags(value).trim().length>0?null:_error;return _error}}"use client";function isJSONString(error){const _error=error||true;return value=>{if("string"==typeof value)try{JSON.parse(value);return null}catch(e){}return _error}}"use client";function useField({mode="controlled",clearErrorOnChange=true,initialValue,initialError=null,initialTouched=false,onValueChange,validateOnChange=false,validateOnBlur=false,validate,resolveValidationError,type="input"}){const[valueState,setValueState]=(0,index_js_.useState)(initialValue);const valueRef=(0,index_js_.useRef)(valueState);const[key,setKey]=(0,index_js_.useState)(0);const[error,setError]=(0,index_js_.useState)(initialError||null);const touchedRef=(0,index_js_.useRef)(initialTouched||false);const[,setTouchedState]=(0,index_js_.useState)(touchedRef.current);const[isValidating,setIsValidating]=(0,index_js_.useState)(false);const errorResolver=(0,index_js_.useMemo)(()=>resolveValidationError||(err=>err),[resolveValidationError]);const setTouched=(0,index_js_.useCallback)((val,{updateState="controlled"===mode}={})=>{touchedRef.current=val;updateState&&setTouchedState(val)},[]);const setValue=(0,index_js_.useCallback)((value,{updateKey="uncontrolled"===mode,updateState="controlled"===mode}={})=>{if(valueRef.current===value)return;valueRef.current=value;onValueChange?.(value);if(clearErrorOnChange&&null!==error)setError(null);if(updateState)setValueState(value);if(updateKey)setKey(currentKey=>currentKey+1);if(validateOnChange)_validate()},[error,clearErrorOnChange,onValueChange]);const reset=(0,index_js_.useCallback)(()=>{setValue(initialValue);setError(null);setTouched(false)},[initialValue]);const getValue=(0,index_js_.useCallback)(()=>valueRef.current,[]);const isTouched=(0,index_js_.useCallback)(()=>touchedRef.current,[]);const isDirty=(0,index_js_.useCallback)(()=>valueRef.current!==initialValue,[initialValue]);const _validate=(0,index_js_.useCallback)(async()=>{const validationResult=validate?.(valueRef.current);if(validationResult instanceof Promise){setIsValidating(true);try{const result=await validationResult;setIsValidating(false);setError(result)}catch(err){setIsValidating(false);const resolvedError=errorResolver(err);setError(resolvedError);return resolvedError}}else{setError(validationResult);return validationResult}},[]);const getInputProps=({withError=true,withFocus=true}={})=>{const onChange=getInputOnChange(val=>setValue(val,{updateKey:false}));const payload={onChange};if(withError)payload.error=error;if("checkbox"===type)payload["controlled"===mode?"checked":"defaultChecked"]=valueRef.current;else payload["controlled"===mode?"value":"defaultValue"]=valueRef.current;if(withFocus){payload.onFocus=()=>{setTouched(true)};payload.onBlur=()=>{if(shouldValidateOnChange("",!!validateOnBlur))_validate()}}return payload};const resetTouched=(0,index_js_.useCallback)(()=>setTouched(false),[]);return{key,getValue,setValue,reset,getInputProps,isValidating,validate:_validate,error,setError,isTouched,isDirty,resetTouched}}"use client";function zodResolver(schema){return values=>{const parsed=schema.safeParse(values);if(parsed.success)return{};const results={};parsed.error.errors.forEach(error=>{results[error.path.join(".")]=error.message});return results}}"use client";function superstructResolver(schema){function structValidation(values){const formErrors={};const[err]=schema.validate(values);if(!err)return formErrors;err.failures().forEach(fieldFailure=>{const fieldName=fieldFailure.path.join(" ");formErrors[fieldFailure.path.join(".")]=`${fieldName}: ${fieldFailure.message}`});return formErrors}return structValidation}"use client";function yupResolver(schema){const _schema=schema;return values=>{try{_schema.validateSync(values,{abortEarly:false});return{}}catch(_yupError){const yupError=_yupError;const results={};yupError.inner.forEach(error=>{results[error.path.replaceAll("[",".").replaceAll("]","")]=error.message});return results}}}"use client";function joiResolver(schema,options){const _schema=schema;return values=>{const parsed=_schema.validate(values,{abortEarly:false,...options});if(!parsed.error)return{};const results={};parsed.error.details.forEach(error=>{results[error.path.join(".")]=error.message});return results}}}}]);
1
+ "use strict";(globalThis["chunk_tech_app"]=globalThis["chunk_tech_app"]||[]).push([["7906"],{4063:function(module){module.exports=function equal(a,b){if(a===b)return true;if(a&&b&&"object"==typeof a&&"object"==typeof b){if(a.constructor!==b.constructor)return false;var length,i,keys;if(Array.isArray(a)){length=a.length;if(length!=b.length)return false;for(i=length;0!==i--;)if(!equal(a[i],b[i]))return false;return true}if(a.constructor===RegExp)return a.source===b.source&&a.flags===b.flags;if(a.valueOf!==Object.prototype.valueOf)return a.valueOf()===b.valueOf();if(a.toString!==Object.prototype.toString)return a.toString()===b.toString();keys=Object.keys(a);length=keys.length;if(length!==Object.keys(b).length)return false;for(i=length;0!==i--;)if(!Object.prototype.hasOwnProperty.call(b,keys[i]))return false;for(i=length;0!==i--;){var key=keys[i];if(!equal(a[key],b[key]))return false}return true}return a!==a&&b!==b}},6845:function(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{hasLength:()=>hasLength,isNotEmptyHTML:()=>isNotEmptyHTML,createFormContext:()=>createFormContext,FORM_INDEX:()=>FORM_INDEX,formRootRule:()=>formRootRule,createFormActions:()=>createFormActions,superstructResolver:()=>superstructResolver,isEmail:()=>isEmail,useForm:()=>useForm,isJSONString:()=>isJSONString,Form:()=>Form,isInRange:()=>isInRange,useField:()=>useField,zodResolver:()=>zodResolver,matchesField:()=>matchesField,joiResolver:()=>joiResolver,matches:()=>matches,isNotEmpty:()=>isNotEmpty,yupResolver:()=>yupResolver});var consume_shared_module_default_react_strict_=__webpack_require__(5850);"use client";function dispatchEvent(type,detail){window.dispatchEvent(new CustomEvent(type,{detail}))}function validateFormName(name){if(!/^[0-9a-zA-Z-]+$/.test(name))throw new Error(`[@mantine/use-form] Form name "${name}" is invalid, it should contain only letters, numbers and dashes`)}const useIsomorphicEffect="undefined"!=typeof window?consume_shared_module_default_react_strict_.useLayoutEffect:consume_shared_module_default_react_strict_.useEffect;function createFormActions(name){validateFormName(name);const setFieldValue=(path,value)=>dispatchEvent(`mantine-form:${name}:set-field-value`,{path,value});const setValues=values=>dispatchEvent(`mantine-form:${name}:set-values`,values);const setInitialValues=values=>dispatchEvent(`mantine-form:${name}:set-initial-values`,values);const setErrors=errors=>dispatchEvent(`mantine-form:${name}:set-errors`,errors);const setFieldError=(path,error)=>dispatchEvent(`mantine-form:${name}:set-field-error`,{path,error});const clearFieldError=path=>dispatchEvent(`mantine-form:${name}:clear-field-error`,path);const clearErrors=()=>dispatchEvent(`mantine-form:${name}:clear-errors`);const reset=()=>dispatchEvent(`mantine-form:${name}:reset`);const validate=()=>dispatchEvent(`mantine-form:${name}:validate`);const validateField=path=>dispatchEvent(`mantine-form:${name}:validate-field`,path);const reorderListItem=(path,payload)=>dispatchEvent(`mantine-form:${name}:reorder-list-item`,{path,payload});const removeListItem=(path,index)=>dispatchEvent(`mantine-form:${name}:remove-list-item`,{path,index});const insertListItem=(path,item,index)=>dispatchEvent(`mantine-form:${name}:insert-list-item`,{path,index,item});const setDirty=value=>dispatchEvent(`mantine-form:${name}:set-dirty`,value);const setTouched=value=>dispatchEvent(`mantine-form:${name}:set-touched`,value);const resetDirty=values=>dispatchEvent(`mantine-form:${name}:reset-dirty`,values);const resetTouched=()=>dispatchEvent(`mantine-form:${name}:reset-touched`);return{setFieldValue,setValues,setInitialValues,setErrors,setFieldError,clearFieldError,clearErrors,reset,validate,validateField,reorderListItem,removeListItem,insertListItem,setDirty,setTouched,resetDirty,resetTouched}}function useFormEvent(eventKey,handler){useIsomorphicEffect(()=>{if(eventKey){window.addEventListener(eventKey,handler);return()=>window.removeEventListener(eventKey,handler)}},[eventKey])}function useFormActions(name,form){if(name)validateFormName(name);useFormEvent(`mantine-form:${name}:set-field-value`,event=>form.setFieldValue(event.detail.path,event.detail.value));useFormEvent(`mantine-form:${name}:set-values`,event=>form.setValues(event.detail));useFormEvent(`mantine-form:${name}:set-initial-values`,event=>form.setInitialValues(event.detail));useFormEvent(`mantine-form:${name}:set-errors`,event=>form.setErrors(event.detail));useFormEvent(`mantine-form:${name}:set-field-error`,event=>form.setFieldError(event.detail.path,event.detail.error));useFormEvent(`mantine-form:${name}:clear-field-error`,event=>form.clearFieldError(event.detail));useFormEvent(`mantine-form:${name}:clear-errors`,form.clearErrors);useFormEvent(`mantine-form:${name}:reset`,form.reset);useFormEvent(`mantine-form:${name}:validate`,form.validate);useFormEvent(`mantine-form:${name}:validate-field`,event=>form.validateField(event.detail));useFormEvent(`mantine-form:${name}:reorder-list-item`,event=>form.reorderListItem(event.detail.path,event.detail.payload));useFormEvent(`mantine-form:${name}:remove-list-item`,event=>form.removeListItem(event.detail.path,event.detail.index));useFormEvent(`mantine-form:${name}:insert-list-item`,event=>form.insertListItem(event.detail.path,event.detail.item,event.detail.index));useFormEvent(`mantine-form:${name}:set-dirty`,event=>form.setDirty(event.detail));useFormEvent(`mantine-form:${name}:set-touched`,event=>form.setTouched(event.detail));useFormEvent(`mantine-form:${name}:reset-dirty`,event=>form.resetDirty(event.detail));useFormEvent(`mantine-form:${name}:reset-touched`,form.resetTouched)}"use client";function getInputOnChange(setValue){return val=>{if(val)if("function"==typeof val)setValue(val);else if("object"==typeof val&&"nativeEvent"in val){const{currentTarget}=val;if(currentTarget instanceof HTMLInputElement)"checkbox"===currentTarget.type?setValue(currentTarget.checked):setValue(currentTarget.value);else if(currentTarget instanceof HTMLTextAreaElement||currentTarget instanceof HTMLSelectElement)setValue(currentTarget.value)}else setValue(val);else setValue(val)}}"use client";function filterErrors(errors){if(null===errors||"object"!=typeof errors)return{};return Object.keys(errors).reduce((acc,key)=>{const errorValue=errors[key];if(null!=errorValue&&false!==errorValue)acc[key]=errorValue;return acc},{})}"use client";function useFormErrors(initialErrors){const[errorsState,setErrorsState]=(0,consume_shared_module_default_react_strict_.useState)(filterErrors(initialErrors));const errorsRef=(0,consume_shared_module_default_react_strict_.useRef)(errorsState);const setErrors=(0,consume_shared_module_default_react_strict_.useCallback)(errors=>{setErrorsState(current=>{const newErrors=filterErrors("function"==typeof errors?errors(current):errors);errorsRef.current=newErrors;return newErrors})},[]);const clearErrors=(0,consume_shared_module_default_react_strict_.useCallback)(()=>setErrors({}),[]);const clearFieldError=(0,consume_shared_module_default_react_strict_.useCallback)(path=>{if(void 0===errorsRef.current[path])return;setErrors(current=>{const errors={...current};delete errors[path];return errors})},[errorsState]);const setFieldError=(0,consume_shared_module_default_react_strict_.useCallback)((path,error)=>{if(null==error||false===error)clearFieldError(path);else if(errorsRef.current[path]!==error)setErrors(current=>({...current,[path]:error}))},[errorsState]);return{errorsState,setErrors,clearErrors,setFieldError,clearFieldError}}"use client";function clearListState(field,state){if(null===state||"object"!=typeof state)return{};const clone={...state};Object.keys(state).forEach(errorKey=>{if(errorKey.includes(`${String(field)}.`))delete clone[errorKey]});return clone}"use client";function getIndexFromKeyAfterPath(key,path){const split=key.substring(path.length+1).split(".")[0];return parseInt(split,10)}function changeErrorIndices(path,index,errors,change){if(void 0===index)return errors;const pathString=`${String(path)}`;let clearedErrors=errors;if(-1===change)clearedErrors=clearListState(`${pathString}.${index}`,clearedErrors);const cloned={...clearedErrors};const changedKeys=/* @__PURE__ */new Set;Object.entries(clearedErrors).filter(([key])=>{if(!key.startsWith(`${pathString}.`))return false;const currIndex=getIndexFromKeyAfterPath(key,pathString);if(Number.isNaN(currIndex))return false;return currIndex>=index}).forEach(([key,value])=>{const currIndex=getIndexFromKeyAfterPath(key,pathString);const newKey=key.replace(`${pathString}.${currIndex}`,`${pathString}.${currIndex+change}`);cloned[newKey]=value;changedKeys.add(newKey);if(!changedKeys.has(key))delete cloned[key]});return cloned}"use client";function reorderErrors(path,{from,to},errors){const oldKeyStart=`${path}.${from}`;const newKeyStart=`${path}.${to}`;const clone={...errors};const processedKeys=/* @__PURE__ */new Set;Object.keys(errors).forEach(key=>{if(processedKeys.has(key))return;let oldKey;let newKey;if(key.startsWith(oldKeyStart)){oldKey=key;newKey=key.replace(oldKeyStart,newKeyStart)}else if(key.startsWith(newKeyStart)){oldKey=key.replace(newKeyStart,oldKeyStart);newKey=key}if(oldKey&&newKey){const value1=clone[oldKey];const value2=clone[newKey];void 0===value2?delete clone[oldKey]:clone[oldKey]=value2;void 0===value1?delete clone[newKey]:clone[newKey]=value1;processedKeys.add(oldKey);processedKeys.add(newKey)}});return clone}"use client";function getSplittedPath(path){if("string"!=typeof path)return[];return path.split(".")}"use client";function getPath(path,values){const splittedPath=getSplittedPath(path);if(0===splittedPath.length||"object"!=typeof values||null===values)return;let value=values[splittedPath[0]];for(let i=1;i<splittedPath.length;i+=1){if(null==value)break;value=value[splittedPath[i]]}return value}function set(obj,key,val){if("object"==typeof val.value)val.value=klona(val.value);if(val.enumerable&&!val.get&&!val.set&&val.configurable&&val.writable&&"__proto__"!==key)obj[key]=val.value;else Object.defineProperty(obj,key,val)}function klona(x){if("object"!=typeof x)return x;var i=0,k,list,tmp,str=Object.prototype.toString.call(x);if("[object Object]"===str)tmp=Object.create(x.__proto__||null);else if("[object Array]"===str)tmp=Array(x.length);else if("[object Set]"===str){tmp=new Set;x.forEach(function(val){tmp.add(klona(val))})}else if("[object Map]"===str){tmp=new Map;x.forEach(function(val,key){tmp.set(klona(key),klona(val))})}else if("[object Date]"===str)tmp=new Date(+x);else if("[object RegExp]"===str)tmp=new RegExp(x.source,x.flags);else if("[object DataView]"===str)tmp=new x.constructor(klona(x.buffer));else if("[object ArrayBuffer]"===str)tmp=x.slice(0);else if("Array]"===str.slice(-6))tmp=new x.constructor(x);if(tmp){for(list=Object.getOwnPropertySymbols(x);i<list.length;i++)set(tmp,list[i],Object.getOwnPropertyDescriptor(x,list[i]));for(i=0,list=Object.getOwnPropertyNames(x);i<list.length;i++)if(!Object.hasOwnProperty.call(tmp,k=list[i])||tmp[k]!==x[k])set(tmp,k,Object.getOwnPropertyDescriptor(x,k))}return tmp||x}"use client";function setPath(path,value,values){const splittedPath=getSplittedPath(path);if(0===splittedPath.length)return values;const cloned=klona(values);if(1===splittedPath.length){cloned[splittedPath[0]]=value;return cloned}let val=cloned[splittedPath[0]];for(let i=1;i<splittedPath.length-1;i+=1){if(void 0===val)return cloned;val=val[splittedPath[i]]}val[splittedPath[splittedPath.length-1]]=value;return cloned}"use client";function reorderPath(path,{from,to},values){const currentValue=getPath(path,values);if(!Array.isArray(currentValue))return values;const cloned=[...currentValue];const item=currentValue[from];cloned.splice(from,1);cloned.splice(to,0,item);return setPath(path,cloned,values)}"use client";function insertPath(path,value,index,values){const currentValue=getPath(path,values);if(!Array.isArray(currentValue))return values;const cloned=[...currentValue];cloned.splice("number"==typeof index?index:cloned.length,0,value);return setPath(path,cloned,values)}"use client";function removePath(path,index,values){const currentValue=getPath(path,values);if(!Array.isArray(currentValue))return values;return setPath(path,currentValue.filter((_,itemIndex)=>itemIndex!==index),values)}"use client";function replacePath(path,item,index,values){const currentValue=getPath(path,values);if(!Array.isArray(currentValue))return values;if(currentValue.length<=index)return values;const cloned=[...currentValue];cloned[index]=item;return setPath(path,cloned,values)}"use client";function useFormList({$values,$errors,$status}){const reorderListItem=(0,consume_shared_module_default_react_strict_.useCallback)((path,payload)=>{$status.clearFieldDirty(path);$errors.setErrors(errs=>reorderErrors(path,payload,errs));$values.setValues({values:reorderPath(path,payload,$values.refValues.current),updateState:true})},[]);const removeListItem=(0,consume_shared_module_default_react_strict_.useCallback)((path,index)=>{$status.clearFieldDirty(path);$errors.setErrors(errs=>changeErrorIndices(path,index,errs,-1));$values.setValues({values:removePath(path,index,$values.refValues.current),updateState:true})},[]);const insertListItem=(0,consume_shared_module_default_react_strict_.useCallback)((path,item,index)=>{$status.clearFieldDirty(path);$errors.setErrors(errs=>changeErrorIndices(path,index,errs,1));$values.setValues({values:insertPath(path,item,index,$values.refValues.current),updateState:true})},[]);const replaceListItem=(0,consume_shared_module_default_react_strict_.useCallback)((path,index,item)=>{$status.clearFieldDirty(path);$values.setValues({values:replacePath(path,item,index,$values.refValues.current),updateState:true})},[]);return{reorderListItem,removeListItem,insertListItem,replaceListItem}}var fast_deep_equal=__webpack_require__(4063);"use client";function getStatus(status,path){const paths=Object.keys(status);if("string"==typeof path){const nestedPaths=paths.filter(statusPath=>statusPath.startsWith(`${path}.`));return status[path]||nestedPaths.some(statusPath=>status[statusPath])||false}return paths.some(statusPath=>status[statusPath])}"use client";function useFormStatus({initialDirty,initialTouched,mode,$values}){const[touchedState,setTouchedState]=(0,consume_shared_module_default_react_strict_.useState)(initialTouched);const[dirtyState,setDirtyState]=(0,consume_shared_module_default_react_strict_.useState)(initialDirty);const touchedRef=(0,consume_shared_module_default_react_strict_.useRef)(initialTouched);const dirtyRef=(0,consume_shared_module_default_react_strict_.useRef)(initialDirty);const setTouched=(0,consume_shared_module_default_react_strict_.useCallback)(values=>{const resolvedValues="function"==typeof values?values(touchedRef.current):values;touchedRef.current=resolvedValues;if("controlled"===mode)setTouchedState(resolvedValues)},[]);const setDirty=(0,consume_shared_module_default_react_strict_.useCallback)((values,forceUpdate=false)=>{const resolvedValues="function"==typeof values?values(dirtyRef.current):values;dirtyRef.current=resolvedValues;if("controlled"===mode||forceUpdate)setDirtyState(resolvedValues)},[]);const resetTouched=(0,consume_shared_module_default_react_strict_.useCallback)(()=>setTouched({}),[]);const resetDirty=(0,consume_shared_module_default_react_strict_.useCallback)(values=>{const newSnapshot=values?{...$values.refValues.current,...values}:$values.refValues.current;$values.setValuesSnapshot(newSnapshot);setDirty({})},[]);const setFieldTouched=(0,consume_shared_module_default_react_strict_.useCallback)((path,touched)=>{setTouched(currentTouched=>{if(getStatus(currentTouched,path)===touched)return currentTouched;return{...currentTouched,[path]:touched}})},[]);const setFieldDirty=(0,consume_shared_module_default_react_strict_.useCallback)((path,dirty,forceUpdate)=>{setDirty(currentDirty=>{if(getStatus(currentDirty,path)===dirty)return currentDirty;return{...currentDirty,[path]:dirty}},forceUpdate)},[]);const setCalculatedFieldDirty=(0,consume_shared_module_default_react_strict_.useCallback)((path,value)=>{const currentDirty=getStatus(dirtyRef.current,path);const dirty=!fast_deep_equal(getPath(path,$values.getValuesSnapshot()),value);const clearedState=clearListState(path,dirtyRef.current);clearedState[path]=dirty;setDirty(clearedState,currentDirty!==dirty)},[]);const isTouched=(0,consume_shared_module_default_react_strict_.useCallback)(path=>getStatus(touchedRef.current,path),[]);const clearFieldDirty=(0,consume_shared_module_default_react_strict_.useCallback)(path=>setDirty(current=>{if("string"!=typeof path)return current;const result=clearListState(path,current);delete result[path];if(fast_deep_equal(result,current))return current;return result}),[]);const isDirty=(0,consume_shared_module_default_react_strict_.useCallback)(path=>{if(path){const overriddenValue=getPath(path,dirtyRef.current);if("boolean"==typeof overriddenValue)return overriddenValue;const sliceOfValues=getPath(path,$values.refValues.current);const sliceOfInitialValues=getPath(path,$values.valuesSnapshot.current);return!fast_deep_equal(sliceOfValues,sliceOfInitialValues)}const isOverridden=Object.keys(dirtyRef.current).length>0;if(isOverridden)return getStatus(dirtyRef.current);return!fast_deep_equal($values.refValues.current,$values.valuesSnapshot.current)},[]);const getDirty=(0,consume_shared_module_default_react_strict_.useCallback)(()=>dirtyRef.current,[]);const getTouched=(0,consume_shared_module_default_react_strict_.useCallback)(()=>touchedRef.current,[]);return{touchedState,dirtyState,touchedRef,dirtyRef,setTouched,setDirty,resetDirty,resetTouched,isTouched,setFieldTouched,setFieldDirty,setTouchedState,setDirtyState,clearFieldDirty,isDirty,getDirty,getTouched,setCalculatedFieldDirty}}"use client";function useFormValues({initialValues,onValuesChange,mode}){const initialized=(0,consume_shared_module_default_react_strict_.useRef)(false);const[stateValues,setStateValues]=(0,consume_shared_module_default_react_strict_.useState)(initialValues||{});const refValues=(0,consume_shared_module_default_react_strict_.useRef)(stateValues);const valuesSnapshot=(0,consume_shared_module_default_react_strict_.useRef)(stateValues);const setValues=(0,consume_shared_module_default_react_strict_.useCallback)(({values,subscribers,updateState=true,mergeWithPreviousValues=true})=>{const previousValues=refValues.current;const resolvedValues=values instanceof Function?values(refValues.current):values;const updatedValues=mergeWithPreviousValues?{...previousValues,...resolvedValues}:resolvedValues;refValues.current=updatedValues;if(updateState){setStateValues(updatedValues);if("uncontrolled"===mode)refValues.current=updatedValues}onValuesChange?.(updatedValues,previousValues);subscribers?.filter(Boolean).forEach(subscriber=>subscriber({updatedValues,previousValues}))},[onValuesChange]);const setFieldValue=(0,consume_shared_module_default_react_strict_.useCallback)(payload=>{const currentValue=getPath(payload.path,refValues.current);const updatedValue=payload.value instanceof Function?payload.value(currentValue):payload.value;if(currentValue!==updatedValue){const previousValues=refValues.current;const updatedValues=setPath(payload.path,updatedValue,refValues.current);setValues({values:updatedValues,updateState:payload.updateState});payload.subscribers?.filter(Boolean).forEach(subscriber=>subscriber({path:payload.path,updatedValues,previousValues}))}},[setValues]);const setValuesSnapshot=(0,consume_shared_module_default_react_strict_.useCallback)(payload=>{valuesSnapshot.current=payload},[]);const initialize=(0,consume_shared_module_default_react_strict_.useCallback)((values,onInitialize)=>{if(!initialized.current){initialized.current=true;setValues({values,updateState:"controlled"===mode});setValuesSnapshot(values);onInitialize()}},[setValues]);const resetValues=(0,consume_shared_module_default_react_strict_.useCallback)(()=>{setValues({values:valuesSnapshot.current,updateState:true,mergeWithPreviousValues:false})},[setValues]);const getValues=(0,consume_shared_module_default_react_strict_.useCallback)(()=>refValues.current,[]);const getValuesSnapshot=(0,consume_shared_module_default_react_strict_.useCallback)(()=>valuesSnapshot.current,[]);const resetField=(0,consume_shared_module_default_react_strict_.useCallback)((path,subscribers)=>{const snapshotValue=getPath(path,valuesSnapshot.current);if(void 0===snapshotValue)return;setFieldValue({path,value:snapshotValue,updateState:"controlled"===mode,subscribers})},[setFieldValue,mode]);return{initialized,stateValues,refValues,valuesSnapshot,setValues,setFieldValue,resetValues,setValuesSnapshot,initialize,getValues,getValuesSnapshot,resetField}}"use client";function useFormWatch({$status,cascadeUpdates}){const subscribers=(0,consume_shared_module_default_react_strict_.useRef)({});const watch=(0,consume_shared_module_default_react_strict_.useCallback)((path,callback)=>{(0,consume_shared_module_default_react_strict_.useEffect)(()=>{subscribers.current[path]=subscribers.current[path]||[];subscribers.current[path].push(callback);return()=>{subscribers.current[path]=subscribers.current[path].filter(cb=>cb!==callback)}},[callback])},[]);const getFieldSubscribers=(0,consume_shared_module_default_react_strict_.useCallback)(path=>{const result=subscribers.current[path]?.map(callback=>input=>callback({previousValue:getPath(path,input.previousValues),value:getPath(path,input.updatedValues),touched:$status.isTouched(path),dirty:$status.isDirty(path)}))??[];if(cascadeUpdates){for(const subscriptionKey in subscribers.current)if(subscriptionKey.startsWith(`${path}.`)||path.startsWith(`${subscriptionKey}.`))result.push(...subscribers.current[subscriptionKey].map(cb=>input=>cb({previousValue:getPath(subscriptionKey,input.previousValues),value:getPath(subscriptionKey,input.updatedValues),touched:$status.isTouched(subscriptionKey),dirty:$status.isDirty(subscriptionKey)})))}return result},[]);return{subscribers,watch,getFieldSubscribers}}"use client";function getDataPath(formName,fieldPath){return formName?`${formName}-${fieldPath.toString()}`:fieldPath.toString()}"use client";const formRootRule=Symbol("root-rule");function getValidationResults(errors){const filteredErrors=filterErrors(errors);return{hasErrors:Object.keys(filteredErrors).length>0,errors:filteredErrors}}function validateRulesRecord(rules,values,path="",errors={}){if("object"!=typeof rules||null===rules)return errors;return Object.keys(rules).reduce((acc,ruleKey)=>{const rule=rules[ruleKey];const rulePath=`${""===path?"":`${path}.`}${ruleKey}`;const value=getPath(rulePath,values);let arrayValidation=false;if("function"==typeof rule)acc[rulePath]=rule(value,values,rulePath);if("object"==typeof rule&&Array.isArray(value)){arrayValidation=true;value.forEach((_item,index)=>validateRulesRecord(rule,values,`${rulePath}.${index}`,acc));if(formRootRule in rule)acc[rulePath]=rule[formRootRule](value,values,rulePath)}if("object"==typeof rule&&"object"==typeof value&&null!==value){if(!arrayValidation)validateRulesRecord(rule,values,rulePath,acc);if(formRootRule in rule)acc[rulePath]=rule[formRootRule](value,values,rulePath)}return acc},errors)}function validateValues(validate,values){if("function"==typeof validate)return getValidationResults(validate(values));return getValidationResults(validateRulesRecord(validate,values))}"use client";function validateFieldValue(path,rules,values){if("string"!=typeof path)return{hasError:false,error:null};const results=validateValues(rules,values);const pathInError=Object.keys(results.errors).find(errorKey=>path.split(".").every((pathPart,i)=>pathPart===errorKey.split(".")[i]));return{hasError:!!pathInError,error:pathInError?results.errors[pathInError]:null}}"use client";const FORM_INDEX="__MANTINE_FORM_INDEX__";"use client";function shouldValidateOnChange(path,validateInputOnChange){if(!validateInputOnChange)return false;if("boolean"==typeof validateInputOnChange)return validateInputOnChange;if(Array.isArray(validateInputOnChange))return validateInputOnChange.includes(path.replace(/[.][0-9]+/g,`.${FORM_INDEX}`));return false}"use client";function useForm({name,mode="controlled",initialValues,initialErrors={},initialDirty={},initialTouched={},clearInputErrorOnChange=true,validateInputOnChange=false,validateInputOnBlur=false,onValuesChange,transformValues=values=>values,enhanceGetInputProps,validate:rules,onSubmitPreventDefault="always",touchTrigger="change",cascadeUpdates=false}={}){const $errors=useFormErrors(initialErrors);const $values=useFormValues({initialValues,onValuesChange,mode});const $status=useFormStatus({initialDirty,initialTouched,$values,mode});const $list=useFormList({$values,$errors,$status});const $watch=useFormWatch({$status,cascadeUpdates});const[formKey,setFormKey]=(0,consume_shared_module_default_react_strict_.useState)(0);const[fieldKeys,setFieldKeys]=(0,consume_shared_module_default_react_strict_.useState)({});const[submitting,setSubmitting]=(0,consume_shared_module_default_react_strict_.useState)(false);const reset=(0,consume_shared_module_default_react_strict_.useCallback)(()=>{$values.resetValues();$errors.clearErrors();$status.resetDirty();$status.resetTouched();"uncontrolled"===mode&&setFormKey(key2=>key2+1)},[]);const handleValuesChanges=(0,consume_shared_module_default_react_strict_.useCallback)(previousValues=>{clearInputErrorOnChange&&$errors.clearErrors();"uncontrolled"===mode&&setFormKey(key2=>key2+1);Object.keys($watch.subscribers.current).forEach(path=>{const value=getPath(path,$values.refValues.current);const previousValue=getPath(path,previousValues);if(value!==previousValue)$watch.getFieldSubscribers(path).forEach(cb=>cb({previousValues,updatedValues:$values.refValues.current}))})},[clearInputErrorOnChange]);const initialize=(0,consume_shared_module_default_react_strict_.useCallback)(values=>{const previousValues=$values.refValues.current;$values.initialize(values,()=>"uncontrolled"===mode&&setFormKey(key2=>key2+1));handleValuesChanges(previousValues)},[handleValuesChanges]);const setFieldValue=(0,consume_shared_module_default_react_strict_.useCallback)((path,value,options)=>{const shouldValidate=shouldValidateOnChange(path,validateInputOnChange);const resolvedValue=value instanceof Function?value(getPath(path,$values.refValues.current)):value;$status.setCalculatedFieldDirty(path,resolvedValue);"change"===touchTrigger&&$status.setFieldTouched(path,true);!shouldValidate&&clearInputErrorOnChange&&$errors.clearFieldError(path);$values.setFieldValue({path,value,updateState:"controlled"===mode,subscribers:[...$watch.getFieldSubscribers(path),shouldValidate?payload=>{const validationResults=validateFieldValue(path,rules,payload.updatedValues);validationResults.hasError?$errors.setFieldError(path,validationResults.error):$errors.clearFieldError(path)}:null,options?.forceUpdate!==false&&"controlled"!==mode?()=>setFieldKeys(keys=>({...keys,[path]:(keys[path]||0)+1})):null]})},[onValuesChange,rules]);const setValues=(0,consume_shared_module_default_react_strict_.useCallback)(values=>{const previousValues=$values.refValues.current;$values.setValues({values,updateState:"controlled"===mode});handleValuesChanges(previousValues)},[onValuesChange,handleValuesChanges]);const validate=(0,consume_shared_module_default_react_strict_.useCallback)(()=>{const results=validateValues(rules,$values.refValues.current);$errors.setErrors(results.errors);return results},[rules]);const validateField=(0,consume_shared_module_default_react_strict_.useCallback)(path=>{const results=validateFieldValue(path,rules,$values.refValues.current);results.hasError?$errors.setFieldError(path,results.error):$errors.clearFieldError(path);return results},[rules]);const getInputProps=(path,{type="input",withError=true,withFocus=true,...otherOptions}={})=>{const onChange=getInputOnChange(value=>setFieldValue(path,value,{forceUpdate:false}));const payload={onChange,"data-path":getDataPath(name,path)};if(withError)payload.error=$errors.errorsState[path];if("checkbox"===type)payload["controlled"===mode?"checked":"defaultChecked"]=getPath(path,$values.refValues.current);else payload["controlled"===mode?"value":"defaultValue"]=getPath(path,$values.refValues.current);if(withFocus){payload.onFocus=()=>$status.setFieldTouched(path,true);payload.onBlur=()=>{if(shouldValidateOnChange(path,validateInputOnBlur)){const validationResults=validateFieldValue(path,rules,$values.refValues.current);validationResults.hasError?$errors.setFieldError(path,validationResults.error):$errors.clearFieldError(path)}}}return Object.assign(payload,enhanceGetInputProps?.({inputProps:payload,field:path,options:{type,withError,withFocus,...otherOptions},form}))};const onSubmit=(handleSubmit,handleValidationFailure)=>event=>{if("always"===onSubmitPreventDefault)event?.preventDefault();const results=validate();if(results.hasErrors){if("validation-failed"===onSubmitPreventDefault)event?.preventDefault();handleValidationFailure?.(results.errors,$values.refValues.current,event)}else{const submitResult=handleSubmit?.(transformValues($values.refValues.current),event);if(submitResult instanceof Promise){setSubmitting(true);submitResult.finally(()=>setSubmitting(false))}}};const getTransformedValues=input=>transformValues(input||$values.refValues.current);const onReset=(0,consume_shared_module_default_react_strict_.useCallback)(event=>{event.preventDefault();reset()},[]);const isValid=(0,consume_shared_module_default_react_strict_.useCallback)(path=>path?!validateFieldValue(path,rules,$values.refValues.current).hasError:!validateValues(rules,$values.refValues.current).hasErrors,[rules]);const key=path=>`${formKey}-${String(path)}-${fieldKeys[String(path)]||0}`;const getInputNode=(0,consume_shared_module_default_react_strict_.useCallback)(path=>document.querySelector(`[data-path="${getDataPath(name,path)}"]`),[]);const resetField=(0,consume_shared_module_default_react_strict_.useCallback)(path=>{$values.resetField(path,["controlled"!==mode?()=>setFieldKeys(keys=>({...keys,[path]:(keys[path]||0)+1})):null])},[$values.resetField,mode,setFieldKeys]);const form={watch:$watch.watch,initialized:$values.initialized.current,values:"uncontrolled"===mode?$values.refValues.current:$values.stateValues,getValues:$values.getValues,getInitialValues:$values.getValuesSnapshot,setInitialValues:$values.setValuesSnapshot,resetField,initialize,setValues,setFieldValue,submitting,setSubmitting,errors:$errors.errorsState,setErrors:$errors.setErrors,setFieldError:$errors.setFieldError,clearFieldError:$errors.clearFieldError,clearErrors:$errors.clearErrors,resetDirty:$status.resetDirty,setTouched:$status.setTouched,setDirty:$status.setDirty,isTouched:$status.isTouched,resetTouched:$status.resetTouched,isDirty:$status.isDirty,getTouched:$status.getTouched,getDirty:$status.getDirty,reorderListItem:$list.reorderListItem,insertListItem:$list.insertListItem,removeListItem:$list.removeListItem,replaceListItem:$list.replaceListItem,reset,validate,validateField,getInputProps,onSubmit,onReset,isValid,getTransformedValues,key,getInputNode};useFormActions(name,form);return form}var jsx_runtime=__webpack_require__(5893);"use client";function createFormContext(){const FormContext=(0,consume_shared_module_default_react_strict_.createContext)(null);function FormProvider({form,children}){return/* @__PURE__ */(0,jsx_runtime.jsx)(FormContext.Provider,{value:form,children})}function useFormContext(){const ctx=(0,consume_shared_module_default_react_strict_.useContext)(FormContext);if(!ctx)throw new Error("useFormContext was called outside of FormProvider context");return ctx}return[FormProvider,useFormContext,useForm]}"use client";const Form=(0,consume_shared_module_default_react_strict_.forwardRef)(({form,onSubmit,onReset,...others},ref)=>/* @__PURE__ */(0,jsx_runtime.jsx)("form",{...others,onSubmit:form.onSubmit("function"==typeof onSubmit?onSubmit:()=>{}),onReset:event=>{onReset?.(event);form.onReset(event)},ref}));Form.displayName="@mantine/use-form/Form";"use client";function isNotEmpty(error){const _error=error||true;return value=>{if("string"==typeof value)return value.trim().length>0?null:_error;if(Array.isArray(value))return value.length>0?null:_error;if(null==value)return _error;if(false===value)return _error;return null}}"use client";function matches(regexp,error){const _error=error||true;return value=>{if("string"!=typeof value)return _error;return regexp.test(value)?null:_error}}"use client";function isEmail(error){return matches(/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,error)}"use client";function isLengthValid(payload,value){if("number"==typeof payload)return value.length===payload;const{max,min}=payload;let valid=true;if("number"==typeof max&&value.length>max)valid=false;if("number"==typeof min&&value.length<min)valid=false;return valid}function hasLength(payload,error){const _error=error||true;return value=>{if("string"==typeof value)return isLengthValid(payload,value.trim())?null:_error;if("object"==typeof value&&null!==value&&"length"in value)return isLengthValid(payload,value)?null:_error;return _error}}"use client";function isInRange({min,max},error){const _error=error||true;return value=>{if("number"!=typeof value)return _error;let valid=true;if("number"==typeof min&&value<min)valid=false;if("number"==typeof max&&value>max)valid=false;return valid?null:_error}}"use client";function matchesField(field,error){const _error=error||true;return(value,values)=>{if(!values||!(field in values))return _error;return value===values[field]?null:_error}}"use client";function removeHtmlTags(input){return input.replace(/<\/?[^>]+(>|$)/g,"")}function isNotEmptyHTML(error){const _error=error||true;return value=>{if("string"==typeof value)return removeHtmlTags(value).trim().length>0?null:_error;return _error}}"use client";function isJSONString(error){const _error=error||true;return value=>{if("string"==typeof value)try{JSON.parse(value);return null}catch(e){}return _error}}"use client";function useField({mode="controlled",clearErrorOnChange=true,initialValue,initialError=null,initialTouched=false,onValueChange,validateOnChange=false,validateOnBlur=false,validate,resolveValidationError,type="input"}){const[valueState,setValueState]=(0,consume_shared_module_default_react_strict_.useState)(initialValue);const valueRef=(0,consume_shared_module_default_react_strict_.useRef)(valueState);const[key,setKey]=(0,consume_shared_module_default_react_strict_.useState)(0);const[error,setError]=(0,consume_shared_module_default_react_strict_.useState)(initialError||null);const touchedRef=(0,consume_shared_module_default_react_strict_.useRef)(initialTouched||false);const[,setTouchedState]=(0,consume_shared_module_default_react_strict_.useState)(touchedRef.current);const[isValidating,setIsValidating]=(0,consume_shared_module_default_react_strict_.useState)(false);const errorResolver=(0,consume_shared_module_default_react_strict_.useMemo)(()=>resolveValidationError||(err=>err),[resolveValidationError]);const setTouched=(0,consume_shared_module_default_react_strict_.useCallback)((val,{updateState="controlled"===mode}={})=>{touchedRef.current=val;updateState&&setTouchedState(val)},[]);const setValue=(0,consume_shared_module_default_react_strict_.useCallback)((value,{updateKey="uncontrolled"===mode,updateState="controlled"===mode}={})=>{if(valueRef.current===value)return;valueRef.current=value;onValueChange?.(value);if(clearErrorOnChange&&null!==error)setError(null);if(updateState)setValueState(value);if(updateKey)setKey(currentKey=>currentKey+1);if(validateOnChange)_validate()},[error,clearErrorOnChange,onValueChange]);const reset=(0,consume_shared_module_default_react_strict_.useCallback)(()=>{setValue(initialValue);setError(null);setTouched(false)},[initialValue]);const getValue=(0,consume_shared_module_default_react_strict_.useCallback)(()=>valueRef.current,[]);const isTouched=(0,consume_shared_module_default_react_strict_.useCallback)(()=>touchedRef.current,[]);const isDirty=(0,consume_shared_module_default_react_strict_.useCallback)(()=>valueRef.current!==initialValue,[initialValue]);const _validate=(0,consume_shared_module_default_react_strict_.useCallback)(async()=>{const validationResult=validate?.(valueRef.current);if(validationResult instanceof Promise){setIsValidating(true);try{const result=await validationResult;setIsValidating(false);setError(result)}catch(err){setIsValidating(false);const resolvedError=errorResolver(err);setError(resolvedError);return resolvedError}}else{setError(validationResult);return validationResult}},[]);const getInputProps=({withError=true,withFocus=true}={})=>{const onChange=getInputOnChange(val=>setValue(val,{updateKey:false}));const payload={onChange};if(withError)payload.error=error;if("checkbox"===type)payload["controlled"===mode?"checked":"defaultChecked"]=valueRef.current;else payload["controlled"===mode?"value":"defaultValue"]=valueRef.current;if(withFocus){payload.onFocus=()=>{setTouched(true)};payload.onBlur=()=>{if(shouldValidateOnChange("",!!validateOnBlur))_validate()}}return payload};const resetTouched=(0,consume_shared_module_default_react_strict_.useCallback)(()=>setTouched(false),[]);return{key,getValue,setValue,reset,getInputProps,isValidating,validate:_validate,error,setError,isTouched,isDirty,resetTouched}}"use client";function zodResolver(schema){return values=>{const parsed=schema.safeParse(values);if(parsed.success)return{};const results={};parsed.error.errors.forEach(error=>{results[error.path.join(".")]=error.message});return results}}"use client";function superstructResolver(schema){function structValidation(values){const formErrors={};const[err]=schema.validate(values);if(!err)return formErrors;err.failures().forEach(fieldFailure=>{const fieldName=fieldFailure.path.join(" ");formErrors[fieldFailure.path.join(".")]=`${fieldName}: ${fieldFailure.message}`});return formErrors}return structValidation}"use client";function yupResolver(schema){const _schema=schema;return values=>{try{_schema.validateSync(values,{abortEarly:false});return{}}catch(_yupError){const yupError=_yupError;const results={};yupError.inner.forEach(error=>{results[error.path.replaceAll("[",".").replaceAll("]","")]=error.message});return results}}}"use client";function joiResolver(schema,options){const _schema=schema;return values=>{const parsed=_schema.validate(values,{abortEarly:false,...options});if(!parsed.error)return{};const results={};parsed.error.details.forEach(error=>{results[error.path.join(".")]=error.message});return results}}}}]);