@orieljs/framework 0.1.0-alpha.4 → 0.1.0-alpha.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.
- package/dist/{chunk-3DETYZMZ.js → chunk-A5XRLEWM.js} +3 -3
- package/dist/{chunk-WSGWYXAO.js → chunk-BSQKOLSK.js} +3 -1
- package/dist/chunk-BSQKOLSK.js.map +1 -0
- package/dist/{chunk-DCI2T7WJ.js → chunk-PM5YTG57.js} +117 -3
- package/dist/chunk-PM5YTG57.js.map +1 -0
- package/dist/{chunk-SBZQ6L3Z.js → chunk-WNJP46B7.js} +563 -73
- package/dist/chunk-WNJP46B7.js.map +1 -0
- package/dist/contracts.d.ts +43 -1
- package/dist/contracts.js +3 -1
- package/dist/index.d.ts +391 -52
- package/dist/index.js +610 -144
- package/dist/index.js.map +1 -1
- package/dist/jsx-runtime.js +3 -3
- package/dist/{testing-D3dCOkTm.d.ts → testing-BErengYY.d.ts} +89 -12
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +3 -3
- package/package.json +30 -30
- package/dist/chunk-DCI2T7WJ.js.map +0 -1
- package/dist/chunk-SBZQ6L3Z.js.map +0 -1
- package/dist/chunk-WSGWYXAO.js.map +0 -1
- /package/dist/{chunk-3DETYZMZ.js.map → chunk-A5XRLEWM.js.map} +0 -0
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
Str,
|
|
4
4
|
facade,
|
|
5
5
|
inject
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-PM5YTG57.js";
|
|
7
7
|
import {
|
|
8
8
|
ConfigRepository,
|
|
9
9
|
Session,
|
|
10
10
|
ViewFactory
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-BSQKOLSK.js";
|
|
12
12
|
|
|
13
13
|
// ../View/dist/chunk-KIU7OKDI.js
|
|
14
14
|
var ELEMENT = /* @__PURE__ */ Symbol.for("oriel:view.element");
|
|
@@ -475,4 +475,4 @@ export {
|
|
|
475
475
|
View,
|
|
476
476
|
ViewServiceProvider
|
|
477
477
|
};
|
|
478
|
-
//# sourceMappingURL=chunk-
|
|
478
|
+
//# sourceMappingURL=chunk-A5XRLEWM.js.map
|
|
@@ -26,6 +26,7 @@ var Hasher = token("Hashing.Hasher");
|
|
|
26
26
|
var ViewFactory = token("View.Factory");
|
|
27
27
|
var LogManager = token("Log.Manager");
|
|
28
28
|
var DatabaseManager = token("Database.Manager");
|
|
29
|
+
var PaginationState = token("Database.PaginationState");
|
|
29
30
|
var ValidationFactory = token("Validation.Factory");
|
|
30
31
|
var AuthFactory = token("Auth.Factory");
|
|
31
32
|
var Gate = token("Auth.Gate");
|
|
@@ -72,6 +73,7 @@ export {
|
|
|
72
73
|
ViewFactory,
|
|
73
74
|
LogManager,
|
|
74
75
|
DatabaseManager,
|
|
76
|
+
PaginationState,
|
|
75
77
|
ValidationFactory,
|
|
76
78
|
AuthFactory,
|
|
77
79
|
Gate,
|
|
@@ -92,4 +94,4 @@ export {
|
|
|
92
94
|
InertiaFactory,
|
|
93
95
|
LiveManager
|
|
94
96
|
};
|
|
95
|
-
//# sourceMappingURL=chunk-
|
|
97
|
+
//# sourceMappingURL=chunk-BSQKOLSK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../Contracts/Container.ts","../../Contracts/Foundation.ts","../../Contracts/Config.ts","../../Contracts/Support.ts","../../Contracts/Pipeline.ts","../../Contracts/Http.ts","../../Contracts/Routing.ts","../../Contracts/Session.ts","../../Contracts/Cookie.ts","../../Contracts/Encryption.ts","../../Contracts/Hashing.ts","../../Contracts/View.ts","../../Contracts/Log.ts","../../Contracts/Database.ts","../../Contracts/Validation.ts","../../Contracts/Auth.ts","../../Contracts/Queue.ts","../../Contracts/Bus.ts","../../Contracts/Console.ts","../../Contracts/Mail.ts","../../Contracts/Notifications.ts","../../Contracts/Cache.ts","../../Contracts/Events.ts","../../Contracts/Filesystem.ts","../../Contracts/Inertia.ts","../../Contracts/Live.ts"],"sourcesContent":["/** A typed, runtime-unique key for container bindings. */\nexport interface Token<T> {\n readonly id: symbol\n readonly description: string\n /** Phantom field: only carries T at the type level. Never set at runtime. */\n readonly __type?: T\n}\n\nexport function token<T>(description: string): Token<T> {\n return Object.freeze({ id: Symbol.for(`oriel:${description}`), description })\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type Class<T> = abstract new (...args: any[]) => T\nexport type Abstract<T> = Token<T> | Class<T>\nexport type Factory<T> = (container: Container) => T\nexport type Concrete<T> = Factory<T> | (new () => T)\n\nexport interface Container {\n /** New instance on every make(). A class with no concrete binds to itself (constructed with no args). Root only; throws on a scope. */\n bind<T>(abstract: Abstract<T>, concrete?: Concrete<T>): void\n /** One instance for the life of this container and its scopes. Root only; throws on a scope. */\n singleton<T>(abstract: Abstract<T>, concrete?: Concrete<T>): void\n /** One instance per scope (e.g. per HTTP request or queue job). Root only; throws on a scope. */\n scoped<T>(abstract: Abstract<T>, concrete?: Concrete<T>): void\n /** Register an existing object as a shared instance. Returns it. On a scope it stays local to that scope. */\n instance<T>(abstract: Abstract<T>, instance: T): T\n /** Resolve. Unbound classes are constructed with `new Class()`. Unbound tokens throw BindingResolutionError. */\n make<T>(abstract: Abstract<T>): T\n bound(abstract: Abstract<unknown>): boolean\n resolved(abstract: Abstract<unknown>): boolean\n /** Decorate or replace an instance each time it's resolved (applied before resolving callbacks). Root only; throws on a scope. */\n extend<T>(abstract: Abstract<T>, extender: (instance: T, container: Container) => T): void\n /** Called after each resolution of the abstract. Root only; throws on a scope. */\n resolving<T>(abstract: Abstract<T>, callback: (instance: T, container: Container) => void): void\n forgetInstance(abstract: Abstract<unknown>): void\n /** A child container: shares bindings and singletons with its parent, and has its own scoped instances. Bindings can't be registered on it. */\n createScope(): Container\n /** Run fn with this container as the \"current\" one for inject(), helpers and facades (AsyncLocalStorage). */\n run<R>(fn: () => R): R\n}\nexport const Container = token<Container>('Container.Container')\n","import { token, type Container } from './Container'\nimport type { HttpRequest } from './Http'\n\nexport interface ServiceProvider {\n /** Bind things into the container. Synchronous. Don't resolve other services here. */\n register?(): void\n /** Runs after every provider is registered. May be async (e.g. importing route files). */\n boot?(): void | Promise<void>\n}\nexport type ServiceProviderClass = new (app: Application) => ServiceProvider\n\nexport interface Application extends Container {\n readonly version: string\n basePath(path?: string): string\n appPath(path?: string): string\n bootstrapPath(path?: string): string\n configPath(path?: string): string\n databasePath(path?: string): string\n publicPath(path?: string): string\n resourcePath(path?: string): string\n storagePath(path?: string): string\n /** With no args returns the environment name. With args returns whether it matches any of them. */\n environment(): string\n environment(...environments: string[]): boolean\n isProduction(): boolean\n isLocal(): boolean\n runningInConsole(): boolean\n /** Mark the app as running in the console (the CLI entry point calls this). Defaults to true. */\n setRunningInConsole(value?: boolean): void\n runningUnitTests(): boolean\n /** Registers the provider. If the app is already booted, the provider is booted immediately. */\n register(provider: ServiceProvider | ServiceProviderClass): Promise<ServiceProvider>\n getProviders(): ServiceProvider[]\n boot(): Promise<void>\n isBooted(): boolean\n booting(callback: (app: Application) => void | Promise<void>): void\n booted(callback: (app: Application) => void | Promise<void>): void\n /** Handle one HTTP request in a fresh request scope via the bound HttpKernel. */\n handle(request: Request): Promise<Response>\n /** Register a callback that terminate() runs, in registration order. */\n terminating(callback: () => void | Promise<void>): void\n terminate(): Promise<void>\n}\nexport const Application = token<Application>('Foundation.Application')\n\nexport interface ExceptionHandler {\n report(error: unknown): Promise<void>\n shouldReport(error: unknown): boolean\n /** `request` is the scoped HttpRequest (Contracts/Http) when available, else the raw Request. */\n render(request: unknown, error: unknown): Promise<Response>\n}\nexport const ExceptionHandler = token<ExceptionHandler>('Foundation.ExceptionHandler')\n\n/** Paths passed to Application.configure().withRouting(). Routing (Wave 1) loads them. */\nexport interface RoutingPaths {\n /** One route file or several, loaded in order (Laravel's `withRouting(web: [...])`). */\n web?: string | string[]\n api?: string | string[]\n console?: string\n health?: string\n apiPrefix: string\n}\nexport const RoutingPaths = token<RoutingPaths>('Foundation.RoutingPaths')\n\n/** The object passed to Application.configure().withExceptions(e => …), like Laravel's Exceptions class. */\nexport interface ExceptionsConfigurator {\n /** Custom reporting. Return false to stop the default logging. */\n report(callback: (error: unknown) => void | boolean | Promise<void | boolean>): this\n /** Custom rendering. Return undefined to fall through to the default rendering. */\n render(callback: (error: unknown, request: unknown) => Response | undefined | Promise<Response | undefined>): this\n /** Never report errors of these classes. */\n dontReport(...classes: Array<abstract new (...args: never[]) => Error>): this\n /** Render errors as JSON when the callback returns true, whatever the Accept header. */\n shouldRenderJsonWhen(callback: (request: HttpRequest, error: unknown) => boolean): this\n}\n\n/** Callbacks collected by withMiddleware()/withExceptions(); invoked by Http / the exception handler (Wave 1). */\nexport type ConfigCallbacks<T> = Array<(configurator: T) => void>\n/** Typed as unknown here because MiddlewareConfigurator lives in Contracts/Http; Http casts on use. */\nexport const MiddlewareCallbacks = token<ConfigCallbacks<unknown>>('Foundation.MiddlewareCallbacks')\nexport const ExceptionCallbacks = token<ConfigCallbacks<ExceptionsConfigurator>>('Foundation.ExceptionCallbacks')\n","import { token } from './Container'\n\nexport interface ConfigRepository {\n has(key: string): boolean\n /** Dot notation: get('database.connections.sqlite.database'). */\n get<T = unknown>(key: string, defaultValue?: T): T\n set(key: string, value: unknown): void\n set(values: Record<string, unknown>): void\n push(key: string, value: unknown): void\n all(): Record<string, unknown>\n}\nexport const ConfigRepository = token<ConfigRepository>('Config.Repository')\n","import { token, type Class } from './Container'\n\nexport interface Arrayable<T = unknown> {\n toArray(): T\n}\nexport interface Jsonable {\n toJson(): string\n}\nexport interface Htmlable {\n toHtml(): string\n}\n/** Anything a controller can return that knows how to become a Response. */\nexport interface Responsable {\n toResponse(request: unknown): Response | Promise<Response>\n}\n/** The minimal collection surface contracts rely on (implemented by @orieljs/collections). */\nexport interface Enumerable<T> extends Iterable<T>, Arrayable<unknown[]> {\n all(): T[]\n count(): number\n isEmpty(): boolean\n}\n\nexport interface ClassRegistry {\n /** Registers under `name` (default: cls.name). Throws if the name is already taken by a different class. */\n register(cls: Class<unknown>, name?: string): string\n nameOf(cls: Class<unknown>): string | undefined\n resolve<T = unknown>(name: string): Class<T>\n has(name: string): boolean\n}\nexport const ClassRegistry = token<ClassRegistry>('Support.ClassRegistry')\n","import { token, type Class } from './Container'\n\nexport type PipeNext<T> = (passable: T) => Promise<unknown>\nexport type PipeClosure<T> = (passable: T, next: PipeNext<T>) => Promise<unknown> | unknown\n/** A class resolved from the container whose `via` method (default 'handle') is called; or a string alias 'name:param1,param2'. */\nexport type Pipe<T> = PipeClosure<T> | Class<object> | string\n\nexport interface Pipeline<T = unknown> {\n send(passable: T): this\n through(pipes: ReadonlyArray<Pipe<T>>): this\n pipe(...pipes: Array<Pipe<T>>): this\n /** Method called on class pipes. Default 'handle'. */\n via(method: string): this\n then<R>(destination: (passable: T) => R | Promise<R>): Promise<R>\n thenReturn(): Promise<T>\n}\n\nexport interface PipelineFactory {\n make<T>(): Pipeline<T>\n}\nexport const PipelineFactory = token<PipelineFactory>('Pipeline.Factory')\n","import { token } from './Container'\nimport type { Session } from './Session'\nimport type { Rules } from './Validation'\n\n/** Web-standard body/headers init types, derived from the runtime's global Response/Headers (no DOM lib needed). */\nexport type BodyInit = ConstructorParameters<typeof Response>[0]\nexport type HeadersInit = ConstructorParameters<typeof Headers>[0]\n\nexport interface UploadedFile {\n readonly clientName: string\n readonly mimeType: string\n readonly size: number\n extension(): string\n arrayBuffer(): Promise<ArrayBuffer>\n /** Stores on a Filesystem disk. Returns the stored path. */\n store(directory: string, disk?: string): Promise<string>\n storeAs(directory: string, name: string, disk?: string): Promise<string>\n}\n\n/**\n * Oriel's request wrapper (one per request, scoped).\n * The Http kernel awaits `load()` before any middleware runs, so every input accessor below is synchronous.\n */\nexport interface HttpRequest {\n readonly raw: Request\n load(): Promise<this>\n method(): string\n isMethod(method: string): boolean\n url(): string\n fullUrl(): string\n path(): string\n is(...patterns: string[]): boolean\n routeIs(...names: string[]): boolean\n header(name: string): string | undefined\n header(name: string, defaultValue: string): string\n bearerToken(): string | undefined\n ip(): string | undefined\n /** The raw body as text (Laravel's getContent()); '' when there is none. */\n content(): string\n expectsJson(): boolean\n ajax(): boolean\n query<T = unknown>(key?: string, defaultValue?: T): T\n input<T = unknown>(key?: string, defaultValue?: T): T\n all(): Record<string, unknown>\n only(...keys: string[]): Record<string, unknown>\n except(...keys: string[]): Record<string, unknown>\n has(...keys: string[]): boolean\n filled(key: string): boolean\n boolean(key: string, defaultValue?: boolean): boolean\n integer(key: string, defaultValue?: number): number\n merge(values: Record<string, unknown>): this\n file(key: string): UploadedFile | undefined\n cookie(name: string): string | undefined\n /** Replace the parsed request cookies (EncryptCookies calls this after decrypting). */\n setCookies(cookies: Record<string, string>): void\n /** Route parameter (after model binding), or every parameter when called with no key. */\n route<T = unknown>(key?: string): T\n session(): Session\n /** The user resolved earlier by auth middleware. Undefined for guests. Use `await Auth.user()` to resolve lazily. */\n user<T = unknown>(guard?: string): T | undefined\n setUserResolver(resolver: (guard?: string) => unknown): void\n /** Validates this request's input via the ValidationFactory; throws a Validation OrielError (422) on failure. */\n validate<T = Record<string, unknown>>(\n rules: Rules,\n messages?: Record<string, string>,\n attributes?: Record<string, string>,\n ): Promise<T>\n}\nexport const HttpRequest = token<HttpRequest>('Http.Request')\n\nexport type Next = (request: HttpRequest) => Promise<Response>\nexport interface Middleware {\n handle(request: HttpRequest, next: Next, ...parameters: string[]): Promise<Response>\n terminate?(request: HttpRequest, response: Response): Promise<void>\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type MiddlewareClass = new (...args: any[]) => Middleware\n\n/** The object passed to Application.configure().withMiddleware(m => …), like Laravel's Middleware class. */\nexport interface MiddlewareConfigurator {\n append(...middleware: MiddlewareClass[]): this\n prepend(...middleware: MiddlewareClass[]): this\n web(options: { append?: MiddlewareClass[]; prepend?: MiddlewareClass[]; remove?: MiddlewareClass[] }): this\n api(options: { append?: MiddlewareClass[]; prepend?: MiddlewareClass[]; remove?: MiddlewareClass[] }): this\n alias(aliases: Record<string, MiddlewareClass>): this\n group(name: string, middleware: Array<MiddlewareClass | string>): this\n validateCsrfTokens(options: { except: string[] }): this\n redirectGuestsTo(url: string | ((request: HttpRequest) => string)): this\n}\n\nexport interface HttpKernel {\n handle(request: Request): Promise<Response>\n terminate?(request: Request, response: Response): Promise<void>\n}\nexport const HttpKernel = token<HttpKernel>('Http.Kernel')\n\nexport interface ResponseFactory {\n make(content?: BodyInit | null, status?: number, headers?: HeadersInit): Response\n json(data: unknown, status?: number, headers?: HeadersInit): Response\n noContent(status?: number): Response\n download(path: string, name?: string, headers?: HeadersInit): Promise<Response>\n stream(body: ReadableStream, status?: number, headers?: HeadersInit): Response\n}\nexport const ResponseFactory = token<ResponseFactory>('Http.ResponseFactory')\n","import { token, type Class } from './Container'\nimport type { Responsable } from './Support'\nimport type { HttpRequest, Middleware, MiddlewareClass } from './Http'\n\n/** Public method names of a controller (excludes non-function members). */\nexport type ActionMethods<C> = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [K in keyof C]: C[K] extends (...args: any[]) => unknown ? K : never\n}[keyof C] &\n string\n\nexport type ControllerAction<C> = readonly [Class<C>, ActionMethods<C>]\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type RouteClosure = (...args: any[]) => unknown\n/** A class with __invoke(): Route.get('/counter', Counter) (single-action controllers, full-page Live components). */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type InvokableClass = Class<{ __invoke(...args: any[]): unknown }>\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type RouteAction = RouteClosure | ControllerAction<any> | InvokableClass\nexport type MiddlewareReference = string | MiddlewareClass\n\nexport interface Route {\n readonly methods: readonly string[]\n readonly uri: string\n getName(): string | undefined\n name(name: string): this\n middleware(...middleware: Array<MiddlewareReference | readonly MiddlewareReference[]>): this\n withoutMiddleware(...middleware: MiddlewareReference[]): this\n where(parameter: string, pattern: string): this\n where(patterns: Record<string, string>): this\n}\n\nexport interface RouteRegistrar {\n prefix(prefix: string): RouteRegistrar\n name(prefix: string): RouteRegistrar\n middleware(...middleware: Array<MiddlewareReference | readonly MiddlewareReference[]>): RouteRegistrar\n controller(controller: Class<unknown>): RouteRegistrar\n group(routes: () => void | Promise<void>): Promise<void>\n}\n\nexport interface ResourceOptions {\n only?: string[]\n except?: string[]\n parameters?: Record<string, string>\n names?: Record<string, string>\n}\n\nexport interface Router {\n get<C>(uri: string, action: ControllerAction<C> | RouteClosure | InvokableClass | string): Route\n post<C>(uri: string, action: ControllerAction<C> | RouteClosure | InvokableClass | string): Route\n put<C>(uri: string, action: ControllerAction<C> | RouteClosure | InvokableClass | string): Route\n patch<C>(uri: string, action: ControllerAction<C> | RouteClosure | InvokableClass | string): Route\n delete<C>(uri: string, action: ControllerAction<C> | RouteClosure | InvokableClass | string): Route\n options<C>(uri: string, action: ControllerAction<C> | RouteClosure | InvokableClass | string): Route\n any<C>(uri: string, action: ControllerAction<C> | RouteClosure | InvokableClass | string): Route\n match<C>(methods: string[], uri: string, action: ControllerAction<C> | RouteClosure | InvokableClass | string): Route\n redirect(from: string, to: string, status?: number): Route\n view(uri: string, view: string, data?: Record<string, unknown>): Route\n /** Route.inertia('/about', 'About', props): a GET route that renders an Inertia page (Laravel's Route::inertia). */\n inertia(uri: string, component: string, props?: Record<string, unknown>): Route\n resource(name: string, controller: Class<unknown>, options?: ResourceOptions): void\n apiResource(name: string, controller: Class<unknown>, options?: ResourceOptions): void\n fallback(action: RouteAction): Route\n prefix(prefix: string): RouteRegistrar\n name(prefix: string): RouteRegistrar\n middleware(...middleware: Array<MiddlewareReference | readonly MiddlewareReference[]>): RouteRegistrar\n controller(controller: Class<unknown>): RouteRegistrar\n /** Explicit model binding: Route.model('author', User). */\n model(parameter: string, model: Class<unknown>): void\n /** Custom binding resolver. */\n bind(parameter: string, resolver: (value: string) => unknown | Promise<unknown>): void\n pattern(parameter: string, pattern: string): void\n /** Name a middleware class, e.g. aliasMiddleware('auth', Authenticate). */\n aliasMiddleware(name: string, middleware: MiddlewareClass): this\n /** Define (or replace) a middleware group such as 'web' or 'api'. */\n middlewareGroup(name: string, middleware: MiddlewareReference[]): this\n /** Append to a group unless it is already present. */\n pushMiddlewareToGroup(group: string, middleware: MiddlewareReference): this\n getMiddlewareGroups(): Record<string, MiddlewareReference[]>\n getRoutes(): readonly Route[]\n current(): Route | undefined\n /** Match the request, bind parameters, run the route middleware and the action. Called by the Http kernel. */\n dispatch(request: HttpRequest): Promise<Response>\n}\n\n/** The route matched for the current request (scope-local; set by the router before route middleware runs). */\nexport interface CurrentRoute {\n readonly route: Route\n /** Route parameters after model binding, in URI order. */\n readonly parameters: Record<string, unknown>\n /** Resolved route middleware instances, for HttpKernel.terminate(). */\n readonly middleware: Middleware[]\n}\nexport const CurrentRoute = token<CurrentRoute>('Routing.CurrentRoute')\nexport const Router = token<Router>('Routing.Router')\n\n/**\n * Resolves implicit route-model bindings by naming convention ({post} → Post).\n * Bound by Database (Wave 1) so that Routing never imports Database.\n * Returns undefined when no model matches the parameter name. Throws ModelNotFound when the model exists but the row doesn't.\n */\nexport interface RouteModelResolver {\n resolve(parameter: string, value: string, field?: string): Promise<unknown | undefined>\n resolveExplicit(model: Class<unknown>, value: string, field?: string): Promise<unknown>\n}\nexport const RouteModelResolver = token<RouteModelResolver>('Routing.ModelResolver')\n\n/**\n * Route name → parameters, for the typed route() and redirect().route() helpers. Empty until `oriel route:types`\n * augments it (types/routes.d.ts); while it is empty any string is accepted. The contracts themselves keep taking\n * strings: the framework builds route names at run time.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface RouteList {}\n\n/** A route name: the generated ones, or any string before `oriel route:types` has run. */\nexport type RouteName = [keyof RouteList] extends [never] ? string : Extract<keyof RouteList, string>\n\nexport interface UrlGenerator {\n to(path: string, query?: Record<string, unknown>, absolute?: boolean): string\n route(name: string, parameters?: unknown, absolute?: boolean): string\n asset(path: string): string\n current(): string\n previous(fallback?: string): string\n hasRoute(name: string): boolean\n /** A URL to a named route with a `signature` query (HMAC-SHA256 keyed by APP_KEY); `expiration` adds `expires`. */\n signedRoute(name: string, parameters?: unknown, expiration?: Date | number, absolute?: boolean): string\n /** signedRoute() that expires: a Date, or seconds from now. */\n temporarySignedRoute(name: string, expiration: Date | number, parameters?: unknown, absolute?: boolean): string\n /** Whether the request URL carries a valid, unexpired signature (`absolute: false` signs the path only). */\n hasValidSignature(request: HttpRequest, absolute?: boolean): boolean\n}\nexport const UrlGenerator = token<UrlGenerator>('Routing.UrlGenerator')\n\nexport interface RedirectResponse extends Responsable {\n readonly targetUrl: string\n with(key: string | Record<string, unknown>, value?: unknown): this\n withErrors(errors: Record<string, string | string[]>, bag?: string): this\n withInput(input?: Record<string, unknown>): this\n withCookie(name: string, value: string, minutes?: number): this\n}\n\nexport interface Redirector {\n to(path: string, status?: number): RedirectResponse\n route(name: string, parameters?: unknown, status?: number): RedirectResponse\n back(fallback?: string, status?: number): RedirectResponse\n intended(fallback?: string): RedirectResponse\n away(url: string, status?: number): RedirectResponse\n}\nexport const Redirector = token<Redirector>('Routing.Redirector')\n","import { token } from './Container'\n\n/** The session of the current request (scoped). Loaded and saved by the StartSession middleware. */\nexport interface Session {\n getId(): string\n start(): Promise<void>\n save(): Promise<void>\n all(): Record<string, unknown>\n has(key: string): boolean\n get<T = unknown>(key: string, defaultValue?: T): T\n put(key: string | Record<string, unknown>, value?: unknown): void\n push(key: string, value: unknown): void\n pull<T = unknown>(key: string, defaultValue?: T): T\n forget(...keys: string[]): void\n flush(): void\n flash(key: string, value: unknown): void\n now(key: string, value: unknown): void\n reflash(): void\n keep(...keys: string[]): void\n getOldInput<T = unknown>(key?: string, defaultValue?: T): T\n flashInput(input: Record<string, unknown>): void\n token(): string\n regenerateToken(): void\n regenerate(destroy?: boolean): Promise<void>\n invalidate(): Promise<void>\n previousUrl(): string | undefined\n setPreviousUrl(url: string): void\n}\nexport const Session = token<Session>('Session.Store')\n\n/** Storage driver (file, cookie, database, redis). */\nexport interface SessionHandler {\n read(id: string): Promise<string>\n write(id: string, data: string): Promise<void>\n destroy(id: string): Promise<void>\n gc(maxLifetimeSeconds: number): Promise<void>\n}\n","import { token } from './Container'\n\nexport interface Cookie {\n name: string\n value: string\n /** Minutes until expiry. 0 = session cookie, negative = delete. */\n minutes: number\n path: string\n domain?: string\n secure: boolean\n httpOnly: boolean\n sameSite: 'lax' | 'strict' | 'none'\n}\n\nexport interface CookieJar {\n make(name: string, value: string, minutes?: number, options?: Partial<Omit<Cookie, 'name' | 'value' | 'minutes'>>): Cookie\n forever(name: string, value: string): Cookie\n forget(name: string): Cookie\n /** Queue a cookie to attach to the outgoing response (scoped per request). */\n queue(cookie: Cookie): void\n queued(): Cookie[]\n}\nexport const CookieJar = token<CookieJar>('Cookie.Jar')\n","import { token } from './Container'\n\nexport interface Encrypter {\n /** JSON-serializes unless serialize=false (then value must be a string). AES-256-GCM, keyed by APP_KEY. */\n encrypt(value: unknown, serialize?: boolean): string\n decrypt<T = unknown>(payload: string, unserialize?: boolean): T\n encryptString(value: string): string\n decryptString(payload: string): string\n getKey(): Uint8Array\n}\nexport const Encrypter = token<Encrypter>('Encryption.Encrypter')\n","import { token } from './Container'\n\nexport interface Hasher {\n make(value: string): Promise<string>\n check(value: string, hashed: string): Promise<boolean>\n needsRehash(hashed: string): boolean\n info(hashed: string): { algorithm: string; options: Record<string, unknown> }\n}\nexport const Hasher = token<Hasher>('Hashing.Hasher')\n","import { token } from './Container'\nimport type { Htmlable } from './Support'\n\nexport interface View extends Htmlable {\n readonly name: string\n with(key: string | Record<string, unknown>, value?: unknown): this\n render(): Promise<string>\n}\n\n/** Resolves 'posts.index' → resources/views/posts/index.tsx and renders it to HTML on the server. */\nexport interface ViewFactory {\n make(name: string, data?: Record<string, unknown>): View\n exists(name: string): boolean\n share(key: string | Record<string, unknown>, value?: unknown): void\n composer(views: string | string[], composer: (view: View) => void | Promise<void>): void\n /** Renders TSX (an element, a string, an Htmlable, a View, promises of them) to HTML, like Blade::render(). */\n renderToString(node: unknown): Promise<string>\n}\nexport const ViewFactory = token<ViewFactory>('View.Factory')\n","import { token } from './Container'\n\nexport type LogLevel = 'emergency' | 'alert' | 'critical' | 'error' | 'warning' | 'notice' | 'info' | 'debug'\n\nexport interface Logger {\n log(level: LogLevel, message: string, context?: Record<string, unknown>): void\n emergency(message: string, context?: Record<string, unknown>): void\n alert(message: string, context?: Record<string, unknown>): void\n critical(message: string, context?: Record<string, unknown>): void\n error(message: string, context?: Record<string, unknown>): void\n warning(message: string, context?: Record<string, unknown>): void\n notice(message: string, context?: Record<string, unknown>): void\n info(message: string, context?: Record<string, unknown>): void\n debug(message: string, context?: Record<string, unknown>): void\n /** Adds context to every later log entry in the current scope (request or job). */\n withContext(context: Record<string, unknown>): this\n}\n\nexport interface LogManager extends Logger {\n channel(name?: string): Logger\n stack(channels: string[]): Logger\n}\nexport const LogManager = token<LogManager>('Log.Manager')\n","import { token } from './Container'\nimport type { Enumerable } from './Support'\n\nexport type Operator = '=' | '!=' | '<>' | '<' | '<=' | '>' | '>=' | 'like' | 'not like' | 'ilike' | 'in' | 'not in'\nexport type Row = Record<string, unknown>\n\n/** The minimal query surface other components rely on (Queue, Cache, Session, Validation, Notifications). */\nexport interface QueryBuilder<T = Row> {\n select(...columns: string[]): this\n where(column: string, value: unknown): this\n where(column: string, operator: Operator, value: unknown): this\n where(conditions: Row): this\n orWhere(column: string, value: unknown): this\n orWhere(column: string, operator: Operator, value: unknown): this\n whereIn(column: string, values: readonly unknown[]): this\n whereNotIn(column: string, values: readonly unknown[]): this\n whereNull(column: string): this\n whereNotNull(column: string): this\n orderBy(column: string, direction?: 'asc' | 'desc'): this\n limit(count: number): this\n offset(count: number): this\n lockForUpdate(): this\n get(): Promise<Enumerable<T>>\n first(): Promise<T | undefined>\n find(id: unknown): Promise<T | undefined>\n value<V = unknown>(column: string): Promise<V | undefined>\n pluck<V = unknown>(column: string): Promise<Enumerable<V>>\n count(): Promise<number>\n exists(): Promise<boolean>\n insert(values: Row | Row[]): Promise<void>\n /**\n * Inserts rows, skipping any that violate a unique key instead of failing (Laravel's insertOrIgnore). Returns the\n * number of rows inserted. Nothing is thrown for a duplicate, so a caller's transaction stays usable on Postgres.\n */\n insertOrIgnore(values: Row | Row[]): Promise<number>\n insertGetId(values: Row, keyName?: string): Promise<number | string>\n update(values: Row): Promise<number>\n upsert(values: Row | Row[], uniqueBy: string[], update?: string[]): Promise<number>\n increment(column: string, amount?: number, extra?: Row): Promise<number>\n decrement(column: string, amount?: number, extra?: Row): Promise<number>\n delete(): Promise<number>\n}\n\nexport type DriverName = 'pgsql' | 'mysql' | 'sqlite'\n\nexport interface DatabaseConnection {\n getName(): string\n getDriverName(): DriverName\n table<T = Row>(table: string): QueryBuilder<T>\n select<T = Row>(sql: string, bindings?: readonly unknown[]): Promise<T[]>\n statement(sql: string, bindings?: readonly unknown[]): Promise<void>\n /** Nested calls use savepoints. Rolls back if fn throws. */\n transaction<R>(fn: (connection: DatabaseConnection) => Promise<R>): Promise<R>\n /**\n * Start a transaction that stays open, for every caller of this connection, until commit()/rollBack().\n * Nested calls use savepoints. Meant for test isolation (RefreshDatabase); app code uses transaction(fn).\n */\n beginTransaction(): Promise<void>\n commit(): Promise<void>\n /** Rolls back the innermost level opened by beginTransaction(). Does nothing when none is open. */\n rollBack(): Promise<void>\n /** 0 outside a transaction. */\n transactionLevel(): number\n}\n\nexport interface DatabaseManager extends DatabaseConnection {\n connection(name?: string): DatabaseConnection\n disconnect(name?: string): Promise<void>\n}\nexport const DatabaseManager = token<DatabaseManager>('Database.Manager')\n\n/** What non-Database components may rely on from a model instance. */\nexport interface ModelInstance {\n exists: boolean\n getKey(): unknown\n getKeyName(): string\n getTable(): string\n getRouteKey(): unknown\n getRouteKeyName(): string\n /** The value stored in a polymorphic `*_type` column for this model: its morph map alias, else its class name. */\n getMorphClass(): string\n getAttribute<T = unknown>(key: string): T\n setAttribute(key: string, value: unknown): this\n fill(attributes: Row): this\n save(): Promise<boolean>\n delete(): Promise<boolean>\n refresh(): Promise<this>\n toArray(): Row\n toJSON(): Row\n}\n\nexport interface ModelStatic<M extends ModelInstance = ModelInstance> {\n new (): M\n query(): QueryBuilder<M>\n find(id: unknown): Promise<M | undefined>\n findOrFail(id: unknown): Promise<M>\n}\n\n/**\n * What decides a paginator's page and the path of its links when the request doesn't (Laravel's\n * Paginator::currentPageResolver and currentPathResolver, which Livewire's WithPagination replaces). Live binds one for\n * the application, which answers while a WithPagination component mounts, runs an update's hooks and actions, or\n * renders. Unbound, or `undefined` from a method, the paginators read the request (`?page=` and its URL).\n */\nexport interface PaginationState {\n /** The page to show for `pageName` ('page' by default). */\n currentPage(pageName: string): number | undefined\n /** The base path of the page links. */\n currentPath(): string | undefined\n}\nexport const PaginationState = token<PaginationState>('Database.PaginationState')\n","import { token } from './Container'\n\n/** A rule object (Laravel's ValidationRule). Call fail() to reject the value. */\nexport interface ValidationRule {\n validate(\n attribute: string,\n value: unknown,\n fail: (message: string) => void,\n data: Record<string, unknown>,\n ): void | Promise<void>\n}\n\n/** 'required|string|max:255', or an array mixing strings and rule objects. Keys support dot + `*` wildcards. */\nexport type Rules = Record<string, string | ReadonlyArray<string | ValidationRule>>\n\nexport interface MessageBag {\n has(key: string): boolean\n first(key?: string): string | undefined\n get(key: string): string[]\n all(): string[]\n isEmpty(): boolean\n count(): number\n toObject(): Record<string, string[]>\n}\n\nexport interface Validator {\n passes(): Promise<boolean>\n fails(): Promise<boolean>\n /** Only the keys that have rules. Throws ValidationError (Exceptions.ts) on failure. */\n validated<T = Record<string, unknown>>(): Promise<T>\n /** Valid only after passes()/fails()/validated() has run. */\n errors(): MessageBag\n after(callback: (validator: Validator) => void | Promise<void>): this\n}\n\nexport type RuleCallback = (\n attribute: string,\n value: unknown,\n parameters: string[],\n data: Record<string, unknown>,\n) => boolean | Promise<boolean>\n\nexport interface ValidationFactory {\n make(\n data: Record<string, unknown>,\n rules: Rules,\n messages?: Record<string, string>,\n attributes?: Record<string, string>,\n ): Validator\n /** Registers a string rule, e.g. extend('uppercase', fn, ':attribute must be uppercase'). */\n extend(name: string, callback: RuleCallback, message?: string): void\n}\nexport const ValidationFactory = token<ValidationFactory>('Validation.Factory')\n","import { token, type Class } from './Container'\n\nexport interface Authenticatable {\n getAuthIdentifierName(): string\n getAuthIdentifier(): unknown\n getAuthPassword(): string\n getRememberToken(): string | undefined\n setRememberToken(value: string): void\n getRememberTokenName(): string\n}\n\nexport type Credentials = Record<string, unknown>\n\nexport interface UserProvider {\n retrieveById(id: unknown): Promise<Authenticatable | undefined>\n retrieveByToken(id: unknown, token: string): Promise<Authenticatable | undefined>\n updateRememberToken(user: Authenticatable, token: string): Promise<void>\n retrieveByCredentials(credentials: Credentials): Promise<Authenticatable | undefined>\n validateCredentials(user: Authenticatable, credentials: Credentials): Promise<boolean>\n}\n\nexport interface Guard {\n check(): Promise<boolean>\n guest(): Promise<boolean>\n user<T extends Authenticatable = Authenticatable>(): Promise<T | undefined>\n id(): Promise<unknown>\n validate(credentials: Credentials): Promise<boolean>\n hasUser(): boolean\n setUser(user: Authenticatable): void\n}\n\nexport interface StatefulGuard extends Guard {\n attempt(credentials: Credentials, remember?: boolean): Promise<boolean>\n once(credentials: Credentials): Promise<boolean>\n login(user: Authenticatable, remember?: boolean): Promise<void>\n loginUsingId(id: unknown, remember?: boolean): Promise<Authenticatable | false>\n logout(): Promise<void>\n}\n\nexport interface AuthFactory {\n guard(name?: string): StatefulGuard | Guard\n shouldUse(name: string): void\n extend(driver: string, factory: (name: string, config: Record<string, unknown>) => Guard): void\n provider(driver: string, factory: (config: Record<string, unknown>) => UserProvider): void\n}\nexport const AuthFactory = token<AuthFactory>('Auth.Factory')\n\nexport type AbilityCallback = (user: Authenticatable | undefined, ...args: unknown[]) => boolean | Promise<boolean>\n\nexport interface Gate {\n define(ability: string, callback: AbilityCallback): this\n policy(model: Class<unknown>, policy: Class<unknown>): this\n before(callback: (user: Authenticatable | undefined, ability: string) => boolean | undefined | Promise<boolean | undefined>): this\n allows(ability: string, ...args: unknown[]): Promise<boolean>\n denies(ability: string, ...args: unknown[]): Promise<boolean>\n /** Throws an Authorization OrielError (403) when denied. */\n authorize(ability: string, ...args: unknown[]): Promise<void>\n any(abilities: string[], ...args: unknown[]): Promise<boolean>\n forUser(user: Authenticatable | undefined): Gate\n}\nexport const Gate = token<Gate>('Auth.Gate')\n\nexport type PasswordStatus = 'passwords.sent' | 'passwords.reset' | 'passwords.user' | 'passwords.token' | 'passwords.throttled'\n\nexport interface PasswordBroker {\n sendResetLink(credentials: Credentials): Promise<PasswordStatus>\n reset(credentials: Credentials, callback: (user: Authenticatable, password: string) => Promise<void>): Promise<PasswordStatus>\n}\nexport const PasswordBroker = token<PasswordBroker>('Auth.PasswordBroker')\n\nexport interface MustVerifyEmail {\n hasVerifiedEmail(): boolean\n markEmailAsVerified(): Promise<boolean>\n sendEmailVerificationNotification(): Promise<void>\n getEmailForVerification(): string\n}\n","import { token } from './Container'\n\n/** Options a job class may declare as public fields. Their presence (or implementing ShouldQueue) makes things queueable. */\nexport interface ShouldQueue {\n /**\n * Marks the class as queued at run time: `implements ShouldQueue` leaves no trace once compiled, so the interface\n * asks for `readonly shouldQueue = true`. Jobs, listeners, mailables and notifications carrying it are queued.\n */\n readonly shouldQueue: true\n connection?: string\n queue?: string\n /** Seconds. */\n delay?: number\n tries?: number\n /** Seconds, or a per-attempt list. */\n backoff?: number | number[]\n /** Seconds. */\n timeout?: number\n uniqueId?(): string\n}\n\n/** A job: public fields are its serialized data; handle() runs on the worker (inject() works inside it). */\nexport interface Job extends Partial<ShouldQueue> {\n handle(): unknown | Promise<unknown>\n failed?(error: unknown): void | Promise<void>\n}\n\nexport interface QueuePayload {\n uuid: string\n /** ClassRegistry name. */\n job: string\n displayName: string\n data: Record<string, unknown>\n attempts: number\n maxTries?: number\n backoff?: number[]\n timeout?: number\n /** Unix ms. */\n pushedAt: number\n batchId?: string\n chain?: QueuePayload[]\n /** Unix ms after which the job fails instead of retrying. */\n retryUntil?: number\n /** Mark the job failed (instead of releasing it) when it times out. */\n failOnTimeout?: boolean\n}\n\nexport interface QueueJob {\n getJobId(): string\n getQueue(): string\n payload(): QueuePayload\n attempts(): number\n delete(): Promise<void>\n release(delaySeconds?: number): Promise<void>\n /** Marks as failed: stores it via FailedJobProvider and calls job.failed(). */\n fail(error: unknown): Promise<void>\n isDeleted(): boolean\n isReleased(): boolean\n}\n\nexport interface Queue {\n push(job: Job, queue?: string): Promise<string>\n later(delaySeconds: number, job: Job, queue?: string): Promise<string>\n pushRaw(payload: QueuePayload, queue?: string, delaySeconds?: number): Promise<string>\n pop(queue?: string): Promise<QueueJob | undefined>\n size(queue?: string): Promise<number>\n clear(queue?: string): Promise<number>\n}\n\nexport interface QueueManager extends Queue {\n connection(name?: string): Queue\n extend(driver: string, factory: (config: Record<string, unknown>) => Queue): void\n}\nexport const QueueManager = token<QueueManager>('Queue.Manager')\n\nexport interface FailedJob {\n id: string\n connection: string\n queue: string\n payload: QueuePayload\n exception: string\n failedAt: Date\n}\n\nexport interface FailedJobProvider {\n log(connection: string, queue: string, payload: QueuePayload, error: unknown): Promise<string>\n all(): Promise<FailedJob[]>\n find(id: string): Promise<FailedJob | undefined>\n forget(id: string): Promise<boolean>\n flush(): Promise<void>\n}\nexport const FailedJobProvider = token<FailedJobProvider>('Queue.FailedJobProvider')\n","import { token } from './Container'\nimport type { Job } from './Queue'\n\nexport interface Batch {\n readonly id: string\n readonly name: string\n readonly totalJobs: number\n readonly pendingJobs: number\n readonly failedJobs: number\n progress(): number\n finished(): boolean\n cancelled(): boolean\n cancel(): Promise<void>\n}\n\nexport interface PendingChain {\n onConnection(connection: string): this\n onQueue(queue: string): this\n /** Runs as a job if any job in the chain fails. Callbacks are jobs, because closures can't be serialized. */\n catch(job: Job): this\n dispatch(): Promise<void>\n}\n\nexport interface PendingBatch {\n name(name: string): this\n onConnection(connection: string): this\n onQueue(queue: string): this\n allowFailures(allow?: boolean): this\n then(job: Job): this\n catch(job: Job): this\n finally(job: Job): this\n dispatch(): Promise<Batch>\n}\n\nexport interface BusDispatcher {\n /** Queues it when the job is queueable (implements ShouldQueue / declares queue options), otherwise runs it now. */\n dispatch(job: Job): Promise<unknown>\n dispatchSync(job: Job): Promise<unknown>\n /** Runs after the current response is sent (or the current job finishes). */\n dispatchAfterResponse(job: Job): void\n chain(jobs: Job[]): PendingChain\n batch(jobs: Job[]): PendingBatch\n findBatch(id: string): Promise<Batch | undefined>\n}\nexport const BusDispatcher = token<BusDispatcher>('Bus.Dispatcher')\n\n/** What PendingBatch hands to the repository. Callbacks are jobs, because closures can't be serialized. */\nexport interface PendingBatchOptions {\n name: string\n then: Job[]\n catch: Job[]\n finally: Job[]\n allowFailures: boolean\n connection?: string\n queue?: string\n}\n\n/** Stores batches and runs their bookkeeping (Laravel's BatchRepository). Bound by the Queue component. */\nexport interface BatchRepository {\n store(options: PendingBatchOptions): Promise<Batch>\n find(id: string): Promise<Batch | undefined>\n /** Adds `amount` to both total and pending jobs, before the jobs are pushed. */\n incrementTotalJobs(id: string, amount: number): Promise<void>\n /** A batched job succeeded: decrement pending, then run then/finally callbacks when due. */\n recordSuccessfulJob(id: string, jobUuid: string): Promise<void>\n /** A batched job failed for good: count it, cancel unless failures are allowed, run catch/finally when due. */\n recordFailedJob(id: string, jobUuid: string, error: unknown): Promise<void>\n markAsFinished(id: string): Promise<void>\n cancel(id: string): Promise<void>\n delete(id: string): Promise<void>\n}\nexport const BatchRepository = token<BatchRepository>('Queue.BatchRepository')\n","import { token } from './Container'\nimport type { Job } from './Queue'\n\n/** A CLI command. Signature uses Laravel syntax: 'mail:send {user} {--queue=default}'. */\nexport interface Command {\n readonly signature: string\n readonly description: string\n handle(): number | void | Promise<number | void>\n}\n\nexport type OptionValue = string | boolean | string[] | undefined\n\n/** `this` inside a closure command (Laravel's Command API). */\nexport interface CommandContext extends Command {\n argument(name: string): string | string[] | undefined\n arguments(): Record<string, string | string[]>\n option(name: string): OptionValue\n options(): Record<string, OptionValue>\n info(message: string): void\n line(message?: string): void\n comment(message: string): void\n warn(message: string): void\n error(message: string): void\n newLine(count?: number): void\n table(headers: string[], rows: string[][]): void\n ask(question: string, defaultValue?: string): Promise<string>\n secret(question: string): Promise<string>\n confirm(question: string, defaultValue?: boolean): Promise<boolean>\n choice(question: string, choices: string[], defaultIndex?: number): Promise<string>\n}\n\n/** What ConsoleKernel.command() returns. */\nexport interface ClosureCommand extends CommandContext {\n purpose(description: string): this\n}\n\nexport interface ConsoleKernel {\n /** Returns the exit code. */\n handle(argv: string[]): Promise<number>\n call(command: string, parameters?: Record<string, unknown>): Promise<number>\n /** Output buffered from the last call(). */\n output(): string\n all(): Record<string, Command>\n /** Register command classes or instances (components call this from their provider's boot()). */\n register(...commands: Array<Command | (new () => Command)>): void\n /** Closure command, like Artisan::command() in routes/console.ts. `this` is the command (argument(), info(), …). */\n command(signature: string, handler: (this: CommandContext, ...args: unknown[]) => number | void | Promise<number | void>): ClosureCommand\n}\nexport const ConsoleKernel = token<ConsoleKernel>('Console.Kernel')\n\nexport interface ScheduledEvent {\n readonly expression: string\n cron(expression: string): this\n everyMinute(): this\n everyFiveMinutes(): this\n everyFifteenMinutes(): this\n everyThirtyMinutes(): this\n hourly(): this\n hourlyAt(minute: number): this\n daily(): this\n dailyAt(time: string): this\n twiceDaily(first?: number, second?: number): this\n weekly(): this\n weeklyOn(day: number, time?: string): this\n monthly(): this\n monthlyOn(day: number, time?: string): this\n yearly(): this\n weekdays(): this\n weekends(): this\n timezone(timezone: string): this\n between(start: string, end: string): this\n when(callback: () => boolean | Promise<boolean>): this\n skip(callback: () => boolean | Promise<boolean>): this\n /** Uses a cache lock (default 1440 minutes). */\n withoutOverlapping(expiresAtMinutes?: number): this\n /** Uses a cache lock so only one server runs it. */\n onOneServer(): this\n runInBackground(): this\n name(name: string): this\n description(description: string): this\n isDue(now: Date): boolean\n run(): Promise<void>\n}\n\nexport interface Schedule {\n command(command: string, parameters?: string[]): ScheduledEvent\n job(job: Job, queue?: string, connection?: string): ScheduledEvent\n call(callback: () => unknown | Promise<unknown>): ScheduledEvent\n events(): ScheduledEvent[]\n dueEvents(now: Date): ScheduledEvent[]\n}\nexport const Schedule = token<Schedule>('Console.Schedule')\n","import { token } from './Container'\n\nexport interface Address {\n address: string\n name?: string\n}\n/** A plain email string, an Address, or anything with email (+ optional name), such as a User model. */\nexport type MailRecipient = string | Address | { email: string; name?: string }\n\nexport interface Envelope {\n from?: MailRecipient\n to?: MailRecipient[]\n cc?: MailRecipient[]\n bcc?: MailRecipient[]\n replyTo?: MailRecipient[]\n subject?: string\n tags?: string[]\n metadata?: Record<string, string>\n}\n\nexport interface Content {\n /** A View name, rendered by ViewFactory (TSX). */\n view?: string\n /** A plain-text view name. */\n text?: string\n /** Raw HTML (used when no view is given). */\n htmlString?: string\n /** Raw plain-text body (used when no text view is given). */\n textString?: string\n with?: Record<string, unknown>\n}\n\nexport interface Attachment {\n name: string\n path?: string\n data?: Uint8Array | string\n mime?: string\n}\n\n/** Laravel 10+ style mailable: envelope() + content() + attachments(). */\nexport interface Mailable {\n envelope(): Envelope | Promise<Envelope>\n content(): Content | Promise<Content>\n attachments?(): Attachment[] | Promise<Attachment[]>\n}\n\n/** Fully rendered message handed to a transport. */\nexport interface OutgoingMessage {\n from: Address\n to: Address[]\n cc: Address[]\n bcc: Address[]\n replyTo: Address[]\n subject: string\n html?: string\n text?: string\n attachments: Attachment[]\n headers: Record<string, string>\n}\n\nexport interface SentMessage {\n messageId: string\n message: OutgoingMessage\n}\n\nexport interface MailTransport {\n send(message: OutgoingMessage): Promise<SentMessage>\n}\n\nexport interface PendingMail {\n cc(recipients: MailRecipient | MailRecipient[]): this\n bcc(recipients: MailRecipient | MailRecipient[]): this\n send(mailable: Mailable): Promise<SentMessage | undefined>\n queue(mailable: Mailable): Promise<void>\n later(delaySeconds: number, mailable: Mailable): Promise<void>\n}\n\nexport interface Mailer {\n to(recipients: MailRecipient | MailRecipient[]): PendingMail\n /** Sends to the recipients given in the mailable's envelope. Queues it if the mailable is queueable. */\n send(mailable: Mailable): Promise<SentMessage | undefined>\n queue(mailable: Mailable): Promise<void>\n}\n\nexport interface MailManager extends Mailer {\n mailer(name?: string): Mailer\n extend(transport: string, factory: (config: Record<string, unknown>) => MailTransport): void\n}\nexport const MailManager = token<MailManager>('Mail.Manager')\n","import { token } from './Container'\nimport type { ModelInstance } from './Database'\n\nexport interface Notifiable {\n /** e.g. 'mail' → email address, 'database' → the model itself. */\n routeNotificationFor(channel: string, notification: Notification): unknown\n}\n\nexport interface Notification {\n /** Optional id; set by the dispatcher when missing. */\n id?: string\n via(notifiable: Notifiable): string[]\n /** Returns a Mailable (Contracts/Mail) or the Notifications MailMessage builder. */\n toMail?(notifiable: Notifiable): unknown\n toDatabase?(notifiable: Notifiable): Record<string, unknown>\n toArray?(notifiable: Notifiable): Record<string, unknown>\n}\n\nexport interface NotificationChannel {\n send(notifiable: Notifiable, notification: Notification): Promise<void>\n}\n\nexport interface NotificationDispatcher {\n /** Queues it when the notification is queueable, otherwise sends immediately. */\n send(notifiables: Notifiable | Notifiable[], notification: Notification): Promise<void>\n sendNow(notifiables: Notifiable | Notifiable[], notification: Notification, channels?: string[]): Promise<void>\n /** On-demand: Notification.route('mail', 'a@b.c').notify(n). */\n route(channel: string, route: unknown): Notifiable & { notify(notification: Notification): Promise<void> }\n extend(channel: string, factory: () => NotificationChannel): void\n}\nexport const NotificationDispatcher = token<NotificationDispatcher>('Notifications.Dispatcher')\n\n/**\n * A stored database notification (Laravel's DatabaseNotification model): one row of the `notifications` table, with\n * its snake_case columns. `user.notifications()`, `unreadNotifications()` and `readNotifications()` query these,\n * newest first.\n */\nexport interface DatabaseNotification extends ModelInstance {\n /** A UUID. */\n readonly id: string\n /** The notification's class name. */\n readonly type: string\n /** What the notification's toDatabase() (or toArray()) returned. */\n readonly data: Record<string, unknown>\n read_at: Date | null\n readonly created_at: Date | null\n readonly updated_at: Date | null\n /** Sets read_at to now and saves, unless it is already read. */\n markAsRead(): Promise<void>\n /** Clears read_at and saves, unless it is already unread. */\n markAsUnread(): Promise<void>\n read(): boolean\n unread(): boolean\n}\n","import { token } from './Container'\n\nexport interface Lock {\n /** Tries once. Returns whether it was acquired. */\n get(): Promise<boolean>\n /** Tries once. Runs the callback and releases if acquired, else returns false. */\n get<T>(callback: () => T | Promise<T>): Promise<T | false>\n /** Waits up to `seconds` to acquire. Throws LockTimeoutError (an OrielError, kind 'Server', status 500) on timeout. */\n block<T>(seconds: number, callback?: () => T | Promise<T>): Promise<T | true>\n release(): Promise<boolean>\n forceRelease(): Promise<void>\n owner(): string\n}\n\nexport interface CacheRepository {\n get<T = unknown>(key: string): Promise<T | undefined>\n get<T>(key: string, defaultValue: T | (() => T)): Promise<T>\n many<T = unknown>(keys: string[]): Promise<Record<string, T | undefined>>\n has(key: string): Promise<boolean>\n missing(key: string): Promise<boolean>\n /** ttl in seconds; undefined = forever. */\n put(key: string, value: unknown, ttlSeconds?: number): Promise<boolean>\n /** Only stores if the key is missing. Atomic in every driver. */\n add(key: string, value: unknown, ttlSeconds?: number): Promise<boolean>\n increment(key: string, by?: number): Promise<number>\n decrement(key: string, by?: number): Promise<number>\n forever(key: string, value: unknown): Promise<boolean>\n pull<T = unknown>(key: string, defaultValue?: T): Promise<T | undefined>\n forget(key: string): Promise<boolean>\n flush(): Promise<boolean>\n remember<T>(key: string, ttlSeconds: number, callback: () => T | Promise<T>): Promise<T>\n rememberForever<T>(key: string, callback: () => T | Promise<T>): Promise<T>\n lock(name: string, seconds?: number, owner?: string): Lock\n /** Only supported by the redis store. Others throw. */\n tags(names: string | string[]): CacheRepository\n}\n\nexport interface CacheManager extends CacheRepository {\n store(name?: string): CacheRepository\n extend(driver: string, factory: (config: Record<string, unknown>) => CacheRepository): void\n}\nexport const CacheManager = token<CacheManager>('Cache.Manager')\n\n/** Laravel's RateLimiter: hits per key, kept in the default cache store. */\nexport interface RateLimiter {\n tooManyAttempts(key: string, maxAttempts: number): Promise<boolean>\n /** Adds a hit; the window starts at the first hit and lasts `decaySeconds` (default 60). Returns the hit count. */\n hit(key: string, decaySeconds?: number): Promise<number>\n attempts(key: string): Promise<number>\n remaining(key: string, maxAttempts: number): Promise<number>\n /** Seconds until the key's window resets. */\n availableIn(key: string): Promise<number>\n clear(key: string): Promise<void>\n}\nexport const RateLimiter = token<RateLimiter>('Cache.RateLimiter')\n","import { token, type Class } from './Container'\n\nexport type ListenerClass<E> = Class<{ handle(event: E): unknown }>\nexport type Listener<E> = ((event: E) => unknown) | ListenerClass<E>\n\nexport interface EventDispatcher {\n /** Class events (recommended) or string events like 'eloquent.created: Post'. */\n listen<E>(events: Class<E> | string | Array<Class<E> | string>, listener: Listener<E>): void\n hasListeners(event: Class<unknown> | string): boolean\n /** Runs listeners in registration order. Listener classes that are queueable are queued. Returns results. */\n dispatch(event: object | string, payload?: unknown[]): Promise<unknown[]>\n /** Stops at the first listener that returns something other than undefined. Returns that value. */\n until(event: object | string, payload?: unknown[]): Promise<unknown>\n subscribe(subscriber: Class<{ subscribe(events: EventDispatcher): void }>): void\n forget(event: Class<unknown> | string): void\n}\nexport const EventDispatcher = token<EventDispatcher>('Events.Dispatcher')\n","import { token } from './Container'\nimport type { UploadedFile } from './Http'\n\nexport interface PutOptions {\n visibility?: 'public' | 'private'\n mimeType?: string\n}\n\n/** Paths are relative to the disk root. Throws on paths that escape it ('../'). */\nexport interface Filesystem {\n exists(path: string): Promise<boolean>\n missing(path: string): Promise<boolean>\n get(path: string): Promise<string>\n getBytes(path: string): Promise<Uint8Array>\n readStream(path: string): Promise<ReadableStream<Uint8Array>>\n put(path: string, contents: string | Uint8Array | ReadableStream<Uint8Array>, options?: PutOptions): Promise<boolean>\n /** Stores under a generated unique name. Returns the stored path. */\n putFile(directory: string, file: UploadedFile, options?: PutOptions): Promise<string>\n putFileAs(directory: string, file: UploadedFile, name: string, options?: PutOptions): Promise<string>\n delete(paths: string | string[]): Promise<boolean>\n copy(from: string, to: string): Promise<boolean>\n move(from: string, to: string): Promise<boolean>\n size(path: string): Promise<number>\n lastModified(path: string): Promise<Date>\n mimeType(path: string): Promise<string | undefined>\n url(path: string): string\n temporaryUrl(path: string, expiresAt: Date): Promise<string>\n files(directory?: string, recursive?: boolean): Promise<string[]>\n directories(directory?: string, recursive?: boolean): Promise<string[]>\n makeDirectory(path: string): Promise<boolean>\n deleteDirectory(path: string): Promise<boolean>\n /** Absolute local path (local disks only). */\n path(path: string): string\n}\n\nexport interface FilesystemManager extends Filesystem {\n disk(name?: string): Filesystem\n extend(driver: string, factory: (config: Record<string, unknown>) => Filesystem): void\n}\nexport const FilesystemManager = token<FilesystemManager>('Filesystem.Manager')\n","import { token } from './Container'\nimport type { RedirectResponse } from './Routing'\nimport type { Responsable } from './Support'\n\n/** Infinite-scroll metadata for one prop (page.scrollProps[path]). */\nexport interface InertiaScrollProp {\n pageName: string\n previousPage: string | number | null\n nextPage: string | number | null\n currentPage: string | number | null\n reset: boolean\n}\n\n/** A once prop the client keeps between visits (page.onceProps[key]). `expiresAt` is epoch milliseconds. */\nexport interface InertiaOnceProp {\n prop: string\n expiresAt: number | null\n}\n\n/**\n * The Inertia page object (protocol v3, @inertiajs/core 3.x). Only component, props, url and version are always\n * present; the other fields are left out when empty or false.\n */\nexport interface InertiaPage {\n component: string\n props: Record<string, unknown>\n /** Path and query, never absolute: '/posts?page=2'. */\n url: string\n /** '' when the app has no asset version. */\n version: string\n sharedProps?: string[]\n mergeProps?: string[]\n prependProps?: string[]\n deepMergeProps?: string[]\n /** '<prop path>.<key field>', e.g. 'posts.data.id'. */\n matchPropsOn?: string[]\n /** Group name → prop paths loaded after the first render. */\n deferredProps?: Record<string, string[]>\n rescuedProps?: string[]\n scrollProps?: Record<string, InertiaScrollProp>\n onceProps?: Record<string, InertiaOnceProp>\n clearHistory?: true\n encryptHistory?: true\n flash?: Record<string, unknown>\n preserveFragment?: true\n}\n\nexport interface InertiaResponse extends Responsable {\n with(key: string | Record<string, unknown>, value?: unknown): this\n withViewData(key: string | Record<string, unknown>, value?: unknown): this\n rootView(view: string): this\n /** Flash data for the next page (page.flash), stored in the session. */\n flash(key: string | Record<string, unknown>, value?: unknown): this\n}\n\nexport type PropCallback<T = unknown> = () => T | Promise<T>\n\n/** The SSR result spliced into the root view: the `head` tags and the rendered `body`. */\nexport interface InertiaSsrResponse {\n head: string\n body: string\n}\n\n/** Sends a page to the SSR server. Resolves to undefined when SSR is off, unreachable or failing. */\nexport interface InertiaSsrGateway {\n dispatch(page: InertiaPage): Promise<InertiaSsrResponse | undefined>\n}\nexport const InertiaSsrGateway = token<InertiaSsrGateway>('Inertia.SsrGateway')\n\nexport interface InertiaFactory {\n render(component: string, props?: Record<string, unknown>): InertiaResponse\n share(key: string | Record<string, unknown>, value?: unknown): void\n /** A shared once prop: sent on the first visit, then kept by the client. */\n shareOnce(key: string, callback: PropCallback): void\n getShared(key?: string): unknown\n flushShared(): void\n version(version: string | null | (() => string | null | Promise<string | null>)): void\n getVersion(): Promise<string>\n setRootView(view: string): void\n /** Only evaluated on partial reloads that ask for it. */\n optional<T>(callback: PropCallback<T>): unknown\n /** Loaded in a follow-up request after the first render. */\n defer<T>(callback: PropCallback<T>, group?: string): unknown\n /** Always included, even in partial reloads. */\n always<T>(value: T | PropCallback<T>): unknown\n /** Appended to the existing client-side value instead of replacing it. */\n merge<T>(value: T | PropCallback<T>): unknown\n /** Deep-merged with the existing client-side value. */\n deepMerge<T>(value: T | PropCallback<T>): unknown\n /** Resolved once, then remembered by the client. */\n once<T>(callback: PropCallback<T>): unknown\n /** Infinite scroll over a paginator: merged page by page, with scroll metadata. */\n scroll<T>(value: T | PropCallback<T>, wrapper?: string): unknown\n /** Flash data for the next page (page.flash), stored in the session. */\n flash(key: string | Record<string, unknown>, value?: unknown): this\n encryptHistory(encrypt?: boolean): void\n /** The next page tells the client to clear its encrypted history. */\n clearHistory(): void\n /** The next page keeps the URL fragment of the request that redirected to it. */\n preserveFragment(): void\n /** 409 + X-Inertia-Location for Inertia requests, a plain 302 otherwise. */\n location(url: string): Response\n /** Redirect back (Inertia.flash('saved', true).back()). */\n back(fallback?: string, status?: number): RedirectResponse\n}\nexport const InertiaFactory = token<InertiaFactory>('Inertia.Factory')\n","import { token, type Class } from './Container'\nimport type { HttpRequest } from './Http'\n\nexport interface LiveSnapshot {\n data: Record<string, unknown>\n memo: {\n id: string\n /** ClassRegistry name of the component. */\n name: string\n path: string\n method: string\n children: Record<string, [tag: string, id: string]>\n errors: Record<string, string[]>\n }\n /** HMAC-SHA256 of JSON(data + memo), keyed by APP_KEY. */\n checksum: string\n}\n\nexport interface LiveEffects {\n html?: string\n /** Browser events from this.dispatch(); `self` keeps one on this component, `to` sends it to one component name. */\n dispatches?: Array<{ name: string; params: Record<string, unknown>; self?: true; to?: string }>\n /** Events this component listens to (@On, static listeners); sent with the first render. */\n listeners?: string[]\n redirect?: string\n /** Follow `redirect` with o:navigate instead of a full page load. */\n redirectUsingNavigate?: true\n returns?: unknown[]\n}\n\nexport interface LiveUpdateRequest {\n components: Array<{\n /** JSON-encoded LiveSnapshot. */\n snapshot: string\n updates: Record<string, unknown>\n calls: Array<{ method: string; params: unknown[] }>\n }>\n}\n\nexport interface LiveUpdateResponse {\n components: Array<{ snapshot: string; effects: LiveEffects }>\n}\n\nexport interface LiveManager {\n register(component: Class<unknown>, name?: string): void\n /** Server-renders the first HTML (snapshot embedded). `key` identifies a child inside its parent (o:key). */\n mount(component: string | Class<unknown>, params?: Record<string, unknown>, key?: string): Promise<string>\n /** Checks checksums and CSRF, then applies updates and calls, re-renders and returns new snapshots. */\n update(request: LiveUpdateRequest): Promise<LiveUpdateResponse>\n /**\n * A full-page component (Route.get('/counter', Counter)): mounts `component` (a component instance) with the current route's parameters and\n * returns the response, its layout view or a redirect.\n */\n page(component: object): Promise<unknown>\n isLiveRequest(request: HttpRequest): boolean\n}\nexport const LiveManager = token<LiveManager>('Live.Manager')\n"],"mappings":";AAQO,SAAS,MAAS,aAA+B;AACtD,SAAO,OAAO,OAAO,EAAE,IAAI,uBAAO,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E,IAAM,gBAAgB,MAAqB,gBAAgB;AA2C3D,IAAM,WAAW,MAAgB,kBAAkB;ACHnD,IAAM,cAAc,MAAmB,cAAc;AC1DrD,IAAM,yBAAyB,MAA8B,0BAA0B;ACWvF,IAAM,eAAe,MAAoB,eAAe;AAaxD,IAAM,cAAc,MAAmB,mBAAmB;ACtC1D,IAAM,kBAAkB,MAAuB,mBAAmB;ACuBlE,IAAM,oBAAoB,MAAyB,oBAAoB;AC4BvE,IAAM,oBAAoB,MAAyB,oBAAoB;AAsCvE,IAAM,iBAAiB,MAAsB,iBAAiB;ACjD9D,IAAM,cAAc,MAAmB,cAAc;","names":[]}
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
Application,
|
|
3
3
|
ConfigRepository,
|
|
4
4
|
Container
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-BSQKOLSK.js";
|
|
6
6
|
|
|
7
7
|
// ../Container/dist/index.js
|
|
8
8
|
import { AsyncLocalStorage } from "async_hooks";
|
|
@@ -500,6 +500,11 @@ var LazyCollection = class _LazyCollection {
|
|
|
500
500
|
import { randomBytes, randomUUID } from "crypto";
|
|
501
501
|
import pluralize from "pluralize";
|
|
502
502
|
import { setTimeout as sleep } from "timers/promises";
|
|
503
|
+
var __defProp = Object.defineProperty;
|
|
504
|
+
var __export = (target, all) => {
|
|
505
|
+
for (var name in all)
|
|
506
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
507
|
+
};
|
|
503
508
|
var words = (value2) => value2.replace(/([a-z\d])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").split(/[^A-Za-z\d]+/).filter(Boolean);
|
|
504
509
|
var ALPHANUM = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
505
510
|
var escapeRegex = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
@@ -739,6 +744,114 @@ function __(key, replace = {}) {
|
|
|
739
744
|
}
|
|
740
745
|
return line;
|
|
741
746
|
}
|
|
747
|
+
var fileType_exports = {};
|
|
748
|
+
__export(fileType_exports, {
|
|
749
|
+
AVIF: () => AVIF,
|
|
750
|
+
BINARY_AND_MARKUP_TYPES: () => BINARY_AND_MARKUP_TYPES,
|
|
751
|
+
BMP: () => BMP,
|
|
752
|
+
EMPTY: () => EMPTY,
|
|
753
|
+
GIF: () => GIF,
|
|
754
|
+
HTML: () => HTML,
|
|
755
|
+
JPEG: () => JPEG,
|
|
756
|
+
PDF: () => PDF,
|
|
757
|
+
PNG: () => PNG,
|
|
758
|
+
RASTER_IMAGES: () => RASTER_IMAGES,
|
|
759
|
+
SNIFF_BYTES: () => SNIFF_BYTES,
|
|
760
|
+
SVG: () => SVG,
|
|
761
|
+
TEXT: () => TEXT,
|
|
762
|
+
UNKNOWN: () => UNKNOWN,
|
|
763
|
+
WEBP: () => WEBP,
|
|
764
|
+
XML: () => XML,
|
|
765
|
+
detectFileType: () => detectFileType
|
|
766
|
+
});
|
|
767
|
+
var type = (mime, ...extensions) => Object.freeze({ mime, extensions: Object.freeze(extensions) });
|
|
768
|
+
var JPEG = type("image/jpeg", "jpg", "jpeg");
|
|
769
|
+
var PNG = type("image/png", "png");
|
|
770
|
+
var GIF = type("image/gif", "gif");
|
|
771
|
+
var WEBP = type("image/webp", "webp");
|
|
772
|
+
var AVIF = type("image/avif", "avif");
|
|
773
|
+
var BMP = type("image/bmp", "bmp");
|
|
774
|
+
var SVG = type("image/svg+xml", "svg");
|
|
775
|
+
var PDF = type("application/pdf", "pdf");
|
|
776
|
+
var HTML = type("text/html", "html", "htm");
|
|
777
|
+
var XML = type("text/xml", "xml");
|
|
778
|
+
var TEXT = type("text/plain", "txt");
|
|
779
|
+
var UNKNOWN = type("application/octet-stream");
|
|
780
|
+
var EMPTY = type("application/x-empty");
|
|
781
|
+
var RASTER_IMAGES = new Set([JPEG, PNG, GIF, WEBP, AVIF, BMP].map(({ mime }) => mime));
|
|
782
|
+
var BINARY_AND_MARKUP_TYPES = [JPEG, PNG, GIF, WEBP, AVIF, BMP, SVG, PDF, HTML, XML];
|
|
783
|
+
var SNIFF_BYTES = 1024 * 1024;
|
|
784
|
+
var MARKUP_SNIFF_BYTES = 64 * 1024;
|
|
785
|
+
var MAX_PROLOG_ITEMS = 64;
|
|
786
|
+
var BINARY_BYTES = new Uint8Array(256).fill(1, 0, 32);
|
|
787
|
+
for (const byte of [7, 8, 9, 10, 11, 12, 13, 27]) BINARY_BYTES[byte] = 0;
|
|
788
|
+
BINARY_BYTES[127] = 1;
|
|
789
|
+
var FTYP_SCAN_BYTES = 1024;
|
|
790
|
+
var BMP_HEADER_SIZES = /* @__PURE__ */ new Set([12, 40, 52, 56, 64, 108, 124]);
|
|
791
|
+
var ascii = (bytes, offset, length) => String.fromCharCode(...bytes.subarray(offset, offset + length));
|
|
792
|
+
var startsWith = (bytes, signature) => bytes.length >= signature.length && signature.every((byte, i) => bytes[i] === byte);
|
|
793
|
+
var u32be = (bytes, offset) => (bytes[offset] << 24 | bytes[offset + 1] << 16 | bytes[offset + 2] << 8 | bytes[offset + 3]) >>> 0;
|
|
794
|
+
var u32le = (bytes, offset) => (bytes[offset] | bytes[offset + 1] << 8 | bytes[offset + 2] << 16 | bytes[offset + 3] << 24) >>> 0;
|
|
795
|
+
function detectFileType(bytes) {
|
|
796
|
+
if (bytes.length === 0) return EMPTY;
|
|
797
|
+
if (startsWith(bytes, [255, 216, 255])) return JPEG;
|
|
798
|
+
if (startsWith(bytes, [137, 80, 78, 71, 13, 10, 26, 10])) return PNG;
|
|
799
|
+
const head = ascii(bytes, 0, 6);
|
|
800
|
+
if (head === "GIF87a" || head === "GIF89a") return GIF;
|
|
801
|
+
if (ascii(bytes, 0, 4) === "RIFF" && ascii(bytes, 8, 4) === "WEBP") return WEBP;
|
|
802
|
+
if (isAvif(bytes)) return AVIF;
|
|
803
|
+
if (ascii(bytes, 0, 2) === "BM" && bytes.length >= 18 && BMP_HEADER_SIZES.has(u32le(bytes, 14))) return BMP;
|
|
804
|
+
if (ascii(bytes, 0, 5) === "%PDF-") return PDF;
|
|
805
|
+
return detectText(bytes);
|
|
806
|
+
}
|
|
807
|
+
function isAvif(bytes) {
|
|
808
|
+
if (bytes.length < 16 || ascii(bytes, 4, 4) !== "ftyp") return false;
|
|
809
|
+
const isAvifBrand = (offset) => {
|
|
810
|
+
const brand = ascii(bytes, offset, 4);
|
|
811
|
+
return brand === "avif" || brand === "avis";
|
|
812
|
+
};
|
|
813
|
+
if (isAvifBrand(8)) return true;
|
|
814
|
+
const end = Math.min(u32be(bytes, 0), bytes.length, FTYP_SCAN_BYTES);
|
|
815
|
+
for (let offset = 16; offset + 4 <= end; offset += 4) {
|
|
816
|
+
if (isAvifBrand(offset)) return true;
|
|
817
|
+
}
|
|
818
|
+
return false;
|
|
819
|
+
}
|
|
820
|
+
function detectText(bytes) {
|
|
821
|
+
const end = Math.min(bytes.length, SNIFF_BYTES);
|
|
822
|
+
for (let i = 0; i < end; i++) {
|
|
823
|
+
if (BINARY_BYTES[bytes[i]] === 1) return UNKNOWN;
|
|
824
|
+
}
|
|
825
|
+
const content = new TextDecoder().decode(bytes.subarray(0, MARKUP_SNIFF_BYTES)).trimStart();
|
|
826
|
+
if (!content.startsWith("<")) return TEXT;
|
|
827
|
+
const root = rootElement(content);
|
|
828
|
+
if (root === "svg" || root?.endsWith(":svg")) return SVG;
|
|
829
|
+
if (root === "html") return HTML;
|
|
830
|
+
return content.startsWith("<?xml") ? XML : HTML;
|
|
831
|
+
}
|
|
832
|
+
function rootElement(markup) {
|
|
833
|
+
let rest = markup;
|
|
834
|
+
for (let items = 0; ; items++) {
|
|
835
|
+
const skip = prologItemLength(rest);
|
|
836
|
+
if (skip === 0) return /^<([A-Za-z_][\w.:-]*)/.exec(rest)?.[1]?.toLowerCase();
|
|
837
|
+
if (skip === -1 || items === MAX_PROLOG_ITEMS) return void 0;
|
|
838
|
+
rest = rest.slice(skip).trimStart();
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
function prologItemLength(rest) {
|
|
842
|
+
const through = (index, length) => index === -1 ? -1 : index + length;
|
|
843
|
+
if (rest.startsWith("<?")) return through(rest.indexOf("?>"), 2);
|
|
844
|
+
if (rest.startsWith("<!--")) return through(rest.indexOf("-->"), 3);
|
|
845
|
+
if (/^<!doctype/i.test(rest)) {
|
|
846
|
+
const close = rest.indexOf(">");
|
|
847
|
+
if (close === -1) return -1;
|
|
848
|
+
const subset = rest.slice(0, close).indexOf("[");
|
|
849
|
+
if (subset === -1) return close + 1;
|
|
850
|
+
const subsetEnd = rest.indexOf("]", subset);
|
|
851
|
+
return subsetEnd === -1 ? -1 : through(rest.indexOf(">", subsetEnd), 1);
|
|
852
|
+
}
|
|
853
|
+
return 0;
|
|
854
|
+
}
|
|
742
855
|
|
|
743
856
|
export {
|
|
744
857
|
BindingResolutionError,
|
|
@@ -761,6 +874,7 @@ export {
|
|
|
761
874
|
value,
|
|
762
875
|
tap,
|
|
763
876
|
retry,
|
|
764
|
-
__
|
|
877
|
+
__,
|
|
878
|
+
fileType_exports
|
|
765
879
|
};
|
|
766
|
-
//# sourceMappingURL=chunk-
|
|
880
|
+
//# sourceMappingURL=chunk-PM5YTG57.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../Container/Container.ts","../../Container/context.ts","../../Container/describe.ts","../../Container/errors.ts","../../Collections/compare.ts","../../Collections/Collection.ts","../../Collections/LazyCollection.ts","../../Support/Str.ts","../../Support/Arr.ts","../../Support/ServiceProvider.ts","../../Support/Facade.ts","../../Support/ClassRegistry.ts","../../Support/helpers.ts","../../Support/lang.ts","../../Support/fileType.ts"],"sourcesContent":["import { Container as ContainerToken, type Abstract, type Concrete, type Container as ContainerContract, type Factory } from '@orieljs/contracts'\nimport { building, GLOBAL_KEY, storage } from './context'\nimport { describe } from './describe'\nimport { BindingResolutionError, CircularDependencyError } from './errors'\n\ntype Key = unknown\ntype Lifetime = 'transient' | 'singleton' | 'scoped'\ninterface Binding { lifetime: Lifetime; factory: Factory<unknown> }\ntype Extender = (instance: unknown, c: ContainerContract) => unknown\ntype Callback = (instance: unknown, c: ContainerContract) => void\n\ninterface SharedState {\n bindings: Map<Key, Binding>\n extenders: Map<Key, Extender[]>\n resolving: Map<Key, Callback[]>\n resolved: Set<Key>\n}\n\nconst globals = globalThis as unknown as Record<symbol, Container | undefined>\n\nconst keyOf = (abstract: Abstract<unknown>): Key => (typeof abstract === 'function' ? abstract : abstract.id)\nconst isClass = (fn: unknown): fn is new () => unknown =>\n typeof fn === 'function' && /^class[\\s{]/.test(Function.prototype.toString.call(fn))\n\nexport class Container implements ContainerContract {\n static getInstance(): Container | undefined {\n return globals[GLOBAL_KEY]\n }\n static setInstance(container: Container | undefined): void {\n globals[GLOBAL_KEY] = container\n }\n\n protected readonly shared: SharedState\n protected readonly root: Container\n protected readonly parent: Container | undefined\n protected readonly local = new Map<Key, unknown>()\n\n constructor(parent?: Container) {\n this.parent = parent\n this.root = parent?.root ?? this\n this.shared = parent?.shared ?? { bindings: new Map(), extenders: new Map(), resolving: new Map(), resolved: new Set() }\n // Every container (root or scope) resolves \"the container\" as itself, by token and by class.\n this.local.set(keyOf(ContainerToken), this)\n this.local.set(Container, this)\n }\n\n bind<T>(abstract: Abstract<T>, concrete?: Concrete<T>): void {\n this.#assertRoot('bind')\n this.#addBinding(abstract, concrete, 'transient')\n }\n singleton<T>(abstract: Abstract<T>, concrete?: Concrete<T>): void {\n this.#assertRoot('singleton')\n this.#addBinding(abstract, concrete, 'singleton')\n }\n scoped<T>(abstract: Abstract<T>, concrete?: Concrete<T>): void {\n this.#assertRoot('scoped')\n this.#addBinding(abstract, concrete, 'scoped')\n }\n\n instance<T>(abstract: Abstract<T>, instance: T): T {\n const key = keyOf(abstract)\n this.local.set(key, instance)\n // A scope's instances are its own business: only the root records them in the shared resolved set.\n if (this === this.root) this.shared.resolved.add(key)\n return instance\n }\n\n make<T>(abstract: Abstract<T>): T {\n const key = keyOf(abstract)\n const owner = this.#owning(key)\n if (owner) return owner.local.get(key) as T\n\n const binding = this.shared.bindings.get(key) ?? this.#implicitBinding(abstract)\n if (binding.lifetime === 'scoped' && this === this.root) {\n throw new BindingResolutionError(\n `Scoped binding [${describe(abstract)}] was resolved outside a scope. Resolve it inside app.createScope().run(...), and don't inject scoped services into singletons.`,\n )\n }\n const builder = binding.lifetime === 'singleton' ? this.root : this\n const instance = builder.build(abstract, key, binding)\n\n if (binding.lifetime === 'singleton') this.root.local.set(key, instance)\n if (binding.lifetime === 'scoped') this.local.set(key, instance)\n return instance as T\n }\n\n bound(abstract: Abstract<unknown>): boolean {\n const key = keyOf(abstract)\n return this.shared.bindings.has(key) || this.#owning(key) !== undefined\n }\n\n resolved(abstract: Abstract<unknown>): boolean {\n const key = keyOf(abstract)\n return this.shared.resolved.has(key) || this.#owning(key) !== undefined\n }\n\n extend<T>(abstract: Abstract<T>, extender: (instance: T, container: ContainerContract) => T): void {\n this.#assertRoot('extend')\n const key = keyOf(abstract)\n const list = this.shared.extenders.get(key) ?? []\n list.push(extender as Extender)\n this.shared.extenders.set(key, list)\n if (this.local.has(key)) this.local.set(key, extender(this.local.get(key) as T, this))\n }\n\n resolving<T>(abstract: Abstract<T>, callback: (instance: T, container: ContainerContract) => void): void {\n this.#assertRoot('resolving')\n const key = keyOf(abstract)\n const list = this.shared.resolving.get(key) ?? []\n list.push(callback as Callback)\n this.shared.resolving.set(key, list)\n }\n\n forgetInstance(abstract: Abstract<unknown>): void {\n this.local.delete(keyOf(abstract))\n }\n\n /** Scopes are always plain Containers (never subclasses such as Application). */\n createScope(): Container {\n return new Container(this)\n }\n\n run<R>(fn: () => R): R {\n return storage.run(this, fn)\n }\n\n /** The nearest container in this -> parent scopes -> root that holds an instance for the key. */\n #owning(key: Key): Container | undefined {\n if (this.local.has(key)) return this\n return this.parent === undefined ? undefined : this.parent.#owning(key)\n }\n\n /** Bindings, extenders and callbacks are app-wide state: a request scope must never write them. */\n #assertRoot(method: string): void {\n if (this !== this.root) {\n throw new Error(\n `Cannot register bindings on a request scope (${method}). Register them on the application in a service provider; use instance() for per-request values.`,\n )\n }\n }\n\n #addBinding(abstract: Abstract<unknown>, concrete: Concrete<unknown> | undefined, lifetime: Lifetime): void {\n const key = keyOf(abstract)\n let factory: Factory<unknown>\n if (concrete === undefined) {\n if (typeof abstract !== 'function') throw new TypeError(`bind(${describe(abstract)}) needs a concrete: tokens can't be constructed`)\n factory = () => new (abstract as new () => unknown)()\n } else if (isClass(concrete)) {\n factory = () => new concrete()\n } else {\n factory = concrete as Factory<unknown>\n }\n this.shared.bindings.set(key, { lifetime, factory })\n this.local.delete(key)\n }\n\n #implicitBinding(abstract: Abstract<unknown>): Binding {\n if (typeof abstract === 'function') {\n return { lifetime: 'transient', factory: () => new (abstract as new () => unknown)() }\n }\n throw new BindingResolutionError(\n `Target [${abstract.description}] is not bound. Is its service provider registered in bootstrap/providers.ts?`,\n )\n }\n\n protected build(abstract: Abstract<unknown>, key: Key, binding: Binding): unknown {\n const stackIndex = building.keys.indexOf(key)\n if (stackIndex !== -1) {\n const chain = [...building.names.slice(stackIndex), describe(abstract)]\n throw new CircularDependencyError(chain)\n }\n building.keys.push(key)\n building.names.push(describe(abstract))\n building.containers.push(this)\n try {\n let instance = binding.factory(this)\n for (const extender of this.shared.extenders.get(key) ?? []) instance = extender(instance, this)\n for (const callback of this.shared.resolving.get(key) ?? []) callback(instance, this)\n this.shared.resolved.add(key)\n return instance\n } finally {\n building.keys.pop()\n building.names.pop()\n building.containers.pop()\n }\n }\n}\n","import { AsyncLocalStorage } from 'node:async_hooks'\nimport type { Abstract, Container } from '@orieljs/contracts'\nimport { describe } from './describe'\nimport { ContainerNotAvailableError } from './errors'\n\nconst ALS_KEY = Symbol.for('oriel:container.als')\nexport const GLOBAL_KEY = Symbol.for('oriel:container.instance')\nconst BUILDING_KEY = Symbol.for('oriel:container.building')\nconst g = globalThis as unknown as Record<symbol, unknown>\n\n/** One AsyncLocalStorage per process, even if @orieljs/container is installed twice. */\nexport const storage: AsyncLocalStorage<Container> = (g[ALS_KEY] ??= new AsyncLocalStorage<Container>()) as AsyncLocalStorage<Container>\n\n/** Synchronous build stack. Shared through globalThis so duplicate package copies share the same stack. */\nexport const building = (g[BUILDING_KEY] ??= {\n keys: [] as unknown[],\n names: [] as string[],\n containers: [] as Container[],\n}) as { keys: unknown[]; names: string[]; containers: Container[] }\n\nexport function currentContainer(): Container | undefined {\n return building.containers.at(-1) ?? storage.getStore() ?? (g[GLOBAL_KEY] as Container | undefined)\n}\n\nexport function inject<T>(abstract: Abstract<T>): T {\n const container = currentContainer()\n if (!container) throw new ContainerNotAvailableError(describe(abstract))\n return container.make(abstract)\n}\n","import type { Abstract } from '@orieljs/contracts'\n\nexport function describe(abstract: Abstract<unknown>): string {\n return typeof abstract === 'function' ? abstract.name || '<anonymous class>' : abstract.description\n}\n","import type { OrielError } from '@orieljs/contracts'\n\nexport class BindingResolutionError extends Error implements OrielError {\n readonly kind = 'BindingResolution' as const\n override readonly name = 'BindingResolutionError'\n}\n\nexport class CircularDependencyError extends Error implements OrielError {\n readonly kind = 'CircularDependency' as const\n override readonly name = 'CircularDependencyError'\n constructor(readonly chain: string[]) {\n super(`Circular dependency detected: ${chain.join(' -> ')}`)\n }\n}\n\nexport class ContainerNotAvailableError extends Error implements OrielError {\n readonly kind = 'ContainerNotAvailable' as const\n override readonly name = 'ContainerNotAvailableError'\n constructor(what: string) {\n super(\n `Cannot resolve [${what}]: no container is available. inject(), helpers and facades only work while the ` +\n `application is running (inside a request, job, command, provider or app.run()). ` +\n `Don't call them at module top level.`,\n )\n }\n}\n","export type Operator = '=' | '==' | '===' | '!=' | '!==' | '<>' | '<' | '<=' | '>' | '>='\n\nexport function compare(left: unknown, operator: Operator, right: unknown): boolean {\n switch (operator) {\n case '=':\n case '==':\n return left == right\n case '===':\n return left === right\n case '!=':\n case '<>':\n return left != right\n case '!==':\n return left !== right\n case '<':\n return (left as number) < (right as number)\n case '<=':\n return (left as number) <= (right as number)\n case '>':\n return (left as number) > (right as number)\n case '>=':\n return (left as number) >= (right as number)\n }\n}\n\n/** Ascending comparator: null/undefined last; numbers numerically; everything else by localeCompare. */\nexport function ascending(a: unknown, b: unknown): number {\n const aNil = a === null || a === undefined\n const bNil = b === null || b === undefined\n if (aNil || bNil) return aNil === bNil ? 0 : aNil ? 1 : -1\n if (typeof a === 'number' && typeof b === 'number') return a - b\n if (a instanceof Date && b instanceof Date) return a.getTime() - b.getTime()\n return String(a).localeCompare(String(b))\n}\n","import type { Arrayable, Enumerable } from '@orieljs/contracts'\nimport { ascending, compare, type Operator } from './compare'\n\ntype Getter<T, V = unknown> = (keyof T & string) | ((item: T) => V)\n\nconst read = <T>(item: T, getter: Getter<T>): unknown =>\n typeof getter === 'function' ? getter(item) : (item as Record<string, unknown> | null | undefined)?.[getter]\n\nconst isArrayable = (v: unknown): v is Arrayable =>\n typeof v === 'object' && v !== null && typeof (v as Arrayable).toArray === 'function'\n\nconst numbers = <T>(items: T[], getter?: Getter<T>): number[] =>\n items\n .map((item) => (getter === undefined ? item : read(item, getter)))\n .filter((v): v is number => typeof v === 'number' && !Number.isNaN(v))\n\nexport class Collection<T> implements Enumerable<T> {\n protected readonly items: T[]\n\n constructor(items: Iterable<T> = []) {\n this.items = [...items]\n }\n\n static make<T>(items: Iterable<T> = []): Collection<T> {\n return new Collection(items)\n }\n\n /** Laravel semantics: callback receives 1..n. */\n static times<T>(count: number, callback: (index: number) => T): Collection<T> {\n return new Collection(Array.from({ length: Math.max(0, count) }, (_, i) => callback(i + 1)))\n }\n\n [Symbol.iterator](): Iterator<T> {\n return this.items[Symbol.iterator]()\n }\n\n all(): T[] { return [...this.items] }\n count(): number { return this.items.length }\n isEmpty(): boolean { return this.items.length === 0 }\n isNotEmpty(): boolean { return this.items.length > 0 }\n toArray(): unknown[] { return this.items.map((i) => (isArrayable(i) ? i.toArray() : i)) }\n toJSON(): T[] { return this.all() }\n toJson(): string { return JSON.stringify(this) }\n\n map<U>(callback: (item: T, index: number) => U): Collection<U> {\n return new Collection(this.items.map(callback))\n }\n\n flatMap<U>(callback: (item: T, index: number) => U | U[] | Collection<U>): Collection<U> {\n return new Collection(\n this.items.flatMap((item, i) => {\n const out = callback(item, i)\n return out instanceof Collection ? out.all() : (out as U | U[])\n }) as U[],\n )\n }\n\n filter(callback?: (item: T, index: number) => unknown): Collection<T> {\n return new Collection(this.items.filter(callback ?? ((item) => Boolean(item))))\n }\n\n reject(callback: (item: T, index: number) => unknown): Collection<T> {\n return new Collection(this.items.filter((item, i) => !callback(item, i)))\n }\n\n /** Return false from the callback to stop. */\n each(callback: (item: T, index: number) => unknown): this {\n for (let i = 0; i < this.items.length; i++) if (callback(this.items[i]!, i) === false) break\n return this\n }\n\n reduce<U>(callback: (carry: U, item: T, index: number) => U, initial: U): U {\n return this.items.reduce(callback, initial)\n }\n\n first(): T | undefined\n first<D = undefined>(callback: (item: T, index: number) => unknown, defaultValue?: D): T | D\n first<D>(callback?: (item: T, index: number) => unknown, defaultValue?: D): T | D | undefined {\n if (!callback) return this.items[0]\n const index = this.items.findIndex(callback)\n return index === -1 ? defaultValue : this.items[index]\n }\n\n last(): T | undefined\n last<D = undefined>(callback: (item: T, index: number) => unknown, defaultValue?: D): T | D\n last<D>(callback?: (item: T, index: number) => unknown, defaultValue?: D): T | D | undefined {\n if (!callback) return this.items.at(-1)\n const index = this.items.findLastIndex(callback)\n return index === -1 ? defaultValue : this.items[index]\n }\n\n where(key: Getter<T>, value: unknown): Collection<T>\n where(key: Getter<T>, operator: Operator, value: unknown): Collection<T>\n where(key: Getter<T>, operatorOrValue: unknown, value?: unknown): Collection<T> {\n const [op, expected] = arguments.length === 2 ? (['=', operatorOrValue] as const) : [operatorOrValue as Operator, value]\n return this.filter((item) => compare(read(item, key), op, expected))\n }\n\n firstWhere(key: Getter<T>, value: unknown): T | undefined\n firstWhere(key: Getter<T>, operator: Operator, value: unknown): T | undefined\n firstWhere(key: Getter<T>, operatorOrValue: unknown, value?: unknown): T | undefined {\n const [op, expected] = arguments.length === 2 ? (['=', operatorOrValue] as const) : [operatorOrValue as Operator, value]\n return this.items.find((item) => compare(read(item, key), op, expected))\n }\n\n whereIn(key: Getter<T>, values: readonly unknown[]): Collection<T> {\n const set = new Set(values)\n return this.filter((item) => set.has(read(item, key)))\n }\n\n whereNotIn(key: Getter<T>, values: readonly unknown[]): Collection<T> {\n const set = new Set(values)\n return this.filter((item) => !set.has(read(item, key)))\n }\n\n pluck<K extends keyof T & string>(key: K): Collection<T[K]> {\n return this.map((item) => read(item, key) as T[K])\n }\n\n keyBy(key: Getter<T>): Record<string, T> {\n return Object.fromEntries(this.items.map((item) => [String(read(item, key)), item]))\n }\n\n groupBy(key: Getter<T>): Record<string, Collection<T>> {\n const groups: Record<string, Collection<T>> = {}\n for (const item of this.items) (groups[String(read(item, key))] ??= new Collection<T>()).push(item)\n return groups\n }\n\n mapWithKeys<V>(callback: (item: T, index: number) => readonly [string, V]): Record<string, V> {\n return Object.fromEntries(this.items.map(callback))\n }\n\n sortBy(key: Getter<T>, direction: 'asc' | 'desc' = 'asc'): Collection<T> {\n const sign = direction === 'asc' ? 1 : -1\n return new Collection(\n this.items\n .map((item, index) => ({ item, index, value: read(item, key) }))\n .sort((a, b) => {\n const aNil = a.value === null || a.value === undefined\n const bNil = b.value === null || b.value === undefined\n if (aNil || bNil) return aNil === bNil ? a.index - b.index : aNil ? 1 : -1 // nulls last both ways\n return sign * ascending(a.value, b.value) || a.index - b.index\n })\n .map((x) => x.item),\n )\n }\n\n sortByDesc(key: Getter<T>): Collection<T> {\n return this.sortBy(key, 'desc')\n }\n\n sum(key?: Getter<T>): number { return numbers(this.items, key).reduce((a, b) => a + b, 0) }\n avg(key?: Getter<T>): number | undefined {\n const values = numbers(this.items, key)\n return values.length ? values.reduce((a, b) => a + b, 0) / values.length : undefined\n }\n min(key?: Getter<T>): number | undefined {\n const values = numbers(this.items, key)\n return values.length ? Math.min(...values) : undefined\n }\n max(key?: Getter<T>): number | undefined {\n const values = numbers(this.items, key)\n return values.length ? Math.max(...values) : undefined\n }\n\n unique(key?: Getter<T>): Collection<T> {\n const seen = new Set<unknown>()\n return this.filter((item) => {\n const v = key === undefined ? item : read(item, key)\n if (seen.has(v)) return false\n seen.add(v)\n return true\n })\n }\n\n chunk(size: number): Collection<Collection<T>> {\n if (size <= 0) return new Collection()\n const chunks: Collection<T>[] = []\n for (let i = 0; i < this.items.length; i += size) chunks.push(new Collection(this.items.slice(i, i + size)))\n return new Collection(chunks)\n }\n\n /** Negative count takes from the end. */\n take(count: number): Collection<T> {\n return new Collection(count < 0 ? this.items.slice(count) : this.items.slice(0, count))\n }\n skip(count: number): Collection<T> { return new Collection(this.items.slice(count)) }\n slice(offset: number, length?: number): Collection<T> {\n return new Collection(this.items.slice(offset, length === undefined ? undefined : offset + length))\n }\n values(): Collection<T> { return new Collection(this.items) }\n\n contains(key: keyof T & string, value: unknown): boolean\n contains(callback: (item: T) => boolean): boolean\n contains(value: unknown): boolean\n contains(keyOrValue: unknown, value?: unknown): boolean {\n if (arguments.length === 2) return this.items.some((item) => read(item, keyOrValue as keyof T & string) === value)\n if (typeof keyOrValue === 'function') return this.items.some(keyOrValue as (item: T) => boolean)\n return this.items.includes(keyOrValue as T)\n }\n\n /** Mutates, like Laravel. */\n push(...values: T[]): this {\n this.items.push(...values)\n return this\n }\n\n concat(values: Iterable<T>): Collection<T> {\n return new Collection([...this.items, ...values])\n }\n\n partition(callback: (item: T, index: number) => unknown): [Collection<T>, Collection<T>] {\n return [this.filter(callback), this.reject(callback)]\n }\n\n implode(glue: string): string\n implode(key: keyof T & string, glue: string): string\n implode(keyOrGlue: string, glue?: string): string {\n if (glue === undefined) return this.items.join(keyOrGlue)\n return this.items.map((item) => read(item, keyOrGlue as keyof T & string)).join(glue)\n }\n\n when<U = this>(condition: unknown, callback: (collection: this) => U): U | this {\n return condition ? callback(this) : this\n }\n\n pipe<U>(callback: (collection: this) => U): U { return callback(this) }\n\n tap(callback: (collection: this) => void): this {\n callback(this)\n return this\n }\n}\n\nexport function collect<T>(items: Iterable<T> = []): Collection<T> {\n return new Collection(items)\n}\n","import { Collection } from './Collection'\n\ntype Source<T> = () => AsyncIterable<T> | Iterable<T>\n\n/** Pull-based and async: for DB cursors (Model.lazy()) and large files. */\nexport class LazyCollection<T> implements AsyncIterable<T> {\n constructor(private readonly source: Source<T>) {}\n\n static make<T>(source: Source<T>): LazyCollection<T> {\n return new LazyCollection(source)\n }\n\n async *[Symbol.asyncIterator](): AsyncIterator<T> {\n yield* this.source()\n }\n\n map<U>(callback: (item: T, index: number) => U | Promise<U>): LazyCollection<U> {\n const self = this\n return new LazyCollection(async function* () {\n let i = 0\n for await (const item of self) yield await callback(item, i++)\n })\n }\n\n filter(callback: (item: T, index: number) => unknown): LazyCollection<T> {\n const self = this\n return new LazyCollection(async function* () {\n let i = 0\n for await (const item of self) if (await callback(item, i++)) yield item\n })\n }\n\n take(count: number): LazyCollection<T> {\n const self = this\n return new LazyCollection(async function* () {\n if (count <= 0) return\n let taken = 0\n for await (const item of self) {\n yield item\n if (++taken >= count) return\n }\n })\n }\n\n chunk(size: number): LazyCollection<Collection<T>> {\n const self = this\n return new LazyCollection(async function* () {\n if (size <= 0) return\n let buffer: T[] = []\n for await (const item of self) {\n buffer.push(item)\n if (buffer.length === size) {\n yield new Collection(buffer)\n buffer = []\n }\n }\n if (buffer.length) yield new Collection(buffer)\n })\n }\n\n /** Return false from the callback to stop. */\n async each(callback: (item: T, index: number) => unknown): Promise<void> {\n let i = 0\n for await (const item of this) if ((await callback(item, i++)) === false) return\n }\n\n async first(callback?: (item: T) => unknown): Promise<T | undefined> {\n for await (const item of this) if (!callback || (await callback(item))) return item\n return undefined\n }\n\n async count(): Promise<number> {\n let n = 0\n for await (const item of this) {\n void item\n n++\n }\n return n\n }\n\n async collect(): Promise<Collection<T>> {\n const items: T[] = []\n for await (const item of this) items.push(item)\n return new Collection(items)\n }\n}\n","import { randomBytes, randomUUID } from 'node:crypto'\nimport pluralize from 'pluralize'\n\nconst words = (value: string): string[] =>\n value\n .replace(/([a-z\\d])([A-Z])/g, '$1 $2')\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2')\n .split(/[^A-Za-z\\d]+/)\n .filter(Boolean)\n\nconst ALPHANUM = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'\nconst escapeRegex = (s: string) => s.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')\nconst anyOf = (needles: string | string[]) => (Array.isArray(needles) ? needles : [needles]).filter((n) => n !== '')\n\nexport const Str = {\n ucfirst: (v: string) => v.charAt(0).toUpperCase() + v.slice(1),\n lcfirst: (v: string) => v.charAt(0).toLowerCase() + v.slice(1),\n studly: (v: string) => words(v).map((w) => Str.ucfirst(w.toLowerCase())).join(''),\n camel: (v: string) => Str.lcfirst(Str.studly(v)),\n snake: (v: string, delimiter = '_') => words(v).map((w) => w.toLowerCase()).join(delimiter),\n kebab: (v: string) => Str.snake(v, '-'),\n title: (v: string) => v.toLowerCase().replace(/(^|\\s)\\S/g, (m) => m.toUpperCase()),\n slug: (v: string, separator = '-') =>\n v\n .normalize('NFKD')\n .replace(/[̀-ͯ]/g, '')\n .toLowerCase()\n .replace(/[^a-z\\d]+/g, separator)\n .replace(new RegExp(`^${escapeRegex(separator)}+|${escapeRegex(separator)}+$`, 'g'), ''),\n plural: (v: string, count = 2) => pluralize(v, count),\n singular: (v: string) => pluralize.singular(v),\n random: (length = 16) => {\n let out = ''\n while (out.length < length) {\n for (const byte of randomBytes(length)) {\n if (byte < 248 && out.length < length) out += ALPHANUM[byte % 62] // 248 = 62*4, avoids modulo bias\n }\n }\n return out\n },\n uuid: () => randomUUID(),\n /** Wildcard match: `*` matches anything; everything else is literal. */\n is: (pattern: string, value: string) =>\n pattern === value || new RegExp(`^${pattern.split('*').map(escapeRegex).join('.*')}$`, 's').test(value),\n startsWith: (v: string, needles: string | string[]) => anyOf(needles).some((n) => v.startsWith(n)),\n endsWith: (v: string, needles: string | string[]) => anyOf(needles).some((n) => v.endsWith(n)),\n contains: (v: string, needles: string | string[]) => anyOf(needles).some((n) => v.includes(n)),\n after: (v: string, search: string) => (search === '' || !v.includes(search) ? v : v.slice(v.indexOf(search) + search.length)),\n afterLast: (v: string, search: string) =>\n search === '' || !v.includes(search) ? v : v.slice(v.lastIndexOf(search) + search.length),\n before: (v: string, search: string) => (search === '' || !v.includes(search) ? v : v.slice(0, v.indexOf(search))),\n beforeLast: (v: string, search: string) =>\n search === '' || !v.includes(search) ? v : v.slice(0, v.lastIndexOf(search)),\n between: (v: string, from: string, to: string) => Str.beforeLast(Str.after(v, from), to),\n limit: (v: string, limit = 100, end = '...') => (v.length <= limit ? v : v.slice(0, limit).trimEnd() + end),\n start: (v: string, prefix: string) => (v.startsWith(prefix) ? v : prefix + v),\n finish: (v: string, cap: string) => (v.endsWith(cap) ? v : v + cap),\n}\n","type Obj = Record<string, unknown>\nconst FORBIDDEN = new Set(['__proto__', 'prototype', 'constructor'])\nconst isWalkable = (v: unknown): v is Obj => typeof v === 'object' && v !== null\nconst segments = (key: string) => key.split('.')\n\nexport const Arr = {\n get<T = unknown>(target: unknown, key: string | undefined, defaultValue?: T): T {\n if (key === undefined || key === '') return target as T\n let current: unknown = target\n for (const segment of segments(key)) {\n if (!isWalkable(current) || !Object.hasOwn(current, segment)) return defaultValue as T\n current = current[segment]\n }\n return current as T\n },\n\n has(target: unknown, key: string): boolean {\n const missing = Symbol('missing')\n return Arr.get(target, key, missing) !== missing\n },\n\n set(target: Obj, key: string, value: unknown): Obj {\n const parts = segments(key)\n if (parts.some((p) => FORBIDDEN.has(p))) throw new Error(`Refusing to set unsafe key \"${key}\"`)\n let current: Obj = target\n parts.slice(0, -1).forEach((segment) => {\n if (!isWalkable(current[segment])) current[segment] = {}\n current = current[segment] as Obj\n })\n current[parts.at(-1)!] = value\n return target\n },\n\n forget(target: Obj, key: string): void {\n const parts = segments(key)\n const parent = parts.length === 1 ? target : Arr.get<unknown>(target, parts.slice(0, -1).join('.'))\n if (isWalkable(parent)) delete parent[parts.at(-1)!]\n },\n\n dot(target: Obj, prefix = ''): Obj {\n const out: Obj = {}\n for (const [k, v] of Object.entries(target)) {\n const path = prefix + k\n if (isWalkable(v) && Object.keys(v).length > 0) Object.assign(out, Arr.dot(v as Obj, `${path}.`))\n else out[path] = v\n }\n return out\n },\n\n undot(flat: Obj): Obj {\n const out: Obj = {}\n for (const [k, v] of Object.entries(flat)) Arr.set(out, k, v)\n return out\n },\n\n only<T extends Obj>(target: T, keys: string[]): Partial<T> {\n return Object.fromEntries(keys.filter((k) => Object.hasOwn(target, k)).map((k) => [k, target[k]])) as Partial<T>\n },\n\n except<T extends Obj>(target: T, keys: string[]): Partial<T> {\n const skip = new Set(keys)\n return Object.fromEntries(Object.entries(target).filter(([k]) => !skip.has(k))) as Partial<T>\n },\n\n wrap<T>(value: T | T[] | null | undefined): T[] {\n if (value === null || value === undefined) return []\n return Array.isArray(value) ? value : [value]\n },\n\n first<T, D = undefined>(items: readonly T[], predicate?: (item: T, index: number) => boolean, defaultValue?: D): T | D {\n const index = predicate ? items.findIndex(predicate) : items.length > 0 ? 0 : -1\n return index === -1 ? (defaultValue as D) : items[index]!\n },\n\n last<T, D = undefined>(items: readonly T[], predicate?: (item: T, index: number) => boolean, defaultValue?: D): T | D {\n const index = predicate ? items.findLastIndex(predicate) : items.length - 1\n return index === -1 ? (defaultValue as D) : items[index]!\n },\n}\n","import { ConfigRepository, type Application, type ServiceProvider as ServiceProviderContract } from '@orieljs/contracts'\n\nexport abstract class ServiceProvider implements ServiceProviderContract {\n constructor(protected readonly app: Application) {}\n\n register(): void {}\n\n boot(): void | Promise<void> {}\n\n /** Package defaults under `key`; values the app already set win (shallow merge, like Laravel). */\n protected mergeConfigFrom(defaults: Record<string, unknown>, key: string): void {\n const config = this.app.make(ConfigRepository)\n config.set(key, { ...defaults, ...config.get<Record<string, unknown>>(key, {}) })\n }\n}\n","import type { Abstract } from '@orieljs/contracts'\nimport { ContainerNotAvailableError, currentContainer, describe } from '@orieljs/container'\n\nexport interface FacadeStatics<T> {\n getFacadeRoot(): T\n /** Replace the instance in the current container (used by X.fake()). */\n swap(instance: T): void\n}\nexport type Facade<T, X = object> = T & X & FacadeStatics<T>\n\nexport function facade<T extends object, X extends object = object>(abstract: Abstract<T>, extras?: X): Facade<T, X> {\n const container = () => {\n const c = currentContainer()\n if (!c) throw new ContainerNotAvailableError(describe(abstract))\n return c\n }\n const statics: FacadeStatics<T> = {\n getFacadeRoot: () => container().make(abstract),\n swap: (instance) => void container().instance(abstract, instance),\n }\n\n const proxy: Facade<T, X> = new Proxy({} as Facade<T, X>, {\n get(_target, prop) {\n if (typeof prop === 'symbol' || prop === 'then') return undefined\n if (extras && Object.hasOwn(extras, prop)) {\n const extra = (extras as Record<string, unknown>)[prop]\n return typeof extra === 'function' ? extra.bind(proxy) : extra\n }\n if (Object.hasOwn(statics, prop)) return statics[prop as keyof FacadeStatics<T>]\n const root = statics.getFacadeRoot()\n const value = Reflect.get(root, prop, root)\n return typeof value === 'function' ? value.bind(root) : value\n },\n })\n return proxy\n}\n","import type { Class, ClassRegistry as ClassRegistryContract } from '@orieljs/contracts'\n\nexport class ClassRegistry implements ClassRegistryContract {\n private readonly byName = new Map<string, Class<unknown>>()\n private readonly byClass = new Map<Class<unknown>, string>()\n\n register(cls: Class<unknown>, name: string = cls.name): string {\n const existingName = this.byClass.get(cls)\n if (existingName !== undefined) return existingName\n if (!name) throw new Error('Anonymous classes need an explicit name: registry.register(cls, \"Some.Name\")')\n const existing = this.byName.get(name)\n if (existing && existing !== cls) {\n throw new Error(`\"${name}\" is already registered to a different class. Pass an explicit name: register(cls, \"Module.${name}\")`)\n }\n this.byName.set(name, cls)\n this.byClass.set(cls, name)\n return name\n }\n\n nameOf(cls: Class<unknown>): string | undefined {\n return this.byClass.get(cls)\n }\n\n resolve<T = unknown>(name: string): Class<T> {\n const cls = this.byName.get(name)\n if (!cls) throw new Error(`No class registered as \"${name}\". Is it registered by its service provider?`)\n return cls as Class<T>\n }\n\n has(name: string): boolean {\n return this.byName.has(name)\n }\n}\n","import { setTimeout as sleep } from 'node:timers/promises'\nimport { Application, ConfigRepository, type Abstract } from '@orieljs/contracts'\nimport { currentContainer, inject } from '@orieljs/container'\n\nexport { collect } from '@orieljs/collections'\n\n/** Container methods that must act on the current (request) scope rather than on the root application. */\nconst SCOPE_METHODS = new Set<PropertyKey>(['make', 'instance', 'bound', 'resolved', 'forgetInstance', 'createScope', 'run'])\nconst scopedViews = new WeakMap<object, Application>()\n\n/** The application, seen from `scope`: container methods hit the scope, everything else hits the application. */\nfunction viewFrom(scope: object, application: Application): Application {\n let view = scopedViews.get(scope)\n if (view === undefined) {\n view = new Proxy(application, {\n get(target, property) {\n const source: object = SCOPE_METHODS.has(property) ? scope : target\n const member: unknown = Reflect.get(source, property, source)\n return typeof member === 'function' ? member.bind(source) : member\n },\n })\n scopedViews.set(scope, view)\n }\n return view\n}\n\n/**\n * The application, or an abstract resolved from the current container.\n * Inside a request scope, app().make()/instance()/… act on that scope, so app().make(X) sees scoped services.\n */\nexport function app(): Application\nexport function app<T>(abstract: Abstract<T>): T\nexport function app<T>(abstract?: Abstract<T>): T | Application {\n if (abstract !== undefined) return inject(abstract)\n const application = inject(Application)\n const current = currentContainer()\n return current === undefined || current === application ? application : viewFrom(current, application)\n}\n\nexport function config(): ConfigRepository\nexport function config(values: Record<string, unknown>): void\nexport function config<T = unknown>(key: string, defaultValue?: T): T\nexport function config(keyOrValues?: string | Record<string, unknown>, defaultValue?: unknown): unknown {\n const repository = inject(ConfigRepository)\n if (keyOrValues === undefined) return repository\n if (typeof keyOrValues === 'string') return repository.get(keyOrValues, defaultValue)\n repository.set(keyOrValues)\n return undefined\n}\n\nexport const now = (): Date => new Date()\n\nexport const value = <T>(v: T | (() => T)): T => (typeof v === 'function' ? (v as () => T)() : v)\n\nexport function tap<T>(target: T, callback: (target: T) => void): T {\n callback(target)\n return target\n}\n\n/** Calls fn up to `times` times (attempt numbers are 1-based). Rethrows the last error, or the first one `when` rejects. */\nexport async function retry<T>(\n times: number,\n fn: (attempt: number) => T | Promise<T>,\n sleepMs: number | ((attempt: number) => number) = 0,\n when?: (error: unknown) => boolean,\n): Promise<T> {\n for (let attempt = 1; ; attempt++) {\n try {\n return await fn(attempt)\n } catch (error) {\n if (attempt >= times || (when && !when(error))) throw error\n const ms = typeof sleepMs === 'function' ? sleepMs(attempt) : sleepMs\n if (ms > 0) await sleep(ms)\n }\n }\n}\n","/** Laravel's English lang/en/auth.php and lang/en/passwords.php. */\nconst LINES: Record<string, string> = {\n 'auth.failed': 'These credentials do not match our records.',\n 'auth.password': 'The provided password is incorrect.',\n 'auth.throttle': 'Too many login attempts. Please try again in :seconds seconds.',\n 'passwords.reset': 'Your password has been reset.',\n 'passwords.sent': 'We have emailed your password reset link.',\n 'passwords.throttled': 'Please wait before retrying.',\n 'passwords.token': 'This password reset token is invalid.',\n 'passwords.user': \"We can't find a user with that email address.\",\n}\n\n/**\n * Laravel's __(): the line for `key` with `:placeholders` filled (`:name`, `:Name` capitalized, `:NAME` upper-cased),\n * longest placeholder first. A key with no line comes back as is, so a sentence can be its own key:\n * __('auth.failed'), __('auth.throttle', { seconds: 30 }), __('A reset link will be sent if the account exists.').\n */\nexport function __(key: string, replace: Record<string, string | number> = {}): string {\n let line = LINES[key] ?? key\n const names = Object.keys(replace).sort((a, b) => b.length - a.length)\n for (const name of names) {\n const value = String(replace[name])\n const capitalized = name.charAt(0).toUpperCase() + name.slice(1)\n line = line\n .replaceAll(`:${capitalized}`, value.charAt(0).toUpperCase() + value.slice(1))\n .replaceAll(`:${name.toUpperCase()}`, value.toUpperCase())\n .replaceAll(`:${name}`, value)\n }\n return line\n}\n","/**\n * What a file's bytes show it to be, read from its leading bytes the way PHP's finfo reads them for Laravel (the file\n * validation rules, and the extension a stored upload gets). The client's file name and MIME type are never consulted.\n */\nexport interface DetectedType {\n /** 'image/png', 'text/plain', …; 'application/octet-stream' when no format matches, 'application/x-empty' for no bytes. */\n readonly mime: string\n /** The extensions that name the type, the usual one first. Empty when the bytes match no format. */\n readonly extensions: readonly string[]\n}\n\n/** Frozen, extensions too: the types are shared constants, compared by identity. */\nconst type = (mime: string, ...extensions: string[]): DetectedType =>\n Object.freeze({ mime, extensions: Object.freeze(extensions) })\n\nexport const JPEG = type('image/jpeg', 'jpg', 'jpeg')\nexport const PNG = type('image/png', 'png')\nexport const GIF = type('image/gif', 'gif')\nexport const WEBP = type('image/webp', 'webp')\nexport const AVIF = type('image/avif', 'avif')\nexport const BMP = type('image/bmp', 'bmp')\nexport const SVG = type('image/svg+xml', 'svg')\nexport const PDF = type('application/pdf', 'pdf')\nexport const HTML = type('text/html', 'html', 'htm')\nexport const XML = type('text/xml', 'xml')\nexport const TEXT = type('text/plain', 'txt')\nexport const UNKNOWN = type('application/octet-stream')\nexport const EMPTY = type('application/x-empty')\n\n/** The raster formats the image rule accepts: Laravel 12's jpg, jpeg, png, gif, bmp and webp, plus AVIF. */\nexport const RASTER_IMAGES: ReadonlySet<string> = new Set([JPEG, PNG, GIF, WEBP, AVIF, BMP].map(({ mime }) => mime))\n\n/** Every format recognised by its bytes other than plain text. */\nexport const BINARY_AND_MARKUP_TYPES: readonly DetectedType[] = [JPEG, PNG, GIF, WEBP, AVIF, BMP, SVG, PDF, HTML, XML]\n\n/**\n * How much of a file is read to tell its type: the window checked for binary bytes (libmagic reads its first megabyte\n * too). Uploads read this much to be named, so naming and validation see the same bytes.\n */\nexport const SNIFF_BYTES = 1024 * 1024\n/** How much is decoded to find the root element of markup. */\nconst MARKUP_SNIFF_BYTES = 64 * 1024\n/** How many prolog items (declarations, comments, doctypes) are walked to find the root element (real files: a few). */\nconst MAX_PROLOG_ITEMS = 64\n/**\n * 1 for each byte text never contains: every control byte but BEL, BS, TAB, LF, VT, FF, CR and ESC (libmagic's text\n * characters), and DEL.\n */\nconst BINARY_BYTES = new Uint8Array(256).fill(1, 0, 0x20)\nfor (const byte of [0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x1b]) BINARY_BYTES[byte] = 0\nBINARY_BYTES[0x7f] = 1\n/** How much of an ftyp box is searched for its brands, whatever size it claims (real ones name a handful). */\nconst FTYP_SCAN_BYTES = 1024\n/** The sizes of the BMP info headers (core, info, v2 to v5). */\nconst BMP_HEADER_SIZES: ReadonlySet<number> = new Set([12, 40, 52, 56, 64, 108, 124])\n\nconst ascii = (bytes: Uint8Array, offset: number, length: number): string =>\n String.fromCharCode(...bytes.subarray(offset, offset + length))\n\nconst startsWith = (bytes: Uint8Array, signature: readonly number[]): boolean =>\n bytes.length >= signature.length && signature.every((byte, i) => bytes[i] === byte)\n\nconst u32be = (bytes: Uint8Array, offset: number): number =>\n ((bytes[offset]! << 24) | (bytes[offset + 1]! << 16) | (bytes[offset + 2]! << 8) | bytes[offset + 3]!) >>> 0\n\nconst u32le = (bytes: Uint8Array, offset: number): number =>\n (bytes[offset]! | (bytes[offset + 1]! << 8) | (bytes[offset + 2]! << 16) | (bytes[offset + 3]! << 24)) >>> 0\n\n/** The type the bytes show. */\nexport function detectFileType(bytes: Uint8Array): DetectedType {\n if (bytes.length === 0) return EMPTY\n if (startsWith(bytes, [0xff, 0xd8, 0xff])) return JPEG\n if (startsWith(bytes, [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a])) return PNG\n const head = ascii(bytes, 0, 6)\n if (head === 'GIF87a' || head === 'GIF89a') return GIF\n if (ascii(bytes, 0, 4) === 'RIFF' && ascii(bytes, 8, 4) === 'WEBP') return WEBP\n if (isAvif(bytes)) return AVIF\n if (ascii(bytes, 0, 2) === 'BM' && bytes.length >= 18 && BMP_HEADER_SIZES.has(u32le(bytes, 14))) return BMP\n if (ascii(bytes, 0, 5) === '%PDF-') return PDF\n return detectText(bytes)\n}\n\n/** An ISO-BMFF file whose ftyp box names the avif (still) or avis (sequence) brand, as its major or a compatible brand. */\nfunction isAvif(bytes: Uint8Array): boolean {\n if (bytes.length < 16 || ascii(bytes, 4, 4) !== 'ftyp') return false\n const isAvifBrand = (offset: number): boolean => {\n const brand = ascii(bytes, offset, 4)\n return brand === 'avif' || brand === 'avis'\n }\n if (isAvifBrand(8)) return true\n const end = Math.min(u32be(bytes, 0), bytes.length, FTYP_SCAN_BYTES)\n for (let offset = 16; offset + 4 <= end; offset += 4) {\n if (isAvifBrand(offset)) return true\n }\n return false\n}\n\n/** Text has no binary control bytes; markup is told apart by its root element. */\nfunction detectText(bytes: Uint8Array): DetectedType {\n const end = Math.min(bytes.length, SNIFF_BYTES)\n for (let i = 0; i < end; i++) {\n if (BINARY_BYTES[bytes[i]!] === 1) return UNKNOWN\n }\n const content = new TextDecoder().decode(bytes.subarray(0, MARKUP_SNIFF_BYTES)).trimStart()\n if (!content.startsWith('<')) return TEXT\n const root = rootElement(content)\n if (root === 'svg' || root?.endsWith(':svg')) return SVG\n if (root === 'html') return HTML\n return content.startsWith('<?xml') ? XML : HTML\n}\n\n/**\n * The name of the first element (lower-cased), after the XML declaration, processing instructions, comments and\n * doctype. None when the prolog doesn't end or has more than MAX_PROLOG_ITEMS items, so such markup is never read as\n * SVG.\n */\nfunction rootElement(markup: string): string | undefined {\n let rest = markup\n for (let items = 0; ; items++) {\n const skip = prologItemLength(rest)\n if (skip === 0) return /^<([A-Za-z_][\\w.:-]*)/.exec(rest)?.[1]?.toLowerCase()\n if (skip === -1 || items === MAX_PROLOG_ITEMS) return undefined\n rest = rest.slice(skip).trimStart()\n }\n}\n\n/** How many characters the prolog item at the start takes: 0 when it starts an element (or isn't markup), -1 when it never ends. */\nfunction prologItemLength(rest: string): number {\n const through = (index: number, length: number) => (index === -1 ? -1 : index + length)\n if (rest.startsWith('<?')) return through(rest.indexOf('?>'), 2)\n if (rest.startsWith('<!--')) return through(rest.indexOf('-->'), 3)\n if (/^<!doctype/i.test(rest)) {\n // An internal subset ([ … ]) opens before the doctype's first '>', and may itself contain '>'.\n const close = rest.indexOf('>')\n if (close === -1) return -1\n const subset = rest.slice(0, close).indexOf('[')\n if (subset === -1) return close + 1\n const subsetEnd = rest.indexOf(']', subset)\n return subsetEnd === -1 ? -1 : through(rest.indexOf('>', subsetEnd), 1)\n }\n return 0\n}\n"],"mappings":";;;;;;;ACAA,SAAS,yBAAyB;ACE3B,SAAS,SAAS,UAAqC;AAC5D,SAAO,OAAO,aAAa,aAAa,SAAS,QAAQ,sBAAsB,SAAS;AAC1F;ACFO,IAAM,yBAAN,cAAqC,MAA4B;EAC7D,OAAO;EACE,OAAO;AAC3B;AAEO,IAAM,0BAAN,cAAsC,MAA4B;EAGvE,YAAqB,OAAiB;AACpC,UAAM,iCAAiC,MAAM,KAAK,MAAM,CAAC,EAAE;AADxC,SAAA,QAAA;EAErB;EAFqB;EAFZ,OAAO;EACE,OAAO;AAI3B;AAEO,IAAM,6BAAN,cAAyC,MAA4B;EACjE,OAAO;EACE,OAAO;EACzB,YAAY,MAAc;AACxB;MACE,mBAAmB,IAAI;IAGzB;EACF;AACF;AFpBA,IAAM,UAAU,uBAAO,IAAI,qBAAqB;AACzC,IAAM,aAAa,uBAAO,IAAI,0BAA0B;AAC/D,IAAM,eAAe,uBAAO,IAAI,0BAA0B;AAC1D,IAAM,IAAI;AAGH,IAAM,UAAyC,EAAE,OAAO,MAAM,IAAI,kBAA6B;AAG/F,IAAM,WAAY,EAAE,YAAY,MAAM;EAC3C,MAAM,CAAC;EACP,OAAO,CAAC;EACR,YAAY,CAAC;AACf;AAEO,SAAS,mBAA0C;AACxD,SAAO,SAAS,WAAW,GAAG,EAAE,KAAK,QAAQ,SAAS,KAAM,EAAE,UAAU;AAC1E;AAEO,SAAS,OAAU,UAA0B;AAClD,QAAM,YAAY,iBAAiB;AACnC,MAAI,CAAC,UAAW,OAAM,IAAI,2BAA2B,SAAS,QAAQ,CAAC;AACvE,SAAO,UAAU,KAAK,QAAQ;AAChC;ADVA,IAAM,UAAU;AAEhB,IAAM,QAAQ,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