{"version":3,"sources":["jsdelivr-header.js","/npm/jquery-param-fn@1.0.3/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,aAEA,SAAS,YAAY,GACnB,GAAI,MAAM,QAAQ,GAIhB,EAAM,EAAI,QAAO,SAAU,EAAK,GAS9B,OARI,GAAQ,EAAK,OACW,iBAAf,EAAK,MAEd,EAAI,EAAK,MAAQ,EAAK,MAAM,WAE5B,EAAI,EAAK,MAAQ,EAAK,OAGnB,CACT,GAAG,CAAC,QACC,GAAmB,iBAAR,EAIhB,EAAM,EAAI,MAAM,IAAI,QAAO,SAAU,EAAK,EAAI,GAC7B,OAAf,EAAI,GAAO,EAAW,CACxB,GAAG,CAAC,QACC,GAAmB,iBAAR,GAAmC,kBAAR,EAC3C,MAAO,GAIT,MAAM,EAAuB,SAAS,EAAK,GACzC,OAAO,OAAO,KAAK,GAAK,KAAI,SAAU,GACpC,IAAI,EAAQ,EAAI,GAKhB,GAJI,IAEF,EAAM,mBAAmB,IAAM,EAAM,MAEnC,QACF,OAAO,EAAS,EAAM,IACjB,GAAI,MAAM,QAAQ,GAAQ,CAC/B,MAAM,EAAY,EAAS,EAa3B,OAZoB,EAAM,KAAI,SAAU,EAAW,GACjD,MAAM,EAAQ,CAAC,EACU,iBAAd,GAA0B,MAAM,QAAQ,GACjD,EAAM,GAAO,EAGb,EAAM,IAAM,EAId,OAFmB,EAAqB,EAAO,GAE7B,KAAK,IACzB,IACmB,KAAK,IAC1B,CAAO,GAAqB,iBAAV,EAAoB,CAGpC,OADuB,EAAqB,EAD1B,EAAS,GAEL,KAAK,IAC7B,CAEE,OADA,EAAQ,mBAAmB,GACpB,EAAS,EAAM,IAAM,CAEhC,GACF,EACA,OAAO,EAAqB,EAAK,IAAI,KAAK,IAC5C,CAEA,OAAO,QAAU","file":"/npm/jquery-param-fn@1.0.3/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/jquery-param-fn@1.0.3/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\";\n\nfunction queryParams(obj) {\n  if (Array.isArray(obj)) {\n    //JQuery expects array elements to be {name: <name>, value: <value>}\n    //so we convert the array into an object so the rest of the logic\n    //remains the same\n    obj = obj.reduce(function (acc, elem) {\n      if (elem && elem.name) {\n        if (typeof elem.value === 'object') {\n          //JQuery uses the result of toString() (e.g. '[object Object]') when value is an object\n          acc[elem.name] = elem.value.toString();\n        } else {\n          acc[elem.name] = elem.value;\n        }\n      }\n      return acc;\n    }, {});\n  } else if (typeof obj === 'string') {\n    //JQuery treats a string as an array of chars, so\n    //we map it to an object where fields are the array\n    //indexes\n    obj = obj.split('').reduce(function (acc, el, idx) {\n      acc[idx] = el; return acc;\n    }, {});\n  } else if (typeof obj === 'number' || typeof obj === 'boolean') {\n    return '';\n  }\n\n  // Converts an object or array into an a list of query params\n  const objectToListOfParams = function(obj, prefix) {\n    return Object.keys(obj).map(function (key) {\n      var value = obj[key];\n      if (prefix) {\n        //Properties of inner objects are surrounded with []\n        key = encodeURIComponent('[' + key + ']');\n      }\n      if (value === undefined || value === null) {\n        return prefix + key + '=';\n      } else if (Array.isArray(value)) {\n        const newPrefix = prefix + key;\n        const innerParams = value.map(function (innerElem, idx) {\n          const asObj = {};\n          if (typeof innerElem === 'object' || Array.isArray(innerElem)) {\n            asObj[idx] = innerElem;\n          } else {\n            // If it's a basic value (string, number, etc) use empty key\n            asObj[''] = innerElem;\n          }\n          const elemParams = objectToListOfParams(asObj, newPrefix);\n\n          return elemParams.join('&');\n        });\n        return innerParams.join('&');\n      } else if (typeof value === 'object') {\n        const newPrefix = prefix + key;\n        const innerObjParams = objectToListOfParams(value, newPrefix);\n        return innerObjParams.join('&');\n      } else {\n        value = encodeURIComponent(value);\n        return prefix + key + '=' + value;\n      }\n    });\n  };\n  return objectToListOfParams(obj, '').join('&');\n}\n\nmodule.exports = queryParams;"]}