"use strict";
/* Socket Lib - Built with rolldown */
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const require_primordials_uncurry = require('./uncurry.js');
const require_smol_primordial = require('../smol/primordial.js');

//#region src/primordials/string.ts
/**
* @file Safe references to `String` static methods and prototype methods.
*   `StringPrototypeCharCodeAt` prefers the smol Fast API binding for ASCII
*   inputs (single byte load) and translates the `-1` Fast API sentinel back to
*   `NaN` to preserve spec parity. Two-byte strings fall back to the uncurried
*   `String.prototype.charCodeAt`.
*
*   ## Fast API surface — and why it's small
*
*   Mirrors the design rationale from socket-btm's `primordial_binding.cc`
*   (lines 41-72). The smol Fast API exposes exactly one string op
*   (`stringCharCodeAt`) because that's the one shape where the C++ trampoline
*   genuinely beats V8's existing hot path: a single ASCII byte load, no
*   encoding dispatch, no HandleScope, returns a primitive. String **searches**
*   (`startsWith` / `endsWith` / `includes` / `indexOf` / `lastIndexOf`) are
*   intentionally NOT exposed. V8's existing hot path dispatches on encoding
*   and runs native SIMD memcmp — a Fast API binding would add overhead without
*   winning. Same for `Map.has` / `Set.has` / `Array.includes`. Fast API also
*   has a hard constraint: a fast-path function cannot return a new V8 object —
*   only primitives, Local<Value/Object/Array>, or FastOneByteString. That
*   rules out anything that produces a new string (`slice`, `substring`,
*   `toUpperCase`, `concat`, `repeat`, `padStart`/`padEnd`, formatted-number)
*   from ever being a Fast API win on the return path. Net: the current surface
*   is approximately the ceiling. Adding more Fast API string ops without a
*   flamegraph showing the cost is a regression risk, not a perf win. See
*   `socket-btm/packages/node-smol-builder/additions/source-patched/`
*   `src/socketsecurity/primordial/primordial_binding.cc:41-72` for the
*   canonical design statement.
*/
const _smolPrimordial = /* @__PURE__ */ require_smol_primordial.getSmolPrimordial();
const StringCtor = String;
const StringFromCharCode = String.fromCharCode;
const StringFromCodePoint = String.fromCodePoint;
const StringRaw = String.raw;
const StringPrototypeAt = require_primordials_uncurry.uncurryThis(String.prototype.at);
const StringPrototypeCharAt = require_primordials_uncurry.uncurryThis(String.prototype.charAt);
const _smolCharCodeAt = _smolPrimordial?.stringCharCodeAt;
/* c8 ignore start */
const StringPrototypeCharCodeAt = _smolCharCodeAt ? (s, i) => {
	const code = _smolCharCodeAt(s, i);
	return code === -1 ? NaN : code;
} : require_primordials_uncurry.uncurryThis(String.prototype.charCodeAt);
/* c8 ignore stop */
const StringPrototypeCodePointAt = require_primordials_uncurry.uncurryThis(String.prototype.codePointAt);
const StringPrototypeConcat = require_primordials_uncurry.uncurryThis(String.prototype.concat);
const StringPrototypeEndsWith = require_primordials_uncurry.uncurryThis(String.prototype.endsWith);
const StringPrototypeIncludes = require_primordials_uncurry.uncurryThis(String.prototype.includes);
const StringPrototypeIndexOf = require_primordials_uncurry.uncurryThis(String.prototype.indexOf);
const StringPrototypeIsWellFormed = _smolPrimordial?.stringIsWellFormed ?? require_primordials_uncurry.uncurryThis(String.prototype.isWellFormed);
const StringPrototypeLastIndexOf = require_primordials_uncurry.uncurryThis(String.prototype.lastIndexOf);
const StringPrototypeLocaleCompare = require_primordials_uncurry.uncurryThis(String.prototype.localeCompare);
const StringPrototypeMatch = require_primordials_uncurry.uncurryThis(String.prototype.match);
const StringPrototypeMatchAll = require_primordials_uncurry.uncurryThis(String.prototype.matchAll);
const StringPrototypeNormalize = require_primordials_uncurry.uncurryThis(String.prototype.normalize);
const StringPrototypePadEnd = require_primordials_uncurry.uncurryThis(String.prototype.padEnd);
const StringPrototypePadStart = require_primordials_uncurry.uncurryThis(String.prototype.padStart);
const StringPrototypeRepeat = require_primordials_uncurry.uncurryThis(String.prototype.repeat);
const StringPrototypeReplace = require_primordials_uncurry.uncurryThis(String.prototype.replace);
const StringPrototypeReplaceAll = require_primordials_uncurry.uncurryThis(String.prototype.replaceAll);
const StringPrototypeSearch = require_primordials_uncurry.uncurryThis(String.prototype.search);
const StringPrototypeSlice = require_primordials_uncurry.uncurryThis(String.prototype.slice);
const StringPrototypeSplit = require_primordials_uncurry.uncurryThis(String.prototype.split);
const StringPrototypeStartsWith = require_primordials_uncurry.uncurryThis(String.prototype.startsWith);
const StringPrototypeSubstring = require_primordials_uncurry.uncurryThis(String.prototype.substring);
const StringPrototypeToLocaleLowerCase = require_primordials_uncurry.uncurryThis(String.prototype.toLocaleLowerCase);
const StringPrototypeToLocaleUpperCase = require_primordials_uncurry.uncurryThis(String.prototype.toLocaleUpperCase);
const StringPrototypeToLowerCase = require_primordials_uncurry.uncurryThis(String.prototype.toLowerCase);
const StringPrototypeToString = require_primordials_uncurry.uncurryThis(String.prototype.toString);
const StringPrototypeToUpperCase = require_primordials_uncurry.uncurryThis(String.prototype.toUpperCase);
const StringPrototypeToWellFormed = require_primordials_uncurry.uncurryThis(String.prototype.toWellFormed);
const StringPrototypeTrim = require_primordials_uncurry.uncurryThis(String.prototype.trim);
const StringPrototypeTrimEnd = require_primordials_uncurry.uncurryThis(String.prototype.trimEnd);
const StringPrototypeTrimStart = require_primordials_uncurry.uncurryThis(String.prototype.trimStart);
const StringPrototypeValueOf = require_primordials_uncurry.uncurryThis(String.prototype.valueOf);

