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AoB,YAAa8M,GAC1CjN,SAASG,oBAAoB,OAAQ+M,GAErCT,EAAgBtM,oBAAoB,WAAYgN,GAChDV,EAAgBtM,oBAAoB,YAAaiN,GACjDX,EAAgBtM,oBAAoB,OAAQkN,GAE5Cb,EAAqBC,GAErBN,EAAajO,QAAU,EACvBkO,EAAclO,SAAU,GA3BxBsO,KA6BD,CAAClK,IAEG,CACL4J,cACAoB,0B","sources":["webpack://@react-hive/honey-hooks/./node_modules/.pnpm/lodash.throttle@4.1.1/node_modules/lodash.throttle/index.js","webpack://@react-hive/honey-hooks/webpack/bootstrap","webpack://@react-hive/honey-hooks/webpack/runtime/compat get default export","webpack://@react-hive/honey-hooks/webpack/runtime/define property getters","webpack://@react-hive/honey-hooks/webpack/runtime/global","webpack://@react-hive/honey-hooks/webpack/runtime/hasOwnProperty shorthand","webpack://@react-hive/honey-hooks/./src/use-honey-latest.ts","webpack://@react-hive/honey-hooks/./node_modules/.pnpm/@react-hive+honey-utils@3.31.0/node_modules/@react-hive/honey-utils/dist/index.mjs","webpack://@react-hive/honey-hooks/./src/use-honey-raf-loop.ts","webpack://@react-hive/honey-hooks/./src/use-honey-decay.ts","webpack://@react-hive/honey-hooks/./src/use-honey-document-key-up.ts","webpack://@react-hive/honey-hooks/./src/use-honey-drag.ts","webpack://@react-hive/honey-hooks/./src/use-honey-on-change.ts","webpack://@react-hive/honey-hooks/./src/use-honey-resize.ts","webpack://@react-hive/honey-hooks/./src/utils/resolve-axis-translate.ts","webpack://@react-hive/honey-hooks/./src/utils/apply-scroll-delta.ts","webpack://@react-hive/honey-hooks/./src/use-honey-synthetic-scroll.ts","webpack://@react-hive/honey-hooks/./src/use-honey-synthetic-scroll-x.ts","webpack://@react-hive/honey-hooks/./src/use-honey-synthetic-scroll-y.ts","webpack://@react-hive/honey-hooks/./src/use-honey-timer.ts","webpack://@react-hive/honey-hooks/./src/use-honey-pending-targets.ts","webpack://@react-hive/honey-hooks/./src/use-honey-object-url.ts","webpack://@react-hive/honey-hooks/./src/use-honey-force-rerender.ts","webpack://@react-hive/honey-hooks/./src/utils/prevent-default-event.ts","webpack://@react-hive/honey-hooks/./src/use-honey-drag-and-drop.ts"],"sourcesContent":["/**\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n    nativeMin = Math.min;\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n *   console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n  return root.Date.now();\n};\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n *  Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n *  The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n *  Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n *   'leading': true,\n *   'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n  var lastArgs,\n      lastThis,\n      maxWait,\n      result,\n      timerId,\n      lastCallTime,\n      lastInvokeTime = 0,\n      leading = false,\n      maxing = false,\n      trailing = true;\n\n  if (typeof func != 'function') {\n    throw new TypeError(FUNC_ERROR_TEXT);\n  }\n  wait = toNumber(wait) || 0;\n  if (isObject(options)) {\n    leading = !!options.leading;\n    maxing = 'maxWait' in options;\n    maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n    trailing = 'trailing' in options ? !!options.trailing : trailing;\n  }\n\n  function invokeFunc(time) {\n    var args = lastArgs,\n        thisArg = lastThis;\n\n    lastArgs = lastThis = undefined;\n    lastInvokeTime = time;\n    result = func.apply(thisArg, args);\n    return result;\n  }\n\n  function leadingEdge(time) {\n    // Reset any `maxWait` timer.\n    lastInvokeTime = time;\n    // Start the timer for the trailing edge.\n    timerId = setTimeout(timerExpired, wait);\n    // Invoke the leading edge.\n    return leading ? invokeFunc(time) : result;\n  }\n\n  function remainingWait(time) {\n    var timeSinceLastCall = time - lastCallTime,\n        timeSinceLastInvoke = time - lastInvokeTime,\n        result = wait - timeSinceLastCall;\n\n    return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;\n  }\n\n  function shouldInvoke(time) {\n    var timeSinceLastCall = time - lastCallTime,\n        timeSinceLastInvoke = time - lastInvokeTime;\n\n    // Either this is the first call, activity has stopped and we're at the\n    // trailing edge, the system time has gone backwards and we're treating\n    // it as the trailing edge, or we've hit the `maxWait` limit.\n    return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n      (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n  }\n\n  function timerExpired() {\n    var time = now();\n    if (shouldInvoke(time)) {\n      return trailingEdge(time);\n    }\n    // Restart the timer.\n    timerId = setTimeout(timerExpired, remainingWait(time));\n  }\n\n  function trailingEdge(time) {\n    timerId = undefined;\n\n    // Only invoke if we have `lastArgs` which means `func` has been\n    // debounced at least once.\n    if (trailing && lastArgs) {\n      return invokeFunc(time);\n    }\n    lastArgs = lastThis = undefined;\n    return result;\n  }\n\n  function cancel() {\n    if (timerId !== undefined) {\n      clearTimeout(timerId);\n    }\n    lastInvokeTime = 0;\n    lastArgs = lastCallTime = lastThis = timerId = undefined;\n  }\n\n  function flush() {\n    return timerId === undefined ? result : trailingEdge(now());\n  }\n\n  function debounced() {\n    var time = now(),\n        isInvoking = shouldInvoke(time);\n\n    lastArgs = arguments;\n    lastThis = this;\n    lastCallTime = time;\n\n    if (isInvoking) {\n      if (timerId === undefined) {\n        return leadingEdge(lastCallTime);\n      }\n      if (maxing) {\n        // Handle invocations in a tight loop.\n        timerId = setTimeout(timerExpired, wait);\n        return invokeFunc(lastCallTime);\n      }\n    }\n    if (timerId === undefined) {\n      timerId = setTimeout(timerExpired, wait);\n    }\n    return result;\n  }\n  debounced.cancel = cancel;\n  debounced.flush = flush;\n  return debounced;\n}\n\n/**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n *  Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n *  Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\nfunction throttle(func, wait, options) {\n  var leading = true,\n      trailing = true;\n\n  if (typeof func != 'function') {\n    throw new TypeError(FUNC_ERROR_TEXT);\n  }\n  if (isObject(options)) {\n    leading = 'leading' in options ? !!options.leading : leading;\n    trailing = 'trailing' in options ? !!options.trailing : trailing;\n  }\n  return debounce(func, wait, {\n    'leading': leading,\n    'maxWait': wait,\n    'trailing': trailing\n  });\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n  var type = typeof value;\n  return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n  return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n  return typeof value == 'symbol' ||\n    (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n  if (typeof value == 'number') {\n    return value;\n  }\n  if (isSymbol(value)) {\n    return NAN;\n  }\n  if (isObject(value)) {\n    var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n    value = isObject(other) ? (other + '') : other;\n  }\n  if (typeof value != 'string') {\n    return value === 0 ? value : +value;\n  }\n  value = value.replace(reTrim, '');\n  var isBinary = reIsBinary.test(value);\n  return (isBinary || reIsOctal.test(value))\n    ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n    : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = throttle;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","import type { RefObject } from 'react';\nimport { useRef } from 'react';\n\ntype UseHoneyLatest = {\n  <T>(value: T): RefObject<T>;\n  <T>(value: T | undefined): RefObject<T | undefined>;\n};\n\n/**\n * Stores the latest value in a stable ref.\n *\n * Guarantees that:\n * - `ref.current` always points to the latest value\n * - the ref object identity never changes\n *\n * Overload behavior:\n * - If a non-optional value is provided, `.current` is non-optional\n * - If an optional value is provided, `.current` is optional\n */\nexport const useHoneyLatest: UseHoneyLatest = <T>(\n  value: T | undefined,\n): RefObject<T | undefined> => {\n  const ref = useRef<T | undefined>(value);\n\n  ref.current = value;\n\n  return ref;\n};\n","const e=e=>new Blob([e],{type:e.type}),t=e=>new DOMRect(e.offsetLeft,e.offsetTop,e.clientWidth,e.clientHeight),n=e=>\"A\"===e.tagName,r=e=>\"true\"===e.getAttribute(\"contenteditable\"),a=[\"INPUT\",\"SELECT\",\"TEXTAREA\",\"BUTTON\",\"A\"],l=e=>{if(!e)return!1;const t=window.getComputedStyle(e);if(\"hidden\"===t.visibility||\"none\"===t.display)return!1;if(\"disabled\"in e&&e.disabled)return!1;const l=e.getAttribute(\"tabindex\");return\"-1\"!==l&&(a.includes(e.tagName)?!n(e)||\"\"!==e.href:!!r(e)||null!==l)},i=e=>Array.from(e.querySelectorAll(\"*\")).filter(l),o=(e,t=null,{wrap:n=!0,getNextIndex:r}={})=>{const a=document.activeElement,l=t??a?.parentElement;if(!a||!l)return;const o=i(l);if(0===o.length)return;const s=o.indexOf(a);if(-1===s)return;let c;r?c=r(s,e,o):\"next\"===e?(c=s+1,c>=o.length&&(c=n?0:null)):(c=s-1,c<0&&(c=n?o.length-1:null)),null!==c&&o[c]?.focus()},s=(...e)=>t=>e.reduce((e,t)=>t(e),t),c=(...e)=>t=>e.reduceRight((e,t)=>t(e),t),u=(e,t)=>e.filter(e=>!t.includes(e)),h=e=>[...new Set(e)],f=(...e)=>{if(0===e.length)return[];if(1===e.length)return[...e[0]];const[t,...n]=e;return h(t).filter(e=>n.every(t=>t.includes(e)))};function d(e,t){if(!e)throw new Error(t)}const m=e=>null===e,p=e=>null==e,g=e=>null!=e,y=e=>void 0===e,w=e=>\"number\"==typeof e,b=e=>\"boolean\"==typeof e,x=e=>\"object\"==typeof e,A=e=>x(e)&&!m(e)&&0===Object.keys(e).length,M=e=>e instanceof Date,v=e=>e instanceof Blob,I=e=>e instanceof Error,S=e=>M(e)&&!isNaN(e.getTime()),C=e=>e instanceof RegExp,k=e=>e instanceof Map,E=e=>e instanceof Set,O=e=>\"symbol\"==typeof e,L=e=>w(e)&&isFinite(e),P=e=>w(e)&&Number.isInteger(e),T=e=>L(e)&&!Number.isInteger(e),X=(e,t)=>(d(t>0,\"Chunk size must be greater than 0\"),Array.from({length:Math.ceil(e.length/t)},(n,r)=>e.slice(r*t,(r+1)*t))),$=e=>e.filter(Boolean),_=e=>Array.isArray(e),N=e=>_(e)&&0===e.length,Y=(e,t,n)=>{if(!e?.length||!t)return{previousItem:null,currentItem:null,nextItem:null};const r=e.findIndex(e=>n(e,t));return-1===r?{previousItem:null,currentItem:null,nextItem:null}:{previousItem:r>0?e[r-1]:null,currentItem:e[r],nextItem:r<e.length-1?e[r+1]:null}},F=()=>{},R=e=>\"function\"==typeof e,j=e=>(...t)=>!e(...t),z=e=>{let t,n=!1;return function(...r){return n||(n=!0,t=e.apply(this,r)),t}},U=e=>R(e?.then),W=async(e,t)=>{const n=[];for(let r=0;r<e.length;r++)n.push(await t(e[r],r,e));return n},D=async(e,t)=>Promise.all(e.map(t)),H=async(e,t)=>{const n=[];for(let r=0;r<e.length;r++){const a=e[r];await t(a,r,e)&&n.push(a)}return n},B=async(e,t)=>{const n=await D(e,async(e,n,r)=>!!await t(e,n,r)&&e);return $(n)},V=async(e,t)=>{for(let n=0;n<e.length;n++)if(await t(e[n],n,e))return!0;return!1},Z=async(e,t)=>{for(let n=0;n<e.length;n++)if(!await t(e[n],n,e))return!1;return!0},G=async(e,t,n)=>{let r=n;for(let n=0;n<e.length;n++)r=await t(r,e[n],n,e);return r},J=async(e,t)=>{for(let n=0;n<e.length;n++)if(await t(e[n],n,e))return e[n];return null},q=e=>new Promise(t=>setTimeout(t,e)),K=async(e,t,n=\"Operation timed out\")=>{try{return await Promise.race([e,q(t).then(()=>Promise.reject(new Error(n)))])}finally{}},Q=(e,{maxAttempts:t=3,delayMs:n=300,backoff:r=!0,onRetry:a}={})=>async(...l)=>{let i;for(let o=1;o<=t;o++)try{return await e(...l)}catch(e){if(i=e,o<t){a?.(o,e);const t=r?n*2**(o-1):n;await q(t)}}throw i},ee=\"application/json\",te=(e,t)=>{e.setData(ee,JSON.stringify(t))},ne=e=>{const t=e.getData(ee);if(t)try{return JSON.parse(t)}catch{return}},re=e=>\"string\"==typeof e,ae=(e,{fileName:t,target:n}={})=>{if(y(document))return;const r=document.createElement(\"a\");let a=null;try{const l=re(e)?e:a=URL.createObjectURL(e);r.href=l,t&&(r.download=t),n&&(r.target=n),document.body.appendChild(r),r.click()}finally{r.remove(),a&&setTimeout(()=>{d(a,\"Object URL should not be null\"),URL.revokeObjectURL(a)},0)}},le=e=>e.scrollWidth>e.clientWidth,ie=e=>Math.max(0,e.scrollWidth-e.clientWidth),oe=e=>e.scrollHeight>e.clientHeight,se=e=>Math.max(0,e.scrollHeight-e.clientHeight),ce=({containerSize:e,elementOffset:t,elementSize:n})=>-(t+n/2-e/2),ue=(e,t)=>t<=0?0:Math.max(-t,Math.min(e,0)),he=(e,t,{axis:n=\"both\",shouldClamp:r=!0}={})=>{let a=0,l=0;if(\"x\"===n||\"both\"===n){const n=ce({containerSize:e.clientWidth,elementOffset:t.offsetLeft,elementSize:t.clientWidth});a=r?ue(n,ie(e)):n}if(\"y\"===n||\"both\"===n){const n=ce({containerSize:e.clientHeight,elementOffset:t.offsetTop,elementSize:t.clientHeight});l=r?ue(n,se(e)):n}e.style.transform=`translate(${a}px, ${l}px)`},fe=e=>{const t=window.getComputedStyle(e).getPropertyValue(\"transform\").match(/^matrix\\((.+)\\)$/);if(!t)return{translateX:0,translateY:0,scaleX:1,scaleY:1,skewX:0,skewY:0};const[n,r,a,l,i,o]=t[1].split(\", \").map(parseFloat);return{translateX:i,translateY:o,scaleX:n,scaleY:l,skewX:a,skewY:r}},de=()=>{if(\"undefined\"==typeof window||!window.localStorage)return!1;try{return window.localStorage.getItem(\"__non_existing_key__\"),!0}catch{return!1}},me=()=>{if(!de())return{readable:!1,writable:!1};try{const e=\"__test_write__\";return window.localStorage.setItem(e,\"1\"),window.localStorage.removeItem(e),{readable:!0,writable:!0}}catch{}return{readable:!0,writable:!1}},pe=e=>e instanceof File,ge=e=>{if(!e)return[];const t=[];for(let n=0;n<e.length;n++)t.push(e[n]);return t},ye=(e,t)=>new File([e],t,{type:e.type}),we=async(e,{skipFiles:t=[\".DS_Store\",\"Thumbs.db\",\"desktop.ini\",\"ehthumbs.db\",\".Spotlight-V100\",\".Trashes\",\".fseventsd\",\"__MACOSX\"]}={})=>{const n=new Set(t),r=await(async e=>{const t=e.createReader(),n=async()=>new Promise((e,r)=>{t.readEntries(async t=>{if(t.length)try{const r=await n();e([...t,...r])}catch(e){r(e)}else e([])},r)});return n()})(e);return(await D(r,async e=>e.isDirectory?we(e,{skipFiles:t}):n.has(e.name)?[]:[await new Promise((t,n)=>{e.file(t,n)})])).flat()},be=async(e,t={})=>{const n=e?.items;if(!n)return[];const r=[];for(let e=0;e<n.length;e++){const a=n[e];if(\"webkitGetAsEntry\"in a){const e=a.webkitGetAsEntry?.();if(e?.isDirectory){r.push(we(e,t));continue}if(e?.isFile){r.push(new Promise((t,n)=>e.file(e=>t([e]),n)));continue}}const l=a.getAsFile();l&&r.push(Promise.resolve([l]))}return(await Promise.all(r)).flat()},xe=(e,...t)=>\"function\"==typeof e?e(...t):e,Ae=({delta:e,value:t,min:n,max:r})=>{if(0===e)return null;const a=t+e;return e<0?t<=n?null:Math.max(a,n):e>0?t>=r?null:Math.min(a,r):null},Me=({value:e,min:t,max:n,velocityPxMs:r,deltaTimeMs:a,friction:l=.002,minVelocityPxMs:i=.01,emaAlpha:o=.2})=>{if(Math.abs(r)<i)return null;const s=Ae({delta:r*a,value:e,min:t,max:n});if(null===s)return null;const c=r*Math.exp(-l*a),u=o>0?r*(1-o)+c*o:c;return Math.abs(u)<i?null:{value:s,velocityPxMs:u}},ve=()=>`${Math.floor(1e3*performance.now()).toString(36)}${Math.random().toString(36).slice(2,10)}`,Ie=(e,t)=>Math.max(0,Math.min(e.right,t.right)-Math.max(e.left,t.left))*Math.max(0,Math.min(e.bottom,t.bottom)-Math.max(e.top,t.top))/(t.width*t.height),Se=(e,t,{allowFallback:n=!0,invert:r=!0}={})=>{const a=r?-1:1;switch(t){case\"x\":return{deltaX:a*(0!==e.deltaX?e.deltaX:n?e.deltaY:0),deltaY:0};case\"y\":return{deltaX:0,deltaY:a*e.deltaY};default:return{deltaX:a*e.deltaX,deltaY:a*e.deltaY}}},Ce=(e,t,n,r)=>{const a=n-e,l=r-t;return Math.hypot(a,l)},ke=(e,t)=>Math.abs(e/t),Ee=(e,t)=>e*t/100,Oe=e=>{let t=5381;for(let n=0;n<e.length;n++)t=33*t^e.charCodeAt(n);return(t>>>0).toString(36)},Le=e=>Object.entries(e).reduce((e,[t,n])=>(void 0!==n&&(e[t]=n),e),{}),Pe=e=>e.replace(/([a-z0-9])([A-Z])/g,\"$1-$2\").toLowerCase(),Te=e=>{const t=e.charAt(0),n=e.slice(1);return t.toLowerCase()+n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)},Xe=e=>e.replace(/([a-z0-9])([A-Z])/g,\"$1 $2\"),$e=e=>0===e.length?[]:e.split(\" \").filter(Boolean),_e=e=>\"\"===e||p(e),Ne=e=>{const t=e.lastIndexOf(\".\");return t<=0||t===e.length-1?[e,\"\"]:[e.slice(0,t),e.slice(t+1).toLowerCase()]},Ye=(e,t)=>{if(0===e.length)return[];const n=t.charCodeAt(0),r=[];for(let t=0;t<e.length;t++)e.charCodeAt(t)===n&&r.push(t);return r},Fe=(e,t,n)=>{if(0===e.length)return;const r=e.length;for(let a=0;a<r;a++){const l=e[a],i={charIndex:a,prevChar:a>0?e[a-1]:null,nextChar:a<r-1?e[a+1]:null};n?.(l,i)||t(l,i)}},Re=(e,t=1/0)=>0===e.length?\"\":$e(e).slice(0,t).map(e=>e[0]).join(\"\").toUpperCase(),je=(e,t,n,r=t)=>e.split(t).map((e,t)=>n(e.trim(),t)).join(r),ze=(e,t,n,r=[],a=void 0,l=0)=>(e?.forEach(e=>{const{[n]:i,...o}=e,s=e[n],c=Array.isArray(s);if(r.push({...o,parentId:a,depthLevel:l,childCount:c?s.length:0}),c){const a=e[t];ze(s,t,n,r,a,l+1)}}),r),Ue=(e,t,n)=>e.filter(e=>e.parentId===t&&(!n||n(e))),We=(e,t,n,r)=>{const a=$e(r.toLowerCase());if(!a.length)return e;const l=e.reduce((e,n,r)=>(e[n[t]]=r,e),{});return e.reduce((r,i)=>{const o=i[n];if(!o)return r;if(r.some(e=>e[t]===i[t]))return r;const s=$e(o.toLowerCase());if(a.every(e=>s.some(t=>t.startsWith(e))))if(y(i.parentId)){r.push(i);const n=a=>{a.childCount&&e.forEach(e=>{e.parentId===a[t]&&(r.push(e),n(e))})};n(i)}else{const t=n=>{const a=l[n.parentId],i=e[a];y(i.parentId)||t(i);const o=r.length?r[r.length-1].parentId:null;(m(o)||o!==n.parentId)&&(d(i,\"[@react-hive/honey-utils]: Parent node was not found.\"),r.push(i))};t(i),r.push(i)}return r},[])},De=(e,t)=>{d(t>=0&&t<=1,`[@react-hive/honey-utils]: Alpha \"${t}\" must be a number between 0 and 1.`);const n=e.match(/^#?([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/);d(n,`[@react-hive/honey-utils]: Invalid hex format: ${e}`);const r=n[1];return`#${(3===r.length?r[0]+r[0]+r[1]+r[1]+r[2]+r[2]:r)+Math.round(255*t).toString(16).toUpperCase().padStart(2,\"0\")}`};export{ee as DATA_TRANSFER_JSON_MIME,a as FOCUSABLE_HTML_TAGS,Me as applyInertiaStep,d as assert,ye as blobToFile,ce as calculateCenterOffset,Ce as calculateEuclideanDistance,ke as calculateMovingSpeed,Ee as calculatePercentage,Te as camelToDashCase,Xe as camelToWords,he as centerElementInContainer,X as chunk,ue as clampOffsetToOverflow,e as cloneBlob,$ as compact,c as compose,Le as definedProps,q as delay,u as difference,ae as downloadFile,Z as everyAsync,ge as fileListToFiles,B as filterParallel,H as filterSequential,J as findAsync,Ye as findCharIndices,ze as flattenTree,Fe as forEachChar,ve as generateEphemeralId,Y as getAdjacentItems,Ie as getDOMRectIntersectionRatio,ne as getDataTransferJson,t as getElementOffsetRect,i as getFocusableHtmlElements,me as getLocalStorageCapabilities,Ue as getTreeChildren,Re as getWordsInitials,ie as getXOverflowWidth,se as getYOverflowHeight,le as hasXOverflow,oe as hasYOverflow,Oe as hashString,De as hexWithAlpha,f as intersection,xe as invokeIfFunction,n as isAnchorHtmlElement,_ as isArray,v as isBlob,b as isBool,r as isContentEditableHtmlElement,M as isDate,T as isDecimal,g as isDefined,N as isEmptyArray,A as isEmptyObject,I as isError,pe as isFile,L as isFiniteNumber,R as isFunction,l as isHtmlElementFocusable,P as isInteger,de as isLocalStorageReadable,k as isMap,p as isNil,_e as isNilOrEmptyString,m as isNull,w as isNumber,x as isObject,U as isPromise,C as isRegExp,E as isSet,re as isString,O as isSymbol,y as isUndefined,S as isValidDate,o as moveFocusWithinContainer,F as noop,j as not,z as once,fe as parse2DMatrix,Ne as parseFileName,s as pipe,be as readFilesFromDataTransfer,G as reduceAsync,Se as resolveAxisDelta,Ae as resolveBoundedDelta,Q as retry,D as runParallel,W as runSequential,We as searchTree,te as setDataTransferJson,V as someAsync,je as splitMapJoin,$e as splitStringIntoWords,K as timeout,Pe as toKebabCase,we as traverseFileSystemDirectory,h as unique};\n//# sourceMappingURL=index.mjs.map","import { useCallback, useEffect, useRef, useState } from 'react';\n\nimport type { Nullable } from './types';\nimport { __DEV__ } from './constants';\nimport { useHoneyLatest } from './use-honey-latest';\n\ninterface UseHoneyRafFrameContext {\n  /**\n   * Immediately terminates the active `requestAnimationFrame` loop.\n   *\n   * This method is **safe to call synchronously from within the frame handler**\n   * and is the **recommended mechanism** for ending frame-driven processes based on runtime conditions.\n   *\n   * Typical use cases:\n   * - Inertia or momentum decay reaching a threshold\n   * - Animation or transition completion\n   * - Time- or state-based termination conditions\n   */\n  stop: () => void;\n}\n\n/**\n * Function invoked on every animation frame while the RAF loop is active.\n *\n * The handler is expected to be **side-effect driven** and may:\n * - Mutate refs\n * - Update React state\n * - Stop the RAF loop via `context.stop()`\n *\n * ⚠️ Referential stability\n * This handler **must be wrapped in `useCallback`** to avoid unnecessary\n * re-bindings and to ensure predictable behavior across renders.\n *\n * @param deltaTimeMs - Time delta in milliseconds since the previous frame.\n *                      This value is clamped to `maxDeltaMs` to prevent large\n *                      time steps caused by tab backgrounding, visibility changes,\n *                      or browser throttling.\n *\n * @param context - RAF lifecycle control context. See {@link UseHoneyRafFrameContext}.\n */\nexport type UseHoneyRafOnFrameHandler = (\n  deltaTimeMs: number,\n  context: UseHoneyRafFrameContext,\n) => void;\n\n/**\n * Configuration options for {@link useHoneyRafLoop}.\n */\ninterface UseHoneyRafLoopOptions {\n  /**\n   * Automatically start the RAF loop on mount.\n   *\n   * This is useful for continuous loops (e.g. visualizers),\n   * but should generally be disabled for gesture- or intent-driven animations.\n   *\n   * @default false\n   */\n  autoStart?: boolean;\n  /**\n   * Whether the RAF loop should automatically resume when the\n   * document becomes visible again after being hidden.\n   *\n   * ⚠️ Important:\n   * - Visibility changes will ALWAYS stop the RAF loop\n   * - Resuming is **opt-in** and never happens implicitly\n   *\n   * This option should only be enabled for truly continuous\n   * systems (e.g. game loops, live visualizations).\n   *\n   * It is intentionally disabled by default to avoid restarting\n   * gesture-driven or state-sensitive animations with stale data.\n   *\n   * Requires `autoStart` to be enabled.\n   *\n   * @default false\n   */\n  resumeOnVisibility?: boolean;\n  /**\n   * Maximum allowed delta time between frames.\n   *\n   * This prevents physics, inertia, or animation logic from receiving large\n   * time steps after backgrounding, tab switches, or frame drops.\n   *\n   * @default 32\n   */\n  maxDeltaMs?: number;\n  /**\n   * Optional error handler invoked when the RAF callback throws.\n   *\n   * When an error occurs:\n   * - The RAF loop is immediately stopped\n   * - `isRafLoopRunning` is set to `false`\n   * - The error is passed to this handler\n   *\n   * @default undefined\n   */\n  onError?: (error: unknown) => void;\n}\n\n/**\n * Public control API returned by {@link useHoneyRafLoop}.\n */\nexport interface HoneyRafLoopApi {\n  /**\n   * Indicates whether the RAF loop is currently running.\n   */\n  isRunning: boolean;\n  /**\n   * Starts the RAF loop.\n   *\n   * If the loop is already running, this call is ignored.\n   */\n  start: () => void;\n  /**\n   * Stops the RAF loop immediately.\n   *\n   * This method is safe to call:\n   * - From user code\n   * - From within the RAF frame handler\n   */\n  stop: () => void;\n}\n\n/**\n * A hook for running a controlled `requestAnimationFrame` loop.\n *\n * Features:\n * - Explicit RAF lifecycle control (`start` / `stop`)\n * - Delta time calculation with frame clamping\n * - Automatic cleanup on unmounting\n * - Conservative handling of tab visibility changes (mobile-safe)\n * - Safe error handling (stops loop on exception)\n *\n * Visibility behavior:\n * - The RAF loop is always stopped when the document becomes hidden\n * - Automatic resume is disabled by default and must be explicitly enabled\n *\n * This hook is designed for gesture handling, inertia, physics simulations,\n * and animation loops that must not trigger React re-renders on every frame.\n *\n * @param onFrame - Function invoked on each animation frame.\n * @param options  - Optional configuration for the RAF loop.\n *\n * @returns Control helpers and RAF loop state.\n *\n * @example\n * ```ts\n * // Gesture-driven inertia (recommended usage)\n * // The RAF loop stops itself when motion decays.\n *\n * const velocityRef = useRef({ x: 12, y: 4 });\n *\n * const onFrame = useCallback<HoneyRafOnFrameHandler>(\n *   (dtMs, { stop }) => {\n *     velocityRef.current.x *= 0.94;\n *     velocityRef.current.y *= 0.94;\n *\n *     setPosition(p => ({\n *       x: p.x + velocityRef.current.x,\n *       y: p.y + velocityRef.current.y,\n *     }));\n *\n *     if (\n *       Math.abs(velocityRef.current.x) < 0.1 &&\n *       Math.abs(velocityRef.current.y) < 0.1\n *     ) {\n *       stop(); // terminate RAF loop\n *     }\n *   },\n *   [],\n * );\n *\n * useHoneyRafLoop(onFrame);\n * ```\n */\nexport const useHoneyRafLoop = (\n  onFrame: UseHoneyRafOnFrameHandler,\n  {\n    autoStart = false,\n    resumeOnVisibility = false,\n    maxDeltaMs = 32, // ~30fps clamp\n    onError,\n  }: UseHoneyRafLoopOptions = {},\n): HoneyRafLoopApi => {\n  const [isRunning, setIsRunning] = useState(false);\n  const isRunningRef = useRef(false);\n\n  const rafIdRef = useRef<Nullable<number>>(null);\n  const lastTimeMsRef = useRef<Nullable<number>>(null);\n\n  const onFrameRef = useHoneyLatest(onFrame);\n  const onErrorRef = useHoneyLatest(onError);\n\n  const stop = useCallback(() => {\n    if (!isRunningRef.current) {\n      return;\n    }\n\n    isRunningRef.current = false;\n\n    if (rafIdRef.current !== null) {\n      cancelAnimationFrame(rafIdRef.current);\n\n      rafIdRef.current = null;\n    }\n\n    lastTimeMsRef.current = null;\n    setIsRunning(false);\n  }, []);\n\n  const loop = useCallback<FrameRequestCallback>(\n    timeMs => {\n      if (!isRunningRef.current) {\n        return;\n      }\n\n      if (lastTimeMsRef.current === null) {\n        lastTimeMsRef.current = timeMs;\n      }\n\n      let deltaTimeMs = timeMs - lastTimeMsRef.current;\n      lastTimeMsRef.current = timeMs;\n\n      // Clamp delta (prevents jumps after background tab / lag)\n      if (deltaTimeMs > maxDeltaMs) {\n        deltaTimeMs = maxDeltaMs;\n      }\n\n      try {\n        onFrameRef.current(deltaTimeMs, {\n          stop,\n        });\n\n        if (isRunningRef.current) {\n          rafIdRef.current = requestAnimationFrame(loop);\n        }\n      } catch (e) {\n        if (__DEV__) {\n          console.error(e);\n        }\n\n        stop();\n\n        onErrorRef.current?.(e);\n      }\n    },\n    [maxDeltaMs, stop],\n  );\n\n  const start = useCallback(() => {\n    if (isRunningRef.current) {\n      return;\n    }\n\n    lastTimeMsRef.current = null;\n\n    isRunningRef.current = true;\n    setIsRunning(true);\n\n    rafIdRef.current = requestAnimationFrame(loop);\n  }, [loop]);\n\n  useEffect(() => {\n    if (autoStart) {\n      start();\n    }\n\n    return stop;\n  }, [autoStart]);\n\n  // Pause when a tab is hidden (important for mobile)\n  useEffect(() => {\n    const onVisibilityChange = () => {\n      if (document.hidden) {\n        stop();\n      } else if (resumeOnVisibility && autoStart) {\n        start();\n      }\n    };\n\n    document.addEventListener('visibilitychange', onVisibilityChange);\n\n    return () => {\n      document.removeEventListener('visibilitychange', onVisibilityChange);\n    };\n  }, [autoStart, resumeOnVisibility, start, stop]);\n\n  return {\n    isRunning,\n    start,\n    stop,\n  };\n};\n","import { useCallback, useRef, useState } from 'react';\nimport type { InertiaOptions } from '@react-hive/honey-utils';\nimport { applyInertiaStep } from '@react-hive/honey-utils';\n\nimport type { UseHoneyRafOnFrameHandler } from './use-honey-raf-loop';\nimport { useHoneyRafLoop } from './use-honey-raf-loop';\nimport { useHoneyLatest } from './use-honey-latest';\n\n/**\n * Configuration options for {@link useHoneyDecay}.\n */\nexport interface UseHoneyDecayOptions extends Pick<\n  InertiaOptions,\n  'friction' | 'minVelocityPxMs' | 'emaAlpha'\n> {\n  /**\n   * Initial numeric value from which inertial motion starts.\n   *\n   * This typically represents a translated position  (e.g. scroll offset or `translateX` value),\n   * but may be any bounded numeric domain.\n   */\n  initialValue: number;\n  /**\n   * Lower bound for the value (inclusive).\n   *\n   * Movement beyond this boundary is not permitted.\n   */\n  min: number;\n  /**\n   * Upper bound for the value (inclusive).\n   *\n   * Movement beyond this boundary is not permitted.\n   */\n  max: number;\n  /**\n   * Optional callback invoked exactly once when inertial motion terminates.\n   *\n   * Triggered when inertia ends due to:\n   * - velocity decaying below `minVelocityPxMs`\n   * - movement being blocked by bounds\n   * - an explicit call to `stop()`\n   *\n   * Not invoked if inertia was never started.\n   */\n  onStop?: () => void;\n}\n\n/**\n * Public control API returned by {@link useHoneyDecay}.\n *\n * Exposes imperative controls for managing velocity-based inertial motion.\n */\nexport interface UseHoneyDecayApi {\n  /**\n   * Current value produced by the decay simulation.\n   *\n   * This value updates over time while inertia is active\n   * and always remains within the configured bounds.\n   */\n  value: number;\n  /**\n   * Indicates whether inertial motion is currently active.\n   */\n  isRunning: boolean;\n  /**\n   * Updates the hard bounds used by the decay simulation.\n   *\n   * This method is safe to call **at any time**, including while inertia is actively running.\n   *\n   * ### Behavior\n   * - If the current value lies **within** the new bounds:\n   *   - bounds are updated\n   *   - inertia (if running) continues uninterrupted\n   *\n   * - If the current value lies **outside** the new bounds:\n   *   - the value is immediately clamped to the nearest boundary\n   *   - internal velocity is reset to `0`\n   *   - any active inertia is **terminated immediately**\n   *   - `onStop` is invoked exactly once (if inertia was active)\n   *\n   * This deterministic behavior mirrors native scroll engines and ensures:\n   * - no overshoot\n   * - no extra inertia frames\n   * - consistent `onStop` semantics\n   *\n   * ### Intended usage\n   * - Responding to layout or content changes\n   * - Handling resize / orientation changes\n   * - Updating overscroll or overflow limits dynamically\n   *\n   * ⚠️ This method should **not** be called from inside the RAF frame handler.\n   *\n   * @param min - New lower bound (inclusive)\n   * @param max - New upper bound (inclusive)\n   */\n  setBounds: (min: number, max: number) => void;\n  /**\n   * Starts inertial motion from the current value using\n   * the provided initial velocity.\n   *\n   * The sign of the velocity determines a direction:\n   * - Positive → movement toward the upper bound\n   * - Negative → movement toward the lower bound\n   *\n   * @param velocityPxMs - Initial velocity expressed in pixels per millisecond (`px/ms`).\n   */\n  start: (velocityPxMs: number) => void;\n  /**\n   * Immediately sets the value and starts inertial motion from that value in a single atomic operation.\n   *\n   * This is the preferred way to hand off from a gesture (e.g. drag end) to inertia, as it:\n   * - avoids transient intermediate states\n   * - guarantees correct value/velocity ordering\n   * - ensures `onStop` semantics remain consistent\n   *\n   * @param value - Starting value for the inertia simulation\n   * @param velocityPxMs - Initial velocity in pixels per millisecond (`px/ms`)\n   */\n  startFrom: (value: number, velocityPxMs: number) => void;\n  /**\n   * Immediately stops inertial motion.\n   *\n   * If inertia is currently active, this will:\n   * - cancel the RAF loop\n   * - reset internal velocity\n   * - invoke `onStop` exactly once\n   */\n  stop: () => void;\n}\n\n/**\n * A bounded, velocity-based inertia (decay) hook built on top\n * of {@link useHoneyRafLoop} and {@link applyInertiaStep}.\n *\n * This hook models **momentum-driven motion** where:\n * - Motion starts with an initial velocity\n * - Velocity decays exponentially over time\n * - Movement is constrained by hard numeric bounds\n * - Inertia stops naturally when velocity becomes negligible\n *\n * Unlike spring-based motion, this hook has **no target value**.\n * Motion continues purely based on momentum until it decays\n * or is blocked by a boundary.\n *\n * ---\n *\n * ### Key characteristics\n * - Frame-rate independent (delta-time based)\n * - Deterministic and interruptible\n * - Direction-aware and bound-safe (no overshoot or jitter)\n * - Closely matches native scroll and drag inertia behavior\n *\n * ---\n *\n * ### Visibility behavior\n * This hook is a **simulation-based system**:\n * - Inertia automatically pauses when the document becomes hidden\n * - No time elapses while hidden\n * - Motion resumes only when explicitly restarted\n *\n * This behavior is inherited from {@link useHoneyRafLoop} and is intentional.\n *\n * ---\n *\n * ### Common use cases\n * - Scroll containers with momentum\n * - Drag-to-scroll interactions\n * - Carousels and sliders\n * - Timelines and scrubbers\n * - Kinetic panning and flinging\n *\n * ---\n *\n * @example\n * ```ts\n * const decay = useHoneyDecay({\n *   initialValue: 0,\n *   min: -maxOverflow,\n *   max: 0,\n * });\n *\n * const onRelease = (velocityPxMs: number) => {\n *   decay.start(velocityPxMs);\n * };\n *\n * return (\n *   <div style={{ transform: `translateX(${decay.value}px)` }} />\n * );\n * ```\n */\nexport const useHoneyDecay = ({\n  initialValue,\n  min,\n  max,\n  friction = 0.002,\n  minVelocityPxMs = 0.01,\n  emaAlpha = 0.2,\n  onStop,\n}: UseHoneyDecayOptions): UseHoneyDecayApi => {\n  const [value, setValue] = useState(initialValue);\n\n  const valueRef = useRef(initialValue);\n  const velocityPxMsRef = useRef(0);\n  const hasActiveInertiaRef = useRef(false);\n\n  const minRef = useRef(min);\n  const maxRef = useRef(max);\n\n  const onStopRef = useHoneyLatest(onStop);\n\n  const frameHandler = useCallback<UseHoneyRafOnFrameHandler>(\n    (deltaTimeMs, frameContext) => {\n      // Ignore the first RAF tick\n      if (deltaTimeMs === 0) {\n        return;\n      }\n\n      const inertia = applyInertiaStep({\n        value: valueRef.current,\n        velocityPxMs: velocityPxMsRef.current,\n        min: minRef.current,\n        max: maxRef.current,\n        deltaTimeMs,\n        friction,\n        minVelocityPxMs,\n        emaAlpha,\n      });\n\n      if (inertia === null) {\n        velocityPxMsRef.current = 0;\n\n        if (hasActiveInertiaRef.current) {\n          hasActiveInertiaRef.current = false;\n\n          onStopRef.current?.();\n        }\n\n        frameContext.stop();\n        return;\n      }\n\n      hasActiveInertiaRef.current = true;\n\n      valueRef.current = inertia.value;\n      velocityPxMsRef.current = inertia.velocityPxMs;\n\n      setValue(inertia.value);\n    },\n    [friction, minVelocityPxMs, emaAlpha],\n  );\n\n  const rafLoop = useHoneyRafLoop(frameHandler);\n\n  const setBounds = useCallback(\n    (nextMin: number, nextMax: number) => {\n      minRef.current = nextMin;\n      maxRef.current = nextMax;\n\n      const currentValue = valueRef.current;\n\n      if (currentValue < nextMin || currentValue > nextMax) {\n        const nextValue = Math.min(Math.max(currentValue, nextMin), nextMax);\n\n        valueRef.current = nextValue;\n        velocityPxMsRef.current = 0;\n\n        setValue(nextValue);\n\n        if (hasActiveInertiaRef.current) {\n          hasActiveInertiaRef.current = false;\n\n          onStopRef.current?.();\n        }\n\n        rafLoop.stop();\n      }\n    },\n    [rafLoop.stop],\n  );\n\n  const start = useCallback(\n    (velocityPxMs: number) => {\n      velocityPxMsRef.current = velocityPxMs;\n      hasActiveInertiaRef.current = true;\n\n      rafLoop.start();\n    },\n    [rafLoop.start],\n  );\n\n  const startFrom = useCallback(\n    (nextValue: number, velocityPxMs: number) => {\n      valueRef.current = nextValue;\n      velocityPxMsRef.current = velocityPxMs;\n      hasActiveInertiaRef.current = true;\n\n      setValue(nextValue);\n      rafLoop.start();\n    },\n    [rafLoop.start],\n  );\n\n  const stop = useCallback(() => {\n    if (hasActiveInertiaRef.current) {\n      hasActiveInertiaRef.current = false;\n\n      onStopRef.current?.();\n    }\n\n    velocityPxMsRef.current = 0;\n    rafLoop.stop();\n  }, [rafLoop.stop]);\n\n  return {\n    value,\n    isRunning: rafLoop.isRunning,\n    setBounds,\n    start,\n    startFrom,\n    stop,\n  };\n};\n","import { useEffect } from 'react';\n\nimport type { HoneyKeyboardEventCode } from './types';\nimport { useHoneyLatest } from './use-honey-latest';\n\n/**\n * Callback invoked when a matching `keyup` event is fired on the document.\n *\n * @param keyCode - Released key code from `KeyboardEvent.code`.\n * @param e - Native keyboard event.\n */\nexport type UseHoneyDocumentOnKeyUpHandler = (\n  keyCode: HoneyKeyboardEventCode,\n  e: KeyboardEvent,\n) => void;\n\ninterface UseHoneyDocumentKeyUpOptions {\n  /**\n   * Whether the event listener should be active.\n   *\n   * @default true\n   */\n  enabled?: boolean;\n  /**\n   * Whether to call `preventDefault()` on matching `keyup` events.\n   *\n   * This is useful for suppressing default browser behavior\n   * (for example, scrolling with the Space key).\n   *\n   * @default true\n   */\n  preventDefault?: boolean;\n}\n\n/**\n * Subscribes to `keyup` events on the `document` and invokes the callback\n * when one of the specified keys is released.\n *\n * The hook keeps a stable document event listener and always uses the latest\n * `onKeyUp` callback and `listenKeys` values without re-subscribing when they change.\n *\n * @param onKeyUp - Callback invoked when a matching key is released.\n * @param listenKeys - List of `KeyboardEvent.code` values to listen for.\n * @param options - Listener behavior configuration.\n *\n * @example\n * ```tsx\n * useHoneyDocumentKeyUp(\n *   (keyCode, event) => {\n *     console.log('Key released:', keyCode);\n *   },\n *   ['Escape'],\n * );\n * ```\n */\nexport const useHoneyDocumentKeyUp = (\n  onKeyUp: UseHoneyDocumentOnKeyUpHandler,\n  listenKeys: HoneyKeyboardEventCode[],\n  { enabled = true, preventDefault = true }: UseHoneyDocumentKeyUpOptions = {},\n) => {\n  const onKeyUpRef = useHoneyLatest(onKeyUp);\n  const listenKeysRef = useHoneyLatest(listenKeys);\n\n  useEffect(() => {\n    if (!enabled) {\n      return;\n    }\n\n    const handleKeyUp = (e: KeyboardEvent) => {\n      const keyCode = e.code as HoneyKeyboardEventCode;\n\n      if (listenKeysRef.current.includes(keyCode)) {\n        if (preventDefault) {\n          e.preventDefault();\n        }\n\n        onKeyUpRef.current(keyCode, e);\n      }\n    };\n\n    document.addEventListener('keyup', handleKeyUp);\n\n    return () => {\n      document.removeEventListener('keyup', handleKeyUp);\n    };\n  }, [enabled, preventDefault]);\n};\n","import type { RefObject } from 'react';\nimport { useEffect } from 'react';\n\nimport type { Nullable } from './types';\nimport { useHoneyLatest } from './use-honey-latest';\n\n/**\n * Invoked when a drag gesture is about to start.\n *\n * This handler is called on the initial pointer-down interaction\n * (mouse or touch) before drag tracking begins.\n *\n * It can be used to:\n * - allow or block dragging\n * - capture initial external state\n * - cancel dragging based on application logic\n *\n * @template Element - Draggable element type.\n *\n * @param draggableElement - Element that is about to be dragged.\n * @param e - Pointer event that initiated the drag.\n *\n * @returns Promise resolving to:\n * - `true` to allow dragging\n * - `false` to cancel dragging\n */\nexport type UseHoneyDragOnStartHandler<Element extends HTMLElement> = (\n  draggableElement: Element,\n  e: MouseEvent | TouchEvent,\n) => Promise<boolean>;\n\n/**\n * Context describing pointer movement during an active drag gesture.\n *\n * All values are expressed in **pixels** and are relative\n * to the drag start or previous frame as noted.\n */\nexport interface UseHoneyDragOnMoveContext {\n  /**\n   * Horizontal delta since the previous move event.\n   *\n   * Positive values indicate movement to the right.\n   */\n  deltaX: number;\n  /**\n   * Vertical delta since the previous move event.\n   *\n   * Positive values indicate movement downward.\n   */\n  deltaY: number;\n  /**\n   * Total horizontal displacement from the drag start position.\n   */\n  distanceX: number;\n  /**\n   * Total vertical displacement from the drag start position.\n   */\n  distanceY: number;\n}\n\n/**\n * Creates a move callback for the current drag gesture.\n *\n * The returned callback is invoked on each pointer move and receives\n * incremental and total movement data.\n *\n * Returning `false` from the move callback immediately terminates the drag.\n *\n * @template Element - The draggable element type.\n *\n * @param draggableElement - The element being dragged.\n *\n * @returns A function invoked on every pointer move, receiving\n *          {@link UseHoneyDragOnMoveContext}, and resolving to:\n *          - `true` to continue dragging\n *          - `false` to stop dragging immediately\n */\nexport type UseHoneyDragOnMoveHandler<Element extends HTMLElement> = (\n  draggableElement: Element,\n) => (context: UseHoneyDragOnMoveContext) => Promise<boolean>;\n\n/**\n * Context describing the final state of a completed drag gesture.\n *\n * This context exposes **release velocity**, which is suitable for\n * inertia, momentum, or decay-based motion systems.\n */\ninterface UseHoneyDragOnEndContext {\n  /**\n   * Total horizontal displacement from drag start to release.\n   */\n  deltaX: number;\n  /**\n   * Total vertical displacement from drag start to release.\n   */\n  deltaY: number;\n  /**\n   * Horizontal release velocity in pixels per millisecond (`px/ms`).\n   *\n   * This value represents the **instantaneous velocity at release**\n   * and is suitable for inertia or momentum-based motion.\n   */\n  velocityXPxMs: number;\n  /**\n   * Vertical release velocity in pixels per millisecond (`px/ms`).\n   *\n   * This value represents the **instantaneous velocity at release**\n   * and is suitable for inertia or momentum-based motion.\n   */\n  velocityYPxMs: number;\n}\n\n/**\n * Invoked when a drag gesture ends.\n *\n * This handler is called when:\n * - the pointer is released\n * - the drag is stopped programmatically, unless skipped\n *\n * It receives final drag displacement and release velocity.\n *\n * @template Element - Draggable element type.\n *\n * @param context - Final drag metrics.\n * @param draggableElement - Element that was dragged.\n * @param e - Pointer event that finished the drag.\n *\n * @returns Promise resolved when end-of-drag logic completes.\n */\nexport type UseHoneyDragOnEndHandler<Element extends HTMLElement> = (\n  context: UseHoneyDragOnEndContext,\n  draggableElement: Element,\n  e: MouseEvent | TouchEvent,\n) => Promise<void>;\n\n/**\n * Handlers controlling the drag gesture lifecycle.\n *\n * Together, these handlers define:\n * - whether dragging can start\n * - how movement is handled\n * - what happens when dragging ends\n */\nexport interface UseHoneyDragHandlers<Element extends HTMLElement> {\n  /**\n   * Optional handler triggered when the drag operation starts.\n   * This is useful for capturing the initial state or performing any setup actions before the drag starts.\n   *\n   * @param element - The element being dragged.\n   *\n   * @returns A boolean or Promise resolving to a boolean indicating if the drag should proceed.\n   */\n  onStartDrag?: UseHoneyDragOnStartHandler<Element>;\n  /**\n   * Required handler triggered continuously during the drag operation.\n   * This handler is responsible for updating the drag state and typically tracks the element's movement.\n   *\n   * @param element - The element being dragged.\n   *\n   * @returns A boolean or Promise resolving to a boolean indicating whether the drag should continue.\n   */\n  onMoveDrag: UseHoneyDragOnMoveHandler<Element>;\n  /**\n   * Optional handler triggered when the drag operation ends.\n   * This is commonly used for cleanup or finalizing the drag process.\n   *\n   * @param context - Contains information about the drag operation, such as distance and speed.\n   * @param element - The element being dragged.\n   *\n   * @returns A Promise.\n   */\n  onEndDrag?: UseHoneyDragOnEndHandler<Element>;\n}\n\n/**\n * Options controlling drag behavior.\n */\nexport interface UseHoneyDragOptions<\n  Element extends HTMLElement,\n> extends UseHoneyDragHandlers<Element> {\n  /**\n   * Controls whether the `onEndDrag` handler is skipped when the drag operation is forcibly stopped.\n   * This can be useful when dragging is interrupted or terminated early due to movement restrictions.\n   *\n   * @default false\n   */\n  skipOnEndDragWhenStopped?: boolean;\n  /**\n   * Whether dragging is enabled.\n   *\n   * @default true\n   */\n  enabled?: boolean;\n}\n\n/**\n * Enables mouse and touch dragging for an element.\n *\n * The hook:\n * - tracks drag movement for mouse and touch input\n * - computes instantaneous release velocity using `performance.now()`\n * - emits drag lifecycle events for start, move, and end\n * - keeps DOM event subscriptions stable while always using the latest handler references\n *\n * Handler behavior:\n * - `onStartDrag`, `onMoveDrag`, and `onEndDrag` are read through `useHoneyLatest`\n * - listener subscriptions are not recreated when handler identities change\n * - the latest `onMoveDrag` factory is used for the attached element\n *\n * Architectural notes:\n * - velocity is computed during movement, not at drag end\n * - no layout reads or writes are performed internally\n * - supports both mouse and touch input\n *\n * @template Element - Draggable HTML element type.\n *\n * @param draggableElementRef - Ref pointing to the draggable element.\n * @param options - Drag lifecycle handlers and configuration.\n */\nexport const useHoneyDrag = <Element extends HTMLElement>(\n  draggableElementRef: RefObject<Nullable<Element>>,\n  {\n    skipOnEndDragWhenStopped = false,\n    enabled = true,\n    onMoveDrag,\n    onStartDrag,\n    onEndDrag,\n  }: UseHoneyDragOptions<Element>,\n) => {\n  const onStartDragRef = useHoneyLatest(onStartDrag);\n  const onMoveDragRef = useHoneyLatest(onMoveDrag);\n  const onEndDragRef = useHoneyLatest(onEndDrag);\n\n  useEffect(() => {\n    const draggableElement = draggableElementRef.current;\n\n    if (!enabled || !draggableElement) {\n      return;\n    }\n\n    let onMove: Nullable<ReturnType<UseHoneyDragOnMoveHandler<Element>>> = null;\n\n    let isDragging = false;\n\n    let startX = 0;\n    let startY = 0;\n\n    let lastX = 0;\n    let lastY = 0;\n    let lastMoveTimeMs = 0;\n\n    let velocityXPxMs = 0;\n    let velocityYPxMs = 0;\n\n    const startDrag = async (clientX: number, clientY: number, e: MouseEvent | TouchEvent) => {\n      if (onStartDragRef.current && !(await onStartDragRef.current(draggableElement, e))) {\n        return;\n      }\n\n      onMove = onMoveDragRef.current(draggableElement);\n\n      lastMoveTimeMs = performance.now();\n\n      isDragging = true;\n\n      startX = clientX;\n      startY = clientY;\n      lastX = clientX;\n      lastY = clientY;\n\n      velocityXPxMs = 0;\n      velocityYPxMs = 0;\n    };\n\n    const stopDrag = async (shouldTriggerOnEndDrag: boolean, e: MouseEvent | TouchEvent) => {\n      if (!isDragging) {\n        return;\n      }\n\n      isDragging = false;\n\n      if (shouldTriggerOnEndDrag && onEndDragRef.current) {\n        const deltaX = lastX - startX;\n        const deltaY = lastY - startY;\n\n        const endContext: UseHoneyDragOnEndContext = {\n          deltaX,\n          deltaY,\n          velocityXPxMs,\n          velocityYPxMs,\n        };\n\n        await onEndDragRef.current(endContext, draggableElement, e);\n      }\n\n      onMove = null;\n    };\n\n    const releaseDragEvents = () => {\n      window.removeEventListener('mousemove', mouseMoveHandler, { capture: true });\n      window.removeEventListener('mouseup', mouseUpHandler, { capture: true });\n\n      window.removeEventListener('touchmove', touchMoveHandler, { capture: true });\n      window.removeEventListener('touchend', touchEndHandler, { capture: true });\n      window.removeEventListener('touchcancel', touchCancelHandler, { capture: true });\n    };\n\n    const releaseDrag = async (shouldTriggerOnEndDrag: boolean, e: MouseEvent | TouchEvent) => {\n      await stopDrag(shouldTriggerOnEndDrag, e);\n\n      releaseDragEvents();\n    };\n\n    const mouseUpHandler = async (e: MouseEvent) => {\n      await releaseDrag(true, e);\n    };\n\n    const moveHandler = async (clientX: number, clientY: number, e: MouseEvent | TouchEvent) => {\n      if (!isDragging || !onMove) {\n        return;\n      }\n\n      const nowMs = performance.now();\n      const deltaTimeMs = nowMs - lastMoveTimeMs;\n\n      const deltaX = clientX - lastX;\n      const deltaY = clientY - lastY;\n\n      if (deltaTimeMs > 0) {\n        velocityXPxMs = deltaX / deltaTimeMs;\n        velocityYPxMs = deltaY / deltaTimeMs;\n      }\n\n      const distanceX = clientX - startX;\n      const distanceY = clientY - startY;\n\n      const isContinue = await onMove({\n        deltaX,\n        deltaY,\n        distanceX,\n        distanceY,\n      });\n\n      lastX = clientX;\n      lastY = clientY;\n      lastMoveTimeMs = nowMs;\n\n      if (!isContinue) {\n        await releaseDrag(!skipOnEndDragWhenStopped, e);\n      }\n    };\n\n    const mouseMoveHandler = async (e: MouseEvent) => {\n      await moveHandler(e.clientX, e.clientY, e);\n    };\n\n    const touchMoveHandler = async (e: TouchEvent) => {\n      const touch = e.touches[0];\n\n      await moveHandler(touch.clientX, touch.clientY, e);\n    };\n\n    const touchEndHandler = async (e: TouchEvent) => {\n      await releaseDrag(true, e);\n    };\n\n    const touchCancelHandler = async (e: TouchEvent) => {\n      await releaseDrag(true, e);\n    };\n\n    const touchStartHandler = async (e: TouchEvent) => {\n      e.stopPropagation();\n\n      const touch = e.touches[0];\n\n      await startDrag(touch.clientX, touch.clientY, e);\n\n      window.addEventListener('touchmove', touchMoveHandler, {\n        passive: true,\n        capture: true,\n      });\n      window.addEventListener('touchend', touchEndHandler, { capture: true });\n      window.addEventListener('touchcancel', touchCancelHandler, { capture: true });\n    };\n\n    const mouseDownHandler = async (e: MouseEvent) => {\n      e.stopPropagation();\n\n      await startDrag(e.clientX, e.clientY, e);\n\n      window.addEventListener('mousemove', mouseMoveHandler, { capture: true });\n      window.addEventListener('mouseup', mouseUpHandler, { capture: true });\n    };\n\n    draggableElement.addEventListener('mousedown', mouseDownHandler);\n    draggableElement.addEventListener('touchstart', touchStartHandler, {\n      passive: true,\n    });\n\n    return () => {\n      draggableElement.removeEventListener('mousedown', mouseDownHandler);\n      draggableElement.removeEventListener('touchstart', touchStartHandler);\n\n      releaseDragEvents();\n    };\n  }, [enabled]);\n};\n","import type { EffectCallback } from 'react';\nimport { useEffect, useRef } from 'react';\n\n/**\n * A hook that invokes a callback function whenever the provided `state` value changes.\n *\n * This hook stores the previous value internally and performs a shallow comparison with the current value.\n * If a change is detected, it executes the `onChange` callback. If the callback returns a cleanup function,\n * it will be invoked before the next change or when the component unmounts, similar to standard `useEffect` behavior.\n *\n * @template T - The type of the state being observed.\n *\n * @param state - The value to monitor for changes. Can be of any type.\n * @param onChange - A function called whenever `state` changes. It may return a cleanup function.\n *\n * @returns void\n *\n * @example\n * ```ts\n * useHoneyOnChange(someValue, (newValue) => {\n *   console.log('Value changed to:', newValue);\n *\n *   return () => {\n *     console.log('Cleanup for value:', newValue);\n *   };\n * });\n * ```\n */\nexport const useHoneyOnChange = <T>(\n  state: T,\n  onChange: (newState: T) => ReturnType<EffectCallback>,\n) => {\n  const prevStateRef = useRef(state);\n\n  useEffect(() => {\n    if (prevStateRef.current !== state) {\n      prevStateRef.current = state;\n\n      return onChange(state);\n    }\n  }, [state]);\n};\n","import { useEffect, useRef } from 'react';\nimport { isFunction } from '@react-hive/honey-utils';\nimport throttle from 'lodash.throttle';\n\nimport { useHoneyLatest } from './use-honey-latest';\n\n/**\n * Cleanup function returned by the resize handler.\n */\ntype UseHoneyResizeCleanup = () => void;\n\n/**\n * Callback invoked when the resize listener runs.\n *\n * May optionally return a cleanup function. When returned, that cleanup\n * function is called before the next successful handler execution and when\n * the hook is cleaned up.\n */\nexport type UseHoneyResizeHandler = () => UseHoneyResizeCleanup | undefined;\n\ninterface UseHoneyResizeOptions {\n  /**\n   * Whether to invoke the resize handler immediately after the listener is attached.\n   *\n   * Useful when initial layout measurements should be performed\n   * before any resize events occur.\n   *\n   * @default false\n   */\n  invokeOnMount?: boolean;\n  /**\n   * Throttle delay, in milliseconds, applied to the resize handler.\n   *\n   * When greater than `0`, the resize listener is throttled using\n   * `lodash.throttle` to reduce execution frequency.\n   *\n   * @default 0\n   */\n  throttleTime?: number;\n  /**\n   * Whether the resize listener should be active.\n   *\n   * @default true\n   */\n  enabled?: boolean;\n}\n\n/**\n * Subscribes to the window `resize` event and invokes the provided handler.\n *\n * The handler may optionally return a cleanup function. When provided, the\n * cleanup function is called before the next handler execution and when the\n * hook is cleaned up, such as on unmount or when the effect re-runs.\n *\n * The resize listener can be invoked immediately on mount and optionally\n * throttled to reduce execution frequency for expensive layout work.\n *\n * @param handler - Callback invoked when the resize listener runs.\n * @param options - Configuration options controlling listener behavior.\n *\n * @example\n * ```ts\n * useHoneyResize(() => {\n *   console.log('Window resized');\n * }, { throttleTime: 200 });\n * ```\n *\n * @example\n * ```ts\n * useHoneyResize(() => {\n *   const observer = createResizeSideEffect();\n *\n *   return () => {\n *     observer.disconnect();\n *   };\n * }, { invokeOnMount: true });\n * ```\n */\nexport const useHoneyResize = (\n  handler: UseHoneyResizeHandler,\n  { invokeOnMount = false, throttleTime = 0, enabled = true }: UseHoneyResizeOptions = {},\n) => {\n  const handlerRef = useHoneyLatest(handler);\n  const cleanupRef = useRef<ReturnType<UseHoneyResizeHandler>>(undefined);\n\n  useEffect(() => {\n    if (!enabled) {\n      return;\n    }\n\n    const runHandler = () => {\n      cleanupRef.current?.();\n\n      const cleanup = handlerRef.current();\n\n      cleanupRef.current = isFunction(cleanup) ? cleanup : undefined;\n    };\n\n    const handleResize: typeof runHandler | ReturnType<typeof throttle> = throttleTime\n      ? throttle(runHandler, throttleTime)\n      : runHandler;\n\n    window.addEventListener('resize', handleResize);\n\n    if (invokeOnMount) {\n      runHandler();\n    }\n\n    return () => {\n      if ('cancel' in handleResize && isFunction(handleResize.cancel)) {\n        handleResize.cancel();\n      }\n\n      window.removeEventListener('resize', handleResize);\n\n      cleanupRef.current?.();\n      cleanupRef.current = undefined;\n    };\n  }, [enabled, invokeOnMount, throttleTime]);\n};\n","import { resolveBoundedDelta } from '@react-hive/honey-utils';\n\nimport type { Nullable } from '../types';\n\ninterface ResolveAxisTranslateOptions {\n  /**\n   * Drag delta for the axis (deltaX or deltaY).\n   */\n  delta: number;\n  /**\n   * Current translate value for the axis.\n   */\n  translate: number;\n  /**\n   * Visible container size for the axis (width or height).\n   */\n  containerSize: number;\n  /**\n   * Overflow size for the axis.\n   */\n  overflowSize: number;\n  /**\n   * Overscroll window percentage.\n   */\n  overscrollPct: number;\n}\n\nexport const resolveAxisTranslate = ({\n  delta,\n  translate,\n  containerSize,\n  overflowSize,\n  overscrollPct,\n}: ResolveAxisTranslateOptions): Nullable<number> => {\n  if (overflowSize <= 0) {\n    return null;\n  }\n\n  const threshold = containerSize * (overscrollPct / 100);\n\n  return resolveBoundedDelta({\n    delta,\n    value: translate,\n    min: -(overflowSize + threshold),\n    max: threshold,\n  });\n};\n","import type { Axis } from '@react-hive/honey-utils';\nimport { getXOverflowWidth, getYOverflowHeight, parse2DMatrix } from '@react-hive/honey-utils';\n\nimport { resolveAxisTranslate } from './resolve-axis-translate';\n\ninterface ApplyScrollDeltaOptions {\n  axis: Axis;\n  container: HTMLElement;\n  deltaX: number;\n  deltaY: number;\n  overscrollPct: number;\n}\n\nexport const applyScrollDelta = ({\n  axis,\n  container,\n  deltaX,\n  deltaY,\n  overscrollPct,\n}: ApplyScrollDeltaOptions): boolean => {\n  const { translateX, translateY } = parse2DMatrix(container);\n\n  let nextX = translateX;\n  let nextY = translateY;\n  let shouldScroll = false;\n\n  if (axis === 'x' || axis === 'both') {\n    const next = resolveAxisTranslate({\n      delta: deltaX,\n      translate: translateX,\n      containerSize: container.clientWidth,\n      overflowSize: getXOverflowWidth(container),\n      overscrollPct,\n    });\n\n    if (next !== null) {\n      nextX = next;\n      shouldScroll = true;\n    }\n  }\n\n  if (axis === 'y' || axis === 'both') {\n    const next = resolveAxisTranslate({\n      delta: deltaY,\n      translate: translateY,\n      containerSize: container.clientHeight,\n      overflowSize: getYOverflowHeight(container),\n      overscrollPct,\n    });\n\n    if (next !== null) {\n      nextY = next;\n      shouldScroll = true;\n    }\n  }\n\n  if (shouldScroll) {\n    container.style.transform = `translate(${nextX}px, ${nextY}px)`;\n  }\n\n  return shouldScroll;\n};\n","import type { RefObject } from 'react';\nimport { useCallback, useEffect, useRef } from 'react';\nimport type { Axis } from '@react-hive/honey-utils';\nimport { resolveAxisDelta } from '@react-hive/honey-utils';\nimport * as CSS from 'csstype';\n\nimport type { Nullable } from './types';\nimport type {\n  UseHoneyDragHandlers,\n  UseHoneyDragOnEndHandler,\n  UseHoneyDragOnMoveHandler,\n  UseHoneyDragOnStartHandler,\n} from './use-honey-drag';\nimport { useHoneyDrag } from './use-honey-drag';\nimport { applyScrollDelta } from './utils';\nimport type { UseHoneyResizeHandler } from './use-honey-resize';\nimport { useHoneyResize } from './use-honey-resize';\n\nexport type HoneySyntheticScrollMode = 'default' | 'embedded';\n\nexport interface UseHoneySyntheticScrollOptions<Element extends HTMLElement> extends Pick<\n  UseHoneyDragHandlers<Element>,\n  'onStartDrag' | 'onEndDrag'\n> {\n  /**\n   * Axis along which synthetic scrolling is enabled.\n   *\n   * - `'x'` — horizontal only\n   * - `'y'` — vertical only\n   * - `'both'` — horizontal and vertical\n   *\n   * @default 'both'\n   */\n  axis?: Axis;\n  /**\n   * Percentage of the container size used as an overscroll buffer\n   * on each enabled axis.\n   *\n   * This allows limited dragging beyond the natural content bounds\n   * before movement is clamped.\n   *\n   * A value of `0` disables overscroll entirely.\n   *\n   * @default 0\n   */\n  overscrollPct?: number;\n  /**\n   * Controls how the hook applies scroll-related interaction styles\n   * (`touch-action` and `overscroll-behavior`) to the container.\n   *\n   * Synthetic scrolling often requires restricting native browser scrolling\n   * behavior to ensure consistent drag and wheel handling.\n   *\n   * However, in some embedded layouts (such as carousels placed inside a\n   * vertically scrollable page), applying these styles can unintentionally\n   * block natural page scrolling.\n   *\n   * ### Modes\n   * - `default` - Applies restrictive interaction styles:\n   *   - `overscroll-behavior: contain`\n   *   - Axis-aware `touch-action` (`pan-y`, `pan-x`, or `none`)\n   *\n   *   Recommended for standalone synthetic scroll containers.\n   *\n   * - `embedded` - Does not apply any interaction-blocking styles.\n   *\n   *   Recommended when the container is integrated into another scrollable\n   *   context (e.g. horizontal carousel inside a page), where native scroll\n   *   chaining must remain intact.\n   *\n   * @default default\n   */\n  mode?: HoneySyntheticScrollMode;\n  /**\n   * Whether to clear any applied translation transforms when the window resizes.\n   *\n   * Useful to keep the layout state consistent after dimension changes.\n   *\n   * @default true\n   */\n  resetOnResize?: boolean;\n  /**\n   * Enables synthetic scrolling driven by pointer-based scroll input,\n   * such as mouse wheels and trackpads.\n   *\n   * When enabled, scroll input is intercepted and converted into bounded\n   * translation using the same logic as drag gestures.\n   *\n   * When disabled, native scrolling behavior is preserved and no scroll\n   * input is handled by this hook.\n   *\n   * @default true\n   */\n  enablePointerScroll?: boolean;\n  /**\n   * Master toggle for the synthetic scroll behavior.\n   *\n   * When `true`, the hook:\n   * - Enables drag-based translation via {@link useHoneyDrag}.\n   * - Optionally resets transforms on resize via {@link useHoneyResize}.\n   * - Applies overscroll and touch-action styles.\n   * - Intercepts wheel / trackpad scroll input if {@link enablePointerScroll} is enabled.\n   *\n   * When `false`, the hook becomes completely inert:\n   * - No drag or wheel listeners are attached.\n   * - No transforms are applied.\n   * - Native scrolling behavior is preserved.\n   *\n   * Useful for conditionally disabling synthetic scrolling\n   * (e.g. mobile layouts, reduced motion, or feature flags).\n   *\n   * @default true\n   */\n  enabled?: boolean;\n}\n\n/**\n * Enables synthetic scrolling for a container using pointer-based drag gestures.\n *\n * Instead of relying on native scrollbars, this hook translates the container\n * using CSS transforms in response to drag input.\n *\n * ### Key characteristics\n * - Dragging is only applied when content overflows the container on a given axis.\n * - Movement is clamped within calculated bounds, with optional overscroll allowance.\n * - Scroll position is stored purely in `transform: translate(...)`.\n * - Active transforms can be automatically cleared on window resize.\n *\n * ### Internals\n * - Uses {@link useHoneyDrag} to track mouse / touch movement.\n * - Uses {@link useHoneyResize} to optionally reset scroll state on resize.\n *\n * @template Element - The HTML element type of the scrollable container.\n *\n * @param options - Configuration controlling axes, boundaries, and lifecycle behavior.\n *\n * @returns A ref that must be attached to the scrollable container element.\n */\nexport const useHoneySyntheticScroll = <Element extends HTMLElement>({\n  axis = 'both',\n  overscrollPct = 0,\n  onStartDrag,\n  onEndDrag,\n  mode = 'default',\n  resetOnResize = true,\n  enablePointerScroll = true,\n  enabled = true,\n}: UseHoneySyntheticScrollOptions<Element> = {}): RefObject<Nullable<Element>> => {\n  const containerRef = useRef<Nullable<Element>>(null);\n\n  const handleOnStartDrag = useCallback<UseHoneyDragOnStartHandler<Element>>(\n    async (...args) => {\n      return onStartDrag?.(...args) ?? true;\n    },\n    [onStartDrag],\n  );\n\n  const handleOnMoveDrag = useCallback<UseHoneyDragOnMoveHandler<Element>>(\n    container =>\n      async ({ deltaX, deltaY }) => {\n        applyScrollDelta({\n          container,\n          deltaX,\n          deltaY,\n          axis,\n          overscrollPct,\n        });\n\n        return true;\n      },\n    [axis, overscrollPct],\n  );\n\n  const handleOnEndDrag = useCallback<UseHoneyDragOnEndHandler<Element>>(\n    async (...args) => {\n      onEndDrag?.(...args);\n    },\n    [axis, overscrollPct, onEndDrag],\n  );\n\n  useHoneyDrag(containerRef, {\n    enabled,\n    onStartDrag: handleOnStartDrag,\n    onMoveDrag: handleOnMoveDrag,\n    onEndDrag: handleOnEndDrag,\n  });\n\n  const resizeHandler = useCallback<UseHoneyResizeHandler>(() => {\n    const container = containerRef.current;\n    if (container) {\n      container.style.removeProperty('transform');\n    }\n  }, []);\n\n  useHoneyResize(resizeHandler, {\n    enabled: enabled && resetOnResize,\n  });\n\n  useEffect(() => {\n    const container = containerRef.current;\n    if (!enabled || !container) {\n      return;\n    }\n\n    if (mode === 'default') {\n      const touchAction: CSS.Properties['touchAction'] =\n        axis === 'x' ? 'pan-y' : axis === 'y' ? 'pan-x' : 'none';\n\n      container.style.overscrollBehavior = 'contain';\n      container.style.touchAction = touchAction;\n    }\n\n    const handleOnWheel = (event: WheelEvent) => {\n      const { deltaX, deltaY } = resolveAxisDelta(\n        {\n          deltaX: event.deltaX,\n          deltaY: event.deltaY,\n        },\n        axis,\n      );\n\n      const didScroll = applyScrollDelta({\n        container,\n        deltaX,\n        deltaY,\n        axis,\n        overscrollPct,\n      });\n\n      if (didScroll) {\n        event.preventDefault();\n      }\n    };\n\n    if (enablePointerScroll) {\n      container.addEventListener('wheel', handleOnWheel, { passive: false });\n    }\n\n    return () => {\n      if (mode === 'default') {\n        container.style.removeProperty('overscroll-behavior');\n        container.style.removeProperty('touch-action');\n      }\n\n      if (enablePointerScroll) {\n        container.removeEventListener('wheel', handleOnWheel);\n      }\n    };\n  }, [mode, enabled, enablePointerScroll]);\n\n  return containerRef;\n};\n","import type { UseHoneySyntheticScrollOptions } from './use-honey-synthetic-scroll';\nimport { useHoneySyntheticScroll } from './use-honey-synthetic-scroll';\n\n/**\n * Enables synthetic horizontal (X-axis) scrolling for a container element\n * using pointer-based drag interactions.\n *\n * This is a convenience wrapper around {@link useHoneySyntheticScroll} with\n * the axis fixed to `'x'`.\n *\n * All behavior, boundaries, and lifecycle guarantees are identical to the\n * base hook, but limited to horizontal movement only.\n *\n * @template Element - The HTML element type of the scrollable container.\n *\n * @param options - Configuration options forwarded to\n * {@link useHoneySyntheticScroll}, excluding the `axis` option.\n *\n * @returns A ref that must be attached to the scrollable container element.\n */\nexport const useHoneySyntheticScrollX = <Element extends HTMLElement>(\n  options?: Omit<UseHoneySyntheticScrollOptions<Element>, 'axis'>,\n) =>\n  useHoneySyntheticScroll<Element>({\n    ...options,\n    axis: 'x',\n  });\n","import type { UseHoneySyntheticScrollOptions } from './use-honey-synthetic-scroll';\nimport { useHoneySyntheticScroll } from './use-honey-synthetic-scroll';\n\n/**\n * Enables synthetic vertical (Y-axis) scrolling for a container element\n * using pointer-based drag interactions.\n *\n * This is a convenience wrapper around {@link useHoneySyntheticScroll} with\n * the axis fixed to `'y'`.\n *\n * All behavior, boundaries, and lifecycle guarantees are identical to the\n * base hook, but limited to vertical movement only.\n *\n * @template Element - The HTML element type of the scrollable container.\n *\n * @param options - Configuration options forwarded to\n * {@link useHoneySyntheticScroll}, excluding the `axis` option.\n *\n * @returns A ref that must be attached to the scrollable container element.\n */\nexport const useHoneySyntheticScrollY = <Element extends HTMLElement>(\n  options?: Omit<UseHoneySyntheticScrollOptions<Element>, 'axis'>,\n) =>\n  useHoneySyntheticScroll<Element>({\n    ...options,\n    axis: 'y',\n  });\n","import { useCallback, useEffect, useState } from 'react';\n\nimport { useHoneyLatest } from './use-honey-latest';\nimport type { UseHoneyRafOnFrameHandler } from './use-honey-raf-loop';\nimport { useHoneyRafLoop } from './use-honey-raf-loop';\nimport type { Nullable } from './types';\n\n/**\n * Timer operating mode.\n *\n * - `countdown` — decreases time until it reaches `targetTimeMs`\n * - `countup` — increases time until it reaches `targetTimeMs` (if provided)\n */\ntype UseHoneyTimerMode = 'countdown' | 'countup';\n\ntype UseHoneyTimerOnEndHandler = () => void;\n\nexport interface UseHoneyTimerOptions {\n  /**\n   * Initial timer value in milliseconds.\n   *\n   * - Countdown: starting time\n   * - Count-up: initial offset\n   */\n  initialTimeMs: number;\n  /**\n   * Target time in milliseconds.\n   *\n   * - Countdown: usually `0`\n   * - Count-up: optional upper limit\n   *\n   * When reached, the timer stops and `onEnd` is invoked.\n   *\n   * @default 0\n   */\n  targetTimeMs?: number;\n  /**\n   * Direction in which the timer progresses.\n   *\n   * @default 'countdown'\n   */\n  mode?: UseHoneyTimerMode;\n  /**\n   * Whether the timer should automatically start on mount.\n   *\n   * @default false\n   */\n  autoStart?: boolean;\n  /**\n   * Optional callback invoked exactly once when the timer reaches the target time.\n   */\n  onEnd?: UseHoneyTimerOnEndHandler;\n}\n\n/**\n * Public control API returned by {@link useHoneyTimer}.\n */\nexport interface UseHoneyTimerApi {\n  /**\n   * Current timer value in milliseconds.\n   *\n   * This value updates over time while the timer is running.\n   */\n  timeMs: number;\n  /**\n   * Indicates whether the timer is currently progressing.\n   */\n  isRunning: boolean;\n  /**\n   * Starts the timer from `initialTimeMs`, resetting any previous state.\n   */\n  start: () => void;\n  /**\n   * Pauses the timer while preserving the current time value.\n   */\n  pause: () => void;\n  /**\n   * Resumes the timer from its current time value.\n   *\n   * Has no effect if the timer is already running.\n   */\n  resume: () => void;\n  /**\n   * Resets the timer to a specific time value.\n   *\n   * @param timeMs - Optional new timer value. Defaults to `initialTimeMs`.\n   */\n  reset: (timeMs?: number) => void;\n}\n\n/**\n * A high-precision timer hook built on top of {@link useHoneyRafLoop}.\n *\n * Features:\n * - Frame-accurate time progression using `requestAnimationFrame`\n * - Supports countdown and count-up modes\n * - Explicit lifecycle control (start / pause / resume / reset)\n * - Drift-free timing using delta-based updates\n * - Safe completion handling via `onEnd`\n *\n * Architectural notes:\n * - Time progression is handled imperatively via refs to avoid stale closures and unnecessary re-renders.\n * - React state is updated only with the derived timer value.\n * - RAF lifecycle is fully delegated to `useHoneyRafLoop`.\n *\n * @example\n * ```ts\n * const timer = useHoneyTimer({\n *   initialTimeMs: 10_000,\n *   targetTimeMs: 0,\n *   onEnd: () => console.log('Done'),\n * });\n *\n * timer.startTimer();\n * ```\n */\nexport const useHoneyTimer = ({\n  initialTimeMs,\n  targetTimeMs = 0,\n  mode = 'countdown',\n  autoStart = false,\n  onEnd,\n}: UseHoneyTimerOptions): UseHoneyTimerApi => {\n  const [timeMs, setTimeMs] = useState(initialTimeMs);\n  const timeRef = useHoneyLatest(timeMs);\n\n  const onEndRef = useHoneyLatest<Nullable<UseHoneyTimerOnEndHandler>>(onEnd);\n\n  /**\n   * RAF frame handler responsible for advancing the timer.\n   *\n   * - Computes the next timer value based on `deltaTimeMs`\n   * - Detects completion and stops the RAF loop\n   * - Updates React state with the derived value\n   */\n  const frameHandler = useCallback<UseHoneyRafOnFrameHandler>(\n    (deltaTimeMs, frameContext) => {\n      let nextTime =\n        mode === 'countdown' ? timeRef.current - deltaTimeMs : timeRef.current + deltaTimeMs;\n\n      let finished = false;\n\n      if (mode === 'countdown') {\n        if (nextTime <= targetTimeMs) {\n          nextTime = targetTimeMs;\n          finished = true;\n        }\n      } else if (targetTimeMs > 0 && nextTime >= targetTimeMs) {\n        nextTime = targetTimeMs;\n        finished = true;\n      }\n\n      timeRef.current = nextTime;\n      setTimeMs(nextTime);\n\n      if (finished) {\n        frameContext.stop();\n\n        onEndRef.current?.();\n      }\n    },\n    [mode, targetTimeMs],\n  );\n\n  const rafLoop = useHoneyRafLoop(frameHandler);\n\n  const start = useCallback(() => {\n    timeRef.current = initialTimeMs;\n\n    setTimeMs(initialTimeMs);\n    rafLoop.start();\n  }, [initialTimeMs, rafLoop.start]);\n\n  const pause = useCallback(() => {\n    rafLoop.stop();\n  }, [rafLoop.stop]);\n\n  const resume = useCallback(() => {\n    if (!rafLoop.isRunning) {\n      rafLoop.start();\n    }\n  }, [rafLoop.isRunning, rafLoop.start]);\n\n  const reset = useCallback(\n    (nextTimeMs = initialTimeMs) => {\n      rafLoop.stop();\n\n      timeRef.current = nextTimeMs;\n      setTimeMs(nextTimeMs);\n    },\n    [initialTimeMs, rafLoop.stop],\n  );\n\n  useEffect(() => {\n    if (autoStart) {\n      start();\n    }\n  }, [autoStart]);\n\n  return {\n    timeMs,\n    isRunning: rafLoop.isRunning,\n    start,\n    pause,\n    resume,\n    reset,\n  };\n};\n","import { useCallback, useRef } from 'react';\n\nimport type { Nullable } from './types';\n\ntype TargetKey = string;\n\n/**\n * API for managing pending targets keyed by a string identifier.\n *\n * Targets are stored temporarily and can be \"consumed\" once,\n * making this hook useful for deferred attachment scenarios\n * (e.g. IntersectionObserver, ResizeObserver, etc.).\n *\n * @template Target - The type of stored target (e.g. HTMLElement)\n * @template Key - A string union representing allowed keys\n */\nexport interface HoneyPendingTargetsApi<Target, Key extends TargetKey> {\n  /**\n   * Stores a target for the given key.\n   *\n   * @param key - Identifier for the target\n   * @param target - Target to store (or `null` to clear)\n   */\n  set: (key: Key, target: Nullable<Target>) => void;\n  /**\n   * Checks whether a non-null target exists for the given key.\n   *\n   * @param key - Identifier for the target\n   *\n   * @returns `true` if a target is present, otherwise `false`\n   */\n  has: (key: Key) => boolean;\n  /**\n   * Retrieves the current target for the given key without removing it.\n   *\n   * @param key - Identifier for the target\n   *\n   * @returns The stored target or `null` if none exists\n   */\n  get: (key: Key) => Nullable<Target>;\n  /**\n   * Retrieves and removes the target for the given key.\n   *\n   * After calling this, the stored value becomes `null`.\n   *\n   * @param key - Identifier for the target\n   *\n   * @returns The previously stored target or `null`\n   */\n  consume: (key: Key) => Nullable<Target>;\n  /**\n   * Clears all stored targets.\n   */\n  clear: () => void;\n}\n\n/**\n * Hook for managing pending (deferred) targets keyed by identifiers.\n *\n * Useful when targets may be assigned before a consumer is ready\n * (e.g. before an observer is initialized). Targets can later be\n * consumed and attached when needed.\n *\n * This hook does not trigger re-renders and is fully ref-based.\n *\n * @template Target - The type of stored target (e.g. HTMLElement)\n * @template Key - A string union representing allowed keys\n *\n * @returns API for managing pending targets\n *\n * @example\n * ```tsx\n * const pendingTargets = useHoneyPendingTargets<HTMLElement, 'top' | 'bottom'>();\n *\n * // store target before observer is ready\n * pendingTargets.set('top', el);\n *\n * // later\n * const target = pendingTargets.consume('top');\n * if (target) {\n *   observer.observe(target);\n * }\n * ```\n */\nexport const useHoneyPendingTargets = <\n  Target,\n  Key extends TargetKey = TargetKey,\n>(): HoneyPendingTargetsApi<Target, Key> => {\n  const pendingTargetsRef = useRef<Record<Key, Nullable<Target>>>(\n    {} as Record<Key, Nullable<Target>>,\n  );\n\n  const set = useCallback((key: Key, target: Nullable<Target>) => {\n    pendingTargetsRef.current[key] = target;\n  }, []);\n\n  const has = useCallback((key: Key) => pendingTargetsRef.current[key] != null, []);\n\n  const get = useCallback((key: Key) => pendingTargetsRef.current[key] ?? null, []);\n\n  const consume = useCallback((key: Key) => {\n    const target = pendingTargetsRef.current[key] ?? null;\n\n    pendingTargetsRef.current[key] = null;\n\n    return target;\n  }, []);\n\n  const clear = useCallback(() => {\n    pendingTargetsRef.current = {} as Record<Key, Nullable<Target>>;\n  }, []);\n\n  return {\n    set,\n    has,\n    get,\n    consume,\n    clear,\n  };\n};\n","import { useEffect, useState } from 'react';\n\nimport type { Nullable } from './types';\nimport { useHoneyLatest } from './use-honey-latest';\nimport { useHoneyOnChange } from './use-honey-on-change';\n\n/**\n * Revokes an object URL asynchronously.\n *\n * Delaying revocation avoids conflicts with cases where the URL\n * may still be used during the current execution frame.\n *\n * @param url - Object URL to revoke.\n */\nconst revokeObjectURL = (url: Nullable<string>) => {\n  if (url) {\n    // Revoke the URL asynchronously to avoid conflicts with its usage\n    setTimeout(() => URL.revokeObjectURL(url), 0);\n  }\n};\n\n/**\n * Creates and manages an object URL for the provided `Blob` or `MediaSource`.\n *\n * The hook:\n * - creates an object URL for the current object\n * - updates the URL when the object changes\n * - revokes the previous URL asynchronously to avoid revoking it while it may still be in use\n * - revokes the current URL on unmounting to prevent memory leaks\n *\n * This hook returns `null` when no object is provided.\n *\n * @param obj - Source object used to create an object URL.\n *\n * @returns Object URL for the provided object, or `null` when `obj` is not defined.\n *\n * @example\n * ```tsx\n * const objectUrl = useObjectUrl(mediaFileData);\n *\n * return objectUrl ? <img src={objectUrl} alt=\"Preview\" /> : null;\n * ```\n */\nexport const useHoneyObjectUrl = (\n  obj: Nullable<Blob | MediaSource> | undefined,\n): Nullable<string> => {\n  const [objectUrl, setObjectUrl] = useState<Nullable<string>>(() =>\n    obj ? URL.createObjectURL(obj) : null,\n  );\n\n  const objectUrlRef = useHoneyLatest(objectUrl);\n\n  useHoneyOnChange(obj, newObj => {\n    revokeObjectURL(objectUrlRef.current);\n\n    setObjectUrl(newObj ? URL.createObjectURL(newObj) : null);\n  });\n\n  useEffect(() => {\n    // Handles React StrictMode where the object URL may be revoked during\n    // the development double-invocation cycle and needs to be recreated\n    if (!objectUrlRef.current && obj) {\n      setObjectUrl(URL.createObjectURL(obj));\n    }\n\n    return () => {\n      setObjectUrl(null);\n\n      const urlToRevoke = objectUrlRef.current;\n      objectUrlRef.current = null;\n\n      revokeObjectURL(urlToRevoke);\n    };\n  }, []);\n\n  return objectUrl;\n};\n","import { useCallback, useState } from 'react';\n\n/**\n * Creates a stable callback that forces the component to rerender.\n *\n * Useful when mutable refs are updated and the component needs to rerun effects\n * or refresh derived values without storing meaningful state.\n *\n * @returns A stable callback that forces a rerender.\n *\n * @example\n * ```tsx\n * const forceRerender = useHoneyForceRerender();\n *\n * const setElementRef = useCallback((element: Nullable<HTMLDivElement>) => {\n *   elementRef.current = element;\n *\n *   forceRerender();\n * }, []);\n * ```\n */\nexport const useHoneyForceRerender = () => {\n  const [, setState] = useState(0);\n\n  return useCallback(() => {\n    setState(value => value + 1);\n  }, []);\n};\n","/**\n * Prevents the browser's default drag-and-drop behavior and stops the event\n * from bubbling further.\n *\n * This is required to allow custom drop handling and to prevent the browser\n * from opening dropped files.\n *\n * @param e - The event to prevent.\n */\nexport const preventDefaultEvent = (e: Event) => {\n  e.preventDefault();\n  e.stopPropagation();\n};\n","import { useCallback, useEffect, useRef } from 'react';\n\nimport { Nullable } from './types';\nimport { preventDefaultEvent } from './utils';\nimport { useHoneyLatest } from './use-honey-latest';\nimport { useHoneyForceRerender } from './use-honey-force-rerender';\n\n/**\n * Class name applied to the drop zone while a drag operation is active\n * anywhere within the document.\n */\nexport const HONEY_HIGHLIGHT_DROP_ZONE_CLASS_NAME = 'honey__highlight-drop-zone';\n\n/**\n * Class name applied to the drop zone while the dragged item is directly\n * over the drop zone element.\n */\nexport const HONEY_HIGHLIGHT_DROP_ZONE_OVER_CLASS_NAME = 'honey__highlight-drop-zone-over';\n\n/**\n * Callback invoked once when a drag operation enters the document.\n *\n * @template Element - The drop zone element type.\n *\n * @param dropZoneElement - The current drop zone element, or `null` if it is not mounted.\n * @param e - The native drag event.\n */\nexport type UseHoneyDragAndDropStartHandler<Element extends HTMLElement> = (\n  dropZoneElement: Nullable<Element>,\n  e: DragEvent,\n) => void;\n\n/**\n * Callback invoked when a drag operation ends.\n *\n * This can happen when the dragged item leaves the document or after a drop.\n *\n * @template Element - The drop zone element type.\n *\n * @param dropZoneElement - The current drop zone element, or `null` if it is not mounted.\n * @param e - The native drag event.\n */\nexport type UseHoneyDragAndDropEndHandler<Element extends HTMLElement> = (\n  dropZoneElement: Nullable<Element>,\n  e: DragEvent,\n) => void;\n\n/**\n * Callback invoked when an item is dropped on the drop zone element.\n *\n * @template Element - The drop zone element type.\n *\n * @param dropZoneElement - The current drop zone element, or `null` if it is not mounted.\n * @param e - The native drag event.\n */\nexport type UseHoneyDragAndDropDropHandler<Element extends HTMLElement> = (\n  dropZoneElement: Nullable<Element>,\n  e: DragEvent,\n) => void;\n\n/**\n * Callback ref used to register or unregister the drop zone element.\n *\n * Pass this handler to the target element's `ref` prop.\n *\n * @template Element - The drop zone element type.\n *\n * @param dropZoneElement - The mounted drop zone element, or `null` when unmounted.\n */\nexport type UseHoneyDragAndDropSetElementHandler<Element extends HTMLElement> = (\n  dropZoneElement: Nullable<Element>,\n) => void;\n\n/**\n * Options for configuring the `useDragAndDrop` hook.\n *\n * @template Element - The drop zone element type.\n */\nexport interface UseHoneyDragAndDropOptions<Element extends HTMLElement> {\n  /**\n   * Callback invoked when an item is dropped on the drop zone element.\n   */\n  onDrop: UseHoneyDragAndDropDropHandler<Element>;\n  /**\n   * Optional callback invoked once when a drag operation enters the document.\n   */\n  onDragStart?: UseHoneyDragAndDropStartHandler<Element>;\n  /**\n   * Optional callback invoked when a drag operation leaves the document or after drop.\n   */\n  onDragEnd?: UseHoneyDragAndDropEndHandler<Element>;\n  /**\n   * Whether drag-and-drop handling is enabled.\n   *\n   * When disabled, event listeners are not attached and highlight classes are removed.\n   *\n   * @default true\n   */\n  enabled?: boolean;\n}\n\n/**\n * Adds document-level drag tracking and drop-zone-specific drop handling.\n *\n * The hook highlights the drop zone when a drag operation enters the document,\n * applies an additional class when the dragged item is directly over the drop zone,\n * and invokes the provided callbacks for drag start, drag end, and drop events.\n *\n * Native event listeners are attached directly to the document and drop zone element.\n * Latest callback references are used internally, so changing callback props does not\n * require re-attaching all listeners.\n *\n * @template Element - The drop zone element type.\n *\n * @param options - Hook configuration.\n *\n * @returns An object containing a callback ref to assign to the drop zone element.\n *\n * @example\n * ```tsx\n * const { setDropZoneRef } = useDragAndDrop<HTMLDivElement>({\n *   onDrop: (dropZoneElement, e) => {\n *     const files = Array.from(e.dataTransfer?.files ?? []);\n *\n *     console.log(dropZoneElement, files);\n *   },\n * });\n *\n * return <div ref={setDropZoneRef}>Drop files here</div>;\n * ```\n */\nexport const useHoneyDragAndDrop = <Element extends HTMLElement>({\n  onDragStart,\n  onDragEnd,\n  onDrop,\n  enabled = true,\n}: UseHoneyDragAndDropOptions<Element>) => {\n  const forceRerender = useHoneyForceRerender();\n\n  const dropZoneRef = useRef<Nullable<Element>>(null);\n  /**\n   * Tracks nested document-level drag enter/leave events to avoid ending the\n   * drag operation too early when moving between child elements.\n   */\n  const dragDepthRef = useRef(0);\n  const isDraggingRef = useRef(false);\n\n  /**\n   * Latest callback refs prevent native listeners from capturing stale closures.\n   */\n  const onDragStartRef = useHoneyLatest(onDragStart);\n  const onDragEndRef = useHoneyLatest(onDragEnd);\n  const onDropRef = useHoneyLatest(onDrop);\n\n  const clearDropZoneClasses = useCallback((dropZoneElement = dropZoneRef.current) => {\n    dropZoneElement?.classList.remove(HONEY_HIGHLIGHT_DROP_ZONE_CLASS_NAME);\n    dropZoneElement?.classList.remove(HONEY_HIGHLIGHT_DROP_ZONE_OVER_CLASS_NAME);\n  }, []);\n\n  /**\n   * Starts a drag operation if one is not already active.\n   *\n   * @param e - The native drag event that started the operation.\n   */\n  const startDragging = useCallback((e: DragEvent) => {\n    if (isDraggingRef.current) {\n      return;\n    }\n\n    isDraggingRef.current = true;\n\n    dropZoneRef.current?.classList.add(HONEY_HIGHLIGHT_DROP_ZONE_CLASS_NAME);\n\n    onDragStartRef.current?.(dropZoneRef.current, e);\n  }, []);\n\n  /**\n   * Ends the current drag operation and clears all drag-related state.\n   *\n   * @param e - The native drag event that ended the operation.\n   */\n  const endDragging = useCallback((e: DragEvent) => {\n    if (!isDraggingRef.current) {\n      return;\n    }\n\n    dragDepthRef.current = 0;\n    isDraggingRef.current = false;\n\n    clearDropZoneClasses();\n\n    onDragEndRef.current?.(dropZoneRef.current, e);\n  }, []);\n\n  /**\n   * Handles drag entering the document.\n   *\n   * Increments drag depth and starts the drag operation if needed.\n   *\n   * @param e - The native drag event.\n   */\n  const handleDocumentDragEnter = useCallback((e: DragEvent) => {\n    preventDefaultEvent(e);\n\n    dragDepthRef.current += 1;\n\n    startDragging(e);\n  }, []);\n\n  /**\n   * Handles dragging over the document.\n   *\n   * Prevents the browser's default drag behavior.\n   *\n   * @param e - The native drag event.\n   */\n  const handleDocumentDragOver = useCallback((e: DragEvent) => {\n    preventDefaultEvent(e);\n  }, []);\n\n  /**\n   * Handles drag leaving the document.\n   *\n   * Decrements drag depth and ends the drag operation when no nested drag targets remain.\n   *\n   * @param e - The native drag event.\n   */\n  const handleDocumentDragLeave = useCallback((e: DragEvent) => {\n    preventDefaultEvent(e);\n\n    dragDepthRef.current = Math.max(0, dragDepthRef.current - 1);\n\n    if (dragDepthRef.current === 0) {\n      endDragging(e);\n    }\n  }, []);\n\n  /**\n   * Handles dropping anywhere in the document.\n   *\n   * This is used only to clean up drag state when the item is dropped outside\n   * the actual drop zone.\n   *\n   * @param e - The native drag event.\n   */\n  const handleDocumentDrop = useCallback((e: DragEvent) => {\n    preventDefaultEvent(e);\n\n    endDragging(e);\n  }, []);\n\n  /**\n   * Handles dragging directly over the drop zone element.\n   *\n   * Adds the drop-zone-over highlight class.\n   *\n   * @param e - The native drag event.\n   */\n  const handleDropZoneDragOver = useCallback((e: DragEvent) => {\n    preventDefaultEvent(e);\n\n    dropZoneRef.current?.classList.add(HONEY_HIGHLIGHT_DROP_ZONE_OVER_CLASS_NAME);\n  }, []);\n\n  /**\n   * Handles drag leaving the drop zone element.\n   *\n   * Removes the drop-zone-over highlight class.\n   *\n   * @param e - The native drag event.\n   */\n  const handleDropZoneDragLeave = useCallback((e: DragEvent) => {\n    preventDefaultEvent(e);\n\n    dropZoneRef.current?.classList.remove(HONEY_HIGHLIGHT_DROP_ZONE_OVER_CLASS_NAME);\n  }, []);\n\n  /**\n   * Handles dropping directly on the drop zone element.\n   *\n   * Invokes the latest `onDrop` callback and then ends the active drag operation.\n   *\n   * @param e - The native drag event.\n   */\n  const handleDrop = useCallback((e: DragEvent) => {\n    preventDefaultEvent(e);\n\n    onDropRef.current(dropZoneRef.current, e);\n\n    endDragging(e);\n  }, []);\n\n  /**\n   * Callback ref used to register the drop zone element.\n   *\n   * A rerender is triggered so the effect can attach listeners to the latest\n   * mounted element.\n   *\n   * @param dropZoneElement - The mounted drop zone element, or `null` when unmounted.\n   */\n  const setDropZoneRef = useCallback<UseHoneyDragAndDropSetElementHandler<Element>>(\n    dropZoneElement => {\n      dropZoneRef.current = dropZoneElement;\n\n      forceRerender();\n    },\n    [],\n  );\n\n  useEffect(() => {\n    const dropZoneElement = dropZoneRef.current;\n\n    if (!enabled || !dropZoneElement) {\n      clearDropZoneClasses();\n\n      return;\n    }\n\n    document.addEventListener('dragenter', handleDocumentDragEnter);\n    document.addEventListener('dragover', handleDocumentDragOver);\n    document.addEventListener('dragleave', handleDocumentDragLeave);\n    document.addEventListener('drop', handleDocumentDrop);\n\n    dropZoneElement.addEventListener('dragover', handleDropZoneDragOver);\n    dropZoneElement.addEventListener('dragleave', handleDropZoneDragLeave);\n    dropZoneElement.addEventListener('drop', handleDrop);\n\n    return () => {\n      document.removeEventListener('dragenter', handleDocumentDragEnter);\n      document.removeEventListener('dragover', handleDocumentDragOver);\n      document.removeEventListener('dragleave', handleDocumentDragLeave);\n      document.removeEventListener('drop', handleDocumentDrop);\n\n      dropZoneElement.removeEventListener('dragover', handleDropZoneDragOver);\n      dropZoneElement.removeEventListener('dragleave', handleDropZoneDragLeave);\n      dropZoneElement.removeEventListener('drop', handleDrop);\n\n      clearDropZoneClasses(dropZoneElement);\n\n      dragDepthRef.current = 0;\n      isDraggingRef.current = false;\n    };\n  }, [enabled]);\n\n  return {\n    dropZoneRef,\n    setDropZoneRef,\n  };\n};\n"],"names":["FUNC_ERROR_TEXT","reTrim","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","parseInt","freeGlobal","g","Object","freeSelf","self","root","Function","objectToString","prototype","toString","nativeMax","Math","max","nativeMin","min","now","Date","isObject","value","type","toNumber","isObjectLike","call","isSymbol","other","valueOf","replace","isBinary","test","slice","module","exports","func","wait","options","leading","trailing","TypeError","lastArgs","lastThis","maxWait","result","timerId","lastCallTime","lastInvokeTime","maxing","invokeFunc","time","args","thisArg","undefined","apply","shouldInvoke","timeSinceLastCall","timerExpired","trailingEdge","setTimeout","remainingWait","debounced","isInvoking","arguments","this","leadingEdge","cancel","clearTimeout","flush","debounce","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","defineProperty","enumerable","get","globalThis","e","window","obj","prop","hasOwnProperty","useHoneyLatest","ref","current","R","se","scrollHeight","clientHeight","Ae","delta","t","r","useHoneyRafLoop","onFrame","autoStart","resumeOnVisibility","maxDeltaMs","onError","isRunning","setIsRunning","isRunningRef","rafIdRef","lastTimeMsRef","onFrameRef","onErrorRef","stop","cancelAnimationFrame","loop","timeMs","deltaTimeMs","requestAnimationFrame","start","onVisibilityChange","document","hidden","addEventListener","removeEventListener","useHoneyDecay","initialValue","friction","minVelocityPxMs","emaAlpha","onStop","setValue","valueRef","velocityPxMsRef","hasActiveInertiaRef","minRef","maxRef","onStopRef","frameHandler","frameContext","inertia","velocityPxMs","l","i","abs","s","c","exp","u","rafLoop","setBounds","nextMin","nextMax","currentValue","nextValue","startFrom","useHoneyDocumentKeyUp","onKeyUp","listenKeys","enabled","preventDefault","onKeyUpRef","listenKeysRef","handleKeyUp","keyCode","code","includes","useHoneyDrag","draggableElementRef","skipOnEndDragWhenStopped","onMoveDrag","onStartDrag","onEndDrag","onStartDragRef","onMoveDragRef","onEndDragRef","draggableElement","onMove","isDragging","startX","startY","lastX","lastY","lastMoveTimeMs","velocityXPxMs","velocityYPxMs","startDrag","async","clientX","clientY","performance","releaseDragEvents","mouseMoveHandler","capture","mouseUpHandler","touchMoveHandler","touchEndHandler","touchCancelHandler","releaseDrag","shouldTriggerOnEndDrag","endContext","deltaX","deltaY","stopDrag","moveHandler","nowMs","distanceX","distanceY","isContinue","touch","touches","touchStartHandler","stopPropagation","passive","mouseDownHandler","useHoneyOnChange","state","onChange","prevStateRef","useHoneyResize","handler","invokeOnMount","throttleTime","handlerRef","cleanupRef","runHandler","cleanup","handleResize","resolveAxisTranslate","translate","containerSize","overflowSize","overscrollPct","threshold","applyScrollDelta","axis","container","translateX","translateY","getComputedStyle","getPropertyValue","match","scaleX","scaleY","skewX","skewY","split","map","parseFloat","nextX","nextY","shouldScroll","next","clientWidth","scrollWidth","style","transform","useHoneySyntheticScroll","mode","resetOnResize","enablePointerScroll","containerRef","handleOnStartDrag","handleOnMoveDrag","handleOnEndDrag","resizeHandler","removeProperty","touchAction","overscrollBehavior","handleOnWheel","event","allowFallback","invert","useHoneySyntheticScrollX","useHoneySyntheticScrollY","useHoneyTimer","initialTimeMs","targetTimeMs","onEnd","setTimeMs","timeRef","onEndRef","nextTime","finished","pause","resume","reset","nextTimeMs","useHoneyPendingTargets","pendingTargetsRef","set","target","has","consume","clear","revokeObjectURL","url","URL","useHoneyObjectUrl","objectUrl","setObjectUrl","createObjectURL","objectUrlRef","newObj","urlToRevoke","useHoneyForceRerender","setState","preventDefaultEvent","HONEY_HIGHLIGHT_DROP_ZONE_CLASS_NAME","HONEY_HIGHLIGHT_DROP_ZONE_OVER_CLASS_NAME","useHoneyDragAndDrop","onDragStart","onDragEnd","onDrop","forceRerender","dropZoneRef","dragDepthRef","isDraggingRef","onDragStartRef","onDragEndRef","onDropRef","clearDropZoneClasses","dropZoneElement","classList","remove","startDragging","add","endDragging","handleDocumentDragEnter","handleDocumentDragOver","handleDocumentDragLeave","handleDocumentDrop","handleDropZoneDragOver","handleDropZoneDragLeave","handleDrop","setDropZoneRef"],"sourceRoot":""}