"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("./get.js");function g(e,t,o,l){if(!t.length)return o;const[r,...f]=t;let n;return!e&&typeof r=="number"?n=[]:Array.isArray(e)?n=[...e]:n={...e},l&&o===void 0&&f.length===1?delete n[r][f[0]]:n[r]=g(n[r],f,o,l),n}function i(e,t,o,l=!1){return t.length&&l&&o===void 0&&!u.default(e,t.slice(0,-1))?e:g(e,t,o,l)}function b(e){return typeof e=="object"&&e!==null&&Object.getPrototypeOf(e)===Object.prototype}function y(e){return Array.isArray(e)?[]:{}}const A=typeof Reflect>"u"?Object.keys:Reflect.ownKeys;function O(...e){let t=y(e[0]);return e.forEach(o=>{function l(r,f){const n=new Set(f),c=u.default(o,r),s=Array.isArray(c);if(s||b(c)){if(!n.has(c)){n.add(c);const a=u.default(t,r);s?t=i(t,r,[]):(!a||typeof a!="object")&&(t=i(t,r,y(c))),A(c).forEach(d=>{l([...r,d],n)})}}else t=i(t,r,c)}l([])}),t}exports.default=i;exports.merge=O;
