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AE9C,IACE,EAAK,UACP,CAAE,MACF,KAEF,OAAO,WACL,GAAM,aACN,GACF,CACF","file":"/npm/@zag-js/focus-trap@1.35.3/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@zag-js/focus-trap@1.35.3/dist/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n  for (var name in all)\n    __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n  if (from && typeof from === \"object\" || typeof from === \"function\") {\n    for (let key of __getOwnPropNames(from))\n      if (!__hasOwnProp.call(to, key) && key !== except)\n        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n  }\n  return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/index.ts\nvar index_exports = {};\n__export(index_exports, {\n  FocusTrap: () => import_focus_trap.FocusTrap,\n  trapFocus: () => trapFocus\n});\nmodule.exports = __toCommonJS(index_exports);\nvar import_dom_query = require(\"@zag-js/dom-query\");\nvar import_focus_trap = require(\"./focus-trap.js\");\nfunction trapFocus(el, options = {}) {\n  let trap;\n  const cleanup = (0, import_dom_query.raf)(() => {\n    const elements = Array.isArray(el) ? el : [el];\n    const resolvedElements = elements.map((e) => typeof e === \"function\" ? e() : e).filter((e) => e != null);\n    if (resolvedElements.length === 0) return;\n    const primaryEl = resolvedElements[0];\n    trap = new import_focus_trap.FocusTrap(resolvedElements, {\n      escapeDeactivates: false,\n      allowOutsideClick: true,\n      preventScroll: true,\n      returnFocusOnDeactivate: true,\n      delayInitialFocus: false,\n      fallbackFocus: primaryEl,\n      ...options,\n      document: (0, import_dom_query.getDocument)(primaryEl)\n    });\n    try {\n      trap.activate();\n    } catch {\n    }\n  });\n  return function destroy() {\n    trap?.deactivate();\n    cleanup();\n  };\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n  FocusTrap,\n  trapFocus\n});\n"]}