@fern-api/python-dynamic-snippets 4.43.0 → 4.45.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/index.cjs +37 -0
  2. package/dist/index.cjs.map +1 -0
  3. package/dist/index.d.cts +165 -0
  4. package/dist/index.d.ts +165 -0
  5. package/dist/index.js +37 -0
  6. package/dist/index.js.map +1 -0
  7. package/package.json +9 -10
  8. package/cjs/DynamicSnippetsGenerator.cjs +0 -42
  9. package/cjs/DynamicSnippetsGenerator.cjs.map +0 -1
  10. package/cjs/DynamicSnippetsGenerator.d.cts +0 -25
  11. package/cjs/DynamicSnippetsGeneratorContext-4_I0JAlU.d.cts +0 -87
  12. package/cjs/EndpointSnippetGenerator.cjs +0 -31
  13. package/cjs/EndpointSnippetGenerator.cjs.map +0 -1
  14. package/cjs/EndpointSnippetGenerator.d.cts +0 -68
  15. package/cjs/context/DynamicSnippetsGeneratorContext.cjs +0 -42
  16. package/cjs/context/DynamicSnippetsGeneratorContext.cjs.map +0 -1
  17. package/cjs/context/DynamicSnippetsGeneratorContext.d.cts +0 -5
  18. package/cjs/context/DynamicTypeLiteralMapper.cjs +0 -31
  19. package/cjs/context/DynamicTypeLiteralMapper.cjs.map +0 -1
  20. package/cjs/context/DynamicTypeLiteralMapper.d.cts +0 -5
  21. package/cjs/context/FilePropertyMapper.cjs +0 -31
  22. package/cjs/context/FilePropertyMapper.cjs.map +0 -1
  23. package/cjs/context/FilePropertyMapper.d.cts +0 -5
  24. package/cjs/index.cjs +0 -42
  25. package/cjs/index.cjs.map +0 -1
  26. package/cjs/index.d.cts +0 -7
  27. package/esm/DynamicSnippetsGenerator.d.ts +0 -25
  28. package/esm/DynamicSnippetsGenerator.js +0 -2
  29. package/esm/DynamicSnippetsGenerator.js.map +0 -1
  30. package/esm/DynamicSnippetsGeneratorContext-4_I0JAlU.d.ts +0 -87
  31. package/esm/EndpointSnippetGenerator.d.ts +0 -68
  32. package/esm/EndpointSnippetGenerator.js +0 -2
  33. package/esm/EndpointSnippetGenerator.js.map +0 -1
  34. package/esm/chunk-2KHLQG2A.js +0 -2
  35. package/esm/chunk-2KHLQG2A.js.map +0 -1
  36. package/esm/chunk-2SPAKVUZ.js +0 -2
  37. package/esm/chunk-2SPAKVUZ.js.map +0 -1
  38. package/esm/chunk-3XEFLXHY.js +0 -2
  39. package/esm/chunk-3XEFLXHY.js.map +0 -1
  40. package/esm/chunk-DP6NTUTQ.js +0 -2
  41. package/esm/chunk-DP6NTUTQ.js.map +0 -1
  42. package/esm/chunk-HGKGDQ5J.js +0 -15
  43. package/esm/chunk-HGKGDQ5J.js.map +0 -1
  44. package/esm/chunk-NHAFJ5OA.js +0 -31
  45. package/esm/chunk-NHAFJ5OA.js.map +0 -1
  46. package/esm/chunk-ULECZXWB.js +0 -2
  47. package/esm/chunk-ULECZXWB.js.map +0 -1
  48. package/esm/context/DynamicSnippetsGeneratorContext.d.ts +0 -5
  49. package/esm/context/DynamicSnippetsGeneratorContext.js +0 -2
  50. package/esm/context/DynamicSnippetsGeneratorContext.js.map +0 -1
  51. package/esm/context/DynamicTypeLiteralMapper.d.ts +0 -5
  52. package/esm/context/DynamicTypeLiteralMapper.js +0 -2
  53. package/esm/context/DynamicTypeLiteralMapper.js.map +0 -1
  54. package/esm/context/FilePropertyMapper.d.ts +0 -5
  55. package/esm/context/FilePropertyMapper.js +0 -2
  56. package/esm/context/FilePropertyMapper.js.map +0 -1
  57. package/esm/index.d.ts +0 -7
  58. package/esm/index.js +0 -2
  59. package/esm/index.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../node_modules/.pnpm/@esbuild-plugins+node-globals-polyfill@0.2.3_esbuild@0.27.0/node_modules/@esbuild-plugins/node-globals-polyfill/process.js","../../../../../node_modules/.pnpm/@esbuild-plugins+node-globals-polyfill@0.2.3_esbuild@0.27.0/node_modules/@esbuild-plugins/node-globals-polyfill/Buffer.js","../../../../../node_modules/.pnpm/@esbuild-plugins+node-globals-polyfill@0.2.3_esbuild@0.27.0/node_modules/@esbuild-plugins/node-globals-polyfill/_buffer.js","../../src/EndpointSnippetGenerator.ts","../../../../../packages/commons/core-utils/src/index.ts","../../../../../packages/commons/core-utils/src/assert.ts","../../../../browser-compatible-base/src/ast/index.ts","../../../../browser-compatible-base/src/ast/AbstractAstNode.ts","../../../../browser-compatible-base/src/utils/stacktrace.ts","../../../../browser-compatible-base/src/ast/AbstractWriter.ts","../../../../browser-compatible-base/src/utils/index.ts","../../../../browser-compatible-base/src/ast/CodeBlock.ts","../../../../browser-compatible-base/src/dynamic-snippets/index.ts","../../../../browser-compatible-base/src/dynamic-snippets/ErrorReporter.ts","../../../../browser-compatible-base/src/dynamic-snippets/Scope.ts","../../../ast/src/index.ts","../../../ast/src/python.ts","../../../ast/src/AccessAttribute.ts","../../../ast/src/core/AstNode.ts","../../../ast/src/core/Writer.ts","../../../ast/src/Assign.ts","../../../ast/src/BaseInvocation.ts","../../../ast/src/Class.ts","../../../ast/src/ClassInstantiation.ts","../../../ast/src/CodeBlock.ts","../../../ast/src/Comment.ts","../../../ast/src/Decorator.ts","../../../ast/src/Field.ts","../../../ast/src/Lambda.ts","../../../ast/src/LambdaParameter.ts","../../../ast/src/Parameter.ts","../../../ast/src/Method.ts","../../../ast/src/MethodArgument.ts","../../../ast/src/MethodInvocation.ts","../../../ast/src/Operator.ts","../../../ast/src/OperatorType.ts","../../../ast/src/PythonFile.ts","../../../ast/src/core/utils.ts","../../../ast/src/StarImport.ts","../../../ast/src/Reference.ts","../../../ast/src/Type.ts","../../../ast/src/TypeInstantiation.ts"],"sourcesContent":["// shim for using process in browser\n// based off https://github.com/defunctzombie/node-process/blob/master/browser.js\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined')\n}\nfunction defaultClearTimeout() {\n throw new Error('clearTimeout has not been defined')\n}\nvar cachedSetTimeout = defaultSetTimout\nvar cachedClearTimeout = defaultClearTimeout\nif (typeof global.setTimeout === 'function') {\n cachedSetTimeout = setTimeout\n}\nif (typeof global.clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout\n}\n\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0)\n }\n // if setTimeout wasn't available but was latter defined\n if (\n (cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) &&\n setTimeout\n ) {\n cachedSetTimeout = setTimeout\n return setTimeout(fun, 0)\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0)\n } catch (e) {\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0)\n } catch (e) {\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0)\n }\n }\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker)\n }\n // if clearTimeout wasn't available but was latter defined\n if (\n (cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) &&\n clearTimeout\n ) {\n cachedClearTimeout = clearTimeout\n return clearTimeout(marker)\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker)\n } catch (e) {\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker)\n } catch (e) {\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker)\n }\n }\n}\nvar queue = []\nvar draining = false\nvar currentQueue\nvar queueIndex = -1\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return\n }\n draining = false\n if (currentQueue.length) {\n queue = currentQueue.concat(queue)\n } else {\n queueIndex = -1\n }\n if (queue.length) {\n drainQueue()\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return\n }\n var timeout = runTimeout(cleanUpNextTick)\n draining = true\n\n var len = queue.length\n while (len) {\n currentQueue = queue\n queue = []\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run()\n }\n }\n queueIndex = -1\n len = queue.length\n }\n currentQueue = null\n draining = false\n runClearTimeout(timeout)\n}\nfunction nextTick(fun) {\n var args = new Array(arguments.length - 1)\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i]\n }\n }\n queue.push(new Item(fun, args))\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue)\n }\n}\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun\n this.array = array\n}\nItem.prototype.run = function() {\n this.fun.apply(null, this.array)\n}\nvar title = 'browser'\nvar platform = 'browser'\nvar browser = true\nvar env = {}\nvar argv = []\nvar version = '' // empty string to avoid regexp issues\nvar versions = {}\nvar release = {}\nvar config = {}\n\nfunction noop() {}\n\nvar on = noop\nvar addListener = noop\nvar once = noop\nvar off = noop\nvar removeListener = noop\nvar removeAllListeners = noop\nvar emit = noop\n\nfunction binding(name) {\n throw new Error('process.binding is not supported')\n}\n\nfunction cwd() {\n return '/'\n}\nfunction chdir(dir) {\n throw new Error('process.chdir is not supported')\n}\nfunction umask() {\n return 0\n}\n\n// from https://github.com/kumavis/browser-process-hrtime/blob/master/index.js\nvar performance = global.performance || {}\nvar performanceNow =\n performance.now ||\n performance.mozNow ||\n performance.msNow ||\n performance.oNow ||\n performance.webkitNow ||\n function() {\n return new Date().getTime()\n }\n\n// generate timestamp or delta\n// see http://nodejs.org/api/process.html#process_process_hrtime\nfunction hrtime(previousTimestamp) {\n var clocktime = performanceNow.call(performance) * 1e-3\n var seconds = Math.floor(clocktime)\n var nanoseconds = Math.floor((clocktime % 1) * 1e9)\n if (previousTimestamp) {\n seconds = seconds - previousTimestamp[0]\n nanoseconds = nanoseconds - previousTimestamp[1]\n if (nanoseconds < 0) {\n seconds--\n nanoseconds += 1e9\n }\n }\n return [seconds, nanoseconds]\n}\n\nvar startTime = new Date()\nfunction uptime() {\n var currentTime = new Date()\n var dif = currentTime - startTime\n return dif / 1000\n}\n\nexport var process = {\n nextTick: nextTick,\n title: title,\n browser: browser,\n env: env,\n argv: argv,\n version: version,\n versions: versions,\n on: on,\n addListener: addListener,\n once: once,\n off: off,\n removeListener: removeListener,\n removeAllListeners: removeAllListeners,\n emit: emit,\n binding: binding,\n cwd: cwd,\n chdir: chdir,\n umask: umask,\n hrtime: hrtime,\n platform: platform,\n release: release,\n config: config,\n uptime: uptime,\n}\n\n// replace process.env.VAR with define\n\nconst defines = {}\nObject.keys(defines).forEach((key) => {\n const segs = key.split('.')\n let target = process\n for (let i = 0; i < segs.length; i++) {\n const seg = segs[i]\n if (i === segs.length - 1) {\n target[seg] = defines[key]\n } else {\n target = target[seg] || (target[seg] = {})\n }\n }\n})\n","// taken from https://github.com/calvinmetcalf/buffer-es6\n\n/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>\n * @license MIT\n */\n/* eslint-disable no-proto */\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\nvar inited = false\nfunction init() {\n inited = true\n var code =\n 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\n for (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n }\n\n revLookup['-'.charCodeAt(0)] = 62\n revLookup['_'.charCodeAt(0)] = 63\n}\n\nfunction base64toByteArray(b64) {\n if (!inited) {\n init()\n }\n var i, j, l, tmp, placeHolders, arr\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // the number of equal signs (place holders)\n // if there are two placeholders, than the two characters before it\n // represent one byte\n // if there is only one, then the three characters before it represent 2 bytes\n // this is just a cheap hack to not do indexOf twice\n placeHolders = b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0\n\n // base64 is 4/3 + up to two characters of the original data\n arr = new Arr((len * 3) / 4 - placeHolders)\n\n // if there are placeholders, only get up to the last complete 4 chars\n l = placeHolders > 0 ? len - 4 : len\n\n var L = 0\n\n for (i = 0, j = 0; i < l; i += 4, j += 3) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[L++] = (tmp >> 16) & 0xff\n arr[L++] = (tmp >> 8) & 0xff\n arr[L++] = tmp & 0xff\n }\n\n if (placeHolders === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[L++] = tmp & 0xff\n } else if (placeHolders === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[L++] = (tmp >> 8) & 0xff\n arr[L++] = tmp & 0xff\n }\n\n return arr\n}\n\nfunction tripletToBase64(num) {\n return (\n lookup[(num >> 18) & 0x3f] +\n lookup[(num >> 12) & 0x3f] +\n lookup[(num >> 6) & 0x3f] +\n lookup[num & 0x3f]\n )\n}\n\nfunction encodeChunk(uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + uint8[i + 2]\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction base64fromByteArray(uint8) {\n if (!inited) {\n init()\n }\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var output = ''\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(\n encodeChunk(\n uint8,\n i,\n i + maxChunkLength > len2 ? len2 : i + maxChunkLength,\n ),\n )\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n output += lookup[tmp >> 2]\n output += lookup[(tmp << 4) & 0x3f]\n output += '=='\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n output += lookup[tmp >> 10]\n output += lookup[(tmp >> 4) & 0x3f]\n output += lookup[(tmp << 2) & 0x3f]\n output += '='\n }\n\n parts.push(output)\n\n return parts.join('')\n}\n\nvar INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT =\n global.TYPED_ARRAY_SUPPORT !== undefined ? global.TYPED_ARRAY_SUPPORT : true\n\nfunction kMaxLength() {\n return Buffer.TYPED_ARRAY_SUPPORT ? 0x7fffffff : 0x3fffffff\n}\n\nfunction createBuffer(that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nexport function Buffer(arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string',\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function(arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from(that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function(value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nBuffer.kMaxLength = kMaxLength()\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (\n typeof Symbol !== 'undefined' &&\n Symbol.species &&\n Buffer[Symbol.species] === Buffer\n ) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n // Object.defineProperty(Buffer, Symbol.species, {\n // value: null,\n // configurable: true\n // })\n }\n}\n\nfunction assertSize(size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc(that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function(size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe(that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function(size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function(size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString(that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike(that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer(that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError(\"'offset' is out of bounds\")\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError(\"'length' is out of bounds\")\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject(that, obj) {\n if (internalIsBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if (\n (typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) ||\n 'length' in obj\n ) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && Array.isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError(\n 'First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.',\n )\n}\n\nfunction checked(length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError(\n 'Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' +\n kMaxLength().toString(16) +\n ' bytes',\n )\n }\n return length | 0\n}\n\nexport function SlowBuffer(length) {\n if (+length != length) {\n // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\nBuffer.isBuffer = isBuffer\nfunction internalIsBuffer(b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare(a, b) {\n if (!internalIsBuffer(a) || !internalIsBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding(encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat(list, length) {\n if (!Array.isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!internalIsBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength(string, encoding) {\n if (internalIsBuffer(string)) {\n return string.length\n }\n if (\n typeof ArrayBuffer !== 'undefined' &&\n typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)\n ) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString(encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase)\n throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap(b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16() {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32() {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64() {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString() {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals(b) {\n if (!internalIsBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\n\nBuffer.prototype.compare = function compare(\n target,\n start,\n end,\n thisStart,\n thisEnd,\n) {\n if (!internalIsBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (\n start < 0 ||\n end > target.length ||\n thisStart < 0 ||\n thisEnd > this.length\n ) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : buffer.length - 1\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (internalIsBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xff // Search for a byte value [0-255]\n if (\n Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function'\n ) {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(\n buffer,\n val,\n byteOffset,\n )\n } else {\n return Uint8Array.prototype.lastIndexOf.call(\n buffer,\n val,\n byteOffset,\n )\n }\n }\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf(arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (\n encoding === 'ucs2' ||\n encoding === 'ucs-2' ||\n encoding === 'utf16le' ||\n encoding === 'utf-16le'\n ) {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read(buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (\n read(arr, i) ===\n read(val, foundIndex === -1 ? 0 : i - foundIndex)\n ) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength)\n return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength)\n byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes(val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf(val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite(buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write(buf, string, offset, length) {\n return blitBuffer(\n utf8ToBytes(string, buf.length - offset),\n buf,\n offset,\n length,\n )\n}\n\nfunction asciiWrite(buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write(buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write(buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write(buf, string, offset, length) {\n return blitBuffer(\n utf16leToBytes(string, buf.length - offset),\n buf,\n offset,\n length,\n )\n}\n\nBuffer.prototype.write = function write(string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported',\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if (\n (string.length > 0 && (length < 0 || offset < 0)) ||\n offset > this.length\n ) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase)\n throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON() {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0),\n }\n}\n\nfunction base64Slice(buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64fromByteArray(buf)\n } else {\n return base64fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice(buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence =\n firstByte > 0xef\n ? 4\n : firstByte > 0xdf\n ? 3\n : firstByte > 0xbf\n ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xc0) === 0x80) {\n tempCodePoint =\n ((firstByte & 0x1f) << 0x6) | (secondByte & 0x3f)\n if (tempCodePoint > 0x7f) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if (\n (secondByte & 0xc0) === 0x80 &&\n (thirdByte & 0xc0) === 0x80\n ) {\n tempCodePoint =\n ((firstByte & 0xf) << 0xc) |\n ((secondByte & 0x3f) << 0x6) |\n (thirdByte & 0x3f)\n if (\n tempCodePoint > 0x7ff &&\n (tempCodePoint < 0xd800 || tempCodePoint > 0xdfff)\n ) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if (\n (secondByte & 0xc0) === 0x80 &&\n (thirdByte & 0xc0) === 0x80 &&\n (fourthByte & 0xc0) === 0x80\n ) {\n tempCodePoint =\n ((firstByte & 0xf) << 0x12) |\n ((secondByte & 0x3f) << 0xc) |\n ((thirdByte & 0x3f) << 0x6) |\n (fourthByte & 0x3f)\n if (\n tempCodePoint > 0xffff &&\n tempCodePoint < 0x110000\n ) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xfffd\n bytesPerSequence = 1\n } else if (codePoint > 0xffff) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(((codePoint >>> 10) & 0x3ff) | 0xd800)\n codePoint = 0xdc00 | (codePoint & 0x3ff)\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray(codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, (i += MAX_ARGUMENTS_LENGTH)),\n )\n }\n return res\n}\n\nfunction asciiSlice(buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7f)\n }\n return ret\n}\n\nfunction latin1Slice(buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice(buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice(buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice(start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset(offset, ext, length) {\n if (offset % 1 !== 0 || offset < 0)\n throw new RangeError('offset is not uint')\n if (offset + ext > length)\n throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE(\n offset,\n byteLength,\n noAssert,\n) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE(\n offset,\n byteLength,\n noAssert,\n) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (\n (this[offset] | (this[offset + 1] << 8) | (this[offset + 2] << 16)) +\n this[offset + 3] * 0x1000000\n )\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (\n this[offset] * 0x1000000 +\n ((this[offset + 1] << 16) | (this[offset + 2] << 8) | this[offset + 3])\n )\n}\n\nBuffer.prototype.readIntLE = function readIntLE(offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE(offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return this[offset]\n return (0xff - this[offset] + 1) * -1\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return val & 0x8000 ? val | 0xffff0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return val & 0x8000 ? val | 0xffff0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (\n this[offset] |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n )\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (\n (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3]\n )\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754read(this, offset, false, 52, 8)\n}\n\nfunction checkInt(buf, value, offset, ext, max, min) {\n if (!internalIsBuffer(buf))\n throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min)\n throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE(\n value,\n offset,\n byteLength,\n noAssert,\n) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xff\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xff\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE(\n value,\n offset,\n byteLength,\n noAssert,\n) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xff\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xff\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = value & 0xff\n return offset + 1\n}\n\nfunction objectWriteUInt16(buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] =\n (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n ((littleEndian ? i : 1 - i) * 8)\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE(\n value,\n offset,\n noAssert,\n) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value & 0xff\n this[offset + 1] = value >>> 8\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE(\n value,\n offset,\n noAssert,\n) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value >>> 8\n this[offset + 1] = value & 0xff\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32(buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> ((littleEndian ? i : 3 - i) * 8)) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE(\n value,\n offset,\n noAssert,\n) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = value >>> 24\n this[offset + 2] = value >>> 16\n this[offset + 1] = value >>> 8\n this[offset] = value & 0xff\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE(\n value,\n offset,\n noAssert,\n) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value >>> 24\n this[offset + 1] = value >>> 16\n this[offset + 2] = value >>> 8\n this[offset + 3] = value & 0xff\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE(\n value,\n offset,\n byteLength,\n noAssert,\n) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xff\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = (((value / mul) >> 0) - sub) & 0xff\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE(\n value,\n offset,\n byteLength,\n noAssert,\n) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xff\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = (((value / mul) >> 0) - sub) & 0xff\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8(value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = value & 0xff\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value & 0xff\n this[offset + 1] = value >>> 8\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value >>> 8\n this[offset + 1] = value & 0xff\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value & 0xff\n this[offset + 1] = value >>> 8\n this[offset + 2] = value >>> 16\n this[offset + 3] = value >>> 24\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value >>> 24\n this[offset + 1] = value >>> 16\n this[offset + 2] = value >>> 8\n this[offset + 3] = value & 0xff\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754(buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat(buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(\n buf,\n value,\n offset,\n 4,\n 3.4028234663852886e38,\n -3.4028234663852886e38,\n )\n }\n ieee754write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble(buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(\n buf,\n value,\n offset,\n 8,\n 1.7976931348623157e308,\n -1.7976931348623157e308,\n )\n }\n ieee754write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE(\n value,\n offset,\n noAssert,\n) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE(\n value,\n offset,\n noAssert,\n) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy(target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length)\n throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart,\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill(val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = internalIsBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean(str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim(str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex(n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes(string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xd7ff && codePoint < 0xe000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xdbff) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xef, 0xbf, 0xbd)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xef, 0xbf, 0xbd)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xdc00) {\n if ((units -= 3) > -1) bytes.push(0xef, 0xbf, 0xbd)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint =\n (((leadSurrogate - 0xd800) << 10) | (codePoint - 0xdc00)) +\n 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xef, 0xbf, 0xbd)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push((codePoint >> 0x6) | 0xc0, (codePoint & 0x3f) | 0x80)\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n (codePoint >> 0xc) | 0xe0,\n ((codePoint >> 0x6) & 0x3f) | 0x80,\n (codePoint & 0x3f) | 0x80,\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n (codePoint >> 0x12) | 0xf0,\n ((codePoint >> 0xc) & 0x3f) | 0x80,\n ((codePoint >> 0x6) & 0x3f) | 0x80,\n (codePoint & 0x3f) | 0x80,\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes(str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xff)\n }\n return byteArray\n}\n\nfunction utf16leToBytes(str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes(str) {\n return base64toByteArray(base64clean(str))\n}\n\nfunction blitBuffer(src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if (i + offset >= dst.length || i >= src.length) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan(val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n\n// the following is from is-buffer, also by Feross Aboukhadijeh and with same lisence\n// The _isBuffer check is for Safari 5-7 support, because it's missing\n// Object.prototype.constructor. Remove this eventually\nfunction isBuffer(obj) {\n return (\n obj != null &&\n (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj))\n )\n}\n\nfunction isFastBuffer(obj) {\n return (\n !!obj.constructor &&\n typeof obj.constructor.isBuffer === 'function' &&\n obj.constructor.isBuffer(obj)\n )\n}\n\n// For Node v0.10 support. Remove this eventually.\nfunction isSlowBuffer(obj) {\n return (\n typeof obj.readFloatLE === 'function' &&\n typeof obj.slice === 'function' &&\n isFastBuffer(obj.slice(0, 0))\n )\n}\n\nfunction ieee754read(buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = nBytes * 8 - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? nBytes - 1 : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << -nBits) - 1)\n s >>= -nBits\n nBits += eLen\n for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << -nBits) - 1)\n e >>= -nBits\n nBits += mLen\n for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : (s ? -1 : 1) * Infinity\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nfunction ieee754write(buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = nBytes * 8 - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0\n var i = isLE ? 0 : nBytes - 1\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (\n ;\n mLen >= 8;\n buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8\n ) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (\n ;\n eLen > 0;\n buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8\n ) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","export { Buffer } from '_node-buffer-polyfill_.js'\n","import { AbstractAstNode, Scope, Severity } from \"@fern-api/browser-compatible-base-generator\";\nimport { assertNever } from \"@fern-api/core-utils\";\nimport { FernIr } from \"@fern-api/dynamic-ir-sdk\";\nimport { python } from \"@fern-api/python-ast\";\n\nimport { DynamicSnippetsGeneratorContext } from \"./context/DynamicSnippetsGeneratorContext\";\nimport { FilePropertyInfo } from \"./context/FilePropertyMapper\";\n\nconst STRING_TYPE_REFERENCE: FernIr.dynamic.TypeReference = {\n type: \"primitive\",\n value: \"STRING\"\n};\nconst SNIPPET_MODULE_PATH = [\"example\"];\nconst CLIENT_VAR_NAME = \"client\";\nconst REQUEST_BODY_ARG_NAME = \"request\";\n\nexport class EndpointSnippetGenerator {\n private context: DynamicSnippetsGeneratorContext;\n\n constructor({ context }: { context: DynamicSnippetsGeneratorContext }) {\n this.context = context;\n }\n\n public async generateSnippet({\n endpoint,\n request\n }: {\n endpoint: FernIr.dynamic.Endpoint;\n request: FernIr.dynamic.EndpointSnippetRequest;\n }): Promise<string> {\n const file = this.buildPythonFile({ endpoint, snippet: request });\n return file.toString();\n }\n\n public generateSnippetSync({\n endpoint,\n request\n }: {\n endpoint: FernIr.dynamic.Endpoint;\n request: FernIr.dynamic.EndpointSnippetRequest;\n }): string {\n const file = this.buildPythonFile({ endpoint, snippet: request });\n return file.toString();\n }\n\n public async generateSnippetAst({\n endpoint,\n request\n }: {\n endpoint: FernIr.dynamic.Endpoint;\n request: FernIr.dynamic.EndpointSnippetRequest;\n }): Promise<AbstractAstNode> {\n return this.buildPythonFile({ endpoint, snippet: request });\n }\n\n /**\n * Generates just the method call AST without the client instantiation.\n * This is useful for wire tests where the client is created separately\n * with test-specific configuration.\n */\n public generateMethodCallSnippetAst({\n endpoint,\n request\n }: {\n endpoint: FernIr.dynamic.Endpoint;\n request: FernIr.dynamic.EndpointSnippetRequest;\n }): python.AstNode {\n return this.callMethod({ endpoint, snippet: request });\n }\n\n private buildPythonFile({\n endpoint,\n snippet\n }: {\n endpoint: FernIr.dynamic.Endpoint;\n snippet: FernIr.dynamic.EndpointSnippetRequest;\n }): python.PythonFile {\n return python.file({\n path: SNIPPET_MODULE_PATH,\n statements: [this.constructClient({ endpoint, snippet }), this.callMethod({ endpoint, snippet })]\n });\n }\n\n private constructClient({\n endpoint,\n snippet\n }: {\n endpoint: FernIr.dynamic.Endpoint;\n snippet: FernIr.dynamic.EndpointSnippetRequest;\n }): python.AstNode {\n return python.assign({\n lhs: python.reference({ name: CLIENT_VAR_NAME }),\n rhs: python.instantiateClass({\n classReference: this.context.getRootClientClassReference(),\n arguments_: this.getConstructorArgs({ endpoint, snippet }).map((arg) =>\n python.methodArgument({\n name: arg.name,\n value: arg.value\n })\n ),\n multiline: true\n })\n });\n }\n\n private getConstructorArgs({\n endpoint,\n snippet\n }: {\n endpoint: FernIr.dynamic.Endpoint;\n snippet: FernIr.dynamic.EndpointSnippetRequest;\n }): python.NamedValue[] {\n const fields: python.NamedValue[] = [];\n const environmentArgs = this.getConstructorEnvironmentArgs({\n baseUrl: snippet.baseURL,\n environment: snippet.environment\n });\n if (environmentArgs.length > 0) {\n fields.push(...environmentArgs);\n }\n if (endpoint.auth != null) {\n if (snippet.auth != null) {\n fields.push(...this.getConstructorAuthArgs({ auth: endpoint.auth, values: snippet.auth }));\n } else {\n this.context.errors.add({\n severity: Severity.Warning,\n message: `Auth with ${endpoint.auth.type} configuration is required for this endpoint`\n });\n }\n }\n\n this.context.errors.scope(Scope.PathParameters);\n if (this.context.ir.pathParameters != null) {\n fields.push(...this.getPathParameters({ namedParameters: this.context.ir.pathParameters, snippet }));\n }\n this.context.errors.unscope();\n\n this.context.errors.scope(Scope.Headers);\n if (this.context.ir.headers != null && snippet.headers != null) {\n fields.push(\n ...this.getConstructorHeaderArgs({ headers: this.context.ir.headers, values: snippet.headers })\n );\n }\n this.context.errors.unscope();\n return fields;\n }\n\n private getConstructorEnvironmentArgs({\n baseUrl,\n environment\n }: {\n baseUrl: string | undefined;\n environment: FernIr.dynamic.EnvironmentValues | undefined;\n }): python.NamedValue[] {\n const environmentValue = this.getEnvironmentValue({ baseUrl, environment });\n if (environmentValue == null) {\n return [];\n }\n\n if (environment != null && this.context.isMultiEnvironmentValues(environment)) {\n return [\n {\n name: \"environment\",\n value: environmentValue\n }\n ];\n }\n\n return [\n {\n name: this.getEnvironmentOptionName({ environment }),\n value: environmentValue\n }\n ];\n }\n\n private getEnvironmentValue({\n baseUrl,\n environment\n }: {\n baseUrl: string | undefined;\n environment: FernIr.dynamic.EnvironmentValues | undefined;\n }): python.TypeInstantiation | undefined {\n if (baseUrl != null && environment != null) {\n this.context.errors.add({\n severity: Severity.Critical,\n message: \"Cannot specify both baseUrl and environment options\"\n });\n return undefined;\n }\n if (baseUrl != null) {\n return python.TypeInstantiation.str(baseUrl);\n }\n if (environment != null) {\n if (this.context.isSingleEnvironmentID(environment)) {\n const environmentTypeReference = this.context.getEnvironmentTypeReferenceFromID(environment);\n if (environmentTypeReference == null) {\n this.context.errors.add({\n severity: Severity.Warning,\n message: `Environment ${JSON.stringify(environment)} was not found`\n });\n return undefined;\n }\n return python.TypeInstantiation.reference(environmentTypeReference);\n }\n if (this.context.isMultiEnvironmentValues(environment)) {\n if (!this.context.validateMultiEnvironmentUrlValues(environment)) {\n return undefined;\n }\n return python.TypeInstantiation.reference(\n python.instantiateClass({\n classReference: this.context.getEnvironmentClassReference(),\n arguments_: Object.entries(environment)\n .map(([key, value]) => ({\n name: key,\n value: this.context.dynamicTypeLiteralMapper.convert({\n typeReference: STRING_TYPE_REFERENCE,\n value\n })\n }))\n .map((arg) =>\n python.methodArgument({\n name: arg.name,\n value: arg.value\n })\n ),\n multiline: true\n })\n );\n }\n }\n return undefined;\n }\n\n private getConstructorAuthArgs({\n auth,\n values\n }: {\n auth: FernIr.dynamic.Auth;\n values: FernIr.dynamic.AuthValues;\n }): python.NamedValue[] {\n switch (auth.type) {\n case \"basic\":\n if (values.type !== \"basic\") {\n this.addAuthMismatchError(auth, values);\n return [];\n }\n return this.getConstructorBasicAuthArg({ auth, values });\n case \"bearer\":\n if (values.type !== \"bearer\") {\n this.addAuthMismatchError(auth, values);\n return [];\n }\n return this.getConstructorBearerAuthArgs({ auth, values });\n case \"header\":\n if (values.type !== \"header\") {\n this.addAuthMismatchError(auth, values);\n return [];\n }\n return this.getConstructorHeaderAuthArgs({ auth, values });\n case \"oauth\":\n if (values.type !== \"oauth\") {\n this.addAuthMismatchError(auth, values);\n return [];\n }\n return this.getConstructorOAuthArgs({ auth, values });\n case \"inferred\":\n if (values.type !== \"inferred\") {\n this.addAuthMismatchError(auth, values);\n return [];\n }\n this.addWarning(\"The Python SDK Generator does not support Inferred auth scheme yet\");\n return [];\n default:\n assertNever(auth);\n }\n }\n\n private addAuthMismatchError(auth: FernIr.dynamic.Auth, values: FernIr.dynamic.AuthValues): void {\n this.context.errors.add({\n severity: Severity.Critical,\n message: this.context.newAuthMismatchError({ auth, values }).message\n });\n }\n\n private addWarning(message: string): void {\n this.context.errors.add({ severity: Severity.Warning, message });\n }\n\n private getConstructorBasicAuthArg({\n auth,\n values\n }: {\n auth: FernIr.dynamic.BasicAuth;\n values: FernIr.dynamic.BasicAuthValues;\n }): python.NamedValue[] {\n return [\n {\n name: this.context.getPropertyName(auth.username),\n value: python.TypeInstantiation.str(values.username)\n },\n {\n name: this.context.getPropertyName(auth.password),\n value: python.TypeInstantiation.str(values.password)\n }\n ];\n }\n\n private getConstructorBearerAuthArgs({\n auth,\n values\n }: {\n auth: FernIr.dynamic.BearerAuth;\n values: FernIr.dynamic.BearerAuthValues;\n }): python.NamedValue[] {\n return [\n {\n name: this.context.getPropertyName(auth.token),\n value: python.TypeInstantiation.str(values.token)\n }\n ];\n }\n\n private getConstructorHeaderAuthArgs({\n auth,\n values\n }: {\n auth: FernIr.dynamic.HeaderAuth;\n values: FernIr.dynamic.HeaderAuthValues;\n }): python.NamedValue[] {\n return [\n {\n name: this.context.getPropertyName(auth.header.name.name),\n value: this.context.dynamicTypeLiteralMapper.convert({\n typeReference: auth.header.typeReference,\n value: values.value\n })\n }\n ];\n }\n\n private getConstructorOAuthArgs({\n auth,\n values\n }: {\n auth: FernIr.dynamic.OAuth;\n values: FernIr.dynamic.OAuthValues;\n }): python.NamedValue[] {\n return [\n {\n name: this.context.getPropertyName(auth.clientId),\n value: python.TypeInstantiation.str(values.clientId)\n },\n {\n name: this.context.getPropertyName(auth.clientSecret),\n value: python.TypeInstantiation.str(values.clientSecret)\n }\n ];\n }\n\n private getConstructorHeaderArgs({\n headers,\n values\n }: {\n headers: FernIr.dynamic.NamedParameter[];\n values: FernIr.dynamic.Values;\n }): python.NamedValue[] {\n const fields: python.NamedValue[] = [];\n for (const header of headers) {\n const field = this.getConstructorHeaderArg({ header, value: values.value });\n if (field != null) {\n fields.push(field);\n }\n }\n return fields;\n }\n\n private getConstructorHeaderArg({\n header,\n value\n }: {\n header: FernIr.dynamic.NamedParameter;\n value: unknown;\n }): python.NamedValue | undefined {\n const typeLiteral = this.context.dynamicTypeLiteralMapper.convert({\n typeReference: header.typeReference,\n value\n });\n if (python.TypeInstantiation.isNop(typeLiteral)) {\n // Literal header values (e.g. \"X-API-Version\") should not be included in the\n // client constructor.\n return undefined;\n }\n return {\n name: this.context.getPropertyName(header.name.name),\n value: typeLiteral\n };\n }\n\n private callMethod({\n endpoint,\n snippet\n }: {\n endpoint: FernIr.dynamic.Endpoint;\n snippet: FernIr.dynamic.EndpointSnippetRequest;\n }): python.AstNode {\n return python.invokeMethod({\n on: python.reference({ name: CLIENT_VAR_NAME }),\n method: this.getMethod({ endpoint }),\n arguments_: this.getMethodArgs({ endpoint, snippet }).map((arg) =>\n python.methodArgument({\n name: arg.name,\n value: arg.value\n })\n ),\n multiline: true\n });\n }\n\n private getMethodArgs({\n endpoint,\n snippet\n }: {\n endpoint: FernIr.dynamic.Endpoint;\n snippet: FernIr.dynamic.EndpointSnippetRequest;\n }): python.NamedValue[] {\n switch (endpoint.request.type) {\n case \"inlined\":\n return this.getMethodArgsForInlinedRequest({ request: endpoint.request, snippet });\n case \"body\":\n return this.getMethodArgsForBodyRequest({ request: endpoint.request, snippet });\n default:\n assertNever(endpoint.request);\n }\n }\n\n private getMethodArgsForBodyRequest({\n request,\n snippet\n }: {\n request: FernIr.dynamic.BodyRequest;\n snippet: FernIr.dynamic.EndpointSnippetRequest;\n }): python.NamedValue[] {\n const args: python.NamedValue[] = [];\n\n this.context.errors.scope(Scope.PathParameters);\n const pathParameters = [...(this.context.ir.pathParameters ?? []), ...(request.pathParameters ?? [])];\n\n // Get body property names to check for collisions\n let bodyPropertyNames: Set<string> = new Set();\n if (request.body != null) {\n const bodyArgs = this.getBodyRequestArgs({ body: request.body, value: snippet.requestBody });\n bodyPropertyNames = new Set(bodyArgs.map((arg) => arg.name));\n }\n\n // Add path parameters, adding underscore suffix if they collide with body properties\n if (pathParameters.length > 0) {\n const pathArgs = this.getPathParameters({ namedParameters: pathParameters, snippet });\n const disambiguatedPathArgs = pathArgs.map((arg) => {\n // If this path parameter name collides with a body property, add underscore suffix\n if (bodyPropertyNames.has(arg.name)) {\n return { ...arg, name: arg.name + \"_\" };\n }\n return arg;\n });\n args.push(...disambiguatedPathArgs);\n }\n this.context.errors.unscope();\n\n this.context.errors.scope(Scope.RequestBody);\n if (request.body != null) {\n args.push(...this.getBodyRequestArgs({ body: request.body, value: snippet.requestBody }));\n }\n this.context.errors.unscope();\n\n return args;\n }\n\n private getBodyRequestArgs({\n body,\n value\n }: {\n body: FernIr.dynamic.ReferencedRequestBodyType;\n value: unknown;\n }): python.NamedValue[] {\n switch (body.type) {\n case \"bytes\":\n return [\n {\n name: REQUEST_BODY_ARG_NAME,\n value: this.getBytesBodyRequestTypeInstantiation({ value })\n }\n ];\n case \"typeReference\":\n return this.getBodyRequestArgsForTypeReference({ typeReference: body.value, value });\n default:\n assertNever(body);\n }\n }\n\n private getBodyRequestArgsForTypeReference({\n typeReference,\n value\n }: {\n typeReference: FernIr.dynamic.TypeReference;\n value: unknown;\n }): python.NamedValue[] {\n switch (typeReference.type) {\n case \"named\": {\n const named = this.context.resolveNamedType({ typeId: typeReference.value });\n if (named == null) {\n return [];\n }\n return this.getBodyRequestArgsForNamedTypeReference({ typeReference, named, value });\n }\n case \"nullable\":\n case \"optional\": {\n // Check if the inner type is an object - if so, don't flatten it\n const innerType = typeReference.value;\n if (innerType.type === \"named\") {\n const named = this.context.resolveNamedType({ typeId: innerType.value });\n if (named?.type === \"object\") {\n // Optional objects should NOT be flattened - use as single 'request' parameter\n return [\n {\n name: REQUEST_BODY_ARG_NAME,\n value: this.context.dynamicTypeLiteralMapper.convert({\n typeReference: innerType,\n value\n })\n }\n ];\n }\n }\n // For non-object types, continue unwrapping\n return this.getBodyRequestArgsForTypeReference({ typeReference: typeReference.value, value });\n }\n case \"list\":\n case \"map\":\n case \"set\":\n case \"literal\":\n case \"primitive\":\n case \"unknown\":\n return [\n {\n name: REQUEST_BODY_ARG_NAME,\n value: this.context.dynamicTypeLiteralMapper.convert({ typeReference, value })\n }\n ];\n default:\n assertNever(typeReference);\n }\n }\n\n private getBodyRequestArgsForNamedTypeReference({\n typeReference,\n named,\n value\n }: {\n typeReference: FernIr.dynamic.TypeReference;\n named: FernIr.dynamic.NamedType;\n value: unknown;\n }): python.NamedValue[] {\n switch (named.type) {\n case \"alias\":\n return this.getBodyRequestArgsForTypeReference({ typeReference: named.typeReference, value });\n case \"enum\":\n case \"discriminatedUnion\":\n case \"undiscriminatedUnion\":\n return [\n {\n name: REQUEST_BODY_ARG_NAME,\n value: this.context.dynamicTypeLiteralMapper.convert({ typeReference, value })\n }\n ];\n case \"object\": {\n const bodyProperties = this.context.associateByWireValue({\n parameters: named.properties,\n values: this.context.getRecord(value) ?? {}\n });\n\n const nonLiteralBodyProperties = bodyProperties.filter(\n (property) => !this.resolvesToLiteralType(property.typeReference)\n );\n\n return nonLiteralBodyProperties.map((property) => ({\n name: this.context.getPropertyName(property.name.name),\n value: this.context.dynamicTypeLiteralMapper.convert(property)\n }));\n }\n default:\n assertNever(named);\n }\n }\n\n private resolvesToLiteralType(typeReference: FernIr.dynamic.TypeReference): boolean {\n switch (typeReference.type) {\n case \"literal\":\n return true;\n case \"optional\":\n case \"nullable\":\n return this.resolvesToLiteralType(typeReference.value);\n case \"named\": {\n const named = this.context.resolveNamedType({ typeId: typeReference.value });\n if (named == null) {\n return false;\n }\n if (named.type === \"alias\") {\n return this.resolvesToLiteralType(named.typeReference);\n }\n return false;\n }\n case \"list\":\n case \"map\":\n case \"set\":\n case \"primitive\":\n case \"unknown\":\n return false;\n default:\n assertNever(typeReference);\n }\n }\n\n private getBodyRequestArgsForBytes({\n body,\n value\n }: {\n body: FernIr.dynamic.ReferencedRequestBody;\n value: unknown;\n }): python.NamedValue[] {\n const typeInstantiation = this.getBytesBodyRequestTypeInstantiation({ value });\n if (python.TypeInstantiation.isNop(typeInstantiation)) {\n return [];\n }\n return [\n {\n name: this.context.getPropertyName(body.bodyKey),\n value: typeInstantiation\n }\n ];\n }\n\n private getBytesBodyRequestTypeInstantiation({ value }: { value: unknown }): python.TypeInstantiation {\n if (typeof value !== \"string\") {\n this.context.errors.add({\n severity: Severity.Critical,\n message: `Expected bytes value to be a string, got ${typeof value}`\n });\n return python.TypeInstantiation.nop();\n }\n return python.TypeInstantiation.bytes(value);\n }\n\n private getMethodArgsForInlinedRequest({\n request,\n snippet\n }: {\n request: FernIr.dynamic.InlinedRequest;\n snippet: FernIr.dynamic.EndpointSnippetRequest;\n }): python.NamedValue[] {\n const args: python.NamedValue[] = [];\n\n const inlinePathParameters = this.context.shouldInlinePathParameters();\n\n this.context.errors.scope(Scope.PathParameters);\n const pathParameterFields: python.NamedValue[] = [];\n if (request.pathParameters != null) {\n pathParameterFields.push(...this.getPathParameters({ namedParameters: request.pathParameters, snippet }));\n }\n this.context.errors.unscope();\n\n this.context.errors.scope(Scope.RequestBody);\n const filePropertyInfo = this.getFilePropertyInfo({ request, snippet });\n this.context.errors.unscope();\n\n if (\n !this.context.includePathParametersInWrappedRequest({\n request,\n inlinePathParameters\n })\n ) {\n args.push(...pathParameterFields);\n }\n\n if (\n this.context.needsRequestParameter({\n request,\n inlinePathParameters,\n inlineFileProperties: true\n })\n ) {\n args.push(\n ...this.getInlinedRequestArgs({\n request,\n snippet,\n pathParameterFields: this.context.includePathParametersInWrappedRequest({\n request,\n inlinePathParameters\n })\n ? pathParameterFields\n : [],\n filePropertyInfo\n })\n );\n }\n return args;\n }\n\n private getFilePropertyInfo({\n request,\n snippet\n }: {\n request: FernIr.dynamic.InlinedRequest;\n snippet: FernIr.dynamic.EndpointSnippetRequest;\n }): FilePropertyInfo {\n if (request.body == null || !this.context.isFileUploadRequestBody(request.body)) {\n return {\n fileFields: [],\n bodyPropertyFields: []\n };\n }\n return this.context.filePropertyMapper.getFilePropertyInfo({\n body: request.body,\n value: snippet.requestBody\n });\n }\n\n private getInlinedRequestArgs({\n request,\n snippet,\n pathParameterFields,\n filePropertyInfo\n }: {\n request: FernIr.dynamic.InlinedRequest;\n snippet: FernIr.dynamic.EndpointSnippetRequest;\n pathParameterFields: python.NamedValue[];\n filePropertyInfo: FilePropertyInfo;\n }): python.NamedValue[] {\n this.context.errors.scope(Scope.QueryParameters);\n const queryParameters = this.context.associateQueryParametersByWireValue({\n parameters: request.queryParameters ?? [],\n values: snippet.queryParameters ?? {}\n });\n const queryParameterFields = queryParameters.map((queryParameter) => ({\n name: this.context.getPropertyName(queryParameter.name.name),\n value: this.context.dynamicTypeLiteralMapper.convert(queryParameter)\n }));\n this.context.errors.unscope();\n\n this.context.errors.scope(Scope.Headers);\n const headers = this.context.associateByWireValue({\n parameters: request.headers ?? [],\n values: snippet.headers ?? {}\n });\n const headerFields = headers.map((header) => ({\n name: this.context.getPropertyName(header.name.name),\n value: this.context.dynamicTypeLiteralMapper.convert(header)\n }));\n this.context.errors.unscope();\n\n this.context.errors.scope(Scope.RequestBody);\n const requestBodyFields =\n request.body != null\n ? this.getInlinedRequestBodyObjectFields({\n body: request.body,\n value: snippet.requestBody,\n filePropertyInfo\n })\n : [];\n this.context.errors.unscope();\n\n return [...pathParameterFields, ...queryParameterFields, ...headerFields, ...requestBodyFields];\n }\n\n private getInlinedRequestBodyObjectFields({\n body,\n value,\n filePropertyInfo\n }: {\n body: FernIr.dynamic.InlinedRequestBody;\n value: unknown;\n filePropertyInfo: FilePropertyInfo;\n }): python.NamedValue[] {\n switch (body.type) {\n case \"properties\":\n return this.getInlinedRequestBodyPropertyObjectFields({ parameters: body.value, value });\n case \"referenced\":\n return this.getReferencedRequestBodyPropertyTypeInstantiation({ body, value });\n case \"fileUpload\":\n return this.getFileUploadRequestBodyObjectFields({ filePropertyInfo });\n default:\n assertNever(body);\n }\n }\n\n private getFileUploadRequestBodyObjectFields({\n filePropertyInfo\n }: {\n filePropertyInfo: FilePropertyInfo;\n }): python.NamedValue[] {\n return [...filePropertyInfo.fileFields, ...filePropertyInfo.bodyPropertyFields];\n }\n\n private getReferencedRequestBodyPropertyTypeInstantiation({\n body,\n value\n }: {\n body: FernIr.dynamic.ReferencedRequestBody;\n value: unknown;\n }): python.NamedValue[] {\n const bodyType = body.bodyType;\n switch (bodyType.type) {\n case \"bytes\":\n return this.getBodyRequestArgsForBytes({ body, value });\n case \"typeReference\":\n return this.getBodyRequestArgsForTypeReference({ typeReference: bodyType.value, value });\n default:\n assertNever(bodyType);\n }\n }\n\n private getInlinedRequestBodyPropertyObjectFields({\n parameters,\n value\n }: {\n parameters: FernIr.dynamic.NamedParameter[];\n value: unknown;\n }): python.NamedValue[] {\n const fields: python.NamedValue[] = [];\n\n const bodyProperties = this.context.associateByWireValue({\n parameters,\n values: this.context.getRecord(value) ?? {}\n });\n\n const nonLiteralBodyProperties = bodyProperties.filter(\n (parameter) => !this.resolvesToLiteralType(parameter.typeReference)\n );\n\n for (const parameter of nonLiteralBodyProperties) {\n fields.push({\n name: this.context.getPropertyName(parameter.name.name),\n value: this.context.dynamicTypeLiteralMapper.convert(parameter)\n });\n }\n\n return fields;\n }\n\n private getPathParameters({\n namedParameters,\n snippet\n }: {\n namedParameters: FernIr.dynamic.NamedParameter[];\n snippet: FernIr.dynamic.EndpointSnippetRequest;\n }): python.NamedValue[] {\n const args: python.NamedValue[] = [];\n\n const nonLiteralPathParameters = namedParameters.filter(\n (parameter) => !this.resolvesToLiteralType(parameter.typeReference)\n );\n\n const pathParameters = this.context.associateByWireValue({\n parameters: nonLiteralPathParameters,\n values: snippet.pathParameters ?? {},\n\n // Path parameters are distributed across the client constructor\n // and the request method, so we ignore missing parameters here.\n ignoreMissingParameters: true\n });\n for (const parameter of pathParameters) {\n args.push({\n name: this.context.getPropertyName(parameter.name.name),\n value: this.context.dynamicTypeLiteralMapper.convert(parameter)\n });\n }\n\n return args;\n }\n\n private getMethod({ endpoint }: { endpoint: FernIr.dynamic.Endpoint }): string {\n if (endpoint.declaration.fernFilepath.allParts.length > 0) {\n return `${endpoint.declaration.fernFilepath.allParts\n .map((val) => this.context.getMethodName(val))\n .join(\".\")}.${this.context.getMethodName(endpoint.declaration.name)}`;\n }\n return this.context.getMethodName(endpoint.declaration.name);\n }\n\n private getEnvironmentOptionName({\n environment\n }: {\n environment: FernIr.dynamic.EnvironmentValues | undefined;\n }): string {\n if (environment != null) {\n return \"environment\";\n }\n return \"base_url\";\n }\n}\n","export { addPrefixToString } from \"./addPrefixToString\";\nexport {\n assert,\n assertDefined,\n assertNever,\n assertNeverNoThrow,\n assertNonNull,\n assertString,\n assertVoidNoThrow\n} from \"./assert\";\nexport { delay } from \"./delay/delay\";\nexport { withMinimumTime } from \"./delay/withMinimumTime\";\nexport { EMPTY_ARRAY, EMPTY_OBJECT } from \"./empty\";\nexport * as Examples from \"./examples\";\nexport { extractErrorMessage } from \"./extractErrorMessage\";\nexport { getDuplicates } from \"./getDuplicates\";\nexport { identity } from \"./identity\";\nexport { isNonNullish } from \"./isNonNullish\";\nexport { MediaType } from \"./mediaType\";\nexport { mergeWithOverrides } from \"./mergeWithOverrides\";\nexport { noop } from \"./noop\";\nexport {\n haveSameNullishness,\n nullIfNullish,\n nullIfSomeNullish,\n undefinedIfNullish,\n undefinedIfSomeNullish\n} from \"./nullishUtils\";\nexport { type ObjectPropertiesVisitor, visitObject, visitObjectAsync } from \"./ObjectPropertiesVisitor\";\nexport { type Entries, entries } from \"./objects/entries\";\nexport { isPlainObject } from \"./objects/isPlainObject\";\nexport { keys } from \"./objects/keys\";\nexport { mapValues } from \"./objects/mapValues\";\nexport { type Values, values } from \"./objects/values\";\nexport { parseEndpointLocator } from \"./parseEndpointLocator\";\nexport { PLATFORM, type Platform } from \"./platform\";\nexport { removeSuffix } from \"./removeSuffix\";\nexport { replaceEnvVariables } from \"./replaceEnvVars\";\nexport { SymbolRegistry, type SymbolRegistryOptions } from \"./SymbolRegistry\";\nexport { SKIP_MARKER, sanitizeNullValues } from \"./sanitizeNullValues\";\nexport { diffSemverOrThrow, parseSemverOrThrow } from \"./semverUtils\";\nexport { type SetRequired } from \"./setRequired\";\nexport { stripLeadingSlash } from \"./stripLeadingSlash\";\nexport { titleCase } from \"./titleCase\";\nexport type { ContainerRunner, Digit, Letter, LowercaseLetter, UppercaseLetter } from \"./types\";\nexport { validateAgainstJsonSchema } from \"./validateAgainstJsonSchema\";\nexport { visitDiscriminatedUnion } from \"./visitDiscriminatedUnion\";\nexport type { WithoutQuestionMarks } from \"./withoutQuestionMarks\";\n","/**\n * Asserts that a condition is truthy, throwing an exception with the specified message if it is falsy.\n */\nexport function assert(condition: unknown, message?: string): asserts condition {\n if (!condition) {\n throw new Error(message ?? \"Expected condition to be truthy but got falsy.\");\n }\n}\n\nexport function assertDefined<T>(val: T, message?: string): asserts val is Exclude<T, undefined> {\n if (val === undefined) {\n throw new Error(message ?? \"Expected value to be defined but got undefined.\");\n }\n}\n\nexport function assertNonNull<T>(val: T, message?: string): asserts val is Exclude<T, null> {\n if (val === null) {\n throw new Error(message ?? \"Expected value to be non-null but got null.\");\n }\n}\n\nexport function assertString(val: unknown, message?: string): asserts val is string {\n if (typeof val !== \"string\") {\n throw new Error(message ?? `Expected value to be a string but got ${typeof val}.`);\n }\n}\n\nexport function assertNever(x: never): never {\n throw new Error(\"Unexpected value: \" + JSON.stringify(x));\n}\n\n// biome-ignore lint/suspicious/noEmptyBlockStatements: allow\nexport function assertNeverNoThrow(_: never): void {}\n\n// biome-ignore lint/suspicious/noEmptyBlockStatements: allow\nexport function assertVoidNoThrow(_x: void): void {}\n","export { AbstractAstNode } from \"./AbstractAstNode\";\nexport { AbstractFormatter, NopFormatter } from \"./AbstractFormatter\";\nexport { AbstractWriter } from \"./AbstractWriter\";\nexport {\n type Argument,\n type Arguments,\n hasNamedArgument,\n isNamedArgument,\n type NamedArgument,\n type UnnamedArgument\n} from \"./Argument\";\nexport { CodeBlock } from \"./CodeBlock\";\nexport { Ternary } from \"./Ternary\";\n","import { tag } from \"../utils/stacktrace\";\nimport { AbstractWriter } from \"./AbstractWriter\";\n\nexport abstract class AbstractAstNode {\n /**\n * Every AST node knows how to write itself to a string.\n */\n public abstract write(writer: AbstractWriter): void;\n\n public constructor() {\n // when FERN_STACK_TRACK is defined this will track the stack trace of the current AstNode.\n // otherwise this has absolutely no effect whatsoever.\n tag(this);\n }\n}\n","/**\n * Global flag that enables or disables stack tracing functionality throughout the application.\n * This is controlled via the FERN_STACK_TRACK environment variable.\n *\n * When enabled (truthy environment variable value), stack traces will be captured and processed\n * by the stacktrace functions in this module. When disabled, the stacktrace() function returns\n * an empty array for performance optimization.\n *\n * @example\n * // Enable tracing by setting the environment variable\n * // FERN_STACK_TRACK=1 <cmdline>\n */\nconst key = process.env[\"FERN_STACK_TRACK\"]?.toLowerCase() ?? \"\";\n\nexport const enableStackTracking = key !== \"\" && key !== \"0\" && key !== \"false\";\n\n/** The style of comments desired for the stack tracking comments\n *\n * can be \"single\", \"multiline\", or \"box\".\n * if not set to one of those, defaults to \"single\".\n */\nexport const trackingType = [\"single\", \"multiline\", \"box\"].includes(key) ? key : \"single\";\n\nif (enableStackTracking) {\n // we're going to put a hard max limit on the stack trace to prevent infinite recursion and excessive stack generation\n Error.stackTraceLimit = 50;\n}\n\n/**\n * Configuration options for controlling stack trace capture and filtering behavior.\n */\ninterface StackTraceOptions {\n /**\n * Maximum number of stack frames to return after filtering.\n *\n * Maximum may never exceed 50.\n * @default 50\n */\n maxFrames?: number;\n\n /**\n * Number of frames to skip from the beginning of the filtered stack trace.\n * Useful for omitting wrapper functions from the output.\n * @default 0\n */\n skip?: number;\n\n /**\n * Array of function name substrings that trigger an early stop when encountered.\n * When a frame's function name includes any of these strings, that frame and all\n * subsequent frames will be excluded from the output.\n *\n * implicitly includes \"runInteractiveTask\"\n * @default []\n */\n stopOn?: string[];\n\n /**\n * Array of file path substrings to filter out. Any frame whose path contains\n * any of these strings will be excluded from the output.\n * @default []\n */\n filterPaths?: string[];\n\n /**\n * Array of function name substrings to filter out. Any frame whose function name\n * contains any of these strings will be excluded from the output.\n *\n * implicitly includes \"SdkGeneratorCLI\", \"runCli\",\"Frames.trace\",\"Frames.tag\", \"at\", \"stacktrace\"\n * @default []\n */\n filterFunctions?: string[];\n\n /**\n * Whether to filter out Node.js internal frames (paths starting with \"node:\").\n * @default true\n */\n filterNode?: boolean;\n\n /**\n * Whether to filter out .js files, which typically indicate non-source files\n * without source map information.\n * @default true\n */\n filterJs?: boolean;\n\n /**\n * A function to format the file path of the stack trace frame.\n * @default (filename) => filename\n */\n formatFilename?: (filename: string) => string;\n}\n\n/**\n * Represents a single parsed stack trace frame containing function, file path, and position information.\n */\nexport interface StackTraceFrame {\n /**\n * The function name or context. May include special formatting like \"alias()=> { ... }\"\n * for certain Object methods, or be an empty string for anonymous contexts.\n */\n fn: string;\n\n /**\n * The file path where this frame originated. This will typically be the full path\n * to the source file.\n */\n path: string;\n\n /**\n * The line and column position in the format \"line:column\" (e.g., \"42:13\").\n */\n position: string;\n}\n\nconst globalFunctionFilters = new Set<string>([\"SdkGeneratorCLI\", \"runCli\", \"LoggerImpl\", \"Array.forEach\"]);\nconst globalFileFilters = new Set<string>([\"stacktrace\"]);\n\n/**\n * Adds a function name to the global function filters for stack traces\n * @param filter - The function name to add to the global function filters.\n */\nexport function addGlobalFunctionFilter(filter: string): void {\n if (enableStackTracking) {\n globalFunctionFilters.add(filter);\n }\n}\n\n/**\n * Adds a file path to the global file filters for stack traces.\n * @param filter - The file path to add to the global file filters.\n */\nexport function addGlobalFileFilter(filter: string): void {\n if (enableStackTracking) {\n globalFileFilters.add(filter);\n }\n}\n\n/**\n * Captures and parses the current call stack, returning an array of stack frames with filtering options.\n *\n * This function creates a new Error object to capture the stack trace, then parses each frame\n * to extract function names, file paths, and positions. It applies multiple filtering strategies\n * to exclude unwanted frames (e.g., Node.js internals, .js files, specific functions).\n *\n * The function only operates when `enableStackTracking` is true. If tracing is disabled, it returns\n * an empty array for performance optimization.\n *\n * @param options - Configuration options for stack trace capture and filtering\n * @returns Array of parsed stack trace frames, filtered and limited according to the options\n *\n * @example\n * // Capture the first 10 frames, skipping the first 2\n * const frames = stacktrace({ maxFrames: 10, skip: 2 });\n *\n * @example\n * // Capture frames until hitting \"main\" function, filter out test files\n * const frames = stacktrace({\n * stopOn: [\"main\"],\n * filterPaths: [\"/test/\"],\n * filterFunctions: [\"runTests\"]\n * });\n *\n * @remarks\n * The function applies filters in the following order:\n * 1. Parses each stack frame using regex to extract function, path, line, and column\n * 2. Applies early-stop logic when encountering functions in the `stopOn` array\n * 3. Formats special function names (e.g., \"Object.alias\" → \"alias()=> { ... }\")\n * 4. Filters out:\n * - The stacktrace function itself (\"at\", \"stacktrace\")\n * - Functions matching `filterFunctions` (substring match)\n * - Node.js internal frames (if `filterNode` is true)\n * - .js files (if `filterJs` is true)\n * - Paths matching `filterPaths` (substring match)\n * 5. Applies `skip` and `maxFrames` to limit the output\n */\nexport function stacktrace({\n maxFrames = 50,\n skip = 0,\n filterPaths = [],\n filterFunctions = [],\n stopOn = [],\n filterNode = true,\n filterJs = true,\n formatFilename = (filename) => filename\n}: StackTraceOptions = {}): StackTraceFrame[] {\n if (!enableStackTracking) {\n return [];\n }\n filterFunctions = [...filterFunctions, ...globalFunctionFilters];\n filterPaths = [...filterPaths, ...globalFileFilters];\n stopOn = [...stopOn, \"runInteractiveTask\"];\n let stop = false;\n return (\n (new Error().stack ?? \"\")\n .split(\"\\n\")\n .map((line) => {\n const match = line.match(/at\\s+(.*)\\s+\\((.*):(\\d+):(\\d+)\\)/);\n if (match && match.length === 5) {\n let [, fn, path, line, column] = match;\n if (!fn || !path || !line || !column) {\n return undefined;\n }\n\n if (stop || stopOn.some((s) => fn?.includes(s))) {\n stop = true;\n return undefined;\n }\n\n switch (fn) {\n case \"Object.<anonymous>\":\n fn = \"\";\n break;\n case \"Object.object\":\n case \"Object.alias\":\n case \"Object.union\":\n case \"Object.enum\":\n case \"Object.undiscriminatedUnion\":\n fn = `${fn.substring(fn.indexOf(\".\") + 1)}()=> { ... }`;\n break;\n }\n return {\n fn,\n path: formatFilename(path),\n position: `${line}:${column}`\n } as StackTraceFrame;\n }\n return undefined;\n })\n .filter(\n (each) =>\n each &&\n !filterFunctions.some((f) => each.fn.includes(f)) && // substring match for filter functions\n !(filterNode && each.path?.startsWith(\"node:\")) && // starts with node:\n !(filterJs && each.path?.endsWith(\".js\")) && // ends with .js (meaning likely not a source file - no source map info)\n !filterPaths.some((p) => each.path.includes(p)) // substring match for filter paths\n ) as StackTraceFrame[]\n ).slice(skip, skip + maxFrames);\n}\n\n/**\n * Returns a formatted stack trace string at the current location for debugging purposes.\n *\n * This is a convenience function that wraps `stacktrace()` and formats the output as a\n * human-readable string. It's particularly useful for logging or debugging to understand\n * the execution flow and call hierarchy.\n *\n * The function supports both single-line and multi-line output formats. Single-line format\n * concatenates all frames into one line (useful for compact logging), while multi-line format\n * adds newlines and indentation for better readability.\n *\n * @param options - Configuration options for stack trace capture, filtering, and formatting\n * @param options.multiline - Whether to format the output with newlines and indentation.\n * When true, each frame is on its own line with 4-space indent.\n * When false (default), all frames are concatenated on one line.\n * @returns A formatted string containing the stack trace information, prefixed with \"stacktrace - \"\n *\n * @example\n * // Single-line format (compact)\n * console.log(at());\n * // Output: \"stacktrace - myFunction - /path/to/file.ts:42:13anotherFunc - /path/to/other.ts:17:5\"\n *\n * @example\n * // Multi-line format (readable)\n * console.log(at({ multiline: true, maxFrames: 5 }));\n * // Output:\n * // stacktrace -\n * // myFunction - /path/to/file.ts:42:13\n * // anotherFunc - /path/to/other.ts:17:5\n * // main - /path/to/index.ts:10:1\n *\n * @example\n * // Custom filtering for specific use case\n * console.log(at({\n * maxFrames: 10,\n * skip: 1,\n * filterPaths: [\"foo.ts\"],\n * multiline: true\n * }));\n *\n * @remarks\n * This function automatically skips itself from the stack trace output by default.\n * The \"at\" function name is filtered by the underlying `stacktrace()` function.\n */\nexport function at({\n maxFrames = 50,\n skip = 0,\n filterPaths = [],\n filterFunctions = [],\n stopOn = [\"runInteractiveTask\"],\n filterNode = true,\n filterJs = true,\n multiline = false,\n formatFilename = (filename) => filename\n}: StackTraceOptions & { multiline?: boolean } = {}): string {\n return enableStackTracking\n ? `${stacktrace({ maxFrames, skip, filterPaths, filterFunctions, stopOn, filterNode, filterJs, formatFilename })\n .map((each) => `${multiline ? \"\\n \" : \" > \"}${each.fn} - ${each.path}:${each.position}`)\n .join(\"\")}`\n : \"\";\n}\n\n/** This class allows the developer to attach stack trace information to objects */\nexport class StackTraces {\n private readonly maxFrames: number;\n private readonly skip: number;\n private readonly filterPaths: string[];\n private readonly filterFunctions: string[];\n private readonly stopOn: string[];\n private readonly filterNode: boolean;\n private readonly filterJs: boolean;\n private readonly multiline: boolean;\n private readonly formatFilename: (filename: string) => string;\n private tracking = new WeakMap<object, Set<StackTraceFrame>>();\n\n constructor({\n maxFrames = 50,\n skip = 0,\n filterPaths = [],\n filterFunctions = [],\n stopOn = [],\n filterNode = true,\n filterJs = true,\n multiline = false,\n formatFilename = (filename) => filename\n }: StackTraceOptions & { multiline?: boolean } = {}) {\n this.maxFrames = maxFrames;\n this.skip = skip;\n this.filterPaths = filterPaths;\n this.filterFunctions = filterFunctions;\n this.stopOn = stopOn;\n this.filterNode = filterNode;\n this.filterJs = filterJs;\n this.multiline = multiline;\n this.formatFilename = formatFilename;\n }\n\n /**\n * Tags the current stack trace with the given object.\n *\n * This can be called multiple times to add more stack trace information to the object.\n *\n * @param obj - The object to tag the stack trace with.\n */\n tag(obj: object): void {\n const current = this.tracking.get(obj) || new Set<StackTraceFrame>();\n stacktrace({\n maxFrames: this.maxFrames,\n skip: this.skip,\n filterPaths: this.filterPaths,\n filterFunctions: this.filterFunctions,\n stopOn: this.stopOn,\n filterNode: this.filterNode,\n filterJs: this.filterJs,\n formatFilename: this.formatFilename\n }).forEach((frame) => current.add(frame));\n this.tracking.set(obj, current);\n }\n\n /**\n * Returns a formatted stack trace string for the given object.\n * @param obj - The object to get the stack trace for.\n * @returns A formatted string containing the stack trace information.\n */\n trace(obj: object): string {\n if (!enableStackTracking) {\n return \"\";\n }\n const frames = this.tracking.get(obj);\n if (!frames) {\n return \"\";\n }\n\n return [...frames]\n .map((each) => `${this.multiline ? \"\\n \" : \"\"}${each.fn} - ${each.path}:${each.position}`)\n .join(\"\");\n }\n\n /**\n * Gets the stack trace frames for the given object.\n *\n * Note: This will only work when FERN_STACK_TRACK is defined and the .startTracking() function has been called.\n * Otherwise this will return an empty array.\n *\n * @param obj - The object to get the stack trace frames for.\n * @returns The stack trace frames for the given object.\n */\n frames(obj: object): StackTraceFrame[] {\n const frames = this.tracking.get(obj);\n if (!frames) {\n return [];\n }\n return [...frames];\n }\n\n /**\n * Frees the stack trace information for the given object.\n * @param obj - The object to free the stack trace information for.\n */\n free(obj: object): void {\n this.tracking.delete(obj);\n }\n\n /**\n * Clears all stack trace information.\n */\n clear(): void {\n this.tracking = new WeakMap<object, Set<StackTraceFrame>>();\n }\n}\n\nlet stackTraces: StackTraces | undefined;\n/**\n * Starts tracking the stack trace of the current object.\n *\n * Note: This will only start tracking when FERN_STACK_TRACK is defined.\n *\n * @param options - Configuration options for stack trace capture and filtering\n * @returns The stack traces object.\n */\nexport function startTracking({\n maxFrames = 50,\n skip = 0,\n filterPaths = [],\n filterFunctions = [],\n stopOn = [],\n filterNode = true,\n filterJs = true,\n multiline = false,\n formatFilename = (filename) => filename\n}: StackTraceOptions & { multiline?: boolean } = {}) {\n if (!enableStackTracking) {\n return;\n }\n stackTraces ??= new StackTraces({\n maxFrames,\n skip,\n filterPaths,\n filterFunctions,\n stopOn,\n filterNode,\n filterJs,\n multiline,\n formatFilename\n });\n}\n\n/**\n * Tags the current stack trace with the given object.\n *\n * Note: This will only work when FERN_STACK_TRACK is defined and the .startTracking() function has been called.\n * Otherwise this will do nothing whatsoever.\n *\n * @param obj - The object to tag the stack trace with.\n */\nexport function tag(obj: object) {\n stackTraces?.tag(obj);\n}\n\n/**\n * Returns a formatted stack trace string for the given object.\n *\n * Note: This will only work when FERN_STACK_TRACK is defined and the .startTracking() function has been called.\n * Otherwise this will do nothing whatsoever.\n *\n * @param obj - The object to get the stack trace for.\n * @returns A formatted string containing the stack trace information.\n */\nexport function trace(obj: object) {\n return stackTraces?.trace(obj) ?? \"\";\n}\n\n/**\n * Frees the stack trace information for the given object.\n *\n * Note: This will only work when FERN_STACK_TRACK is defined and the .startTracking() function has been called.\n * Otherwise this will do nothing whatsoever.\n *\n * @param obj - The object to free the stack trace information for.\n */\nexport function free(obj: object) {\n stackTraces?.free(obj);\n}\n\n/**\n * Gets the stack trace frames for the given object.\n *\n * Note: This will only work when FERN_STACK_TRACK is defined and the .startTracking() function has been called.\n * Otherwise this will return an empty array.\n *\n * @param obj - The object to get the stack trace frames for.\n * @returns The stack trace frames for the given object.\n */\nexport function getFramesForTaggedObject(obj: object): StackTraceFrame[] {\n return stackTraces?.frames(obj) ?? [];\n}\n","import { enableStackTracking } from \"../utils\";\nimport {\n getFramesForTaggedObject,\n StackTraceFrame,\n stacktrace,\n startTracking,\n trackingType\n} from \"../utils/stacktrace\";\nimport { AbstractAstNode } from \"./AbstractAstNode\";\nimport { CodeBlock } from \"./CodeBlock\";\n\nconst TAB_SIZE = 4;\n// this will start tracking only when FERN_STACK_TRACK is defined\n// otherwise this has absolutely no effect whatsoever.\nstartTracking({ skip: 0, maxFrames: 15, filterFunctions: [\"Abstract\"] });\n\nexport class AbstractWriter {\n /* The buffer of lines being written */\n protected readonly lineBuffer: string[] = [];\n\n /* The contents being written */\n public get buffer() {\n if (enableStackTracking && this.nodeStackFrames.length > 0) {\n // if we're emitting tracking comments, let's ensure we get the last little bit of info.\n // by appending a newline to the buffer before returning it.\n // (this can be useful when using toString() to get a node's content.)\n this.writeInternal(\"\\n\");\n }\n return this.lineBuffer.join(\"\\n\") + (this.lastCharacterIsNewline ? \"\\n\" : \"\");\n }\n\n /* Indentation level (multiple of 4) */\n private indentLevel = 0;\n /* Whether anything has been written to the buffer */\n private hasWrittenAnything = false;\n /* Whether the last character written was a semi colon */\n private lastCharacterIsSemicolon = false;\n /* Whether the last character written was a newline */\n private lastCharacterIsNewline = false;\n /* The stack traces associated with the current node */\n private nodeStackFrames: StackTraceFrame[] = [];\n\n /**\n * Writes arbitrary text and nodes\n * @param text\n */\n public write(...parts: (string | AbstractAstNode | undefined)[]): void {\n for (const text of parts) {\n if (text != null) {\n if (typeof text === \"string\") {\n const textEndsInNewline = text.length > 0 && text.endsWith(\"\\n\");\n // temporarily remove the trailing newline, since we don't want to add the indent prefix after it\n const textWithoutNewline = textEndsInNewline ? text.substring(0, text.length - 1) : text;\n\n const indent = this.getIndentString();\n let indentedText = textWithoutNewline.replaceAll(\"\\n\", `\\n${indent}`);\n if (this.isAtStartOfLine()) {\n indentedText = indent + indentedText;\n }\n if (textEndsInNewline) {\n indentedText += \"\\n\";\n }\n this.writeInternal(indentedText);\n } else {\n this.writeNode(text);\n }\n }\n }\n }\n\n public writeStatement(...parts: (string | AbstractAstNode | undefined)[]): void {\n this.write(...parts);\n this.write(\";\");\n this.writeNewLineIfLastLineNot();\n }\n\n /**\n * Writes arbitrary text without indentation\n * @param text\n */\n public writeNoIndent(text: string): void {\n const currIndentLevel = this.indentLevel;\n this.indentLevel = 0;\n this.write(text);\n this.indentLevel = currIndentLevel;\n }\n\n /**\n * Writes a node\n * @param node\n */\n public writeNode(node: AbstractAstNode): void {\n if (enableStackTracking) {\n this.nodeStackFrames.push(...getFramesForTaggedObject(node));\n }\n node.write(this);\n\n // if we're using box or multiline comments, write a newline after every node so it emits a comment for the node\n // since we're dumping a lot of data anyway, might as well be explicit about it.\n if (enableStackTracking && trackingType !== \"single\") {\n this.writeInternal(\"\\n\");\n }\n }\n\n /**\n * Writes a node or string\n * @param input\n */\n public writeNodeOrString(input: AbstractAstNode | string): void {\n if (typeof input === \"string\") {\n this.write(input);\n return;\n }\n\n this.writeNode(input);\n }\n\n /**\n * Writes a node but then suffixes with a `;` and new line\n * @param node\n */\n public writeNodeStatement(node: AbstractAstNode): void {\n this.writeNode(node);\n this.write(\";\");\n this.writeNewLineIfLastLineNot();\n }\n\n /**\n * Writes text but then suffixes with a `;`\n * @param node\n */\n public writeTextStatement(text: string): void {\n const codeBlock = new CodeBlock(text);\n codeBlock.write(this);\n if (!text.endsWith(\";\")) {\n this.write(\";\");\n }\n this.writeNewLineIfLastLineNot();\n }\n\n /**\n * Starts a control flow block\n * @param prefix\n * @param statement\n */\n public controlFlow(prefix: string, statement: AbstractAstNode): void {\n const codeBlock = new CodeBlock(prefix);\n codeBlock.write(this);\n this.write(\" (\", statement, \")\");\n this.pushScope();\n }\n\n /**\n * Starts a control flow block\n * @param prefix\n * @param statement\n */\n public controlFlowWithoutStatement(prefix: string): void {\n const codeBlock = new CodeBlock(prefix);\n codeBlock.write(this);\n this.pushScope();\n }\n\n /**\n * Ends a control flow block\n */\n public endControlFlow(): void {\n this.popScope();\n }\n\n /**\n * Starts a control flow without a newline from the previous control flow block\n * @param prefix\n * @param statement\n */\n public contiguousControlFlow(prefix: string, statement: AbstractAstNode): void {\n this.dedent();\n this.write(\"} \");\n const codeBlock = new CodeBlock(prefix);\n codeBlock.write(this);\n this.write(\" (\", statement, \")\");\n this.pushScope();\n }\n\n /**\n * Starts a control flow alternative block\n * @param prefix\n */\n public alternativeControlFlow(prefix: string): void {\n this.dedent();\n this.write(\"} \");\n const codeBlock = new CodeBlock(prefix);\n codeBlock.write(this);\n this.pushScope();\n }\n\n public pushScope() {\n this.writeLine(\"{\");\n this.indent();\n }\n\n public popScope(withNewline = true) {\n this.dedent();\n this.writeNewLineIfLastLineNot();\n if (withNewline) {\n this.writeLine(\"}\");\n } else {\n this.write(\"}\");\n }\n }\n\n /* Only writes a newline if last line in the buffer is not a newline */\n public writeLine(...parts: (string | AbstractAstNode | undefined)[]): void {\n this.write(...(parts.length === 0 ? [\"\"] : parts));\n this.writeNewLineIfLastLineNot();\n }\n\n /* Always writes newline */\n public newLine(): void {\n this.writeInternal(\"\\n\");\n }\n\n public writeSemicolonIfLastCharacterIsNot(): void {\n if (!this.lastCharacterIsSemicolon) {\n this.writeInternal(\";\");\n }\n }\n\n public writeNewLineIfLastLineNot(): void {\n if (!this.lastCharacterIsNewline) {\n this.writeInternal(\"\\n\");\n }\n }\n\n public indent(): void {\n this.indentLevel++;\n }\n\n public dedent(): void {\n this.indentLevel--;\n }\n\n public delimit<T extends AbstractAstNode>({\n nodes,\n delimiter,\n writeFunction\n }: {\n nodes: T[];\n delimiter: string;\n writeFunction: (node: T) => void;\n }): void {\n if (nodes.length > 0) {\n const firstNode = nodes[0];\n if (firstNode != null) {\n writeFunction(firstNode);\n }\n for (let i = 1; i < nodes.length; i++) {\n this.write(delimiter);\n const node = nodes[i];\n if (node != null) {\n writeFunction(node);\n }\n }\n }\n }\n\n public toString(): string {\n return this.buffer;\n }\n\n /*******************************\n * Helper Methods\n *******************************/\n private writeInternal(text: string) {\n if (text.length === 0) {\n return;\n }\n\n const appendToLastLine = !this.lastCharacterIsNewline;\n\n this.hasWrittenAnything = true;\n this.lastCharacterIsNewline = text.endsWith(\"\\n\");\n this.lastCharacterIsSemicolon = text.endsWith(\";\");\n\n const lines = text.split(\"\\n\");\n\n const appendTrackingComment =\n enableStackTracking && !this.shouldSkipTracking(lines) && this.lastCharacterIsNewline;\n\n if (appendToLastLine) {\n this.lastLine = `${this.lastLine}${lines.shift() || \"\"}`;\n }\n\n if (this.lastCharacterIsNewline) {\n lines.pop();\n }\n\n this.lineBuffer.push(...lines);\n\n if (appendTrackingComment) {\n this.appendTrackingComment();\n }\n }\n\n /**\n * Sets the last line of the buffer\n * @param line - The line to set\n */\n protected set lastLine(line: string) {\n if (this.lineBuffer.length > 0) {\n this.lineBuffer[this.lineBuffer.length - 1] = line;\n } else {\n this.lineBuffer.push(line);\n }\n }\n\n /**\n * Gets the last line of the buffer\n * @returns The last line of the buffer\n */\n protected get lastLine() {\n return this.lineBuffer[this.lineBuffer.length - 1] || \"\";\n }\n\n /**\n * Determines if the tracking comment should be skipped\n * @param lines - The that are being written out\n *\n * @returns True if the tracking comment should be skipped\n */\n protected shouldSkipTracking(lines: string[]) {\n return false;\n }\n\n /**\n * Formats the stack trace frames into a string\n * @param stack - The stack trace to format\n * @param prefix - The prefix to add to the stack trace\n * @returns The formatted stack trace\n */\n protected formatStack(stack: StackTraceFrame[], prefix = \"\") {\n return stack.map((each) => `${prefix ? `(${prefix}) ` : \"\"} ${each.fn} - ${each.path} : ${each.position}`);\n }\n\n /**\n * Filters out frames that start with the name of the current class\n *\n * This will filter out frames that start with the name of the current class that inherits from AbstractWriter.\n *\n * You can override this function to filter out more things.\n * @param stack - The stack trace to filter\n * @returns The filtered stack trace\n */\n protected filterStack(stack: StackTraceFrame[]) {\n return stack.filter((each) => !each.fn.startsWith(`${this.constructor.name}.`));\n }\n\n /**\n * Prepares the stack trace and calls the appropriate tracking comment formatter\n */\n protected appendTrackingComment() {\n const stack = [\n // adds the stack frames of the current function call\n ...this.formatStack(this.filterStack(stacktrace({ maxFrames: 15, skip: 3 }))),\n\n // adds the stack frames of any AstNodes that have been written since the last tracking comment\n ...this.formatStack(this.filterStack(this.nodeStackFrames), \"node\")\n ];\n // reset the ast node stack frames\n this.nodeStackFrames.length = 0;\n\n switch (trackingType) {\n case \"single\":\n return this.singleLineTrackingComment(stack);\n\n case \"multiline\":\n return this.multiLineTrackingComment(stack);\n\n case \"box\":\n return this.boxTrackingComment(stack);\n }\n }\n\n /**\n * Creates a single line tracking comment\n *\n * Override this to change the format of the comment.\n *\n * @param stack - The stack trace to add to the comment\n */\n protected singleLineTrackingComment(stack: string[]) {\n this.lastLine = `${this.lastLine} // ${stack.join(\" \")}`;\n }\n /**\n * Creates a multi line tracking comment\n *\n * Override this to change the format of the comment.\n *\n * @param stack - The stack trace to add to the comment\n */\n protected multiLineTrackingComment(stack: string[]) {\n this.lineBuffer.push(...stack.map((each) => ` // ${each}`));\n }\n /**\n * Creates a box tracking comment\n *\n * Override this to change the format of the comment.\n *\n * @param stack - The stack trace to add to the comment\n */\n protected boxTrackingComment(stack: string[]) {\n this.lineBuffer.push(\"/*\", ...stack.map((each) => ` ${each}`), \"*/\");\n }\n\n private isAtStartOfLine(): boolean {\n return this.lastCharacterIsNewline || !this.hasWrittenAnything;\n }\n\n private getIndentString(): string {\n return \" \".repeat(this.indentLevel * this.getTabSize());\n }\n\n protected getTabSize(): number {\n return TAB_SIZE;\n }\n}\n","export { getPackageName } from \"./getPackageName\";\nexport { getSdkVersion } from \"./getSdkVersion\";\nexport {\n addGlobalFileFilter,\n addGlobalFunctionFilter,\n at,\n enableStackTracking,\n getFramesForTaggedObject,\n StackTraces,\n stacktrace\n} from \"./stacktrace\";\n","import { AbstractAstNode } from \"./AbstractAstNode\";\nimport { AbstractWriter } from \"./AbstractWriter\";\n\nexport declare namespace CodeBlock {\n /* Write arbitrary code */\n type Arg<T extends AbstractWriter> = string | AbstractAstNode | ((writer: T) => void);\n}\n\nexport class CodeBlock<T extends AbstractWriter> extends AbstractAstNode {\n private value: CodeBlock.Arg<T>;\n\n constructor(value: CodeBlock.Arg<T>) {\n super();\n this.value = value;\n }\n\n public write(writer: T): void {\n if (typeof this.value === \"string\") {\n writer.write(this.value);\n // if function\n } else if (typeof this.value === \"function\") {\n this.value(writer);\n } else {\n this.value.write(writer);\n }\n }\n}\n","export { AbstractDynamicSnippetsGenerator } from \"./AbstractDynamicSnippetsGenerator\";\nexport { AbstractDynamicSnippetsGeneratorContext } from \"./AbstractDynamicSnippetsGeneratorContext\";\nexport { type DiscriminatedUnionTypeInstance } from \"./DiscriminatedUnionTypeInstance\";\nexport { ErrorReporter, Severity } from \"./ErrorReporter\";\nexport { type Options, Style } from \"./Options\";\nexport { Result } from \"./Result\";\nexport { Scope } from \"./Scope\";\nexport { type TypeInstance } from \"./TypeInstance\";\nexport { DynamicSnippetsTestRunner } from \"./test-utils/DynamicSnippetsTestRunner\";\n","export const Severity = {\n Critical: \"CRITICAL\",\n Warning: \"WARNING\"\n} as const;\n\nexport declare namespace ErrorReporter {\n type Path = readonly PathItem[];\n\n type PathItem = string | ArrayPathItem;\n\n type Severity = (typeof Severity)[keyof typeof Severity];\n\n interface ArrayPathItem {\n index: number;\n }\n\n interface Error {\n path?: Path;\n severity: Severity;\n message: string;\n }\n}\n\ninterface Error_ {\n severity: \"CRITICAL\" | \"WARNING\";\n path: string[] | undefined;\n message: string;\n}\n\nexport class ErrorReporter {\n private errors: ErrorReporter.Error[];\n private path: ErrorReporter.PathItem[];\n\n constructor() {\n this.errors = [];\n this.path = [];\n }\n\n public add(err: Omit<ErrorReporter.Error, \"path\">): void {\n this.errors.push({\n ...err,\n path: [...this.path]\n });\n }\n\n public scope(path: ErrorReporter.PathItem): void {\n this.path.push(path);\n }\n\n public unscope(): void {\n this.path.pop();\n }\n\n public getBySeverity(severity: ErrorReporter.Severity): ErrorReporter.Error[] {\n return this.errors.filter((err) => err.severity === severity);\n }\n\n public empty(): boolean {\n return this.errors.length === 0;\n }\n\n public size(): number {\n return this.errors.length;\n }\n\n public clone(): ErrorReporter {\n const clone = new ErrorReporter();\n clone.errors = [...this.errors];\n clone.path = [...this.path];\n return clone;\n }\n\n public reset(): void {\n this.errors = [];\n this.path = [];\n }\n\n public toDynamicSnippetErrors(): Error_[] {\n return this.errors.map((err) => ({\n severity: err.severity,\n path: err.path != null ? this.pathToStringArray(err.path) : undefined,\n message: err.message\n }));\n }\n\n private pathToStringArray(path: ErrorReporter.Path): string[] {\n const result: string[] = [];\n for (const item of path) {\n if (typeof item === \"string\") {\n result.push(item);\n continue;\n }\n result[result.length - 1] += `[${item.index}]`;\n }\n return result;\n }\n}\n","export const Scope = {\n PathParameters: \"pathParameters\",\n QueryParameters: \"queryParameters\",\n Headers: \"headers\",\n RequestBody: \"requestBody\"\n} as const;\n\nexport type Scope = (typeof Scope)[keyof typeof Scope];\n","export * as python from \"./python\";\n","import { AccessAttribute } from \"./AccessAttribute\";\nimport { Assign } from \"./Assign\";\nimport { BaseInvocation } from \"./BaseInvocation\";\nimport { Class } from \"./Class\";\nimport { ClassInstantiation } from \"./ClassInstantiation\";\nimport { CodeBlock } from \"./CodeBlock\";\nimport { Comment } from \"./Comment\";\nimport { Decorator } from \"./Decorator\";\nimport { Field } from \"./Field\";\nimport { Lambda } from \"./Lambda\";\nimport { LambdaParameter } from \"./LambdaParameter\";\nimport { Method } from \"./Method\";\nimport { MethodArgument } from \"./MethodArgument\";\nimport { MethodInvocation } from \"./MethodInvocation\";\nimport { Operator } from \"./Operator\";\nimport { Parameter } from \"./Parameter\";\nimport { PythonFile } from \"./PythonFile\";\nimport { Reference } from \"./Reference\";\nimport { StarImport } from \"./StarImport\";\n\nexport { AccessAttribute } from \"./AccessAttribute\";\nexport { Class } from \"./Class\";\nexport { ClassInstantiation } from \"./ClassInstantiation\";\nexport { CodeBlock } from \"./CodeBlock\";\nexport { Comment } from \"./Comment\";\nexport { AstNode } from \"./core/AstNode\";\nexport { Decorator } from \"./Decorator\";\nexport { Field } from \"./Field\";\nexport { Lambda } from \"./Lambda\";\nexport { LambdaParameter } from \"./LambdaParameter\";\nexport { Method } from \"./Method\";\nexport { MethodArgument } from \"./MethodArgument\";\nexport { MethodInvocation } from \"./MethodInvocation\";\nexport { Operator } from \"./Operator\";\nexport { Parameter } from \"./Parameter\";\nexport { PythonFile } from \"./PythonFile\";\nexport { Reference } from \"./Reference\";\nexport { StarImport } from \"./StarImport\";\nexport { Type } from \"./Type\";\nexport { type NamedValue, TypeInstantiation } from \"./TypeInstantiation\";\n\nexport function accessAttribute(args: AccessAttribute.Args): AccessAttribute {\n return new AccessAttribute(args);\n}\n\nexport function assign(args: Assign.Args): Assign {\n return new Assign(args);\n}\n\nexport function file(args: PythonFile.Args): PythonFile {\n return new PythonFile(args);\n}\n\nexport function class_(args: Class.Args): Class {\n return new Class(args);\n}\n\nexport function instantiateClass(args: ClassInstantiation.Args): ClassInstantiation {\n return new ClassInstantiation(args);\n}\n\nexport function decorator(args: Decorator.Args): Decorator {\n return new Decorator(args);\n}\n\nexport function reference(args: Reference.Args): Reference {\n return new Reference(args);\n}\n\nexport function starImport(args: StarImport.Args): StarImport {\n return new StarImport(args);\n}\n\nexport function field(args: Field.Args): Field {\n return new Field(args);\n}\n\nexport function codeBlock(args: CodeBlock.Arg): CodeBlock {\n return new CodeBlock(args);\n}\n\nexport function comment(args: Comment.Args): Comment {\n return new Comment(args);\n}\n\nexport function lambda(args: Lambda.Args): Lambda {\n return new Lambda(args);\n}\n\nexport function lambdaParameter(args: LambdaParameter.Args): LambdaParameter {\n return new LambdaParameter(args);\n}\n\nexport function method(args: Method.Args): Method {\n return new Method(args);\n}\n\nexport function invokeFunction(args: BaseInvocation.Args): BaseInvocation {\n return new BaseInvocation(args);\n}\n\nexport function invokeMethod(args: MethodInvocation.Args): MethodInvocation {\n return new MethodInvocation(args);\n}\n\nexport function parameter(args: Parameter.Args): Parameter {\n return new Parameter(args);\n}\n\nexport function methodArgument(args: MethodArgument.Args): MethodArgument {\n return new MethodArgument(args);\n}\n\nexport function operator(args: Operator.Args): Operator {\n return new Operator(args);\n}\n","import { AstNode } from \"./core/AstNode\";\nimport { Writer } from \"./core/Writer\";\n\nexport declare namespace AccessAttribute {\n interface Args {\n lhs: AstNode;\n rhs: AstNode;\n }\n}\n\nexport class AccessAttribute extends AstNode {\n private readonly lhs: AstNode;\n private readonly rhs: AstNode;\n\n constructor({ lhs, rhs }: AccessAttribute.Args) {\n super();\n\n this.lhs = lhs;\n this.inheritReferences(lhs);\n\n this.rhs = rhs;\n this.inheritReferences(rhs);\n }\n\n public write(writer: Writer): void {\n this.lhs.write(writer);\n writer.write(\".\");\n this.rhs.write(writer);\n }\n}\n","import { AbstractAstNode, AbstractFormatter } from \"@fern-api/browser-compatible-base-generator\";\n\nimport { Reference } from \"../Reference\";\nimport { Writer } from \"./Writer\";\n\nexport abstract class AstNode extends AbstractAstNode {\n protected references: Reference[] = [];\n\n public addReference(reference: Reference): void {\n this.references.push(reference);\n }\n\n public inheritReferences(astNode: AstNode | undefined): void {\n if (astNode === undefined) {\n return;\n }\n\n astNode.references.forEach((reference) => {\n if (!this.references.includes(reference)) {\n this.addReference(reference);\n }\n });\n }\n\n public getReferences(): Reference[] {\n return this.references;\n }\n\n /**\n * Writes the node to a string.\n */\n public toString(): string {\n const writer = new Writer();\n this.write(writer);\n return writer.toString();\n }\n\n /**\n * Writes the node to a string and formats it.\n */\n public async toStringFormatted(formatter: AbstractFormatter): Promise<string> {\n const writer = new Writer();\n this.write(writer);\n return writer.toStringFormatted(formatter);\n }\n}\n","import { AbstractFormatter, AbstractWriter } from \"@fern-api/browser-compatible-base-generator\";\n\nimport { Reference } from \"../Reference\";\nimport { ImportedName } from \"./types\";\n\nexport class Writer extends AbstractWriter {\n private fullyQualifiedModulePathsToImportedNames: Record<string, ImportedName> = {};\n\n public setRefNameOverrides(completeRefPathsToNameOverrides: Record<string, ImportedName>): void {\n this.fullyQualifiedModulePathsToImportedNames = completeRefPathsToNameOverrides;\n }\n\n public unsetRefNameOverrides(): void {\n this.fullyQualifiedModulePathsToImportedNames = {};\n }\n\n public getRefNameOverride(reference: Reference): ImportedName {\n const explicitNameOverride =\n this.fullyQualifiedModulePathsToImportedNames[reference.getFullyQualifiedModulePath()];\n\n if (explicitNameOverride) {\n return explicitNameOverride;\n }\n\n return { name: reference.alias ?? reference.name, isAlias: !!reference.alias };\n }\n\n public toString(): string {\n return this.buffer;\n }\n\n public async toStringFormatted(formatter: AbstractFormatter): Promise<string> {\n return formatter.format(this.buffer);\n }\n}\n","import { AstNode } from \"./core/AstNode\";\nimport { Writer } from \"./core/Writer\";\n\nexport declare namespace Assign {\n interface Args {\n lhs: AstNode;\n rhs: AstNode;\n }\n}\n\nexport class Assign extends AstNode {\n private readonly lhs: AstNode;\n private readonly rhs: AstNode;\n\n constructor({ lhs, rhs }: Assign.Args) {\n super();\n\n this.lhs = lhs;\n this.inheritReferences(lhs);\n\n this.rhs = rhs;\n this.inheritReferences(rhs);\n }\n\n public write(writer: Writer): void {\n this.lhs.write(writer);\n writer.write(\" = \");\n this.rhs.write(writer);\n }\n}\n","import { AstNode } from \"./core/AstNode\";\nimport { Writer } from \"./core/Writer\";\nimport { MethodArgument } from \"./MethodArgument\";\nimport { Reference } from \"./Reference\";\n\nexport declare namespace BaseInvocation {\n interface Args {\n /* A reference to the callable that you'd like to invoke */\n reference: Reference;\n /* The arguments to pass to the method */\n arguments_: MethodArgument[];\n /* Whether to write the invocation on a new line */\n multiline?: boolean;\n }\n}\n\nexport class BaseInvocation extends AstNode {\n protected reference: Reference;\n private arguments: MethodArgument[];\n private multiline: boolean;\n\n constructor({ reference, arguments_, multiline }: BaseInvocation.Args) {\n super();\n\n this.reference = reference;\n this.arguments = arguments_;\n this.multiline = multiline ?? false;\n\n this.inheritReferences(reference);\n this.arguments.forEach((arg) => {\n this.inheritReferences(arg);\n });\n }\n\n public write(writer: Writer): void {\n this.reference.write(writer);\n\n if (this.arguments.length === 0) {\n writer.write(\"()\");\n return;\n }\n\n writer.write(\"(\");\n if (this.multiline) {\n writer.newLine();\n writer.indent();\n }\n this.arguments.forEach((arg, idx) => {\n arg.write(writer);\n if (idx < this.arguments.length - 1) {\n writer.write(\",\");\n if (this.multiline) {\n writer.newLine();\n } else {\n writer.write(\" \");\n }\n }\n });\n if (this.multiline) {\n writer.newLine();\n writer.dedent();\n }\n writer.write(\")\");\n }\n}\n","import { AstNode } from \"./core/AstNode\";\nimport { Writer } from \"./core/Writer\";\nimport { Decorator } from \"./Decorator\";\nimport { Field } from \"./Field\";\nimport { Reference } from \"./Reference\";\n\nexport declare namespace Class {\n interface Args {\n /* The name of the Python class */\n name: string;\n /* Documentation string for the class */\n docs?: string;\n /* The parent classes that this class inherits from */\n extends_?: Reference[];\n /* The decorators that should be applied to this class */\n decorators?: Decorator[];\n }\n}\n\nexport class Class extends AstNode {\n public readonly name: string;\n public readonly extends_: Reference[];\n public readonly decorators: Decorator[];\n public readonly fields: Field[] = [];\n public readonly docs?: string;\n private statements: AstNode[] = [];\n\n constructor({ docs, name, extends_, decorators }: Class.Args) {\n super();\n this.name = name;\n this.extends_ = extends_ ?? [];\n this.decorators = decorators ?? [];\n this.docs = docs;\n\n this.extends_.forEach((parentClassReference) => {\n this.inheritReferences(parentClassReference);\n });\n\n this.decorators.forEach((decorator) => {\n this.inheritReferences(decorator);\n });\n }\n\n public write(writer: Writer): void {\n this.decorators.forEach((decorator) => {\n decorator.write(writer);\n });\n\n writer.write(`class ${this.name}`);\n\n if (this.extends_.length > 0) {\n writer.write(\"(\");\n this.extends_.forEach((parentClassReference, index) => {\n if (index > 0) {\n writer.write(\", \");\n }\n parentClassReference.write(writer);\n });\n writer.write(\")\");\n }\n writer.write(\":\");\n writer.newLine();\n\n writer.indent();\n if (this.docs != null) {\n writer.write('\"\"\"');\n writer.write(this.docs);\n writer.write('\"\"\"');\n }\n writer.writeNewLineIfLastLineNot();\n\n this.fields.forEach((field) => {\n field.write(writer);\n writer.writeNewLineIfLastLineNot();\n });\n writer.dedent();\n\n writer.indent();\n if (this.statements.length) {\n this.writeStatements({ writer });\n } else {\n writer.write(\"pass\");\n }\n writer.dedent();\n }\n\n public add(statement: AstNode): void {\n this.statements.push(statement);\n this.inheritReferences(statement);\n }\n\n private writeStatements({ writer }: { writer: Writer }): void {\n this.statements.forEach((statement, index) => {\n statement.write(writer);\n writer.writeNewLineIfLastLineNot();\n });\n }\n\n public addField(field: Field): void {\n this.add(field);\n }\n}\n","import { BaseInvocation } from \"./BaseInvocation\";\nimport { Reference } from \"./Reference\";\n\nexport declare namespace ClassInstantiation {\n interface Args extends Omit<BaseInvocation.Args, \"reference\"> {\n /* A reference to the class that you'd like to instantiate */\n classReference: Reference;\n }\n}\n\nexport class ClassInstantiation extends BaseInvocation {\n constructor({ classReference, ...args }: ClassInstantiation.Args) {\n super({ reference: classReference, ...args });\n }\n}\n","import { CodeBlock as CommonCodeBlock } from \"@fern-api/browser-compatible-base-generator\";\n\nimport { AstNode } from \"./core/AstNode\";\nimport { Writer } from \"./core/Writer\";\n\nexport declare namespace CodeBlock {\n /* Write arbitrary code */\n type Arg = CommonCodeBlock.Arg<Writer>;\n}\n\nexport class CodeBlock extends AstNode {\n private arg: CodeBlock.Arg;\n\n public constructor(arg: CodeBlock.Arg) {\n super();\n this.arg = arg;\n }\n\n public write(writer: Writer): void {\n const commonCodeBlock = new CommonCodeBlock(this.arg);\n return commonCodeBlock.write(writer);\n }\n}\n","import { AstNode } from \"./core/AstNode\";\nimport { Writer } from \"./core/Writer\";\n\nexport declare namespace Comment {\n interface Args {\n /* The comment documentation, if any */\n docs?: string;\n }\n}\n\nexport class Comment extends AstNode {\n public readonly docs: string | undefined;\n\n public constructor({ docs }: Comment.Args) {\n super();\n this.docs = docs;\n }\n\n public write(writer: Writer): void {\n if (this.docs != null) {\n this.docs.split(\"\\n\").forEach((line) => {\n writer.writeLine(`# ${line}`);\n });\n }\n }\n}\n","import { AstNode } from \"./core/AstNode\";\nimport { Writer } from \"./core/Writer\";\n\nexport declare namespace Decorator {\n interface Args {\n callable: AstNode;\n }\n}\n\nexport class Decorator extends AstNode {\n private callable: AstNode;\n\n constructor({ callable }: Decorator.Args) {\n super();\n this.callable = callable;\n this.inheritReferences(callable);\n }\n\n public write(writer: Writer): void {\n writer.write(\"@\");\n this.callable.write(writer);\n writer.newLine();\n }\n}\n","import { AstNode } from \"./core/AstNode\";\nimport { Writer } from \"./core/Writer\";\nimport { Type } from \"./Type\";\n\nexport declare namespace Field {\n export interface BaseArgs {\n /* The name of the field */\n name: string;\n /* The documentation for the field */\n docs?: string;\n }\n\n /* At least one of type or initializer must be defined\n * type: The type annotation of the field\n * initializer: The initializer for the field\n */\n export type Args = BaseArgs &\n (\n | { type: Type; initializer?: AstNode }\n | { type?: Type; initializer: AstNode }\n | { type: Type; initializer: AstNode }\n );\n}\n\nexport class Field extends AstNode {\n public readonly name: string;\n public readonly type: Type | undefined;\n public readonly initializer: AstNode | undefined;\n public readonly docs: string | undefined;\n\n constructor({ name, type, initializer, docs }: Field.Args) {\n super();\n this.name = name;\n this.type = type;\n this.initializer = initializer;\n this.docs = docs;\n\n this.inheritReferences(this.type);\n this.inheritReferences(this.initializer);\n }\n\n public write(writer: Writer): void {\n writer.write(this.name);\n\n if (this.type !== undefined) {\n writer.write(\": \");\n this.type.write(writer);\n }\n\n if (this.initializer !== undefined) {\n writer.write(\" = \");\n this.initializer.write(writer);\n }\n\n if (this.docs != null) {\n writer.newLine();\n writer.write('\"\"\"');\n writer.newLine();\n writer.write(this.docs);\n writer.newLine();\n writer.write('\"\"\"');\n }\n }\n}\n","import { AstNode } from \"./core/AstNode\";\nimport { Writer } from \"./core/Writer\";\nimport { LambdaParameter } from \"./LambdaParameter\";\n\nexport declare namespace Lambda {\n interface Args {\n /* The parameter names of the lambda */\n parameters?: LambdaParameter[];\n /* The body of the lambda */\n body: AstNode;\n }\n}\n\nexport class Lambda extends AstNode {\n private readonly parameters: LambdaParameter[];\n private readonly body: AstNode;\n\n constructor({ parameters, body }: Lambda.Args) {\n super();\n this.parameters = parameters ?? [];\n this.body = body;\n\n this.inheritReferences(body);\n }\n\n public write(writer: Writer): void {\n writer.write(\"lambda\");\n\n if (this.parameters && this.parameters.length) {\n writer.write(\" \");\n this.parameters.forEach((param, index) => {\n param.write(writer);\n if (index < this.parameters.length - 1) {\n writer.write(\", \");\n }\n });\n }\n writer.write(\": \");\n this.body.write(writer);\n }\n}\n","import { AstNode } from \"./core/AstNode\";\nimport { Parameter } from \"./Parameter\";\n\nexport declare namespace LambdaParameter {\n interface Args {\n /* The name of the parameter */\n name: string;\n /* The initializer for the parameter */\n initializer?: AstNode;\n }\n}\n\nexport class LambdaParameter extends Parameter {\n constructor({ name, initializer }: LambdaParameter.Args) {\n super({ name, initializer, type: undefined });\n }\n}\n","import { AstNode } from \"./core/AstNode\";\nimport { Writer } from \"./core/Writer\";\nimport { Type } from \"./Type\";\n\nexport declare namespace Parameter {\n interface Args {\n /* The name of the parameter */\n name: string;\n /* The type of the parameter. Set to undefined if you explicitly do not want a type hint. */\n type: Type | undefined;\n /* The initializer for the parameter */\n initializer?: AstNode;\n }\n}\n\nexport class Parameter extends AstNode {\n public readonly name: string;\n public readonly initializer: AstNode | undefined;\n public readonly type: Type | undefined;\n\n constructor({ name, type, initializer }: Parameter.Args) {\n super();\n this.name = name;\n this.type = type;\n this.initializer = initializer;\n }\n\n public write(writer: Writer): void {\n writer.write(this.name);\n\n if (this.type) {\n writer.write(\": \");\n this.type.write(writer);\n }\n\n if (this.initializer !== undefined) {\n writer.write(\" = \");\n this.initializer.write(writer);\n }\n }\n}\n","import { python } from \".\";\nimport { CodeBlock } from \"./CodeBlock\";\nimport { AstNode } from \"./core/AstNode\";\nimport { Writer } from \"./core/Writer\";\nimport { Decorator } from \"./Decorator\";\nimport { Parameter } from \"./Parameter\";\nimport { Type } from \"./Type\";\n\nexport enum ClassMethodType {\n STATIC,\n INSTANCE,\n CLASS\n}\n\nexport declare namespace Method {\n interface Args {\n /* The name of the method */\n name: string;\n /* The parameters of the method */\n parameters?: Parameter[];\n /* The return type of the method */\n return_?: Type;\n /* The docstring for the method */\n docstring?: string;\n /* The type of the method if defined within the context of a class */\n type?: ClassMethodType;\n /* Whether the method is a static method */\n static_?: boolean;\n /* The decorators that should be applied to this method */\n decorators?: Decorator[];\n }\n}\n\nexport class Method extends AstNode {\n public readonly name: string;\n public readonly return: Type | undefined;\n public readonly docstring: string | undefined;\n public readonly type: ClassMethodType | undefined;\n private readonly parameters: Parameter[];\n private readonly decorators: Decorator[];\n private readonly statements: AstNode[] = [];\n private readonly static_: boolean;\n\n constructor({ static_, name, parameters, return_, docstring, type, decorators }: Method.Args) {\n super();\n this.name = name;\n this.parameters = parameters ?? [];\n this.return = return_;\n this.docstring = docstring;\n this.type = type;\n this.decorators = decorators ?? [];\n this.static_ = static_ ?? false;\n\n this.parameters.forEach((parameter) => {\n this.inheritReferences(parameter);\n });\n\n this.inheritReferences(this.return);\n\n this.decorators.forEach((decorator) => {\n this.inheritReferences(decorator);\n });\n\n this.statements.forEach((statements) => {\n this.inheritReferences(statements);\n });\n }\n\n public addStatement(statement: AstNode): void {\n this.statements.push(statement);\n this.inheritReferences(statement);\n }\n\n public write(writer: Writer): void {\n if (this.static_) {\n this.decorators.push(\n python.decorator({\n callable: python.codeBlock(\"staticmethod\")\n })\n );\n }\n\n // Write decorators\n this.decorators.forEach((decorator) => {\n decorator.write(writer);\n });\n\n if (this.type === ClassMethodType.CLASS) {\n python\n .decorator({\n callable: new CodeBlock(\"classmethod\")\n })\n .write(writer);\n } else if (this.type === ClassMethodType.STATIC) {\n python\n .decorator({\n callable: new CodeBlock(\"staticmethod\")\n })\n .write(writer);\n }\n\n // Write method signature\n writer.write(`def ${this.name}(`);\n\n const totalParams = this.parameters.length;\n const useMultiline = totalParams > 3;\n\n if (useMultiline) {\n writer.newLine();\n writer.indent();\n }\n\n if (this.type === ClassMethodType.INSTANCE) {\n writer.write(\"self\");\n if (this.parameters.length > 0) {\n writer.write(useMultiline ? \",\" : \", \");\n if (useMultiline) {\n writer.newLine();\n }\n }\n } else if (this.type === ClassMethodType.CLASS) {\n writer.write(\"cls\");\n if (this.parameters.length > 0) {\n writer.write(useMultiline ? \",\" : \", \");\n if (useMultiline) {\n writer.newLine();\n }\n }\n }\n this.parameters.forEach((param, index) => {\n param.write(writer);\n if (index < this.parameters.length - 1) {\n writer.write(useMultiline ? \",\" : \", \");\n if (useMultiline) {\n writer.newLine();\n }\n }\n });\n\n if (useMultiline) {\n writer.write(\",\");\n writer.dedent();\n writer.newLine();\n }\n\n writer.write(\")\");\n\n // Write return type if specified\n if (this.return) {\n writer.write(\" -> \");\n this.return.write(writer);\n }\n\n writer.write(\":\");\n writer.newLine();\n\n // Write docstring if specified\n if (this.docstring) {\n writer.indent();\n writer.write('\"\"\"');\n writer.write(this.docstring);\n writer.write('\"\"\"');\n writer.newLine();\n writer.dedent();\n }\n\n // Write method body\n if (this.statements.length) {\n writer.indent();\n this.statements.forEach((statement, index) => {\n statement.write(writer);\n if (index < this.statements.length - 1) {\n writer.newLine();\n }\n });\n writer.dedent();\n } else {\n writer.indent();\n writer.write(\"pass\");\n writer.dedent();\n }\n writer.newLine();\n }\n}\n","import { AstNode } from \"./core/AstNode\";\nimport { Writer } from \"./core/Writer\";\n\nexport declare namespace MethodArgument {\n interface Args {\n /* If a kwarg, then the name of the parameter that this is a keyword argument for */\n name?: string;\n /* The value of the argument */\n value: AstNode;\n }\n}\n\nexport class MethodArgument extends AstNode {\n public readonly name: string | undefined;\n public readonly value: AstNode;\n\n constructor({ name, value }: MethodArgument.Args) {\n super();\n this.name = name;\n this.value = value;\n\n this.inheritReferences(this.value);\n }\n\n public write(writer: Writer): void {\n if (this.name !== undefined) {\n writer.write(this.name);\n writer.write(\"=\");\n }\n this.value.write(writer);\n }\n}\n","import { AstNode } from \"./core/AstNode\";\nimport { Writer } from \"./core/Writer\";\nimport { MethodArgument } from \"./MethodArgument\";\nimport { Reference } from \"./Reference\";\n\nexport declare namespace MethodInvocation {\n interface Args {\n /* The reference to the class instance the method is defined on */\n on: Reference;\n /* The method to invoke */\n method: string;\n /* The arguments to pass to the method */\n arguments_: MethodArgument[];\n /* Whether to write the method invocation on a new line */\n multiline?: boolean;\n }\n}\n\nexport class MethodInvocation extends AstNode {\n protected on: Reference;\n private method: string;\n private arguments: MethodArgument[];\n private multiline: boolean;\n\n constructor({ on, method, arguments_, multiline }: MethodInvocation.Args) {\n super();\n\n this.on = on;\n this.method = method;\n this.arguments = arguments_;\n this.multiline = multiline ?? false;\n\n this.inheritReferences(on);\n this.arguments.forEach((arg) => {\n this.inheritReferences(arg);\n });\n }\n\n public write(writer: Writer): void {\n this.on.write(writer);\n writer.write(\".\");\n writer.write(this.method);\n\n if (this.arguments.length === 0) {\n writer.write(\"()\");\n return;\n }\n\n writer.write(\"(\");\n if (this.multiline) {\n writer.newLine();\n writer.indent();\n }\n this.arguments.forEach((arg, idx) => {\n arg.write(writer);\n if (idx < this.arguments.length - 1) {\n writer.write(\",\");\n if (this.multiline) {\n writer.newLine();\n } else {\n writer.write(\" \");\n }\n }\n });\n if (this.multiline) {\n writer.newLine();\n writer.dedent();\n }\n writer.write(\")\");\n }\n}\n","import { assertNever } from \"@fern-api/core-utils\";\nimport { AstNode } from \"./core/AstNode\";\nimport { Writer } from \"./core/Writer\";\nimport { OperatorType } from \"./OperatorType\";\n\nexport declare namespace Operator {\n interface Args {\n operator: OperatorType;\n lhs: AstNode;\n rhs: AstNode;\n }\n}\n\nexport class Operator extends AstNode {\n private readonly operator: OperatorType;\n private readonly lhs: AstNode;\n private readonly rhs: AstNode;\n\n public constructor({ operator, lhs, rhs }: Operator.Args) {\n super();\n this.operator = operator;\n this.lhs = lhs;\n this.inheritReferences(lhs);\n this.rhs = rhs;\n this.inheritReferences(rhs);\n }\n\n private getOperatorString(): string {\n switch (this.operator) {\n case OperatorType.Or:\n return \"or\";\n case OperatorType.And:\n return \"and\";\n case OperatorType.Add:\n return \"+\";\n case OperatorType.Subtract:\n return \"-\";\n case OperatorType.Multiply:\n return \"*\";\n case OperatorType.Divide:\n return \"/\";\n case OperatorType.Modulo:\n return \"%\";\n case OperatorType.LeftShift:\n return \"<<\";\n case OperatorType.RightShift:\n return \">>\";\n default:\n assertNever(this.operator);\n }\n }\n\n public write(writer: Writer): void {\n this.lhs.write(writer);\n writer.write(\" \");\n writer.write(this.getOperatorString());\n writer.write(\" \");\n this.rhs.write(writer);\n }\n}\n","export type OperatorType =\n | \"or\"\n | \"and\"\n | \"add\"\n | \"subtract\"\n | \"multiple\"\n | \"divide\"\n | \"modulo\"\n | \"leftShift\"\n | \"rightShift\";\n\nexport const OperatorType = {\n Or: \"or\",\n And: \"and\",\n Add: \"add\",\n Subtract: \"subtract\",\n Multiply: \"multiple\",\n Divide: \"divide\",\n Modulo: \"modulo\",\n LeftShift: \"leftShift\",\n RightShift: \"rightShift\"\n} as const;\n","import { Class } from \"./Class\";\nimport { Comment } from \"./Comment\";\nimport { AstNode } from \"./core/AstNode\";\nimport { ImportedName, ModulePath } from \"./core/types\";\nimport { createPythonClassName } from \"./core/utils\";\nimport { Writer } from \"./core/Writer\";\nimport { Field } from \"./Field\";\nimport { Method } from \"./Method\";\nimport { Reference } from \"./Reference\";\nimport { StarImport } from \"./StarImport\";\n\ninterface UniqueReferenceValue {\n modulePath: ModulePath;\n references: Reference[];\n referenceNames: Set<string>;\n}\n\nexport declare namespace PythonFile {\n interface Args {\n /* The path of the Python file relative to the module */\n path: ModulePath;\n /* The list of statements in the Python file. More can be added following initialization. */\n statements?: AstNode[];\n /* Whether or not this represents the root of a Python module */\n isInitFile?: boolean;\n /* Any comments that should be at the top of the file */\n comments?: Comment[];\n /* Any explicit imports that should be included */\n imports?: StarImport[];\n }\n}\n\nexport class PythonFile extends AstNode {\n public readonly path: ModulePath;\n public readonly isInitFile: boolean;\n private readonly statements: AstNode[] = [];\n private readonly comments: Comment[];\n\n constructor({ path, statements, isInitFile = false, comments, imports }: PythonFile.Args) {\n super();\n this.path = path;\n this.isInitFile = isInitFile;\n\n statements?.forEach((statement) => this.addStatement(statement));\n\n this.comments = comments ?? [];\n\n imports?.forEach((import_) => this.addReference(import_));\n }\n\n public addStatement(statement: AstNode): void {\n this.statements.push(statement);\n this.inheritReferences(statement);\n }\n\n public write(writer: Writer): void {\n const uniqueReferences = this.deduplicateReferences();\n\n this.updateWriterRefNameOverrides({ writer, uniqueReferences });\n\n this.writeComments(writer);\n this.writeImports({ writer, uniqueReferences });\n this.statements.forEach((statement, idx) => {\n statement.write(writer);\n writer.newLine();\n if (idx < this.statements.length - 1) {\n writer.newLine();\n }\n });\n\n writer.unsetRefNameOverrides();\n }\n\n /*******************************\n * Helper Methods\n *******************************/\n\n private updateWriterRefNameOverrides({\n writer,\n uniqueReferences\n }: {\n writer: Writer;\n uniqueReferences: Map<string, UniqueReferenceValue>;\n }): void {\n // Clone the map so that we can mutate its copy.\n const referencesToHandle = new Map(uniqueReferences);\n\n // Build up a map of refs to their name overrides, keeping track of names that have been used as we go.\n const completeRefPathsToNameOverrides: Record<string, ImportedName> = {};\n const usedNames = this.getInitialUsedNames();\n\n // First, reserve the names of any references that are defined in the file itself and that don't need importing.\n const filePath = this.path.join(\".\");\n const fileReferences = uniqueReferences.get(filePath);\n if (fileReferences) {\n const { references } = fileReferences;\n\n references.forEach((reference) => {\n const fullyQualifiedModulePath = reference.getFullyQualifiedModulePath();\n const name = reference.name;\n\n completeRefPathsToNameOverrides[fullyQualifiedModulePath] = {\n name,\n isAlias: false\n };\n usedNames.add(reference.name);\n });\n\n referencesToHandle.delete(filePath);\n }\n\n // Continue on to resolving names for references that must be imported\n const importedReferences: Reference[] = Array.from(referencesToHandle.values()).flatMap(\n ({ references }) => references\n );\n importedReferences.forEach((reference) => {\n // Skip star imports since we should never override their import alias\n if (reference instanceof StarImport) {\n return;\n }\n\n const name = reference.alias ?? reference.name;\n const fullyQualifiedModulePath = reference.getFullyQualifiedModulePath();\n\n let nameOverride = name;\n let modulePathIdx = reference.modulePath.length - 1;\n let isAlias = !!reference.alias;\n\n while (usedNames.has(nameOverride)) {\n isAlias = true;\n\n const module = reference.modulePath[modulePathIdx];\n if (modulePathIdx < 0 || !module) {\n nameOverride = `_${nameOverride}`;\n } else {\n nameOverride = `${createPythonClassName(module)}${nameOverride}`;\n }\n\n modulePathIdx--;\n }\n usedNames.add(nameOverride);\n\n completeRefPathsToNameOverrides[fullyQualifiedModulePath] = {\n name: nameOverride,\n isAlias\n };\n });\n\n writer.setRefNameOverrides(completeRefPathsToNameOverrides);\n }\n\n private getInitialUsedNames(): Set<string> {\n const usedNames = new Set<string>();\n\n this.statements.forEach((statement) => {\n if (statement instanceof Class) {\n usedNames.add(statement.name);\n } else if (statement instanceof Method) {\n usedNames.add(statement.name);\n } else if (statement instanceof Field) {\n usedNames.add(statement.name);\n }\n });\n\n return usedNames;\n }\n\n private deduplicateReferences() {\n // Deduplicate references by their fully qualified paths\n const uniqueReferences = new Map<string, UniqueReferenceValue>();\n for (const reference of this.references) {\n const referenceName = reference.name;\n const fullyQualifiedPath = reference.getFullyQualifiedPath();\n\n // Skip references that don't have a path. It's inferred that they don't need to be imported.\n if (fullyQualifiedPath === \"\") {\n continue;\n }\n\n const existingRefs = uniqueReferences.get(fullyQualifiedPath);\n\n if (existingRefs) {\n if (!existingRefs.referenceNames.has(referenceName)) {\n existingRefs.references.push(reference);\n existingRefs.referenceNames.add(referenceName);\n }\n } else {\n uniqueReferences.set(fullyQualifiedPath, {\n modulePath: reference.modulePath,\n references: [reference],\n referenceNames: new Set([referenceName])\n });\n }\n }\n\n return uniqueReferences;\n }\n\n private writeComments(writer: Writer): void {\n this.comments.forEach((comment) => {\n comment.write(writer);\n });\n\n if (this.comments.length > 0) {\n writer.newLine();\n }\n }\n\n private getImportName({ writer, reference }: { writer: Writer; reference: Reference }): string {\n const nameOverride = writer.getRefNameOverride(reference);\n\n const name = reference.name;\n const alias = nameOverride.isAlias ? nameOverride.name : undefined;\n\n return `${name}${alias ? ` as ${alias}` : \"\"}`;\n }\n\n private writeImports({\n writer,\n uniqueReferences\n }: {\n writer: Writer;\n uniqueReferences: Map<string, { modulePath: ModulePath; references: Reference[] }>;\n }): void {\n if (uniqueReferences.size === 0) {\n return;\n }\n for (const [fullyQualifiedPath, { modulePath, references }] of uniqueReferences) {\n const refModulePath = modulePath;\n\n // Check to see if the reference is defined in this same file and if so, skip its import\n if (this.isDefinedInFile(refModulePath)) {\n continue;\n }\n\n if (refModulePath[0] === this.path[0]) {\n // Relativize the import\n // Calculate the common prefix length\n let commonPrefixLength = 0;\n while (\n commonPrefixLength < this.path.length &&\n commonPrefixLength < refModulePath.length &&\n this.path[commonPrefixLength] === refModulePath[commonPrefixLength]\n ) {\n commonPrefixLength++;\n }\n\n // Calculate the number of levels to go up\n let levelsUp = this.path.length - commonPrefixLength;\n\n // If this is an __init__.py file, then we must go one more level up.\n if (this.isInitFile) {\n levelsUp++;\n }\n\n // Build the relative import path\n let relativePath = levelsUp > 0 ? \".\".repeat(levelsUp) : \".\";\n relativePath += refModulePath.slice(commonPrefixLength).join(\".\");\n\n // Write the relative import statement\n writer.write(\n `from ${relativePath} import ${references\n .map((reference) => this.getImportName({ writer, reference }))\n .join(\", \")}`\n );\n } else {\n // Use fully qualified path\n writer.write(\n `from ${fullyQualifiedPath} import ${references\n .map((reference) => this.getImportName({ writer, reference }))\n .join(\", \")}`\n );\n }\n writer.newLine();\n }\n writer.newLine();\n }\n\n private isDefinedInFile(modulePath: readonly string[]): boolean {\n return modulePath.length === this.path.length && modulePath.every((part, idx) => part === this.path[idx]);\n }\n}\n","export function createPythonClassName(input: string): string {\n // Handle empty input\n if (!input) {\n return \"Class\";\n }\n\n // Clean up the input string\n let cleanedInput = input\n .replace(/[^a-zA-Z0-9\\s_-]/g, \" \") // Replace special characters with spaces\n .replace(/[-_\\s]+/g, \" \") // Replace hyphens, underscores and multiple spaces with single space\n .trim(); // Remove leading/trailing spaces\n\n // Handle numeric-only or empty string after cleanup\n if (!cleanedInput || /^\\d+$/.test(cleanedInput)) {\n return \"Class\" + (cleanedInput || \"\");\n }\n\n // Handle strings starting with numbers\n if (/^\\d/.test(cleanedInput)) {\n cleanedInput = \"Class\" + cleanedInput;\n }\n\n // Split into words and handle special cases\n const words = cleanedInput\n .split(/(?=[A-Z])|[-_\\s]+/)\n .filter((word) => word.length > 0)\n .map((word) => {\n // Fix any garbled text by splitting on number boundaries\n return word.split(/(?<=\\d)(?=[a-zA-Z])|(?<=[a-zA-Z])(?=\\d)/).filter((w) => w.length > 0);\n })\n .flat();\n\n // Process each word\n return words\n .map((word, index) => {\n // If it's the first word and starts with a number, prepend \"Class\"\n if (index === 0 && /^\\d/.test(word)) {\n return \"Class\" + word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();\n }\n // Preserve words that are all uppercase and longer than one character\n if (word.length > 1 && word === word.toUpperCase() && !/^\\d+$/.test(word)) {\n return word;\n }\n // Capitalize first letter, lowercase rest\n return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();\n })\n .join(\"\");\n}\n","import { Writer } from \"./core/Writer\";\nimport { Reference } from \"./Reference\";\n\nexport declare namespace StarImport {\n interface Args extends Pick<Reference.Args, \"modulePath\"> {}\n}\n\nexport class StarImport extends Reference {\n public readonly docs: string | undefined;\n\n public constructor({ modulePath }: StarImport.Args) {\n super({ name: \"*\", modulePath });\n }\n\n public write(writer: Writer): void {\n throw new Error(\"Not intended to be written outside the context of a PythonFile.\");\n }\n}\n","import { AstNode } from \"./core/AstNode\";\nimport { AttrPath, ModulePath } from \"./core/types\";\nimport { Writer } from \"./core/Writer\";\n\nexport declare namespace Reference {\n interface Args {\n /* The name of the reference */\n name: string;\n /* The module path of the reference\n For example:\n - \"foo.bar\" -> [\"foo\", \"bar\"]\n - \"foo.bar.baz\" -> [\"foo\", \"bar\", \"baz\"]\n */\n modulePath?: ModulePath;\n /* The generic types of the reference */\n genericTypes?: AstNode[];\n /* The alias of the reference */\n alias?: string;\n /* The path to the attribute of the reference */\n attribute?: AttrPath;\n }\n}\n\nexport class Reference extends AstNode {\n public readonly name: string;\n public readonly modulePath: ModulePath;\n public readonly genericTypes: AstNode[];\n public readonly alias: string | undefined;\n public readonly attribute: AttrPath;\n\n constructor({ name, modulePath, genericTypes, alias, attribute }: Reference.Args) {\n super();\n this.name = name;\n this.modulePath = modulePath ?? [];\n this.genericTypes = genericTypes ?? [];\n this.alias = alias;\n this.attribute = attribute ?? [];\n this.references.push(this);\n\n this.genericTypes.forEach((genericType) => {\n this.inheritReferences(genericType);\n });\n }\n\n public write(writer: Writer): void {\n const nameOverride = writer.getRefNameOverride(this);\n writer.write(nameOverride.name);\n\n if (this.genericTypes.length > 0) {\n writer.write(\"[\");\n this.genericTypes.forEach((genericType, index) => {\n if (index > 0) {\n writer.write(\", \");\n }\n genericType.write(writer);\n });\n writer.write(\"]\");\n }\n\n if (this.attribute.length > 0) {\n writer.write(\".\");\n this.attribute.forEach((attr, index) => {\n if (index > 0) {\n writer.write(\".\");\n }\n writer.write(attr);\n });\n }\n }\n\n public getFullyQualifiedPath(): string {\n return this.modulePath.join(\".\");\n }\n\n public getFullyQualifiedModulePath(): string {\n return `${this.getFullyQualifiedPath()}.${this.name}`;\n }\n}\n","import { assertNever } from \"@fern-api/core-utils\";\n\nimport { python } from \".\";\nimport { AstNode } from \"./core/AstNode\";\nimport { Writer } from \"./core/Writer\";\nimport { Reference } from \"./Reference\";\n\ntype InternalType =\n | Int\n | Float\n | Bool\n | Str\n | Bytes\n | List\n | Set\n | Tuple\n | Dict\n | None\n | Uuid\n | Optional\n | Union\n | Any\n | ReferenceType\n | Datetime\n | Literal;\n\ninterface Int {\n type: \"int\";\n}\n\ninterface Float {\n type: \"float\";\n}\n\ninterface Bool {\n type: \"bool\";\n}\n\ninterface Str {\n type: \"str\";\n}\n\ninterface Bytes {\n type: \"bytes\";\n}\n\ninterface List {\n type: \"list\";\n value: Type;\n}\n\ninterface Set {\n type: \"set\";\n value: Type;\n}\n\ninterface Tuple {\n type: \"tuple\";\n values: Type[];\n}\n\ninterface Dict {\n type: \"dict\";\n keyType: Type;\n valueType: Type;\n}\n\ninterface None {\n type: \"none\";\n}\n\ninterface Uuid {\n type: \"uuid\";\n}\n\ninterface Optional {\n type: \"optional\";\n value: Type;\n}\n\ninterface Union {\n type: \"union\";\n values: Type[];\n}\n\ninterface Datetime {\n type: \"datetime\";\n}\n\ninterface Any {\n type: \"any\";\n}\n\ninterface ReferenceType {\n type: \"reference\";\n value: Reference;\n}\n\ninterface Literal {\n type: \"literal\";\n value: string | number | boolean;\n}\n\nexport class Type extends AstNode {\n private internalType: InternalType;\n\n private constructor(internalType: InternalType) {\n super();\n this.internalType = internalType;\n }\n\n public write(writer: Writer): void {\n switch (this.internalType.type) {\n case \"int\":\n writer.write(\"int\");\n break;\n case \"float\":\n writer.write(\"float\");\n break;\n case \"bool\":\n writer.write(\"bool\");\n break;\n case \"str\":\n writer.write(\"str\");\n break;\n case \"bytes\":\n writer.write(\"bytes\");\n break;\n case \"list\":\n writer.write(\"List[\");\n this.internalType.value.write(writer);\n writer.write(\"]\");\n break;\n case \"set\":\n writer.write(\"Set[\");\n this.internalType.value.write(writer);\n writer.write(\"]\");\n break;\n case \"tuple\":\n writer.write(\"Tuple[\");\n this.internalType.values.forEach((value, index) => {\n if (index > 0) {\n writer.write(\", \");\n }\n value.write(writer);\n });\n writer.write(\"]\");\n break;\n case \"dict\":\n writer.write(\"Dict[\");\n this.internalType.keyType.write(writer);\n writer.write(\", \");\n this.internalType.valueType.write(writer);\n writer.write(\"]\");\n break;\n case \"none\":\n writer.write(\"None\");\n break;\n case \"uuid\":\n writer.write(\"UUID\");\n break;\n case \"optional\":\n writer.write(\"Optional[\");\n this.internalType.value.write(writer);\n writer.write(\"]\");\n break;\n case \"union\":\n writer.write(\"Union[\");\n this.internalType.values.forEach((value, index) => {\n if (index > 0) {\n writer.write(\", \");\n }\n value.write(writer);\n });\n writer.write(\"]\");\n break;\n case \"any\":\n writer.write(\"Any\");\n break;\n case \"reference\":\n this.internalType.value.write(writer);\n break;\n case \"datetime\":\n writer.write(\"datetime\");\n break;\n case \"literal\":\n if (typeof this.internalType.value === \"string\") {\n writer.write(`Literal[\"${this.internalType.value}\"]`);\n } else {\n writer.write(`Literal[${this.internalType.value}]`);\n }\n break;\n default:\n assertNever(this.internalType);\n }\n }\n\n public static int(): Type {\n return new this({ type: \"int\" });\n }\n\n public static float(): Type {\n return new this({ type: \"float\" });\n }\n\n public static bool(): Type {\n return new this({ type: \"bool\" });\n }\n\n public static str(): Type {\n return new this({ type: \"str\" });\n }\n\n public static bytes(): Type {\n return new this({ type: \"bytes\" });\n }\n\n public static list(value: Type): Type {\n const listType = new this({ type: \"list\", value });\n listType.addReference(python.reference({ name: \"List\", modulePath: [\"typing\"] }));\n listType.inheritReferences(value);\n return listType;\n }\n\n public static set(value: Type): Type {\n const setType = new this({ type: \"set\", value });\n setType.addReference(python.reference({ name: \"Set\", modulePath: [\"typing\"] }));\n setType.inheritReferences(value);\n return setType;\n }\n\n public static tuple(values: Type[]): Type {\n const tupleType = new this({ type: \"tuple\", values });\n tupleType.addReference(python.reference({ name: \"Tuple\", modulePath: [\"typing\"] }));\n values.forEach((value) => tupleType.inheritReferences(value));\n return tupleType;\n }\n\n public static dict(keyType: Type, valueType: Type): Type {\n const dictType = new this({ type: \"dict\", keyType, valueType });\n dictType.addReference(python.reference({ name: \"Dict\", modulePath: [\"typing\"] }));\n dictType.inheritReferences(keyType);\n dictType.inheritReferences(valueType);\n return dictType;\n }\n\n public static none(): Type {\n return new this({ type: \"none\" });\n }\n\n public static uuid(): Type {\n const uuidType = new this({ type: \"uuid\" });\n uuidType.addReference(python.reference({ name: \"UUID\", modulePath: [\"uuid\"] }));\n return uuidType;\n }\n\n public static optional(value: Type): Type {\n // Avoids double optional.\n if (this.isAlreadyOptional(value)) {\n return value;\n }\n const optionalType = new this({ type: \"optional\", value });\n optionalType.addReference(python.reference({ name: \"Optional\", modulePath: [\"typing\"] }));\n optionalType.inheritReferences(value);\n return optionalType;\n }\n\n public static union(values: Type[]): Type {\n const unionType = new this({ type: \"union\", values });\n unionType.addReference(python.reference({ name: \"Union\", modulePath: [\"typing\"] }));\n values.forEach((value) => unionType.inheritReferences(value));\n return unionType;\n }\n\n public static any(): Type {\n const anyType = new this({ type: \"any\" });\n anyType.addReference(python.reference({ name: \"Any\", modulePath: [\"typing\"] }));\n return anyType;\n }\n\n public static datetime(): Type {\n const datetimeType = new this({ type: \"datetime\" });\n datetimeType.addReference(python.reference({ name: \"datetime\", modulePath: [\"datetime\"] }));\n return datetimeType;\n }\n\n public static reference(value: Reference): Type {\n const referenceType = new this({ type: \"reference\", value });\n referenceType.addReference(value);\n return referenceType;\n }\n\n public static literal(value: string | boolean | number): Type {\n const literalType = new this({ type: \"literal\", value });\n literalType.addReference(python.reference({ name: \"Literal\", modulePath: [\"typing\"] }));\n return literalType;\n }\n\n private static isAlreadyOptional(value: Type): boolean {\n return value.internalType.type === \"optional\";\n }\n}\n","import { assertNever } from \"@fern-api/core-utils\";\nimport { AstNode } from \"./core/AstNode\";\nimport { Writer } from \"./core/Writer\";\nimport { Reference } from \"./Reference\";\nimport { Type } from \"./Type\";\n\nexport interface NamedValue {\n name: string;\n value: AstNode;\n}\n\ntype InternalTypeInstantiation =\n | Int\n | Float\n | Bool\n | Str\n | Date\n | DateTime\n | Bytes\n | List\n | Set\n | Tuple\n | Dict\n | TypedDict\n | Reference_\n | None\n | Unknown\n | Uuid\n | Nop;\n\ninterface IterableConfig {\n endWithComma?: boolean;\n multiline?: boolean;\n}\n\ninterface StrConfig {\n multiline?: boolean;\n startOnNewLine?: boolean;\n endWithNewLine?: boolean;\n}\n\ninterface Int {\n type: \"int\";\n value: number;\n}\n\ninterface Float {\n type: \"float\";\n value: number;\n}\n\ninterface Bool {\n type: \"bool\";\n value: boolean;\n}\n\ninterface Str {\n type: \"str\";\n value: string;\n config?: StrConfig;\n}\n\ninterface Date {\n type: \"date\";\n value: string;\n}\n\ninterface DateTime {\n type: \"datetime\";\n value: string;\n}\n\ninterface Bytes {\n type: \"bytes\";\n value: string;\n}\n\ninterface TypedDict {\n type: \"typedDict\";\n entries: NamedValue[];\n config?: IterableConfig;\n}\n\ninterface List {\n type: \"list\";\n values: AstNode[];\n config?: IterableConfig;\n}\n\ninterface Set {\n type: \"set\";\n values: AstNode[];\n config?: IterableConfig;\n}\n\ninterface Tuple {\n type: \"tuple\";\n values: AstNode[];\n config?: IterableConfig;\n}\n\ninterface Dict {\n type: \"dict\";\n entries: DictEntry[];\n config?: IterableConfig;\n}\n\ninterface DictEntry {\n key: AstNode;\n value: AstNode;\n}\n\ninterface Reference_ {\n type: \"reference\";\n value: AstNode;\n}\n\ninterface None {\n type: \"none\";\n}\n\ninterface Unknown {\n type: \"unknown\";\n value: unknown;\n}\n\ninterface Uuid {\n type: \"uuid\";\n value: string;\n}\n\ninterface Nop {\n type: \"nop\";\n}\n\nexport class TypeInstantiation extends AstNode {\n private constructor(private readonly internalType: InternalTypeInstantiation) {\n super();\n }\n\n public static int(value: number): TypeInstantiation {\n return new this({ type: \"int\", value });\n }\n\n public static float(value: number): TypeInstantiation {\n return new this({ type: \"float\", value });\n }\n\n public static bool(value: boolean): TypeInstantiation {\n return new this({ type: \"bool\", value });\n }\n\n public static str(\n value: string,\n config: StrConfig = {\n multiline: false,\n startOnNewLine: false,\n endWithNewLine: false\n }\n ): TypeInstantiation {\n return new this({ type: \"str\", value, config });\n }\n\n public static bytes(value: string): TypeInstantiation {\n return new this({ type: \"bytes\", value });\n }\n\n public static list(values: AstNode[], config: IterableConfig = { endWithComma: false }): TypeInstantiation {\n const list = new this({ type: \"list\", values, config });\n values.forEach((value) => list.inheritReferences(value));\n return list;\n }\n\n public static set(values: AstNode[], config: IterableConfig = { endWithComma: false }): TypeInstantiation {\n const set = new this({ type: \"set\", values, config });\n values.forEach((value) => set.inheritReferences(value));\n return set;\n }\n\n public static tuple(values: AstNode[], config: IterableConfig = { endWithComma: false }): TypeInstantiation {\n const tuple = new this({ type: \"tuple\", values, config });\n values.forEach((value) => tuple.inheritReferences(value));\n return tuple;\n }\n\n public static typedDict(\n entries: NamedValue[],\n config: IterableConfig = { endWithComma: false }\n ): TypeInstantiation {\n const typedDict = new this({ type: \"typedDict\", entries, config });\n entries.forEach((entry) => typedDict.inheritReferences(entry.value));\n return typedDict;\n }\n\n public static date(value: string): TypeInstantiation {\n const date = new this({ type: \"date\", value });\n date.addReference(new Reference({ name: \"date\", modulePath: [\"datetime\"] }));\n return date;\n }\n\n public static datetime(value: string): TypeInstantiation {\n const datetime = new this({ type: \"datetime\", value });\n datetime.addReference(new Reference({ name: \"datetime\", modulePath: [\"datetime\"] }));\n return datetime;\n }\n\n public static dict(entries: DictEntry[], config: IterableConfig = { endWithComma: false }): TypeInstantiation {\n const dict = new this({ type: \"dict\", entries, config });\n entries.forEach((entry) => {\n dict.inheritReferences(entry.key);\n dict.inheritReferences(entry.value);\n });\n return dict;\n }\n\n public static reference(value: AstNode): TypeInstantiation {\n const ref = new this({ type: \"reference\", value });\n ref.inheritReferences(value);\n return ref;\n }\n\n public static none(): TypeInstantiation {\n return new this({ type: \"none\" });\n }\n\n public static unknown(value: unknown): TypeInstantiation {\n return new this({ type: \"unknown\", value });\n }\n\n public static uuid(value: string): TypeInstantiation {\n const uuid = new this({ type: \"uuid\", value });\n uuid.addReference(new Reference({ name: \"UUID\", modulePath: [\"uuid\"] }));\n return uuid;\n }\n\n public static nop(): TypeInstantiation {\n return new this({ type: \"nop\" });\n }\n\n public static isNop(typeInstantiation: AstNode): boolean {\n return typeInstantiation instanceof TypeInstantiation && typeInstantiation.internalType.type === \"nop\";\n }\n\n public isTypedDict(): this is TypedDict {\n return (this.internalType as TypedDict).type === \"typedDict\";\n }\n\n public asTypedDictOrThrow(): TypedDict {\n if (this.isTypedDict()) {\n return this.internalType as TypedDict;\n }\n throw new Error(\"Internal error; python.TypeInstantiation is not a TypedDict\");\n }\n\n public write(writer: Writer): void {\n switch (this.internalType.type) {\n case \"int\":\n writer.write(this.internalType.value.toString());\n break;\n case \"float\":\n writer.write(this.internalType.value.toString());\n break;\n case \"bool\":\n if (this.internalType.value) {\n writer.write(\"True\");\n } else {\n writer.write(\"False\");\n }\n break;\n case \"str\":\n if (this.internalType.config?.multiline) {\n const { startOnNewLine, endWithNewLine } = this.internalType.config;\n this.writeStringWithTripleQuotes({\n writer,\n value: this.internalType.value,\n startOnNewLine,\n endWithNewLine\n });\n } else {\n writer.write(`\"${this.escapeString(this.internalType.value)}\"`);\n }\n break;\n case \"date\":\n writer.write(`date.fromisoformat(\"${this.internalType.value}\")`);\n break;\n case \"datetime\":\n writer.write(`datetime.fromisoformat(\"${this.internalType.value}\")`);\n break;\n case \"bytes\":\n writer.write(`b\"${this.internalType.value}\"`);\n break;\n case \"list\": {\n const internalType = this.internalType;\n const values = filterNopValues({ values: internalType.values });\n if (values.length === 0) {\n writer.write(\"[]\");\n break;\n }\n writer.write(\"[\");\n if (internalType.config?.multiline) {\n writer.newLine();\n writer.indent();\n }\n values.forEach((value, index) => {\n if (index > 0) {\n writer.write(\",\");\n if (internalType.config?.multiline) {\n writer.newLine();\n } else {\n writer.write(\" \");\n }\n }\n value.write(writer);\n if (index === values.length - 1 && internalType.config?.endWithComma) {\n writer.write(\",\");\n }\n });\n if (internalType.config?.multiline) {\n writer.newLine();\n writer.dedent();\n }\n writer.write(\"]\");\n break;\n }\n case \"set\": {\n const internalType = this.internalType;\n const values = filterNopValues({ values: internalType.values });\n if (values.length === 0) {\n writer.write(\"{}\");\n break;\n }\n writer.write(\"{\");\n if (internalType.config?.multiline) {\n writer.newLine();\n writer.indent();\n }\n values.forEach((value, index) => {\n if (index > 0) {\n writer.write(\",\");\n if (internalType.config?.multiline) {\n writer.newLine();\n } else {\n writer.write(\" \");\n }\n }\n value.write(writer);\n if (index === values.length - 1 && internalType.config?.endWithComma) {\n writer.write(\",\");\n }\n });\n if (internalType.config?.multiline) {\n writer.newLine();\n writer.dedent();\n }\n writer.write(\"}\");\n break;\n }\n case \"tuple\": {\n const internalType = this.internalType;\n const values = filterNopValues({ values: internalType.values });\n if (values.length === 0) {\n writer.write(\"()\");\n break;\n }\n writer.write(\"(\");\n if (internalType.config?.multiline) {\n writer.newLine();\n writer.indent();\n }\n values.forEach((value, index) => {\n if (index > 0) {\n writer.write(\",\");\n if (internalType.config?.multiline) {\n writer.newLine();\n } else {\n writer.write(\" \");\n }\n }\n value.write(writer);\n if (\n // If the tuple is of length 1, then we must always add a trailing comma\n values.length === 1 ||\n // Otherwise, check the config that was specified\n (index === values.length - 1 && internalType.config?.endWithComma)\n ) {\n writer.write(\",\");\n }\n });\n if (internalType.config?.multiline) {\n writer.newLine();\n writer.dedent();\n }\n writer.write(\")\");\n break;\n }\n case \"dict\": {\n const internalType = this.internalType;\n const entries = filterNopDictEntries({ entries: internalType.entries });\n if (entries.length === 0) {\n writer.write(\"{}\");\n break;\n }\n writer.write(\"{\");\n if (internalType.config?.multiline) {\n writer.newLine();\n writer.indent();\n }\n entries.forEach((entry, index) => {\n if (index > 0) {\n writer.write(\",\");\n if (internalType.config?.multiline) {\n writer.newLine();\n } else {\n writer.write(\" \");\n }\n }\n entry.key.write(writer);\n writer.write(\": \");\n entry.value.write(writer);\n if (index === entries.length - 1 && internalType.config?.endWithComma) {\n writer.write(\",\");\n }\n });\n if (internalType.config?.multiline) {\n writer.newLine();\n writer.dedent();\n }\n writer.write(\"}\");\n break;\n }\n case \"typedDict\": {\n const internalType = this.internalType;\n const entries = filterNopNamedValues({ entries: internalType.entries });\n if (entries.length === 0) {\n writer.write(\"{}\");\n break;\n }\n writer.write(\"{\");\n if (internalType.config?.multiline) {\n writer.writeLine();\n writer.indent();\n }\n entries.forEach((entry, index) => {\n if (index > 0) {\n writer.write(\",\");\n if (internalType.config?.multiline) {\n writer.newLine();\n } else {\n writer.write(\" \");\n }\n }\n writer.write(`\"${entry.name}\": `);\n entry.value.write(writer);\n });\n if (internalType.config?.multiline) {\n writer.newLine();\n writer.dedent();\n }\n writer.write(\"}\");\n break;\n }\n case \"reference\": {\n this.internalType.value.write(writer);\n break;\n }\n case \"none\":\n writer.write(\"None\");\n break;\n case \"unknown\":\n this.writeUnknown({ writer, value: this.internalType.value });\n break;\n case \"uuid\":\n writer.write(`UUID(\"${this.internalType.value}\")`);\n break;\n case \"nop\":\n break;\n default:\n assertNever(this.internalType);\n }\n }\n\n private writeStringWithTripleQuotes({\n writer,\n value,\n startOnNewLine,\n endWithNewLine\n }: {\n writer: Writer;\n value: string;\n } & Pick<StrConfig, \"startOnNewLine\" | \"endWithNewLine\">): void {\n writer.write('\"\"\"');\n const lines = value.split(\"\\n\");\n\n // If there is only one line, we can just write it as a single line string\n if (lines.length <= 1) {\n writer.write(this.escapeString(lines[0] ?? \"\"));\n writer.write('\"\"\"');\n return;\n }\n\n if (startOnNewLine) {\n writer.writeNoIndent(\"\\\\\\n\");\n }\n\n lines.forEach((line, idx) => {\n writer.writeNoIndent(this.escapeString(line));\n\n // If this is the last line, add a newline escape\n if (idx === lines.length - 1) {\n if (endWithNewLine) {\n writer.writeNoIndent(\"\\\\\\n\");\n }\n } else {\n writer.writeNoIndent(\"\\n\");\n }\n });\n\n writer.writeNoIndent('\"\"\"');\n }\n\n /**\n * Escapes certain special characters if they're NOT already preceded\n * by a backslash. Specifically:\n *\n * - \" -> \\\"\n * - ' -> \\'\n * - \\ -> \\\\\n * - literal \\t -> \\t\n * - literal \\n -> \\n\n * - literal \\r -> \\r\n *\n * Uses a negative lookbehind `(?<!\\\\)` to handle consecutive matches like\n * \\n\\n correctly, since each \\n is independently matched in the original string.\n *\n * @param input The input string to be escaped\n */\n private escapeString(input: string): string {\n // Negative lookbehind ensures the character is NOT preceded by a backslash\n // in the original string.\n const pattern = /(?<!\\\\)([\"'\\\\\\t\\n\\r])/g;\n\n const replacements: Record<string, string> = {\n '\"': '\\\\\"',\n \"'\": \"\\\\'\",\n \"\\\\\": \"\\\\\\\\\",\n \"\\t\": \"\\\\t\",\n \"\\n\": \"\\\\n\",\n \"\\r\": \"\\\\r\"\n };\n\n return input.replace(pattern, (char) => replacements[char] ?? char);\n }\n\n private writeUnknown({ writer, value }: { writer: Writer; value: unknown }): void {\n switch (typeof value) {\n case \"boolean\":\n writer.write(value ? \"True\" : \"False\");\n return;\n case \"string\":\n writer.write(`\"${this.escapeString(value)}\"`);\n return;\n case \"number\":\n writer.write(value.toString());\n return;\n case \"object\":\n if (value == null) {\n writer.write(\"None\");\n return;\n }\n if (Array.isArray(value)) {\n this.writeUnknownArray({ writer, value });\n return;\n }\n this.writeUnknownObject({ writer, value });\n return;\n default:\n throw new Error(`Internal error; unsupported unknown type: ${typeof value}`);\n }\n }\n\n private writeUnknownArray({\n writer,\n value\n }: {\n writer: Writer;\n // biome-ignore lint/suspicious/noExplicitAny: allow\n value: any[];\n }): void {\n if (value.length === 0) {\n writer.write(\"[]\");\n return;\n }\n writer.writeLine(\"[\");\n writer.indent();\n for (const element of value) {\n writer.writeNode(TypeInstantiation.unknown(element));\n writer.writeLine(\",\");\n }\n writer.dedent();\n writer.write(\"]\");\n }\n\n private writeUnknownObject({ writer, value }: { writer: Writer; value: object }): void {\n const entries = Object.entries(value);\n if (entries.length === 0) {\n writer.write(\"{}\");\n return;\n }\n writer.writeLine(\"{\");\n writer.indent();\n for (const [key, val] of entries) {\n writer.write(`\"${key}\": `);\n writer.writeNode(TypeInstantiation.unknown(val));\n writer.writeLine(\",\");\n }\n writer.dedent();\n writer.write(\"}\");\n }\n}\n\nfunction filterNopDictEntries({ entries }: { entries: DictEntry[] }): DictEntry[] {\n return entries.filter((entry) => !TypeInstantiation.isNop(entry.key) && !TypeInstantiation.isNop(entry.value));\n}\n\nfunction filterNopNamedValues({ entries }: { entries: NamedValue[] }): NamedValue[] {\n return entries.filter((entry) => !TypeInstantiation.isNop(entry.value));\n}\n\nfunction filterNopValues({ values }: { values: AstNode[] }): AstNode[] {\n return values.filter((value) => !TypeInstantiation.isNop(value));\n}\n\nexport { Type };\n"],"mappings":"8hCAGA,SAASA,IAAmB,CACxB,MAAM,IAAI,MAAM,iCAAiC,CACrD,CACA,SAASC,IAAsB,CAC3B,MAAM,IAAI,MAAM,mCAAmC,CACvD,CAUA,SAASC,GAAWC,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AK,CACN,KAAM,KAAK,QAAQ,gBAAgByB,EAAU,KAAK,IAAI,EACtD,MAAO,KAAK,QAAQ,yBAAyB,QAAQA,CAAS,CAClE,CAAC,EAGL,OAAOzB,CACX,CAEQ,UAAU,CAAE,SAAAzB,CAAS,EAAkD,CAC3E,OAAIA,EAAS,YAAY,aAAa,SAAS,OAAS,EAC7C,GAAGA,EAAS,YAAY,aAAa,SACvC,IAAKqD,GAAQ,KAAK,QAAQ,cAAcA,CAAG,CAAC,EAC5C,KAAK,GAAG,CAAC,IAAI,KAAK,QAAQ,cAAcrD,EAAS,YAAY,IAAI,CAAC,GAEpE,KAAK,QAAQ,cAAcA,EAAS,YAAY,IAAI,CAC/D,CAEQ,yBAAyB,CAC7B,YAAAU,CACJ,EAEW,CACP,OAAIA,GAAe,KACR,cAEJ,UACX,CACJ","names":["defaultSetTimout","defaultClearTimeout","runTimeout","fun","cachedSetTimeout","e","runClearTimeout","marker","cachedClearTimeout","cleanUpNextTick","draining","currentQueue","queue","queueIndex","drainQueue","timeout","len","nextTick","args","i","Item","array","noop","binding","name","cwd","chdir","dir","umask","hrtime","previousTimestamp","clocktime","performanceNow","performance","seconds","nanoseconds","uptime","currentTime","dif","startTime","title","platform","browser","env","argv","version","versions","release","config","on","addListener","once","off","removeListener","removeAllListeners","emit","process","defines","init_process","__esmMin","key","segs","target","seg","init","inited","code","i","len","lookup","revLookup","base64toByteArray","b64","j","l","tmp","placeHolders","arr","Arr","L","tripletToBase64","num","encodeChunk","uint8","start","end","output","base64fromByteArray","extraBytes","parts","maxChunkLength","len2","kMaxLength","Buffer","createBuffer","that","length","arg","encodingOrOffset","allocUnsafe","from","value","fromArrayBuffer","fromString","fromObject","assertSize","size","alloc","fill","encoding","checked","string","byteLength","actual","fromArrayLike","array","byteOffset","obj","internalIsBuffer","isnan","b","loweredCase","utf8ToBytes","base64ToBytes","slowToString","hexSlice","utf8Slice","asciiSlice","latin1Slice","base64Slice","utf16leSlice","swap","n","m","bidirectionalIndexOf","buffer","val","dir","arrayIndexOf","indexSize","arrLength","valLength","read","buf","foundIndex","found","hexWrite","offset","remaining","strLen","parsed","utf8Write","blitBuffer","asciiWrite","asciiToBytes","latin1Write","base64Write","ucs2Write","utf16leToBytes","res","firstByte","codePoint","bytesPerSequence","secondByte","thirdByte","fourthByte","tempCodePoint","decodeCodePointsArray","codePoints","MAX_ARGUMENTS_LENGTH","ret","out","toHex","bytes","checkOffset","ext","checkInt","max","min","objectWriteUInt16","littleEndian","objectWriteUInt32","checkIEEE754","writeFloat","noAssert","ieee754write","writeDouble","base64clean","str","stringtrim","INVALID_BASE64_RE","units","leadSurrogate","byteArray","c","hi","lo","src","dst","isBuffer","isFastBuffer","isSlowBuffer","ieee754read","isLE","mLen","nBytes","e","eLen","eMax","eBias","nBits","d","s","rt","init_Buffer","__esmMin","init_process","init_buffer","a","x","y","list","pos","target","thisStart","thisEnd","thisCopy","targetCopy","newBuf","sliceLen","mul","maxBytes","limit","sub","targetStart","init_buffer","__esmMin","init_Buffer","EndpointSnippetGenerator_exports","__export","EndpointSnippetGenerator","__toCommonJS","init_process","init_buffer","init_process","init_buffer","init_process","init_buffer","assertNever","x","init_process","init_buffer","init_process","init_buffer","init_process","init_buffer","_a","_b","key","process","enableStackTracking","trackingType","globalFunctionFilters","globalFileFilters","stacktrace","maxFrames","skip","filterPaths","filterFunctions","stopOn","filterNode","filterJs","formatFilename","filename","_a","enableStackTracking","globalFunctionFilters","globalFileFilters","stop","line","match","fn","path","column","s","each","_b","f","p","StackTraces","maxFrames","skip","filterPaths","filterFunctions","stopOn","filterNode","filterJs","multiline","formatFilename","filename","__publicField","obj","current","stacktrace","frame","enableStackTracking","frames","each","stackTraces","startTracking","tag","getFramesForTaggedObject","obj","_a","stackTraces","AbstractAstNode","tag","init_process","init_buffer","init_process","init_buffer","init_process","init_buffer","CodeBlock","AbstractAstNode","value","__publicField","writer","TAB_SIZE","startTracking","AbstractWriter","__publicField","enableStackTracking","parts","text","textEndsInNewline","textWithoutNewline","indent","indentedText","currIndentLevel","node","getFramesForTaggedObject","trackingType","input","CodeBlock","prefix","statement","withNewline","nodes","delimiter","writeFunction","firstNode","i","appendToLastLine","lines","appendTrackingComment","line","stack","each","stacktrace","init_process","init_buffer","init_process","init_buffer","Severity","init_process","init_buffer","Scope","init_process","init_buffer","python_exports","__export","AccessAttribute","AstNode","Class","ClassInstantiation","CodeBlock","Comment","Decorator","Field","Lambda","LambdaParameter","Method","MethodArgument","MethodInvocation","Operator","Parameter","PythonFile","Reference","StarImport","Type","TypeInstantiation","accessAttribute","assign","class_","codeBlock","comment","decorator","field","file","instantiateClass","invokeFunction","invokeMethod","lambda","lambdaParameter","method","methodArgument","operator","parameter","reference","starImport","init_process","init_buffer","init_process","init_buffer","init_process","init_buffer","init_process","init_buffer","Writer","AbstractWriter","__publicField","completeRefPathsToNameOverrides","reference","_a","explicitNameOverride","formatter","AstNode","AbstractAstNode","__publicField","reference","astNode","writer","Writer","formatter","AccessAttribute","AstNode","lhs","rhs","__publicField","writer","init_process","init_buffer","Assign","AstNode","lhs","rhs","__publicField","writer","init_process","init_buffer","BaseInvocation","AstNode","reference","arguments_","multiline","__publicField","arg","writer","idx","init_process","init_buffer","Class","AstNode","docs","name","extends_","decorators","__publicField","parentClassReference","decorator","writer","index","field","statement","init_process","init_buffer","ClassInstantiation","BaseInvocation","_a","_b","classReference","args","__objRest","__spreadValues","init_process","init_buffer","CodeBlock","AstNode","arg","__publicField","writer","init_process","init_buffer","Comment","AstNode","docs","__publicField","writer","line","init_process","init_buffer","Decorator","AstNode","callable","__publicField","writer","init_process","init_buffer","Field","AstNode","name","type","initializer","docs","__publicField","writer","init_process","init_buffer","Lambda","AstNode","parameters","body","__publicField","writer","param","index","init_process","init_buffer","init_process","init_buffer","Parameter","AstNode","name","type","initializer","__publicField","writer","LambdaParameter","Parameter","name","initializer","init_process","init_buffer","ClassMethodType","Method","AstNode","static_","name","parameters","return_","docstring","type","decorators","__publicField","parameter","decorator","statements","statement","writer","python_exports","CodeBlock","useMultiline","param","index","init_process","init_buffer","MethodArgument","AstNode","name","value","__publicField","writer","init_process","init_buffer","MethodInvocation","AstNode","on","method","arguments_","multiline","__publicField","arg","writer","idx","init_process","init_buffer","init_process","init_buffer","OperatorType","Operator","AstNode","operator","lhs","rhs","__publicField","OperatorType","assertNever","writer","init_process","init_buffer","init_process","init_buffer","createPythonClassName","input","cleanedInput","word","w","index","init_process","init_buffer","init_process","init_buffer","Reference","AstNode","name","modulePath","genericTypes","alias","attribute","__publicField","genericType","writer","nameOverride","index","attr","StarImport","Reference","modulePath","__publicField","writer","PythonFile","AstNode","path","statements","isInitFile","comments","imports","__publicField","statement","import_","writer","uniqueReferences","idx","referencesToHandle","completeRefPathsToNameOverrides","usedNames","filePath","fileReferences","references","reference","fullyQualifiedModulePath","name","_a","StarImport","nameOverride","modulePathIdx","isAlias","module","createPythonClassName","Class","Method","Field","referenceName","fullyQualifiedPath","existingRefs","comment","alias","modulePath","refModulePath","commonPrefixLength","levelsUp","relativePath","part","init_process","init_buffer","Type","AstNode","internalType","__publicField","writer","value","index","assertNever","listType","python_exports","setType","values","tupleType","keyType","valueType","dictType","uuidType","optionalType","unionType","anyType","datetimeType","referenceType","literalType","init_process","init_buffer","TypeInstantiation","_TypeInstantiation","AstNode","internalType","__publicField","value","config","values","list","set","tuple","entries","typedDict","entry","date","Reference","datetime","dict","ref","uuid","typeInstantiation","writer","_a","_b","_c","_d","_e","_f","_g","_h","_i","_j","_k","startOnNewLine","endWithNewLine","filterNopValues","index","filterNopDictEntries","filterNopNamedValues","assertNever","lines","line","idx","input","pattern","replacements","char","element","key","val","accessAttribute","args","AccessAttribute","assign","Assign","file","PythonFile","class_","Class","instantiateClass","ClassInstantiation","decorator","Decorator","reference","Reference","starImport","StarImport","field","Field","codeBlock","CodeBlock","comment","Comment","lambda","Lambda","lambdaParameter","LambdaParameter","method","Method","invokeFunction","BaseInvocation","invokeMethod","MethodInvocation","parameter","Parameter","methodArgument","MethodArgument","operator","Operator","STRING_TYPE_REFERENCE","SNIPPET_MODULE_PATH","CLIENT_VAR_NAME","REQUEST_BODY_ARG_NAME","EndpointSnippetGenerator","context","__publicField","endpoint","request","snippet","python_exports","arg","fields","environmentArgs","Severity","Scope","baseUrl","environment","environmentValue","environmentTypeReference","key","value","auth","values","assertNever","message","headers","header","field","typeLiteral","_a","_b","args","pathParameters","bodyPropertyNames","bodyArgs","disambiguatedPathArgs","__spreadProps","__spreadValues","body","typeReference","named","innerType","property","typeInstantiation","inlinePathParameters","pathParameterFields","filePropertyInfo","_c","_d","queryParameterFields","queryParameter","headerFields","requestBodyFields","bodyType","parameters","nonLiteralBodyProperties","parameter","namedParameters","nonLiteralPathParameters","val"]}