| 4957 | const ctorRegistry = utils.initCtorRegistry(globalObject); |
| 4958 | class URLSearchParams2 { |
| 4959 | constructor() { |
| 4960 | const args = []; |
| 4961 | { |
| 4962 | let curArg = arguments[0]; |
| 4963 | if (curArg !== void 0) { |
| 4964 | if (utils.isObject(curArg)) { |
| 4965 | if (curArg[Symbol.iterator] !== void 0) { |
| 4966 | if (!utils.isObject(curArg)) { |
| 4967 | throw new globalObject.TypeError( |
| 4968 | "Failed to construct 'URLSearchParams': parameter 1 sequence is not an iterable object." |
| 4969 | ); |
| 4970 | } else { |
| 4971 | const V6 = []; |
| 4972 | const tmp = curArg; |
| 4973 | for (let nextItem of tmp) { |
| 4974 | if (!utils.isObject(nextItem)) { |
| 4975 | throw new globalObject.TypeError( |
| 4976 | "Failed to construct 'URLSearchParams': parameter 1 sequence's element is not an iterable object." |
| 4977 | ); |
| 4978 | } else { |
| 4979 | const V7 = []; |
| 4980 | const tmp2 = nextItem; |
| 4981 | for (let nextItem2 of tmp2) { |
| 4982 | nextItem2 = conversions["USVString"](nextItem2, { |
| 4983 | context: "Failed to construct 'URLSearchParams': parameter 1 sequence's element's element", |
| 4984 | globals: globalObject |
| 4985 | }); |
| 4986 | V7.push(nextItem2); |
| 4987 | } |
| 4988 | nextItem = V7; |
| 4989 | } |
| 4990 | V6.push(nextItem); |
| 4991 | } |
| 4992 | curArg = V6; |
| 4993 | } |
| 4994 | } else { |
| 4995 | if (!utils.isObject(curArg)) { |
| 4996 | throw new globalObject.TypeError( |
| 4997 | "Failed to construct 'URLSearchParams': parameter 1 record is not an object." |
| 4998 | ); |
| 4999 | } else { |
| 5000 | const result = /* @__PURE__ */ Object.create(null); |
| 5001 | for (const key of Reflect.ownKeys(curArg)) { |
| 5002 | const desc = Object.getOwnPropertyDescriptor(curArg, key); |
| 5003 | if (desc && desc.enumerable) { |
| 5004 | let typedKey = key; |
| 5005 | typedKey = conversions["USVString"](typedKey, { |
| 5006 | context: "Failed to construct 'URLSearchParams': parameter 1 record's key", |
| 5007 | globals: globalObject |
| 5008 | }); |
| 5009 | let typedValue = curArg[key]; |
| 5010 | typedValue = conversions["USVString"](typedValue, { |
| 5011 | context: "Failed to construct 'URLSearchParams': parameter 1 record's value", |
| 5012 | globals: globalObject |
| 5013 | }); |
| 5014 | result[typedKey] = typedValue; |
| 5015 | } |
| 5016 | } |