@vireo-ai/trellis-ui 0.1.2 → 0.1.5

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 (42) hide show
  1. package/package.json +2 -5
  2. package/src/components/date-picker/styles.css +9 -0
  3. package/src/components/select/styles.css +9 -0
  4. package/src/theme.css +36 -4
  5. package/trellis_ui/static/trellis_ui/css/styles.css +307 -12
  6. package/trellis_ui/static/trellis_ui/js/esm/index.js +3605 -2210
  7. package/trellis_ui/static/trellis_ui/js/esm/index.js.map +1 -1
  8. package/trellis_ui/static/trellis_ui/js/index.js +6 -6
  9. package/types/components/accordion/contract.d.ts +2 -0
  10. package/types/components/accordion/index.d.ts +3 -1
  11. package/types/components/combobox/index.d.ts +8 -2
  12. package/types/components/container/contract.d.ts +30 -0
  13. package/types/components/container/index.d.ts +1 -0
  14. package/types/components/date-picker/index.d.ts +3 -2
  15. package/types/components/dropdown/index.d.ts +4 -2
  16. package/types/components/flex/contract.d.ts +35 -0
  17. package/types/components/flex/index.d.ts +1 -0
  18. package/types/components/grid/contract.d.ts +40 -0
  19. package/types/components/grid/index.d.ts +1 -0
  20. package/types/components/input/index.d.ts +1 -0
  21. package/types/components/layout.d.ts +408 -0
  22. package/types/components/modal/index.d.ts +4 -2
  23. package/types/components/runtime.d.ts +2 -0
  24. package/types/components/section/contract.d.ts +27 -0
  25. package/types/components/section/index.d.ts +1 -0
  26. package/types/components/select/index.d.ts +8 -2
  27. package/types/components/sidebar/index.d.ts +14 -7
  28. package/types/components/slider/index.d.ts +1 -0
  29. package/types/components/stack/contract.d.ts +29 -0
  30. package/types/components/stack/index.d.ts +1 -0
  31. package/types/components/table/contract.d.ts +4 -3
  32. package/types/components/tabs/index.d.ts +1 -0
  33. package/types/components/textarea/index.d.ts +13 -0
  34. package/types/components/toast/index.d.ts +4 -0
  35. package/types/index.d.ts +6 -4
  36. package/types/runtime/codecs.d.ts +11 -2
  37. package/types/runtime/index.d.ts +5 -2
  38. package/types/runtime/machine.d.ts +55 -0
  39. package/types/runtime/manifest.d.ts +2 -0
  40. package/types/runtime/stream.d.ts +1 -1
  41. package/trellis_ui/static/trellis_ui/js/esm/chunks/dist-DMX3Q5Zu.js +0 -551
  42. package/trellis_ui/static/trellis_ui/js/esm/chunks/dist-DMX3Q5Zu.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"dist-DMX3Q5Zu.js","names":["Headers","AbortController"],"sources":["../../../../../../node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs","../../../../../../node_modules/.pnpm/ufo@1.6.4/node_modules/ufo/dist/index.mjs","../../../../../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.mjs","../../../../../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/index.mjs","../../../../../../node_modules/.pnpm/event-source-plus@0.1.15/node_modules/event-source-plus/dist/index.mjs"],"sourcesContent":["const suspectProtoRx = /\"(?:_|\\\\u0{2}5[Ff]){2}(?:p|\\\\u0{2}70)(?:r|\\\\u0{2}72)(?:o|\\\\u0{2}6[Ff])(?:t|\\\\u0{2}74)(?:o|\\\\u0{2}6[Ff])(?:_|\\\\u0{2}5[Ff]){2}\"\\s*:/;\nconst suspectConstructorRx = /\"(?:c|\\\\u0063)(?:o|\\\\u006[Ff])(?:n|\\\\u006[Ee])(?:s|\\\\u0073)(?:t|\\\\u0074)(?:r|\\\\u0072)(?:u|\\\\u0075)(?:c|\\\\u0063)(?:t|\\\\u0074)(?:o|\\\\u006[Ff])(?:r|\\\\u0072)\"\\s*:/;\nconst JsonSigRx = /^\\s*[\"[{]|^\\s*-?\\d{1,16}(\\.\\d{1,17})?([Ee][+-]?\\d+)?\\s*$/;\nfunction jsonParseTransform(key, value) {\n if (key === \"__proto__\" || key === \"constructor\" && value && typeof value === \"object\" && \"prototype\" in value) {\n warnKeyDropped(key);\n return;\n }\n return value;\n}\nfunction warnKeyDropped(key) {\n console.warn(`[destr] Dropping \"${key}\" key to prevent prototype pollution.`);\n}\nfunction destr(value, options = {}) {\n if (typeof value !== \"string\") {\n return value;\n }\n if (value[0] === '\"' && value[value.length - 1] === '\"' && value.indexOf(\"\\\\\") === -1) {\n return value.slice(1, -1);\n }\n const _value = value.trim();\n if (_value.length <= 9) {\n switch (_value.toLowerCase()) {\n case \"true\": {\n return true;\n }\n case \"false\": {\n return false;\n }\n case \"undefined\": {\n return void 0;\n }\n case \"null\": {\n return null;\n }\n case \"nan\": {\n return Number.NaN;\n }\n case \"infinity\": {\n return Number.POSITIVE_INFINITY;\n }\n case \"-infinity\": {\n return Number.NEGATIVE_INFINITY;\n }\n }\n }\n if (!JsonSigRx.test(value)) {\n if (options.strict) {\n throw new SyntaxError(\"[destr] Invalid JSON\");\n }\n return value;\n }\n try {\n if (suspectProtoRx.test(value) || suspectConstructorRx.test(value)) {\n if (options.strict) {\n throw new Error(\"[destr] Possible prototype pollution\");\n }\n return JSON.parse(value, jsonParseTransform);\n }\n return JSON.parse(value);\n } catch (error) {\n if (options.strict) {\n throw error;\n }\n return value;\n }\n}\nfunction safeDestr(value, options = {}) {\n return destr(value, { ...options, strict: true });\n}\n\nexport { destr as default, destr, safeDestr };\n","const n = /[^\\0-\\x7E]/;\nconst t = /[\\x2E\\u3002\\uFF0E\\uFF61]/g;\nconst o = {\n overflow: \"Overflow Error\",\n \"not-basic\": \"Illegal Input\",\n \"invalid-input\": \"Invalid Input\"\n};\nconst e = Math.floor;\nconst r = String.fromCharCode;\nfunction s(n2) {\n throw new RangeError(o[n2]);\n}\nconst c = function(n2, t2) {\n return n2 + 22 + 75 * (n2 < 26) - ((t2 != 0) << 5);\n};\nconst u = function(n2, t2, o2) {\n let r2 = 0;\n for (n2 = o2 ? e(n2 / 700) : n2 >> 1, n2 += e(n2 / t2); n2 > 455; r2 += 36) {\n n2 = e(n2 / 35);\n }\n return e(r2 + 36 * n2 / (n2 + 38));\n};\nfunction toASCII(o2) {\n return (function(n2, o3) {\n const e2 = n2.split(\"@\");\n let r2 = \"\";\n e2.length > 1 && (r2 = e2[0] + \"@\", n2 = e2[1]);\n const s2 = (function(n3, t2) {\n const o4 = [];\n let e3 = n3.length;\n for (; e3--; ) {\n o4[e3] = t2(n3[e3]);\n }\n return o4;\n })((n2 = n2.replace(t, \".\")).split(\".\"), o3).join(\".\");\n return r2 + s2;\n })(o2, function(t2) {\n return n.test(t2) ? \"xn--\" + (function(n2) {\n const t3 = [];\n const o3 = (n2 = (function(n3) {\n const t4 = [];\n let o4 = 0;\n const e2 = n3.length;\n for (; o4 < e2; ) {\n const r2 = n3.charCodeAt(o4++);\n if (r2 >= 55296 && r2 <= 56319 && o4 < e2) {\n const e3 = n3.charCodeAt(o4++);\n (64512 & e3) == 56320 ? t4.push(((1023 & r2) << 10) + (1023 & e3) + 65536) : (t4.push(r2), o4--);\n } else {\n t4.push(r2);\n }\n }\n return t4;\n })(n2)).length;\n let f = 128;\n let i = 0;\n let l = 72;\n for (const o4 of n2) {\n o4 < 128 && t3.push(r(o4));\n }\n const h = t3.length;\n let p = h;\n for (h && t3.push(\"-\"); p < o3; ) {\n let o4 = 2147483647;\n for (const t4 of n2) {\n t4 >= f && t4 < o4 && (o4 = t4);\n }\n const a = p + 1;\n o4 - f > e((2147483647 - i) / a) && s(\"overflow\"), i += (o4 - f) * a, f = o4;\n for (const o5 of n2) {\n if (o5 < f && ++i > 2147483647 && s(\"overflow\"), o5 == f) {\n let n3 = i;\n for (let o6 = 36; ; o6 += 36) {\n const s2 = o6 <= l ? 1 : o6 >= l + 26 ? 26 : o6 - l;\n if (n3 < s2) {\n break;\n }\n const u2 = n3 - s2;\n const f2 = 36 - s2;\n t3.push(r(c(s2 + u2 % f2, 0))), n3 = e(u2 / f2);\n }\n t3.push(r(c(n3, 0))), l = u(i, a, p == h), i = 0, ++p;\n }\n }\n ++i, ++f;\n }\n return t3.join(\"\");\n })(t2) : t2;\n });\n}\n\nconst HASH_RE = /#/g;\nconst AMPERSAND_RE = /&/g;\nconst SLASH_RE = /\\//g;\nconst EQUAL_RE = /=/g;\nconst IM_RE = /\\?/g;\nconst PLUS_RE = /\\+/g;\nconst ENC_CARET_RE = /%5e/gi;\nconst ENC_BACKTICK_RE = /%60/gi;\nconst ENC_CURLY_OPEN_RE = /%7b/gi;\nconst ENC_PIPE_RE = /%7c/gi;\nconst ENC_CURLY_CLOSE_RE = /%7d/gi;\nconst ENC_SPACE_RE = /%20/gi;\nconst ENC_SLASH_RE = /%2f/gi;\nconst ENC_ENC_SLASH_RE = /%252f/gi;\nfunction encode(text) {\n return encodeURI(\"\" + text).replace(ENC_PIPE_RE, \"|\");\n}\nfunction encodeHash(text) {\n return encode(text).replace(ENC_CURLY_OPEN_RE, \"{\").replace(ENC_CURLY_CLOSE_RE, \"}\").replace(ENC_CARET_RE, \"^\");\n}\nfunction encodeQueryValue(input) {\n return encode(typeof input === \"string\" ? input : JSON.stringify(input)).replace(PLUS_RE, \"%2B\").replace(ENC_SPACE_RE, \"+\").replace(HASH_RE, \"%23\").replace(AMPERSAND_RE, \"%26\").replace(ENC_BACKTICK_RE, \"`\").replace(ENC_CARET_RE, \"^\").replace(SLASH_RE, \"%2F\");\n}\nfunction encodeQueryKey(text) {\n return encodeQueryValue(text).replace(EQUAL_RE, \"%3D\");\n}\nfunction encodePath(text) {\n return encode(text).replace(HASH_RE, \"%23\").replace(IM_RE, \"%3F\").replace(ENC_ENC_SLASH_RE, \"%2F\").replace(AMPERSAND_RE, \"%26\").replace(PLUS_RE, \"%2B\");\n}\nfunction encodeParam(text) {\n return encodePath(text).replace(SLASH_RE, \"%2F\");\n}\nfunction decode(text = \"\") {\n try {\n return decodeURIComponent(\"\" + text);\n } catch {\n return \"\" + text;\n }\n}\nfunction decodePath(text) {\n return decode(text.replace(ENC_SLASH_RE, \"%252F\"));\n}\nfunction decodeQueryKey(text) {\n return decode(text.replace(PLUS_RE, \" \"));\n}\nfunction decodeQueryValue(text) {\n return decode(text.replace(PLUS_RE, \" \"));\n}\nfunction encodeHost(name = \"\") {\n return toASCII(name);\n}\n\nfunction parseQuery(parametersString = \"\") {\n const object = /* @__PURE__ */ Object.create(null);\n if (parametersString[0] === \"?\") {\n parametersString = parametersString.slice(1);\n }\n for (const parameter of parametersString.split(\"&\")) {\n const s = parameter.match(/([^=]+)=?(.*)/) || [];\n if (s.length < 2) {\n continue;\n }\n const key = decodeQueryKey(s[1]);\n if (key === \"__proto__\" || key === \"constructor\") {\n continue;\n }\n const value = decodeQueryValue(s[2] || \"\");\n if (object[key] === void 0) {\n object[key] = value;\n } else if (Array.isArray(object[key])) {\n object[key].push(value);\n } else {\n object[key] = [object[key], value];\n }\n }\n return object;\n}\nfunction encodeQueryItem(key, value) {\n if (typeof value === \"number\" || typeof value === \"boolean\") {\n value = String(value);\n }\n if (!value) {\n return encodeQueryKey(key);\n }\n if (Array.isArray(value)) {\n return value.map(\n (_value) => `${encodeQueryKey(key)}=${encodeQueryValue(_value)}`\n ).join(\"&\");\n }\n return `${encodeQueryKey(key)}=${encodeQueryValue(value)}`;\n}\nfunction stringifyQuery(query) {\n return Object.keys(query).filter((k) => query[k] !== void 0).map((k) => encodeQueryItem(k, query[k])).filter(Boolean).join(\"&\");\n}\n\nconst PROTOCOL_STRICT_REGEX = /^[\\s\\w\\0+.-]{2,}:([/\\\\]{1,2})/;\nconst PROTOCOL_REGEX = /^[\\s\\w\\0+.-]{2,}:([/\\\\]{2})?/;\nconst PROTOCOL_RELATIVE_REGEX = /^([/\\\\]\\s*){2,}[^/\\\\]/;\nconst PROTOCOL_SCRIPT_RE = /^[\\s\\0]*(blob|data|javascript|vbscript):$/i;\nconst TRAILING_SLASH_RE = /\\/$|\\/\\?|\\/#/;\nconst JOIN_LEADING_SLASH_RE = /^\\.?\\//;\nfunction isRelative(inputString) {\n return [\"./\", \"../\"].some((string_) => inputString.startsWith(string_));\n}\nfunction hasProtocol(inputString, opts = {}) {\n if (typeof opts === \"boolean\") {\n opts = { acceptRelative: opts };\n }\n if (opts.strict) {\n return PROTOCOL_STRICT_REGEX.test(inputString);\n }\n return PROTOCOL_REGEX.test(inputString) || (opts.acceptRelative ? PROTOCOL_RELATIVE_REGEX.test(inputString) : false);\n}\nfunction isScriptProtocol(protocol) {\n return !!protocol && PROTOCOL_SCRIPT_RE.test(protocol);\n}\nfunction hasTrailingSlash(input = \"\", respectQueryAndFragment) {\n if (!respectQueryAndFragment) {\n return input.endsWith(\"/\");\n }\n return TRAILING_SLASH_RE.test(input);\n}\nfunction withoutTrailingSlash(input = \"\", respectQueryAndFragment) {\n if (!respectQueryAndFragment) {\n return (hasTrailingSlash(input) ? input.slice(0, -1) : input) || \"/\";\n }\n if (!hasTrailingSlash(input, true)) {\n return input || \"/\";\n }\n let path = input;\n let fragment = \"\";\n const fragmentIndex = input.indexOf(\"#\");\n if (fragmentIndex !== -1) {\n path = input.slice(0, fragmentIndex);\n fragment = input.slice(fragmentIndex);\n }\n const [s0, ...s] = path.split(\"?\");\n const cleanPath = s0.endsWith(\"/\") ? s0.slice(0, -1) : s0;\n return (cleanPath || \"/\") + (s.length > 0 ? `?${s.join(\"?\")}` : \"\") + fragment;\n}\nfunction withTrailingSlash(input = \"\", respectQueryAndFragment) {\n if (!respectQueryAndFragment) {\n return input.endsWith(\"/\") ? input : input + \"/\";\n }\n if (hasTrailingSlash(input, true)) {\n return input || \"/\";\n }\n let path = input;\n let fragment = \"\";\n const fragmentIndex = input.indexOf(\"#\");\n if (fragmentIndex !== -1) {\n path = input.slice(0, fragmentIndex);\n fragment = input.slice(fragmentIndex);\n if (!path) {\n return fragment;\n }\n }\n const [s0, ...s] = path.split(\"?\");\n return s0 + \"/\" + (s.length > 0 ? `?${s.join(\"?\")}` : \"\") + fragment;\n}\nfunction hasLeadingSlash(input = \"\") {\n return input.startsWith(\"/\");\n}\nfunction withoutLeadingSlash(input = \"\") {\n return (hasLeadingSlash(input) ? input.slice(1) : input) || \"/\";\n}\nfunction withLeadingSlash(input = \"\") {\n return hasLeadingSlash(input) ? input : \"/\" + input;\n}\nfunction cleanDoubleSlashes(input = \"\") {\n return input.split(\"://\").map((string_) => string_.replace(/\\/{2,}/g, \"/\")).join(\"://\");\n}\nfunction withBase(input, base) {\n if (isEmptyURL(base) || hasProtocol(input)) {\n return input;\n }\n const _base = withoutTrailingSlash(base);\n if (input.startsWith(_base)) {\n const nextChar = input[_base.length];\n if (!nextChar || nextChar === \"/\" || nextChar === \"?\") {\n return input;\n }\n }\n return joinURL(_base, input);\n}\nfunction withoutBase(input, base) {\n if (isEmptyURL(base)) {\n return input;\n }\n const _base = withoutTrailingSlash(base);\n if (!input.startsWith(_base)) {\n return input;\n }\n const nextChar = input[_base.length];\n if (nextChar && nextChar !== \"/\" && nextChar !== \"?\") {\n return input;\n }\n const trimmed = input.slice(_base.length).replace(/^\\/+/, \"\");\n return \"/\" + trimmed;\n}\nfunction withQuery(input, query) {\n const parsed = parseURL(input);\n const mergedQuery = { ...parseQuery(parsed.search), ...query };\n parsed.search = stringifyQuery(mergedQuery);\n return stringifyParsedURL(parsed);\n}\nfunction filterQuery(input, predicate) {\n if (!input.includes(\"?\")) {\n return input;\n }\n const parsed = parseURL(input);\n const query = parseQuery(parsed.search);\n const filteredQuery = Object.fromEntries(\n Object.entries(query).filter(([key, value]) => predicate(key, value))\n );\n parsed.search = stringifyQuery(filteredQuery);\n return stringifyParsedURL(parsed);\n}\nfunction getQuery(input) {\n return parseQuery(parseURL(input).search);\n}\nfunction isEmptyURL(url) {\n return !url || url === \"/\";\n}\nfunction isNonEmptyURL(url) {\n return url && url !== \"/\";\n}\nfunction joinURL(base, ...input) {\n let url = base || \"\";\n for (const segment of input.filter((url2) => isNonEmptyURL(url2))) {\n if (url) {\n const _segment = segment.replace(JOIN_LEADING_SLASH_RE, \"\");\n url = withTrailingSlash(url) + _segment;\n } else {\n url = segment;\n }\n }\n return url;\n}\nfunction joinRelativeURL(..._input) {\n const JOIN_SEGMENT_SPLIT_RE = /\\/(?!\\/)/;\n const input = _input.filter(Boolean);\n const segments = [];\n let segmentsDepth = 0;\n for (const i of input) {\n if (!i || i === \"/\") {\n continue;\n }\n for (const [sindex, s] of i.split(JOIN_SEGMENT_SPLIT_RE).entries()) {\n if (!s || s === \".\") {\n continue;\n }\n if (s === \"..\") {\n if (segments.length === 1 && hasProtocol(segments[0])) {\n continue;\n }\n segments.pop();\n segmentsDepth--;\n continue;\n }\n if (sindex === 1 && segments[segments.length - 1]?.endsWith(\":/\")) {\n segments[segments.length - 1] += \"/\" + s;\n continue;\n }\n segments.push(s);\n segmentsDepth++;\n }\n }\n let url = segments.join(\"/\");\n if (segmentsDepth >= 0) {\n if (input[0]?.startsWith(\"/\") && !url.startsWith(\"/\")) {\n url = \"/\" + url;\n } else if (input[0]?.startsWith(\"./\") && !url.startsWith(\"./\")) {\n url = \"./\" + url;\n }\n } else {\n url = \"../\".repeat(-1 * segmentsDepth) + url;\n }\n if (input[input.length - 1]?.endsWith(\"/\") && !url.endsWith(\"/\")) {\n url += \"/\";\n }\n return url;\n}\nfunction withHttp(input) {\n return withProtocol(input, \"http://\");\n}\nfunction withHttps(input) {\n return withProtocol(input, \"https://\");\n}\nfunction withoutProtocol(input) {\n return withProtocol(input, \"\");\n}\nfunction withProtocol(input, protocol) {\n let match = input.match(PROTOCOL_REGEX);\n if (!match) {\n match = input.match(/^\\/{2,}/);\n }\n if (!match) {\n return protocol + input;\n }\n return protocol + input.slice(match[0].length);\n}\nfunction normalizeURL(input) {\n const parsed = parseURL(input);\n parsed.pathname = encodePath(decodePath(parsed.pathname));\n parsed.hash = encodeHash(decode(parsed.hash));\n parsed.host = encodeHost(decode(parsed.host));\n parsed.search = stringifyQuery(parseQuery(parsed.search));\n return stringifyParsedURL(parsed);\n}\nfunction resolveURL(base = \"\", ...inputs) {\n if (typeof base !== \"string\") {\n throw new TypeError(\n `URL input should be string received ${typeof base} (${base})`\n );\n }\n const filteredInputs = inputs.filter((input) => isNonEmptyURL(input));\n if (filteredInputs.length === 0) {\n return base;\n }\n const url = parseURL(base);\n for (const inputSegment of filteredInputs) {\n const urlSegment = parseURL(inputSegment);\n if (urlSegment.pathname) {\n url.pathname = withTrailingSlash(url.pathname) + withoutLeadingSlash(urlSegment.pathname);\n }\n if (urlSegment.hash && urlSegment.hash !== \"#\") {\n url.hash = urlSegment.hash;\n }\n if (urlSegment.search && urlSegment.search !== \"?\") {\n if (url.search && url.search !== \"?\") {\n const queryString = stringifyQuery({\n ...parseQuery(url.search),\n ...parseQuery(urlSegment.search)\n });\n url.search = queryString.length > 0 ? \"?\" + queryString : \"\";\n } else {\n url.search = urlSegment.search;\n }\n }\n }\n return stringifyParsedURL(url);\n}\nfunction isSamePath(p1, p2) {\n return decode(withoutTrailingSlash(p1)) === decode(withoutTrailingSlash(p2));\n}\nfunction isEqual(a, b, options = {}) {\n if (!options.trailingSlash) {\n a = withTrailingSlash(a);\n b = withTrailingSlash(b);\n }\n if (!options.leadingSlash) {\n a = withLeadingSlash(a);\n b = withLeadingSlash(b);\n }\n if (!options.encoding) {\n a = decode(a);\n b = decode(b);\n }\n return a === b;\n}\nfunction withFragment(input, hash) {\n if (!hash || hash === \"#\") {\n return input;\n }\n const parsed = parseURL(input);\n parsed.hash = hash === \"\" ? \"\" : \"#\" + encodeHash(hash);\n return stringifyParsedURL(parsed);\n}\nfunction withoutFragment(input) {\n return stringifyParsedURL({ ...parseURL(input), hash: \"\" });\n}\nfunction withoutHost(input) {\n const parsed = parseURL(input);\n return (parsed.pathname || \"/\") + parsed.search + parsed.hash;\n}\n\nconst protocolRelative = Symbol.for(\"ufo:protocolRelative\");\nfunction parseURL(input = \"\", defaultProto) {\n const _specialProtoMatch = input.match(\n /^[\\s\\0]*(blob:|data:|javascript:|vbscript:)(.*)/i\n );\n if (_specialProtoMatch) {\n const [, _proto, _pathname = \"\"] = _specialProtoMatch;\n return {\n protocol: _proto.toLowerCase(),\n pathname: _pathname,\n href: _proto + _pathname,\n auth: \"\",\n host: \"\",\n search: \"\",\n hash: \"\"\n };\n }\n if (!hasProtocol(input, { acceptRelative: true })) {\n return defaultProto ? parseURL(defaultProto + input) : parsePath(input);\n }\n const [, protocol = \"\", auth, hostAndPath = \"\"] = input.replace(/\\\\/g, \"/\").match(/^[\\s\\0]*([\\w+.-]{2,}:)?\\/\\/([^/@]+@)?(.*)/) || [];\n let [, host = \"\", path = \"\"] = hostAndPath.match(/([^#/?]*)(.*)?/) || [];\n if (protocol === \"file:\") {\n path = path.replace(/\\/(?=[A-Za-z]:)/, \"\");\n }\n const { pathname, search, hash } = parsePath(path);\n return {\n protocol: protocol.toLowerCase(),\n auth: auth ? auth.slice(0, Math.max(0, auth.length - 1)) : \"\",\n host,\n pathname,\n search,\n hash,\n [protocolRelative]: !protocol\n };\n}\nfunction parsePath(input = \"\") {\n const [pathname = \"\", search = \"\", hash = \"\"] = (input.match(/([^#?]*)(\\?[^#]*)?(#.*)?/) || []).splice(1);\n return {\n pathname,\n search,\n hash\n };\n}\nfunction parseAuth(input = \"\") {\n const [username, password] = input.split(\":\");\n return {\n username: decode(username),\n password: decode(password)\n };\n}\nfunction parseHost(input = \"\") {\n const [hostname, port] = (input.match(/([^/:]*):?(\\d+)?/) || []).splice(1);\n return {\n hostname: decode(hostname),\n port\n };\n}\nfunction stringifyParsedURL(parsed) {\n const pathname = parsed.pathname || \"\";\n const search = parsed.search ? (parsed.search.startsWith(\"?\") ? \"\" : \"?\") + parsed.search : \"\";\n const hash = parsed.hash || \"\";\n const auth = parsed.auth ? parsed.auth + \"@\" : \"\";\n const host = parsed.host || \"\";\n const proto = parsed.protocol || parsed[protocolRelative] ? (parsed.protocol || \"\") + \"//\" : \"\";\n return proto + auth + host + pathname + search + hash;\n}\nconst FILENAME_STRICT_REGEX = /\\/([^/]+\\.[^/]+)$/;\nconst FILENAME_REGEX = /\\/([^/]+)$/;\nfunction parseFilename(input = \"\", opts) {\n const { pathname } = parseURL(input);\n const matches = opts?.strict ? pathname.match(FILENAME_STRICT_REGEX) : pathname.match(FILENAME_REGEX);\n return matches ? matches[1] : void 0;\n}\n\nclass $URL {\n protocol;\n host;\n auth;\n pathname;\n query = {};\n hash;\n constructor(input = \"\") {\n if (typeof input !== \"string\") {\n throw new TypeError(\n `URL input should be string received ${typeof input} (${input})`\n );\n }\n const parsed = parseURL(input);\n this.protocol = decode(parsed.protocol);\n this.host = decode(parsed.host);\n this.auth = decode(parsed.auth);\n this.pathname = decodePath(parsed.pathname);\n this.query = parseQuery(parsed.search);\n this.hash = decode(parsed.hash);\n }\n get hostname() {\n return parseHost(this.host).hostname;\n }\n get port() {\n return parseHost(this.host).port || \"\";\n }\n get username() {\n return parseAuth(this.auth).username;\n }\n get password() {\n return parseAuth(this.auth).password || \"\";\n }\n get hasProtocol() {\n return this.protocol.length;\n }\n get isAbsolute() {\n return this.hasProtocol || this.pathname[0] === \"/\";\n }\n get search() {\n const q = stringifyQuery(this.query);\n return q.length > 0 ? \"?\" + q : \"\";\n }\n get searchParams() {\n const p = new URLSearchParams();\n for (const name in this.query) {\n const value = this.query[name];\n if (Array.isArray(value)) {\n for (const v of value) {\n p.append(name, v);\n }\n } else {\n p.append(\n name,\n typeof value === \"string\" ? value : JSON.stringify(value)\n );\n }\n }\n return p;\n }\n get origin() {\n return (this.protocol ? this.protocol + \"//\" : \"\") + encodeHost(this.host);\n }\n get fullpath() {\n return encodePath(this.pathname) + this.search + encodeHash(this.hash);\n }\n get encodedAuth() {\n if (!this.auth) {\n return \"\";\n }\n const { username, password } = parseAuth(this.auth);\n return encodeURIComponent(username) + (password ? \":\" + encodeURIComponent(password) : \"\");\n }\n get href() {\n const auth = this.encodedAuth;\n const originWithAuth = (this.protocol ? this.protocol + \"//\" : \"\") + (auth ? auth + \"@\" : \"\") + encodeHost(this.host);\n return this.hasProtocol && this.isAbsolute ? originWithAuth + this.fullpath : this.fullpath;\n }\n append(url) {\n if (url.hasProtocol) {\n throw new Error(\"Cannot append a URL with protocol\");\n }\n Object.assign(this.query, url.query);\n if (url.pathname) {\n this.pathname = withTrailingSlash(this.pathname) + withoutLeadingSlash(url.pathname);\n }\n if (url.hash) {\n this.hash = url.hash;\n }\n }\n toJSON() {\n return this.href;\n }\n toString() {\n return this.href;\n }\n}\nfunction createURL(input) {\n return new $URL(input);\n}\n\nexport { $URL, cleanDoubleSlashes, createURL, decode, decodePath, decodeQueryKey, decodeQueryValue, encode, encodeHash, encodeHost, encodeParam, encodePath, encodeQueryItem, encodeQueryKey, encodeQueryValue, filterQuery, getQuery, hasLeadingSlash, hasProtocol, hasTrailingSlash, isEmptyURL, isEqual, isNonEmptyURL, isRelative, isSamePath, isScriptProtocol, joinRelativeURL, joinURL, normalizeURL, parseAuth, parseFilename, parseHost, parsePath, parseQuery, parseURL, resolveURL, stringifyParsedURL, stringifyQuery, withBase, withFragment, withHttp, withHttps, withLeadingSlash, withProtocol, withQuery, withTrailingSlash, withoutBase, withoutFragment, withoutHost, withoutLeadingSlash, withoutProtocol, withoutTrailingSlash };\n","import destr from 'destr';\nimport { withBase, withQuery } from 'ufo';\n\nclass FetchError extends Error {\n constructor(message, opts) {\n super(message, opts);\n this.name = \"FetchError\";\n if (opts?.cause && !this.cause) {\n this.cause = opts.cause;\n }\n }\n}\nfunction createFetchError(ctx) {\n const errorMessage = ctx.error?.message || ctx.error?.toString() || \"\";\n const method = ctx.request?.method || ctx.options?.method || \"GET\";\n const url = ctx.request?.url || String(ctx.request) || \"/\";\n const requestStr = `[${method}] ${JSON.stringify(url)}`;\n const statusStr = ctx.response ? `${ctx.response.status} ${ctx.response.statusText}` : \"<no response>\";\n const message = `${requestStr}: ${statusStr}${errorMessage ? ` ${errorMessage}` : \"\"}`;\n const fetchError = new FetchError(\n message,\n ctx.error ? { cause: ctx.error } : void 0\n );\n for (const key of [\"request\", \"options\", \"response\"]) {\n Object.defineProperty(fetchError, key, {\n get() {\n return ctx[key];\n }\n });\n }\n for (const [key, refKey] of [\n [\"data\", \"_data\"],\n [\"status\", \"status\"],\n [\"statusCode\", \"status\"],\n [\"statusText\", \"statusText\"],\n [\"statusMessage\", \"statusText\"]\n ]) {\n Object.defineProperty(fetchError, key, {\n get() {\n return ctx.response && ctx.response[refKey];\n }\n });\n }\n return fetchError;\n}\n\nconst payloadMethods = new Set(\n Object.freeze([\"PATCH\", \"POST\", \"PUT\", \"DELETE\"])\n);\nfunction isPayloadMethod(method = \"GET\") {\n return payloadMethods.has(method.toUpperCase());\n}\nfunction isJSONSerializable(value) {\n if (value === void 0) {\n return false;\n }\n const t = typeof value;\n if (t === \"string\" || t === \"number\" || t === \"boolean\" || t === null) {\n return true;\n }\n if (t !== \"object\") {\n return false;\n }\n if (Array.isArray(value)) {\n return true;\n }\n if (value.buffer) {\n return false;\n }\n if (value instanceof FormData || value instanceof URLSearchParams) {\n return false;\n }\n return value.constructor && value.constructor.name === \"Object\" || typeof value.toJSON === \"function\";\n}\nconst textTypes = /* @__PURE__ */ new Set([\n \"image/svg\",\n \"application/xml\",\n \"application/xhtml\",\n \"application/html\"\n]);\nconst JSON_RE = /^application\\/(?:[\\w!#$%&*.^`~-]*\\+)?json(;.+)?$/i;\nfunction detectResponseType(_contentType = \"\") {\n if (!_contentType) {\n return \"json\";\n }\n const contentType = _contentType.split(\";\").shift() || \"\";\n if (JSON_RE.test(contentType)) {\n return \"json\";\n }\n if (contentType === \"text/event-stream\") {\n return \"stream\";\n }\n if (textTypes.has(contentType) || contentType.startsWith(\"text/\")) {\n return \"text\";\n }\n return \"blob\";\n}\nfunction resolveFetchOptions(request, input, defaults, Headers) {\n const headers = mergeHeaders(\n input?.headers ?? request?.headers,\n defaults?.headers,\n Headers\n );\n let query;\n if (defaults?.query || defaults?.params || input?.params || input?.query) {\n query = {\n ...defaults?.params,\n ...defaults?.query,\n ...input?.params,\n ...input?.query\n };\n }\n return {\n ...defaults,\n ...input,\n query,\n params: query,\n headers\n };\n}\nfunction mergeHeaders(input, defaults, Headers) {\n if (!defaults) {\n return new Headers(input);\n }\n const headers = new Headers(defaults);\n if (input) {\n for (const [key, value] of Symbol.iterator in input || Array.isArray(input) ? input : new Headers(input)) {\n headers.set(key, value);\n }\n }\n return headers;\n}\nasync function callHooks(context, hooks) {\n if (hooks) {\n if (Array.isArray(hooks)) {\n for (const hook of hooks) {\n await hook(context);\n }\n } else {\n await hooks(context);\n }\n }\n}\n\nconst retryStatusCodes = /* @__PURE__ */ new Set([\n 408,\n // Request Timeout\n 409,\n // Conflict\n 425,\n // Too Early (Experimental)\n 429,\n // Too Many Requests\n 500,\n // Internal Server Error\n 502,\n // Bad Gateway\n 503,\n // Service Unavailable\n 504\n // Gateway Timeout\n]);\nconst nullBodyResponses = /* @__PURE__ */ new Set([101, 204, 205, 304]);\nfunction createFetch(globalOptions = {}) {\n const {\n fetch = globalThis.fetch,\n Headers = globalThis.Headers,\n AbortController = globalThis.AbortController\n } = globalOptions;\n async function onError(context) {\n const isAbort = context.error && context.error.name === \"AbortError\" && !context.options.timeout || false;\n if (context.options.retry !== false && !isAbort) {\n let retries;\n if (typeof context.options.retry === \"number\") {\n retries = context.options.retry;\n } else {\n retries = isPayloadMethod(context.options.method) ? 0 : 1;\n }\n const responseCode = context.response && context.response.status || 500;\n if (retries > 0 && (Array.isArray(context.options.retryStatusCodes) ? context.options.retryStatusCodes.includes(responseCode) : retryStatusCodes.has(responseCode))) {\n const retryDelay = typeof context.options.retryDelay === \"function\" ? context.options.retryDelay(context) : context.options.retryDelay || 0;\n if (retryDelay > 0) {\n await new Promise((resolve) => setTimeout(resolve, retryDelay));\n }\n return $fetchRaw(context.request, {\n ...context.options,\n retry: retries - 1\n });\n }\n }\n const error = createFetchError(context);\n if (Error.captureStackTrace) {\n Error.captureStackTrace(error, $fetchRaw);\n }\n throw error;\n }\n const $fetchRaw = async function $fetchRaw2(_request, _options = {}) {\n const context = {\n request: _request,\n options: resolveFetchOptions(\n _request,\n _options,\n globalOptions.defaults,\n Headers\n ),\n response: void 0,\n error: void 0\n };\n if (context.options.method) {\n context.options.method = context.options.method.toUpperCase();\n }\n if (context.options.onRequest) {\n await callHooks(context, context.options.onRequest);\n if (!(context.options.headers instanceof Headers)) {\n context.options.headers = new Headers(\n context.options.headers || {}\n /* compat */\n );\n }\n }\n if (typeof context.request === \"string\") {\n if (context.options.baseURL) {\n context.request = withBase(context.request, context.options.baseURL);\n }\n if (context.options.query) {\n context.request = withQuery(context.request, context.options.query);\n delete context.options.query;\n }\n if (\"query\" in context.options) {\n delete context.options.query;\n }\n if (\"params\" in context.options) {\n delete context.options.params;\n }\n }\n if (context.options.body && isPayloadMethod(context.options.method)) {\n if (isJSONSerializable(context.options.body)) {\n const contentType = context.options.headers.get(\"content-type\");\n if (typeof context.options.body !== \"string\") {\n context.options.body = contentType === \"application/x-www-form-urlencoded\" ? new URLSearchParams(\n context.options.body\n ).toString() : JSON.stringify(context.options.body);\n }\n if (!contentType) {\n context.options.headers.set(\"content-type\", \"application/json\");\n }\n if (!context.options.headers.has(\"accept\")) {\n context.options.headers.set(\"accept\", \"application/json\");\n }\n } else if (\n // ReadableStream Body\n \"pipeTo\" in context.options.body && typeof context.options.body.pipeTo === \"function\" || // Node.js Stream Body\n typeof context.options.body.pipe === \"function\"\n ) {\n if (!(\"duplex\" in context.options)) {\n context.options.duplex = \"half\";\n }\n }\n }\n let abortTimeout;\n if (!context.options.signal && context.options.timeout) {\n const controller = new AbortController();\n abortTimeout = setTimeout(() => {\n const error = new Error(\n \"[TimeoutError]: The operation was aborted due to timeout\"\n );\n error.name = \"TimeoutError\";\n error.code = 23;\n controller.abort(error);\n }, context.options.timeout);\n context.options.signal = controller.signal;\n }\n try {\n context.response = await fetch(\n context.request,\n context.options\n );\n } catch (error) {\n context.error = error;\n if (context.options.onRequestError) {\n await callHooks(\n context,\n context.options.onRequestError\n );\n }\n return await onError(context);\n } finally {\n if (abortTimeout) {\n clearTimeout(abortTimeout);\n }\n }\n const hasBody = (context.response.body || // https://github.com/unjs/ofetch/issues/324\n // https://github.com/unjs/ofetch/issues/294\n // https://github.com/JakeChampion/fetch/issues/1454\n context.response._bodyInit) && !nullBodyResponses.has(context.response.status) && context.options.method !== \"HEAD\";\n if (hasBody) {\n const responseType = (context.options.parseResponse ? \"json\" : context.options.responseType) || detectResponseType(context.response.headers.get(\"content-type\") || \"\");\n switch (responseType) {\n case \"json\": {\n const data = await context.response.text();\n const parseFunction = context.options.parseResponse || destr;\n context.response._data = parseFunction(data);\n break;\n }\n case \"stream\": {\n context.response._data = context.response.body || context.response._bodyInit;\n break;\n }\n default: {\n context.response._data = await context.response[responseType]();\n }\n }\n }\n if (context.options.onResponse) {\n await callHooks(\n context,\n context.options.onResponse\n );\n }\n if (!context.options.ignoreResponseError && context.response.status >= 400 && context.response.status < 600) {\n if (context.options.onResponseError) {\n await callHooks(\n context,\n context.options.onResponseError\n );\n }\n return await onError(context);\n }\n return context.response;\n };\n const $fetch = async function $fetch2(request, options) {\n const r = await $fetchRaw(request, options);\n return r._data;\n };\n $fetch.raw = $fetchRaw;\n $fetch.native = (...args) => fetch(...args);\n $fetch.create = (defaultOptions = {}, customGlobalOptions = {}) => createFetch({\n ...globalOptions,\n ...customGlobalOptions,\n defaults: {\n ...globalOptions.defaults,\n ...customGlobalOptions.defaults,\n ...defaultOptions\n }\n });\n return $fetch;\n}\n\nexport { FetchError as F, createFetchError as a, createFetch as c };\n","import { c as createFetch } from './shared/ofetch.CWycOUEr.mjs';\nexport { F as FetchError, a as createFetchError } from './shared/ofetch.CWycOUEr.mjs';\nimport 'destr';\nimport 'ufo';\n\nconst _globalThis = (function() {\n if (typeof globalThis !== \"undefined\") {\n return globalThis;\n }\n if (typeof self !== \"undefined\") {\n return self;\n }\n if (typeof window !== \"undefined\") {\n return window;\n }\n if (typeof global !== \"undefined\") {\n return global;\n }\n throw new Error(\"unable to locate global object\");\n})();\nconst fetch = _globalThis.fetch ? (...args) => _globalThis.fetch(...args) : () => Promise.reject(new Error(\"[ofetch] global.fetch is not supported!\"));\nconst Headers = _globalThis.Headers;\nconst AbortController = _globalThis.AbortController;\nconst ofetch = createFetch({ fetch, Headers, AbortController });\nconst $fetch = ofetch;\n\nexport { $fetch, AbortController, Headers, createFetch, fetch, ofetch };\n","import { createFetch, ofetch, FetchError } from 'ofetch';\n\nasync function wait(duration) {\n return new Promise((res) => {\n setTimeout(() => {\n res(true);\n }, duration);\n });\n}\n\nfunction messageListFromString(input) {\n const messages = [];\n let line = \"\";\n let ignoreNextNewline = false;\n let data;\n let id;\n let event;\n let retry;\n let previousChar;\n let pendingIndex = 0;\n let isEndOfMessage = false;\n function handleParseLine(pIndex) {\n const result = parseLine(line);\n data = result.data ?? data;\n id = result.id ?? id;\n event = result.event ?? event;\n retry = result.retry ?? retry;\n if (isEndOfMessage) {\n if (typeof data === \"string\") {\n messages.push({\n id,\n data,\n event: event ?? \"message\",\n retry\n });\n }\n id = void 0;\n data = void 0;\n event = void 0;\n retry = void 0;\n pendingIndex = pIndex;\n }\n line = \"\";\n }\n for (let i = 0; i < input.length; i++) {\n const char = input[i];\n switch (char) {\n case \"\\r\": {\n isEndOfMessage = previousChar === \"\\n\" || previousChar === \"\\r\";\n ignoreNextNewline = true;\n const pIndex = input[i + 1] === \"\\n\" ? i + 2 : i + 1;\n handleParseLine(pIndex);\n break;\n }\n case \"\\n\": {\n if (ignoreNextNewline) {\n ignoreNextNewline = false;\n break;\n }\n isEndOfMessage = previousChar === \"\\n\";\n handleParseLine(i + 1);\n break;\n }\n default:\n line += char;\n break;\n }\n previousChar = char;\n }\n return {\n messages,\n leftoverData: input.substring(pendingIndex)\n };\n}\nfunction parseLine(input) {\n if (input.startsWith(\"data:\")) {\n return { data: input.substring(5).trim() };\n }\n if (input.startsWith(\"id:\")) {\n return { id: input.substring(3).trim() };\n }\n if (input.startsWith(\"event:\")) {\n return {\n event: input.substring(6).trim()\n };\n }\n if (input.startsWith(\"retry:\")) {\n const val = Number(input.substring(6).trim());\n if (!Number.isNaN(val)) {\n if (Number.isInteger(val)) {\n return { retry: val };\n } else {\n return { retry: Math.round(val) };\n }\n }\n }\n return {};\n}\nasync function getBytes(controller, stream, onChunk) {\n const reader = stream.getReader();\n let result;\n while (!controller.signal.aborted && !(result = await reader.read()).done) {\n onChunk(result.value);\n }\n}\n\nconst EventStreamContentType = \"text/event-stream\";\nconst LastEventIdHeader = \"last-event-id\";\nclass EventSourcePlus {\n url;\n lastEventId;\n options;\n retryCount = 0;\n retryInterval = 0;\n maxRetryCount;\n maxRetryInterval;\n fetch;\n timeoutDurationMs;\n timeout;\n constructor(url, options = {}) {\n this.url = url;\n this.options = options;\n this.maxRetryCount = options.maxRetryCount;\n this.maxRetryInterval = options.maxRetryInterval ?? 3e4;\n this.fetch = createFetch({ fetch: options.fetch }) ?? ofetch;\n this.timeoutDurationMs = options.timeout;\n }\n async _handleRetry(controller, hooks) {\n this.retryCount++;\n if (typeof this.maxRetryCount === \"number\" && this.retryCount >= this.maxRetryCount) {\n controller._emitEvent({\n type: \"error\",\n reason: \"max retry count reached\"\n });\n return;\n }\n if (this.retryInterval === 0) {\n this.retryInterval = 2;\n } else if (this.retryInterval > 0) {\n this.retryInterval = this.retryInterval * 2;\n if (this.retryInterval >= this.maxRetryInterval) {\n this.retryInterval = this.maxRetryInterval;\n }\n }\n await wait(this.retryInterval);\n controller._abortController.abort();\n controller._abortController = new AbortController();\n await this._handleConnection(controller, hooks);\n }\n async _handleConnection(controller, hooks) {\n let headers;\n const abortSignal = controller._abortController.signal;\n if (typeof this.options.headers === \"function\") {\n const result = this.options.headers();\n if (\"then\" in result && typeof result.then === \"function\") {\n headers = new Headers(\n await result.then((data) => data)\n );\n } else {\n headers = new Headers(result);\n }\n } else {\n headers = new Headers(\n this.options.headers ?? {}\n );\n }\n if (typeof headers.get(\"accept\") !== \"string\") {\n headers.set(\"accept\", EventStreamContentType);\n }\n if (typeof this.lastEventId === \"string\") {\n headers.set(LastEventIdHeader, this.lastEventId);\n }\n let ctx;\n const finalOptions = {\n ...this.options,\n method: this.options.method ?? \"get\",\n responseType: \"stream\",\n headers,\n signal: abortSignal,\n retry: false,\n onRequest: (context) => {\n if (controller.signal.aborted || abortSignal.aborted) return;\n if (isAbortError(context.error)) return;\n return hooks.onRequest?.(context);\n },\n onRequestError: async (context) => {\n if (controller.signal.aborted || abortSignal.aborted) return;\n if (isAbortError(context.error)) return;\n return hooks.onRequestError?.(context);\n },\n onResponse: async (context) => {\n ctx = context;\n return _handleResponse(context, hooks);\n },\n onResponseError: async (context) => {\n if (abortSignal.aborted) return;\n if (isAbortError(context.error)) return;\n if (typeof context.error === \"undefined\") {\n context.error = new FetchError(\n `${context.response.status} ${context.response.statusText}`\n );\n }\n await hooks.onResponseError?.(context);\n throw context.error;\n }\n };\n try {\n if (this.timeoutDurationMs) {\n this.timeout = setTimeout(() => {\n controller._emitEvent({\n type: \"error\",\n reason: `Timeout of ${this.timeoutDurationMs}ms exceeded`\n });\n }, this.timeoutDurationMs);\n }\n const response = await this.fetch.raw(this.url, finalOptions);\n clearTimeout(this.timeout);\n this.timeout = void 0;\n this.retryCount = 0;\n this.retryInterval = 0;\n const decoder = new TextDecoder();\n let pendingData = \"\";\n const stream = response.body;\n if (!stream) {\n const error = new Error(\n `Expected response body to contain ReadableStream`\n );\n ctx.response = response;\n ctx.error = error;\n await hooks.onResponseError?.(ctx);\n throw error;\n }\n await getBytes(controller, stream, (arr) => {\n const text = pendingData + decoder.decode(arr, { stream: true });\n const result = messageListFromString(text);\n pendingData = result.leftoverData ?? \"\";\n for (const message of result.messages) {\n if (typeof message.id === \"string\" && message.id.length > 0) {\n this.lastEventId = message.id;\n }\n hooks.onMessage(message);\n }\n });\n } catch (err) {\n if (abortSignal.aborted || controller.signal.aborted || isAbortError(err)) {\n return;\n }\n return this._handleRetry(controller, hooks);\n }\n if (controller.signal.aborted || abortSignal.aborted) {\n return;\n }\n if (this.options.retryStrategy === \"on-error\") {\n controller._emitEvent({\n type: \"end-of-stream\",\n reason: \"Stream has ended\"\n });\n return;\n }\n return this._handleRetry(controller, hooks);\n }\n listen(hooks) {\n const controller = new EventSourceController(\n new AbortController(),\n (newHooks) => {\n if (typeof newHooks === \"undefined\") {\n void this._handleConnection(controller, hooks);\n return;\n }\n void this._handleConnection(controller, {\n ...hooks,\n ...newHooks\n });\n }\n );\n void this._handleConnection(controller, hooks);\n return controller;\n }\n}\nfunction isAbortError(input) {\n return input instanceof DOMException && input.name === \"AbortError\";\n}\nclass EventSourceController {\n didAbort = false;\n /**\n * Do not modify. For internal use.\n */\n _abortController;\n _connect;\n constructor(controller, connect) {\n this._abortController = controller ?? new AbortController();\n this._connect = connect;\n }\n abort(reason) {\n this._emitEvent({ type: \"manual\", reason });\n }\n reconnect(hooks) {\n this.didAbort = false;\n this._abortController.abort();\n this._abortController = new AbortController();\n void this._connect?.(hooks);\n }\n _abortHook;\n _emitEvent(e) {\n if (this.didAbort) return;\n this.didAbort = true;\n this._abortHook?.(e);\n this._abortController.abort(e.reason);\n }\n onAbort(fn) {\n this._abortHook = fn;\n }\n get signal() {\n return this._abortController.signal;\n }\n}\nconst HTTP_METHOD_VALS = [\n \"get\",\n \"head\",\n \"post\",\n \"put\",\n \"delete\",\n \"connect\",\n \"options\",\n \"trace\",\n \"patch\"\n];\nasync function _handleResponse(context, hooks) {\n if (typeof hooks.onResponse === \"function\") {\n await hooks.onResponse(context);\n }\n if (!context.response.ok) {\n return;\n }\n const contentType = context.response.headers.get(\"Content-Type\");\n if (typeof contentType !== \"string\" || !contentType.includes(EventStreamContentType)) {\n const error = new Error(\n `Expected server to response with Content-Type: '${EventStreamContentType}'. Got '${contentType}'`\n );\n context.error = error;\n if (typeof hooks.onResponseError === \"function\") {\n await hooks.onResponseError(context);\n }\n throw error;\n }\n}\n\nexport { EventSourceController, EventSourcePlus, EventStreamContentType, HTTP_METHOD_VALS, _handleResponse, getBytes, messageListFromString, parseLine };\n"],"x_google_ignoreList":[0,1,2,3,4],"mappings":";AAAA,IAAM,IAAiB,qIACjB,IAAuB,kKACvB,IAAY;AAClB,SAAS,EAAmB,GAAK,GAAO;CACtC,IAAI,MAAQ,eAAe,MAAQ,iBAAiB,KAAS,OAAO,KAAU,YAAY,eAAe,GAAO;EA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