fix(products): fix breadcrumbs and product filtering (backport from main)
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled

This commit is contained in:
2026-02-24 16:04:21 +01:00
parent 915eb61613
commit 5397309103
43805 changed files with 4324295 additions and 3 deletions
@@ -0,0 +1,84 @@
import { withIsolationScope, getCurrentScope, extractTraceparentData, captureException } from '@sentry/core';
function isReactClassComponent(target) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
return typeof target === 'function' && target?.prototype?.isReactComponent;
}
/**
* Wraps a page component with Sentry error instrumentation.
*/
function wrapPageComponentWithSentry(pageComponent) {
if (isReactClassComponent(pageComponent)) {
return class SentryWrappedPageComponent extends pageComponent {
render(...args) {
return withIsolationScope(() => {
const scope = getCurrentScope();
// We extract the sentry trace data that is put in the component props by datafetcher wrappers
const sentryTraceData =
typeof this.props === 'object' &&
this.props !== null &&
'_sentryTraceData' in this.props &&
typeof this.props._sentryTraceData === 'string'
? this.props._sentryTraceData
: undefined;
if (sentryTraceData) {
const traceparentData = extractTraceparentData(sentryTraceData);
scope.setContext('trace', {
span_id: traceparentData?.parentSpanId,
trace_id: traceparentData?.traceId,
});
}
try {
return super.render(...args);
} catch (e) {
captureException(e, {
mechanism: {
handled: false,
type: 'auto.function.nextjs.page_class',
},
});
throw e;
}
});
}
};
} else if (typeof pageComponent === 'function') {
return new Proxy(pageComponent, {
apply(target, thisArg, argArray) {
return withIsolationScope(() => {
const scope = getCurrentScope();
// We extract the sentry trace data that is put in the component props by datafetcher wrappers
const sentryTraceData = argArray?.[0]?._sentryTraceData;
if (sentryTraceData) {
const traceparentData = extractTraceparentData(sentryTraceData);
scope.setContext('trace', {
span_id: traceparentData?.parentSpanId,
trace_id: traceparentData?.traceId,
});
}
try {
return target.apply(thisArg, argArray);
} catch (e) {
captureException(e, {
mechanism: {
handled: false,
type: 'auto.function.nextjs.page_function',
},
});
throw e;
}
});
},
});
} else {
return pageComponent;
}
}
export { wrapPageComponentWithSentry };
//# sourceMappingURL=wrapPageComponentWithSentry.js.map
@@ -0,0 +1,2 @@
import { rangeRight } from "./index";
export = rangeRight;
@@ -0,0 +1,105 @@
import { Client, Integration, ReplayRecordingMode } from '@sentry/core';
import { ReplayConfiguration, SendBufferedReplayOptions } from './types';
/**
* Instruments the global Request constructor to store the original body.
* This allows us to retrieve the original body value later, since Request
* converts string bodies to ReadableStreams.
*/
export declare function _INTERNAL_instrumentRequestInterface(): void;
/**
* Sentry integration for [Session Replay](https://sentry.io/for/session-replay/).
*
* See the [Replay documentation](https://docs.sentry.io/platforms/javascript/guides/session-replay/) for more information.
*
* @example
*
* ```
* Sentry.init({
* dsn: '__DSN__',
* integrations: [Sentry.replayIntegration()],
* });
* ```
*/
export declare const replayIntegration: (options?: ReplayConfiguration) => Replay;
/**
* Replay integration
*/
export declare class Replay implements Integration {
/**
* @inheritDoc
*/
name: string;
/**
* Options to pass to `rrweb.record()`
*/
private readonly _recordingOptions;
/**
* Initial options passed to the replay integration, merged with default values.
* Note: `sessionSampleRate` and `errorSampleRate` are not required here, as they
* can only be finally set when setupOnce() is called.
*
* @private
*/
private readonly _initialOptions;
private _replay?;
constructor({ flushMinDelay, flushMaxDelay, minReplayDuration, maxReplayDuration, stickySession, useCompression, workerUrl, _experiments, maskAllText, maskAllInputs, blockAllMedia, mutationBreadcrumbLimit, mutationLimit, slowClickTimeout, slowClickIgnoreSelectors, networkDetailAllowUrls, networkDetailDenyUrls, networkCaptureBodies, networkRequestHeaders, networkResponseHeaders, mask, maskAttributes, unmask, block, unblock, ignore, maskFn, beforeAddRecordingEvent, beforeErrorSampling, onError, attachRawBodyFromRequest, }?: ReplayConfiguration);
/*If replay has already been initialized
Update _isInitialized */
protected _isInitialized: boolean;
/**
* Setup and initialize replay container
*/
afterAllSetup(client: Client): void;
/**
* Start a replay regardless of sampling rate. Calling this will always
* create a new session. Will log a message if replay is already in progress.
*
* Creates or loads a session, attaches listeners to varying events (DOM,
* PerformanceObserver, Recording, Sentry SDK, etc)
*/
start(): void;
/**
* Start replay buffering. Buffers until `flush()` is called or, if
* `replaysOnErrorSampleRate` > 0, until an error occurs.
*/
startBuffering(): void;
/**
* Currently, this needs to be manually called (e.g. for tests). Sentry SDK
* does not support a teardown
*/
stop(): Promise<void>;
/**
* If not in "session" recording mode, flush event buffer which will create a new replay.
* If replay is not enabled, a new session replay is started.
* Unless `continueRecording` is false, the replay will continue to record and
* behave as a "session"-based replay.
*
* Otherwise, queue up a flush.
*/
flush(options?: SendBufferedReplayOptions): Promise<void>;
/**
* Get the current session ID.
*
* @param onlyIfSampled - If true, will only return the session ID if the session is sampled.
*
*/
getReplayId(onlyIfSampled?: boolean): string | undefined;
/**
* Get the current recording mode. This can be either `session` or `buffer`.
*
* `session`: Recording the whole session, sending it continuously
* `buffer`: Always keeping the last 60s of recording, requires:
* - having replaysOnErrorSampleRate > 0 to capture replay when an error occurs
* - or calling `flush()` to send the replay
*/
getRecordingMode(): ReplayRecordingMode | undefined;
/**
* Initializes replay.
*/
protected _initialize(client: Client): void;
/** Setup the integration. */
private _setup;
/** Get canvas options from ReplayCanvas integration, if it is also added. */
private _maybeLoadFromReplayCanvasIntegration;
}
//# sourceMappingURL=integration.d.ts.map
@@ -0,0 +1,24 @@
import type { ColumnBuilderBaseConfig } from "../../column-builder.cjs";
import type { ColumnBaseConfig } from "../../column.cjs";
import { entityKind } from "../../entity.cjs";
import { GelColumn } from "./common.cjs";
import { GelIntColumnBaseBuilder } from "./int.common.cjs";
export type GelBigInt64BuilderInitial<TName extends string> = GelBigInt64Builder<{
name: TName;
dataType: 'bigint';
columnType: 'GelBigInt64';
data: bigint;
driverParam: bigint;
enumValues: undefined;
}>;
export declare class GelBigInt64Builder<T extends ColumnBuilderBaseConfig<'bigint', 'GelBigInt64'>> extends GelIntColumnBaseBuilder<T> {
static readonly [entityKind]: string;
constructor(name: T['name']);
}
export declare class GelBigInt64<T extends ColumnBaseConfig<'bigint', 'GelBigInt64'>> extends GelColumn<T> {
static readonly [entityKind]: string;
getSQLType(): string;
mapFromDriverValue(value: string): bigint;
}
export declare function bigintT(): GelBigInt64BuilderInitial<''>;
export declare function bigintT<TName extends string>(name: TName): GelBigInt64BuilderInitial<TName>;
@@ -0,0 +1,37 @@
import { constructFrom } from "./constructFrom.mjs";
import { toDate } from "./toDate.mjs";
/**
* @name setYear
* @category Year Helpers
* @summary Set the year to the given date.
*
* @description
* Set the year to the given date.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The date to be changed
* @param year - The year of the new date
*
* @returns The new date with the year set
*
* @example
* // Set year 2013 to 1 September 2014:
* const result = setYear(new Date(2014, 8, 1), 2013)
* //=> Sun Sep 01 2013 00:00:00
*/
export function setYear(date, year) {
const _date = toDate(date);
// Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date
if (isNaN(+_date)) {
return constructFrom(date, NaN);
}
_date.setFullYear(year);
return _date;
}
// Fallback for modularized imports:
export default setYear;
@@ -0,0 +1,23 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Logs = createLucideIcon("Logs", [
["path", { d: "M13 12h8", key: "h98zly" }],
["path", { d: "M13 18h8", key: "oe0vm4" }],
["path", { d: "M13 6h8", key: "15sg57" }],
["path", { d: "M3 12h1", key: "lp3yf2" }],
["path", { d: "M3 18h1", key: "1eiwyy" }],
["path", { d: "M3 6h1", key: "rgxa97" }],
["path", { d: "M8 12h1", key: "1con00" }],
["path", { d: "M8 18h1", key: "13wk12" }],
["path", { d: "M8 6h1", key: "tn6mkg" }]
]);
export { Logs as default };
//# sourceMappingURL=logs.js.map
@@ -0,0 +1,98 @@
import { Client, Integration, Options, StackParser } from '@sentry/core';
import * as clientSdk from './client';
import { ServerComponentContext, VercelCronsConfig } from './common/types';
import * as edgeSdk from './edge';
import * as serverSdk from './server';
export * from './config';
export * from './client';
export * from './server';
export * from './edge';
/** Initializes Sentry Next.js SDK */
export declare function init(options: Options | clientSdk.BrowserOptions | serverSdk.NodeOptions | edgeSdk.EdgeOptions): Client | undefined;
export declare const linkedErrorsIntegration: typeof clientSdk.linkedErrorsIntegration;
export declare const contextLinesIntegration: typeof clientSdk.contextLinesIntegration;
export declare const vercelAIIntegration: typeof serverSdk.vercelAIIntegration;
export declare const getDefaultIntegrations: (options: Options) => Integration[];
export declare const defaultStackParser: StackParser;
export declare function getSentryRelease(fallback?: string): string | undefined;
export declare const ErrorBoundary: typeof clientSdk.ErrorBoundary;
export declare const createReduxEnhancer: typeof clientSdk.createReduxEnhancer;
export declare const showReportDialog: typeof clientSdk.showReportDialog;
export declare const withErrorBoundary: typeof clientSdk.withErrorBoundary;
export declare const logger: typeof clientSdk.logger | typeof serverSdk.logger;
export { withSentryConfig } from './config';
/**
* Wraps a Next.js Pages Router API route with Sentry error and performance instrumentation.
*
* NOTICE: This wrapper is for Pages Router API routes. If you are looking to wrap App Router API routes use `wrapRouteHandlerWithSentry` instead.
*
* @param handler The handler exported from the API route file.
* @param parameterizedRoute The page's parameterized route.
* @returns The wrapped handler.
*/
export declare function wrapApiHandlerWithSentry<APIHandler extends (...args: any[]) => any>(handler: APIHandler, parameterizedRoute: string): (...args: Parameters<APIHandler>) => ReturnType<APIHandler> extends Promise<unknown> ? ReturnType<APIHandler> : Promise<ReturnType<APIHandler>>;
/**
* Wraps a `getInitialProps` function with Sentry error and performance instrumentation.
*
* @param getInitialProps The `getInitialProps` function
* @returns A wrapped version of the function
*/
export declare function wrapGetInitialPropsWithSentry<F extends (...args: any[]) => any>(getInitialProps: F): (...args: Parameters<F>) => ReturnType<F> extends Promise<unknown> ? ReturnType<F> : Promise<ReturnType<F>>;
/**
* Wraps a `getInitialProps` function of a custom `_app` page with Sentry error and performance instrumentation.
*
* @param getInitialProps The `getInitialProps` function
* @returns A wrapped version of the function
*/
export declare function wrapAppGetInitialPropsWithSentry<F extends (...args: any[]) => any>(getInitialProps: F): (...args: Parameters<F>) => ReturnType<F> extends Promise<unknown> ? ReturnType<F> : Promise<ReturnType<F>>;
/**
* Wraps a `getInitialProps` function of a custom `_document` page with Sentry error and performance instrumentation.
*
* @param getInitialProps The `getInitialProps` function
* @returns A wrapped version of the function
*/
export declare function wrapDocumentGetInitialPropsWithSentry<F extends (...args: any[]) => any>(getInitialProps: F): (...args: Parameters<F>) => ReturnType<F> extends Promise<unknown> ? ReturnType<F> : Promise<ReturnType<F>>;
/**
* Wraps a `getInitialProps` function of a custom `_error` page with Sentry error and performance instrumentation.
*
* @param getInitialProps The `getInitialProps` function
* @returns A wrapped version of the function
*/
export declare function wrapErrorGetInitialPropsWithSentry<F extends (...args: any[]) => any>(getInitialProps: F): (...args: Parameters<F>) => ReturnType<F> extends Promise<unknown> ? ReturnType<F> : Promise<ReturnType<F>>;
/**
* Wraps a `getServerSideProps` function with Sentry error and performance instrumentation.
*
* @param origGetServerSideProps The `getServerSideProps` function
* @param parameterizedRoute The page's parameterized route
* @returns A wrapped version of the function
*/
export declare function wrapGetServerSidePropsWithSentry<F extends (...args: any[]) => any>(origGetServerSideProps: F, parameterizedRoute: string): (...args: Parameters<F>) => ReturnType<F> extends Promise<unknown> ? ReturnType<F> : Promise<ReturnType<F>>;
/**
* Wraps a `getStaticProps` function with Sentry error and performance instrumentation.
*
* @param origGetStaticProps The `getStaticProps` function
* @param parameterizedRoute The page's parameterized route
* @returns A wrapped version of the function
*/
export declare function wrapGetStaticPropsWithSentry<F extends (...args: any[]) => any>(origGetStaticPropsa: F, parameterizedRoute: string): (...args: Parameters<F>) => ReturnType<F> extends Promise<unknown> ? ReturnType<F> : Promise<ReturnType<F>>;
/**
* Wraps an `app` directory server component with Sentry error and performance instrumentation.
*/
export declare function wrapServerComponentWithSentry<F extends (...args: any[]) => any>(WrappingTarget: F, context: ServerComponentContext): F;
/**
* Wraps an `app` directory server component with Sentry error and performance instrumentation.
*/
export declare function wrapApiHandlerWithSentryVercelCrons<F extends (...args: any[]) => any>(WrappingTarget: F, vercelCronsConfig: VercelCronsConfig): F;
/**
* Wraps a page component with Sentry error instrumentation.
*/
export declare function wrapPageComponentWithSentry<C>(WrappingTarget: C): C;
export { captureRequestError } from './common/captureRequestError';
export declare const growthbookIntegration: typeof clientSdk.growthbookIntegration;
export declare const launchDarklyIntegration: typeof clientSdk.launchDarklyIntegration;
export declare const buildLaunchDarklyFlagUsedHandler: typeof clientSdk.buildLaunchDarklyFlagUsedHandler;
export declare const openFeatureIntegration: typeof clientSdk.openFeatureIntegration;
export declare const OpenFeatureIntegrationHook: typeof clientSdk.OpenFeatureIntegrationHook;
export declare const statsigIntegration: typeof clientSdk.statsigIntegration;
export declare const unleashIntegration: typeof clientSdk.unleashIntegration;
//# sourceMappingURL=index.types.d.ts.map
@@ -0,0 +1,33 @@
import { localizeStatus as mongoLocalizeStatus } from './mongo/index.js';
import { localizeStatus as sqlLocalizeStatus } from './sql/index.js';
/**
* Main entry point for localizeStatus migration.
* Detects database type and dispatches to appropriate implementation.
*/ export const localizeStatus = {
async up (args) {
// Detect database type by checking which parameters are present
if ('db' in args && 'sql' in args) {
// SQL database (Postgres, SQLite, etc.)
return sqlLocalizeStatus.up(args);
} else if ('payload' in args && !('db' in args)) {
// MongoDB
return mongoLocalizeStatus.up(args);
} else {
throw new Error('Unable to detect database type. Expected either { db, sql } for SQL databases ' + 'or { payload } for MongoDB.');
}
},
async down (args) {
// Detect database type by checking which parameters are present
if ('db' in args && 'sql' in args) {
// SQL database (Postgres, SQLite, etc.)
return sqlLocalizeStatus.down(args);
} else if ('payload' in args && !('db' in args)) {
// MongoDB
return mongoLocalizeStatus.down(args);
} else {
throw new Error('Unable to detect database type. Expected either { db, sql } for SQL databases ' + 'or { payload } for MongoDB.');
}
}
};
//# sourceMappingURL=index.js.map
@@ -0,0 +1,29 @@
"use strict";
exports.cs = void 0;
var _index = require("./cs/_lib/formatDistance.js");
var _index2 = require("./cs/_lib/formatLong.js");
var _index3 = require("./cs/_lib/formatRelative.js");
var _index4 = require("./cs/_lib/localize.js");
var _index5 = require("./cs/_lib/match.js");
/**
* @category Locales
* @summary Czech locale.
* @language Czech
* @iso-639-2 ces
* @author David Rus [@davidrus](https://github.com/davidrus)
* @author Pavel Hrách [@SilenY](https://github.com/SilenY)
* @author Jozef Bíroš [@JozefBiros](https://github.com/JozefBiros)
*/
const cs = (exports.cs = {
code: "cs",
formatDistance: _index.formatDistance,
formatLong: _index2.formatLong,
formatRelative: _index3.formatRelative,
localize: _index4.localize,
match: _index5.match,
options: {
weekStartsOn: 1 /* Monday */,
firstWeekContainsDate: 4,
},
});
@@ -0,0 +1,607 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var dialect_exports = {};
__export(dialect_exports, {
SingleStoreDialect: () => SingleStoreDialect
});
module.exports = __toCommonJS(dialect_exports);
var import_alias = require("../alias.cjs");
var import_casing = require("../casing.cjs");
var import_column = require("../column.cjs");
var import_entity = require("../entity.cjs");
var import_errors = require("../errors.cjs");
var import_relations = require("../relations.cjs");
var import_expressions = require("../sql/expressions/index.cjs");
var import_sql = require("../sql/sql.cjs");
var import_subquery = require("../subquery.cjs");
var import_table = require("../table.cjs");
var import_utils = require("../utils.cjs");
var import_view_common = require("../view-common.cjs");
var import_common = require("./columns/common.cjs");
var import_table2 = require("./table.cjs");
class SingleStoreDialect {
static [import_entity.entityKind] = "SingleStoreDialect";
/** @internal */
casing;
constructor(config) {
this.casing = new import_casing.CasingCache(config?.casing);
}
async migrate(migrations, session, config) {
const migrationsTable = config.migrationsTable ?? "__drizzle_migrations";
const migrationTableCreate = import_sql.sql`
create table if not exists ${import_sql.sql.identifier(migrationsTable)} (
id serial primary key,
hash text not null,
created_at bigint
)
`;
await session.execute(migrationTableCreate);
const dbMigrations = await session.all(
import_sql.sql`select id, hash, created_at from ${import_sql.sql.identifier(migrationsTable)} order by created_at desc limit 1`
);
const lastDbMigration = dbMigrations[0];
await session.transaction(async (tx) => {
for (const migration of migrations) {
if (!lastDbMigration || Number(lastDbMigration.created_at) < migration.folderMillis) {
for (const stmt of migration.sql) {
await tx.execute(import_sql.sql.raw(stmt));
}
await tx.execute(
import_sql.sql`insert into ${import_sql.sql.identifier(migrationsTable)} (\`hash\`, \`created_at\`) values(${migration.hash}, ${migration.folderMillis})`
);
}
}
});
}
escapeName(name) {
return `\`${name}\``;
}
escapeParam(_num) {
return `?`;
}
escapeString(str) {
return `'${str.replace(/'/g, "''")}'`;
}
buildWithCTE(queries) {
if (!queries?.length) return void 0;
const withSqlChunks = [import_sql.sql`with `];
for (const [i, w] of queries.entries()) {
withSqlChunks.push(import_sql.sql`${import_sql.sql.identifier(w._.alias)} as (${w._.sql})`);
if (i < queries.length - 1) {
withSqlChunks.push(import_sql.sql`, `);
}
}
withSqlChunks.push(import_sql.sql` `);
return import_sql.sql.join(withSqlChunks);
}
buildDeleteQuery({ table, where, returning, withList, limit, orderBy }) {
const withSql = this.buildWithCTE(withList);
const returningSql = returning ? import_sql.sql` returning ${this.buildSelection(returning, { isSingleTable: true })}` : void 0;
const whereSql = where ? import_sql.sql` where ${where}` : void 0;
const orderBySql = this.buildOrderBy(orderBy);
const limitSql = this.buildLimit(limit);
return import_sql.sql`${withSql}delete from ${table}${whereSql}${orderBySql}${limitSql}${returningSql}`;
}
buildUpdateSet(table, set) {
const tableColumns = table[import_table.Table.Symbol.Columns];
const columnNames = Object.keys(tableColumns).filter(
(colName) => set[colName] !== void 0 || tableColumns[colName]?.onUpdateFn !== void 0
);
const setSize = columnNames.length;
return import_sql.sql.join(columnNames.flatMap((colName, i) => {
const col = tableColumns[colName];
const value = set[colName] ?? import_sql.sql.param(col.onUpdateFn(), col);
const res = import_sql.sql`${import_sql.sql.identifier(this.casing.getColumnCasing(col))} = ${value}`;
if (i < setSize - 1) {
return [res, import_sql.sql.raw(", ")];
}
return [res];
}));
}
buildUpdateQuery({ table, set, where, returning, withList, limit, orderBy }) {
const withSql = this.buildWithCTE(withList);
const setSql = this.buildUpdateSet(table, set);
const returningSql = returning ? import_sql.sql` returning ${this.buildSelection(returning, { isSingleTable: true })}` : void 0;
const whereSql = where ? import_sql.sql` where ${where}` : void 0;
const orderBySql = this.buildOrderBy(orderBy);
const limitSql = this.buildLimit(limit);
return import_sql.sql`${withSql}update ${table} set ${setSql}${whereSql}${orderBySql}${limitSql}${returningSql}`;
}
/**
* Builds selection SQL with provided fields/expressions
*
* Examples:
*
* `select <selection> from`
*
* `insert ... returning <selection>`
*
* If `isSingleTable` is true, then columns won't be prefixed with table name
*/
buildSelection(fields, { isSingleTable = false } = {}) {
const columnsLen = fields.length;
const chunks = fields.flatMap(({ field }, i) => {
const chunk = [];
if ((0, import_entity.is)(field, import_sql.SQL.Aliased) && field.isSelectionField) {
chunk.push(import_sql.sql.identifier(field.fieldAlias));
} else if ((0, import_entity.is)(field, import_sql.SQL.Aliased) || (0, import_entity.is)(field, import_sql.SQL)) {
const query = (0, import_entity.is)(field, import_sql.SQL.Aliased) ? field.sql : field;
if (isSingleTable) {
chunk.push(
new import_sql.SQL(
query.queryChunks.map((c) => {
if ((0, import_entity.is)(c, import_common.SingleStoreColumn)) {
return import_sql.sql.identifier(this.casing.getColumnCasing(c));
}
return c;
})
)
);
} else {
chunk.push(query);
}
if ((0, import_entity.is)(field, import_sql.SQL.Aliased)) {
chunk.push(import_sql.sql` as ${import_sql.sql.identifier(field.fieldAlias)}`);
}
} else if ((0, import_entity.is)(field, import_column.Column)) {
if (isSingleTable) {
chunk.push(import_sql.sql.identifier(this.casing.getColumnCasing(field)));
} else {
chunk.push(field);
}
}
if (i < columnsLen - 1) {
chunk.push(import_sql.sql`, `);
}
return chunk;
});
return import_sql.sql.join(chunks);
}
buildLimit(limit) {
return typeof limit === "object" || typeof limit === "number" && limit >= 0 ? import_sql.sql` limit ${limit}` : void 0;
}
buildOrderBy(orderBy) {
return orderBy && orderBy.length > 0 ? import_sql.sql` order by ${import_sql.sql.join(orderBy, import_sql.sql`, `)}` : void 0;
}
buildSelectQuery({
withList,
fields,
fieldsFlat,
where,
having,
table,
joins,
orderBy,
groupBy,
limit,
offset,
lockingClause,
distinct,
setOperators
}) {
const fieldsList = fieldsFlat ?? (0, import_utils.orderSelectedFields)(fields);
for (const f of fieldsList) {
if ((0, import_entity.is)(f.field, import_column.Column) && (0, import_table.getTableName)(f.field.table) !== ((0, import_entity.is)(table, import_subquery.Subquery) ? table._.alias : (0, import_entity.is)(table, import_sql.SQL) ? void 0 : (0, import_table.getTableName)(table)) && !((table2) => joins?.some(
({ alias }) => alias === (table2[import_table.Table.Symbol.IsAlias] ? (0, import_table.getTableName)(table2) : table2[import_table.Table.Symbol.BaseName])
))(f.field.table)) {
const tableName = (0, import_table.getTableName)(f.field.table);
throw new Error(
`Your "${f.path.join("->")}" field references a column "${tableName}"."${f.field.name}", but the table "${tableName}" is not part of the query! Did you forget to join it?`
);
}
}
const isSingleTable = !joins || joins.length === 0;
const withSql = this.buildWithCTE(withList);
const distinctSql = distinct ? import_sql.sql` distinct` : void 0;
const selection = this.buildSelection(fieldsList, { isSingleTable });
const tableSql = (() => {
if ((0, import_entity.is)(table, import_table.Table) && table[import_table.Table.Symbol.IsAlias]) {
return import_sql.sql`${import_sql.sql`${import_sql.sql.identifier(table[import_table.Table.Symbol.Schema] ?? "")}.`.if(table[import_table.Table.Symbol.Schema])}${import_sql.sql.identifier(table[import_table.Table.Symbol.OriginalName])} ${import_sql.sql.identifier(table[import_table.Table.Symbol.Name])}`;
}
return table;
})();
const joinsArray = [];
if (joins) {
for (const [index, joinMeta] of joins.entries()) {
if (index === 0) {
joinsArray.push(import_sql.sql` `);
}
const table2 = joinMeta.table;
const lateralSql = joinMeta.lateral ? import_sql.sql` lateral` : void 0;
const onSql = joinMeta.on ? import_sql.sql` on ${joinMeta.on}` : void 0;
if ((0, import_entity.is)(table2, import_table2.SingleStoreTable)) {
const tableName = table2[import_table2.SingleStoreTable.Symbol.Name];
const tableSchema = table2[import_table2.SingleStoreTable.Symbol.Schema];
const origTableName = table2[import_table2.SingleStoreTable.Symbol.OriginalName];
const alias = tableName === origTableName ? void 0 : joinMeta.alias;
joinsArray.push(
import_sql.sql`${import_sql.sql.raw(joinMeta.joinType)} join${lateralSql} ${tableSchema ? import_sql.sql`${import_sql.sql.identifier(tableSchema)}.` : void 0}${import_sql.sql.identifier(origTableName)}${alias && import_sql.sql` ${import_sql.sql.identifier(alias)}`}${onSql}`
);
} else if ((0, import_entity.is)(table2, import_sql.View)) {
const viewName = table2[import_view_common.ViewBaseConfig].name;
const viewSchema = table2[import_view_common.ViewBaseConfig].schema;
const origViewName = table2[import_view_common.ViewBaseConfig].originalName;
const alias = viewName === origViewName ? void 0 : joinMeta.alias;
joinsArray.push(
import_sql.sql`${import_sql.sql.raw(joinMeta.joinType)} join${lateralSql} ${viewSchema ? import_sql.sql`${import_sql.sql.identifier(viewSchema)}.` : void 0}${import_sql.sql.identifier(origViewName)}${alias && import_sql.sql` ${import_sql.sql.identifier(alias)}`}${onSql}`
);
} else {
joinsArray.push(
import_sql.sql`${import_sql.sql.raw(joinMeta.joinType)} join${lateralSql} ${table2}${onSql}`
);
}
if (index < joins.length - 1) {
joinsArray.push(import_sql.sql` `);
}
}
}
const joinsSql = import_sql.sql.join(joinsArray);
const whereSql = where ? import_sql.sql` where ${where}` : void 0;
const havingSql = having ? import_sql.sql` having ${having}` : void 0;
const orderBySql = this.buildOrderBy(orderBy);
const groupBySql = groupBy && groupBy.length > 0 ? import_sql.sql` group by ${import_sql.sql.join(groupBy, import_sql.sql`, `)}` : void 0;
const limitSql = this.buildLimit(limit);
const offsetSql = offset ? import_sql.sql` offset ${offset}` : void 0;
let lockingClausesSql;
if (lockingClause) {
const { config, strength } = lockingClause;
lockingClausesSql = import_sql.sql` for ${import_sql.sql.raw(strength)}`;
if (config.noWait) {
lockingClausesSql.append(import_sql.sql` nowait`);
} else if (config.skipLocked) {
lockingClausesSql.append(import_sql.sql` skip locked`);
}
}
const finalQuery = import_sql.sql`${withSql}select${distinctSql} ${selection} from ${tableSql}${joinsSql}${whereSql}${groupBySql}${havingSql}${orderBySql}${limitSql}${offsetSql}${lockingClausesSql}`;
if (setOperators.length > 0) {
return this.buildSetOperations(finalQuery, setOperators);
}
return finalQuery;
}
buildSetOperations(leftSelect, setOperators) {
const [setOperator, ...rest] = setOperators;
if (!setOperator) {
throw new Error("Cannot pass undefined values to any set operator");
}
if (rest.length === 0) {
return this.buildSetOperationQuery({ leftSelect, setOperator });
}
return this.buildSetOperations(
this.buildSetOperationQuery({ leftSelect, setOperator }),
rest
);
}
buildSetOperationQuery({
leftSelect,
setOperator: { type, isAll, rightSelect, limit, orderBy, offset }
}) {
const leftChunk = import_sql.sql`(${leftSelect.getSQL()}) `;
const rightChunk = import_sql.sql`(${rightSelect.getSQL()})`;
let orderBySql;
if (orderBy && orderBy.length > 0) {
const orderByValues = [];
for (const orderByUnit of orderBy) {
if ((0, import_entity.is)(orderByUnit, import_common.SingleStoreColumn)) {
orderByValues.push(import_sql.sql.identifier(this.casing.getColumnCasing(orderByUnit)));
} else if ((0, import_entity.is)(orderByUnit, import_sql.SQL)) {
for (let i = 0; i < orderByUnit.queryChunks.length; i++) {
const chunk = orderByUnit.queryChunks[i];
if ((0, import_entity.is)(chunk, import_common.SingleStoreColumn)) {
orderByUnit.queryChunks[i] = import_sql.sql.identifier(this.casing.getColumnCasing(chunk));
}
}
orderByValues.push(import_sql.sql`${orderByUnit}`);
} else {
orderByValues.push(import_sql.sql`${orderByUnit}`);
}
}
orderBySql = import_sql.sql` order by ${import_sql.sql.join(orderByValues, import_sql.sql`, `)} `;
}
const limitSql = typeof limit === "object" || typeof limit === "number" && limit >= 0 ? import_sql.sql` limit ${limit}` : void 0;
const operatorChunk = import_sql.sql.raw(`${type} ${isAll ? "all " : ""}`);
const offsetSql = offset ? import_sql.sql` offset ${offset}` : void 0;
return import_sql.sql`${leftChunk}${operatorChunk}${rightChunk}${orderBySql}${limitSql}${offsetSql}`;
}
buildInsertQuery({ table, values, ignore, onConflict }) {
const valuesSqlList = [];
const columns = table[import_table.Table.Symbol.Columns];
const colEntries = Object.entries(columns).filter(
([_, col]) => !col.shouldDisableInsert()
);
const insertOrder = colEntries.map(([, column]) => import_sql.sql.identifier(this.casing.getColumnCasing(column)));
const generatedIdsResponse = [];
for (const [valueIndex, value] of values.entries()) {
const generatedIds = {};
const valueList = [];
for (const [fieldName, col] of colEntries) {
const colValue = value[fieldName];
if (colValue === void 0 || (0, import_entity.is)(colValue, import_sql.Param) && colValue.value === void 0) {
if (col.defaultFn !== void 0) {
const defaultFnResult = col.defaultFn();
generatedIds[fieldName] = defaultFnResult;
const defaultValue = (0, import_entity.is)(defaultFnResult, import_sql.SQL) ? defaultFnResult : import_sql.sql.param(defaultFnResult, col);
valueList.push(defaultValue);
} else if (!col.default && col.onUpdateFn !== void 0) {
const onUpdateFnResult = col.onUpdateFn();
const newValue = (0, import_entity.is)(onUpdateFnResult, import_sql.SQL) ? onUpdateFnResult : import_sql.sql.param(onUpdateFnResult, col);
valueList.push(newValue);
} else {
valueList.push(import_sql.sql`default`);
}
} else {
if (col.defaultFn && (0, import_entity.is)(colValue, import_sql.Param)) {
generatedIds[fieldName] = colValue.value;
}
valueList.push(colValue);
}
}
generatedIdsResponse.push(generatedIds);
valuesSqlList.push(valueList);
if (valueIndex < values.length - 1) {
valuesSqlList.push(import_sql.sql`, `);
}
}
const valuesSql = import_sql.sql.join(valuesSqlList);
const ignoreSql = ignore ? import_sql.sql` ignore` : void 0;
const onConflictSql = onConflict ? import_sql.sql` on duplicate key ${onConflict}` : void 0;
return {
sql: import_sql.sql`insert${ignoreSql} into ${table} ${insertOrder} values ${valuesSql}${onConflictSql}`,
generatedIds: generatedIdsResponse
};
}
sqlToQuery(sql2, invokeSource) {
return sql2.toQuery({
casing: this.casing,
escapeName: this.escapeName,
escapeParam: this.escapeParam,
escapeString: this.escapeString,
invokeSource
});
}
buildRelationalQuery({
fullSchema,
schema,
tableNamesMap,
table,
tableConfig,
queryConfig: config,
tableAlias,
nestedQueryRelation,
joinOn
}) {
let selection = [];
let limit, offset, orderBy, where;
const joins = [];
if (config === true) {
const selectionEntries = Object.entries(tableConfig.columns);
selection = selectionEntries.map(([key, value]) => ({
dbKey: value.name,
tsKey: key,
field: (0, import_alias.aliasedTableColumn)(value, tableAlias),
relationTableTsKey: void 0,
isJson: false,
selection: []
}));
} else {
const aliasedColumns = Object.fromEntries(
Object.entries(tableConfig.columns).map(([key, value]) => [key, (0, import_alias.aliasedTableColumn)(value, tableAlias)])
);
if (config.where) {
const whereSql = typeof config.where === "function" ? config.where(aliasedColumns, (0, import_relations.getOperators)()) : config.where;
where = whereSql && (0, import_alias.mapColumnsInSQLToAlias)(whereSql, tableAlias);
}
const fieldsSelection = [];
let selectedColumns = [];
if (config.columns) {
let isIncludeMode = false;
for (const [field, value] of Object.entries(config.columns)) {
if (value === void 0) {
continue;
}
if (field in tableConfig.columns) {
if (!isIncludeMode && value === true) {
isIncludeMode = true;
}
selectedColumns.push(field);
}
}
if (selectedColumns.length > 0) {
selectedColumns = isIncludeMode ? selectedColumns.filter((c) => config.columns?.[c] === true) : Object.keys(tableConfig.columns).filter((key) => !selectedColumns.includes(key));
}
} else {
selectedColumns = Object.keys(tableConfig.columns);
}
for (const field of selectedColumns) {
const column = tableConfig.columns[field];
fieldsSelection.push({ tsKey: field, value: column });
}
let selectedRelations = [];
if (config.with) {
selectedRelations = Object.entries(config.with).filter((entry) => !!entry[1]).map(([tsKey, queryConfig]) => ({ tsKey, queryConfig, relation: tableConfig.relations[tsKey] }));
}
let extras;
if (config.extras) {
extras = typeof config.extras === "function" ? config.extras(aliasedColumns, { sql: import_sql.sql }) : config.extras;
for (const [tsKey, value] of Object.entries(extras)) {
fieldsSelection.push({
tsKey,
value: (0, import_alias.mapColumnsInAliasedSQLToAlias)(value, tableAlias)
});
}
}
for (const { tsKey, value } of fieldsSelection) {
selection.push({
dbKey: (0, import_entity.is)(value, import_sql.SQL.Aliased) ? value.fieldAlias : tableConfig.columns[tsKey].name,
tsKey,
field: (0, import_entity.is)(value, import_column.Column) ? (0, import_alias.aliasedTableColumn)(value, tableAlias) : value,
relationTableTsKey: void 0,
isJson: false,
selection: []
});
}
let orderByOrig = typeof config.orderBy === "function" ? config.orderBy(aliasedColumns, (0, import_relations.getOrderByOperators)()) : config.orderBy ?? [];
if (!Array.isArray(orderByOrig)) {
orderByOrig = [orderByOrig];
}
orderBy = orderByOrig.map((orderByValue) => {
if ((0, import_entity.is)(orderByValue, import_column.Column)) {
return (0, import_alias.aliasedTableColumn)(orderByValue, tableAlias);
}
return (0, import_alias.mapColumnsInSQLToAlias)(orderByValue, tableAlias);
});
limit = config.limit;
offset = config.offset;
for (const {
tsKey: selectedRelationTsKey,
queryConfig: selectedRelationConfigValue,
relation
} of selectedRelations) {
const normalizedRelation = (0, import_relations.normalizeRelation)(schema, tableNamesMap, relation);
const relationTableName = (0, import_table.getTableUniqueName)(relation.referencedTable);
const relationTableTsName = tableNamesMap[relationTableName];
const relationTableAlias = `${tableAlias}_${selectedRelationTsKey}`;
const joinOn2 = (0, import_expressions.and)(
...normalizedRelation.fields.map(
(field2, i) => (0, import_expressions.eq)(
(0, import_alias.aliasedTableColumn)(normalizedRelation.references[i], relationTableAlias),
(0, import_alias.aliasedTableColumn)(field2, tableAlias)
)
)
);
const builtRelation = this.buildRelationalQuery({
fullSchema,
schema,
tableNamesMap,
table: fullSchema[relationTableTsName],
tableConfig: schema[relationTableTsName],
queryConfig: (0, import_entity.is)(relation, import_relations.One) ? selectedRelationConfigValue === true ? { limit: 1 } : { ...selectedRelationConfigValue, limit: 1 } : selectedRelationConfigValue,
tableAlias: relationTableAlias,
joinOn: joinOn2,
nestedQueryRelation: relation
});
const field = import_sql.sql`${import_sql.sql.identifier(relationTableAlias)}.${import_sql.sql.identifier("data")}`.as(selectedRelationTsKey);
joins.push({
on: import_sql.sql`true`,
table: new import_subquery.Subquery(builtRelation.sql, {}, relationTableAlias),
alias: relationTableAlias,
joinType: "left",
lateral: true
});
selection.push({
dbKey: selectedRelationTsKey,
tsKey: selectedRelationTsKey,
field,
relationTableTsKey: relationTableTsName,
isJson: true,
selection: builtRelation.selection
});
}
}
if (selection.length === 0) {
throw new import_errors.DrizzleError({ message: `No fields selected for table "${tableConfig.tsName}" ("${tableAlias}")` });
}
let result;
where = (0, import_expressions.and)(joinOn, where);
if (nestedQueryRelation) {
let field = import_sql.sql`JSON_TO_ARRAY(${import_sql.sql.join(
selection.map(
({ field: field2, tsKey, isJson }) => isJson ? import_sql.sql`${import_sql.sql.identifier(`${tableAlias}_${tsKey}`)}.${import_sql.sql.identifier("data")}` : (0, import_entity.is)(field2, import_sql.SQL.Aliased) ? field2.sql : field2
),
import_sql.sql`, `
)})`;
if ((0, import_entity.is)(nestedQueryRelation, import_relations.Many)) {
field = import_sql.sql`json_agg(${field})`;
}
const nestedSelection = [{
dbKey: "data",
tsKey: "data",
field: field.as("data"),
isJson: true,
relationTableTsKey: tableConfig.tsName,
selection
}];
const needsSubquery = limit !== void 0 || offset !== void 0 || (orderBy?.length ?? 0) > 0;
if (needsSubquery) {
result = this.buildSelectQuery({
table: (0, import_alias.aliasedTable)(table, tableAlias),
fields: {},
fieldsFlat: [
{
path: [],
field: import_sql.sql.raw("*")
},
...((orderBy?.length ?? 0) > 0 ? [{
path: [],
field: import_sql.sql`row_number() over (order by ${import_sql.sql.join(orderBy, import_sql.sql`, `)})`
}] : [])
],
where,
limit,
offset,
setOperators: []
});
where = void 0;
limit = void 0;
offset = void 0;
orderBy = void 0;
} else {
result = (0, import_alias.aliasedTable)(table, tableAlias);
}
result = this.buildSelectQuery({
table: (0, import_entity.is)(result, import_table2.SingleStoreTable) ? result : new import_subquery.Subquery(result, {}, tableAlias),
fields: {},
fieldsFlat: nestedSelection.map(({ field: field2 }) => ({
path: [],
field: (0, import_entity.is)(field2, import_column.Column) ? (0, import_alias.aliasedTableColumn)(field2, tableAlias) : field2
})),
joins,
where,
limit,
offset,
orderBy,
setOperators: []
});
} else {
result = this.buildSelectQuery({
table: (0, import_alias.aliasedTable)(table, tableAlias),
fields: {},
fieldsFlat: selection.map(({ field }) => ({
path: [],
field: (0, import_entity.is)(field, import_column.Column) ? (0, import_alias.aliasedTableColumn)(field, tableAlias) : field
})),
joins,
where,
limit,
offset,
orderBy,
setOperators: []
});
}
return {
tableTsKey: tableConfig.tsName,
sql: result,
selection
};
}
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
SingleStoreDialect
});
//# sourceMappingURL=dialect.cjs.map
@@ -0,0 +1,34 @@
import { type FlattenedField, type JoinQuery, type SelectMode, type SelectType } from 'payload';
import type { BuildQueryJoinAliases, DrizzleAdapter } from '../types.js';
import type { Result } from './buildFindManyArgs.js';
type TraverseFieldArgs = {
_locales: Result;
adapter: DrizzleAdapter;
collectionSlug?: string;
currentArgs: Result;
currentTableName: string;
depth?: number;
draftsEnabled?: boolean;
fields: FlattenedField[];
forceWithFields?: boolean;
joinQuery: JoinQuery;
joins?: BuildQueryJoinAliases;
locale?: string;
parentIsLocalized?: boolean;
path: string;
select?: SelectType;
selectAllOnCurrentLevel?: boolean;
selectMode?: SelectMode;
tablePath: string;
topLevelArgs: Record<string, unknown>;
topLevelTableName: string;
versions?: boolean;
withTabledFields: {
numbers?: boolean;
rels?: boolean;
texts?: boolean;
};
};
export declare const traverseFields: ({ _locales, adapter, collectionSlug, currentArgs, currentTableName, depth, draftsEnabled, fields, forceWithFields, joinQuery, joins, locale, parentIsLocalized, path, select, selectAllOnCurrentLevel, selectMode, tablePath, topLevelArgs, topLevelTableName, versions, withTabledFields, }: TraverseFieldArgs) => Record<string, unknown>;
export {};
//# sourceMappingURL=traverseFields.d.ts.map
@@ -0,0 +1,10 @@
"use strict";
exports.transpose = void 0;
var _index = require("../transpose.cjs");
var _index2 = require("./_lib/convertToFP.cjs"); // This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
const transpose = (exports.transpose = (0, _index2.convertToFP)(
_index.transpose,
2,
));
@@ -0,0 +1,35 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
type Func = () => void;
/**
* Returns a function that will execute all functions passed when called. It is generally used
* to register multiple lexical listeners and then tear them down with a single function call, such
* as React's useEffect hook.
* @example
* ```ts
* useEffect(() => {
* return mergeRegister(
* editor.registerCommand(...registerCommand1 logic),
* editor.registerCommand(...registerCommand2 logic),
* editor.registerCommand(...registerCommand3 logic)
* )
* }, [editor])
* ```
* In this case, useEffect is returning the function returned by mergeRegister as a cleanup
* function to be executed after either the useEffect runs again (due to one of its dependencies
* updating) or the component it resides in unmounts.
* Note the functions don't necessarily need to be in an array as all arguments
* are considered to be the func argument and spread from there.
* The order of cleanup is the reverse of the argument order. Generally it is
* expected that the first "acquire" will be "released" last (LIFO order),
* because a later step may have some dependency on an earlier one.
* @param func - An array of cleanup functions meant to be executed by the returned function.
* @returns the function which executes all the passed cleanup functions.
*/
export default function mergeRegister(...func: Array<Func>): () => void;
export {};
@@ -0,0 +1,23 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const BookOpenCheck = createLucideIcon("BookOpenCheck", [
["path", { d: "M12 21V7", key: "gj6g52" }],
["path", { d: "m16 12 2 2 4-4", key: "mdajum" }],
[
"path",
{
d: "M22 6V4a1 1 0 0 0-1-1h-5a4 4 0 0 0-4 4 4 4 0 0 0-4-4H3a1 1 0 0 0-1 1v13a1 1 0 0 0 1 1h6a3 3 0 0 1 3 3 3 3 0 0 1 3-3h6a1 1 0 0 0 1-1v-1.3",
key: "8arnkb"
}
]
]);
export { BookOpenCheck as default };
//# sourceMappingURL=book-open-check.js.map
@@ -0,0 +1,16 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const MoveRight = createLucideIcon("MoveRight", [
["path", { d: "M18 8L22 12L18 16", key: "1r0oui" }],
["path", { d: "M2 12H22", key: "1m8cig" }]
]);
export { MoveRight as default };
//# sourceMappingURL=move-right.js.map
@@ -0,0 +1,6 @@
/*
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn fix:special` to update
*/
"use strict";function r(e,{instancePath:t="",parentData:o,parentDataProperty:n,rootData:a=e}={}){if(!e||"object"!=typeof e||Array.isArray(e))return r.errors=[{params:{type:"object"}}],!1;{let t;if(void 0===e.path&&(t="path"))return r.errors=[{params:{missingProperty:t}}],!1;{const t=0;for(const t in e)if("context"!==t&&"entryOnly"!==t&&"format"!==t&&"name"!==t&&"path"!==t&&"type"!==t)return r.errors=[{params:{additionalProperty:t}}],!1;if(0===t){if(void 0!==e.context){let t=e.context;const o=0;if(0===o){if("string"!=typeof t)return r.errors=[{params:{type:"string"}}],!1;if(t.length<1)return r.errors=[{params:{}}],!1}var s=0===o}else s=!0;if(s){if(void 0!==e.entryOnly){const t=0;if("boolean"!=typeof e.entryOnly)return r.errors=[{params:{type:"boolean"}}],!1;s=0===t}else s=!0;if(s){if(void 0!==e.format){const t=0;if("boolean"!=typeof e.format)return r.errors=[{params:{type:"boolean"}}],!1;s=0===t}else s=!0;if(s){if(void 0!==e.name){let t=e.name;const o=0;if(0===o){if("string"!=typeof t)return r.errors=[{params:{type:"string"}}],!1;if(t.length<1)return r.errors=[{params:{}}],!1}s=0===o}else s=!0;if(s){if(void 0!==e.path){let t=e.path;const o=0;if(0===o){if("string"!=typeof t)return r.errors=[{params:{type:"string"}}],!1;if(t.length<1)return r.errors=[{params:{}}],!1}s=0===o}else s=!0;if(s)if(void 0!==e.type){let t=e.type;const o=0;if(0===o){if("string"!=typeof t)return r.errors=[{params:{type:"string"}}],!1;if(t.length<1)return r.errors=[{params:{}}],!1}s=0===o}else s=!0}}}}}}}return r.errors=null,!0}module.exports=r,module.exports.default=r;
@@ -0,0 +1 @@
{"version":3,"file":"file-pie-chart.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1 @@
{"version":3,"file":"stable_events.js","sourceRoot":"","sources":["../../src/stable_events.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,6GAA6G;AAC7G,6GAA6G;AAC7G,6GAA6G;AAE7G;;GAEG;AACU,QAAA,eAAe,GAAG,WAAoB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n//-----------------------------------------------------------------------------------------------------------\n// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates/registry/ts-stable/events.ts.j2\n//-----------------------------------------------------------------------------------------------------------\n\n/**\n * This event describes a single exception.\n */\nexport const EVENT_EXCEPTION = 'exception' as const;\n\n"]}
@@ -0,0 +1,87 @@
@import '../../scss/styles.scss';
@layer payload-default {
.radio-group {
.tooltip:not([aria-hidden='true']) {
right: auto;
position: static;
margin-bottom: 0.2em;
max-width: fit-content;
}
&--layout-horizontal {
ul {
display: flex;
flex-wrap: wrap;
}
li {
flex-shrink: 0;
[dir='ltr'] & {
padding-right: $baseline;
}
[dir='rtl'] & {
padding-left: $baseline;
}
}
}
ul {
list-style: none;
padding: 0;
margin: 0;
}
}
.radio-group--read-only {
.radio-input {
cursor: default;
&:hover {
border-color: var(--theme-elevation-50);
}
&__label {
color: var(--theme-elevation-400);
}
&--is-selected {
.radio-input__styled-radio {
&:before {
background-color: var(--theme-elevation-250);
}
}
}
&:not(.radio-input--is-selected) {
&:hover {
.radio-input__styled-radio {
&:before {
opacity: 0;
}
}
}
}
}
}
html[data-theme='light'] {
.radio-group {
&.error {
.radio-input__styled-radio {
@include lightInputError;
}
}
}
}
html[data-theme='dark'] {
.radio-group {
&.error {
.radio-input__styled-radio {
@include darkInputError;
}
}
}
}
}
@@ -0,0 +1,44 @@
{
"name": "graphql-scalars",
"version": "1.22.2",
"description": "A collection of scalar types not included in base GraphQL.",
"sideEffects": false,
"peerDependencies": {
"graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0"
},
"dependencies": {
"tslib": "^2.5.0"
},
"repository": {
"type": "git",
"url": "https://github.com/Urigo/graphql-scalars.git"
},
"license": "MIT",
"engines": {
"node": ">=10"
},
"main": "cjs/index.js",
"module": "esm/index.js",
"typings": "typings/index.d.ts",
"typescript": {
"definition": "typings/index.d.ts"
},
"type": "module",
"exports": {
".": {
"require": {
"types": "./typings/index.d.cts",
"default": "./cjs/index.js"
},
"import": {
"types": "./typings/index.d.ts",
"default": "./esm/index.js"
},
"default": {
"types": "./typings/index.d.ts",
"default": "./esm/index.js"
}
},
"./package.json": "./package.json"
}
}
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/elements/Table/DefaultCell/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,yBAAyB,EAAqB,MAAM,SAAS,CAAA;AAI3E,OAAO,KAAK,MAAM,OAAO,CAAA;AAWzB,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CA8J3D,CAAA"}
@@ -0,0 +1,422 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
*/
"use strict";
const RuntimeGlobals = require("../RuntimeGlobals");
const RuntimeModule = require("../RuntimeModule");
const Template = require("../Template");
const { compareModulesByIdentifier } = require("../util/comparators");
const WebAssemblyUtils = require("./WebAssemblyUtils");
/** @typedef {import("@webassemblyjs/ast").Signature} Signature */
/** @typedef {import("../Chunk")} Chunk */
/** @typedef {import("../ChunkGraph")} ChunkGraph */
/** @typedef {import("../ChunkGraph").ModuleId} ModuleId */
/** @typedef {import("../Compilation")} Compilation */
/** @typedef {import("../Module")} Module */
/** @typedef {import("../Module").ReadOnlyRuntimeRequirements} ReadOnlyRuntimeRequirements */
/** @typedef {import("../ModuleGraph")} ModuleGraph */
/** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */
// TODO webpack 6 remove the whole folder
// Get all wasm modules
/**
* @param {ModuleGraph} moduleGraph the module graph
* @param {ChunkGraph} chunkGraph the chunk graph
* @param {Chunk} chunk the chunk
* @returns {Module[]} all wasm modules
*/
const getAllWasmModules = (moduleGraph, chunkGraph, chunk) => {
const wasmModules = chunk.getAllAsyncChunks();
/** @type {Module[]} */
const array = [];
for (const chunk of wasmModules) {
for (const m of chunkGraph.getOrderedChunkModulesIterable(
chunk,
compareModulesByIdentifier
)) {
if (m.type.startsWith("webassembly")) {
array.push(m);
}
}
}
return array;
};
/** @typedef {string[]} Declarations */
/**
* generates the import object function for a module
* @param {ChunkGraph} chunkGraph the chunk graph
* @param {Module} module the module
* @param {boolean | undefined} mangle mangle imports
* @param {Declarations} declarations array where declarations are pushed to
* @param {RuntimeSpec} runtime the runtime
* @returns {string} source code
*/
const generateImportObject = (
chunkGraph,
module,
mangle,
declarations,
runtime
) => {
const moduleGraph = chunkGraph.moduleGraph;
/** @type {Map<string, ModuleId>} */
const waitForInstances = new Map();
/** @type {{ module: string, name: string, value: string }[]} */
const properties = [];
const usedWasmDependencies = WebAssemblyUtils.getUsedDependencies(
moduleGraph,
module,
mangle
);
for (const usedDep of usedWasmDependencies) {
const dep = usedDep.dependency;
const importedModule = moduleGraph.getModule(dep);
const exportName = dep.name;
const usedName =
importedModule &&
moduleGraph
.getExportsInfo(importedModule)
.getUsedName(exportName, runtime);
const description = dep.description;
const direct = dep.onlyDirectImport;
const module = usedDep.module;
const name = usedDep.name;
if (direct) {
const instanceVar = `m${waitForInstances.size}`;
waitForInstances.set(
instanceVar,
/** @type {ModuleId} */
(chunkGraph.getModuleId(/** @type {Module} */ (importedModule)))
);
properties.push({
module,
name,
value: `${instanceVar}[${JSON.stringify(usedName)}]`
});
} else {
const params =
/** @type {Signature} */
(description.signature).params.map(
(param, k) => `p${k}${param.valtype}`
);
const mod = `${RuntimeGlobals.moduleCache}[${JSON.stringify(
chunkGraph.getModuleId(/** @type {Module} */ (importedModule))
)}]`;
const modExports = `${mod}.exports`;
const cache = `wasmImportedFuncCache${declarations.length}`;
declarations.push(`var ${cache};`);
const modCode =
/** @type {Module} */
(importedModule).type.startsWith("webassembly")
? `${mod} ? ${modExports}[${JSON.stringify(usedName)}] : `
: "";
properties.push({
module,
name,
value: Template.asString([
`${modCode}function(${params}) {`,
Template.indent([
`if(${cache} === undefined) ${cache} = ${modExports};`,
`return ${cache}[${JSON.stringify(usedName)}](${params});`
]),
"}"
])
});
}
}
/** @type {string[]} */
let importObject;
if (mangle) {
importObject = [
"return {",
Template.indent([
properties
.map((p) => `${JSON.stringify(p.name)}: ${p.value}`)
.join(",\n")
]),
"};"
];
} else {
/** @type {Map<string, { name: string, value: string }[]>} */
const propertiesByModule = new Map();
for (const p of properties) {
let list = propertiesByModule.get(p.module);
if (list === undefined) {
propertiesByModule.set(p.module, (list = []));
}
list.push(p);
}
importObject = [
"return {",
Template.indent([
Array.from(propertiesByModule, ([module, list]) =>
Template.asString([
`${JSON.stringify(module)}: {`,
Template.indent([
list
.map((p) => `${JSON.stringify(p.name)}: ${p.value}`)
.join(",\n")
]),
"}"
])
).join(",\n")
]),
"};"
];
}
const moduleIdStringified = JSON.stringify(chunkGraph.getModuleId(module));
if (waitForInstances.size === 1) {
const moduleId = [...waitForInstances.values()][0];
const promise = `installedWasmModules[${JSON.stringify(moduleId)}]`;
const variable = [...waitForInstances.keys()][0];
return Template.asString([
`${moduleIdStringified}: function() {`,
Template.indent([
`return promiseResolve().then(function() { return ${promise}; }).then(function(${variable}) {`,
Template.indent(importObject),
"});"
]),
"},"
]);
} else if (waitForInstances.size > 0) {
const promises = Array.from(
waitForInstances.values(),
(id) => `installedWasmModules[${JSON.stringify(id)}]`
).join(", ");
const variables = Array.from(
waitForInstances.keys(),
(name, i) => `${name} = array[${i}]`
).join(", ");
return Template.asString([
`${moduleIdStringified}: function() {`,
Template.indent([
`return promiseResolve().then(function() { return Promise.all([${promises}]); }).then(function(array) {`,
Template.indent([`var ${variables};`, ...importObject]),
"});"
]),
"},"
]);
}
return Template.asString([
`${moduleIdStringified}: function() {`,
Template.indent(importObject),
"},"
]);
};
/**
* @typedef {object} WasmChunkLoadingRuntimeModuleOptions
* @property {(path: string) => string} generateLoadBinaryCode
* @property {boolean=} supportsStreaming
* @property {boolean=} mangleImports
* @property {ReadOnlyRuntimeRequirements} runtimeRequirements
*/
class WasmChunkLoadingRuntimeModule extends RuntimeModule {
/**
* @param {WasmChunkLoadingRuntimeModuleOptions} options options
*/
constructor({
generateLoadBinaryCode,
supportsStreaming,
mangleImports,
runtimeRequirements
}) {
super("wasm chunk loading", RuntimeModule.STAGE_ATTACH);
this.generateLoadBinaryCode = generateLoadBinaryCode;
this.supportsStreaming = supportsStreaming;
this.mangleImports = mangleImports;
this._runtimeRequirements = runtimeRequirements;
}
/**
* @returns {string | null} runtime code
*/
generate() {
const fn = RuntimeGlobals.ensureChunkHandlers;
const withHmr = this._runtimeRequirements.has(
RuntimeGlobals.hmrDownloadUpdateHandlers
);
const compilation = /** @type {Compilation} */ (this.compilation);
const { moduleGraph, outputOptions } = compilation;
const chunkGraph = /** @type {ChunkGraph} */ (this.chunkGraph);
const chunk = /** @type {Chunk} */ (this.chunk);
const wasmModules = getAllWasmModules(moduleGraph, chunkGraph, chunk);
const { mangleImports } = this;
/** @type {Declarations} */
const declarations = [];
const importObjects = wasmModules.map((module) =>
generateImportObject(
chunkGraph,
module,
mangleImports,
declarations,
chunk.runtime
)
);
const chunkModuleIdMap = chunkGraph.getChunkModuleIdMap(chunk, (m) =>
m.type.startsWith("webassembly")
);
/**
* @param {string} content content
* @returns {string} created import object
*/
const createImportObject = (content) =>
mangleImports
? `{ ${JSON.stringify(WebAssemblyUtils.MANGLED_MODULE)}: ${content} }`
: content;
const wasmModuleSrcPath = compilation.getPath(
JSON.stringify(outputOptions.webassemblyModuleFilename),
{
hash: `" + ${RuntimeGlobals.getFullHash}() + "`,
hashWithLength: (length) =>
`" + ${RuntimeGlobals.getFullHash}}().slice(0, ${length}) + "`,
module: {
id: '" + wasmModuleId + "',
hash: `" + ${JSON.stringify(
chunkGraph.getChunkModuleRenderedHashMap(chunk, (m) =>
m.type.startsWith("webassembly")
)
)}[chunkId][wasmModuleId] + "`,
hashWithLength(length) {
return `" + ${JSON.stringify(
chunkGraph.getChunkModuleRenderedHashMap(
chunk,
(m) => m.type.startsWith("webassembly"),
length
)
)}[chunkId][wasmModuleId] + "`;
}
},
runtime: chunk.runtime
}
);
const stateExpression = withHmr
? `${RuntimeGlobals.hmrRuntimeStatePrefix}_wasm`
: undefined;
return Template.asString([
"// object to store loaded and loading wasm modules",
`var installedWasmModules = ${
stateExpression ? `${stateExpression} = ${stateExpression} || ` : ""
}{};`,
"",
// This function is used to delay reading the installed wasm module promises
// by a microtask. Sorting them doesn't help because there are edge cases where
// sorting is not possible (modules splitted into different chunks).
// So we not even trying and solve this by a microtask delay.
"function promiseResolve() { return Promise.resolve(); }",
"",
Template.asString(declarations),
"var wasmImportObjects = {",
Template.indent(importObjects),
"};",
"",
`var wasmModuleMap = ${JSON.stringify(
chunkModuleIdMap,
undefined,
"\t"
)};`,
"",
"// object with all WebAssembly.instance exports",
`${RuntimeGlobals.wasmInstances} = {};`,
"",
"// Fetch + compile chunk loading for webassembly",
`${fn}.wasm = function(chunkId, promises) {`,
Template.indent([
"",
"var wasmModules = wasmModuleMap[chunkId] || [];",
"",
"wasmModules.forEach(function(wasmModuleId, idx) {",
Template.indent([
"var installedWasmModuleData = installedWasmModules[wasmModuleId];",
"",
'// a Promise means "currently loading" or "already loaded".',
"if(installedWasmModuleData)",
Template.indent(["promises.push(installedWasmModuleData);"]),
"else {",
Template.indent([
"var importObject = wasmImportObjects[wasmModuleId]();",
`var req = ${this.generateLoadBinaryCode(wasmModuleSrcPath)};`,
"var promise;",
this.supportsStreaming
? Template.asString([
"if(importObject && typeof importObject.then === 'function' && typeof WebAssembly.compileStreaming === 'function') {",
Template.indent([
"promise = Promise.all([WebAssembly.compileStreaming(req), importObject]).then(function(items) {",
Template.indent([
`return WebAssembly.instantiate(items[0], ${createImportObject(
"items[1]"
)});`
]),
"});"
]),
"} else if(typeof WebAssembly.instantiateStreaming === 'function') {",
Template.indent([
`promise = WebAssembly.instantiateStreaming(req, ${createImportObject(
"importObject"
)});`
])
])
: Template.asString([
"if(importObject && typeof importObject.then === 'function') {",
Template.indent([
"var bytesPromise = req.then(function(x) { return x.arrayBuffer(); });",
"promise = Promise.all([",
Template.indent([
"bytesPromise.then(function(bytes) { return WebAssembly.compile(bytes); }),",
"importObject"
]),
"]).then(function(items) {",
Template.indent([
`return WebAssembly.instantiate(items[0], ${createImportObject(
"items[1]"
)});`
]),
"});"
])
]),
"} else {",
Template.indent([
"var bytesPromise = req.then(function(x) { return x.arrayBuffer(); });",
"promise = bytesPromise.then(function(bytes) {",
Template.indent([
`return WebAssembly.instantiate(bytes, ${createImportObject(
"importObject"
)});`
]),
"});"
]),
"}",
"promises.push(installedWasmModules[wasmModuleId] = promise.then(function(res) {",
Template.indent([
`return ${RuntimeGlobals.wasmInstances}[wasmModuleId] = (res.instance || res).exports;`
]),
"}));"
]),
"}"
]),
"});"
]),
"};"
]);
}
}
module.exports = WasmChunkLoadingRuntimeModule;
@@ -0,0 +1,18 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const RefreshCw = createLucideIcon("RefreshCw", [
["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
["path", { d: "M21 3v5h-5", key: "1q7to0" }],
["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
["path", { d: "M8 16H3v5", key: "1cv678" }]
]);
export { RefreshCw as default };
//# sourceMappingURL=refresh-cw.js.map
@@ -0,0 +1,5 @@
export declare const eachYearOfIntervalWithOptions: import("./types.js").FPFn2<
Date[],
import("../eachYearOfInterval.js").EachYearOfIntervalOptions | undefined,
import("../fp.js").Interval<Date>
>;
@@ -0,0 +1,164 @@
import { buildLocalizeFn } from "../../_lib/buildLocalizeFn.mjs";
const eraValues = {
narrow: ["Q", "W"],
abbreviated: ["QK", "WK"],
wide: ["qabel Kristu", "wara Kristu"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["K1", "K2", "K3", "K4"],
wide: ["1. kwart", "2. kwart", "3. kwart", "4. kwart"],
};
const monthValues = {
narrow: ["J", "F", "M", "A", "M", "Ġ", "L", "A", "S", "O", "N", "D"],
abbreviated: [
"Jan",
"Fra",
"Mar",
"Apr",
"Mej",
"Ġun",
"Lul",
"Aww",
"Set",
"Ott",
"Nov",
"Diċ",
],
wide: [
"Jannar",
"Frar",
"Marzu",
"April",
"Mejju",
"Ġunju",
"Lulju",
"Awwissu",
"Settembru",
"Ottubru",
"Novembru",
"Diċembru",
],
};
const dayValues = {
narrow: ["Ħ", "T", "T", "E", "Ħ", "Ġ", "S"],
short: ["Ħa", "Tn", "Tl", "Er", "Ħa", "Ġi", "Si"],
abbreviated: ["Ħad", "Tne", "Tli", "Erb", "Ħam", "Ġim", "Sib"],
wide: [
"Il-Ħadd",
"It-Tnejn",
"It-Tlieta",
"L-Erbgħa",
"Il-Ħamis",
"Il-Ġimgħa",
"Is-Sibt",
],
};
const dayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "nofsillejl",
noon: "nofsinhar",
morning: "għodwa",
afternoon: "wara nofsinhar",
evening: "filgħaxija",
night: "lejl",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "nofsillejl",
noon: "nofsinhar",
morning: "għodwa",
afternoon: "wara nofsinhar",
evening: "filgħaxija",
night: "lejl",
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "nofsillejl",
noon: "nofsinhar",
morning: "għodwa",
afternoon: "wara nofsinhar",
evening: "filgħaxija",
night: "lejl",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "f'nofsillejl",
noon: "f'nofsinhar",
morning: "filgħodu",
afternoon: "wara nofsinhar",
evening: "filgħaxija",
night: "billejl",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "f'nofsillejl",
noon: "f'nofsinhar",
morning: "filgħodu",
afternoon: "wara nofsinhar",
evening: "filgħaxija",
night: "billejl",
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "f'nofsillejl",
noon: "f'nofsinhar",
morning: "filgħodu",
afternoon: "wara nofsinhar",
evening: "filgħaxija",
night: "billejl",
},
};
const ordinalNumber = (dirtyNumber, _options) => {
const number = Number(dirtyNumber);
return number + "º";
};
export const localize = {
ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide",
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide",
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
};
@@ -0,0 +1,24 @@
'use client';
export const fieldBaseClass = 'field-type';
/**
* Determines whether a field should be displayed as right-to-left (RTL) based on its configuration, payload's localization configuration and the adming user's currently enabled locale.
* @returns Whether the field should be displayed as RTL.
*/
export function isFieldRTL({
fieldLocalized,
fieldRTL,
locale,
localizationConfig
}) {
const hasMultipleLocales = locale && localizationConfig && localizationConfig.locales && localizationConfig.locales.length > 1;
const isCurrentLocaleDefaultLocale = locale?.code === localizationConfig?.defaultLocale;
return fieldRTL !== false && locale?.rtl === true && (fieldLocalized || !fieldLocalized && !hasMultipleLocales ||
// If there is only one locale which is also rtl, that field is rtl too
!fieldLocalized && isCurrentLocaleDefaultLocale) ||
// If the current locale is the default locale, but the field is not localized, that field is rtl too
fieldRTL === true // If fieldRTL is true. This should be useful for when no localization is set at all in the payload config, but you still want fields to be rtl.
;
}
//# sourceMappingURL=index.js.map
@@ -0,0 +1,26 @@
"use strict";
exports.isSunday = isSunday;
var _index = require("./toDate.js");
/**
* @name isSunday
* @category Weekday Helpers
* @summary Is the given date Sunday?
*
* @description
* Is the given date Sunday?
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The date to check
*
* @returns The date is Sunday
*
* @example
* // Is 21 September 2014 Sunday?
* const result = isSunday(new Date(2014, 8, 21))
* //=> true
*/
function isSunday(date) {
return (0, _index.toDate)(date).getDay() === 0;
}
@@ -0,0 +1,11 @@
import type { SanitizedCollectionConfig } from 'payload';
import React from 'react';
export type SortComplexProps = {
collection: SanitizedCollectionConfig;
handleChange?: (sort: string) => void;
modifySearchQuery?: boolean;
sort?: string;
};
import './index.scss';
export declare const SortComplex: React.FC<SortComplexProps>;
//# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"thumbs-down.js","sources":["../../../src/icons/thumbs-down.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ThumbsDown\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTcgMTRWMiIgLz4KICA8cGF0aCBkPSJNOSAxOC4xMiAxMCAxNEg0LjE3YTIgMiAwIDAgMS0xLjkyLTIuNTZsMi4zMy04QTIgMiAwIDAgMSA2LjUgMkgyMGEyIDIgMCAwIDEgMiAydjhhMiAyIDAgMCAxLTIgMmgtMi43NmEyIDIgMCAwIDAtMS43OSAxLjExTDEyIDIyYTMuMTMgMy4xMyAwIDAgMS0zLTMuODhaIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/thumbs-down\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst ThumbsDown = createLucideIcon('ThumbsDown', [\n ['path', { d: 'M17 14V2', key: '8ymqnk' }],\n [\n 'path',\n {\n d: 'M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z',\n key: 'm61m77',\n },\n ],\n]);\n\nexport default ThumbsDown;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,iBAAiB,YAAc,CAAA,CAAA,CAAA;AAAA,CAAA,CAChD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACzC,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,8 @@
// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
import { nextThursday as fn } from "../nextThursday.mjs";
import { convertToFP } from "./_lib/convertToFP.mjs";
export const nextThursday = convertToFP(fn, 1);
// Fallback for modularized imports:
export default nextThursday;
@@ -0,0 +1,15 @@
import { getGlobalSingleton } from './carrier.js';
import { Scope } from './scope.js';
/** Get the default current scope. */
function getDefaultCurrentScope() {
return getGlobalSingleton('defaultCurrentScope', () => new Scope());
}
/** Get the default isolation scope. */
function getDefaultIsolationScope() {
return getGlobalSingleton('defaultIsolationScope', () => new Scope());
}
export { getDefaultCurrentScope, getDefaultIsolationScope };
//# sourceMappingURL=defaultScopes.js.map
@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["POST","GRAPHQL_POST","GET","GRAPHQL_PLAYGROUND_GET"],"sources":["../../../src/routes/graphql/index.ts"],"sourcesContent":["export { POST as GRAPHQL_POST } from './handler.js'\n\nexport { GET as GRAPHQL_PLAYGROUND_GET } from './playground.js'\n"],"mappings":"AAAA,SAASA,IAAA,IAAQC,YAAY,QAAQ;AAErC,SAASC,GAAA,IAAOC,sBAAsB,QAAQ","ignoreList":[]}
@@ -0,0 +1,300 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true,
});
exports.getArgumentValues = getArgumentValues;
exports.getDirectiveValues = getDirectiveValues;
exports.getVariableValues = getVariableValues;
var _inspect = require('../jsutils/inspect.js');
var _keyMap = require('../jsutils/keyMap.js');
var _printPathArray = require('../jsutils/printPathArray.js');
var _GraphQLError = require('../error/GraphQLError.js');
var _kinds = require('../language/kinds.js');
var _printer = require('../language/printer.js');
var _definition = require('../type/definition.js');
var _coerceInputValue = require('../utilities/coerceInputValue.js');
var _typeFromAST = require('../utilities/typeFromAST.js');
var _valueFromAST = require('../utilities/valueFromAST.js');
/**
* Prepares an object map of variableValues of the correct type based on the
* provided variable definitions and arbitrary input. If the input cannot be
* parsed to match the variable definitions, a GraphQLError will be thrown.
*
* Note: The returned value is a plain Object with a prototype, since it is
* exposed to user code. Care should be taken to not pull values from the
* Object prototype.
*/
function getVariableValues(schema, varDefNodes, inputs, options) {
const errors = [];
const maxErrors =
options === null || options === void 0 ? void 0 : options.maxErrors;
try {
const coerced = coerceVariableValues(
schema,
varDefNodes,
inputs,
(error) => {
if (maxErrors != null && errors.length >= maxErrors) {
throw new _GraphQLError.GraphQLError(
'Too many errors processing variables, error limit reached. Execution aborted.',
);
}
errors.push(error);
},
);
if (errors.length === 0) {
return {
coerced,
};
}
} catch (error) {
errors.push(error);
}
return {
errors,
};
}
function coerceVariableValues(schema, varDefNodes, inputs, onError) {
const coercedValues = {};
for (const varDefNode of varDefNodes) {
const varName = varDefNode.variable.name.value;
const varType = (0, _typeFromAST.typeFromAST)(schema, varDefNode.type);
if (!(0, _definition.isInputType)(varType)) {
// Must use input types for variables. This should be caught during
// validation, however is checked again here for safety.
const varTypeStr = (0, _printer.print)(varDefNode.type);
onError(
new _GraphQLError.GraphQLError(
`Variable "$${varName}" expected value of type "${varTypeStr}" which cannot be used as an input type.`,
{
nodes: varDefNode.type,
},
),
);
continue;
}
if (!hasOwnProperty(inputs, varName)) {
if (varDefNode.defaultValue) {
coercedValues[varName] = (0, _valueFromAST.valueFromAST)(
varDefNode.defaultValue,
varType,
);
} else if ((0, _definition.isNonNullType)(varType)) {
const varTypeStr = (0, _inspect.inspect)(varType);
onError(
new _GraphQLError.GraphQLError(
`Variable "$${varName}" of required type "${varTypeStr}" was not provided.`,
{
nodes: varDefNode,
},
),
);
}
continue;
}
const value = inputs[varName];
if (value === null && (0, _definition.isNonNullType)(varType)) {
const varTypeStr = (0, _inspect.inspect)(varType);
onError(
new _GraphQLError.GraphQLError(
`Variable "$${varName}" of non-null type "${varTypeStr}" must not be null.`,
{
nodes: varDefNode,
},
),
);
continue;
}
coercedValues[varName] = (0, _coerceInputValue.coerceInputValue)(
value,
varType,
(path, invalidValue, error) => {
let prefix =
`Variable "$${varName}" got invalid value ` +
(0, _inspect.inspect)(invalidValue);
if (path.length > 0) {
prefix += ` at "${varName}${(0, _printPathArray.printPathArray)(
path,
)}"`;
}
onError(
new _GraphQLError.GraphQLError(prefix + '; ' + error.message, {
nodes: varDefNode,
originalError: error,
}),
);
},
);
}
return coercedValues;
}
/**
* Prepares an object map of argument values given a list of argument
* definitions and list of argument AST nodes.
*
* Note: The returned value is a plain Object with a prototype, since it is
* exposed to user code. Care should be taken to not pull values from the
* Object prototype.
*/
function getArgumentValues(def, node, variableValues) {
var _node$arguments;
const coercedValues = {}; // FIXME: https://github.com/graphql/graphql-js/issues/2203
/* c8 ignore next */
const argumentNodes =
(_node$arguments = node.arguments) !== null && _node$arguments !== void 0
? _node$arguments
: [];
const argNodeMap = (0, _keyMap.keyMap)(
argumentNodes,
(arg) => arg.name.value,
);
for (const argDef of def.args) {
const name = argDef.name;
const argType = argDef.type;
const argumentNode = argNodeMap[name];
if (!argumentNode) {
if (argDef.defaultValue !== undefined) {
coercedValues[name] = argDef.defaultValue;
} else if ((0, _definition.isNonNullType)(argType)) {
throw new _GraphQLError.GraphQLError(
`Argument "${name}" of required type "${(0, _inspect.inspect)(
argType,
)}" ` + 'was not provided.',
{
nodes: node,
},
);
}
continue;
}
const valueNode = argumentNode.value;
let isNull = valueNode.kind === _kinds.Kind.NULL;
if (valueNode.kind === _kinds.Kind.VARIABLE) {
const variableName = valueNode.name.value;
if (
variableValues == null ||
!hasOwnProperty(variableValues, variableName)
) {
if (argDef.defaultValue !== undefined) {
coercedValues[name] = argDef.defaultValue;
} else if ((0, _definition.isNonNullType)(argType)) {
throw new _GraphQLError.GraphQLError(
`Argument "${name}" of required type "${(0, _inspect.inspect)(
argType,
)}" ` +
`was provided the variable "$${variableName}" which was not provided a runtime value.`,
{
nodes: valueNode,
},
);
}
continue;
}
isNull = variableValues[variableName] == null;
}
if (isNull && (0, _definition.isNonNullType)(argType)) {
throw new _GraphQLError.GraphQLError(
`Argument "${name}" of non-null type "${(0, _inspect.inspect)(
argType,
)}" ` + 'must not be null.',
{
nodes: valueNode,
},
);
}
const coercedValue = (0, _valueFromAST.valueFromAST)(
valueNode,
argType,
variableValues,
);
if (coercedValue === undefined) {
// Note: ValuesOfCorrectTypeRule validation should catch this before
// execution. This is a runtime check to ensure execution does not
// continue with an invalid argument value.
throw new _GraphQLError.GraphQLError(
`Argument "${name}" has invalid value ${(0, _printer.print)(
valueNode,
)}.`,
{
nodes: valueNode,
},
);
}
coercedValues[name] = coercedValue;
}
return coercedValues;
}
/**
* Prepares an object map of argument values given a directive definition
* and a AST node which may contain directives. Optionally also accepts a map
* of variable values.
*
* If the directive does not exist on the node, returns undefined.
*
* Note: The returned value is a plain Object with a prototype, since it is
* exposed to user code. Care should be taken to not pull values from the
* Object prototype.
*/
function getDirectiveValues(directiveDef, node, variableValues) {
var _node$directives;
const directiveNode =
(_node$directives = node.directives) === null || _node$directives === void 0
? void 0
: _node$directives.find(
(directive) => directive.name.value === directiveDef.name,
);
if (directiveNode) {
return getArgumentValues(directiveDef, directiveNode, variableValues);
}
}
function hasOwnProperty(obj, prop) {
return Object.prototype.hasOwnProperty.call(obj, prop);
}
@@ -0,0 +1 @@
{"version":3,"file":"receipt-russian-ruble.js","sources":["../../../src/icons/receipt-russian-ruble.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ReceiptRussianRuble\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNCAydjIwbDItMSAyIDEgMi0xIDIgMSAyLTEgMiAxIDItMSAyIDFWMmwtMiAxLTItMS0yIDEtMi0xLTIgMS0yLTEtMiAxWiIgLz4KICA8cGF0aCBkPSJNOCAxNWg1IiAvPgogIDxwYXRoIGQ9Ik04IDExaDVhMiAyIDAgMSAwIDAtNGgtM3YxMCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/receipt-russian-ruble\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst ReceiptRussianRuble = createLucideIcon('ReceiptRussianRuble', [\n [\n 'path',\n { d: 'M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z', key: 'q3az6g' },\n ],\n ['path', { d: 'M8 15h5', key: 'vxg57a' }],\n ['path', { d: 'M8 11h5a2 2 0 1 0 0-4h-3v10', key: '1usi5u' }],\n]);\n\nexport default ReceiptRussianRuble;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAsB,iBAAiB,qBAAuB,CAAA,CAAA,CAAA;AAAA,CAClE,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA,CAAE,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA2E,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,QAAS,CAAA,CAAA;AAAA,CAChG,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA+B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC9D,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,57 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.DiagConsoleLogger = void 0;
const consoleMap = [
{ n: 'error', c: 'error' },
{ n: 'warn', c: 'warn' },
{ n: 'info', c: 'info' },
{ n: 'debug', c: 'debug' },
{ n: 'verbose', c: 'trace' },
];
/**
* A simple Immutable Console based diagnostic logger which will output any messages to the Console.
* If you want to limit the amount of logging to a specific level or lower use the
* {@link createLogLevelDiagLogger}
*/
class DiagConsoleLogger {
constructor() {
function _consoleFunc(funcName) {
return function (...args) {
if (console) {
// Some environments only expose the console when the F12 developer console is open
// eslint-disable-next-line no-console
let theFunc = console[funcName];
if (typeof theFunc !== 'function') {
// Not all environments support all functions
// eslint-disable-next-line no-console
theFunc = console.log;
}
// One last final check
if (typeof theFunc === 'function') {
return theFunc.apply(console, args);
}
}
};
}
for (let i = 0; i < consoleMap.length; i++) {
this[consoleMap[i].n] = _consoleFunc(consoleMap[i].c);
}
}
}
exports.DiagConsoleLogger = DiagConsoleLogger;
//# sourceMappingURL=consoleLogger.js.map
@@ -0,0 +1,300 @@
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { PageConfigProvider } from '@payloadcms/ui';
import { RenderServerComponent } from '@payloadcms/ui/elements/RenderServerComponent';
import { getVisibleEntities } from '@payloadcms/ui/shared';
import { getClientConfig } from '@payloadcms/ui/utilities/getClientConfig';
import { notFound, redirect } from 'next/navigation.js';
import { applyLocaleFiltering, formatAdminURL } from 'payload/shared';
import * as qs from 'qs-esm';
import React from 'react';
import { DefaultTemplate } from '../../templates/Default/index.js';
import { MinimalTemplate } from '../../templates/Minimal/index.js';
import { getPreferences } from '../../utilities/getPreferences.js';
import { handleAuthRedirect } from '../../utilities/handleAuthRedirect.js';
import { initReq } from '../../utilities/initReq.js';
import { isCustomAdminView } from '../../utilities/isCustomAdminView.js';
import { isPublicAdminRoute } from '../../utilities/isPublicAdminRoute.js';
import { getCustomViewByRoute } from './getCustomViewByRoute.js';
import { getRouteData } from './getRouteData.js';
export const RootPage = async ({
config: configPromise,
importMap,
params: paramsPromise,
searchParams: searchParamsPromise
}) => {
const config = await configPromise;
const {
admin: {
routes: {
createFirstUser: _createFirstUserRoute
},
user: userSlug
},
routes: {
admin: adminRoute
}
} = config;
const params = await paramsPromise;
const currentRoute = formatAdminURL({
adminRoute,
path: Array.isArray(params.segments) ? `/${params.segments.join('/')}` : null
});
const segments = Array.isArray(params.segments) ? params.segments : [];
const isCollectionRoute = segments[0] === 'collections';
const isGlobalRoute = segments[0] === 'globals';
let collectionConfig = undefined;
let globalConfig = undefined;
const searchParams = await searchParamsPromise;
// Redirect `${adminRoute}/collections` to `${adminRoute}`
if (isCollectionRoute) {
if (segments.length === 1) {
const {
viewKey
} = getCustomViewByRoute({
config,
currentRoute: '/collections'
});
// Only redirect if there's NO custom view configured for /collections
if (!viewKey) {
redirect(adminRoute);
}
}
if (segments[1]) {
collectionConfig = config.collections.find(({
slug
}) => slug === segments[1]);
}
}
// Redirect `${adminRoute}/globals` to `${adminRoute}`
if (isGlobalRoute) {
if (segments.length === 1) {
const {
viewKey
} = getCustomViewByRoute({
config,
currentRoute: '/globals'
});
// Only redirect if there's NO custom view configured for /globals
if (!viewKey) {
redirect(adminRoute);
}
}
if (segments[1]) {
globalConfig = config.globals.find(({
slug
}) => slug === segments[1]);
}
}
if (isCollectionRoute && !collectionConfig || isGlobalRoute && !globalConfig) {
return notFound();
}
const queryString = `${qs.stringify(searchParams ?? {}, {
addQueryPrefix: true
})}`;
const {
cookies,
locale,
permissions,
req,
req: {
payload
}
} = await initReq({
configPromise: config,
importMap,
key: 'initPage',
overrides: {
fallbackLocale: false,
req: {
query: qs.parse(queryString, {
depth: 10,
ignoreQueryPrefix: true
})
},
// intentionally omit `serverURL` to keep URL relative
urlSuffix: `${currentRoute}${searchParams ? queryString : ''}`
}
});
if (!permissions.canAccessAdmin && !isPublicAdminRoute({
adminRoute,
config: payload.config,
route: currentRoute
}) && !isCustomAdminView({
adminRoute,
config: payload.config,
route: currentRoute
})) {
redirect(handleAuthRedirect({
config: payload.config,
route: currentRoute,
searchParams,
user: req.user
}));
}
let collectionPreferences = undefined;
if (collectionConfig && segments.length === 2) {
if (config.folders && collectionConfig.folders && segments[1] !== config.folders.slug) {
await getPreferences(`collection-${collectionConfig.slug}`, req.payload, req.user.id, config.admin.user).then(res => {
if (res && res.value) {
collectionPreferences = res.value;
}
});
}
}
const {
browseByFolderSlugs,
DefaultView,
documentSubViewType,
routeParams,
templateClassName,
templateType,
viewActions,
viewType
} = getRouteData({
adminRoute,
collectionConfig,
collectionPreferences,
currentRoute,
globalConfig,
payload,
searchParams,
segments
});
req.routeParams = routeParams;
const dbHasUser = req.user || (await req.payload.db.findOne({
collection: userSlug,
req
})?.then(doc => !!doc));
/**
* This function is responsible for handling the case where the view is not found.
* The current route did not match any default views or custom route views.
*/
if (!DefaultView?.Component && !DefaultView?.payloadComponent) {
if (req?.user) {
notFound();
}
if (dbHasUser) {
redirect(adminRoute);
}
}
const usersCollection = config.collections.find(({
slug
}) => slug === userSlug);
const disableLocalStrategy = usersCollection?.auth?.disableLocalStrategy;
const createFirstUserRoute = formatAdminURL({
adminRoute,
path: _createFirstUserRoute
});
if (disableLocalStrategy && currentRoute === createFirstUserRoute) {
redirect(adminRoute);
}
if (!dbHasUser && currentRoute !== createFirstUserRoute && !disableLocalStrategy) {
redirect(createFirstUserRoute);
}
if (dbHasUser && currentRoute === createFirstUserRoute) {
redirect(adminRoute);
}
if (!DefaultView?.Component && !DefaultView?.payloadComponent && !dbHasUser) {
redirect(adminRoute);
}
const clientConfig = getClientConfig({
config,
i18n: req.i18n,
importMap,
user: viewType === 'createFirstUser' ? true : req.user
});
await applyLocaleFiltering({
clientConfig,
config,
req
});
// Ensure locale on req is still valid after filtering locales
if (clientConfig.localization && req.locale && !clientConfig.localization.localeCodes.includes(req.locale)) {
redirect(`${currentRoute}${qs.stringify({
...searchParams,
locale: clientConfig.localization.localeCodes.includes(clientConfig.localization.defaultLocale) ? clientConfig.localization.defaultLocale : clientConfig.localization.localeCodes[0]
}, {
addQueryPrefix: true
})}`);
}
const visibleEntities = getVisibleEntities({
req
});
const folderID = routeParams.folderID;
const RenderedView = RenderServerComponent({
clientProps: {
browseByFolderSlugs,
clientConfig,
documentSubViewType,
viewType
},
Component: DefaultView.payloadComponent,
Fallback: DefaultView.Component,
importMap,
serverProps: {
clientConfig,
collectionConfig,
docID: routeParams.id,
folderID,
globalConfig,
i18n: req.i18n,
importMap,
initPageResult: {
collectionConfig,
cookies,
docID: routeParams.id,
globalConfig,
languageOptions: Object.entries(req.payload.config.i18n.supportedLanguages || {}).reduce((acc, [language, languageConfig]) => {
if (Object.keys(req.payload.config.i18n.supportedLanguages).includes(language)) {
acc.push({
label: languageConfig.translations.general.thisLanguage,
value: language
});
}
return acc;
}, []),
locale,
permissions,
req,
translations: req.i18n.translations,
visibleEntities
},
params,
payload: req.payload,
searchParams,
viewActions
}
});
return /*#__PURE__*/_jsxs(PageConfigProvider, {
config: clientConfig,
children: [!templateType && /*#__PURE__*/_jsx(React.Fragment, {
children: RenderedView
}), templateType === 'minimal' && /*#__PURE__*/_jsx(MinimalTemplate, {
className: templateClassName,
children: RenderedView
}), templateType === 'default' && /*#__PURE__*/_jsx(DefaultTemplate, {
collectionSlug: collectionConfig?.slug,
docID: routeParams.id,
documentSubViewType: documentSubViewType,
globalSlug: globalConfig?.slug,
i18n: req.i18n,
locale: locale,
params: params,
payload: req.payload,
permissions: permissions,
req: req,
searchParams: searchParams,
user: req.user,
viewActions: viewActions,
viewType: viewType,
visibleEntities: {
// The reason we are not passing in initPageResult.visibleEntities directly is due to a "Cannot assign to read only property of object '#<Object>" error introduced in React 19
// which this caused as soon as initPageResult.visibleEntities is passed in
collections: visibleEntities?.collections,
globals: visibleEntities?.globals
},
children: RenderedView
})]
});
};
//# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
{"version":3,"file":"text-cursor.js","sources":["../../../src/icons/text-cursor.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name TextCursor\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTcgMjJoLTFhNCA0IDAgMCAxLTQtNFY2YTQgNCAwIDAgMSA0LTRoMSIgLz4KICA8cGF0aCBkPSJNNyAyMmgxYTQgNCAwIDAgMCA0LTR2LTEiIC8+CiAgPHBhdGggZD0iTTcgMmgxYTQgNCAwIDAgMSA0IDR2MSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/text-cursor\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst TextCursor = createLucideIcon('TextCursor', [\n ['path', { d: 'M17 22h-1a4 4 0 0 1-4-4V6a4 4 0 0 1 4-4h1', key: 'uvaxm9' }],\n ['path', { d: 'M7 22h1a4 4 0 0 0 4-4v-1', key: '11xy8d' }],\n ['path', { d: 'M7 2h1a4 4 0 0 1 4 4v1', key: '1uw06m' }],\n]);\n\nexport default TextCursor;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,iBAAiB,YAAc,CAAA,CAAA,CAAA;AAAA,CAAA,CAChD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA6C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA4B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA0B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACzD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,4 @@
import type { DefaultTranslationsObject, Language } from '../types.js';
export declare const etTranslations: DefaultTranslationsObject;
export declare const et: Language;
//# sourceMappingURL=et.d.ts.map
@@ -0,0 +1,8 @@
"use strict";
exports.hoursToMilliseconds = void 0;
var _index = require("../hoursToMilliseconds.js");
var _index2 = require("./_lib/convertToFP.js"); // This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
const hoursToMilliseconds = (exports.hoursToMilliseconds = (0,
_index2.convertToFP)(_index.hoursToMilliseconds, 1));
@@ -0,0 +1 @@
{"version":3,"file":"chevrons-down.js","sources":["../../../src/icons/chevrons-down.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ChevronsDown\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtNyA2IDUgNSA1LTUiIC8+CiAgPHBhdGggZD0ibTcgMTMgNSA1IDUtNSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/chevrons-down\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst ChevronsDown = createLucideIcon('ChevronsDown', [\n ['path', { d: 'm7 6 5 5 5-5', key: '1lc07p' }],\n ['path', { d: 'm7 13 5 5 5-5', key: '1d48rs' }],\n]);\n\nexport default ChevronsDown;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,iBAAiB,cAAgB,CAAA,CAAA,CAAA;AAAA,CAAA,CACpD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAgB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC7C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAChD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,13 @@
import { Context } from '../context/types';
import { TextMapPropagator } from './TextMapPropagator';
/**
* No-op implementations of {@link TextMapPropagator}.
*/
export declare class NoopTextMapPropagator implements TextMapPropagator {
/** Noop inject function does nothing */
inject(_context: Context, _carrier: unknown): void;
/** Noop extract function does nothing and returns the input context */
extract(context: Context, _carrier: unknown): Context;
fields(): string[];
}
//# sourceMappingURL=NoopTextMapPropagator.d.ts.map
@@ -0,0 +1,2 @@
var convert = require('./convert');
module.exports = convert(require('../array'));
@@ -0,0 +1,16 @@
'use strict'
const pino = require('../..')
const transport = pino.transport({
target: './to-file-transport-with-transform.js',
options: {
destination: process.argv[2]
}
})
const logger = pino(transport)
logger.info('Hello')
logger.info('World')
process.exit(0)
@@ -0,0 +1,62 @@
var baseGetTag = require('./_baseGetTag'),
getPrototype = require('./_getPrototype'),
isObjectLike = require('./isObjectLike');
/** `Object#toString` result references. */
var objectTag = '[object Object]';
/** Used for built-in method references. */
var funcProto = Function.prototype,
objectProto = Object.prototype;
/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/** Used to infer the `Object` constructor. */
var objectCtorString = funcToString.call(Object);
/**
* Checks if `value` is a plain object, that is, an object created by the
* `Object` constructor or one with a `[[Prototype]]` of `null`.
*
* @static
* @memberOf _
* @since 0.8.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
* @example
*
* function Foo() {
* this.a = 1;
* }
*
* _.isPlainObject(new Foo);
* // => false
*
* _.isPlainObject([1, 2, 3]);
* // => false
*
* _.isPlainObject({ 'x': 0, 'y': 0 });
* // => true
*
* _.isPlainObject(Object.create(null));
* // => true
*/
function isPlainObject(value) {
if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
return false;
}
var proto = getPrototype(value);
if (proto === null) {
return true;
}
var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
return typeof Ctor == 'function' && Ctor instanceof Ctor &&
funcToString.call(Ctor) == objectCtorString;
}
module.exports = isPlainObject;
@@ -0,0 +1,6 @@
export declare const addMonthsWithOptions: import("./types.js").FPFn3<
Date,
import("../addMonths.js").AddMonthsOptions<Date> | undefined,
number,
import("../fp.js").DateArg<Date>
>;
@@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = cloneWithoutLoc;
var _cloneNode = require("./cloneNode.js");
function cloneWithoutLoc(node) {
return (0, _cloneNode.default)(node, false, true);
}
//# sourceMappingURL=cloneWithoutLoc.js.map
@@ -0,0 +1 @@
{"version":3,"file":"getSiblingData.d.ts","sourceRoot":"","sources":["../../src/utilities/getSiblingData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAKxD,eAAO,MAAM,cAAc,WAAY,SAAS,QAAQ,MAAM,KAAG,IAqChE,CAAA"}
@@ -0,0 +1 @@
{"version":3,"file":"geometryColumn.d.ts","sourceRoot":"","sources":["../../../src/postgres/schema/geometryColumn.ts"],"names":[],"mappings":"AAMA,KAAK,KAAK,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAE7B,eAAO,MAAM,cAAc,SAAU,MAAM;;;;;;;EAWjC,CAAA"}
@@ -0,0 +1,68 @@
import { entityKind } from "../../entity.js";
import { getColumnNameAndConfig } from "../../utils.js";
import { MySqlColumnBuilderWithAutoIncrement, MySqlColumnWithAutoIncrement } from "./common.js";
class MySqlBigInt53Builder extends MySqlColumnBuilderWithAutoIncrement {
static [entityKind] = "MySqlBigInt53Builder";
constructor(name, unsigned = false) {
super(name, "number", "MySqlBigInt53");
this.config.unsigned = unsigned;
}
/** @internal */
build(table) {
return new MySqlBigInt53(
table,
this.config
);
}
}
class MySqlBigInt53 extends MySqlColumnWithAutoIncrement {
static [entityKind] = "MySqlBigInt53";
getSQLType() {
return `bigint${this.config.unsigned ? " unsigned" : ""}`;
}
mapFromDriverValue(value) {
if (typeof value === "number") {
return value;
}
return Number(value);
}
}
class MySqlBigInt64Builder extends MySqlColumnBuilderWithAutoIncrement {
static [entityKind] = "MySqlBigInt64Builder";
constructor(name, unsigned = false) {
super(name, "bigint", "MySqlBigInt64");
this.config.unsigned = unsigned;
}
/** @internal */
build(table) {
return new MySqlBigInt64(
table,
this.config
);
}
}
class MySqlBigInt64 extends MySqlColumnWithAutoIncrement {
static [entityKind] = "MySqlBigInt64";
getSQLType() {
return `bigint${this.config.unsigned ? " unsigned" : ""}`;
}
// eslint-disable-next-line unicorn/prefer-native-coercion-functions
mapFromDriverValue(value) {
return BigInt(value);
}
}
function bigint(a, b) {
const { name, config } = getColumnNameAndConfig(a, b);
if (config.mode === "number") {
return new MySqlBigInt53Builder(name, config.unsigned);
}
return new MySqlBigInt64Builder(name, config.unsigned);
}
export {
MySqlBigInt53,
MySqlBigInt53Builder,
MySqlBigInt64,
MySqlBigInt64Builder,
bigint
};
//# sourceMappingURL=bigint.js.map
@@ -0,0 +1,39 @@
import { buildFormatLongFn } from "../../_lib/buildFormatLongFn.mjs";
const dateFormats = {
full: "EEEE, dd MMMM yyyy",
long: "dd MMMM yyyy",
medium: "dd MMM yyyy",
short: "yyyy/MM/dd",
};
const timeFormats = {
full: "HH:mm:ss zzzz",
long: "HH:mm:ss z",
medium: "HH:mm:ss",
short: "HH:mm",
};
const dateTimeFormats = {
full: "{{date}} 'at' {{time}}",
long: "{{date}} 'at' {{time}}",
medium: "{{date}}, {{time}}",
short: "{{date}}, {{time}}",
};
export const formatLong = {
date: buildFormatLongFn({
formats: dateFormats,
defaultWidth: "full",
}),
time: buildFormatLongFn({
formats: timeFormats,
defaultWidth: "full",
}),
dateTime: buildFormatLongFn({
formats: dateTimeFormats,
defaultWidth: "full",
}),
};
@@ -0,0 +1 @@
{"version":3,"file":"element-container.js","sourceRoot":"","sources":["../../../src/dom/element-container.ts"],"names":[],"mappings":";;;AAAA,sCAAkD;AAElD,+CAAyD;AACzD,6CAAgD;AAEhD,6CAA2D;AAS3D;IAOI,0BAA+B,OAAgB,EAAE,OAAgB;QAAlC,YAAO,GAAP,OAAO,CAAS;QALtC,cAAS,GAAoB,EAAE,CAAC;QAChC,aAAQ,GAAuB,EAAE,CAAC;QAE3C,UAAK,GAAG,CAAC,CAAC;QAGN,IAAI,sBAAW,CAAC,OAAO,gBAAqB,EAAE;YAC1C,QAAQ,CAAC;SACZ;QAED,IAAI,CAAC,MAAM,GAAG,IAAI,4BAAoB,CAAC,OAAO,EAAE,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;QAExF,IAAI,+BAAiB,CAAC,OAAO,CAAC,EAAE;YAC5B,IAAI,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC,UAAC,QAAQ,IAAK,OAAA,QAAQ,GAAG,CAAC,EAAZ,CAAY,CAAC,EAAE;gBAChE,OAAO,CAAC,KAAK,CAAC,iBAAiB,GAAG,IAAI,CAAC;aAC1C;YAED,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS,KAAK,IAAI,EAAE;gBAChC,sDAAsD;gBACtD,OAAO,CAAC,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC;aACpC;SACJ;QAED,IAAI,CAAC,MAAM,GAAG,oBAAW,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAEjD,IAAI,sBAAW,CAAC,OAAO,iBAAsB,EAAE;YAC3C,IAAI,CAAC,KAAK,yBAAsB,CAAC;SACpC;IACL,CAAC;IACL,uBAAC;AAAD,CAAC,AA/BD,IA+BC;AA/BY,4CAAgB"}
@@ -0,0 +1,314 @@
import { inspect } from '../jsutils/inspect.mjs';
import { invariant } from '../jsutils/invariant.mjs';
import { isPrintableAsBlockString } from '../language/blockString.mjs';
import { Kind } from '../language/kinds.mjs';
import { print } from '../language/printer.mjs';
import {
isEnumType,
isInputObjectType,
isInterfaceType,
isObjectType,
isScalarType,
isUnionType,
} from '../type/definition.mjs';
import {
DEFAULT_DEPRECATION_REASON,
isSpecifiedDirective,
} from '../type/directives.mjs';
import { isIntrospectionType } from '../type/introspection.mjs';
import { isSpecifiedScalarType } from '../type/scalars.mjs';
import { astFromValue } from './astFromValue.mjs';
export function printSchema(schema) {
return printFilteredSchema(
schema,
(n) => !isSpecifiedDirective(n),
isDefinedType,
);
}
export function printIntrospectionSchema(schema) {
return printFilteredSchema(schema, isSpecifiedDirective, isIntrospectionType);
}
function isDefinedType(type) {
return !isSpecifiedScalarType(type) && !isIntrospectionType(type);
}
function printFilteredSchema(schema, directiveFilter, typeFilter) {
const directives = schema.getDirectives().filter(directiveFilter);
const types = Object.values(schema.getTypeMap()).filter(typeFilter);
return [
printSchemaDefinition(schema),
...directives.map((directive) => printDirective(directive)),
...types.map((type) => printType(type)),
]
.filter(Boolean)
.join('\n\n');
}
function printSchemaDefinition(schema) {
if (schema.description == null && isSchemaOfCommonNames(schema)) {
return;
}
const operationTypes = [];
const queryType = schema.getQueryType();
if (queryType) {
operationTypes.push(` query: ${queryType.name}`);
}
const mutationType = schema.getMutationType();
if (mutationType) {
operationTypes.push(` mutation: ${mutationType.name}`);
}
const subscriptionType = schema.getSubscriptionType();
if (subscriptionType) {
operationTypes.push(` subscription: ${subscriptionType.name}`);
}
return printDescription(schema) + `schema {\n${operationTypes.join('\n')}\n}`;
}
/**
* GraphQL schema define root types for each type of operation. These types are
* the same as any other type and can be named in any manner, however there is
* a common naming convention:
*
* ```graphql
* schema {
* query: Query
* mutation: Mutation
* subscription: Subscription
* }
* ```
*
* When using this naming convention, the schema description can be omitted.
*/
function isSchemaOfCommonNames(schema) {
const queryType = schema.getQueryType();
if (queryType && queryType.name !== 'Query') {
return false;
}
const mutationType = schema.getMutationType();
if (mutationType && mutationType.name !== 'Mutation') {
return false;
}
const subscriptionType = schema.getSubscriptionType();
if (subscriptionType && subscriptionType.name !== 'Subscription') {
return false;
}
return true;
}
export function printType(type) {
if (isScalarType(type)) {
return printScalar(type);
}
if (isObjectType(type)) {
return printObject(type);
}
if (isInterfaceType(type)) {
return printInterface(type);
}
if (isUnionType(type)) {
return printUnion(type);
}
if (isEnumType(type)) {
return printEnum(type);
}
if (isInputObjectType(type)) {
return printInputObject(type);
}
/* c8 ignore next 3 */
// Not reachable, all possible types have been considered.
false || invariant(false, 'Unexpected type: ' + inspect(type));
}
function printScalar(type) {
return (
printDescription(type) + `scalar ${type.name}` + printSpecifiedByURL(type)
);
}
function printImplementedInterfaces(type) {
const interfaces = type.getInterfaces();
return interfaces.length
? ' implements ' + interfaces.map((i) => i.name).join(' & ')
: '';
}
function printObject(type) {
return (
printDescription(type) +
`type ${type.name}` +
printImplementedInterfaces(type) +
printFields(type)
);
}
function printInterface(type) {
return (
printDescription(type) +
`interface ${type.name}` +
printImplementedInterfaces(type) +
printFields(type)
);
}
function printUnion(type) {
const types = type.getTypes();
const possibleTypes = types.length ? ' = ' + types.join(' | ') : '';
return printDescription(type) + 'union ' + type.name + possibleTypes;
}
function printEnum(type) {
const values = type
.getValues()
.map(
(value, i) =>
printDescription(value, ' ', !i) +
' ' +
value.name +
printDeprecated(value.deprecationReason),
);
return printDescription(type) + `enum ${type.name}` + printBlock(values);
}
function printInputObject(type) {
const fields = Object.values(type.getFields()).map(
(f, i) => printDescription(f, ' ', !i) + ' ' + printInputValue(f),
);
return (
printDescription(type) +
`input ${type.name}` +
(type.isOneOf ? ' @oneOf' : '') +
printBlock(fields)
);
}
function printFields(type) {
const fields = Object.values(type.getFields()).map(
(f, i) =>
printDescription(f, ' ', !i) +
' ' +
f.name +
printArgs(f.args, ' ') +
': ' +
String(f.type) +
printDeprecated(f.deprecationReason),
);
return printBlock(fields);
}
function printBlock(items) {
return items.length !== 0 ? ' {\n' + items.join('\n') + '\n}' : '';
}
function printArgs(args, indentation = '') {
if (args.length === 0) {
return '';
} // If every arg does not have a description, print them on one line.
if (args.every((arg) => !arg.description)) {
return '(' + args.map(printInputValue).join(', ') + ')';
}
return (
'(\n' +
args
.map(
(arg, i) =>
printDescription(arg, ' ' + indentation, !i) +
' ' +
indentation +
printInputValue(arg),
)
.join('\n') +
'\n' +
indentation +
')'
);
}
function printInputValue(arg) {
const defaultAST = astFromValue(arg.defaultValue, arg.type);
let argDecl = arg.name + ': ' + String(arg.type);
if (defaultAST) {
argDecl += ` = ${print(defaultAST)}`;
}
return argDecl + printDeprecated(arg.deprecationReason);
}
function printDirective(directive) {
return (
printDescription(directive) +
'directive @' +
directive.name +
printArgs(directive.args) +
(directive.isRepeatable ? ' repeatable' : '') +
' on ' +
directive.locations.join(' | ')
);
}
function printDeprecated(reason) {
if (reason == null) {
return '';
}
if (reason !== DEFAULT_DEPRECATION_REASON) {
const astValue = print({
kind: Kind.STRING,
value: reason,
});
return ` @deprecated(reason: ${astValue})`;
}
return ' @deprecated';
}
function printSpecifiedByURL(scalar) {
if (scalar.specifiedByURL == null) {
return '';
}
const astValue = print({
kind: Kind.STRING,
value: scalar.specifiedByURL,
});
return ` @specifiedBy(url: ${astValue})`;
}
function printDescription(def, indentation = '', firstInBlock = true) {
const { description } = def;
if (description == null) {
return '';
}
const blockString = print({
kind: Kind.STRING,
value: description,
block: isPrintableAsBlockString(description),
});
const prefix =
indentation && !firstInBlock ? '\n' + indentation : indentation;
return prefix + blockString.replace(/\n/g, '\n' + indentation) + '\n';
}
@@ -0,0 +1 @@
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors, Aspecto\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Span } from '@opentelemetry/api';\nimport { InstrumentationConfig } from '@opentelemetry/instrumentation';\n\nexport interface KafkajsMessage {\n key?: Buffer | string | null;\n value: Buffer | string | null;\n partition?: number;\n headers?: Record<string, Buffer | string | (Buffer | string)[] | undefined>;\n timestamp?: string;\n}\n\nexport interface MessageInfo<T = KafkajsMessage> {\n topic: string;\n message: T;\n}\n\nexport interface KafkaProducerCustomAttributeFunction<T = KafkajsMessage> {\n (span: Span, info: MessageInfo<T>): void;\n}\n\nexport interface KafkaConsumerCustomAttributeFunction<T = KafkajsMessage> {\n (span: Span, info: MessageInfo<T>): void;\n}\n\nexport interface KafkaJsInstrumentationConfig extends InstrumentationConfig {\n /** hook for adding custom attributes before producer message is sent */\n producerHook?: KafkaProducerCustomAttributeFunction;\n\n /** hook for adding custom attributes before consumer message is processed */\n consumerHook?: KafkaConsumerCustomAttributeFunction;\n}\n"]}
@@ -0,0 +1,11 @@
// @flow
// These types are not as powerful as the TypeScript types, but they get the job done
export type EqualityFn = (newArgs: mixed[], lastArgs: mixed[]) => boolean;
// default export
declare export default function memoizeOne<ResultFn: (...any[]) => mixed>(
fn: ResultFn,
isEqual?: EqualityFn,
): ResultFn & { clear: () => void };
@@ -0,0 +1,203 @@
import { buildLocalizeFn } from "../../_lib/buildLocalizeFn.js";
const eraValues = {
narrow: ["C", "O"],
abbreviated: ["CC", "OC"],
wide: ["Cyn Crist", "Ar ôl Crist"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["Ch1", "Ch2", "Ch3", "Ch4"],
wide: ["Chwarter 1af", "2ail chwarter", "3ydd chwarter", "4ydd chwarter"],
};
// Note: in English, the names of days of the week and months are capitalized.
// If you are making a new locale based on this one, check if the same is true for the language you're working on.
// Generally, formatted dates should look like they are in the middle of a sentence,
// e.g. in Spanish language the weekdays and months should be in the lowercase.
const monthValues = {
narrow: ["I", "Ch", "Ma", "E", "Mi", "Me", "G", "A", "Md", "H", "T", "Rh"],
abbreviated: [
"Ion",
"Chwe",
"Maw",
"Ebr",
"Mai",
"Meh",
"Gor",
"Aws",
"Med",
"Hyd",
"Tach",
"Rhag",
],
wide: [
"Ionawr",
"Chwefror",
"Mawrth",
"Ebrill",
"Mai",
"Mehefin",
"Gorffennaf",
"Awst",
"Medi",
"Hydref",
"Tachwedd",
"Rhagfyr",
],
};
const dayValues = {
narrow: ["S", "Ll", "M", "M", "I", "G", "S"],
short: ["Su", "Ll", "Ma", "Me", "Ia", "Gw", "Sa"],
abbreviated: ["Sul", "Llun", "Maw", "Mer", "Iau", "Gwe", "Sad"],
wide: [
"dydd Sul",
"dydd Llun",
"dydd Mawrth",
"dydd Mercher",
"dydd Iau",
"dydd Gwener",
"dydd Sadwrn",
],
};
const dayPeriodValues = {
narrow: {
am: "b",
pm: "h",
midnight: "hn",
noon: "hd",
morning: "bore",
afternoon: "prynhawn",
evening: "gyda'r nos",
night: "nos",
},
abbreviated: {
am: "yb",
pm: "yh",
midnight: "hanner nos",
noon: "hanner dydd",
morning: "bore",
afternoon: "prynhawn",
evening: "gyda'r nos",
night: "nos",
},
wide: {
am: "y.b.",
pm: "y.h.",
midnight: "hanner nos",
noon: "hanner dydd",
morning: "bore",
afternoon: "prynhawn",
evening: "gyda'r nos",
night: "nos",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "b",
pm: "h",
midnight: "hn",
noon: "hd",
morning: "yn y bore",
afternoon: "yn y prynhawn",
evening: "gyda'r nos",
night: "yn y nos",
},
abbreviated: {
am: "yb",
pm: "yh",
midnight: "hanner nos",
noon: "hanner dydd",
morning: "yn y bore",
afternoon: "yn y prynhawn",
evening: "gyda'r nos",
night: "yn y nos",
},
wide: {
am: "y.b.",
pm: "y.h.",
midnight: "hanner nos",
noon: "hanner dydd",
morning: "yn y bore",
afternoon: "yn y prynhawn",
evening: "gyda'r nos",
night: "yn y nos",
},
};
const ordinalNumber = (dirtyNumber, _options) => {
const number = Number(dirtyNumber);
if (number < 20) {
switch (number) {
case 0:
return number + "fed";
case 1:
return number + "af";
case 2:
return number + "ail";
case 3:
case 4:
return number + "ydd";
case 5:
case 6:
return number + "ed";
case 7:
case 8:
case 9:
case 10:
case 12:
case 15:
case 18:
return number + "fed";
case 11:
case 13:
case 14:
case 16:
case 17:
case 19:
return number + "eg";
}
} else if ((number >= 50 && number <= 60) || number === 80 || number >= 100) {
return number + "fed";
}
return number + "ain";
};
export const localize = {
ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide",
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide",
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
};
@@ -0,0 +1,5 @@
export declare const differenceInCalendarDays: import("./types.js").FPFn2<
number,
string | number | Date,
string | number | Date
>;
@@ -0,0 +1,28 @@
"use strict";
exports.arMA = void 0;
var _index = require("./ar-MA/_lib/formatDistance.js");
var _index2 = require("./ar-MA/_lib/formatLong.js");
var _index3 = require("./ar-MA/_lib/formatRelative.js");
var _index4 = require("./ar-MA/_lib/localize.js");
var _index5 = require("./ar-MA/_lib/match.js");
/**
* @category Locales
* @summary Arabic locale (Moroccan Arabic).
* @language Moroccan Arabic
* @iso-639-2 ara
* @author Achraf Rrami [@rramiachraf](https://github.com/rramiachraf)
*/
const arMA = (exports.arMA = {
code: "ar-MA",
formatDistance: _index.formatDistance,
formatLong: _index2.formatLong,
formatRelative: _index3.formatRelative,
localize: _index4.localize,
match: _index5.match,
options: {
// Monday is 1
weekStartsOn: 1,
firstWeekContainsDate: 1,
},
});
@@ -0,0 +1,26 @@
"use strict";
exports.isFirstDayOfMonth = isFirstDayOfMonth;
var _index = require("./toDate.js");
/**
* @name isFirstDayOfMonth
* @category Month Helpers
* @summary Is the given date the first day of a month?
*
* @description
* Is the given date the first day of a month?
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The date to check
* @returns The date is the first day of a month
*
* @example
* // Is 1 September 2014 the first day of a month?
* const result = isFirstDayOfMonth(new Date(2014, 8, 1))
* //=> true
*/
function isFirstDayOfMonth(date) {
return (0, _index.toDate)(date).getDate() === 1;
}
@@ -0,0 +1,62 @@
{
"name": "wrap-ansi",
"version": "7.0.0",
"description": "Wordwrap a string with ANSI escape codes",
"license": "MIT",
"repository": "chalk/wrap-ansi",
"funding": "https://github.com/chalk/wrap-ansi?sponsor=1",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
},
"engines": {
"node": ">=10"
},
"scripts": {
"test": "xo && nyc ava"
},
"files": [
"index.js"
],
"keywords": [
"wrap",
"break",
"wordwrap",
"wordbreak",
"linewrap",
"ansi",
"styles",
"color",
"colour",
"colors",
"terminal",
"console",
"cli",
"string",
"tty",
"escape",
"formatting",
"rgb",
"256",
"shell",
"xterm",
"log",
"logging",
"command-line",
"text"
],
"dependencies": {
"ansi-styles": "^4.0.0",
"string-width": "^4.1.0",
"strip-ansi": "^6.0.0"
},
"devDependencies": {
"ava": "^2.1.0",
"chalk": "^4.0.0",
"coveralls": "^3.0.3",
"has-ansi": "^4.0.0",
"nyc": "^15.0.1",
"xo": "^0.29.1"
}
}
@@ -0,0 +1,4 @@
{
"main": "../../cjs/_initializer_warning_helper.cjs",
"module": "../../esm/_initializer_warning_helper.js"
}
@@ -0,0 +1 @@
{"version":3,"file":"getPropertyByPath.d.ts","sourceRoot":"","sources":["../src/getPropertyByPath.ts"],"names":[],"mappings":"AAKA,iBAAS,iBAAiB,CACxB,MAAM,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,EAClC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,GAC3B,OAAO,CAgBT;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
@@ -0,0 +1,373 @@
import { describe, it, expect } from 'vitest';
import { normalizeRelationshipValue } from './normalizeRelationshipValue.js';
describe('normalizeRelationshipValue', () => {
describe('Monomorphic relationships (string relationTo)', () => {
const relationTo = 'users';
it('should return simple string ID as-is', () => {
const result = normalizeRelationshipValue('user123', relationTo);
expect(result).toBe('user123');
});
it('should return simple number ID as-is', () => {
const result = normalizeRelationshipValue(123, relationTo);
expect(result).toBe(123);
});
it('should extract ID from object with relationTo and value', () => {
const value = {
relationTo: 'users',
value: 'user456'
};
const result = normalizeRelationshipValue(value, relationTo);
expect(result).toBe('user456');
});
it('should extract ID from nested value structure', () => {
const value = {
relationTo: 'users',
value: {
value: 'user789'
}
};
const result = normalizeRelationshipValue(value, relationTo);
expect(result).toBe('user789');
});
it('should extract ID from deeply nested value structure', () => {
const value = {
relationTo: 'users',
value: {
value: {
value: 'user999'
}
}
};
const result = normalizeRelationshipValue(value, relationTo);
expect(result).toBe('user999');
});
it('should extract ID from populated document', () => {
const value = {
relationTo: 'users',
value: {
id: 'user111',
name: 'John Doe',
email: 'john@example.com'
}
};
const result = normalizeRelationshipValue(value, relationTo);
expect(result).toBe('user111');
});
it('should extract ID from populated document without relationTo wrapper', () => {
const value = {
id: 'user222',
name: 'Jane Doe',
email: 'jane@example.com'
};
const result = normalizeRelationshipValue(value, relationTo);
expect(result).toBe('user222');
});
it('should handle null values', () => {
const result = normalizeRelationshipValue(null, relationTo);
expect(result).toBeNull();
});
it('should handle undefined values', () => {
const result = normalizeRelationshipValue(undefined, relationTo);
expect(result).toBeUndefined();
});
it('should handle empty object', () => {
const result = normalizeRelationshipValue({}, relationTo);
expect(result).toEqual({});
});
});
describe('Polymorphic relationships (array relationTo)', () => {
const relationTo = ['users', 'posts', 'pages'];
it('should return simple string ID as-is', () => {
const result = normalizeRelationshipValue('user123', relationTo);
expect(result).toBe('user123');
});
it('should return simple number ID as-is', () => {
const result = normalizeRelationshipValue(456, relationTo);
expect(result).toBe(456);
});
it('should preserve relationTo structure with string value', () => {
const value = {
relationTo: 'users',
value: 'user789'
};
const result = normalizeRelationshipValue(value, relationTo);
expect(result).toEqual({
relationTo: 'users',
value: 'user789'
});
});
it('should preserve relationTo structure with number value', () => {
const value = {
relationTo: 'posts',
value: 123
};
const result = normalizeRelationshipValue(value, relationTo);
expect(result).toEqual({
relationTo: 'posts',
value: 123
});
});
it('should extract ID from nested value structure', () => {
const value = {
relationTo: 'posts',
value: {
value: 'post456'
}
};
const result = normalizeRelationshipValue(value, relationTo);
expect(result).toEqual({
relationTo: 'posts',
value: 'post456'
});
});
it('should extract ID from deeply nested value structure', () => {
const value = {
relationTo: 'pages',
value: {
value: {
value: 'page789'
}
}
};
const result = normalizeRelationshipValue(value, relationTo);
expect(result).toEqual({
relationTo: 'pages',
value: 'page789'
});
});
it('should extract ID from populated document', () => {
const value = {
relationTo: 'users',
value: {
id: 'user999',
name: 'John Smith',
email: 'john.smith@example.com'
}
};
const result = normalizeRelationshipValue(value, relationTo);
expect(result).toEqual({
relationTo: 'users',
value: 'user999'
});
});
it('should extract ID from complex populated document', () => {
const value = {
relationTo: 'posts',
value: {
id: 'post123',
title: 'My Post',
author: {
id: 'author456',
name: 'Author Name'
},
createdAt: '2023-01-01T00:00:00.000Z'
}
};
const result = normalizeRelationshipValue(value, relationTo);
expect(result).toEqual({
relationTo: 'posts',
value: 'post123'
});
});
it('should handle different relationTo values', () => {
const values = [{
relationTo: 'users',
value: 'user1'
}, {
relationTo: 'posts',
value: 'post2'
}, {
relationTo: 'pages',
value: 'page3'
}];
const results = values.map(v => normalizeRelationshipValue(v, relationTo));
expect(results).toEqual([{
relationTo: 'users',
value: 'user1'
}, {
relationTo: 'posts',
value: 'post2'
}, {
relationTo: 'pages',
value: 'page3'
}]);
});
it('should handle null values', () => {
const result = normalizeRelationshipValue(null, relationTo);
expect(result).toBeNull();
});
it('should handle undefined values', () => {
const result = normalizeRelationshipValue(undefined, relationTo);
expect(result).toBeUndefined();
});
it('should extract ID from populated document without relationTo wrapper', () => {
const value = {
id: 'doc123',
title: 'Document Title'
};
const result = normalizeRelationshipValue(value, relationTo);
expect(result).toBe('doc123');
});
});
describe('Edge cases', () => {
it('should handle object with only value property (no relationTo)', () => {
const value = {
value: 'someValue'
};
const result = normalizeRelationshipValue(value, 'users');
// Since there's no 'id' field and no relationTo, it should return the value as-is
expect(result).toEqual({
value: 'someValue'
});
});
it('should handle object with relationTo but no value', () => {
const value = {
relationTo: 'users'
};
const result = normalizeRelationshipValue(value, ['users', 'posts']);
expect(result).toEqual({
relationTo: 'users'
});
});
it('should handle empty array relationTo', () => {
const result = normalizeRelationshipValue('user123', []);
expect(result).toBe('user123');
});
it('should handle single-item array relationTo as polymorphic', () => {
const value = {
relationTo: 'users',
value: 'user123'
};
const result = normalizeRelationshipValue(value, ['users']);
expect(result).toEqual({
relationTo: 'users',
value: 'user123'
});
});
it('should handle numeric IDs in populated documents', () => {
const value = {
relationTo: 'users',
value: {
id: 12345,
name: 'User with numeric ID'
}
};
const result = normalizeRelationshipValue(value, ['users', 'posts']);
expect(result).toEqual({
relationTo: 'users',
value: 12345
});
});
it('should handle nested null values', () => {
const value = {
relationTo: 'users',
value: null
};
const result = normalizeRelationshipValue(value, 'users');
expect(result).toBeNull();
});
it('should handle zero as a valid ID', () => {
const result = normalizeRelationshipValue(0, 'users');
expect(result).toBe(0);
});
it('should handle empty string as a valid ID', () => {
const result = normalizeRelationshipValue('', 'users');
expect(result).toBe('');
});
it('should handle false as a value', () => {
const result = normalizeRelationshipValue(false, 'users');
expect(result).toBe(false);
});
it('should handle array values (return as-is)', () => {
const result = normalizeRelationshipValue(['user1', 'user2'], 'users');
expect(result).toEqual(['user1', 'user2']);
});
});
describe('Real-world scenarios', () => {
it('should normalize upload field value for monomorphic upload', () => {
// Upload field with populated media document
const value = {
id: 'media123',
filename: 'image.jpg',
mimeType: 'image/jpeg',
filesize: 12345,
url: '/media/image.jpg'
};
const result = normalizeRelationshipValue(value, 'media');
expect(result).toBe('media123');
});
it('should normalize upload field value for polymorphic upload', () => {
// Upload field with relationTo structure
const value = {
relationTo: 'images',
value: {
id: 'image456',
filename: 'photo.png',
url: '/media/photo.png'
}
};
const result = normalizeRelationshipValue(value, ['images', 'videos']);
expect(result).toEqual({
relationTo: 'images',
value: 'image456'
});
});
it('should normalize form submission data', () => {
// Data coming from form with populated relationship
const value = {
relationTo: 'posts',
value: {
id: 'post789',
title: 'Blog Post Title',
author: {
id: 'author123',
name: 'Author'
},
publishedDate: '2023-12-01'
}
};
const result = normalizeRelationshipValue(value, ['posts', 'pages']);
expect(result).toEqual({
relationTo: 'posts',
value: 'post789'
});
});
it('should normalize API response with nested relationships', () => {
// Complex nested structure from API
const value = {
relationTo: 'categories',
value: {
value: {
id: 'cat123',
name: 'Category Name'
}
}
};
const result = normalizeRelationshipValue(value, ['categories', 'tags']);
expect(result).toEqual({
relationTo: 'categories',
value: 'cat123'
});
});
it('should handle table cell data normalization', () => {
// Cell data from table that might be just an ID
const simpleValue = 'user123';
const result = normalizeRelationshipValue(simpleValue, 'users');
expect(result).toBe('user123');
// Cell data with full structure
const complexValue = {
relationTo: 'users',
value: {
id: 'user456',
name: 'John Doe'
}
};
const result2 = normalizeRelationshipValue(complexValue, ['users', 'admins']);
expect(result2).toEqual({
relationTo: 'users',
value: 'user456'
});
});
});
});
//# sourceMappingURL=normalizeRelationshipValue.spec.js.map
@@ -0,0 +1,39 @@
import { buildFormatLongFn } from "../../_lib/buildFormatLongFn.js";
const dateFormats = {
full: "EEEE, d MMMM yyyy",
long: "d MMMM yyyy",
medium: "d MMM yyyy",
short: "dd/MM/yyyy",
};
const timeFormats = {
full: "HH:mm:ss zzzz",
long: "HH:mm:ss z",
medium: "HH:mm:ss",
short: "HH:mm",
};
const dateTimeFormats = {
full: "{{date}} {{time}}",
long: "{{date}} {{time}}",
medium: "{{date}} {{time}}",
short: "{{date}} {{time}}",
};
export const formatLong = {
date: buildFormatLongFn({
formats: dateFormats,
defaultWidth: "full",
}),
time: buildFormatLongFn({
formats: timeFormats,
defaultWidth: "full",
}),
dateTime: buildFormatLongFn({
formats: dateTimeFormats,
defaultWidth: "full",
}),
};
@@ -0,0 +1,26 @@
import type { MarkOptional } from 'ts-essentials';
import type { JSONField, JSONFieldClient } from '../../fields/config/types.js';
import type { JSONFieldValidation } from '../../fields/validations.js';
import type { FieldErrorClientComponent, FieldErrorServerComponent } from '../forms/Error.js';
import type { ClientFieldBase, FieldClientComponent, FieldPaths, FieldServerComponent, ServerFieldBase } from '../forms/Field.js';
import type { FieldDescriptionClientComponent, FieldDescriptionServerComponent, FieldDiffClientComponent, FieldDiffServerComponent, FieldLabelClientComponent, FieldLabelServerComponent } from '../types.js';
type JSONFieldClientWithoutType = MarkOptional<JSONFieldClient, 'type'>;
type JSONFieldBaseClientProps = {
readonly path: string;
readonly validate?: JSONFieldValidation;
};
type JSONFieldBaseServerProps = Pick<FieldPaths, 'path'>;
export type JSONFieldClientProps = ClientFieldBase<JSONFieldClientWithoutType> & JSONFieldBaseClientProps;
export type JSONFieldServerProps = JSONFieldBaseServerProps & ServerFieldBase<JSONField, JSONFieldClientWithoutType>;
export type JSONFieldServerComponent = FieldServerComponent<JSONField, JSONFieldClientWithoutType, JSONFieldBaseServerProps>;
export type JSONFieldClientComponent = FieldClientComponent<JSONFieldClientWithoutType, JSONFieldBaseClientProps>;
export type JSONFieldLabelServerComponent = FieldLabelServerComponent<JSONField, JSONFieldClientWithoutType>;
export type JSONFieldLabelClientComponent = FieldLabelClientComponent<JSONFieldClientWithoutType>;
export type JSONFieldDescriptionServerComponent = FieldDescriptionServerComponent<JSONField, JSONFieldClientWithoutType>;
export type JSONFieldDescriptionClientComponent = FieldDescriptionClientComponent<JSONFieldClientWithoutType>;
export type JSONFieldErrorServerComponent = FieldErrorServerComponent<JSONField, JSONFieldClientWithoutType>;
export type JSONFieldErrorClientComponent = FieldErrorClientComponent<JSONFieldClientWithoutType>;
export type JSONFieldDiffServerComponent = FieldDiffServerComponent<JSONField, JSONFieldClient>;
export type JSONFieldDiffClientComponent = FieldDiffClientComponent<JSONFieldClient>;
export {};
//# sourceMappingURL=JSON.d.ts.map
@@ -0,0 +1,16 @@
export declare const eachMonthOfIntervalWithOptions: import("./types.js").FPFn2<
import("../eachMonthOfInterval.js").EachMonthOfIntervalResult<
import("../fp.js").Interval<
import("../fp.js").DateArg<Date>,
import("../fp.js").DateArg<Date>
>,
| import("../eachMonthOfInterval.js").EachMonthOfIntervalOptions<Date>
| undefined
>,
| import("../eachMonthOfInterval.js").EachMonthOfIntervalOptions<Date>
| undefined,
import("../fp.js").Interval<
import("../fp.js").DateArg<Date>,
import("../fp.js").DateArg<Date>
>
>;
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"B","16":"zC","132":"K D E F A"},B:{"1":"0 1 2 3 4 5 6 7 8 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I"},C:{"1":"0 1 2 3 4 5 6 7 8 IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B WC 6B XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R YC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC 1C 2C 3C","132":"9 0C VC J bB K D E F A B C L M G N O P cB AB BB CB DB EB FB GB HB 4C 5C"},D:{"1":"0 1 2 3 4 5 6 7 8 DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B WC 6B XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC","132":"9 J bB K D E F A B C L M G N O P cB AB BB CB"},E:{"1":"A B C L M G cC PC QC BD CD DD dC eC RC ED SC fC gC hC iC jC FD TC kC lC mC nC oC GD UC pC qC rC sC HD tC uC vC wC ID","132":"J bB K D E F 6C bC 7C 8C 9C AD"},F:{"1":"0 1 2 3 4 5 6 7 8 9 G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R YC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","16":"F B C JD KD LD MD PC xC ND","132":"QC"},G:{"1":"VD WD XD YD ZD aD bD cD dD eD fD gD hD dC eC RC iD SC fC gC hC iC jC jD TC kC lC mC nC oC kD UC pC qC rC sC lD tC uC vC wC","132":"E bC OD yC PD QD RD SD TD UD"},H:{"132":"mD"},I:{"1":"I rD sD","132":"VC J nD oD pD qD yC"},J:{"132":"D A"},K:{"1":"H","16":"A B C PC xC","132":"QC"},L:{"1":"I"},M:{"1":"OC"},N:{"1":"B","132":"A"},O:{"1":"RC"},P:{"1":"9 AB BB CB DB EB FB GB HB IB tD uD vD wD xD cC yD zD 0D 1D 2D SC TC UC 3D","132":"J"},Q:{"1":"4D"},R:{"1":"5D"},S:{"1":"7D","4":"6D"}},B:6,C:"localeCompare()",D:true};
@@ -0,0 +1,13 @@
'use strict';
const callsites = () => {
const _prepareStackTrace = Error.prepareStackTrace;
Error.prepareStackTrace = (_, stack) => stack;
const stack = new Error().stack.slice(1);
Error.prepareStackTrace = _prepareStackTrace;
return stack;
};
module.exports = callsites;
// TODO: Remove this for the next major release
module.exports.default = callsites;
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/views/ForgotPassword/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAKnD,OAAO,KAAmB,MAAM,OAAO,CAAA;AAKvC,eAAO,MAAM,uBAAuB,oBAAoB,CAAA;AAExD,wBAAgB,kBAAkB,CAAC,EAAE,cAAc,EAAE,EAAE,oBAAoB,qBA8D1E"}
@@ -0,0 +1 @@
{"version":3,"file":"shopping-cart.js","sources":["../../../src/icons/shopping-cart.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ShoppingCart\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSI4IiBjeT0iMjEiIHI9IjEiIC8+CiAgPGNpcmNsZSBjeD0iMTkiIGN5PSIyMSIgcj0iMSIgLz4KICA8cGF0aCBkPSJNMi4wNSAyLjA1aDJsMi42NiAxMi40MmEyIDIgMCAwIDAgMiAxLjU4aDkuNzhhMiAyIDAgMCAwIDEuOTUtMS41N2wxLjY1LTcuNDNINS4xMiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/shopping-cart\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst ShoppingCart = createLucideIcon('ShoppingCart', [\n ['circle', { cx: '8', cy: '21', r: '1', key: 'jimo8o' }],\n ['circle', { cx: '19', cy: '21', r: '1', key: '13723u' }],\n [\n 'path',\n {\n d: 'M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12',\n key: '9zh506',\n },\n ],\n]);\n\nexport default ShoppingCart;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,iBAAiB,cAAgB,CAAA,CAAA,CAAA;AAAA,CACpD,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,EAAK,CAAI,CAAA,CAAA,CAAA,IAAA,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CACvD,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAM,CAAI,CAAA,CAAA,CAAA,IAAA,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CACxD,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,143 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Trie = exports.createTrieFromBase64 = exports.UTRIE2_INDEX_2_MASK = exports.UTRIE2_INDEX_2_BLOCK_LENGTH = exports.UTRIE2_OMITTED_BMP_INDEX_1_LENGTH = exports.UTRIE2_INDEX_1_OFFSET = exports.UTRIE2_UTF8_2B_INDEX_2_LENGTH = exports.UTRIE2_UTF8_2B_INDEX_2_OFFSET = exports.UTRIE2_INDEX_2_BMP_LENGTH = exports.UTRIE2_LSCP_INDEX_2_LENGTH = exports.UTRIE2_DATA_MASK = exports.UTRIE2_DATA_BLOCK_LENGTH = exports.UTRIE2_LSCP_INDEX_2_OFFSET = exports.UTRIE2_SHIFT_1_2 = exports.UTRIE2_INDEX_SHIFT = exports.UTRIE2_SHIFT_1 = exports.UTRIE2_SHIFT_2 = void 0;
var Util_1 = require("./Util");
/** Shift size for getting the index-2 table offset. */
exports.UTRIE2_SHIFT_2 = 5;
/** Shift size for getting the index-1 table offset. */
exports.UTRIE2_SHIFT_1 = 6 + 5;
/**
* Shift size for shifting left the index array values.
* Increases possible data size with 16-bit index values at the cost
* of compactability.
* This requires data blocks to be aligned by UTRIE2_DATA_GRANULARITY.
*/
exports.UTRIE2_INDEX_SHIFT = 2;
/**
* Difference between the two shift sizes,
* for getting an index-1 offset from an index-2 offset. 6=11-5
*/
exports.UTRIE2_SHIFT_1_2 = exports.UTRIE2_SHIFT_1 - exports.UTRIE2_SHIFT_2;
/**
* The part of the index-2 table for U+D800..U+DBFF stores values for
* lead surrogate code _units_ not code _points_.
* Values for lead surrogate code _points_ are indexed with this portion of the table.
* Length=32=0x20=0x400>>UTRIE2_SHIFT_2. (There are 1024=0x400 lead surrogates.)
*/
exports.UTRIE2_LSCP_INDEX_2_OFFSET = 0x10000 >> exports.UTRIE2_SHIFT_2;
/** Number of entries in a data block. 32=0x20 */
exports.UTRIE2_DATA_BLOCK_LENGTH = 1 << exports.UTRIE2_SHIFT_2;
/** Mask for getting the lower bits for the in-data-block offset. */
exports.UTRIE2_DATA_MASK = exports.UTRIE2_DATA_BLOCK_LENGTH - 1;
exports.UTRIE2_LSCP_INDEX_2_LENGTH = 0x400 >> exports.UTRIE2_SHIFT_2;
/** Count the lengths of both BMP pieces. 2080=0x820 */
exports.UTRIE2_INDEX_2_BMP_LENGTH = exports.UTRIE2_LSCP_INDEX_2_OFFSET + exports.UTRIE2_LSCP_INDEX_2_LENGTH;
/**
* The 2-byte UTF-8 version of the index-2 table follows at offset 2080=0x820.
* Length 32=0x20 for lead bytes C0..DF, regardless of UTRIE2_SHIFT_2.
*/
exports.UTRIE2_UTF8_2B_INDEX_2_OFFSET = exports.UTRIE2_INDEX_2_BMP_LENGTH;
exports.UTRIE2_UTF8_2B_INDEX_2_LENGTH = 0x800 >> 6; /* U+0800 is the first code point after 2-byte UTF-8 */
/**
* The index-1 table, only used for supplementary code points, at offset 2112=0x840.
* Variable length, for code points up to highStart, where the last single-value range starts.
* Maximum length 512=0x200=0x100000>>UTRIE2_SHIFT_1.
* (For 0x100000 supplementary code points U+10000..U+10ffff.)
*
* The part of the index-2 table for supplementary code points starts
* after this index-1 table.
*
* Both the index-1 table and the following part of the index-2 table
* are omitted completely if there is only BMP data.
*/
exports.UTRIE2_INDEX_1_OFFSET = exports.UTRIE2_UTF8_2B_INDEX_2_OFFSET + exports.UTRIE2_UTF8_2B_INDEX_2_LENGTH;
/**
* Number of index-1 entries for the BMP. 32=0x20
* This part of the index-1 table is omitted from the serialized form.
*/
exports.UTRIE2_OMITTED_BMP_INDEX_1_LENGTH = 0x10000 >> exports.UTRIE2_SHIFT_1;
/** Number of entries in an index-2 block. 64=0x40 */
exports.UTRIE2_INDEX_2_BLOCK_LENGTH = 1 << exports.UTRIE2_SHIFT_1_2;
/** Mask for getting the lower bits for the in-index-2-block offset. */
exports.UTRIE2_INDEX_2_MASK = exports.UTRIE2_INDEX_2_BLOCK_LENGTH - 1;
var slice16 = function (view, start, end) {
if (view.slice) {
return view.slice(start, end);
}
return new Uint16Array(Array.prototype.slice.call(view, start, end));
};
var slice32 = function (view, start, end) {
if (view.slice) {
return view.slice(start, end);
}
return new Uint32Array(Array.prototype.slice.call(view, start, end));
};
var createTrieFromBase64 = function (base64, _byteLength) {
var buffer = Util_1.decode(base64);
var view32 = Array.isArray(buffer) ? Util_1.polyUint32Array(buffer) : new Uint32Array(buffer);
var view16 = Array.isArray(buffer) ? Util_1.polyUint16Array(buffer) : new Uint16Array(buffer);
var headerLength = 24;
var index = slice16(view16, headerLength / 2, view32[4] / 2);
var data = view32[5] === 2
? slice16(view16, (headerLength + view32[4]) / 2)
: slice32(view32, Math.ceil((headerLength + view32[4]) / 4));
return new Trie(view32[0], view32[1], view32[2], view32[3], index, data);
};
exports.createTrieFromBase64 = createTrieFromBase64;
var Trie = /** @class */ (function () {
function Trie(initialValue, errorValue, highStart, highValueIndex, index, data) {
this.initialValue = initialValue;
this.errorValue = errorValue;
this.highStart = highStart;
this.highValueIndex = highValueIndex;
this.index = index;
this.data = data;
}
/**
* Get the value for a code point as stored in the Trie.
*
* @param codePoint the code point
* @return the value
*/
Trie.prototype.get = function (codePoint) {
var ix;
if (codePoint >= 0) {
if (codePoint < 0x0d800 || (codePoint > 0x0dbff && codePoint <= 0x0ffff)) {
// Ordinary BMP code point, excluding leading surrogates.
// BMP uses a single level lookup. BMP index starts at offset 0 in the Trie2 index.
// 16 bit data is stored in the index array itself.
ix = this.index[codePoint >> exports.UTRIE2_SHIFT_2];
ix = (ix << exports.UTRIE2_INDEX_SHIFT) + (codePoint & exports.UTRIE2_DATA_MASK);
return this.data[ix];
}
if (codePoint <= 0xffff) {
// Lead Surrogate Code Point. A Separate index section is stored for
// lead surrogate code units and code points.
// The main index has the code unit data.
// For this function, we need the code point data.
// Note: this expression could be refactored for slightly improved efficiency, but
// surrogate code points will be so rare in practice that it's not worth it.
ix = this.index[exports.UTRIE2_LSCP_INDEX_2_OFFSET + ((codePoint - 0xd800) >> exports.UTRIE2_SHIFT_2)];
ix = (ix << exports.UTRIE2_INDEX_SHIFT) + (codePoint & exports.UTRIE2_DATA_MASK);
return this.data[ix];
}
if (codePoint < this.highStart) {
// Supplemental code point, use two-level lookup.
ix = exports.UTRIE2_INDEX_1_OFFSET - exports.UTRIE2_OMITTED_BMP_INDEX_1_LENGTH + (codePoint >> exports.UTRIE2_SHIFT_1);
ix = this.index[ix];
ix += (codePoint >> exports.UTRIE2_SHIFT_2) & exports.UTRIE2_INDEX_2_MASK;
ix = this.index[ix];
ix = (ix << exports.UTRIE2_INDEX_SHIFT) + (codePoint & exports.UTRIE2_DATA_MASK);
return this.data[ix];
}
if (codePoint <= 0x10ffff) {
return this.data[this.highValueIndex];
}
}
// Fall through. The code point is outside of the legal range of 0..0x10ffff.
return this.errorValue;
};
return Trie;
}());
exports.Trie = Trie;
//# sourceMappingURL=Trie.js.map
@@ -0,0 +1,39 @@
import { buildFormatLongFn } from "../../_lib/buildFormatLongFn.mjs";
const dateFormats = {
full: "EEEE d. MMMM y",
long: "d. MMMM y",
medium: "d. MMM y",
short: "dd.MM.y",
};
const timeFormats = {
full: "'kl'. HH:mm:ss zzzz",
long: "HH:mm:ss z",
medium: "HH:mm:ss",
short: "HH:mm",
};
const dateTimeFormats = {
full: "{{date}} 'kl.' {{time}}",
long: "{{date}} 'kl.' {{time}}",
medium: "{{date}} {{time}}",
short: "{{date}} {{time}}",
};
export const formatLong = {
date: buildFormatLongFn({
formats: dateFormats,
defaultWidth: "full",
}),
time: buildFormatLongFn({
formats: timeFormats,
defaultWidth: "full",
}),
dateTime: buildFormatLongFn({
formats: dateTimeFormats,
defaultWidth: "full",
}),
};
@@ -0,0 +1,49 @@
"use strict";
exports.milliseconds = milliseconds;
var _index = require("./constants.cjs");
/**
* @name milliseconds
* @category Millisecond Helpers
* @summary
* Returns the number of milliseconds in the specified, years, months, weeks, days, hours, minutes and seconds.
*
* @description
* Returns the number of milliseconds in the specified, years, months, weeks, days, hours, minutes and seconds.
*
* One years equals 365.2425 days according to the formula:
*
* > Leap year occurs every 4 years, except for years that are divisible by 100 and not divisible by 400.
* > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days
*
* One month is a year divided by 12.
*
* @param duration - The object with years, months, weeks, days, hours, minutes and seconds to be added.
*
* @returns The milliseconds
*
* @example
* // 1 year in milliseconds
* milliseconds({ years: 1 })
* //=> 31556952000
*
* // 3 months in milliseconds
* milliseconds({ months: 3 })
* //=> 7889238000
*/
function milliseconds({ years, months, weeks, days, hours, minutes, seconds }) {
let totalDays = 0;
if (years) totalDays += years * _index.daysInYear;
if (months) totalDays += months * (_index.daysInYear / 12);
if (weeks) totalDays += weeks * 7;
if (days) totalDays += days;
let totalSeconds = totalDays * 24 * 60 * 60;
if (hours) totalSeconds += hours * 60 * 60;
if (minutes) totalSeconds += minutes * 60;
if (seconds) totalSeconds += seconds;
return Math.trunc(totalSeconds * 1000);
}
@@ -0,0 +1,5 @@
import { IImage } from './interface.js';
declare const DDS: IImage;
export { DDS };
@@ -0,0 +1 @@
{"version":3,"file":"pause-octagon.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,9 @@
// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
import { isWednesday as fn } from "../isWednesday.js";
import { convertToFP } from "./_lib/convertToFP.js";
export const isWednesday = convertToFP(fn, 1);
// Fallback for modularized imports:
export default isWednesday;
@@ -0,0 +1,46 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const WebpackError = require("./WebpackError");
/** @typedef {import("./Module")} Module */
class ModuleRestoreError extends WebpackError {
/**
* @param {Module} module module tied to dependency
* @param {string | Error} err error thrown
*/
constructor(module, err) {
let message = "Module restore failed: ";
/** @type {string | undefined} */
const details = undefined;
if (err !== null && typeof err === "object") {
if (typeof err.stack === "string" && err.stack) {
const stack = err.stack;
message += stack;
} else if (typeof err.message === "string" && err.message) {
message += err.message;
} else {
message += err;
}
} else {
message += String(err);
}
super(message);
/** @type {string} */
this.name = "ModuleRestoreError";
/** @type {string | undefined} */
this.details = details;
this.module = module;
this.error = err;
}
}
/** @type {typeof ModuleRestoreError} */
module.exports = ModuleRestoreError;
@@ -0,0 +1,638 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const asyncLib = require("neo-async");
const { ConcatSource, RawSource } = require("webpack-sources");
const Compilation = require("./Compilation");
const ModuleFilenameHelpers = require("./ModuleFilenameHelpers");
const ProgressPlugin = require("./ProgressPlugin");
const SourceMapDevToolModuleOptionsPlugin = require("./SourceMapDevToolModuleOptionsPlugin");
const createSchemaValidation = require("./util/create-schema-validation");
const createHash = require("./util/createHash");
const { dirname, relative } = require("./util/fs");
const generateDebugId = require("./util/generateDebugId");
const { makePathsAbsolute } = require("./util/identifier");
/** @typedef {import("webpack-sources").MapOptions} MapOptions */
/** @typedef {import("webpack-sources").Source} Source */
/** @typedef {import("../declarations/plugins/SourceMapDevToolPlugin").SourceMapDevToolPluginOptions} SourceMapDevToolPluginOptions */
/** @typedef {import("../declarations/plugins/SourceMapDevToolPlugin").Rules} Rules */
/** @typedef {import("./CacheFacade").ItemCacheFacade} ItemCacheFacade */
/** @typedef {import("./Chunk")} Chunk */
/** @typedef {import("./Compilation").Asset} Asset */
/** @typedef {import("./Compilation").AssetInfo} AssetInfo */
/** @typedef {import("./Compiler")} Compiler */
/** @typedef {import("./Module")} Module */
/** @typedef {import("./NormalModule").RawSourceMap} RawSourceMap */
/** @typedef {import("./TemplatedPathPlugin").TemplatePath} TemplatePath */
/** @typedef {import("./util/fs").OutputFileSystem} OutputFileSystem */
const validate = createSchemaValidation(
require("../schemas/plugins/SourceMapDevToolPlugin.check"),
() => require("../schemas/plugins/SourceMapDevToolPlugin.json"),
{
name: "SourceMap DevTool Plugin",
baseDataPath: "options"
}
);
/**
* @typedef {object} SourceMapTask
* @property {Source} asset
* @property {AssetInfo} assetInfo
* @property {(string | Module)[]} modules
* @property {string} source
* @property {string} file
* @property {RawSourceMap} sourceMap
* @property {ItemCacheFacade} cacheItem cache item
*/
const METACHARACTERS_REGEXP = /[-[\]\\/{}()*+?.^$|]/g;
const CONTENT_HASH_DETECT_REGEXP = /\[contenthash(?::\w+)?\]/;
const CSS_AND_JS_MODULE_EXTENSIONS_REGEXP = /\.((c|m)?js|css)($|\?)/i;
const CSS_EXTENSION_DETECT_REGEXP = /\.css(?:$|\?)/i;
const MAP_URL_COMMENT_REGEXP = /\[map\]/g;
const URL_COMMENT_REGEXP = /\[url\]/g;
const URL_FORMATTING_REGEXP = /^\n\/\/(.*)$/;
/**
* Reset's .lastIndex of stateful Regular Expressions
* For when `test` or `exec` is called on them
* @param {RegExp} regexp Stateful Regular Expression to be reset
* @returns {void}
*/
const resetRegexpState = (regexp) => {
regexp.lastIndex = -1;
};
/**
* Escapes regular expression metacharacters
* @param {string} str String to quote
* @returns {string} Escaped string
*/
const quoteMeta = (str) => str.replace(METACHARACTERS_REGEXP, "\\$&");
/**
* Creating {@link SourceMapTask} for given file
* @param {string} file current compiled file
* @param {Source} asset the asset
* @param {AssetInfo} assetInfo the asset info
* @param {MapOptions} options source map options
* @param {Compilation} compilation compilation instance
* @param {ItemCacheFacade} cacheItem cache item
* @returns {SourceMapTask | undefined} created task instance or `undefined`
*/
const getTaskForFile = (
file,
asset,
assetInfo,
options,
compilation,
cacheItem
) => {
/** @type {string | Buffer} */
let source;
/** @type {null | RawSourceMap} */
let sourceMap;
/**
* Check if asset can build source map
*/
if (asset.sourceAndMap) {
const sourceAndMap = asset.sourceAndMap(options);
sourceMap = sourceAndMap.map;
source = sourceAndMap.source;
} else {
sourceMap = asset.map(options);
source = asset.source();
}
if (!sourceMap || typeof source !== "string") return;
const context = compilation.options.context;
const root = compilation.compiler.root;
const cachedAbsolutify = makePathsAbsolute.bindContextCache(context, root);
const modules = sourceMap.sources.map((source) => {
if (!source.startsWith("webpack://")) return source;
source = cachedAbsolutify(source.slice(10));
const module = compilation.findModule(source);
return module || source;
});
return {
file,
asset,
source,
assetInfo,
sourceMap,
modules,
cacheItem
};
};
const PLUGIN_NAME = "SourceMapDevToolPlugin";
class SourceMapDevToolPlugin {
/**
* @param {SourceMapDevToolPluginOptions=} options options object
* @throws {Error} throws error, if got more than 1 arguments
*/
constructor(options = {}) {
validate(options);
this.sourceMapFilename = /** @type {string | false} */ (options.filename);
/** @type {false | TemplatePath}} */
this.sourceMappingURLComment =
options.append === false
? false
: // eslint-disable-next-line no-useless-concat
options.append || "\n//# source" + "MappingURL=[url]";
this.moduleFilenameTemplate =
options.moduleFilenameTemplate || "webpack://[namespace]/[resourcePath]";
this.fallbackModuleFilenameTemplate =
options.fallbackModuleFilenameTemplate ||
"webpack://[namespace]/[resourcePath]?[hash]";
this.namespace = options.namespace || "";
this.options = options;
}
/**
* Apply the plugin
* @param {Compiler} compiler compiler instance
* @returns {void}
*/
apply(compiler) {
const outputFs =
/** @type {OutputFileSystem} */
(compiler.outputFileSystem);
const sourceMapFilename = this.sourceMapFilename;
const sourceMappingURLComment = this.sourceMappingURLComment;
const moduleFilenameTemplate = this.moduleFilenameTemplate;
const namespace = this.namespace;
const fallbackModuleFilenameTemplate = this.fallbackModuleFilenameTemplate;
const requestShortener = compiler.requestShortener;
const options = this.options;
options.test = options.test || CSS_AND_JS_MODULE_EXTENSIONS_REGEXP;
/** @type {(filename: string) => boolean} */
const matchObject = ModuleFilenameHelpers.matchObject.bind(
undefined,
options
);
compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
new SourceMapDevToolModuleOptionsPlugin(options).apply(compilation);
compilation.hooks.processAssets.tapAsync(
{
name: PLUGIN_NAME,
stage: Compilation.PROCESS_ASSETS_STAGE_DEV_TOOLING,
additionalAssets: true
},
(assets, callback) => {
const chunkGraph = compilation.chunkGraph;
const cache = compilation.getCache(PLUGIN_NAME);
/** @type {Map<string | Module, string>} */
const moduleToSourceNameMapping = new Map();
const reportProgress =
ProgressPlugin.getReporter(compilation.compiler) || (() => {});
/** @type {Map<string, Chunk>} */
const fileToChunk = new Map();
for (const chunk of compilation.chunks) {
for (const file of chunk.files) {
fileToChunk.set(file, chunk);
}
for (const file of chunk.auxiliaryFiles) {
fileToChunk.set(file, chunk);
}
}
/** @type {string[]} */
const files = [];
for (const file of Object.keys(assets)) {
if (matchObject(file)) {
files.push(file);
}
}
reportProgress(0);
/** @type {SourceMapTask[]} */
const tasks = [];
let fileIndex = 0;
asyncLib.each(
files,
(file, callback) => {
const asset =
/** @type {Readonly<Asset>} */
(compilation.getAsset(file));
if (asset.info.related && asset.info.related.sourceMap) {
fileIndex++;
return callback();
}
const chunk = fileToChunk.get(file);
const sourceMapNamespace = compilation.getPath(this.namespace, {
chunk
});
const cacheItem = cache.getItemCache(
file,
cache.mergeEtags(
cache.getLazyHashedEtag(asset.source),
sourceMapNamespace
)
);
cacheItem.get((err, cacheEntry) => {
if (err) {
return callback(err);
}
/**
* If presented in cache, reassigns assets. Cache assets already have source maps.
*/
if (cacheEntry) {
const { assets, assetsInfo } = cacheEntry;
for (const cachedFile of Object.keys(assets)) {
if (cachedFile === file) {
compilation.updateAsset(
cachedFile,
assets[cachedFile],
assetsInfo[cachedFile]
);
} else {
compilation.emitAsset(
cachedFile,
assets[cachedFile],
assetsInfo[cachedFile]
);
}
/**
* Add file to chunk, if not presented there
*/
if (cachedFile !== file && chunk !== undefined) {
chunk.auxiliaryFiles.add(cachedFile);
}
}
reportProgress(
(0.5 * ++fileIndex) / files.length,
file,
"restored cached SourceMap"
);
return callback();
}
reportProgress(
(0.5 * fileIndex) / files.length,
file,
"generate SourceMap"
);
/** @type {SourceMapTask | undefined} */
const task = getTaskForFile(
file,
asset.source,
asset.info,
{
module: options.module,
columns: options.columns
},
compilation,
cacheItem
);
if (task) {
const modules = task.modules;
for (let idx = 0; idx < modules.length; idx++) {
const module = modules[idx];
if (
typeof module === "string" &&
/^(?:data|https?):/.test(module)
) {
moduleToSourceNameMapping.set(module, module);
continue;
}
if (!moduleToSourceNameMapping.get(module)) {
moduleToSourceNameMapping.set(
module,
ModuleFilenameHelpers.createFilename(
module,
{
moduleFilenameTemplate,
namespace: sourceMapNamespace
},
{
requestShortener,
chunkGraph,
hashFunction: compilation.outputOptions.hashFunction
}
)
);
}
}
tasks.push(task);
}
reportProgress(
(0.5 * ++fileIndex) / files.length,
file,
"generated SourceMap"
);
callback();
});
},
(err) => {
if (err) {
return callback(err);
}
reportProgress(0.5, "resolve sources");
/** @type {Set<string>} */
const usedNamesSet = new Set(moduleToSourceNameMapping.values());
/** @type {Set<string>} */
const conflictDetectionSet = new Set();
/**
* all modules in defined order (longest identifier first)
* @type {(string | Module)[]}
*/
const allModules = [...moduleToSourceNameMapping.keys()].sort(
(a, b) => {
const ai = typeof a === "string" ? a : a.identifier();
const bi = typeof b === "string" ? b : b.identifier();
return ai.length - bi.length;
}
);
// find modules with conflicting source names
for (let idx = 0; idx < allModules.length; idx++) {
const module = allModules[idx];
let sourceName =
/** @type {string} */
(moduleToSourceNameMapping.get(module));
let hasName = conflictDetectionSet.has(sourceName);
if (!hasName) {
conflictDetectionSet.add(sourceName);
continue;
}
// try the fallback name first
sourceName = ModuleFilenameHelpers.createFilename(
module,
{
moduleFilenameTemplate: fallbackModuleFilenameTemplate,
namespace
},
{
requestShortener,
chunkGraph,
hashFunction: compilation.outputOptions.hashFunction
}
);
hasName = usedNamesSet.has(sourceName);
if (!hasName) {
moduleToSourceNameMapping.set(module, sourceName);
usedNamesSet.add(sourceName);
continue;
}
// otherwise just append stars until we have a valid name
while (hasName) {
sourceName += "*";
hasName = usedNamesSet.has(sourceName);
}
moduleToSourceNameMapping.set(module, sourceName);
usedNamesSet.add(sourceName);
}
let taskIndex = 0;
asyncLib.each(
tasks,
(task, callback) => {
/** @type {Record<string, Source>} */
const assets = Object.create(null);
/** @type {Record<string, AssetInfo | undefined>} */
const assetsInfo = Object.create(null);
const file = task.file;
const chunk = fileToChunk.get(file);
const sourceMap = task.sourceMap;
const source = task.source;
const modules = task.modules;
reportProgress(
0.5 + (0.5 * taskIndex) / tasks.length,
file,
"attach SourceMap"
);
const moduleFilenames = modules.map((m) =>
moduleToSourceNameMapping.get(m)
);
sourceMap.sources = /** @type {string[]} */ (moduleFilenames);
if (options.ignoreList) {
const ignoreList = sourceMap.sources.reduce(
/** @type {(acc: number[], sourceName: string, idx: number) => number[]} */ (
(acc, sourceName, idx) => {
const rule = /** @type {Rules} */ (
options.ignoreList
);
if (
ModuleFilenameHelpers.matchPart(sourceName, rule)
) {
acc.push(idx);
}
return acc;
}
),
[]
);
if (ignoreList.length > 0) {
sourceMap.ignoreList = ignoreList;
}
}
if (options.noSources) {
sourceMap.sourcesContent = undefined;
}
sourceMap.sourceRoot = options.sourceRoot || "";
sourceMap.file = file;
const usesContentHash =
sourceMapFilename &&
CONTENT_HASH_DETECT_REGEXP.test(sourceMapFilename);
resetRegexpState(CONTENT_HASH_DETECT_REGEXP);
// If SourceMap and asset uses contenthash, avoid a circular dependency by hiding hash in `file`
if (usesContentHash && task.assetInfo.contenthash) {
const contenthash = task.assetInfo.contenthash;
const pattern = Array.isArray(contenthash)
? contenthash.map(quoteMeta).join("|")
: quoteMeta(contenthash);
sourceMap.file = sourceMap.file.replace(
new RegExp(pattern, "g"),
(m) => "x".repeat(m.length)
);
}
/** @type {false | TemplatePath} */
let currentSourceMappingURLComment = sourceMappingURLComment;
const cssExtensionDetected =
CSS_EXTENSION_DETECT_REGEXP.test(file);
resetRegexpState(CSS_EXTENSION_DETECT_REGEXP);
if (
currentSourceMappingURLComment !== false &&
typeof currentSourceMappingURLComment !== "function" &&
cssExtensionDetected
) {
currentSourceMappingURLComment =
currentSourceMappingURLComment.replace(
URL_FORMATTING_REGEXP,
"\n/*$1*/"
);
}
if (options.debugIds) {
const debugId = generateDebugId(source, sourceMap.file);
sourceMap.debugId = debugId;
const debugIdComment = `\n//# debugId=${debugId}`;
currentSourceMappingURLComment =
currentSourceMappingURLComment
? `${debugIdComment}${currentSourceMappingURLComment}`
: debugIdComment;
}
const sourceMapString = JSON.stringify(sourceMap);
if (sourceMapFilename) {
const filename = file;
const sourceMapContentHash = usesContentHash
? createHash(compilation.outputOptions.hashFunction)
.update(sourceMapString)
.digest("hex")
: undefined;
const pathParams = {
chunk,
filename: options.fileContext
? relative(
outputFs,
`/${options.fileContext}`,
`/${filename}`
)
: filename,
contentHash: sourceMapContentHash
};
const { path: sourceMapFile, info: sourceMapInfo } =
compilation.getPathWithInfo(
sourceMapFilename,
pathParams
);
const sourceMapUrl = options.publicPath
? options.publicPath + sourceMapFile
: relative(
outputFs,
dirname(outputFs, `/${file}`),
`/${sourceMapFile}`
);
/** @type {Source} */
let asset = new RawSource(source);
if (currentSourceMappingURLComment !== false) {
// Add source map url to compilation asset, if currentSourceMappingURLComment is set
asset = new ConcatSource(
asset,
compilation.getPath(currentSourceMappingURLComment, {
url: sourceMapUrl,
...pathParams
})
);
}
const assetInfo = {
related: { sourceMap: sourceMapFile }
};
assets[file] = asset;
assetsInfo[file] = assetInfo;
compilation.updateAsset(file, asset, assetInfo);
// Add source map file to compilation assets and chunk files
const sourceMapAsset = new RawSource(sourceMapString);
const sourceMapAssetInfo = {
...sourceMapInfo,
development: true
};
assets[sourceMapFile] = sourceMapAsset;
assetsInfo[sourceMapFile] = sourceMapAssetInfo;
compilation.emitAsset(
sourceMapFile,
sourceMapAsset,
sourceMapAssetInfo
);
if (chunk !== undefined) {
chunk.auxiliaryFiles.add(sourceMapFile);
}
} else {
if (currentSourceMappingURLComment === false) {
throw new Error(
`${PLUGIN_NAME}: append can't be false when no filename is provided`
);
}
if (typeof currentSourceMappingURLComment === "function") {
throw new Error(
`${PLUGIN_NAME}: append can't be a function when no filename is provided`
);
}
/**
* Add source map as data url to asset
*/
const asset = new ConcatSource(
new RawSource(source),
currentSourceMappingURLComment
.replace(MAP_URL_COMMENT_REGEXP, () => sourceMapString)
.replace(
URL_COMMENT_REGEXP,
() =>
`data:application/json;charset=utf-8;base64,${Buffer.from(
sourceMapString,
"utf8"
).toString("base64")}`
)
);
assets[file] = asset;
assetsInfo[file] = undefined;
compilation.updateAsset(file, asset);
}
task.cacheItem.store({ assets, assetsInfo }, (err) => {
reportProgress(
0.5 + (0.5 * ++taskIndex) / tasks.length,
task.file,
"attached SourceMap"
);
if (err) {
return callback(err);
}
callback();
});
},
(err) => {
reportProgress(1);
callback(err);
}
);
}
);
}
);
});
}
}
module.exports = SourceMapDevToolPlugin;
@@ -0,0 +1,39 @@
"use strict";
exports.formatISODuration = formatISODuration;
/**
* @name formatISODuration
* @category Common Helpers
* @summary Format a duration object according as ISO 8601 duration string
*
* @description
* Format a duration object according to the ISO 8601 duration standard (https://www.digi.com/resources/documentation/digidocs//90001488-13/reference/r_iso_8601_duration_format.htm)
*
* @param duration - The duration to format
*
* @returns The ISO 8601 duration string
*
* @example
* // Format the given duration as ISO 8601 string
* const result = formatISODuration({
* years: 39,
* months: 2,
* days: 20,
* hours: 7,
* minutes: 5,
* seconds: 0
* })
* //=> 'P39Y2M20DT0H0M0S'
*/
function formatISODuration(duration) {
const {
years = 0,
months = 0,
days = 0,
hours = 0,
minutes = 0,
seconds = 0,
} = duration;
return `P${years}Y${months}M${days}DT${hours}H${minutes}M${seconds}S`;
}
@@ -0,0 +1,60 @@
import type { CollectionSlug, FindOptions, Payload, RequestContext, TypedLocale } from '../../../index.js';
import type { Document, PayloadRequest, PopulateType, SelectType } from '../../../types/index.js';
import type { DataFromCollectionSlug, DraftFlagFromCollectionSlug } from '../../config/types.js';
type BaseOptions<TSlug extends CollectionSlug> = {
/**
* the Collection slug to operate against.
*/
collection: TSlug;
/**
* [Context](https://payloadcms.com/docs/hooks/context), which will then be passed to `context` and `req.context`,
* which can be read by hooks. Useful if you want to pass additional information to the hooks which
* shouldn't be necessarily part of the document, for example a `triggerBeforeChange` option which can be read by the BeforeChange hook
* to determine if it should run or not.
*/
context?: RequestContext;
/**
* [Control auto-population](https://payloadcms.com/docs/queries/depth) of nested relationship and upload fields.
*/
depth?: number;
/**
* Specify a [fallback locale](https://payloadcms.com/docs/configuration/localization) to use for any returned documents.
*/
fallbackLocale?: false | TypedLocale;
/**
* The ID of the version to restore.
*/
id: string;
/**
* Specify [locale](https://payloadcms.com/docs/configuration/localization) for any returned documents.
*/
locale?: TypedLocale;
/**
* Skip access control.
* Set to `false` if you want to respect Access Control for the operation, for example when fetching data for the front-end.
* @default true
*/
overrideAccess?: boolean;
/**
* Specify [populate](https://payloadcms.com/docs/queries/select#populate) to control which fields to include to the result from populated documents.
*/
populate?: PopulateType;
/**
* The `PayloadRequest` object. You can pass it to thread the current [transaction](https://payloadcms.com/docs/database/transactions), user and locale to the operation.
* Recommended to pass when using the Local API from hooks, as usually you want to execute the operation within the current transaction.
*/
req?: Partial<PayloadRequest>;
/**
* Opt-in to receiving hidden fields. By default, they are hidden from returned documents in accordance to your config.
* @default false
*/
showHiddenFields?: boolean;
/**
* If you set `overrideAccess` to `false`, you can pass a user to use against the access control checks.
*/
user?: Document;
} & Pick<FindOptions<TSlug, SelectType>, 'select'>;
export type Options<TSlug extends CollectionSlug> = BaseOptions<TSlug> & DraftFlagFromCollectionSlug<TSlug>;
export declare function restoreVersionLocal<TSlug extends CollectionSlug>(payload: Payload, options: Options<TSlug>): Promise<DataFromCollectionSlug<TSlug>>;
export {};
//# sourceMappingURL=restoreVersion.d.ts.map
@@ -0,0 +1,4 @@
{
"main": "../../cjs/_inherits.cjs",
"module": "../../esm/_inherits.js"
}
@@ -0,0 +1 @@
Prism.languages.smali={comment:/#.*/,string:{pattern:/"(?:[^\r\n\\"]|\\.)*"|'(?:[^\r\n\\']|\\(?:.|u[\da-fA-F]{4}))'/,greedy:!0},"class-name":{pattern:/(^|[^L])L(?:(?:\w+|`[^`\r\n]*`)\/)*(?:[\w$]+|`[^`\r\n]*`)(?=\s*;)/,lookbehind:!0,inside:{"class-name":{pattern:/(^L|\/)(?:[\w$]+|`[^`\r\n]*`)$/,lookbehind:!0},namespace:{pattern:/^(L)(?:(?:\w+|`[^`\r\n]*`)\/)+/,lookbehind:!0,inside:{punctuation:/\//}},builtin:/^L/}},builtin:[{pattern:/([();\[])[BCDFIJSVZ]+/,lookbehind:!0},{pattern:/([\w$>]:)[BCDFIJSVZ]/,lookbehind:!0}],keyword:[{pattern:/(\.end\s+)[\w-]+/,lookbehind:!0},{pattern:/(^|[^\w.-])\.(?!\d)[\w-]+/,lookbehind:!0},{pattern:/(^|[^\w.-])(?:abstract|annotation|bridge|constructor|enum|final|interface|private|protected|public|runtime|static|synthetic|system|transient)(?![\w.-])/,lookbehind:!0}],function:{pattern:/(^|[^\w.-])(?:\w+|<[\w$-]+>)(?=\()/,lookbehind:!0},field:{pattern:/[\w$]+(?=:)/,alias:"variable"},register:{pattern:/(^|[^\w.-])[vp]\d(?![\w.-])/,lookbehind:!0,alias:"variable"},boolean:{pattern:/(^|[^\w.-])(?:false|true)(?![\w.-])/,lookbehind:!0},number:{pattern:/(^|[^/\w.-])-?(?:NAN|INFINITY|0x(?:[\dA-F]+(?:\.[\dA-F]*)?|\.[\dA-F]+)(?:p[+-]?[\dA-F]+)?|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)[dflst]?(?![\w.-])/i,lookbehind:!0},label:{pattern:/(:)\w+/,lookbehind:!0,alias:"property"},operator:/->|\.\.|[\[=]/,punctuation:/[{}(),;:]/};
@@ -0,0 +1,4 @@
function _classCallCheck(a, n) {
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
}
export { _classCallCheck as default };
@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["React","baseClass","MinimalTemplate","props","children","className","style","width","classes","filter","Boolean","join","_jsx"],"sources":["../../../src/templates/Minimal/index.tsx"],"sourcesContent":["import React from 'react'\n\nimport './index.scss'\n\nconst baseClass = 'template-minimal'\n\nexport type MinimalTemplateProps = {\n children?: React.ReactNode\n className?: string\n style?: React.CSSProperties\n width?: 'normal' | 'wide'\n}\n\nexport const MinimalTemplate: React.FC<MinimalTemplateProps> = (props) => {\n const { children, className, style = {}, width = 'normal' } = props\n\n const classes = [className, baseClass, `${baseClass}--width-${width}`].filter(Boolean).join(' ')\n\n return (\n <section className={classes} style={style}>\n <div className={`${baseClass}__wrap`}>{children}</div>\n </section>\n )\n}\n"],"mappings":";AAAA,OAAOA,KAAA,MAAW;AAIlB,MAAMC,SAAA,GAAY;AASlB,OAAO,MAAMC,eAAA,GAAmDC,KAAA;EAC9D,MAAM;IAAEC,QAAQ;IAAEC,SAAS;IAAEC,KAAA,GAAQ,CAAC,CAAC;IAAEC,KAAA,GAAQ;EAAQ,CAAE,GAAGJ,KAAA;EAE9D,MAAMK,OAAA,GAAU,CAACH,SAAA,EAAWJ,SAAA,EAAW,GAAGA,SAAA,WAAoBM,KAAA,EAAO,CAAC,CAACE,MAAM,CAACC,OAAA,EAASC,IAAI,CAAC;EAE5F,oBACEC,IAAA,CAAC;IAAQP,SAAA,EAAWG,OAAA;IAASF,KAAA,EAAOA,KAAA;cAClC,aAAAM,IAAA,CAAC;MAAIP,SAAA,EAAW,GAAGJ,SAAA,QAAiB;gBAAGG;;;AAG7C","ignoreList":[]}
@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
// This is an empty module that is served up when outside of a workerd environment
// See the `exports` field in package.json
exports.default = {};
//# sourceMappingURL=empty.js.map
@@ -0,0 +1,643 @@
function _typeof(o) {"@babel/helpers - typeof";return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;}, _typeof(o);}function ownKeys(e, r) {var t = Object.keys(e);if (Object.getOwnPropertySymbols) {var o = Object.getOwnPropertySymbols(e);r && (o = o.filter(function (r) {return Object.getOwnPropertyDescriptor(e, r).enumerable;})), t.push.apply(t, o);}return t;}function _objectSpread(e) {for (var r = 1; r < arguments.length; r++) {var t = null != arguments[r] ? arguments[r] : {};r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {_defineProperty(e, r, t[r]);}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));});}return e;}function _defineProperty(obj, key, value) {key = _toPropertyKey(key);if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _toPropertyKey(t) {var i = _toPrimitive(t, "string");return "symbol" == _typeof(i) ? i : String(i);}function _toPrimitive(t, r) {if ("object" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || "default");if ("object" != _typeof(i)) return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return ("string" === r ? String : Number)(t);}(function (_window$dateFns) {var __defProp = Object.defineProperty;
var __export = function __export(target, all) {
for (var name in all)
__defProp(target, name, {
get: all[name],
enumerable: true,
configurable: true,
set: function set(newValue) {return all[name] = function () {return newValue;};}
});
};
// lib/locale/lt/_lib/formatDistance.mjs
var special = function special(number) {
return number % 10 === 0 || number > 10 && number < 20;
};
var forms = function forms(key) {
return translations[key].split("_");
};
var translations = {
xseconds_other: "sekund\u0117_sekund\u017Ei\u0173_sekundes",
xminutes_one: "minut\u0117_minut\u0117s_minut\u0119",
xminutes_other: "minut\u0117s_minu\u010Di\u0173_minutes",
xhours_one: "valanda_valandos_valand\u0105",
xhours_other: "valandos_valand\u0173_valandas",
xdays_one: "diena_dienos_dien\u0105",
xdays_other: "dienos_dien\u0173_dienas",
xweeks_one: "savait\u0117_savait\u0117s_savait\u0119",
xweeks_other: "savait\u0117s_savai\u010Di\u0173_savaites",
xmonths_one: "m\u0117nuo_m\u0117nesio_m\u0117nes\u012F",
xmonths_other: "m\u0117nesiai_m\u0117nesi\u0173_m\u0117nesius",
xyears_one: "metai_met\u0173_metus",
xyears_other: "metai_met\u0173_metus",
about: "apie",
over: "daugiau nei",
almost: "beveik",
lessthan: "ma\u017Eiau nei"
};
var translateSeconds = function translateSeconds(_number, addSuffix, _key, isFuture) {
if (!addSuffix) {
return "kelios sekund\u0117s";
} else {
return isFuture ? "keli\u0173 sekund\u017Ei\u0173" : "kelias sekundes";
}
};
var translateSingular = function translateSingular(_number, addSuffix, key, isFuture) {
return !addSuffix ? forms(key)[0] : isFuture ? forms(key)[1] : forms(key)[2];
};
var translate = function translate(number, addSuffix, key, isFuture) {
var result = number + " ";
if (number === 1) {
return result + translateSingular(number, addSuffix, key, isFuture);
} else if (!addSuffix) {
return result + (special(number) ? forms(key)[1] : forms(key)[0]);
} else {
if (isFuture) {
return result + forms(key)[1];
} else {
return result + (special(number) ? forms(key)[1] : forms(key)[2]);
}
}
};
var formatDistanceLocale = {
lessThanXSeconds: {
one: translateSeconds,
other: translate
},
xSeconds: {
one: translateSeconds,
other: translate
},
halfAMinute: "pus\u0117 minut\u0117s",
lessThanXMinutes: {
one: translateSingular,
other: translate
},
xMinutes: {
one: translateSingular,
other: translate
},
aboutXHours: {
one: translateSingular,
other: translate
},
xHours: {
one: translateSingular,
other: translate
},
xDays: {
one: translateSingular,
other: translate
},
aboutXWeeks: {
one: translateSingular,
other: translate
},
xWeeks: {
one: translateSingular,
other: translate
},
aboutXMonths: {
one: translateSingular,
other: translate
},
xMonths: {
one: translateSingular,
other: translate
},
aboutXYears: {
one: translateSingular,
other: translate
},
xYears: {
one: translateSingular,
other: translate
},
overXYears: {
one: translateSingular,
other: translate
},
almostXYears: {
one: translateSingular,
other: translate
}
};
var formatDistance = function formatDistance(token, count, options) {
var adverb = token.match(/about|over|almost|lessthan/i);
var unit = adverb ? token.replace(adverb[0], "") : token;
var isFuture = (options === null || options === void 0 ? void 0 : options.comparison) !== undefined && options.comparison > 0;
var result;
var tokenValue = formatDistanceLocale[token];
if (typeof tokenValue === "string") {
result = tokenValue;
} else if (count === 1) {
result = tokenValue.one(count, (options === null || options === void 0 ? void 0 : options.addSuffix) === true, unit.toLowerCase() + "_one", isFuture);
} else {
result = tokenValue.other(count, (options === null || options === void 0 ? void 0 : options.addSuffix) === true, unit.toLowerCase() + "_other", isFuture);
}
if (adverb) {
var key = adverb[0].toLowerCase();
result = translations[key] + " " + result;
}
if (options !== null && options !== void 0 && options.addSuffix) {
if (options.comparison && options.comparison > 0) {
return "po " + result;
} else {
return "prie\u0161 " + result;
}
}
return result;
};
// lib/locale/_lib/buildFormatLongFn.mjs
function buildFormatLongFn(args) {
return function () {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var width = options.width ? String(options.width) : args.defaultWidth;
var format = args.formats[width] || args.formats[args.defaultWidth];
return format;
};
}
// lib/locale/lt/_lib/formatLong.mjs
var dateFormats = {
full: "y 'm'. MMMM d 'd'., EEEE",
long: "y 'm'. MMMM d 'd'.",
medium: "y-MM-dd",
short: "y-MM-dd"
};
var timeFormats = {
full: "HH:mm:ss zzzz",
long: "HH:mm:ss z",
medium: "HH:mm:ss",
short: "HH:mm"
};
var dateTimeFormats = {
full: "{{date}} {{time}}",
long: "{{date}} {{time}}",
medium: "{{date}} {{time}}",
short: "{{date}} {{time}}"
};
var formatLong = {
date: buildFormatLongFn({
formats: dateFormats,
defaultWidth: "full"
}),
time: buildFormatLongFn({
formats: timeFormats,
defaultWidth: "full"
}),
dateTime: buildFormatLongFn({
formats: dateTimeFormats,
defaultWidth: "full"
})
};
// lib/locale/lt/_lib/formatRelative.mjs
var formatRelativeLocale = {
lastWeek: "'Pra\u0117jus\u012F' eeee p",
yesterday: "'Vakar' p",
today: "'\u0160iandien' p",
tomorrow: "'Rytoj' p",
nextWeek: "eeee p",
other: "P"
};
var formatRelative = function formatRelative(token, _date, _baseDate, _options) {return formatRelativeLocale[token];};
// lib/locale/_lib/buildLocalizeFn.mjs
function buildLocalizeFn(args) {
return function (value, options) {
var context = options !== null && options !== void 0 && options.context ? String(options.context) : "standalone";
var valuesArray;
if (context === "formatting" && args.formattingValues) {
var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
} else {
var _defaultWidth = args.defaultWidth;
var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
valuesArray = args.values[_width] || args.values[_defaultWidth];
}
var index = args.argumentCallback ? args.argumentCallback(value) : value;
return valuesArray[index];
};
}
// lib/locale/lt/_lib/localize.mjs
var eraValues = {
narrow: ["pr. Kr.", "po Kr."],
abbreviated: ["pr. Kr.", "po Kr."],
wide: ["prie\u0161 Krist\u0173", "po Kristaus"]
};
var quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["I ketv.", "II ketv.", "III ketv.", "IV ketv."],
wide: ["I ketvirtis", "II ketvirtis", "III ketvirtis", "IV ketvirtis"]
};
var formattingQuarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["I k.", "II k.", "III k.", "IV k."],
wide: ["I ketvirtis", "II ketvirtis", "III ketvirtis", "IV ketvirtis"]
};
var monthValues = {
narrow: ["S", "V", "K", "B", "G", "B", "L", "R", "R", "S", "L", "G"],
abbreviated: [
"saus.",
"vas.",
"kov.",
"bal.",
"geg.",
"bir\u017E.",
"liep.",
"rugp.",
"rugs.",
"spal.",
"lapkr.",
"gruod."],
wide: [
"sausis",
"vasaris",
"kovas",
"balandis",
"gegu\u017E\u0117",
"bir\u017Eelis",
"liepa",
"rugpj\u016Btis",
"rugs\u0117jis",
"spalis",
"lapkritis",
"gruodis"]
};
var formattingMonthValues = {
narrow: ["S", "V", "K", "B", "G", "B", "L", "R", "R", "S", "L", "G"],
abbreviated: [
"saus.",
"vas.",
"kov.",
"bal.",
"geg.",
"bir\u017E.",
"liep.",
"rugp.",
"rugs.",
"spal.",
"lapkr.",
"gruod."],
wide: [
"sausio",
"vasario",
"kovo",
"baland\u017Eio",
"gegu\u017E\u0117s",
"bir\u017Eelio",
"liepos",
"rugpj\u016B\u010Dio",
"rugs\u0117jo",
"spalio",
"lapkri\u010Dio",
"gruod\u017Eio"]
};
var dayValues = {
narrow: ["S", "P", "A", "T", "K", "P", "\u0160"],
short: ["Sk", "Pr", "An", "Tr", "Kt", "Pn", "\u0160t"],
abbreviated: ["sk", "pr", "an", "tr", "kt", "pn", "\u0161t"],
wide: [
"sekmadienis",
"pirmadienis",
"antradienis",
"tre\u010Diadienis",
"ketvirtadienis",
"penktadienis",
"\u0161e\u0161tadienis"]
};
var formattingDayValues = {
narrow: ["S", "P", "A", "T", "K", "P", "\u0160"],
short: ["Sk", "Pr", "An", "Tr", "Kt", "Pn", "\u0160t"],
abbreviated: ["sk", "pr", "an", "tr", "kt", "pn", "\u0161t"],
wide: [
"sekmadien\u012F",
"pirmadien\u012F",
"antradien\u012F",
"tre\u010Diadien\u012F",
"ketvirtadien\u012F",
"penktadien\u012F",
"\u0161e\u0161tadien\u012F"]
};
var dayPeriodValues = {
narrow: {
am: "pr. p.",
pm: "pop.",
midnight: "vidurnaktis",
noon: "vidurdienis",
morning: "rytas",
afternoon: "diena",
evening: "vakaras",
night: "naktis"
},
abbreviated: {
am: "prie\u0161piet",
pm: "popiet",
midnight: "vidurnaktis",
noon: "vidurdienis",
morning: "rytas",
afternoon: "diena",
evening: "vakaras",
night: "naktis"
},
wide: {
am: "prie\u0161piet",
pm: "popiet",
midnight: "vidurnaktis",
noon: "vidurdienis",
morning: "rytas",
afternoon: "diena",
evening: "vakaras",
night: "naktis"
}
};
var formattingDayPeriodValues = {
narrow: {
am: "pr. p.",
pm: "pop.",
midnight: "vidurnaktis",
noon: "perpiet",
morning: "rytas",
afternoon: "popiet\u0117",
evening: "vakaras",
night: "naktis"
},
abbreviated: {
am: "prie\u0161piet",
pm: "popiet",
midnight: "vidurnaktis",
noon: "perpiet",
morning: "rytas",
afternoon: "popiet\u0117",
evening: "vakaras",
night: "naktis"
},
wide: {
am: "prie\u0161piet",
pm: "popiet",
midnight: "vidurnaktis",
noon: "perpiet",
morning: "rytas",
afternoon: "popiet\u0117",
evening: "vakaras",
night: "naktis"
}
};
var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
var number = Number(dirtyNumber);
return number + "-oji";
};
var localize = {
ordinalNumber: ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide"
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
formattingValues: formattingQuarterValues,
defaultFormattingWidth: "wide",
argumentCallback: function argumentCallback(quarter) {return quarter - 1;}
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide",
formattingValues: formattingMonthValues,
defaultFormattingWidth: "wide"
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide",
formattingValues: formattingDayValues,
defaultFormattingWidth: "wide"
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide"
})
};
// lib/locale/_lib/buildMatchFn.mjs
function buildMatchFn(args) {
return function (string) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var width = options.width;
var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
var matchResult = string.match(matchPattern);
if (!matchResult) {
return null;
}
var matchedString = matchResult[0];
var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {return pattern.test(matchedString);}) : findKey(parsePatterns, function (pattern) {return pattern.test(matchedString);});
var value;
value = args.valueCallback ? args.valueCallback(key) : key;
value = options.valueCallback ? options.valueCallback(value) : value;
var rest = string.slice(matchedString.length);
return { value: value, rest: rest };
};
}
var findKey = function findKey(object, predicate) {
for (var key in object) {
if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) {
return key;
}
}
return;
};
var findIndex = function findIndex(array, predicate) {
for (var key = 0; key < array.length; key++) {
if (predicate(array[key])) {
return key;
}
}
return;
};
// lib/locale/_lib/buildMatchPatternFn.mjs
function buildMatchPatternFn(args) {
return function (string) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var matchResult = string.match(args.matchPattern);
if (!matchResult)
return null;
var matchedString = matchResult[0];
var parseResult = string.match(args.parsePattern);
if (!parseResult)
return null;
var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
value = options.valueCallback ? options.valueCallback(value) : value;
var rest = string.slice(matchedString.length);
return { value: value, rest: rest };
};
}
// lib/locale/lt/_lib/match.mjs
var matchOrdinalNumberPattern = /^(\d+)(-oji)?/i;
var parseOrdinalNumberPattern = /\d+/i;
var matchEraPatterns = {
narrow: /^p(r|o)\.?\s?(kr\.?|me)/i,
abbreviated: /^(pr\.\s?(kr\.|m\.\s?e\.)|po\s?kr\.|mūsų eroje)/i,
wide: /^(prieš Kristų|prieš mūsų erą|po Kristaus|mūsų eroje)/i
};
var parseEraPatterns = {
wide: [/prieš/i, /(po|mūsų)/i],
any: [/^pr/i, /^(po|m)/i]
};
var matchQuarterPatterns = {
narrow: /^([1234])/i,
abbreviated: /^(I|II|III|IV)\s?ketv?\.?/i,
wide: /^(I|II|III|IV)\s?ketvirtis/i
};
var parseQuarterPatterns = {
narrow: [/1/i, /2/i, /3/i, /4/i],
any: [/I$/i, /II$/i, /III/i, /IV/i]
};
var matchMonthPatterns = {
narrow: /^[svkbglr]/i,
abbreviated: /^(saus\.|vas\.|kov\.|bal\.|geg\.|birž\.|liep\.|rugp\.|rugs\.|spal\.|lapkr\.|gruod\.)/i,
wide: /^(sausi(s|o)|vasari(s|o)|kov(a|o)s|balandž?i(s|o)|gegužės?|birželi(s|o)|liep(a|os)|rugpjū(t|č)i(s|o)|rugsėj(is|o)|spali(s|o)|lapkri(t|č)i(s|o)|gruodž?i(s|o))/i
};
var parseMonthPatterns = {
narrow: [
/^s/i,
/^v/i,
/^k/i,
/^b/i,
/^g/i,
/^b/i,
/^l/i,
/^r/i,
/^r/i,
/^s/i,
/^l/i,
/^g/i],
any: [
/^saus/i,
/^vas/i,
/^kov/i,
/^bal/i,
/^geg/i,
/^birž/i,
/^liep/i,
/^rugp/i,
/^rugs/i,
/^spal/i,
/^lapkr/i,
/^gruod/i]
};
var matchDayPatterns = {
narrow: /^[spatkš]/i,
short: /^(sk|pr|an|tr|kt|pn|št)/i,
abbreviated: /^(sk|pr|an|tr|kt|pn|št)/i,
wide: /^(sekmadien(is|į)|pirmadien(is|į)|antradien(is|į)|trečiadien(is|į)|ketvirtadien(is|į)|penktadien(is|į)|šeštadien(is|į))/i
};
var parseDayPatterns = {
narrow: [/^s/i, /^p/i, /^a/i, /^t/i, /^k/i, /^p/i, /^š/i],
wide: [/^se/i, /^pi/i, /^an/i, /^tr/i, /^ke/i, /^pe/i, /^še/i],
any: [/^sk/i, /^pr/i, /^an/i, /^tr/i, /^kt/i, /^pn/i, /^št/i]
};
var matchDayPeriodPatterns = {
narrow: /^(pr.\s?p.|pop.|vidurnaktis|(vidurdienis|perpiet)|rytas|(diena|popietė)|vakaras|naktis)/i,
any: /^(priešpiet|popiet$|vidurnaktis|(vidurdienis|perpiet)|rytas|(diena|popietė)|vakaras|naktis)/i
};
var parseDayPeriodPatterns = {
narrow: {
am: /^pr/i,
pm: /^pop./i,
midnight: /^vidurnaktis/i,
noon: /^(vidurdienis|perp)/i,
morning: /rytas/i,
afternoon: /(die|popietė)/i,
evening: /vakaras/i,
night: /naktis/i
},
any: {
am: /^pr/i,
pm: /^popiet$/i,
midnight: /^vidurnaktis/i,
noon: /^(vidurdienis|perp)/i,
morning: /rytas/i,
afternoon: /(die|popietė)/i,
evening: /vakaras/i,
night: /naktis/i
}
};
var match = {
ordinalNumber: buildMatchPatternFn({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: function valueCallback(value) {return parseInt(value, 10);}
}),
era: buildMatchFn({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any"
}),
quarter: buildMatchFn({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: function valueCallback(index) {return index + 1;}
}),
month: buildMatchFn({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any"
}),
day: buildMatchFn({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any"
}),
dayPeriod: buildMatchFn({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any"
})
};
// lib/locale/lt.mjs
var lt = {
code: "lt",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 1,
firstWeekContainsDate: 4
}
};
// lib/locale/lt/cdn.js
window.dateFns = _objectSpread(_objectSpread({},
window.dateFns), {}, {
locale: _objectSpread(_objectSpread({}, (_window$dateFns =
window.dateFns) === null || _window$dateFns === void 0 ? void 0 : _window$dateFns.locale), {}, {
lt: lt }) });
//# debugId=97D385AD35F9453064756e2164756e21
})();
//# sourceMappingURL=cdn.js.map
@@ -0,0 +1,16 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Bell = createLucideIcon("Bell", [
["path", { d: "M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9", key: "1qo2s2" }],
["path", { d: "M10.3 21a1.94 1.94 0 0 0 3.4 0", key: "qgo35s" }]
]);
export { Bell as default };
//# sourceMappingURL=bell.js.map
@@ -0,0 +1,49 @@
import type { HTTPQueryOptions, HTTPTransactionOptions, NeonQueryFunction } from '@neondatabase/serverless';
import type { BatchItem, BatchResponse } from "../batch.cjs";
import type { Cache } from "../cache/core/cache.cjs";
import { entityKind } from "../entity.cjs";
import type { Logger } from "../logger.cjs";
import { PgDatabase } from "../pg-core/db.cjs";
import { PgDialect } from "../pg-core/dialect.cjs";
import type { RelationalSchemaConfig, TablesRelationalConfig } from "../relations.cjs";
import { type DrizzleConfig } from "../utils.cjs";
import { type NeonHttpClient, type NeonHttpQueryResultHKT, NeonHttpSession } from "./session.cjs";
export interface NeonDriverOptions {
logger?: Logger;
cache?: Cache;
}
export declare class NeonHttpDriver {
private client;
private dialect;
private options;
static readonly [entityKind]: string;
constructor(client: NeonHttpClient, dialect: PgDialect, options?: NeonDriverOptions);
createSession(schema: RelationalSchemaConfig<TablesRelationalConfig> | undefined): NeonHttpSession<Record<string, unknown>, TablesRelationalConfig>;
initMappers(): void;
}
export declare class NeonHttpDatabase<TSchema extends Record<string, unknown> = Record<string, never>> extends PgDatabase<NeonHttpQueryResultHKT, TSchema> {
static readonly [entityKind]: string;
$withAuth(token: Exclude<HTTPQueryOptions<true, true>['authToken'], undefined>): Omit<this, Exclude<keyof this, '$count' | 'delete' | 'select' | 'selectDistinct' | 'selectDistinctOn' | 'update' | 'insert' | 'with' | 'query' | 'execute' | 'refreshMaterializedView'>>;
batch<U extends BatchItem<'pg'>, T extends Readonly<[U, ...U[]]>>(batch: T): Promise<BatchResponse<T>>;
}
export declare function drizzle<TSchema extends Record<string, unknown> = Record<string, never>, TClient extends NeonQueryFunction<any, any> = NeonQueryFunction<false, false>>(...params: [
TClient | string
] | [
TClient | string,
DrizzleConfig<TSchema>
] | [
(DrizzleConfig<TSchema> & ({
connection: string | ({
connectionString: string;
} & HTTPTransactionOptions<boolean, boolean>);
} | {
client: TClient;
}))
]): NeonHttpDatabase<TSchema> & {
$client: TClient;
};
export declare namespace drizzle {
function mock<TSchema extends Record<string, unknown> = Record<string, never>>(config?: DrizzleConfig<TSchema>): NeonHttpDatabase<TSchema> & {
$client: '$client is not available on drizzle.mock()';
};
}
@@ -0,0 +1,161 @@
'use strict'
const hasBuffer = typeof Buffer !== 'undefined'
const suspectProtoRx = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/
const suspectConstructorRx = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/
/**
* @description Internal parse function that parses JSON text with security checks.
* @private
* @param {string|Buffer} text - The JSON text string or Buffer to parse.
* @param {Function} [reviver] - The JSON.parse() optional reviver argument.
* @param {import('./types').ParseOptions} [options] - Optional configuration object.
* @returns {*} The parsed object.
* @throws {SyntaxError} If a forbidden prototype property is found and `options.protoAction` or
* `options.constructorAction` is `'error'`.
*/
function _parse (text, reviver, options) {
// Normalize arguments
if (options == null) {
if (reviver !== null && typeof reviver === 'object') {
options = reviver
reviver = undefined
}
}
if (hasBuffer && Buffer.isBuffer(text)) {
text = text.toString()
}
// BOM checker
if (text && text.charCodeAt(0) === 0xFEFF) {
text = text.slice(1)
}
// Parse normally, allowing exceptions
const obj = JSON.parse(text, reviver)
// Ignore null and non-objects
if (obj === null || typeof obj !== 'object') {
return obj
}
const protoAction = (options && options.protoAction) || 'error'
const constructorAction = (options && options.constructorAction) || 'error'
// options: 'error' (default) / 'remove' / 'ignore'
if (protoAction === 'ignore' && constructorAction === 'ignore') {
return obj
}
if (protoAction !== 'ignore' && constructorAction !== 'ignore') {
if (suspectProtoRx.test(text) === false && suspectConstructorRx.test(text) === false) {
return obj
}
} else if (protoAction !== 'ignore' && constructorAction === 'ignore') {
if (suspectProtoRx.test(text) === false) {
return obj
}
} else {
if (suspectConstructorRx.test(text) === false) {
return obj
}
}
// Scan result for proto keys
return filter(obj, { protoAction, constructorAction, safe: options && options.safe })
}
/**
* @description Scans and filters an object for forbidden prototype properties.
* @param {Object} obj - The object being scanned.
* @param {import('./types').ParseOptions} [options] - Optional configuration object.
* @returns {Object|null} The filtered object, or `null` if safe mode is enabled and issues are found.
* @throws {SyntaxError} If a forbidden prototype property is found and `options.protoAction` or
* `options.constructorAction` is `'error'`.
*/
function filter (obj, { protoAction = 'error', constructorAction = 'error', safe } = {}) {
let next = [obj]
while (next.length) {
const nodes = next
next = []
for (const node of nodes) {
if (protoAction !== 'ignore' && Object.prototype.hasOwnProperty.call(node, '__proto__')) { // Avoid calling node.hasOwnProperty directly
if (safe === true) {
return null
} else if (protoAction === 'error') {
throw new SyntaxError('Object contains forbidden prototype property')
}
delete node.__proto__ // eslint-disable-line no-proto
}
if (constructorAction !== 'ignore' &&
Object.prototype.hasOwnProperty.call(node, 'constructor') &&
node.constructor !== null &&
typeof node.constructor === 'object' &&
Object.prototype.hasOwnProperty.call(node.constructor, 'prototype')) { // Avoid calling node.hasOwnProperty directly
if (safe === true) {
return null
} else if (constructorAction === 'error') {
throw new SyntaxError('Object contains forbidden prototype property')
}
delete node.constructor
}
for (const key in node) {
const value = node[key]
if (value && typeof value === 'object') {
next.push(value)
}
}
}
}
return obj
}
/**
* @description Parses a given JSON-formatted text into an object.
* @param {string|Buffer} text - The JSON text string or Buffer to parse.
* @param {Function} [reviver] - The `JSON.parse()` optional reviver argument, or options object.
* @param {import('./types').ParseOptions} [options] - Optional configuration object.
* @returns {*} The parsed object.
* @throws {SyntaxError} If the JSON text is malformed or contains forbidden prototype properties
* when `options.protoAction` or `options.constructorAction` is `'error'`.
*/
function parse (text, reviver, options) {
const { stackTraceLimit } = Error
Error.stackTraceLimit = 0
try {
return _parse(text, reviver, options)
} finally {
Error.stackTraceLimit = stackTraceLimit
}
}
/**
* @description Safely parses a given JSON-formatted text into an object.
* @param {string|Buffer} text - The JSON text string or Buffer to parse.
* @param {Function} [reviver] - The `JSON.parse()` optional reviver argument.
* @returns {*|null|undefined} The parsed object, `null` if security issues found, or `undefined` on parse error.
*/
function safeParse (text, reviver) {
const { stackTraceLimit } = Error
Error.stackTraceLimit = 0
try {
return _parse(text, reviver, { safe: true })
} catch {
return undefined
} finally {
Error.stackTraceLimit = stackTraceLimit
}
}
module.exports = parse
module.exports.default = parse
module.exports.parse = parse
module.exports.safeParse = safeParse
module.exports.scan = filter
@@ -0,0 +1,9 @@
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,187 @@
import { buildLocalizeFn } from "../../_lib/buildLocalizeFn.mjs";
const eraValues = {
narrow: ["ჩ.წ-მდე", "ჩ.წ"],
abbreviated: ["ჩვ.წ-მდე", "ჩვ.წ"],
wide: ["ჩვენს წელთაღრიცხვამდე", "ჩვენი წელთაღრიცხვით"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["1-ლი კვ", "2-ე კვ", "3-ე კვ", "4-ე კვ"],
wide: ["1-ლი კვარტალი", "2-ე კვარტალი", "3-ე კვარტალი", "4-ე კვარტალი"],
};
// Note: in English, the names of days of the week and months are capitalized.
// If you are making a new locale based on this one, check if the same is true for the language you're working on.
// Generally, formatted dates should look like they are in the middle of a sentence,
// e.g. in Spanish language the weekdays and months should be in the lowercase.
const monthValues = {
narrow: [
"ია",
"თე",
"მა",
"აპ",
"მს",
"ვნ",
"ვლ",
"აგ",
"სე",
"ოქ",
"ნო",
"დე",
],
abbreviated: [
"იან",
"თებ",
"მარ",
"აპრ",
"მაი",
"ივნ",
"ივლ",
"აგვ",
"სექ",
"ოქტ",
"ნოე",
"დეკ",
],
wide: [
"იანვარი",
"თებერვალი",
"მარტი",
"აპრილი",
"მაისი",
"ივნისი",
"ივლისი",
"აგვისტო",
"სექტემბერი",
"ოქტომბერი",
"ნოემბერი",
"დეკემბერი",
],
};
const dayValues = {
narrow: ["კვ", "ორ", "სა", "ოთ", "ხუ", "პა", "შა"],
short: ["კვი", "ორშ", "სამ", "ოთხ", "ხუთ", "პარ", "შაბ"],
abbreviated: ["კვი", "ორშ", "სამ", "ოთხ", "ხუთ", "პარ", "შაბ"],
wide: [
"კვირა",
"ორშაბათი",
"სამშაბათი",
"ოთხშაბათი",
"ხუთშაბათი",
"პარასკევი",
"შაბათი",
],
};
const dayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "შუაღამე",
noon: "შუადღე",
morning: "დილა",
afternoon: "საღამო",
evening: "საღამო",
night: "ღამე",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "შუაღამე",
noon: "შუადღე",
morning: "დილა",
afternoon: "საღამო",
evening: "საღამო",
night: "ღამე",
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "შუაღამე",
noon: "შუადღე",
morning: "დილა",
afternoon: "საღამო",
evening: "საღამო",
night: "ღამე",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "შუაღამით",
noon: "შუადღისას",
morning: "დილით",
afternoon: "ნაშუადღევს",
evening: "საღამოს",
night: "ღამით",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "შუაღამით",
noon: "შუადღისას",
morning: "დილით",
afternoon: "ნაშუადღევს",
evening: "საღამოს",
night: "ღამით",
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "შუაღამით",
noon: "შუადღისას",
morning: "დილით",
afternoon: "ნაშუადღევს",
evening: "საღამოს",
night: "ღამით",
},
};
const ordinalNumber = (dirtyNumber) => {
const number = Number(dirtyNumber);
if (number === 1) {
return number + "-ლი";
}
return number + "-ე";
};
export const localize = {
ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide",
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide",
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
};

Some files were not shown because too many files have changed in this diff Show More