"use strict";const n=require("./index.cjs226.js"),E=require("./index.cjs237.js");function a(i){return n.isPlainObject(i)||n.isArray(i)}function h(i){return n.endsWith(i,"[]")?i.slice(0,-2):i}function O(i,e,s){return i?i.concat(e).map(function(o,d){return o=h(o),!s&&d?"["+o+"]":o}).join(s?".":""):e}function T(i){return n.isArray(i)&&!i.some(a)}const S=n.toFlatObject(n,{},null,function(e){return/^is[A-Z]/.test(e)});function g(i,e,s){if(!n.isObject(i))throw new TypeError("target must be an object");e=e||new FormData,s=n.toFlatObject(s,{metaTokens:!0,dots:!1,indexes:!1},!1,function(t,u){return!n.isUndefined(u[t])});const p=s.metaTokens,o=s.visitor||m,d=s.dots,w=s.indexes,j=(s.Blob||typeof Blob<"u"&&Blob)&&n.isSpecCompliantForm(e);if(!n.isFunction(o))throw new TypeError("visitor must be a function");function l(r){if(r===null)return"";if(n.isDate(r))return r.toISOString();if(n.isBoolean(r))return r.toString();if(!j&&n.isBlob(r))throw new E("Blob is not supported. Use a Buffer instead.");return n.isArrayBuffer(r)||n.isTypedArray(r)?j&&typeof Blob=="function"?new Blob([r]):Buffer.from(r):r}function m(r,t,u){let c=r;if(r&&!u&&typeof r=="object"){if(n.endsWith(t,"{}"))t=p?t:t.slice(0,-2),r=JSON.stringify(r);else if(n.isArray(r)&&T(r)||(n.isFileList(r)||n.endsWith(t,"[]"))&&(c=n.toArray(r)))return t=h(t),c.forEach(function(b,x){!(n.isUndefined(b)||b===null)&&e.append(w===!0?O([t],x,d):w===null?t:t+"[]",l(b))}),!1}return a(r)?!0:(e.append(O(u,t,d),l(r)),!1)}const B=[],F=Object.assign(S,{defaultVisitor:m,convertValue:l,isVisitable:a});function A(r,t){if(!n.isUndefined(r)){if(B.indexOf(r)!==-1)throw Error("Circular reference detected in "+t.join("."));B.push(r),n.forEach(r,function(c,f){(!(n.isUndefined(c)||c===null)&&o.call(e,c,n.isString(f)?f.trim():f,t,F))===!0&&A(c,t?t.concat(f):[f])}),B.pop()}}if(!n.isObject(i))throw new TypeError("data must be an object");return A(i),e}module.exports=g;
//# sourceMappingURL=index.cjs236.js.map