//#endregion
exports.StringCtor = StringCtor;
exports.StringFromCharCode = StringFromCharCode;
exports.StringFromCodePoint = StringFromCodePoint;
exports.StringPrototypeAt = StringPrototypeAt;
exports.StringPrototypeCharAt = StringPrototypeCharAt;
exports.StringPrototypeCharCodeAt = StringPrototypeCharCodeAt;
exports.StringPrototypeCodePointAt = StringPrototypeCodePointAt;
exports.StringPrototypeConcat = StringPrototypeConcat;
exports.StringPrototypeEndsWith = StringPrototypeEndsWith;
exports.StringPrototypeIncludes = StringPrototypeIncludes;
exports.StringPrototypeIndexOf = StringPrototypeIndexOf;
exports.StringPrototypeIsWellFormed = StringPrototypeIsWellFormed;
exports.StringPrototypeLastIndexOf = StringPrototypeLastIndexOf;
exports.StringPrototypeLocaleCompare = StringPrototypeLocaleCompare;
exports.StringPrototypeMatch = StringPrototypeMatch;
exports.StringPrototypeMatchAll = StringPrototypeMatchAll;
exports.StringPrototypeNormalize = StringPrototypeNormalize;
exports.StringPrototypePadEnd = StringPrototypePadEnd;
exports.StringPrototypePadStart = StringPrototypePadStart;
exports.StringPrototypeRepeat = StringPrototypeRepeat;
exports.StringPrototypeReplace = StringPrototypeReplace;
exports.StringPrototypeReplaceAll = StringPrototypeReplaceAll;
exports.StringPrototypeSearch = StringPrototypeSearch;
exports.StringPrototypeSlice = StringPrototypeSlice;
exports.StringPrototypeSplit = StringPrototypeSplit;
exports.StringPrototypeStartsWith = StringPrototypeStartsWith;
exports.StringPrototypeSubstring = StringPrototypeSubstring;
exports.StringPrototypeToLocaleLowerCase = StringPrototypeToLocaleLowerCase;
exports.StringPrototypeToLocaleUpperCase = StringPrototypeToLocaleUpperCase;
exports.StringPrototypeToLowerCase = StringPrototypeToLowerCase;
exports.StringPrototypeToString = StringPrototypeToString;
exports.StringPrototypeToUpperCase = StringPrototypeToUpperCase;
exports.StringPrototypeToWellFormed = StringPrototypeToWellFormed;
exports.StringPrototypeTrim = StringPrototypeTrim;
exports.StringPrototypeTrimEnd = StringPrototypeTrimEnd;
exports.StringPrototypeTrimStart = StringPrototypeTrimStart;
exports.StringPrototypeValueOf = StringPrototypeValueOf;
exports.StringRaw = StringRaw;