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 @@
{"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../../../src/sdk/scope.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAG1C;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,cAAc,EAAE,KAAK,GAAG,IAAI,CAK7D"}
@@ -0,0 +1,5 @@
export function removeUndefined(obj) {
return Object.fromEntries(Object.entries(obj).filter(([, value])=>value !== undefined));
}
//# sourceMappingURL=removeUndefined.js.map
@@ -0,0 +1 @@
{"version":3,"file":"translations.cjs","names":[],"sources":["../../../../src/rest/commands/delete/translations.ts"],"sourcesContent":["import type { DirectusTranslation } from '../../../schema/translation.js';\nimport type { RestCommand } from '../../types.js';\nimport { throwIfEmpty } from '../../utils/index.js';\n\n/**\n * Delete multiple existing translations.\n * @param keys\n * @returns\n * @throws Will throw if keys is empty\n */\nexport const deleteTranslations =\n\t<Schema>(keys: DirectusTranslation<Schema>['id'][]): RestCommand<void, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(keys, 'Keys cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/translations`,\n\t\t\tbody: JSON.stringify(keys),\n\t\t\tmethod: 'DELETE',\n\t\t};\n\t};\n\n/**\n * Delete an existing translation.\n * @param key\n * @returns\n * @throws Will throw if key is empty\n */\nexport const deleteTranslation =\n\t<Schema>(key: DirectusTranslation<Schema>['id']): RestCommand<void, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(String(key), 'Key cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/translations/${key}`,\n\t\t\tmethod: 'DELETE',\n\t\t};\n\t};\n"],"mappings":"kDAUa,EACH,QAER,EAAA,aAAa,EAAM,uBAAuB,CAEnC,CACN,KAAM,gBACN,KAAM,KAAK,UAAU,EAAK,CAC1B,OAAQ,SACR,EASU,EACH,QAER,EAAA,aAAa,OAAO,EAAI,CAAE,sBAAsB,CAEzC,CACN,KAAM,iBAAiB,IACvB,OAAQ,SACR"}
@@ -0,0 +1,2 @@
import { PredicateFunction } from "../predicate-function";
export type PredicateType<Type extends PredicateFunction> = Type extends (target: any, ...rest: any[]) => target is infer NarrowedType ? NarrowedType : never;
@@ -0,0 +1,15 @@
import { HrTime, Attributes } from '@opentelemetry/api';
/**
* Represents a timed event.
* A timed event is an event with a timestamp.
*/
export interface TimedEvent {
time: HrTime;
/** The name of the event. */
name: string;
/** The attributes of the event. */
attributes?: Attributes;
/** Count of attributes of the event that were dropped due to collection limits */
droppedAttributesCount?: number;
}
//# sourceMappingURL=TimedEvent.d.ts.map
@@ -0,0 +1,111 @@
/**
* 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.
*
*/
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
import { useLexicalNodeSelection } from '@lexical/react/useLexicalNodeSelection';
import { addClassNamesToElement, mergeRegister, removeClassNamesFromElement } from '@lexical/utils';
import { createCommand, DecoratorNode, $applyNodeReplacement, CLICK_COMMAND, COMMAND_PRIORITY_LOW } from 'lexical';
import { useEffect } from 'react';
import { jsx } from 'react/jsx-runtime';
/**
* 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.
*
*/
const INSERT_HORIZONTAL_RULE_COMMAND = createCommand('INSERT_HORIZONTAL_RULE_COMMAND');
function HorizontalRuleComponent({
nodeKey
}) {
const [editor] = useLexicalComposerContext();
const [isSelected, setSelected, clearSelection] = useLexicalNodeSelection(nodeKey);
useEffect(() => {
return mergeRegister(editor.registerCommand(CLICK_COMMAND, event => {
const hrElem = editor.getElementByKey(nodeKey);
if (event.target === hrElem) {
if (!event.shiftKey) {
clearSelection();
}
setSelected(!isSelected);
return true;
}
return false;
}, COMMAND_PRIORITY_LOW));
}, [clearSelection, editor, isSelected, nodeKey, setSelected]);
useEffect(() => {
const hrElem = editor.getElementByKey(nodeKey);
const isSelectedClassName = editor._config.theme.hrSelected ?? 'selected';
if (hrElem !== null) {
if (isSelected) {
addClassNamesToElement(hrElem, isSelectedClassName);
} else {
removeClassNamesFromElement(hrElem, isSelectedClassName);
}
}
}, [editor, isSelected, nodeKey]);
return null;
}
class HorizontalRuleNode extends DecoratorNode {
static getType() {
return 'horizontalrule';
}
static clone(node) {
return new HorizontalRuleNode(node.__key);
}
static importJSON(serializedNode) {
return $createHorizontalRuleNode().updateFromJSON(serializedNode);
}
static importDOM() {
return {
hr: () => ({
conversion: $convertHorizontalRuleElement,
priority: 0
})
};
}
exportDOM() {
return {
element: document.createElement('hr')
};
}
createDOM(config) {
const element = document.createElement('hr');
addClassNamesToElement(element, config.theme.hr);
return element;
}
getTextContent() {
return '\n';
}
isInline() {
return false;
}
updateDOM() {
return false;
}
decorate() {
return /*#__PURE__*/jsx(HorizontalRuleComponent, {
nodeKey: this.__key
});
}
}
function $convertHorizontalRuleElement() {
return {
node: $createHorizontalRuleNode()
};
}
function $createHorizontalRuleNode() {
return $applyNodeReplacement(new HorizontalRuleNode());
}
function $isHorizontalRuleNode(node) {
return node instanceof HorizontalRuleNode;
}
export { $createHorizontalRuleNode, $isHorizontalRuleNode, HorizontalRuleNode, INSERT_HORIZONTAL_RULE_COMMAND };
@@ -0,0 +1,29 @@
import { DirectusPreset } from "../../../schema/preset.cjs";
import { NestedPartial } from "../../../types/utils.cjs";
import { ApplyQueryFields } from "../../../types/output.cjs";
import { Query } from "../../../types/query.cjs";
import { RestCommand } from "../../types.cjs";
//#region src/rest/commands/create/presets.d.ts
type CreatePresetOutput<Schema, TQuery extends Query<Schema, Item>, Item extends object = DirectusPreset<Schema>> = ApplyQueryFields<Schema, Item, TQuery['fields']>;
/**
* Create multiple new presets.
*
* @param items The presets to create
* @param query Optional return data query
*
* @returns Returns the preset object for the created preset.
*/
declare const createPresets: <Schema, const TQuery extends Query<Schema, DirectusPreset<Schema>>>(items: NestedPartial<DirectusPreset<Schema>>[], query?: TQuery) => RestCommand<CreatePresetOutput<Schema, TQuery>[], Schema>;
/**
* Create a new preset.
*
* @param item The preset to create
* @param query Optional return data query
*
* @returns Returns the preset object for the created preset.
*/
declare const createPreset: <Schema, const TQuery extends Query<Schema, DirectusPreset<Schema>>>(item: NestedPartial<DirectusPreset<Schema>>, query?: TQuery) => RestCommand<CreatePresetOutput<Schema, TQuery>, Schema>;
//#endregion
export { CreatePresetOutput, createPreset, createPresets };
//# sourceMappingURL=presets.d.cts.map
@@ -0,0 +1,20 @@
import { Sampler } from './Sampler';
import { SpanLimits, TracerConfig, GeneralLimits } from './types';
export declare const DEFAULT_ATTRIBUTE_COUNT_LIMIT = 128;
export declare const DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT: number;
/**
* Function to merge Default configuration (as specified in './config') with
* user provided configurations.
*/
export declare function mergeConfig(userConfig: TracerConfig): TracerConfig & {
sampler: Sampler;
spanLimits: SpanLimits;
generalLimits: GeneralLimits;
};
/**
* When general limits are provided and model specific limits are not,
* configures the model specific limits by using the values from the general ones.
* @param userConfig User provided tracer configuration
*/
export declare function reconfigureLimits(userConfig: TracerConfig): TracerConfig;
//# sourceMappingURL=utility.d.ts.map
@@ -0,0 +1,84 @@
import { resize } from '../resize/index.mjs';
import { createScrollInfo } from './info.mjs';
import { createOnScrollHandler } from './on-scroll-handler.mjs';
import { frame, cancelFrame, frameData } from '../../../frameloop/frame.mjs';
const scrollListeners = new WeakMap();
const resizeListeners = new WeakMap();
const onScrollHandlers = new WeakMap();
const getEventTarget = (element) => element === document.documentElement ? window : element;
function scrollInfo(onScroll, { container = document.documentElement, ...options } = {}) {
let containerHandlers = onScrollHandlers.get(container);
/**
* Get the onScroll handlers for this container.
* If one isn't found, create a new one.
*/
if (!containerHandlers) {
containerHandlers = new Set();
onScrollHandlers.set(container, containerHandlers);
}
/**
* Create a new onScroll handler for the provided callback.
*/
const info = createScrollInfo();
const containerHandler = createOnScrollHandler(container, onScroll, info, options);
containerHandlers.add(containerHandler);
/**
* Check if there's a scroll event listener for this container.
* If not, create one.
*/
if (!scrollListeners.has(container)) {
const measureAll = () => {
for (const handler of containerHandlers)
handler.measure();
};
const updateAll = () => {
for (const handler of containerHandlers) {
handler.update(frameData.timestamp);
}
};
const notifyAll = () => {
for (const handler of containerHandlers)
handler.notify();
};
const listener = () => {
frame.read(measureAll, false, true);
frame.read(updateAll, false, true);
frame.update(notifyAll, false, true);
};
scrollListeners.set(container, listener);
const target = getEventTarget(container);
window.addEventListener("resize", listener, { passive: true });
if (container !== document.documentElement) {
resizeListeners.set(container, resize(container, listener));
}
target.addEventListener("scroll", listener, { passive: true });
}
const listener = scrollListeners.get(container);
frame.read(listener, false, true);
return () => {
var _a;
cancelFrame(listener);
/**
* Check if we even have any handlers for this container.
*/
const currentHandlers = onScrollHandlers.get(container);
if (!currentHandlers)
return;
currentHandlers.delete(containerHandler);
if (currentHandlers.size)
return;
/**
* If no more handlers, remove the scroll listener too.
*/
const scrollListener = scrollListeners.get(container);
scrollListeners.delete(container);
if (scrollListener) {
getEventTarget(container).removeEventListener("scroll", scrollListener);
(_a = resizeListeners.get(container)) === null || _a === void 0 ? void 0 : _a();
window.removeEventListener("resize", scrollListener);
}
};
}
export { scrollInfo };
@@ -0,0 +1,37 @@
"use strict";
exports.__esModule = true;
exports.default = void 0;
var SimpleSet = /*#__PURE__*/function () {
function SimpleSet() {
this.v = [];
}
var _proto = SimpleSet.prototype;
_proto.clear = function clear() {
this.v.length = 0;
};
_proto.has = function has(k) {
return this.v.indexOf(k) !== -1;
};
_proto.add = function add(k) {
if (this.has(k)) return;
this.v.push(k);
};
_proto.delete = function _delete(k) {
var idx = this.v.indexOf(k);
if (idx === -1) return false;
this.v.splice(idx, 1);
return true;
};
return SimpleSet;
}();
exports.default = SimpleSet;
module.exports = exports.default;
@@ -0,0 +1,186 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GeneralEncrypt = void 0;
const encrypt_js_1 = require("../flattened/encrypt.js");
const private_symbols_js_1 = require("../../lib/private_symbols.js");
const errors_js_1 = require("../../util/errors.js");
const cek_js_1 = require("../../lib/cek.js");
const is_disjoint_js_1 = require("../../lib/is_disjoint.js");
const encrypt_key_management_js_1 = require("../../lib/encrypt_key_management.js");
const base64url_js_1 = require("../../runtime/base64url.js");
const validate_crit_js_1 = require("../../lib/validate_crit.js");
class IndividualRecipient {
parent;
unprotectedHeader;
key;
options;
constructor(enc, key, options) {
this.parent = enc;
this.key = key;
this.options = options;
}
setUnprotectedHeader(unprotectedHeader) {
if (this.unprotectedHeader) {
throw new TypeError('setUnprotectedHeader can only be called once');
}
this.unprotectedHeader = unprotectedHeader;
return this;
}
addRecipient(...args) {
return this.parent.addRecipient(...args);
}
encrypt(...args) {
return this.parent.encrypt(...args);
}
done() {
return this.parent;
}
}
class GeneralEncrypt {
_plaintext;
_recipients = [];
_protectedHeader;
_unprotectedHeader;
_aad;
constructor(plaintext) {
this._plaintext = plaintext;
}
addRecipient(key, options) {
const recipient = new IndividualRecipient(this, key, { crit: options?.crit });
this._recipients.push(recipient);
return recipient;
}
setProtectedHeader(protectedHeader) {
if (this._protectedHeader) {
throw new TypeError('setProtectedHeader can only be called once');
}
this._protectedHeader = protectedHeader;
return this;
}
setSharedUnprotectedHeader(sharedUnprotectedHeader) {
if (this._unprotectedHeader) {
throw new TypeError('setSharedUnprotectedHeader can only be called once');
}
this._unprotectedHeader = sharedUnprotectedHeader;
return this;
}
setAdditionalAuthenticatedData(aad) {
this._aad = aad;
return this;
}
async encrypt() {
if (!this._recipients.length) {
throw new errors_js_1.JWEInvalid('at least one recipient must be added');
}
if (this._recipients.length === 1) {
const [recipient] = this._recipients;
const flattened = await new encrypt_js_1.FlattenedEncrypt(this._plaintext)
.setAdditionalAuthenticatedData(this._aad)
.setProtectedHeader(this._protectedHeader)
.setSharedUnprotectedHeader(this._unprotectedHeader)
.setUnprotectedHeader(recipient.unprotectedHeader)
.encrypt(recipient.key, { ...recipient.options });
const jwe = {
ciphertext: flattened.ciphertext,
iv: flattened.iv,
recipients: [{}],
tag: flattened.tag,
};
if (flattened.aad)
jwe.aad = flattened.aad;
if (flattened.protected)
jwe.protected = flattened.protected;
if (flattened.unprotected)
jwe.unprotected = flattened.unprotected;
if (flattened.encrypted_key)
jwe.recipients[0].encrypted_key = flattened.encrypted_key;
if (flattened.header)
jwe.recipients[0].header = flattened.header;
return jwe;
}
let enc;
for (let i = 0; i < this._recipients.length; i++) {
const recipient = this._recipients[i];
if (!(0, is_disjoint_js_1.default)(this._protectedHeader, this._unprotectedHeader, recipient.unprotectedHeader)) {
throw new errors_js_1.JWEInvalid('JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint');
}
const joseHeader = {
...this._protectedHeader,
...this._unprotectedHeader,
...recipient.unprotectedHeader,
};
const { alg } = joseHeader;
if (typeof alg !== 'string' || !alg) {
throw new errors_js_1.JWEInvalid('JWE "alg" (Algorithm) Header Parameter missing or invalid');
}
if (alg === 'dir' || alg === 'ECDH-ES') {
throw new errors_js_1.JWEInvalid('"dir" and "ECDH-ES" alg may only be used with a single recipient');
}
if (typeof joseHeader.enc !== 'string' || !joseHeader.enc) {
throw new errors_js_1.JWEInvalid('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');
}
if (!enc) {
enc = joseHeader.enc;
}
else if (enc !== joseHeader.enc) {
throw new errors_js_1.JWEInvalid('JWE "enc" (Encryption Algorithm) Header Parameter must be the same for all recipients');
}
(0, validate_crit_js_1.default)(errors_js_1.JWEInvalid, new Map(), recipient.options.crit, this._protectedHeader, joseHeader);
if (joseHeader.zip !== undefined) {
throw new errors_js_1.JOSENotSupported('JWE "zip" (Compression Algorithm) Header Parameter is not supported.');
}
}
const cek = (0, cek_js_1.default)(enc);
const jwe = {
ciphertext: '',
iv: '',
recipients: [],
tag: '',
};
for (let i = 0; i < this._recipients.length; i++) {
const recipient = this._recipients[i];
const target = {};
jwe.recipients.push(target);
const joseHeader = {
...this._protectedHeader,
...this._unprotectedHeader,
...recipient.unprotectedHeader,
};
const p2c = joseHeader.alg.startsWith('PBES2') ? 2048 + i : undefined;
if (i === 0) {
const flattened = await new encrypt_js_1.FlattenedEncrypt(this._plaintext)
.setAdditionalAuthenticatedData(this._aad)
.setContentEncryptionKey(cek)
.setProtectedHeader(this._protectedHeader)
.setSharedUnprotectedHeader(this._unprotectedHeader)
.setUnprotectedHeader(recipient.unprotectedHeader)
.setKeyManagementParameters({ p2c })
.encrypt(recipient.key, {
...recipient.options,
[private_symbols_js_1.unprotected]: true,
});
jwe.ciphertext = flattened.ciphertext;
jwe.iv = flattened.iv;
jwe.tag = flattened.tag;
if (flattened.aad)
jwe.aad = flattened.aad;
if (flattened.protected)
jwe.protected = flattened.protected;
if (flattened.unprotected)
jwe.unprotected = flattened.unprotected;
target.encrypted_key = flattened.encrypted_key;
if (flattened.header)
target.header = flattened.header;
continue;
}
const { encryptedKey, parameters } = await (0, encrypt_key_management_js_1.default)(recipient.unprotectedHeader?.alg ||
this._protectedHeader?.alg ||
this._unprotectedHeader?.alg, enc, recipient.key, cek, { p2c });
target.encrypted_key = (0, base64url_js_1.encode)(encryptedKey);
if (recipient.unprotectedHeader || parameters)
target.header = { ...recipient.unprotectedHeader, ...parameters };
}
return jwe;
}
}
exports.GeneralEncrypt = GeneralEncrypt;
@@ -0,0 +1,136 @@
import type { ReplayNetworkRequestOrResponse } from './request';
export type AllPerformanceEntry = PerformancePaintTiming | PerformanceResourceTiming | PerformanceNavigationTiming;
export type PerformancePaintTiming = PerformanceEntry;
export type PerformanceNavigationTiming = PerformanceEntry & PerformanceResourceTiming & {
type: string;
transferSize: number;
/**
* A DOMHighResTimeStamp representing the time immediately before the user agent
* sets the document's readyState to "interactive".
*/
domInteractive: number;
/**
* A DOMHighResTimeStamp representing the time immediately before the current
* document's DOMContentLoaded event handler starts.
*/
domContentLoadedEventStart: number;
/**
* A DOMHighResTimeStamp representing the time immediately after the current
* document's DOMContentLoaded event handler completes.
*/
domContentLoadedEventEnd: number;
/**
* A DOMHighResTimeStamp representing the time immediately before the current
* document's load event handler starts.
*/
loadEventStart: number;
/**
* A DOMHighResTimeStamp representing the time immediately after the current
* document's load event handler completes.
*/
loadEventEnd: number;
/**
* A DOMHighResTimeStamp representing the time immediately before the user agent
* sets the document's readyState to "complete".
*/
domComplete: number;
/**
* A number representing the number of redirects since the last non-redirect
* navigation in the current browsing context.
*/
redirectCount: number;
};
export type ExperimentalPerformanceResourceTiming = PerformanceResourceTiming & {
responseStatus?: number;
};
export type PaintData = undefined;
/**
* See https://developer.mozilla.org/en-US/docs/Web/API/PerformanceNavigationTiming
*
* Note `navigation.push` will not have any data
*/
export type NavigationData = Partial<Pick<PerformanceNavigationTiming, 'decodedBodySize' | 'encodedBodySize' | 'duration' | 'domInteractive' | 'domContentLoadedEventEnd' | 'domContentLoadedEventStart' | 'loadEventStart' | 'loadEventEnd' | 'domComplete' | 'redirectCount'>> & {
/**
* Transfer size of resource
*/
size?: number;
};
export type ResourceData = Pick<PerformanceResourceTiming, 'decodedBodySize' | 'encodedBodySize'> & {
/**
* Transfer size of resource
*/
size: number;
/**
* HTTP status code. Note this is experimental and not available on all browsers.
*/
statusCode?: number;
};
export interface WebVitalData {
/**
* Render time (in ms) of the LCP
*/
value: number;
size: number;
/**
* The rating as to whether the metric value is within the "good",
* "needs improvement", or "poor" thresholds of the metric.
*/
rating: 'good' | 'needs-improvement' | 'poor';
/**
* The recording id of the web vital nodes. -1 if not found
*/
nodeIds?: number[];
/**
* The layout shifts of a CLS metric
*/
attributions?: {
value: number;
nodeIds: number[] | undefined;
}[];
}
/**
* Entries that come from window.performance
*/
export type AllPerformanceEntryData = PaintData | NavigationData | ResourceData | WebVitalData;
export interface MemoryData {
memory: {
jsHeapSizeLimit: number;
totalJSHeapSize: number;
usedJSHeapSize: number;
};
}
export interface NetworkRequestData {
method?: string;
statusCode?: number;
requestBodySize?: number;
responseBodySize?: number;
request?: ReplayNetworkRequestOrResponse;
response?: ReplayNetworkRequestOrResponse;
}
export interface HistoryData {
previous: string | undefined;
}
export type AllEntryData = AllPerformanceEntryData | MemoryData | NetworkRequestData | HistoryData;
export interface ReplayPerformanceEntry<T> {
/**
* One of these types https://developer.mozilla.org/en-US/docs/Web/API/PerformanceEntry/entryType
*/
type: string;
/**
* A more specific description of the performance entry
*/
name: string;
/**
* The start timestamp in seconds
*/
start: number;
/**
* The end timestamp in seconds
*/
end: number;
/**
* Additional unstructured data to be included
*/
data: T;
}
//# sourceMappingURL=performance.d.ts.map
@@ -0,0 +1,33 @@
import { entityKind } from "../../entity.js";
import { QueryPromise } from "../../query-promise.js";
class GelRaw extends QueryPromise {
constructor(execute, sql, query, mapBatchResult) {
super();
this.execute = execute;
this.sql = sql;
this.query = query;
this.mapBatchResult = mapBatchResult;
}
static [entityKind] = "GelRaw";
/** @internal */
getSQL() {
return this.sql;
}
getQuery() {
return this.query;
}
mapResult(result, isFromBatch) {
return isFromBatch ? this.mapBatchResult(result) : result;
}
_prepare() {
return this;
}
/** @internal */
isResponseInArrayMode() {
return false;
}
}
export {
GelRaw
};
//# sourceMappingURL=raw.js.map
@@ -0,0 +1,5 @@
export declare const getDecadeWithOptions: import("./types.js").FPFn2<
number,
import("../getDecade.js").GetDecadeOptions | undefined,
string | number | Date
>;
@@ -0,0 +1,40 @@
var baseIsNative = require('./_baseIsNative'),
isMaskable = require('./_isMaskable');
/** Error message constants. */
var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.';
/**
* Checks if `value` is a pristine native function.
*
* **Note:** This method can't reliably detect native functions in the presence
* of the core-js package because core-js circumvents this kind of detection.
* Despite multiple requests, the core-js maintainer has made it clear: any
* attempt to fix the detection will be obstructed. As a result, we're left
* with little choice but to throw an error. Unfortunately, this also affects
* packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
* which rely on core-js.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a native function,
* else `false`.
* @example
*
* _.isNative(Array.prototype.push);
* // => true
*
* _.isNative(_);
* // => false
*/
function isNative(value) {
if (isMaskable(value)) {
throw new Error(CORE_ERROR_TEXT);
}
return baseIsNative(value);
}
module.exports = isNative;
@@ -0,0 +1,61 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.resolveBrowserslistConfigFile = resolveBrowserslistConfigFile;
exports.resolveTargets = resolveTargets;
function _path() {
const data = require("path");
_path = function () {
return data;
};
return data;
}
function _helperCompilationTargets() {
const data = require("@babel/helper-compilation-targets");
_helperCompilationTargets = function () {
return data;
};
return data;
}
({});
function resolveBrowserslistConfigFile(browserslistConfigFile, configFileDir) {
return _path().resolve(configFileDir, browserslistConfigFile);
}
function resolveTargets(options, root) {
const optTargets = options.targets;
let targets;
if (typeof optTargets === "string" || Array.isArray(optTargets)) {
targets = {
browsers: optTargets
};
} else if (optTargets) {
if ("esmodules" in optTargets) {
targets = Object.assign({}, optTargets, {
esmodules: "intersect"
});
} else {
targets = optTargets;
}
}
const {
browserslistConfigFile
} = options;
let configFile;
let ignoreBrowserslistConfig = false;
if (typeof browserslistConfigFile === "string") {
configFile = browserslistConfigFile;
} else {
ignoreBrowserslistConfig = browserslistConfigFile === false;
}
return (0, _helperCompilationTargets().default)(targets, {
ignoreBrowserslistConfig,
configFile,
configPath: root,
browserslistEnv: options.browserslistEnv
});
}
0 && 0;
//# sourceMappingURL=resolve-targets.js.map
@@ -0,0 +1,9 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GraphQLLong = exports.GraphQLLongConfig = void 0;
const graphql_1 = require("graphql");
const BigInt_js_1 = require("./BigInt.js");
exports.GraphQLLongConfig = Object.assign({}, BigInt_js_1.GraphQLBigIntConfig, {
name: 'Long',
});
exports.GraphQLLong = new graphql_1.GraphQLScalarType(exports.GraphQLLongConfig);
@@ -0,0 +1,270 @@
/* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/no-unsafe-enum-comparison */ /**
* Created by Ivo Meißner on 28.07.17.
*/ import { getNamedType, GraphQLError, GraphQLInterfaceType, GraphQLObjectType, isAbstractType, isCompositeType, Kind, TypeInfo, ValidationContext, visit, visitWithTypeInfo } from 'graphql';
import { getArgumentValues, getDirectiveValues, getVariableValues } from 'graphql/execution/values.js';
function queryComplexityMessage(max, actual) {
return `The query exceeds the maximum complexity of ${max}. ` + `Actual complexity is ${actual}`;
}
export function getComplexity(options) {
const typeInfo = new TypeInfo(options.schema);
const errors = [];
const context = new ValidationContext(options.schema, options.query, typeInfo, (error)=>errors.push(error));
const visitor = new QueryComplexity(context, {
// Maximum complexity does not matter since we're only interested in the calculated complexity.
context: options.context,
estimators: options.estimators,
maximumComplexity: Infinity,
operationName: options.operationName,
variables: options.variables
});
visit(options.query, visitWithTypeInfo(typeInfo, visitor));
// Throw first error if any
if (errors.length) {
throw errors.pop();
}
return visitor.complexity;
}
export class QueryComplexity {
complexity;
context;
estimators;
includeDirectiveDef;
OperationDefinition;
options;
requestContext;
skipDirectiveDef;
variableValues;
constructor(context, options){
if (!(typeof options.maximumComplexity === 'number' && options.maximumComplexity > 0)) {
throw new Error('Maximum query complexity must be a positive number');
}
this.context = context;
this.complexity = 0;
this.options = options;
this.includeDirectiveDef = this.context.getSchema().getDirective('include');
this.skipDirectiveDef = this.context.getSchema().getDirective('skip');
this.estimators = options.estimators;
this.variableValues = {};
this.requestContext = options.context;
this.OperationDefinition = {
enter: this.onOperationDefinitionEnter,
leave: this.onOperationDefinitionLeave
};
}
createError() {
if (typeof this.options.createError === 'function') {
return this.options.createError(this.options.maximumComplexity, this.complexity);
}
return new GraphQLError(queryComplexityMessage(this.options.maximumComplexity, this.complexity));
}
nodeComplexity(node, typeDef) {
if (node.selectionSet) {
let fields = {};
if (typeDef instanceof GraphQLObjectType || typeDef instanceof GraphQLInterfaceType) {
fields = typeDef.getFields();
}
// Determine all possible types of the current node
let possibleTypeNames;
if (isAbstractType(typeDef)) {
possibleTypeNames = this.context.getSchema().getPossibleTypes(typeDef).map((t)=>t.name);
} else {
possibleTypeNames = [
typeDef.name
];
}
// Collect complexities for all possible types individually
const selectionSetComplexities = node.selectionSet.selections.reduce((complexities, childNode)=>{
// let nodeComplexity = 0;
let innerComplexities = complexities;
let includeNode = true;
let skipNode = false;
for (const directive of childNode.directives ?? []){
const directiveName = directive.name.value;
switch(directiveName){
case 'include':
{
const values = getDirectiveValues(this.includeDirectiveDef, childNode, this.variableValues || {});
if (typeof values.if === 'boolean') {
includeNode = values.if;
}
break;
}
case 'skip':
{
const values = getDirectiveValues(this.skipDirectiveDef, childNode, this.variableValues || {});
if (typeof values.if === 'boolean') {
skipNode = values.if;
}
break;
}
}
}
if (!includeNode || skipNode) {
return complexities;
}
switch(childNode.kind){
case Kind.FIELD:
{
const field = fields[childNode.name.value];
// Invalid field, should be caught by other validation rules
if (!field) {
break;
}
const fieldType = getNamedType(field.type);
// Get arguments
let args;
try {
args = getArgumentValues(field, childNode, this.variableValues || {});
} catch (e) {
this.context.reportError(e);
return complexities;
}
// Check if we have child complexity
let childComplexity = 0;
if (isCompositeType(fieldType)) {
childComplexity = this.nodeComplexity(childNode, fieldType);
}
// Run estimators one after another and return first valid complexity
// score
const estimatorArgs = {
type: typeDef,
args,
childComplexity,
context: this.requestContext,
field,
node: childNode
};
const validScore = this.estimators.find((estimator)=>{
const tmpComplexity = estimator(estimatorArgs);
if (typeof tmpComplexity === 'number' && !isNaN(tmpComplexity)) {
innerComplexities = addComplexities(tmpComplexity, complexities, possibleTypeNames);
return true;
}
return false;
});
if (!validScore) {
this.context.reportError(new GraphQLError(`No complexity could be calculated for field ${typeDef.name}.${field.name}. ` + 'At least one complexity estimator has to return a complexity score.'));
return complexities;
}
break;
}
case Kind.FRAGMENT_SPREAD:
{
const fragment = this.context.getFragment(childNode.name.value);
// Unknown fragment, should be caught by other validation rules
if (!fragment) {
break;
}
const fragmentType = this.context.getSchema().getType(fragment.typeCondition.name.value);
// Invalid fragment type, ignore. Should be caught by other validation rules
if (!isCompositeType(fragmentType)) {
break;
}
const nodeComplexity = this.nodeComplexity(fragment, fragmentType);
if (isAbstractType(fragmentType)) {
// Add fragment complexity for all possible types
innerComplexities = addComplexities(nodeComplexity, complexities, this.context.getSchema().getPossibleTypes(fragmentType).map((t)=>t.name));
} else {
// Add complexity for object type
innerComplexities = addComplexities(nodeComplexity, complexities, [
fragmentType.name
]);
}
break;
}
case Kind.INLINE_FRAGMENT:
{
let inlineFragmentType = typeDef;
if (childNode.typeCondition && childNode.typeCondition.name) {
inlineFragmentType = this.context.getSchema().getType(childNode.typeCondition.name.value);
if (!isCompositeType(inlineFragmentType)) {
break;
}
}
const nodeComplexity = this.nodeComplexity(childNode, inlineFragmentType);
if (isAbstractType(inlineFragmentType)) {
// Add fragment complexity for all possible types
innerComplexities = addComplexities(nodeComplexity, complexities, this.context.getSchema().getPossibleTypes(inlineFragmentType).map((t)=>t.name));
} else {
// Add complexity for object type
innerComplexities = addComplexities(nodeComplexity, complexities, [
inlineFragmentType.name
]);
}
break;
}
default:
{
innerComplexities = addComplexities(this.nodeComplexity(childNode, typeDef), complexities, possibleTypeNames);
break;
}
}
return innerComplexities;
}, {});
// Only return max complexity of all possible types
if (!selectionSetComplexities) {
return NaN;
}
return Math.max(...Object.values(selectionSetComplexities), 0);
}
return 0;
}
onOperationDefinitionEnter(operation) {
if (typeof this.options.operationName === 'string' && this.options.operationName !== operation.name.value) {
return;
}
// Get variable values from variables that are passed from options, merged
// with default values defined in the operation
const { coerced, errors } = getVariableValues(this.context.getSchema(), // We have to create a new array here because input argument is not readonly in graphql ~14.6.0
operation.variableDefinitions ? [
...operation.variableDefinitions
] : [], this.options.variables ?? {});
if (errors && errors.length) {
// We have input validation errors, report errors and abort
errors.forEach((error)=>this.context.reportError(error));
return;
}
this.variableValues = coerced;
switch(operation.operation){
case 'mutation':
this.complexity += this.nodeComplexity(operation, this.context.getSchema().getMutationType());
break;
case 'query':
this.complexity += this.nodeComplexity(operation, this.context.getSchema().getQueryType());
break;
case 'subscription':
this.complexity += this.nodeComplexity(operation, this.context.getSchema().getSubscriptionType());
break;
default:
throw new Error(`Query complexity could not be calculated for operation of type ${operation.operation}`);
}
}
onOperationDefinitionLeave(operation) {
if (typeof this.options.operationName === 'string' && this.options.operationName !== operation.name.value) {
return;
}
if (this.options.onComplete) {
this.options.onComplete(this.complexity);
}
if (this.complexity > this.options.maximumComplexity) {
return this.context.reportError(this.createError());
}
}
}
/**
* Adds a complexity to the complexity map for all possible types
* @param complexity
* @param complexityMap
* @param possibleTypes
*/ function addComplexities(complexity, complexityMap, possibleTypes) {
for (const type of possibleTypes){
if (Object.prototype.hasOwnProperty.call(complexityMap, type)) {
complexityMap[type] += complexity;
} else {
complexityMap[type] = complexity;
}
}
return complexityMap;
}
//# sourceMappingURL=QueryComplexity.js.map
@@ -0,0 +1,3 @@
import type { PayloadHandler } from '../../config/types.js';
export declare const initHandler: PayloadHandler;
//# sourceMappingURL=init.d.ts.map
@@ -0,0 +1,2 @@
export { lt } from '@payloadcms/translations/languages/lt';
//# sourceMappingURL=lt.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"arrow-up-0-1.js","sources":["../../../src/icons/arrow-up-0-1.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ArrowUp01\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMyA4IDQtNCA0IDQiIC8+CiAgPHBhdGggZD0iTTcgNHYxNiIgLz4KICA8cmVjdCB4PSIxNSIgeT0iNCIgd2lkdGg9IjQiIGhlaWdodD0iNiIgcnk9IjIiIC8+CiAgPHBhdGggZD0iTTE3IDIwdi02aC0yIiAvPgogIDxwYXRoIGQ9Ik0xNSAyMGg0IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/arrow-up-0-1\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 ArrowUp01 = createLucideIcon('ArrowUp01', [\n ['path', { d: 'm3 8 4-4 4 4', key: '11wl7u' }],\n ['path', { d: 'M7 4v16', key: '1glfcx' }],\n ['rect', { x: '15', y: '4', width: '4', height: '6', ry: '2', key: '1bwicg' }],\n ['path', { d: 'M17 20v-6h-2', key: '1qp1so' }],\n ['path', { d: 'M15 20h4', key: '1j968p' }],\n]);\n\nexport default ArrowUp01;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,CAAA,CAAA;AAAA,CAAA,CAC9C,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,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,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAG,MAAM,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,QAAQ,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC7E,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,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,14 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true,
});
exports.isObjectLike = isObjectLike;
/**
* Return true if `value` is object-like. A value is object-like if it's not
* `null` and has a `typeof` result of "object".
*/
function isObjectLike(value) {
return typeof value == 'object' && value !== null;
}
@@ -0,0 +1,9 @@
import type { Locale } from "./types.js";
/**
* @category Locales
* @summary Norwegian Nynorsk locale.
* @language Norwegian Nynorsk
* @iso-639-2 nno
* @author Mats Byrkjeland [@draperunner](https://github.com/draperunner)
*/
export declare const nn: Locale;
@@ -0,0 +1 @@
{"version":3,"file":"_required.js","sourceRoot":"","sources":["../../src/definitions/_required.ts"],"names":[],"mappings":";;AAKA,SAAwB,cAAc,CACpC,OAAoB;IAEpB,OAAO,GAAG,EAAE,CAAC,CAAC;QACZ,OAAO;QACP,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,OAAO;QACnB,KAAK,CAAC,MAAgB;YACpB,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;gBAAE,OAAO,IAAI,CAAA;YACpC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;gBAAE,OAAO,EAAC,QAAQ,EAAE,MAAM,EAAC,CAAA;YAClD,MAAM,IAAI,GAAG,OAAO,KAAK,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAA;YAC1D,OAAO,EAAC,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAC,CAAC,CAAC,EAAC,CAAA;QACvD,CAAC;QACD,UAAU,EAAE;YACV,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAC;SACxB;KACF,CAAC,CAAA;AACJ,CAAC;AAlBD,iCAkBC"}
@@ -0,0 +1,19 @@
/**
* @name endOfToday
* @category Day Helpers
* @summary Return the end of today.
* @pure false
*
* @description
* Return the end of today.
*
* @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).
*
* @returns The end of today
*
* @example
* // If today is 6 October 2014:
* const result = endOfToday()
* //=> Mon Oct 6 2014 23:59:59.999
*/
export declare function endOfToday(): Date;
@@ -0,0 +1,4 @@
import type { AdminViewServerProps } from 'payload';
import React from 'react';
export declare function DashboardView(props: AdminViewServerProps): Promise<React.JSX.Element>;
//# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,9 @@
// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
import { differenceInMinutes as fn } from "../differenceInMinutes.js";
import { convertToFP } from "./_lib/convertToFP.js";
export const differenceInMinutesWithOptions = convertToFP(fn, 3);
// Fallback for modularized imports:
export default differenceInMinutesWithOptions;
@@ -0,0 +1,149 @@
"use strict";
exports.match = void 0;
var _index = require("../../_lib/buildMatchFn.js");
var _index2 = require("../../_lib/buildMatchPatternFn.js");
const matchOrdinalNumberPattern = /^(\d+)\./i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(pr\.n\.e\.|AD)/i,
abbreviated: /^(pr\.\s?Kr\.|po\.\s?Kr\.)/i,
wide: /^(Prije Krista|prije nove ere|Poslije Krista|nova era)/i,
};
const parseEraPatterns = {
any: [/^pr/i, /^(po|nova)/i],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^[1234]\.\s?kv\.?/i,
wide: /^[1234]\. kvartal/i,
};
const parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i],
};
const matchMonthPatterns = {
narrow: /^(10|11|12|[123456789])\./i,
abbreviated: /^(sij|velj|(ožu|ozu)|tra|svi|lip|srp|kol|ruj|lis|stu|pro)/i,
wide: /^((siječanj|siječnja|sijecanj|sijecnja)|(veljača|veljače|veljaca|veljace)|(ožujak|ožujka|ozujak|ozujka)|(travanj|travnja)|(svibanj|svibnja)|(lipanj|lipnja)|(srpanj|srpnja)|(kolovoz|kolovoza)|(rujan|rujna)|(listopad|listopada)|(studeni|studenog)|(prosinac|prosinca))/i,
};
const parseMonthPatterns = {
narrow: [
/1/i,
/2/i,
/3/i,
/4/i,
/5/i,
/6/i,
/7/i,
/8/i,
/9/i,
/10/i,
/11/i,
/12/i,
],
abbreviated: [
/^sij/i,
/^velj/i,
/^(ožu|ozu)/i,
/^tra/i,
/^svi/i,
/^lip/i,
/^srp/i,
/^kol/i,
/^ruj/i,
/^lis/i,
/^stu/i,
/^pro/i,
],
wide: [
/^sij/i,
/^velj/i,
/^(ožu|ozu)/i,
/^tra/i,
/^svi/i,
/^lip/i,
/^srp/i,
/^kol/i,
/^ruj/i,
/^lis/i,
/^stu/i,
/^pro/i,
],
};
const matchDayPatterns = {
narrow: /^[npusčc]/i,
short: /^(ned|pon|uto|sri|(čet|cet)|pet|sub)/i,
abbreviated: /^(ned|pon|uto|sri|(čet|cet)|pet|sub)/i,
wide: /^(nedjelja|ponedjeljak|utorak|srijeda|(četvrtak|cetvrtak)|petak|subota)/i,
};
const parseDayPatterns = {
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],
};
const matchDayPeriodPatterns = {
any: /^(am|pm|ponoc|ponoć|(po)?podne|navecer|navečer|noću|poslije podne|ujutro)/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^a/i,
pm: /^p/i,
midnight: /^pono/i,
noon: /^pod/i,
morning: /jutro/i,
afternoon: /(poslije\s|po)+podne/i,
evening: /(navece|naveče)/i,
night: /(nocu|noću)/i,
},
};
const match = (exports.match = {
ordinalNumber: (0, _index2.buildMatchPatternFn)({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: (value) => parseInt(value, 10),
}),
era: (0, _index.buildMatchFn)({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any",
}),
quarter: (0, _index.buildMatchFn)({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: (index) => index + 1,
}),
month: (0, _index.buildMatchFn)({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "wide",
}),
day: (0, _index.buildMatchFn)({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: (0, _index.buildMatchFn)({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
});
@@ -0,0 +1,298 @@
import { generateFilePathOrURL } from './generateFilePathOrURL.js';
import { mimeTypeValidator } from './mimeTypeValidator.js';
export const getBaseUploadFields = ({ collection, config })=>{
const uploadOptions = typeof collection.upload === 'object' ? collection.upload : {};
const mimeType = {
name: 'mimeType',
type: 'text',
admin: {
hidden: true,
readOnly: true
},
label: 'MIME Type'
};
const thumbnailURL = {
name: 'thumbnailURL',
type: 'text',
admin: {
hidden: true,
readOnly: true
},
hooks: {
afterRead: [
({ originalDoc, req })=>{
const adminThumbnail = typeof collection.upload !== 'boolean' ? collection.upload?.adminThumbnail : undefined;
if (typeof adminThumbnail === 'function') {
return adminThumbnail({
doc: originalDoc
});
}
return generateFilePathOrURL({
collectionSlug: collection.slug,
config,
filename: typeof adminThumbnail === 'string' ? originalDoc.sizes?.[adminThumbnail]?.filename : undefined,
relative: false,
serverURL: req.payload.config.serverURL,
urlOrPath: typeof adminThumbnail === 'string' ? originalDoc.sizes?.[adminThumbnail]?.url : undefined
});
}
]
},
label: 'Thumbnail URL'
};
const width = {
name: 'width',
type: 'number',
admin: {
hidden: true,
readOnly: true
},
label: ({ t })=>t('upload:width')
};
const height = {
name: 'height',
type: 'number',
admin: {
hidden: true,
readOnly: true
},
label: ({ t })=>t('upload:height')
};
const filesize = {
name: 'filesize',
type: 'number',
admin: {
hidden: true,
readOnly: true
},
label: ({ t })=>t('upload:fileSize')
};
const filename = {
name: 'filename',
type: 'text',
admin: {
disableBulkEdit: true,
hidden: true,
readOnly: true
},
index: true,
label: ({ t })=>t('upload:fileName')
};
// Only set unique: true if the collection does not have a compound index
if (collection.upload === true || typeof collection.upload === 'object' && !collection.upload.filenameCompoundIndex) {
filename.unique = true;
}
const url = {
name: 'url',
type: 'text',
admin: {
hidden: true,
readOnly: true
},
label: 'URL'
};
let uploadFields = [
{
...url,
hooks: {
afterRead: [
({ data, originalDoc, req, value })=>generateFilePathOrURL({
collectionSlug: collection.slug,
config,
filename: data?.filename || originalDoc?.filename,
relative: false,
serverURL: req.payload.config.serverURL,
urlOrPath: value
})
],
beforeChange: [
({ collection, data, originalDoc, req, value })=>generateFilePathOrURL({
collectionSlug: collection?.slug,
config,
filename: data?.filename || originalDoc?.filename,
relative: true,
serverURL: req.payload.config.serverURL,
urlOrPath: value
})
]
}
},
thumbnailURL,
filename,
mimeType,
filesize,
width,
height
];
// Add focal point fields if not disabled
if (uploadOptions.focalPoint !== false || uploadOptions.imageSizes || uploadOptions.resizeOptions) {
uploadFields = uploadFields.concat([
'focalX',
'focalY'
].map((name)=>{
return {
name,
type: 'number',
admin: {
disableGroupBy: true,
disableListColumn: true,
disableListFilter: true,
hidden: true
}
};
}));
}
if (uploadOptions.mimeTypes) {
mimeType.validate = mimeTypeValidator(uploadOptions.mimeTypes);
}
// In Payload v4, image size subfields (`url`, `width`, `height`, etc.) should
// default to `disableGroupBy: true`, `disableListColumn: true` and `disableListFilter: true`
// to avoid cluttering the collection list view and filters by default.
if (uploadOptions.imageSizes) {
uploadFields = uploadFields.concat([
{
name: 'sizes',
type: 'group',
admin: {
hidden: true
},
fields: uploadOptions.imageSizes.map((size)=>({
name: size.name,
type: 'group',
admin: {
hidden: true,
...size.admin?.disableGroupBy && {
disableGroupBy: true
},
...size.admin?.disableListColumn && {
disableListColumn: true
},
...size.admin?.disableListFilter && {
disableListFilter: true
}
},
fields: [
{
...url,
admin: {
...url.admin,
...size.admin?.disableGroupBy && {
disableGroupBy: true
},
...size.admin?.disableListColumn && {
disableListColumn: true
},
...size.admin?.disableListFilter && {
disableListFilter: true
}
},
hooks: {
afterRead: [
({ collection, data, originalDoc, req, value })=>generateFilePathOrURL({
collectionSlug: collection?.slug,
config,
filename: data?.sizes?.[size.name]?.filename || originalDoc?.sizes?.[size.name]?.filename,
relative: false,
serverURL: req.payload.config.serverURL,
urlOrPath: value
})
],
beforeChange: [
({ collection, data, originalDoc, req, value })=>generateFilePathOrURL({
collectionSlug: collection?.slug,
config,
filename: data?.sizes?.[size.name]?.filename || originalDoc?.sizes?.[size.name]?.filename,
relative: true,
serverURL: req.payload.config.serverURL,
urlOrPath: value
})
]
}
},
{
...width,
admin: {
...width.admin,
...size.admin?.disableGroupBy && {
disableGroupBy: true
},
...size.admin?.disableListColumn && {
disableListColumn: true
},
...size.admin?.disableListFilter && {
disableListFilter: true
}
}
},
{
...height,
admin: {
...height.admin,
...size.admin?.disableGroupBy && {
disableGroupBy: true
},
...size.admin?.disableListColumn && {
disableListColumn: true
},
...size.admin?.disableListFilter && {
disableListFilter: true
}
}
},
{
...mimeType,
admin: {
...mimeType.admin,
...size.admin?.disableGroupBy && {
disableGroupBy: true
},
...size.admin?.disableListColumn && {
disableListColumn: true
},
...size.admin?.disableListFilter && {
disableListFilter: true
}
}
},
{
...filesize,
admin: {
...filesize.admin,
...size.admin?.disableGroupBy && {
disableGroupBy: true
},
...size.admin?.disableListColumn && {
disableListColumn: true
},
...size.admin?.disableListFilter && {
disableListFilter: true
}
}
},
{
...filename,
admin: {
...filename.admin,
...size.admin?.disableGroupBy && {
disableGroupBy: true
},
...size.admin?.disableListColumn && {
disableListColumn: true
},
...size.admin?.disableListFilter && {
disableListFilter: true
}
},
unique: false
}
],
label: size.name
})),
label: ({ t })=>t('upload:sizes')
}
]);
}
return uploadFields;
};
//# sourceMappingURL=getBaseFields.js.map
@@ -0,0 +1 @@
{"version":3,"file":"deepMerge.d.ts","sourceRoot":"","sources":["../../src/utilities/deepMerge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,CAAC,GAAG,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,CAczE"}
@@ -0,0 +1,3 @@
import type { MigrationConfig } from "../migrator.cjs";
import type { PostgresJsDatabase } from "./driver.cjs";
export declare function migrate<TSchema extends Record<string, unknown>>(db: PostgresJsDatabase<TSchema>, config: MigrationConfig): Promise<void>;
@@ -0,0 +1,10 @@
import { InstrumentationBase, InstrumentationConfig, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
export declare class GenericPoolInstrumentation extends InstrumentationBase {
private _isDisabled;
constructor(config?: InstrumentationConfig);
init(): InstrumentationNodeModuleDefinition[];
private _acquirePatcher;
private _poolWrapper;
private _acquireWithCallbacksPatcher;
}
//# sourceMappingURL=instrumentation.d.ts.map
@@ -0,0 +1,2 @@
import type { Modifier } from '@dnd-kit/core';
export declare const restrictToFirstScrollableAncestor: Modifier;
@@ -0,0 +1 @@
{"version":3,"file":"view.js","sources":["../../../src/icons/view.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name View\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjEgMTd2MmEyIDIgMCAwIDEtMiAySDVhMiAyIDAgMCAxLTItMnYtMiIgLz4KICA8cGF0aCBkPSJNMjEgN1Y1YTIgMiAwIDAgMC0yLTJINWEyIDIgMCAwIDAtMiAydjIiIC8+CiAgPGNpcmNsZSBjeD0iMTIiIGN5PSIxMiIgcj0iMSIgLz4KICA8cGF0aCBkPSJNMTguOTQ0IDEyLjMzYTEgMSAwIDAgMCAwLS42NiA3LjUgNy41IDAgMCAwLTEzLjg4OCAwIDEgMSAwIDAgMCAwIC42NiA3LjUgNy41IDAgMCAwIDEzLjg4OCAwIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/view\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 View = createLucideIcon('View', [\n ['path', { d: 'M21 17v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-2', key: 'mrq65r' }],\n ['path', { d: 'M21 7V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2', key: 'be3xqs' }],\n ['circle', { cx: '12', cy: '12', r: '1', key: '41hilf' }],\n [\n 'path',\n {\n d: 'M18.944 12.33a1 1 0 0 0 0-.66 7.5 7.5 0 0 0-13.888 0 1 1 0 0 0 0 .66 7.5 7.5 0 0 0 13.888 0',\n key: '11ak4c',\n },\n ],\n]);\n\nexport default View;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,iBAAiB,MAAQ,CAAA,CAAA,CAAA;AAAA,CAAA,CACpC,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,CAA2C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CACxE,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,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,14 @@
import type { DrizzleSqliteDODatabase } from "./driver.cjs";
interface MigrationConfig {
journal: {
entries: {
idx: number;
when: number;
tag: string;
breakpoints: boolean;
}[];
};
migrations: Record<string, string>;
}
export declare function migrate<TSchema extends Record<string, unknown>>(db: DrizzleSqliteDODatabase<TSchema>, config: MigrationConfig): Promise<void>;
export {};
@@ -0,0 +1,19 @@
/**
* @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 WholeWord = createLucideIcon("WholeWord", [
["circle", { cx: "7", cy: "12", r: "3", key: "12clwm" }],
["path", { d: "M10 9v6", key: "17i7lo" }],
["circle", { cx: "17", cy: "12", r: "3", key: "gl7c2s" }],
["path", { d: "M14 7v8", key: "dl84cr" }],
["path", { d: "M22 17v1c0 .5-.5 1-1 1H3c-.5 0-1-.5-1-1v-1", key: "lt2kga" }]
]);
export { WholeWord as default };
//# sourceMappingURL=whole-word.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 SquareChevronUp = createLucideIcon("SquareChevronUp", [
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
["path", { d: "m8 14 4-4 4 4", key: "fy2ptz" }]
]);
export { SquareChevronUp as default };
//# sourceMappingURL=square-chevron-up.js.map
@@ -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 ImageMinus = createLucideIcon("ImageMinus", [
["path", { d: "M21 9v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7", key: "m87ecr" }],
["line", { x1: "16", x2: "22", y1: "5", y2: "5", key: "ez7e4s" }],
["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }],
["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }]
]);
export { ImageMinus as default };
//# sourceMappingURL=image-minus.js.map
@@ -0,0 +1,23 @@
import { jsx as _jsx } from "react/jsx-runtime";
import * as React from 'react';
const baseClass = 'minimize-maximize';
export const MinimizeMaximizeIcon = ({
className,
isMinimized
}) => {
const classes = [baseClass, isMinimized ? `${baseClass}--minimized` : `${baseClass}--maximized`, className].filter(Boolean).join(' ');
return /*#__PURE__*/_jsx("svg", {
className: classes,
height: "20",
stroke: "currentColor",
viewBox: "0 0 20 20",
width: "20",
xmlns: "http://www.w3.org/2000/svg",
children: isMinimized ? /*#__PURE__*/_jsx("path", {
d: "M7.33333 4H5.33333C4.97971 4 4.64057 4.14048 4.39052 4.39052C4.14048 4.64057 4 4.97971 4 5.33333V7.33333M16 7.33333V5.33333C16 4.97971 15.8595 4.64057 15.6095 4.39052C15.3594 4.14048 15.0203 4 14.6667 4H12.6667M4 12.6667V14.6667C4 15.0203 4.14048 15.3594 4.39052 15.6095C4.64057 15.8595 4.97971 16 5.33333 16H7.33333M12.6667 16H14.6667C15.0203 16 15.3594 15.8595 15.6095 15.6095C15.8595 15.3594 16 15.0203 16 14.6667V12.6667"
}) : /*#__PURE__*/_jsx("path", {
d: "M7.33333 4V6C7.33333 6.35362 7.19286 6.69276 6.94281 6.94281C6.69276 7.19286 6.35362 7.33333 6 7.33333H4M16 7.33333H14C13.6464 7.33333 13.3072 7.19286 13.0572 6.94281C12.8071 6.69276 12.6667 6.35362 12.6667 6V4M4 12.6667H6C6.35362 12.6667 6.69276 12.8071 6.94281 13.0572C7.19286 13.3072 7.33333 13.6464 7.33333 14V16M12.6667 16V14C12.6667 13.6464 12.8071 13.3072 13.0572 13.0572C13.3072 12.8071 13.6464 12.6667 14 12.6667H16"
})
});
};
//# sourceMappingURL=index.js.map
@@ -0,0 +1,39 @@
"use strict";
exports.addISOWeekYears = addISOWeekYears;
var _index = require("./getISOWeekYear.cjs");
var _index2 = require("./setISOWeekYear.cjs");
/**
* The {@link addISOWeekYears} function options.
*/
/**
* @name addISOWeekYears
* @category ISO Week-Numbering Year Helpers
* @summary Add the specified number of ISO week-numbering years to the given date.
*
* @description
* Add the specified number of ISO week-numbering years to the given date.
*
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_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 amount - The amount of ISO week-numbering years to be added.
* @param options - An object with options
*
* @returns The new date with the ISO week-numbering years added
*
* @example
* // Add 5 ISO week-numbering years to 2 July 2010:
* const result = addISOWeekYears(new Date(2010, 6, 2), 5)
* //=> Fri Jun 26 2015 00:00:00
*/
function addISOWeekYears(date, amount, options) {
return (0, _index2.setISOWeekYear)(
date,
(0, _index.getISOWeekYear)(date, options) + amount,
options,
);
}
@@ -0,0 +1,46 @@
import type { ConstructableDate, ContextFn, DateArg } from "./types.js";
/**
* @name toDate
* @category Common Helpers
* @summary Convert the given argument to an instance of Date.
*
* @description
* Convert the given argument to an instance of Date.
*
* If the argument is an instance of Date, the function returns its clone.
*
* If the argument is a number, it is treated as a timestamp.
*
* If the argument is none of the above, the function returns Invalid Date.
*
* Starting from v3.7.0, it clones a date using `[Symbol.for("constructDateFrom")]`
* enabling to transfer extra properties from the reference date to the new date.
* It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)
* that accept a time zone as a constructor argument.
*
* **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
*
* @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).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param argument - The value to convert
*
* @returns The parsed date in the local time zone
*
* @example
* // Clone the date:
* const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
* //=> Tue Feb 11 2014 11:30:30
*
* @example
* // Convert the timestamp to date:
* const result = toDate(1392098430000)
* //=> Tue Feb 11 2014 11:30:30
*/
export declare function toDate<
DateType extends Date | ConstructableDate,
ResultDate extends Date = DateType,
>(
argument: DateArg<DateType>,
context?: ContextFn<ResultDate> | undefined,
): ResultDate;
@@ -0,0 +1,14 @@
import type { VercelEdgeOptions } from '@sentry/vercel-edge';
export * from '@sentry/vercel-edge';
export * from '../common';
export { captureUnderscoreErrorException } from '../common/pages-router-instrumentation/_error';
export { startSpan, startSpanManual, startInactiveSpan } from '../common/utils/nextSpan';
export { wrapApiHandlerWithSentry } from './wrapApiHandlerWithSentry';
export type EdgeOptions = VercelEdgeOptions;
/** Inits the Sentry NextJS SDK on the Edge Runtime. */
export declare function init(options?: VercelEdgeOptions): void;
/**
* Just a passthrough in case this is imported from the client.
*/
export declare function withSentryConfig<T>(exportedUserNextConfig: T): T;
//# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,303 @@
(function () {
if (typeof Prism === 'undefined' || typeof document === 'undefined') {
return;
}
/**
* @callback Adapter
* @param {any} response
* @param {HTMLPreElement} [pre]
* @returns {string | null}
*/
/**
* The list of adapter which will be used if `data-adapter` is not specified.
*
* @type {Array<{adapter: Adapter, name: string}>}
*/
var adapters = [];
/**
* Adds a new function to the list of adapters.
*
* If the given adapter is already registered or not a function or there is an adapter with the given name already,
* nothing will happen.
*
* @param {Adapter} adapter The adapter to be registered.
* @param {string} [name] The name of the adapter. Defaults to the function name of `adapter`.
*/
function registerAdapter(adapter, name) {
name = name || adapter.name;
if (typeof adapter === 'function' && !getAdapter(adapter) && !getAdapter(name)) {
adapters.push({ adapter: adapter, name: name });
}
}
/**
* Returns the given adapter itself, if registered, or a registered adapter with the given name.
*
* If no fitting adapter is registered, `null` will be returned.
*
* @param {string|Function} adapter The adapter itself or the name of an adapter.
* @returns {Adapter} A registered adapter or `null`.
*/
function getAdapter(adapter) {
if (typeof adapter === 'function') {
for (var i = 0, item; (item = adapters[i++]);) {
if (item.adapter.valueOf() === adapter.valueOf()) {
return item.adapter;
}
}
} else if (typeof adapter === 'string') {
// eslint-disable-next-line no-redeclare
for (var i = 0, item; (item = adapters[i++]);) {
if (item.name === adapter) {
return item.adapter;
}
}
}
return null;
}
/**
* Remove the given adapter or the first registered adapter with the given name from the list of
* registered adapters.
*
* @param {string|Function} adapter The adapter itself or the name of an adapter.
*/
function removeAdapter(adapter) {
if (typeof adapter === 'string') {
adapter = getAdapter(adapter);
}
if (typeof adapter === 'function') {
var index = adapters.findIndex(function (item) {
return item.adapter === adapter;
});
if (index >= 0) {
adapters.splice(index, 1);
}
}
}
registerAdapter(function github(rsp) {
if (rsp && rsp.meta && rsp.data) {
if (rsp.meta.status && rsp.meta.status >= 400) {
return 'Error: ' + (rsp.data.message || rsp.meta.status);
} else if (typeof (rsp.data.content) === 'string') {
return typeof (atob) === 'function'
? atob(rsp.data.content.replace(/\s/g, ''))
: 'Your browser cannot decode base64';
}
}
return null;
}, 'github');
registerAdapter(function gist(rsp, el) {
if (rsp && rsp.meta && rsp.data && rsp.data.files) {
if (rsp.meta.status && rsp.meta.status >= 400) {
return 'Error: ' + (rsp.data.message || rsp.meta.status);
}
var files = rsp.data.files;
var filename = el.getAttribute('data-filename');
if (filename == null) {
// Maybe in the future we can somehow render all files
// But the standard <script> include for gists does that nicely already,
// so that might be getting beyond the scope of this plugin
for (var key in files) {
if (files.hasOwnProperty(key)) {
filename = key;
break;
}
}
}
if (files[filename] !== undefined) {
return files[filename].content;
}
return 'Error: unknown or missing gist file ' + filename;
}
return null;
}, 'gist');
registerAdapter(function bitbucket(rsp) {
if (rsp && rsp.node && typeof (rsp.data) === 'string') {
return rsp.data;
}
return null;
}, 'bitbucket');
var jsonpCallbackCounter = 0;
/**
* Makes a JSONP request.
*
* @param {string} src The URL of the resource to request.
* @param {string | undefined | null} callbackParameter The name of the callback parameter. If falsy, `"callback"`
* will be used.
* @param {(data: unknown) => void} onSuccess
* @param {(reason: "timeout" | "network") => void} onError
* @returns {void}
*/
function jsonp(src, callbackParameter, onSuccess, onError) {
var callbackName = 'prismjsonp' + jsonpCallbackCounter++;
var uri = document.createElement('a');
uri.href = src;
uri.href += (uri.search ? '&' : '?') + (callbackParameter || 'callback') + '=' + callbackName;
var script = document.createElement('script');
script.src = uri.href;
script.onerror = function () {
cleanup();
onError('network');
};
var timeoutId = setTimeout(function () {
cleanup();
onError('timeout');
}, Prism.plugins.jsonphighlight.timeout);
function cleanup() {
clearTimeout(timeoutId);
document.head.removeChild(script);
delete window[callbackName];
}
// the JSONP callback function
window[callbackName] = function (response) {
cleanup();
onSuccess(response);
};
document.head.appendChild(script);
}
var LOADING_MESSAGE = 'Loading…';
var MISSING_ADAPTER_MESSAGE = function (name) {
return '✖ Error: JSONP adapter function "' + name + '" doesn\'t exist';
};
var TIMEOUT_MESSAGE = function (url) {
return '✖ Error: Timeout loading ' + url;
};
var UNKNOWN_FAILURE_MESSAGE = '✖ Error: Cannot parse response (perhaps you need an adapter function?)';
var STATUS_ATTR = 'data-jsonp-status';
var STATUS_LOADING = 'loading';
var STATUS_LOADED = 'loaded';
var STATUS_FAILED = 'failed';
var SELECTOR = 'pre[data-jsonp]:not([' + STATUS_ATTR + '="' + STATUS_LOADED + '"])'
+ ':not([' + STATUS_ATTR + '="' + STATUS_LOADING + '"])';
Prism.hooks.add('before-highlightall', function (env) {
env.selector += ', ' + SELECTOR;
});
Prism.hooks.add('before-sanity-check', function (env) {
var pre = /** @type {HTMLPreElement} */ (env.element);
if (pre.matches(SELECTOR)) {
env.code = ''; // fast-path the whole thing and go to complete
// mark as loading
pre.setAttribute(STATUS_ATTR, STATUS_LOADING);
// add code element with loading message
var code = pre.appendChild(document.createElement('CODE'));
code.textContent = LOADING_MESSAGE;
// set language
var language = env.language;
code.className = 'language-' + language;
// preload the language
var autoloader = Prism.plugins.autoloader;
if (autoloader) {
autoloader.loadLanguages(language);
}
var adapterName = pre.getAttribute('data-adapter');
var adapter = null;
if (adapterName) {
if (typeof window[adapterName] === 'function') {
adapter = window[adapterName];
} else {
// mark as failed
pre.setAttribute(STATUS_ATTR, STATUS_FAILED);
code.textContent = MISSING_ADAPTER_MESSAGE(adapterName);
return;
}
}
var src = pre.getAttribute('data-jsonp');
jsonp(
src,
pre.getAttribute('data-callback'),
function (response) {
// interpret the received data using the adapter(s)
var data = null;
if (adapter) {
data = adapter(response, pre);
} else {
for (var i = 0, l = adapters.length; i < l; i++) {
data = adapters[i].adapter(response, pre);
if (data !== null) {
break;
}
}
}
if (data === null) {
// mark as failed
pre.setAttribute(STATUS_ATTR, STATUS_FAILED);
code.textContent = UNKNOWN_FAILURE_MESSAGE;
} else {
// mark as loaded
pre.setAttribute(STATUS_ATTR, STATUS_LOADED);
code.textContent = data;
Prism.highlightElement(code);
}
},
function () {
// mark as failed
pre.setAttribute(STATUS_ATTR, STATUS_FAILED);
code.textContent = TIMEOUT_MESSAGE(src);
}
);
}
});
Prism.plugins.jsonphighlight = {
/**
* The timeout after which an error message will be displayed.
*
* __Note:__ If the request succeeds after the timeout, it will still be processed and will override any
* displayed error messages.
*/
timeout: 5000,
registerAdapter: registerAdapter,
removeAdapter: removeAdapter,
/**
* Highlights all `pre` elements under the given container with a `data-jsonp` attribute by requesting the
* specified JSON and using the specified adapter or a registered adapter to extract the code to highlight
* from the response. The highlighted code will be inserted into the `pre` element.
*
* Note: Elements which are already loaded or currently loading will not be touched by this method.
*
* @param {Element | Document} [container=document]
*/
highlight: function (container) {
var elements = (container || document).querySelectorAll(SELECTOR);
for (var i = 0, element; (element = elements[i++]);) {
Prism.highlightElement(element);
}
}
};
}());
@@ -0,0 +1,63 @@
'use client';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { useDroppable } from '@dnd-kit/core';
import React from 'react';
import { DraggableWithClick } from '../DraggableWithClick/index.js';
import { HiddenCell, TableCell } from '../SimpleTable/index.js';
import './index.scss';
const baseClass = 'draggable-table-row';
export function DraggableTableRow({
id,
columns,
disabled = false,
dragData,
isDroppable: _isDroppable,
isFocused,
isSelected,
isSelecting,
itemKey,
onClick,
onKeyDown
}) {
const isDroppable = !disabled && _isDroppable && !isSelected;
const {
isOver,
setNodeRef
} = useDroppable({
id,
data: dragData,
disabled: !isDroppable
});
const ref = React.useRef(null);
React.useEffect(() => {
const copyOfRef = ref.current;
if (isFocused && ref.current) {
ref.current.focus();
} else if (!isFocused && ref.current) {
ref.current.blur();
}
return () => {
if (copyOfRef) {
copyOfRef.blur();
}
};
}, [isFocused]);
return /*#__PURE__*/_jsxs(DraggableWithClick, {
as: "tr",
className: [baseClass, isSelected && `${baseClass}--selected`, isSelecting && `${baseClass}--selecting`, disabled && `${baseClass}--disabled`, isFocused && `${baseClass}--focused`, isOver && `${baseClass}--over`].filter(Boolean).join(' '),
onClick: onClick,
onKeyDown: onKeyDown,
ref: ref,
children: [columns.map((col, i) => /*#__PURE__*/_jsx(TableCell, {
className: [`${baseClass}__cell-content`, i === 0 && `${baseClass}__first-td`, i === columns.length - 1 && `${baseClass}__last-td`].filter(Boolean).join(' '),
children: col
}, `${itemKey}-${i}`)), isDroppable ? /*#__PURE__*/_jsx(HiddenCell, {
children: /*#__PURE__*/_jsx("div", {
className: `${baseClass}__drop-area`,
ref: setNodeRef
})
}) : null]
}, itemKey);
}
//# sourceMappingURL=index.js.map
@@ -0,0 +1,630 @@
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/vi/_lib/formatDistance.mjs
var formatDistanceLocale = {
lessThanXSeconds: {
one: "d\u01B0\u1EDBi 1 gi\xE2y",
other: "d\u01B0\u1EDBi {{count}} gi\xE2y"
},
xSeconds: {
one: "1 gi\xE2y",
other: "{{count}} gi\xE2y"
},
halfAMinute: "n\u1EEDa ph\xFAt",
lessThanXMinutes: {
one: "d\u01B0\u1EDBi 1 ph\xFAt",
other: "d\u01B0\u1EDBi {{count}} ph\xFAt"
},
xMinutes: {
one: "1 ph\xFAt",
other: "{{count}} ph\xFAt"
},
aboutXHours: {
one: "kho\u1EA3ng 1 gi\u1EDD",
other: "kho\u1EA3ng {{count}} gi\u1EDD"
},
xHours: {
one: "1 gi\u1EDD",
other: "{{count}} gi\u1EDD"
},
xDays: {
one: "1 ng\xE0y",
other: "{{count}} ng\xE0y"
},
aboutXWeeks: {
one: "kho\u1EA3ng 1 tu\u1EA7n",
other: "kho\u1EA3ng {{count}} tu\u1EA7n"
},
xWeeks: {
one: "1 tu\u1EA7n",
other: "{{count}} tu\u1EA7n"
},
aboutXMonths: {
one: "kho\u1EA3ng 1 th\xE1ng",
other: "kho\u1EA3ng {{count}} th\xE1ng"
},
xMonths: {
one: "1 th\xE1ng",
other: "{{count}} th\xE1ng"
},
aboutXYears: {
one: "kho\u1EA3ng 1 n\u0103m",
other: "kho\u1EA3ng {{count}} n\u0103m"
},
xYears: {
one: "1 n\u0103m",
other: "{{count}} n\u0103m"
},
overXYears: {
one: "h\u01A1n 1 n\u0103m",
other: "h\u01A1n {{count}} n\u0103m"
},
almostXYears: {
one: "g\u1EA7n 1 n\u0103m",
other: "g\u1EA7n {{count}} n\u0103m"
}
};
var formatDistance = function formatDistance(token, count, options) {
var result;
var tokenValue = formatDistanceLocale[token];
if (typeof tokenValue === "string") {
result = tokenValue;
} else if (count === 1) {
result = tokenValue.one;
} else {
result = tokenValue.other.replace("{{count}}", String(count));
}
if (options !== null && options !== void 0 && options.addSuffix) {
if (options.comparison && options.comparison > 0) {
return result + " n\u1EEFa";
} else {
return result + " tr\u01B0\u1EDBc";
}
}
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/vi/_lib/formatLong.mjs
var dateFormats = {
full: "EEEE, 'ng\xE0y' d MMMM 'n\u0103m' y",
long: "'ng\xE0y' d MMMM 'n\u0103m' y",
medium: "d MMM 'n\u0103m' y",
short: "dd/MM/y"
};
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/vi/_lib/formatRelative.mjs
var formatRelativeLocale = {
lastWeek: "eeee 'tu\u1EA7n tr\u01B0\u1EDBc v\xE0o l\xFAc' p",
yesterday: "'h\xF4m qua v\xE0o l\xFAc' p",
today: "'h\xF4m nay v\xE0o l\xFAc' p",
tomorrow: "'ng\xE0y mai v\xE0o l\xFAc' p",
nextWeek: "eeee 't\u1EDBi v\xE0o l\xFAc' 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/vi/_lib/localize.mjs
var eraValues = {
narrow: ["TCN", "SCN"],
abbreviated: ["tr\u01B0\u1EDBc CN", "sau CN"],
wide: ["tr\u01B0\u1EDBc C\xF4ng Nguy\xEAn", "sau C\xF4ng Nguy\xEAn"]
};
var quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
wide: ["Qu\xFD 1", "Qu\xFD 2", "Qu\xFD 3", "Qu\xFD 4"]
};
var formattingQuarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
wide: ["qu\xFD I", "qu\xFD II", "qu\xFD III", "qu\xFD IV"]
};
var monthValues = {
narrow: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"],
abbreviated: [
"Thg 1",
"Thg 2",
"Thg 3",
"Thg 4",
"Thg 5",
"Thg 6",
"Thg 7",
"Thg 8",
"Thg 9",
"Thg 10",
"Thg 11",
"Thg 12"],
wide: [
"Th\xE1ng M\u1ED9t",
"Th\xE1ng Hai",
"Th\xE1ng Ba",
"Th\xE1ng T\u01B0",
"Th\xE1ng N\u0103m",
"Th\xE1ng S\xE1u",
"Th\xE1ng B\u1EA3y",
"Th\xE1ng T\xE1m",
"Th\xE1ng Ch\xEDn",
"Th\xE1ng M\u01B0\u1EDDi",
"Th\xE1ng M\u01B0\u1EDDi M\u1ED9t",
"Th\xE1ng M\u01B0\u1EDDi Hai"]
};
var formattingMonthValues = {
narrow: [
"01",
"02",
"03",
"04",
"05",
"06",
"07",
"08",
"09",
"10",
"11",
"12"],
abbreviated: [
"thg 1",
"thg 2",
"thg 3",
"thg 4",
"thg 5",
"thg 6",
"thg 7",
"thg 8",
"thg 9",
"thg 10",
"thg 11",
"thg 12"],
wide: [
"th\xE1ng 01",
"th\xE1ng 02",
"th\xE1ng 03",
"th\xE1ng 04",
"th\xE1ng 05",
"th\xE1ng 06",
"th\xE1ng 07",
"th\xE1ng 08",
"th\xE1ng 09",
"th\xE1ng 10",
"th\xE1ng 11",
"th\xE1ng 12"]
};
var dayValues = {
narrow: ["CN", "T2", "T3", "T4", "T5", "T6", "T7"],
short: ["CN", "Th 2", "Th 3", "Th 4", "Th 5", "Th 6", "Th 7"],
abbreviated: ["CN", "Th\u1EE9 2", "Th\u1EE9 3", "Th\u1EE9 4", "Th\u1EE9 5", "Th\u1EE9 6", "Th\u1EE9 7"],
wide: [
"Ch\u1EE7 Nh\u1EADt",
"Th\u1EE9 Hai",
"Th\u1EE9 Ba",
"Th\u1EE9 T\u01B0",
"Th\u1EE9 N\u0103m",
"Th\u1EE9 S\xE1u",
"Th\u1EE9 B\u1EA3y"]
};
var dayPeriodValues = {
narrow: {
am: "am",
pm: "pm",
midnight: "n\u1EEDa \u0111\xEAm",
noon: "tr",
morning: "sg",
afternoon: "ch",
evening: "t\u1ED1i",
night: "\u0111\xEAm"
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "n\u1EEDa \u0111\xEAm",
noon: "tr\u01B0a",
morning: "s\xE1ng",
afternoon: "chi\u1EC1u",
evening: "t\u1ED1i",
night: "\u0111\xEAm"
},
wide: {
am: "SA",
pm: "CH",
midnight: "n\u1EEDa \u0111\xEAm",
noon: "tr\u01B0a",
morning: "s\xE1ng",
afternoon: "chi\u1EC1u",
evening: "t\u1ED1i",
night: "\u0111\xEAm"
}
};
var formattingDayPeriodValues = {
narrow: {
am: "am",
pm: "pm",
midnight: "n\u1EEDa \u0111\xEAm",
noon: "tr",
morning: "sg",
afternoon: "ch",
evening: "t\u1ED1i",
night: "\u0111\xEAm"
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "n\u1EEDa \u0111\xEAm",
noon: "tr\u01B0a",
morning: "s\xE1ng",
afternoon: "chi\u1EC1u",
evening: "t\u1ED1i",
night: "\u0111\xEAm"
},
wide: {
am: "SA",
pm: "CH",
midnight: "n\u1EEDa \u0111\xEAm",
noon: "gi\u1EEFa tr\u01B0a",
morning: "v\xE0o bu\u1ED5i s\xE1ng",
afternoon: "v\xE0o bu\u1ED5i chi\u1EC1u",
evening: "v\xE0o bu\u1ED5i t\u1ED1i",
night: "v\xE0o ban \u0111\xEAm"
}
};
var ordinalNumber = function ordinalNumber(dirtyNumber, options) {
var number = Number(dirtyNumber);
var unit = options === null || options === void 0 ? void 0 : options.unit;
if (unit === "quarter") {
switch (number) {
case 1:
return "I";
case 2:
return "II";
case 3:
return "III";
case 4:
return "IV";
}
} else if (unit === "day") {
switch (number) {
case 1:
return "th\u1EE9 2";
case 2:
return "th\u1EE9 3";
case 3:
return "th\u1EE9 4";
case 4:
return "th\u1EE9 5";
case 5:
return "th\u1EE9 6";
case 6:
return "th\u1EE9 7";
case 7:
return "ch\u1EE7 nh\u1EADt";
}
} else if (unit === "week") {
if (number === 1) {
return "th\u1EE9 nh\u1EA5t";
} else {
return "th\u1EE9 " + number;
}
} else if (unit === "dayOfYear") {
if (number === 1) {
return "\u0111\u1EA7u ti\xEAn";
} else {
return "th\u1EE9 " + number;
}
}
return String(number);
};
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"
}),
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/vi/_lib/match.mjs
var matchOrdinalNumberPattern = /^(\d+)/i;
var parseOrdinalNumberPattern = /\d+/i;
var matchEraPatterns = {
narrow: /^(tcn|scn)/i,
abbreviated: /^(trước CN|sau CN)/i,
wide: /^(trước Công Nguyên|sau Công Nguyên)/i
};
var parseEraPatterns = {
any: [/^t/i, /^s/i]
};
var matchQuarterPatterns = {
narrow: /^([1234]|i{1,3}v?)/i,
abbreviated: /^q([1234]|i{1,3}v?)/i,
wide: /^quý ([1234]|i{1,3}v?)/i
};
var parseQuarterPatterns = {
any: [/(1|i)$/i, /(2|ii)$/i, /(3|iii)$/i, /(4|iv)$/i]
};
var matchMonthPatterns = {
narrow: /^(0?[2-9]|10|11|12|0?1)/i,
abbreviated: /^thg[ _]?(0?[1-9](?!\d)|10|11|12)/i,
wide: /^tháng ?(Một|Hai|Ba|Tư|Năm|Sáu|Bảy|Tám|Chín|Mười|Mười ?Một|Mười ?Hai|0?[1-9](?!\d)|10|11|12)/i
};
var parseMonthPatterns = {
narrow: [
/0?1$/i,
/0?2/i,
/3/,
/4/,
/5/,
/6/,
/7/,
/8/,
/9/,
/10/,
/11/,
/12/],
abbreviated: [
/^thg[ _]?0?1(?!\d)/i,
/^thg[ _]?0?2/i,
/^thg[ _]?0?3/i,
/^thg[ _]?0?4/i,
/^thg[ _]?0?5/i,
/^thg[ _]?0?6/i,
/^thg[ _]?0?7/i,
/^thg[ _]?0?8/i,
/^thg[ _]?0?9/i,
/^thg[ _]?10/i,
/^thg[ _]?11/i,
/^thg[ _]?12/i],
wide: [
/^tháng ?(Một|0?1(?!\d))/i,
/^tháng ?(Hai|0?2)/i,
/^tháng ?(Ba|0?3)/i,
/^tháng ?(Tư|0?4)/i,
/^tháng ?(Năm|0?5)/i,
/^tháng ?(Sáu|0?6)/i,
/^tháng ?(Bảy|0?7)/i,
/^tháng ?(Tám|0?8)/i,
/^tháng ?(Chín|0?9)/i,
/^tháng ?(Mười|10)/i,
/^tháng ?(Mười ?Một|11)/i,
/^tháng ?(Mười ?Hai|12)/i]
};
var matchDayPatterns = {
narrow: /^(CN|T2|T3|T4|T5|T6|T7)/i,
short: /^(CN|Th ?2|Th ?3|Th ?4|Th ?5|Th ?6|Th ?7)/i,
abbreviated: /^(CN|Th ?2|Th ?3|Th ?4|Th ?5|Th ?6|Th ?7)/i,
wide: /^(Chủ ?Nhật|Chúa ?Nhật|thứ ?Hai|thứ ?Ba|thứ ?Tư|thứ ?Năm|thứ ?Sáu|thứ ?Bảy)/i
};
var parseDayPatterns = {
narrow: [/CN/i, /2/i, /3/i, /4/i, /5/i, /6/i, /7/i],
short: [/CN/i, /2/i, /3/i, /4/i, /5/i, /6/i, /7/i],
abbreviated: [/CN/i, /2/i, /3/i, /4/i, /5/i, /6/i, /7/i],
wide: [/(Chủ|Chúa) ?Nhật/i, /Hai/i, /Ba/i, /Tư/i, /Năm/i, /Sáu/i, /Bảy/i]
};
var matchDayPeriodPatterns = {
narrow: /^(a|p|nửa đêm|trưa|(giờ) (sáng|chiều|tối|đêm))/i,
abbreviated: /^(am|pm|nửa đêm|trưa|(giờ) (sáng|chiều|tối|đêm))/i,
wide: /^(ch[^i]*|sa|nửa đêm|trưa|(giờ) (sáng|chiều|tối|đêm))/i
};
var parseDayPeriodPatterns = {
any: {
am: /^(a|sa)/i,
pm: /^(p|ch[^i]*)/i,
midnight: /nửa đêm/i,
noon: /trưa/i,
morning: /sáng/i,
afternoon: /chiều/i,
evening: /tối/i,
night: /^đêm/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: "wide"
}),
day: buildMatchFn({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "wide"
}),
dayPeriod: buildMatchFn({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any"
})
};
// lib/locale/vi.mjs
var vi = {
code: "vi",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 1,
firstWeekContainsDate: 1
}
};
// lib/locale/vi/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), {}, {
vi: vi }) });
//# debugId=F33517E3A99C400E64756e2164756e21
})();
//# sourceMappingURL=cdn.js.map
@@ -0,0 +1 @@
{"version":3,"file":"deleteSubfoldersAfterDelete.d.ts","sourceRoot":"","sources":["../../../src/folders/hooks/deleteSubfoldersAfterDelete.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAA;AAEhE,KAAK,IAAI,GAAG;IACV,eAAe,EAAE,MAAM,CAAA;IACvB,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AACD,eAAO,MAAM,4BAA4B,qCAGtC,IAAI,KAAG,0BAYT,CAAA"}
@@ -0,0 +1 @@
{"version":3,"file":"types_internal.js","sourceRoot":"","sources":["../../src/types_internal.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG","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\nimport { TracerProvider, MeterProvider } from '@opentelemetry/api';\nimport { Instrumentation } from './types';\nimport { LoggerProvider } from '@opentelemetry/api-logs';\n\nexport interface AutoLoaderResult {\n instrumentations: Instrumentation[];\n}\n\nexport interface AutoLoaderOptions {\n instrumentations?: (Instrumentation | Instrumentation[])[];\n tracerProvider?: TracerProvider;\n meterProvider?: MeterProvider;\n loggerProvider?: LoggerProvider;\n}\n"]}
@@ -0,0 +1,24 @@
import { DirectusUser } from "../../../schema/user.cjs";
import { RestCommand } from "../../types.cjs";
//#region src/rest/commands/delete/users.d.ts
/**
* Delete multiple existing users.
*
* @param keys
* @returns Nothing
* @throws Will throw if keys is empty
*/
declare const deleteUsers: <Schema>(keys: DirectusUser<Schema>["id"][]) => RestCommand<void, Schema>;
/**
* Delete an existing user.
*
* @param key
* @returns Nothing
* @throws Will throw if key is empty
*/
declare const deleteUser: <Schema>(key: DirectusUser<Schema>["id"]) => RestCommand<void, Schema>;
//#endregion
export { deleteUser, deleteUsers };
//# sourceMappingURL=users.d.cts.map
@@ -0,0 +1,41 @@
'use strict'
module.exports = prettifyLevel
const getPropertyValue = require('./get-property-value')
/**
* @typedef {object} PrettifyLevelParams
* @property {object} log The log object.
* @property {PrettyContext} context The context object built from parsing
* the options.
*/
/**
* Checks if the passed in log has a `level` value and returns a prettified
* string for that level if so.
*
* @param {PrettifyLevelParams} input
*
* @returns {undefined|string} If `log` does not have a `level` property then
* `undefined` will be returned. Otherwise, a string from the specified
* `colorizer` is returned.
*/
function prettifyLevel ({ log, context }) {
const {
colorizer,
customLevels,
customLevelNames,
levelKey,
getLevelLabelData
} = context
const prettifier = context.customPrettifiers?.level
const output = getPropertyValue(log, levelKey)
if (output === undefined) return undefined
const labelColorized = colorizer(output, { customLevels, customLevelNames })
if (prettifier) {
const [label] = getLevelLabelData(output)
return prettifier(output, levelKey, log, { label, labelColorized, colors: colorizer.colors })
}
return labelColorized
}
@@ -0,0 +1 @@
{"version":3,"file":"rss.js","sources":["../../../src/icons/rss.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Rss\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNCAxMWE5IDkgMCAwIDEgOSA5IiAvPgogIDxwYXRoIGQ9Ik00IDRhMTYgMTYgMCAwIDEgMTYgMTYiIC8+CiAgPGNpcmNsZSBjeD0iNSIgY3k9IjE5IiByPSIxIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/rss\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 Rss = createLucideIcon('Rss', [\n ['path', { d: 'M4 11a9 9 0 0 1 9 9', key: 'pv89mb' }],\n ['path', { d: 'M4 4a16 16 0 0 1 16 16', key: 'k0647b' }],\n ['circle', { cx: '5', cy: '19', r: '1', key: 'bfqh0e' }],\n]);\n\nexport default Rss;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,iBAAiB,KAAO,CAAA,CAAA,CAAA;AAAA,CAAA,CAClC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAuB,CAAA,CAAA,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,CACpD,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,CAAA;AAAA,CACvD,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;AACzD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"globalThis.js","sourceRoot":"","sources":["../../../../src/platform/browser/globalThis.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,2EAA2E;AAC3E,2BAA2B;AAE3B;;;;;;GAMG;AAEH,gEAAgE;AAChE,2EAA2E;AAC9D,QAAA,WAAW,GACtB,OAAO,UAAU,KAAK,QAAQ;IAC5B,CAAC,CAAC,UAAU;IACZ,CAAC,CAAC,OAAO,IAAI,KAAK,QAAQ;QACxB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,OAAO,MAAM,KAAK,QAAQ;YAC1B,CAAC,CAAC,MAAM;YACR,CAAC,CAAC,OAAO,MAAM,KAAK,QAAQ;gBAC1B,CAAC,CAAE,MAAuC;gBAC1C,CAAC,CAAE,EAAwB,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// Updates to this file should also be replicated to @opentelemetry/api and\n// @opentelemetry/core too.\n\n/**\n * - globalThis (New standard)\n * - self (Will return the current window instance for supported browsers)\n * - window (fallback for older browser implementations)\n * - global (NodeJS implementation)\n * - <object> (When all else fails)\n */\n\n/** only globals that common to node and browsers are allowed */\n// eslint-disable-next-line n/no-unsupported-features/es-builtins, no-undef\nexport const _globalThis: typeof globalThis =\n typeof globalThis === 'object'\n ? globalThis\n : typeof self === 'object'\n ? self\n : typeof window === 'object'\n ? window\n : typeof global === 'object'\n ? (global as unknown as typeof globalThis)\n : ({} as typeof globalThis);\n"]}
@@ -0,0 +1 @@
{"version":3,"sources":["../../src/utilities/isolateObjectProperty.ts"],"sourcesContent":["/**\n * Creates a proxy for the given object that has its own property\n */\nexport function isolateObjectProperty<T extends object>(object: T, key: (keyof T)[] | keyof T): T {\n const keys = Array.isArray(key) ? key : [key]\n const delegate = {} as T\n\n // Initialize delegate with the keys, if they exist in the original object\n for (const k of keys) {\n if (k in object) {\n delegate[k] = object[k]\n }\n }\n\n const handler: ProxyHandler<T> = {\n deleteProperty(target, p): boolean {\n return Reflect.deleteProperty(keys.includes(p as keyof T) ? delegate : target, p)\n },\n get(target, p, receiver) {\n if (keys.includes(p as keyof T)) {\n return Reflect.get(delegate, p, receiver)\n }\n // Use target as receiver to preserve private field access (e.g., Request#headers in Node 24+)\n return Reflect.get(target, p, target)\n },\n has(target, p) {\n return Reflect.has(keys.includes(p as keyof T) ? delegate : target, p)\n },\n set(target, p, newValue, _receiver) {\n if (keys.includes(p as keyof T)) {\n // in case of transactionID we must ignore any receiver, because\n // \"If provided and target does not have a setter for propertyKey, the property will be set on receiver instead.\"\n return Reflect.set(delegate, p, newValue)\n }\n return Reflect.set(target, p, newValue, target)\n },\n }\n return new Proxy(object, handler)\n}\n"],"names":["isolateObjectProperty","object","key","keys","Array","isArray","delegate","k","handler","deleteProperty","target","p","Reflect","includes","get","receiver","has","set","newValue","_receiver","Proxy"],"mappings":"AAAA;;CAEC,GACD,OAAO,SAASA,sBAAwCC,MAAS,EAAEC,GAA0B;IAC3F,MAAMC,OAAOC,MAAMC,OAAO,CAACH,OAAOA,MAAM;QAACA;KAAI;IAC7C,MAAMI,WAAW,CAAC;IAElB,0EAA0E;IAC1E,KAAK,MAAMC,KAAKJ,KAAM;QACpB,IAAII,KAAKN,QAAQ;YACfK,QAAQ,CAACC,EAAE,GAAGN,MAAM,CAACM,EAAE;QACzB;IACF;IAEA,MAAMC,UAA2B;QAC/BC,gBAAeC,MAAM,EAAEC,CAAC;YACtB,OAAOC,QAAQH,cAAc,CAACN,KAAKU,QAAQ,CAACF,KAAgBL,WAAWI,QAAQC;QACjF;QACAG,KAAIJ,MAAM,EAAEC,CAAC,EAAEI,QAAQ;YACrB,IAAIZ,KAAKU,QAAQ,CAACF,IAAe;gBAC/B,OAAOC,QAAQE,GAAG,CAACR,UAAUK,GAAGI;YAClC;YACA,8FAA8F;YAC9F,OAAOH,QAAQE,GAAG,CAACJ,QAAQC,GAAGD;QAChC;QACAM,KAAIN,MAAM,EAAEC,CAAC;YACX,OAAOC,QAAQI,GAAG,CAACb,KAAKU,QAAQ,CAACF,KAAgBL,WAAWI,QAAQC;QACtE;QACAM,KAAIP,MAAM,EAAEC,CAAC,EAAEO,QAAQ,EAAEC,SAAS;YAChC,IAAIhB,KAAKU,QAAQ,CAACF,IAAe;gBAC/B,gEAAgE;gBAChE,iHAAiH;gBACjH,OAAOC,QAAQK,GAAG,CAACX,UAAUK,GAAGO;YAClC;YACA,OAAON,QAAQK,GAAG,CAACP,QAAQC,GAAGO,UAAUR;QAC1C;IACF;IACA,OAAO,IAAIU,MAAMnB,QAAQO;AAC3B"}
@@ -0,0 +1,183 @@
import { buildLocalizeFn } from "../../_lib/buildLocalizeFn.mjs";
const eraValues = {
narrow: ["前", "公元"],
abbreviated: ["前", "公元"],
wide: ["公元前", "公元"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["第一季", "第二季", "第三季", "第四季"],
wide: ["第一季度", "第二季度", "第三季度", "第四季度"],
};
const monthValues = {
narrow: [
"一",
"二",
"三",
"四",
"五",
"六",
"七",
"八",
"九",
"十",
"十一",
"十二",
],
abbreviated: [
"1月",
"2月",
"3月",
"4月",
"5月",
"6月",
"7月",
"8月",
"9月",
"10月",
"11月",
"12月",
],
wide: [
"一月",
"二月",
"三月",
"四月",
"五月",
"六月",
"七月",
"八月",
"九月",
"十月",
"十一月",
"十二月",
],
};
const dayValues = {
narrow: ["日", "一", "二", "三", "四", "五", "六"],
short: ["日", "一", "二", "三", "四", "五", "六"],
abbreviated: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
wide: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
};
const dayPeriodValues = {
narrow: {
am: "上",
pm: "下",
midnight: "凌晨",
noon: "午",
morning: "早",
afternoon: "下午",
evening: "晚",
night: "夜",
},
abbreviated: {
am: "上午",
pm: "下午",
midnight: "凌晨",
noon: "中午",
morning: "早晨",
afternoon: "中午",
evening: "晚上",
night: "夜间",
},
wide: {
am: "上午",
pm: "下午",
midnight: "凌晨",
noon: "中午",
morning: "早晨",
afternoon: "中午",
evening: "晚上",
night: "夜间",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "上",
pm: "下",
midnight: "凌晨",
noon: "午",
morning: "早",
afternoon: "下午",
evening: "晚",
night: "夜",
},
abbreviated: {
am: "上午",
pm: "下午",
midnight: "凌晨",
noon: "中午",
morning: "早晨",
afternoon: "中午",
evening: "晚上",
night: "夜间",
},
wide: {
am: "上午",
pm: "下午",
midnight: "凌晨",
noon: "中午",
morning: "早晨",
afternoon: "中午",
evening: "晚上",
night: "夜间",
},
};
const ordinalNumber = (dirtyNumber, options) => {
const number = Number(dirtyNumber);
switch (options?.unit) {
case "date":
return number.toString() + "日";
case "hour":
return number.toString() + "时";
case "minute":
return number.toString() + "分";
case "second":
return number.toString() + "秒";
default:
return "第 " + number.toString();
}
};
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,145 @@
"use strict";
exports.match = void 0;
var _index = require("../../_lib/buildMatchPatternFn.cjs");
var _index2 = require("../../_lib/buildMatchFn.cjs");
const matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(ق|ب)/i,
abbreviated: /^(ق\.?\s?م\.?|ق\.?\s?م\.?\s?|a\.?\s?d\.?|c\.?\s?)/i,
wide: /^(قبل الميلاد|قبل الميلاد|بعد الميلاد|بعد الميلاد)/i,
};
const parseEraPatterns = {
any: [/^قبل/i, /^بعد/i],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^ر[1234]/i,
wide: /^الربع [1234]/i,
};
const parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i],
};
const matchMonthPatterns = {
narrow: /^[جفمأسند]/i,
abbreviated: /^(جان|فيف|مار|أفر|ماي|جوا|جوي|أوت|سبت|أكت|نوف|ديس)/i,
wide: /^(جانفي|فيفري|مارس|أفريل|ماي|جوان|جويلية|أوت|سبتمبر|أكتوبر|نوفمبر|ديسمبر)/i,
};
const parseMonthPatterns = {
narrow: [
/^ج/i,
/^ف/i,
/^م/i,
/^أ/i,
/^م/i,
/^ج/i,
/^ج/i,
/^أ/i,
/^س/i,
/^أ/i,
/^ن/i,
/^د/i,
],
any: [
/^جان/i,
/^فيف/i,
/^مار/i,
/^أفر/i,
/^ماي/i,
/^جوا/i,
/^جوي/i,
/^أوت/i,
/^سبت/i,
/^أكت/i,
/^نوف/i,
/^ديس/i,
],
};
const matchDayPatterns = {
narrow: /^[حنثرخجس]/i,
short: /^(أحد|اثنين|ثلاثاء|أربعاء|خميس|جمعة|سبت)/i,
abbreviated: /^(أحد|اثن|ثلا|أرب|خمي|جمعة|سبت)/i,
wide: /^(الأحد|الاثنين|الثلاثاء|الأربعاء|الخميس|الجمعة|السبت)/i,
};
const parseDayPatterns = {
narrow: [/^ح/i, /^ن/i, /^ث/i, /^ر/i, /^خ/i, /^ج/i, /^س/i],
wide: [
/^الأحد/i,
/^الاثنين/i,
/^الثلاثاء/i,
/^الأربعاء/i,
/^الخميس/i,
/^الجمعة/i,
/^السبت/i,
],
any: [/^أح/i, /^اث/i, /^ث/i, /^أر/i, /^خ/i, /^ج/i, /^س/i],
};
const matchDayPeriodPatterns = {
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^a/i,
pm: /^p/i,
midnight: /^mi/i,
noon: /^no/i,
morning: /morning/i,
afternoon: /afternoon/i,
evening: /evening/i,
night: /night/i,
},
};
const match = (exports.match = {
ordinalNumber: (0, _index.buildMatchPatternFn)({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: (value) => parseInt(value, 10),
}),
era: (0, _index2.buildMatchFn)({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any",
}),
quarter: (0, _index2.buildMatchFn)({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: (index) => Number(index) + 1,
}),
month: (0, _index2.buildMatchFn)({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any",
}),
day: (0, _index2.buildMatchFn)({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: (0, _index2.buildMatchFn)({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
});
@@ -0,0 +1 @@
{"version":3,"file":"file-json.js","sources":["../../../src/icons/file-json.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name FileJson\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTUgMkg2YTIgMiAwIDAgMC0yIDJ2MTZhMiAyIDAgMCAwIDIgMmgxMmEyIDIgMCAwIDAgMi0yVjdaIiAvPgogIDxwYXRoIGQ9Ik0xNCAydjRhMiAyIDAgMCAwIDIgMmg0IiAvPgogIDxwYXRoIGQ9Ik0xMCAxMmExIDEgMCAwIDAtMSAxdjFhMSAxIDAgMCAxLTEgMSAxIDEgMCAwIDEgMSAxdjFhMSAxIDAgMCAwIDEgMSIgLz4KICA8cGF0aCBkPSJNMTQgMThhMSAxIDAgMCAwIDEtMXYtMWExIDEgMCAwIDEgMS0xIDEgMSAwIDAgMS0xLTF2LTFhMSAxIDAgMCAwLTEtMSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/file-json\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 FileJson = createLucideIcon('FileJson', [\n ['path', { d: 'M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z', key: '1rqfz7' }],\n ['path', { d: 'M14 2v4a2 2 0 0 0 2 2h4', key: 'tnqrlb' }],\n [\n 'path',\n { d: 'M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1', key: '1oajmo' },\n ],\n [\n 'path',\n { d: 'M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1', key: 'mpwhp6' },\n ],\n]);\n\nexport default FileJson;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,iBAAiB,UAAY,CAAA,CAAA,CAAA;AAAA,CAAA,CAC5C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA8D,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAC3F,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA2B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CACxD,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,CAAsE,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,QAAS,CAAA,CAAA;AAAA,CAC3F,CAAA,CAAA,CAAA;AAAA,CACA,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,CAAwE,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,QAAS,CAAA,CAAA;AAAA,CAC7F,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,13 @@
/**
* @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 Slash = createLucideIcon("Slash", [["path", { d: "M22 2 2 22", key: "y4kqgn" }]]);
export { Slash as default };
//# sourceMappingURL=slash.js.map
@@ -0,0 +1,765 @@
# Source Map JS
[![NPM](https://nodei.co/npm/source-map-js.png?downloads=true&downloadRank=true)](https://www.npmjs.com/package/source-map-js)
Difference between original [source-map](https://github.com/mozilla/source-map):
> TL,DR: it's fork of original source-map@0.6, but with perfomance optimizations.
This journey starts from [source-map@0.7.0](https://github.com/mozilla/source-map/blob/master/CHANGELOG.md#070). Some part of it was rewritten to Rust and WASM and API became async.
It's still a major block for many libraries like PostCSS or Sass for example because they need to migrate the whole API to the async way. This is the reason why 0.6.1 has 2x more downloads than 0.7.3 while it's faster several times.
![Downloads count](media/downloads.png)
More important that WASM version has some optimizations in JS code too. This is why [community asked to create branch for 0.6 version](https://github.com/mozilla/source-map/issues/324) and port these optimizations but, sadly, the answer was «no». A bit later I discovered [the issue](https://github.com/mozilla/source-map/issues/370) created by [Ben Rothman (@benthemonkey)](https://github.com/benthemonkey) with no response at all.
[Roman Dvornov (@lahmatiy)](https://github.com/lahmatiy) wrote a [serveral posts](https://t.me/gorshochekvarit/76) (russian, only, sorry) about source-map library in his own Telegram channel. He mentioned the article [«Maybe you don't need Rust and WASM to speed up your JS»](https://mrale.ph/blog/2018/02/03/maybe-you-dont-need-rust-to-speed-up-your-js.html) written by [Vyacheslav Egorov (@mraleph)](https://github.com/mraleph). This article contains optimizations and hacks that lead to almost the same performance compare to WASM implementation.
I decided to fork the original source-map and port these optimizations from the article and several others PR from the original source-map.
---------
This is a library to generate and consume the source map format
[described here][format].
[format]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit
## Use with Node
$ npm install source-map-js
<!-- ## Use on the Web
<script src="https://raw.githubusercontent.com/mozilla/source-map/master/dist/source-map.min.js" defer></script> -->
--------------------------------------------------------------------------------
<!-- `npm run toc` to regenerate the Table of Contents -->
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
## Table of Contents
- [Examples](#examples)
- [Consuming a source map](#consuming-a-source-map)
- [Generating a source map](#generating-a-source-map)
- [With SourceNode (high level API)](#with-sourcenode-high-level-api)
- [With SourceMapGenerator (low level API)](#with-sourcemapgenerator-low-level-api)
- [API](#api)
- [SourceMapConsumer](#sourcemapconsumer)
- [new SourceMapConsumer(rawSourceMap)](#new-sourcemapconsumerrawsourcemap)
- [SourceMapConsumer.prototype.computeColumnSpans()](#sourcemapconsumerprototypecomputecolumnspans)
- [SourceMapConsumer.prototype.originalPositionFor(generatedPosition)](#sourcemapconsumerprototypeoriginalpositionforgeneratedposition)
- [SourceMapConsumer.prototype.generatedPositionFor(originalPosition)](#sourcemapconsumerprototypegeneratedpositionfororiginalposition)
- [SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition)](#sourcemapconsumerprototypeallgeneratedpositionsfororiginalposition)
- [SourceMapConsumer.prototype.hasContentsOfAllSources()](#sourcemapconsumerprototypehascontentsofallsources)
- [SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing])](#sourcemapconsumerprototypesourcecontentforsource-returnnullonmissing)
- [SourceMapConsumer.prototype.eachMapping(callback, context, order)](#sourcemapconsumerprototypeeachmappingcallback-context-order)
- [SourceMapGenerator](#sourcemapgenerator)
- [new SourceMapGenerator([startOfSourceMap])](#new-sourcemapgeneratorstartofsourcemap)
- [SourceMapGenerator.fromSourceMap(sourceMapConsumer)](#sourcemapgeneratorfromsourcemapsourcemapconsumer)
- [SourceMapGenerator.prototype.addMapping(mapping)](#sourcemapgeneratorprototypeaddmappingmapping)
- [SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent)](#sourcemapgeneratorprototypesetsourcecontentsourcefile-sourcecontent)
- [SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]])](#sourcemapgeneratorprototypeapplysourcemapsourcemapconsumer-sourcefile-sourcemappath)
- [SourceMapGenerator.prototype.toString()](#sourcemapgeneratorprototypetostring)
- [SourceNode](#sourcenode)
- [new SourceNode([line, column, source[, chunk[, name]]])](#new-sourcenodeline-column-source-chunk-name)
- [SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath])](#sourcenodefromstringwithsourcemapcode-sourcemapconsumer-relativepath)
- [SourceNode.prototype.add(chunk)](#sourcenodeprototypeaddchunk)
- [SourceNode.prototype.prepend(chunk)](#sourcenodeprototypeprependchunk)
- [SourceNode.prototype.setSourceContent(sourceFile, sourceContent)](#sourcenodeprototypesetsourcecontentsourcefile-sourcecontent)
- [SourceNode.prototype.walk(fn)](#sourcenodeprototypewalkfn)
- [SourceNode.prototype.walkSourceContents(fn)](#sourcenodeprototypewalksourcecontentsfn)
- [SourceNode.prototype.join(sep)](#sourcenodeprototypejoinsep)
- [SourceNode.prototype.replaceRight(pattern, replacement)](#sourcenodeprototypereplacerightpattern-replacement)
- [SourceNode.prototype.toString()](#sourcenodeprototypetostring)
- [SourceNode.prototype.toStringWithSourceMap([startOfSourceMap])](#sourcenodeprototypetostringwithsourcemapstartofsourcemap)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
## Examples
### Consuming a source map
```js
var rawSourceMap = {
version: 3,
file: 'min.js',
names: ['bar', 'baz', 'n'],
sources: ['one.js', 'two.js'],
sourceRoot: 'http://example.com/www/js/',
mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA'
};
var smc = new SourceMapConsumer(rawSourceMap);
console.log(smc.sources);
// [ 'http://example.com/www/js/one.js',
// 'http://example.com/www/js/two.js' ]
console.log(smc.originalPositionFor({
line: 2,
column: 28
}));
// { source: 'http://example.com/www/js/two.js',
// line: 2,
// column: 10,
// name: 'n' }
console.log(smc.generatedPositionFor({
source: 'http://example.com/www/js/two.js',
line: 2,
column: 10
}));
// { line: 2, column: 28 }
smc.eachMapping(function (m) {
// ...
});
```
### Generating a source map
In depth guide:
[**Compiling to JavaScript, and Debugging with Source Maps**](https://hacks.mozilla.org/2013/05/compiling-to-javascript-and-debugging-with-source-maps/)
#### With SourceNode (high level API)
```js
function compile(ast) {
switch (ast.type) {
case 'BinaryExpression':
return new SourceNode(
ast.location.line,
ast.location.column,
ast.location.source,
[compile(ast.left), " + ", compile(ast.right)]
);
case 'Literal':
return new SourceNode(
ast.location.line,
ast.location.column,
ast.location.source,
String(ast.value)
);
// ...
default:
throw new Error("Bad AST");
}
}
var ast = parse("40 + 2", "add.js");
console.log(compile(ast).toStringWithSourceMap({
file: 'add.js'
}));
// { code: '40 + 2',
// map: [object SourceMapGenerator] }
```
#### With SourceMapGenerator (low level API)
```js
var map = new SourceMapGenerator({
file: "source-mapped.js"
});
map.addMapping({
generated: {
line: 10,
column: 35
},
source: "foo.js",
original: {
line: 33,
column: 2
},
name: "christopher"
});
console.log(map.toString());
// '{"version":3,"file":"source-mapped.js","sources":["foo.js"],"names":["christopher"],"mappings":";;;;;;;;;mCAgCEA"}'
```
## API
Get a reference to the module:
```js
// Node.js
var sourceMap = require('source-map');
// Browser builds
var sourceMap = window.sourceMap;
// Inside Firefox
const sourceMap = require("devtools/toolkit/sourcemap/source-map.js");
```
### SourceMapConsumer
A SourceMapConsumer instance represents a parsed source map which we can query
for information about the original file positions by giving it a file position
in the generated source.
#### new SourceMapConsumer(rawSourceMap)
The only parameter is the raw source map (either as a string which can be
`JSON.parse`'d, or an object). According to the spec, source maps have the
following attributes:
* `version`: Which version of the source map spec this map is following.
* `sources`: An array of URLs to the original source files.
* `names`: An array of identifiers which can be referenced by individual
mappings.
* `sourceRoot`: Optional. The URL root from which all sources are relative.
* `sourcesContent`: Optional. An array of contents of the original source files.
* `mappings`: A string of base64 VLQs which contain the actual mappings.
* `file`: Optional. The generated filename this source map is associated with.
```js
var consumer = new sourceMap.SourceMapConsumer(rawSourceMapJsonData);
```
#### SourceMapConsumer.prototype.computeColumnSpans()
Compute the last column for each generated mapping. The last column is
inclusive.
```js
// Before:
consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" })
// [ { line: 2,
// column: 1 },
// { line: 2,
// column: 10 },
// { line: 2,
// column: 20 } ]
consumer.computeColumnSpans();
// After:
consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" })
// [ { line: 2,
// column: 1,
// lastColumn: 9 },
// { line: 2,
// column: 10,
// lastColumn: 19 },
// { line: 2,
// column: 20,
// lastColumn: Infinity } ]
```
#### SourceMapConsumer.prototype.originalPositionFor(generatedPosition)
Returns the original source, line, and column information for the generated
source's line and column positions provided. The only argument is an object with
the following properties:
* `line`: The line number in the generated source. Line numbers in
this library are 1-based (note that the underlying source map
specification uses 0-based line numbers -- this library handles the
translation).
* `column`: The column number in the generated source. Column numbers
in this library are 0-based.
* `bias`: Either `SourceMapConsumer.GREATEST_LOWER_BOUND` or
`SourceMapConsumer.LEAST_UPPER_BOUND`. Specifies whether to return the closest
element that is smaller than or greater than the one we are searching for,
respectively, if the exact element cannot be found. Defaults to
`SourceMapConsumer.GREATEST_LOWER_BOUND`.
and an object is returned with the following properties:
* `source`: The original source file, or null if this information is not
available.
* `line`: The line number in the original source, or null if this information is
not available. The line number is 1-based.
* `column`: The column number in the original source, or null if this
information is not available. The column number is 0-based.
* `name`: The original identifier, or null if this information is not available.
```js
consumer.originalPositionFor({ line: 2, column: 10 })
// { source: 'foo.coffee',
// line: 2,
// column: 2,
// name: null }
consumer.originalPositionFor({ line: 99999999999999999, column: 999999999999999 })
// { source: null,
// line: null,
// column: null,
// name: null }
```
#### SourceMapConsumer.prototype.generatedPositionFor(originalPosition)
Returns the generated line and column information for the original source,
line, and column positions provided. The only argument is an object with
the following properties:
* `source`: The filename of the original source.
* `line`: The line number in the original source. The line number is
1-based.
* `column`: The column number in the original source. The column
number is 0-based.
and an object is returned with the following properties:
* `line`: The line number in the generated source, or null. The line
number is 1-based.
* `column`: The column number in the generated source, or null. The
column number is 0-based.
```js
consumer.generatedPositionFor({ source: "example.js", line: 2, column: 10 })
// { line: 1,
// column: 56 }
```
#### SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition)
Returns all generated line and column information for the original source, line,
and column provided. If no column is provided, returns all mappings
corresponding to a either the line we are searching for or the next closest line
that has any mappings. Otherwise, returns all mappings corresponding to the
given line and either the column we are searching for or the next closest column
that has any offsets.
The only argument is an object with the following properties:
* `source`: The filename of the original source.
* `line`: The line number in the original source. The line number is
1-based.
* `column`: Optional. The column number in the original source. The
column number is 0-based.
and an array of objects is returned, each with the following properties:
* `line`: The line number in the generated source, or null. The line
number is 1-based.
* `column`: The column number in the generated source, or null. The
column number is 0-based.
```js
consumer.allGeneratedpositionsfor({ line: 2, source: "foo.coffee" })
// [ { line: 2,
// column: 1 },
// { line: 2,
// column: 10 },
// { line: 2,
// column: 20 } ]
```
#### SourceMapConsumer.prototype.hasContentsOfAllSources()
Return true if we have the embedded source content for every source listed in
the source map, false otherwise.
In other words, if this method returns `true`, then
`consumer.sourceContentFor(s)` will succeed for every source `s` in
`consumer.sources`.
```js
// ...
if (consumer.hasContentsOfAllSources()) {
consumerReadyCallback(consumer);
} else {
fetchSources(consumer, consumerReadyCallback);
}
// ...
```
#### SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing])
Returns the original source content for the source provided. The only
argument is the URL of the original source file.
If the source content for the given source is not found, then an error is
thrown. Optionally, pass `true` as the second param to have `null` returned
instead.
```js
consumer.sources
// [ "my-cool-lib.clj" ]
consumer.sourceContentFor("my-cool-lib.clj")
// "..."
consumer.sourceContentFor("this is not in the source map");
// Error: "this is not in the source map" is not in the source map
consumer.sourceContentFor("this is not in the source map", true);
// null
```
#### SourceMapConsumer.prototype.eachMapping(callback, context, order)
Iterate over each mapping between an original source/line/column and a
generated line/column in this source map.
* `callback`: The function that is called with each mapping. Mappings have the
form `{ source, generatedLine, generatedColumn, originalLine, originalColumn,
name }`
* `context`: Optional. If specified, this object will be the value of `this`
every time that `callback` is called.
* `order`: Either `SourceMapConsumer.GENERATED_ORDER` or
`SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to iterate over
the mappings sorted by the generated file's line/column order or the
original's source/line/column order, respectively. Defaults to
`SourceMapConsumer.GENERATED_ORDER`.
```js
consumer.eachMapping(function (m) { console.log(m); })
// ...
// { source: 'illmatic.js',
// generatedLine: 1,
// generatedColumn: 0,
// originalLine: 1,
// originalColumn: 0,
// name: null }
// { source: 'illmatic.js',
// generatedLine: 2,
// generatedColumn: 0,
// originalLine: 2,
// originalColumn: 0,
// name: null }
// ...
```
### SourceMapGenerator
An instance of the SourceMapGenerator represents a source map which is being
built incrementally.
#### new SourceMapGenerator([startOfSourceMap])
You may pass an object with the following properties:
* `file`: The filename of the generated source that this source map is
associated with.
* `sourceRoot`: A root for all relative URLs in this source map.
* `skipValidation`: Optional. When `true`, disables validation of mappings as
they are added. This can improve performance but should be used with
discretion, as a last resort. Even then, one should avoid using this flag when
running tests, if possible.
* `ignoreInvalidMapping`: Optional. When `true`, instead of throwing error on
invalid mapping, it will be ignored.
```js
var generator = new sourceMap.SourceMapGenerator({
file: "my-generated-javascript-file.js",
sourceRoot: "http://example.com/app/js/"
});
```
#### SourceMapGenerator.fromSourceMap(sourceMapConsumer, sourceMapGeneratorOptions)
Creates a new `SourceMapGenerator` from an existing `SourceMapConsumer` instance.
* `sourceMapConsumer` The SourceMap.
* `sourceMapGeneratorOptions` options that will be passed to the SourceMapGenerator constructor which used under the hood.
```js
var generator = sourceMap.SourceMapGenerator.fromSourceMap(consumer, {
ignoreInvalidMapping: true,
});
```
#### SourceMapGenerator.prototype.addMapping(mapping)
Add a single mapping from original source line and column to the generated
source's line and column for this source map being created. The mapping object
should have the following properties:
* `generated`: An object with the generated line and column positions.
* `original`: An object with the original line and column positions.
* `source`: The original source file (relative to the sourceRoot).
* `name`: An optional original token name for this mapping.
```js
generator.addMapping({
source: "module-one.scm",
original: { line: 128, column: 0 },
generated: { line: 3, column: 456 }
})
```
#### SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent)
Set the source content for an original source file.
* `sourceFile` the URL of the original source file.
* `sourceContent` the content of the source file.
```js
generator.setSourceContent("module-one.scm",
fs.readFileSync("path/to/module-one.scm"))
```
#### SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]])
Applies a SourceMap for a source file to the SourceMap.
Each mapping to the supplied source file is rewritten using the
supplied SourceMap. Note: The resolution for the resulting mappings
is the minimum of this map and the supplied map.
* `sourceMapConsumer`: The SourceMap to be applied.
* `sourceFile`: Optional. The filename of the source file.
If omitted, sourceMapConsumer.file will be used, if it exists.
Otherwise an error will be thrown.
* `sourceMapPath`: Optional. The dirname of the path to the SourceMap
to be applied. If relative, it is relative to the SourceMap.
This parameter is needed when the two SourceMaps aren't in the same
directory, and the SourceMap to be applied contains relative source
paths. If so, those relative source paths need to be rewritten
relative to the SourceMap.
If omitted, it is assumed that both SourceMaps are in the same directory,
thus not needing any rewriting. (Supplying `'.'` has the same effect.)
#### SourceMapGenerator.prototype.toString()
Renders the source map being generated to a string.
```js
generator.toString()
// '{"version":3,"sources":["module-one.scm"],"names":[],"mappings":"...snip...","file":"my-generated-javascript-file.js","sourceRoot":"http://example.com/app/js/"}'
```
### SourceNode
SourceNodes provide a way to abstract over interpolating and/or concatenating
snippets of generated JavaScript source code, while maintaining the line and
column information associated between those snippets and the original source
code. This is useful as the final intermediate representation a compiler might
use before outputting the generated JS and source map.
#### new SourceNode([line, column, source[, chunk[, name]]])
* `line`: The original line number associated with this source node, or null if
it isn't associated with an original line. The line number is 1-based.
* `column`: The original column number associated with this source node, or null
if it isn't associated with an original column. The column number
is 0-based.
* `source`: The original source's filename; null if no filename is provided.
* `chunk`: Optional. Is immediately passed to `SourceNode.prototype.add`, see
below.
* `name`: Optional. The original identifier.
```js
var node = new SourceNode(1, 2, "a.cpp", [
new SourceNode(3, 4, "b.cpp", "extern int status;\n"),
new SourceNode(5, 6, "c.cpp", "std::string* make_string(size_t n);\n"),
new SourceNode(7, 8, "d.cpp", "int main(int argc, char** argv) {}\n"),
]);
```
#### SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath])
Creates a SourceNode from generated code and a SourceMapConsumer.
* `code`: The generated code
* `sourceMapConsumer` The SourceMap for the generated code
* `relativePath` The optional path that relative sources in `sourceMapConsumer`
should be relative to.
```js
var consumer = new SourceMapConsumer(fs.readFileSync("path/to/my-file.js.map", "utf8"));
var node = SourceNode.fromStringWithSourceMap(fs.readFileSync("path/to/my-file.js"),
consumer);
```
#### SourceNode.prototype.add(chunk)
Add a chunk of generated JS to this source node.
* `chunk`: A string snippet of generated JS code, another instance of
`SourceNode`, or an array where each member is one of those things.
```js
node.add(" + ");
node.add(otherNode);
node.add([leftHandOperandNode, " + ", rightHandOperandNode]);
```
#### SourceNode.prototype.prepend(chunk)
Prepend a chunk of generated JS to this source node.
* `chunk`: A string snippet of generated JS code, another instance of
`SourceNode`, or an array where each member is one of those things.
```js
node.prepend("/** Build Id: f783haef86324gf **/\n\n");
```
#### SourceNode.prototype.setSourceContent(sourceFile, sourceContent)
Set the source content for a source file. This will be added to the
`SourceMap` in the `sourcesContent` field.
* `sourceFile`: The filename of the source file
* `sourceContent`: The content of the source file
```js
node.setSourceContent("module-one.scm",
fs.readFileSync("path/to/module-one.scm"))
```
#### SourceNode.prototype.walk(fn)
Walk over the tree of JS snippets in this node and its children. The walking
function is called once for each snippet of JS and is passed that snippet and
the its original associated source's line/column location.
* `fn`: The traversal function.
```js
var node = new SourceNode(1, 2, "a.js", [
new SourceNode(3, 4, "b.js", "uno"),
"dos",
[
"tres",
new SourceNode(5, 6, "c.js", "quatro")
]
]);
node.walk(function (code, loc) { console.log("WALK:", code, loc); })
// WALK: uno { source: 'b.js', line: 3, column: 4, name: null }
// WALK: dos { source: 'a.js', line: 1, column: 2, name: null }
// WALK: tres { source: 'a.js', line: 1, column: 2, name: null }
// WALK: quatro { source: 'c.js', line: 5, column: 6, name: null }
```
#### SourceNode.prototype.walkSourceContents(fn)
Walk over the tree of SourceNodes. The walking function is called for each
source file content and is passed the filename and source content.
* `fn`: The traversal function.
```js
var a = new SourceNode(1, 2, "a.js", "generated from a");
a.setSourceContent("a.js", "original a");
var b = new SourceNode(1, 2, "b.js", "generated from b");
b.setSourceContent("b.js", "original b");
var c = new SourceNode(1, 2, "c.js", "generated from c");
c.setSourceContent("c.js", "original c");
var node = new SourceNode(null, null, null, [a, b, c]);
node.walkSourceContents(function (source, contents) { console.log("WALK:", source, ":", contents); })
// WALK: a.js : original a
// WALK: b.js : original b
// WALK: c.js : original c
```
#### SourceNode.prototype.join(sep)
Like `Array.prototype.join` except for SourceNodes. Inserts the separator
between each of this source node's children.
* `sep`: The separator.
```js
var lhs = new SourceNode(1, 2, "a.rs", "my_copy");
var operand = new SourceNode(3, 4, "a.rs", "=");
var rhs = new SourceNode(5, 6, "a.rs", "orig.clone()");
var node = new SourceNode(null, null, null, [ lhs, operand, rhs ]);
var joinedNode = node.join(" ");
```
#### SourceNode.prototype.replaceRight(pattern, replacement)
Call `String.prototype.replace` on the very right-most source snippet. Useful
for trimming white space from the end of a source node, etc.
* `pattern`: The pattern to replace.
* `replacement`: The thing to replace the pattern with.
```js
// Trim trailing white space.
node.replaceRight(/\s*$/, "");
```
#### SourceNode.prototype.toString()
Return the string representation of this source node. Walks over the tree and
concatenates all the various snippets together to one string.
```js
var node = new SourceNode(1, 2, "a.js", [
new SourceNode(3, 4, "b.js", "uno"),
"dos",
[
"tres",
new SourceNode(5, 6, "c.js", "quatro")
]
]);
node.toString()
// 'unodostresquatro'
```
#### SourceNode.prototype.toStringWithSourceMap([startOfSourceMap])
Returns the string representation of this tree of source nodes, plus a
SourceMapGenerator which contains all the mappings between the generated and
original sources.
The arguments are the same as those to `new SourceMapGenerator`.
```js
var node = new SourceNode(1, 2, "a.js", [
new SourceNode(3, 4, "b.js", "uno"),
"dos",
[
"tres",
new SourceNode(5, 6, "c.js", "quatro")
]
]);
node.toStringWithSourceMap({ file: "my-output-file.js" })
// { code: 'unodostresquatro',
// map: [object SourceMapGenerator] }
```
@@ -0,0 +1,6 @@
export declare const isSameDayWithOptions: import("./types.js").FPFn3<
boolean,
import("../isSameDay.js").IsSameDayOptions | undefined,
string | number | Date,
string | number | Date
>;
@@ -0,0 +1,5 @@
/**
* http://ecma-international.org/ecma-402/7.0/index.html#sec-canonicalizelocalelist
* @param locales
*/
export declare function CanonicalizeLocaleList(locales?: string | ReadonlyArray<string>): string[];
@@ -0,0 +1,129 @@
import type { Integration, IntegrationFn } from '@sentry/core';
export declare const INTEGRATION_NAME = "WebWorker";
interface WebWorkerIntegration extends Integration {
addWorker: (worker: Worker) => void;
}
/**
* Use this integration to set up Sentry with web workers.
*
* IMPORTANT: This integration must be added **before** you start listening to
* any messages from the worker. Otherwise, your message handlers will receive
* messages from the Sentry SDK which you need to ignore.
*
* This integration only has an effect, if you call `Sentry.registerWebWorker(self)`
* from within the worker(s) you're adding to the integration.
*
* Given that you want to initialize the SDK as early as possible, you most likely
* want to add this integration **after** initializing the SDK:
*
* @example:
* ```ts filename={main.js}
* import * as Sentry from '@sentry/<your-sdk>';
*
* // some time earlier:
* Sentry.init(...)
*
* // 1. Initialize the worker
* const worker = new Worker(new URL('./worker.ts', import.meta.url));
*
* // 2. Add the integration
* const webWorkerIntegration = Sentry.webWorkerIntegration({ worker });
* Sentry.addIntegration(webWorkerIntegration);
*
* // 3. Register message listeners on the worker
* worker.addEventListener('message', event => {
* // ...
* });
* ```
*
* If you initialize multiple workers at the same time, you can also pass an array of workers
* to the integration:
*
* ```ts filename={main.js}
* const webWorkerIntegration = Sentry.webWorkerIntegration({ worker: [worker1, worker2] });
* Sentry.addIntegration(webWorkerIntegration);
* ```
*
* If you have any additional workers that you initialize at a later point,
* you can add them to the integration as follows:
*
* ```ts filename={main.js}
* const webWorkerIntegration = Sentry.webWorkerIntegration({ worker: worker1 });
* Sentry.addIntegration(webWorkerIntegration);
*
* // sometime later:
* webWorkerIntegration.addWorker(worker2);
* ```
*
* Of course, you can also directly add the integration in Sentry.init:
* ```ts filename={main.js}
* import * as Sentry from '@sentry/<your-sdk>';
*
* // 1. Initialize the worker
* const worker = new Worker(new URL('./worker.ts', import.meta.url));
*
* // 2. Initialize the SDK
* Sentry.init({
* integrations: [Sentry.webWorkerIntegration({ worker })]
* });
*
* // 3. Register message listeners on the worker
* worker.addEventListener('message', event => {
* // ...
* });
* ```
*
* @param options {WebWorkerIntegrationOptions} Integration options:
* - `worker`: The worker instance.
*/
export declare const webWorkerIntegration: IntegrationFn<WebWorkerIntegration>;
/**
* Minimal interface for DedicatedWorkerGlobalScope, only requiring the postMessage method.
* (which is the only thing we need from the worker's global object)
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/DedicatedWorkerGlobalScope
*
* We can't use the actual type because it breaks everyone who doesn't have {"lib": ["WebWorker"]}
* but uses {"skipLibCheck": true} in their tsconfig.json.
*/
interface MinimalDedicatedWorkerGlobalScope {
postMessage: (message: unknown) => void;
addEventListener: (type: string, listener: (event: unknown) => void) => void;
location?: {
href?: string;
};
}
interface RegisterWebWorkerOptions {
self: MinimalDedicatedWorkerGlobalScope & {
_sentryDebugIds?: Record<string, string>;
_sentryModuleMetadata?: Record<string, any>;
};
}
/**
* Use this function to register the worker with the Sentry SDK.
*
* This function will:
* - Send debug IDs to the parent thread
* - Send module metadata to the parent thread (for thirdPartyErrorFilterIntegration)
* - Set up a handler for unhandled rejections in the worker
* - Forward unhandled rejections to the parent thread for capture
*
* Note: Synchronous errors in workers are already captured by globalHandlers.
* This only handles unhandled promise rejections which don't bubble to the parent.
*
* @example
* ```ts filename={worker.js}
* import * as Sentry from '@sentry/<your-sdk>';
*
* // Do this as early as possible in your worker.
* Sentry.registerWebWorker({ self });
*
* // continue setting up your worker
* self.postMessage(...)
* ```
* @param options {RegisterWebWorkerOptions} Integration options:
* - `self`: The worker instance you're calling this function from (self).
*/
export declare function registerWebWorker({ self }: RegisterWebWorkerOptions): void;
export {};
//# sourceMappingURL=webWorker.d.ts.map
@@ -0,0 +1,38 @@
'use strict';
function checkDCE() {
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'
) {
return;
}
if (process.env.NODE_ENV !== 'production') {
// This branch is unreachable because this function is only called
// in production, but the condition is true only in development.
// Therefore if the branch is still here, dead code elimination wasn't
// properly applied.
// Don't change the message. React DevTools relies on it. Also make sure
// this message doesn't occur elsewhere in this function, or it will cause
// a false positive.
throw new Error('^_^');
}
try {
// Verify that the code above has been dead code eliminated (DCE'd).
__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
} catch (err) {
// DevTools shouldn't crash React, no matter what.
// We should still report in case we break this code.
console.error(err);
}
}
if (process.env.NODE_ENV === 'production') {
// DCE check should happen before ReactDOM bundle executes so that
// DevTools can report bad minification during injection.
checkDCE();
module.exports = require('./cjs/react-dom.production.js');
} else {
module.exports = require('./cjs/react-dom.development.js');
}
@@ -0,0 +1,25 @@
import { millisecondsInHour } from "./constants.js";
/**
* @name hoursToMilliseconds
* @category Conversion Helpers
* @summary Convert hours to milliseconds.
*
* @description
* Convert a number of hours to a full number of milliseconds.
*
* @param hours - number of hours to be converted
*
* @returns The number of hours converted to milliseconds
*
* @example
* // Convert 2 hours to milliseconds:
* const result = hoursToMilliseconds(2)
* //=> 7200000
*/
export function hoursToMilliseconds(hours) {
return Math.trunc(hours * millisecondsInHour);
}
// Fallback for modularized imports:
export default hoursToMilliseconds;
@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9saWIvZGVlcC13cml0YWJsZS9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgQnVpbHRpbiB9IGZyb20gXCIuLi9idWlsdC1pblwiO1xuaW1wb3J0IHsgSXNVbmtub3duIH0gZnJvbSBcIi4uL2lzLXVua25vd25cIjtcblxuZXhwb3J0IHR5cGUgRGVlcFdyaXRhYmxlPFR5cGU+ID0gVHlwZSBleHRlbmRzIEV4Y2x1ZGU8QnVpbHRpbiwgRXJyb3I+XG4gID8gVHlwZVxuICA6IFR5cGUgZXh0ZW5kcyBNYXA8aW5mZXIgS2V5LCBpbmZlciBWYWx1ZT5cbiAgPyBNYXA8RGVlcFdyaXRhYmxlPEtleT4sIERlZXBXcml0YWJsZTxWYWx1ZT4+XG4gIDogVHlwZSBleHRlbmRzIFJlYWRvbmx5TWFwPGluZmVyIEtleSwgaW5mZXIgVmFsdWU+XG4gID8gTWFwPERlZXBXcml0YWJsZTxLZXk+LCBEZWVwV3JpdGFibGU8VmFsdWU+PlxuICA6IFR5cGUgZXh0ZW5kcyBXZWFrTWFwPGluZmVyIEtleSwgaW5mZXIgVmFsdWU+XG4gID8gV2Vha01hcDxEZWVwV3JpdGFibGU8S2V5PiwgRGVlcFdyaXRhYmxlPFZhbHVlPj5cbiAgOiBUeXBlIGV4dGVuZHMgU2V0PGluZmVyIFZhbHVlcz5cbiAgPyBTZXQ8RGVlcFdyaXRhYmxlPFZhbHVlcz4+XG4gIDogVHlwZSBleHRlbmRzIFJlYWRvbmx5U2V0PGluZmVyIFZhbHVlcz5cbiAgPyBTZXQ8RGVlcFdyaXRhYmxlPFZhbHVlcz4+XG4gIDogVHlwZSBleHRlbmRzIFdlYWtTZXQ8aW5mZXIgVmFsdWVzPlxuICA/IFdlYWtTZXQ8RGVlcFdyaXRhYmxlPFZhbHVlcz4+XG4gIDogVHlwZSBleHRlbmRzIFByb21pc2U8aW5mZXIgVmFsdWU+XG4gID8gUHJvbWlzZTxEZWVwV3JpdGFibGU8VmFsdWU+PlxuICA6IFR5cGUgZXh0ZW5kcyB7fVxuICA/IHsgLXJlYWRvbmx5IFtLZXkgaW4ga2V5b2YgVHlwZV06IERlZXBXcml0YWJsZTxUeXBlW0tleV0+IH1cbiAgOiBJc1Vua25vd248VHlwZT4gZXh0ZW5kcyB0cnVlXG4gID8gdW5rbm93blxuICA6IFR5cGU7XG4iXX0=
@@ -0,0 +1,127 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
/** @typedef {import("../../declarations/WebpackOptions").ChunkLoadingType} ChunkLoadingType */
/** @typedef {import("../Compiler")} Compiler */
/** @typedef {Set<ChunkLoadingType>} ChunkLoadingTypes */
/** @type {WeakMap<Compiler, ChunkLoadingTypes>} */
const enabledTypes = new WeakMap();
/**
* @param {Compiler} compiler compiler
* @returns {ChunkLoadingTypes} enabled types
*/
const getEnabledTypes = (compiler) => {
let set = enabledTypes.get(compiler);
if (set === undefined) {
/** @type {ChunkLoadingTypes} */
set = new Set();
enabledTypes.set(compiler, set);
}
return set;
};
class EnableChunkLoadingPlugin {
/**
* @param {ChunkLoadingType} type library type that should be available
*/
constructor(type) {
this.type = type;
}
/**
* @param {Compiler} compiler the compiler instance
* @param {ChunkLoadingType} type type of library
* @returns {void}
*/
static setEnabled(compiler, type) {
getEnabledTypes(compiler).add(type);
}
/**
* @param {Compiler} compiler the compiler instance
* @param {ChunkLoadingType} type type of library
* @returns {void}
*/
static checkEnabled(compiler, type) {
if (!getEnabledTypes(compiler).has(type)) {
throw new Error(
`Chunk loading type "${type}" is not enabled. ` +
"EnableChunkLoadingPlugin need to be used to enable this type of chunk loading. " +
'This usually happens through the "output.enabledChunkLoadingTypes" option. ' +
'If you are using a function as entry which sets "chunkLoading", you need to add all potential chunk loading types to "output.enabledChunkLoadingTypes". ' +
`These types are enabled: ${[...getEnabledTypes(compiler)].join(", ")}`
);
}
}
/**
* Apply the plugin
* @param {Compiler} compiler the compiler instance
* @returns {void}
*/
apply(compiler) {
const { type } = this;
// Only enable once
const enabled = getEnabledTypes(compiler);
if (enabled.has(type)) return;
enabled.add(type);
if (typeof type === "string") {
switch (type) {
case "jsonp": {
const JsonpChunkLoadingPlugin = require("../web/JsonpChunkLoadingPlugin");
new JsonpChunkLoadingPlugin().apply(compiler);
break;
}
case "import-scripts": {
const ImportScriptsChunkLoadingPlugin = require("../webworker/ImportScriptsChunkLoadingPlugin");
new ImportScriptsChunkLoadingPlugin().apply(compiler);
break;
}
case "require": {
// @ts-expect-error https://github.com/microsoft/TypeScript/issues/41697
const CommonJsChunkLoadingPlugin = require("../node/CommonJsChunkLoadingPlugin");
new CommonJsChunkLoadingPlugin({
asyncChunkLoading: false
}).apply(compiler);
break;
}
case "async-node": {
// @ts-expect-error https://github.com/microsoft/TypeScript/issues/41697
const CommonJsChunkLoadingPlugin = require("../node/CommonJsChunkLoadingPlugin");
new CommonJsChunkLoadingPlugin({
asyncChunkLoading: true
}).apply(compiler);
break;
}
case "import":
case "universal": {
const ModuleChunkLoadingPlugin = require("../esm/ModuleChunkLoadingPlugin");
new ModuleChunkLoadingPlugin().apply(compiler);
break;
}
default:
throw new Error(`Unsupported chunk loading type ${type}.
Plugins which provide custom chunk loading types must call EnableChunkLoadingPlugin.setEnabled(compiler, type) to disable this error.`);
}
} else {
// TODO support plugin instances here
// apply them to the compiler
}
}
}
module.exports = EnableChunkLoadingPlugin;
@@ -0,0 +1,19 @@
/**
* @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 FileOutput = createLucideIcon("FileOutput", [
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
["path", { d: "M4 7V4a2 2 0 0 1 2-2 2 2 0 0 0-2 2", key: "1vk7w2" }],
["path", { d: "M4.063 20.999a2 2 0 0 0 2 1L18 22a2 2 0 0 0 2-2V7l-5-5H6", key: "1jink5" }],
["path", { d: "m5 11-3 3", key: "1dgrs4" }],
["path", { d: "m5 17-3-3h10", key: "1mvvaf" }]
]);
export { FileOutput as default };
//# sourceMappingURL=file-output.js.map
@@ -0,0 +1,19 @@
import { Config } from '../dist/tailwindcss';
import * as React_2 from 'react';
export declare interface EmailElementProps {
children?: React_2.ReactNode;
className?: string;
style?: React_2.CSSProperties;
}
export declare const Tailwind: React_2.FC<TailwindProps>;
export declare type TailwindConfig = Pick<Config, "important" | "prefix" | "separator" | "safelist" | "blocklist" | "presets" | "future" | "experimental" | "darkMode" | "theme" | "corePlugins" | "plugins">;
export declare interface TailwindProps {
children: React_2.ReactNode;
config?: TailwindConfig;
}
export { }
@@ -0,0 +1,61 @@
/**
* Returns a number indicating whether a reference string comes before, or after,
* or is the same as the given string in natural sort order.
*
* See: https://en.wikipedia.org/wiki/Natural_sort_order
*
*/
export function naturalCompare(aStr, bStr) {
let aIndex = 0;
let bIndex = 0;
while (aIndex < aStr.length && bIndex < bStr.length) {
let aChar = aStr.charCodeAt(aIndex);
let bChar = bStr.charCodeAt(bIndex);
if (isDigit(aChar) && isDigit(bChar)) {
let aNum = 0;
do {
++aIndex;
aNum = aNum * 10 + aChar - DIGIT_0;
aChar = aStr.charCodeAt(aIndex);
} while (isDigit(aChar) && aNum > 0);
let bNum = 0;
do {
++bIndex;
bNum = bNum * 10 + bChar - DIGIT_0;
bChar = bStr.charCodeAt(bIndex);
} while (isDigit(bChar) && bNum > 0);
if (aNum < bNum) {
return -1;
}
if (aNum > bNum) {
return 1;
}
} else {
if (aChar < bChar) {
return -1;
}
if (aChar > bChar) {
return 1;
}
++aIndex;
++bIndex;
}
}
return aStr.length - bStr.length;
}
const DIGIT_0 = 48;
const DIGIT_9 = 57;
function isDigit(code) {
return !isNaN(code) && DIGIT_0 <= code && code <= DIGIT_9;
}
@@ -0,0 +1 @@
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../src/types-hoist/feedback/theme.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
@@ -0,0 +1,172 @@
# pino-abstract-transport
[![npm version](https://img.shields.io/npm/v/pino-abstract-transport)](https://www.npmjs.com/package/pino-abstract-transport)
[![Build Status](https://img.shields.io/github/actions/workflow/status/pinojs/pino-abstract-transport/ci.yml?branch=main)](https://github.com/pinojs/pino-abstract-transport/actions)
[![Coverage Status](https://coveralls.io/repos/github/pinojs/pino-abstract-transport/badge.svg?branch=main)](https://coveralls.io/github/pinojs/pino-abstract-transport?branch=main)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://standardjs.com/)
Write Pino transports easily.
## Install
```sh
npm i pino-abstract-transport
```
## Usage
```js
import build from 'pino-abstract-transport'
export default async function (opts) {
return build(async function (source) {
for await (let obj of source) {
console.log(obj)
}
})
}
```
or in CommonJS and streams:
```js
'use strict'
const build = require('pino-abstract-transport')
module.exports = function (opts) {
return build(function (source) {
source.on('data', function (obj) {
console.log(obj)
})
})
}
```
## Typescript usage
Install the type definitions for node. Make sure the major version of the type definitions matches the node version you are using.
#### Node 16
```sh
npm i -D @types/node@16
```
## API
### build(fn, opts) => Stream
Create a [`split2`](http://npm.im/split2) instance and returns it.
This same instance is also passed to the given function, which is called
synchronously.
If `opts.transform` is `true`, `pino-abstract-transform` will
wrap the split2 instance and the returned stream using [`duplexify`](https://www.npmjs.com/package/duplexify),
so they can be concatenated into multiple transports.
#### Events emitted
In addition to all events emitted by a [`Readable`](https://nodejs.org/api/stream.html#stream_class_stream_readable)
stream, it emits the following events:
* `unknown` where an unparsable line is found, both the line and optional error is emitted.
#### Options
* `parse` an option to change to data format passed to build function. When this option is set to `lines`,
the data is passed as a string, otherwise the data is passed as an object. Default: `undefined`.
* `close(err, cb)` a function that is called to shutdown the transport. It's called both on error and non-error shutdowns.
It can also return a promise. In this case discard the the `cb` argument.
* `parseLine(line)` a function that is used to parse line received from `pino`.
* `expectPinoConfig` a boolean that indicates if the transport expects Pino to add some of its configuration to the stream. Default: `false`.
## Example
### custom parseLine
You can allow custom `parseLine` from users while providing a simple and safe default parseLine.
```js
'use strict'
const build = require('pino-abstract-transport')
function defaultParseLine (line) {
const obj = JSON.parse(line)
// property foo will be added on each line
obj.foo = 'bar'
return obj
}
module.exports = function (opts) {
const parseLine = typeof opts.parseLine === 'function' ? opts.parseLine : defaultParseLine
return build(function (source) {
source.on('data', function (obj) {
console.log(obj)
})
}, {
parseLine: parseLine
})
}
```
### Stream concatenation / pipeline
You can pipeline multiple transports:
```js
const build = require('pino-abstract-transport')
const { Transform, pipeline } = require('stream')
function buildTransform () {
return build(function (source) {
return new Transform({
objectMode: true,
autoDestroy: true,
transform (line, enc, cb) {
line.service = 'bob'
cb(null, JSON.stringify(line))
}
})
}, { enablePipelining: true })
}
function buildDestination () {
return build(function (source) {
source.on('data', function (obj) {
console.log(obj)
})
})
}
pipeline(process.stdin, buildTransform(), buildDestination(), function (err) {
console.log('pipeline completed!', err)
})
```
### Using pino config
Setting `expectPinoConfig` to `true` will make the transport wait for pino to send its configuration before starting to process logs. It will add `levels`, `messageKey` and `errorKey` to the stream.
When used with an incompatible version of pino, the stream will immediately error.
```js
import build from 'pino-abstract-transport'
export default function (opts) {
return build(async function (source) {
for await (const obj of source) {
console.log(`[${source.levels.labels[obj.level]}]: ${obj[source.messageKey]}`)
}
}, {
expectPinoConfig: true
})
}
```
## License
MIT
@@ -0,0 +1,8 @@
"use strict";
exports.differenceInBusinessDays = void 0;
var _index = require("../differenceInBusinessDays.cjs");
var _index2 = require("./_lib/convertToFP.cjs"); // This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
const differenceInBusinessDays = (exports.differenceInBusinessDays = (0,
_index2.convertToFP)(_index.differenceInBusinessDays, 2));
@@ -0,0 +1 @@
{"version":3,"file":"circle-arrow-out-down-left.js","sources":["../../../src/icons/circle-arrow-out-down-left.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name CircleArrowOutDownLeft\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMiAxMmExMCAxMCAwIDEgMSAxMCAxMCIgLz4KICA8cGF0aCBkPSJtMiAyMiAxMC0xMCIgLz4KICA8cGF0aCBkPSJNOCAyMkgydi02IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/circle-arrow-out-down-left\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 CircleArrowOutDownLeft = createLucideIcon('CircleArrowOutDownLeft', [\n ['path', { d: 'M2 12a10 10 0 1 1 10 10', key: '1yn6ov' }],\n ['path', { d: 'm2 22 10-10', key: '28ilpk' }],\n ['path', { d: 'M8 22H2v-6', key: 'sulq54' }],\n]);\n\nexport default CircleArrowOutDownLeft;\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,CAAA,CAAA,CAAA,CAAyB,iBAAiB,wBAA0B,CAAA,CAAA,CAAA;AAAA,CAAA,CACxE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA2B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CACxD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAe,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC5C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC7C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,11 @@
import type { EditorProps } from '@monaco-editor/react';
export type Props = {
maxHeight?: number;
/**
* @default 56 (3 lines)
*/
minHeight?: number;
readOnly?: boolean;
recalculatedHeightAt?: number;
} & EditorProps;
//# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,9 @@
// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
import { endOfYear as fn } from "../endOfYear.js";
import { convertToFP } from "./_lib/convertToFP.js";
export const endOfYearWithOptions = convertToFP(fn, 2);
// Fallback for modularized imports:
export default endOfYearWithOptions;
@@ -0,0 +1,5 @@
export declare const add: import("./types.js").FPFn2<
Date,
import("../fp.js").Duration,
string | number | Date
>;
@@ -0,0 +1 @@
{"version":3,"file":"buildFallbackLocaleInputType.d.ts","sourceRoot":"","sources":["../../src/schema/buildFallbackLocaleInputType.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAA;AAE1D,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAIzC,eAAO,MAAM,4BAA4B,iBACzB,2BAA2B,KACxC,eAaF,CAAA"}
@@ -0,0 +1,3 @@
export * from "./driver.js";
export * from "./query.js";
export * from "./session.js";
@@ -0,0 +1,37 @@
import { constructFrom } from "./constructFrom.js";
import { toDate } from "./toDate.js";
/**
* The {@link getDaysInMonth} function options.
*/
/**
* @name getDaysInMonth
* @category Month Helpers
* @summary Get the number of days in a month of the given date.
*
* @description
* Get the number of days in a month of the given date, considering the context if provided.
*
* @param date - The given date
* @param options - An object with options
*
* @returns The number of days in a month
*
* @example
* // How many days are in February 2000?
* const result = getDaysInMonth(new Date(2000, 1))
* //=> 29
*/
export function getDaysInMonth(date, options) {
const _date = toDate(date, options?.in);
const year = _date.getFullYear();
const monthIndex = _date.getMonth();
const lastDayOfMonth = constructFrom(_date, 0);
lastDayOfMonth.setFullYear(year, monthIndex + 1, 0);
lastDayOfMonth.setHours(0, 0, 0, 0);
return lastDayOfMonth.getDate();
}
// Fallback for modularized imports:
export default getDaysInMonth;
@@ -0,0 +1,29 @@
import { readdir, readFile } from 'node:fs';
import type { AppContext, DeviceContext } from '@sentry/core';
export declare const readFileAsync: typeof readFile.__promisify__;
export declare const readDirAsync: typeof readdir.__promisify__;
interface DeviceContextOptions {
cpu?: boolean;
memory?: boolean;
}
interface ContextOptions {
app?: boolean;
os?: boolean;
device?: DeviceContextOptions | boolean;
culture?: boolean;
cloudResource?: boolean;
}
/**
* Capture context about the environment and the device that the client is running on, to events.
*/
export declare const nodeContextIntegration: (options?: ContextOptions | undefined) => import("@sentry/core").Integration;
/**
* Get app context information from process
*/
export declare function getAppContext(): AppContext;
/**
* Gets device information from os
*/
export declare function getDeviceContext(deviceOpt: DeviceContextOptions | true): DeviceContext;
export {};
//# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"legacy.js","sourceRoot":"https://raw.githubusercontent.com/fb55/domutils/0ab8bcf1ecfc70dfc93291a4cb2496578ac25e9c/src/","sources":["legacy.ts"],"names":[],"mappings":";;AA+GA,kCAGC;AAYD,kCAQC;AAWD,wCAOC;AAYD,oDAYC;AAYD,wDAYC;AAYD,oDAOC;AA3ND,yCAA6D;AAE7D,6CAAgD;AAqBhD;;GAEG;AACH,IAAM,MAAM,GAGR;IACA,QAAQ,YAAC,IAAI;QACT,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE,CAAC;YAC7B,OAAO,UAAC,IAAa,IAAK,OAAA,IAAA,kBAAK,EAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAA9B,CAA8B,CAAC;QAC7D,CAAC;aAAM,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YACtB,OAAO,kBAAK,CAAC;QACjB,CAAC;QACD,OAAO,UAAC,IAAa,IAAK,OAAA,IAAA,kBAAK,EAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,EAAjC,CAAiC,CAAC;IAChE,CAAC;IACD,QAAQ,YAAC,IAAI;QACT,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE,CAAC;YAC7B,OAAO,UAAC,IAAa,IAAK,OAAA,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAf,CAAe,CAAC;QAC9C,CAAC;QACD,OAAO,UAAC,IAAa,IAAK,OAAA,IAAI,CAAC,IAAI,KAAK,IAAI,EAAlB,CAAkB,CAAC;IACjD,CAAC;IACD,YAAY,YAAC,IAAI;QACb,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE,CAAC;YAC7B,OAAO,UAAC,IAAa,IAAK,OAAA,IAAA,mBAAM,EAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAA/B,CAA+B,CAAC;QAC9D,CAAC;QACD,OAAO,UAAC,IAAa,IAAK,OAAA,IAAA,mBAAM,EAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,EAAlC,CAAkC,CAAC;IACjE,CAAC;CACJ,CAAC;AAEF;;;;;;;;GAQG;AACH,SAAS,cAAc,CACnB,MAAc,EACd,KAAwD;IAExD,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE,CAAC;QAC9B,OAAO,UAAC,IAAa,IAAK,OAAA,IAAA,kBAAK,EAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EAA1C,CAA0C,CAAC;IACzE,CAAC;IACD,OAAO,UAAC,IAAa,IAAK,OAAA,IAAA,kBAAK,EAAC,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,KAAK,EAA7C,CAA6C,CAAC;AAC5E,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,YAAY,CAAC,CAAW,EAAE,CAAW;IAC1C,OAAO,UAAC,IAAa,IAAK,OAAA,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAlB,CAAkB,CAAC;AACjD,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,WAAW,CAAC,OAAwB;IACzC,IAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,UAAC,GAAG;QACvC,IAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QAC3B,OAAO,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC;YACpD,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC;YACpB,CAAC,CAAC,cAAc,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;IAEH,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;AAClE,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,WAAW,CAAC,OAAwB,EAAE,IAAa;IAC/D,IAAM,IAAI,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;IAClC,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACpC,CAAC;AAED;;;;;;;;;GASG;AACH,SAAgB,WAAW,CACvB,OAAwB,EACxB,KAA0B,EAC1B,OAAgB,EAChB,KAAwB;IAAxB,sBAAA,EAAA,gBAAwB;IAExB,IAAM,IAAI,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;IAClC,OAAO,IAAI,CAAC,CAAC,CAAC,IAAA,oBAAM,EAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC3D,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,cAAc,CAC1B,EAAsC,EACtC,KAA0B,EAC1B,OAAc;IAAd,wBAAA,EAAA,cAAc;IAEd,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,KAAK,GAAG,CAAC,KAAK,CAAC,CAAC;IAC3C,OAAO,IAAA,qBAAO,EAAC,cAAc,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;AAC7D,CAAC;AAED;;;;;;;;;GASG;AACH,SAAgB,oBAAoB,CAChC,OAA6C,EAC7C,KAA0B,EAC1B,OAAc,EACd,KAAwB;IADxB,wBAAA,EAAA,cAAc;IACd,sBAAA,EAAA,gBAAwB;IAExB,OAAO,IAAA,oBAAM,EACT,MAAM,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,EAC3B,KAAK,EACL,OAAO,EACP,KAAK,CACK,CAAC;AACnB,CAAC;AAED;;;;;;;;;GASG;AACH,SAAgB,sBAAsB,CAClC,SAA+C,EAC/C,KAA0B,EAC1B,OAAc,EACd,KAAwB;IADxB,wBAAA,EAAA,cAAc;IACd,sBAAA,EAAA,gBAAwB;IAExB,OAAO,IAAA,oBAAM,EACT,cAAc,CAAC,OAAO,EAAE,SAAS,CAAC,EAClC,KAAK,EACL,OAAO,EACP,KAAK,CACK,CAAC;AACnB,CAAC;AAED;;;;;;;;;GASG;AACH,SAAgB,oBAAoB,CAChC,IAAoD,EACpD,KAA0B,EAC1B,OAAc,EACd,KAAwB;IADxB,wBAAA,EAAA,cAAc;IACd,sBAAA,EAAA,gBAAwB;IAExB,OAAO,IAAA,oBAAM,EAAC,MAAM,CAAC,UAAU,CAAC,CAAC,IAAc,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AAC7E,CAAC"}
@@ -0,0 +1 @@
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../src/auth/strategies/local/register.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAA;AACrF,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAqB,MAAM,yBAAyB,CAAA;AAMhF,KAAK,IAAI,GAAG;IACV,UAAU,EAAE,yBAAyB,CAAA;IACrC,GAAG,EAAE,UAAU,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,OAAO,CAAA;IAChB,GAAG,EAAE,cAAc,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,qBAAqB,iDAM/B,IAAI,KAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA0ExC,CAAA"}
@@ -0,0 +1,32 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.safeParseAsync = exports.safeParse = exports.parseAsync = exports.parse = void 0;
const core = __importStar(require("../core/index.cjs"));
const errors_js_1 = require("./errors.cjs");
exports.parse = core._parse(errors_js_1.ZodRealError);
exports.parseAsync = core._parseAsync(errors_js_1.ZodRealError);
exports.safeParse = core._safeParse(errors_js_1.ZodRealError);
exports.safeParseAsync = core._safeParseAsync(errors_js_1.ZodRealError);
@@ -0,0 +1,4 @@
import { CSSValue } from '../../syntax/parser';
import { CSSLinearGradientImage } from '../image';
import { Context } from '../../../core/context';
export declare const linearGradient: (context: Context, tokens: CSSValue[]) => CSSLinearGradientImage;
@@ -0,0 +1,33 @@
import React from 'react';
/**
* All fields are wrapped in a `FieldPathContext` provider by default.
* The `useFieldPath` hook will return this value if it exists, not the path the field was explicitly given.
* This means if you render a field directly, you will need to wrap it with a new `FieldPathContext` provider.
* Otherwise, it will return the parent's path, not the path it was explicitly given.
* @example
* ```tsx
* 'use client'
* import React from 'react'
* import { TextField, FieldPathContext } from '@payloadcms/ui'
* import type { TextFieldClientComponent } from 'payload'
*
* export const MyCustomField: TextFieldClientComponent = (props) => {
* return (
* <FieldPathContext value="path.to.some.other.field">
* <TextField {...props} />
* </FieldPathContext>
* )
* }
* ```
*
* @experimental This is an experimental API and may change at any time. Use at your own risk.
*/
export declare const FieldPathContext: React.Context<string>;
/**
* Gets the current field path from the nearest `FieldPathContext` provider.
* All fields are wrapped in this context by default.
*
* @experimental This is an experimental API and may change at any time. Use at your own risk.
*/
export declare const useFieldPath: () => string;
//# sourceMappingURL=context.d.ts.map
@@ -0,0 +1,142 @@
"use strict";
exports.match = void 0;
var _index = require("../../_lib/buildMatchFn.js");
var _index2 = require("../../_lib/buildMatchPatternFn.js");
const matchOrdinalNumberPattern = /^(\d+)(-?(е|й|є|а|я))?/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^((до )?н\.?\s?е\.?)/i,
abbreviated: /^((до )?н\.?\s?е\.?)/i,
wide: /^(до нашої ери|нашої ери|наша ера)/i,
};
const parseEraPatterns = {
any: [/^д/i, /^н/i],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^[1234](-?[иі]?й?)? кв.?/i,
wide: /^[1234](-?[иі]?й?)? квартал/i,
};
const parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i],
};
const matchMonthPatterns = {
narrow: /^[слбктчвжг]/i,
abbreviated:
/^(січ|лют|бер(ез)?|квіт|трав|черв|лип|серп|вер(ес)?|жовт|лис(топ)?|груд)\.?/i,
wide: /^(січень|січня|лютий|лютого|березень|березня|квітень|квітня|травень|травня|червня|червень|липень|липня|серпень|серпня|вересень|вересня|жовтень|жовтня|листопад[а]?|грудень|грудня)/i,
};
const parseMonthPatterns = {
narrow: [
/^с/i,
/^л/i,
/^б/i,
/^к/i,
/^т/i,
/^ч/i,
/^л/i,
/^с/i,
/^в/i,
/^ж/i,
/^л/i,
/^г/i,
],
any: [
/^сі/i,
/^лю/i,
/^б/i,
/^к/i,
/^т/i,
/^ч/i,
/^лип/i,
/^се/i,
/^в/i,
/^ж/i,
/^лис/i,
/^г/i,
],
};
const matchDayPatterns = {
narrow: /^[нпвсч]/i,
short: /^(нд|пн|вт|ср|чт|пт|сб)\.?/i,
abbreviated: /^(нед|пон|вів|сер|че?тв|птн?|суб)\.?/i,
wide: /^(неділ[яі]|понеділ[ок][ка]|вівтор[ок][ка]|серед[аи]|четвер(га)?|п\W*?ятниц[яі]|субот[аи])/i,
};
const parseDayPatterns = {
narrow: [/^н/i, /^п/i, /^в/i, /^с/i, /^ч/i, /^п/i, /^с/i],
any: [/^н/i, /^п[он]/i, /^в/i, /^с[ер]/i, /^ч/i, /^п\W*?[ят]/i, /^с[уб]/i],
};
const matchDayPeriodPatterns = {
narrow: /^([дп]п|півн\.?|пол\.?|ранок|ранку|день|дня|веч\.?|ніч|ночі)/i,
abbreviated: /^([дп]п|півн\.?|пол\.?|ранок|ранку|день|дня|веч\.?|ніч|ночі)/i,
wide: /^([дп]п|північ|полудень|ранок|ранку|день|дня|вечір|вечора|ніч|ночі)/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^дп/i,
pm: /^пп/i,
midnight: /^півн/i,
noon: /^пол/i,
morning: /^р/i,
afternoon: /^д[ен]/i,
evening: /^в/i,
night: /^н/i,
},
};
const match = (exports.match = {
ordinalNumber: (0, _index2.buildMatchPatternFn)({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: (value) => parseInt(value, 10),
}),
era: (0, _index.buildMatchFn)({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any",
}),
quarter: (0, _index.buildMatchFn)({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: (index) => index + 1,
}),
month: (0, _index.buildMatchFn)({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any",
}),
day: (0, _index.buildMatchFn)({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: (0, _index.buildMatchFn)({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
});
@@ -0,0 +1 @@
{"version":3,"file":"node-postgres.d.ts","sourceRoot":"","sources":["../../src/drizzle-proxy/node-postgres.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAA"}
@@ -0,0 +1,11 @@
export const idToUUID = (fields)=>fields.map((field)=>{
if ('name' in field && field.name === 'id') {
return {
...field,
name: '_uuid'
};
}
return field;
});
//# sourceMappingURL=idToUUID.js.map
@@ -0,0 +1,25 @@
import { getTranslation } from '@payloadcms/translations';
import { generateMetadata } from '../../utilities/meta.js';
export const generateCollectionFolderMetadata = async args => {
const {
collectionConfig,
config,
i18n
} = args;
let title = '';
const description = '';
const keywords = '';
if (collectionConfig) {
title = getTranslation(collectionConfig.labels.singular, i18n);
}
title = `${title ? `${title} ` : title}${i18n.t('folder:folders')}`;
return generateMetadata({
...(config.admin.meta || {}),
description,
keywords,
serverURL: config.serverURL,
title,
...(collectionConfig?.admin?.meta || {})
});
};
//# sourceMappingURL=metadata.js.map
@@ -0,0 +1,134 @@
import { useContext, useRef, useInsertionEffect, useEffect } from 'react';
import { PresenceContext } from '../../context/PresenceContext.mjs';
import { MotionContext } from '../../context/MotionContext/index.mjs';
import { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs';
import { LazyContext } from '../../context/LazyContext.mjs';
import { MotionConfigContext } from '../../context/MotionConfigContext.mjs';
import { optimizedAppearDataAttribute } from '../../animation/optimized-appear/data-id.mjs';
import { microtask } from '../../frameloop/microtask.mjs';
import { isRefObject } from '../../utils/is-ref-object.mjs';
import { SwitchLayoutGroupContext } from '../../context/SwitchLayoutGroupContext.mjs';
function useVisualElement(Component, visualState, props, createVisualElement, ProjectionNodeConstructor) {
var _a, _b;
const { visualElement: parent } = useContext(MotionContext);
const lazyContext = useContext(LazyContext);
const presenceContext = useContext(PresenceContext);
const reducedMotionConfig = useContext(MotionConfigContext).reducedMotion;
const visualElementRef = useRef(null);
/**
* If we haven't preloaded a renderer, check to see if we have one lazy-loaded
*/
createVisualElement = createVisualElement || lazyContext.renderer;
if (!visualElementRef.current && createVisualElement) {
visualElementRef.current = createVisualElement(Component, {
visualState,
parent,
props,
presenceContext,
blockInitialAnimation: presenceContext
? presenceContext.initial === false
: false,
reducedMotionConfig,
});
}
const visualElement = visualElementRef.current;
/**
* Load Motion gesture and animation features. These are rendered as renderless
* components so each feature can optionally make use of React lifecycle methods.
*/
const initialLayoutGroupConfig = useContext(SwitchLayoutGroupContext);
if (visualElement &&
!visualElement.projection &&
ProjectionNodeConstructor &&
(visualElement.type === "html" || visualElement.type === "svg")) {
createProjectionNode(visualElementRef.current, props, ProjectionNodeConstructor, initialLayoutGroupConfig);
}
const isMounted = useRef(false);
useInsertionEffect(() => {
/**
* Check the component has already mounted before calling
* `update` unnecessarily. This ensures we skip the initial update.
*/
if (visualElement && isMounted.current) {
visualElement.update(props, presenceContext);
}
});
/**
* Cache this value as we want to know whether HandoffAppearAnimations
* was present on initial render - it will be deleted after this.
*/
const optimisedAppearId = props[optimizedAppearDataAttribute];
const wantsHandoff = useRef(Boolean(optimisedAppearId) &&
!((_a = window.MotionHandoffIsComplete) === null || _a === void 0 ? void 0 : _a.call(window, optimisedAppearId)) &&
((_b = window.MotionHasOptimisedAnimation) === null || _b === void 0 ? void 0 : _b.call(window, optimisedAppearId)));
useIsomorphicLayoutEffect(() => {
if (!visualElement)
return;
isMounted.current = true;
window.MotionIsMounted = true;
visualElement.updateFeatures();
microtask.render(visualElement.render);
/**
* Ideally this function would always run in a useEffect.
*
* However, if we have optimised appear animations to handoff from,
* it needs to happen synchronously to ensure there's no flash of
* incorrect styles in the event of a hydration error.
*
* So if we detect a situtation where optimised appear animations
* are running, we use useLayoutEffect to trigger animations.
*/
if (wantsHandoff.current && visualElement.animationState) {
visualElement.animationState.animateChanges();
}
});
useEffect(() => {
if (!visualElement)
return;
if (!wantsHandoff.current && visualElement.animationState) {
visualElement.animationState.animateChanges();
}
if (wantsHandoff.current) {
// This ensures all future calls to animateChanges() in this component will run in useEffect
queueMicrotask(() => {
var _a;
(_a = window.MotionHandoffMarkAsComplete) === null || _a === void 0 ? void 0 : _a.call(window, optimisedAppearId);
});
wantsHandoff.current = false;
}
});
return visualElement;
}
function createProjectionNode(visualElement, props, ProjectionNodeConstructor, initialPromotionConfig) {
const { layoutId, layout, drag, dragConstraints, layoutScroll, layoutRoot, } = props;
visualElement.projection = new ProjectionNodeConstructor(visualElement.latestValues, props["data-framer-portal-id"]
? undefined
: getClosestProjectingNode(visualElement.parent));
visualElement.projection.setOptions({
layoutId,
layout,
alwaysMeasureLayout: Boolean(drag) || (dragConstraints && isRefObject(dragConstraints)),
visualElement,
/**
* TODO: Update options in an effect. This could be tricky as it'll be too late
* to update by the time layout animations run.
* We also need to fix this safeToRemove by linking it up to the one returned by usePresence,
* ensuring it gets called if there's no potential layout animations.
*
*/
animationType: typeof layout === "string" ? layout : "both",
initialPromotionConfig,
layoutScroll,
layoutRoot,
});
}
function getClosestProjectingNode(visualElement) {
if (!visualElement)
return undefined;
return visualElement.options.allowProjection !== false
? visualElement.projection
: getClosestProjectingNode(visualElement.parent);
}
export { useVisualElement };
@@ -0,0 +1 @@
{"version":3,"sources":["../../src/utilities/isPlainObject.ts"],"sourcesContent":["import { isReactComponentOrFunction } from './isReactComponent.js'\n\nexport function isPlainObject(o: any): boolean {\n // Is this a React component?\n if (isReactComponentOrFunction(o)) {\n return false\n }\n\n // from https://github.com/fastify/deepmerge/blob/master/index.js#L77\n return typeof o === 'object' && o !== null && !(o instanceof RegExp) && !(o instanceof Date)\n}\n"],"names":["isReactComponentOrFunction","isPlainObject","o","RegExp","Date"],"mappings":"AAAA,SAASA,0BAA0B,QAAQ,wBAAuB;AAElE,OAAO,SAASC,cAAcC,CAAM;IAClC,6BAA6B;IAC7B,IAAIF,2BAA2BE,IAAI;QACjC,OAAO;IACT;IAEA,qEAAqE;IACrE,OAAO,OAAOA,MAAM,YAAYA,MAAM,QAAQ,CAAEA,CAAAA,aAAaC,MAAK,KAAM,CAAED,CAAAA,aAAaE,IAAG;AAC5F"}
@@ -0,0 +1,79 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GraphQLDate = exports.GraphQLDateConfig = void 0;
/**
* Copyright (c) 2017, Dirk-Jan Rutten
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
const graphql_1 = require("graphql");
const error_js_1 = require("../../error.js");
const formatter_js_1 = require("./formatter.js");
const validator_js_1 = require("./validator.js");
exports.GraphQLDateConfig = {
name: 'Date',
description: 'A date string, such as 2007-12-03, compliant with the `full-date` ' +
'format outlined in section 5.6 of the RFC 3339 profile of the ' +
'ISO 8601 standard for representation of dates and times using ' +
'the Gregorian calendar.',
serialize(value) {
if (value instanceof Date) {
if ((0, validator_js_1.validateJSDate)(value)) {
return (0, formatter_js_1.serializeDate)(value);
}
throw (0, error_js_1.createGraphQLError)('Date cannot represent an invalid Date instance');
}
else if (typeof value === 'string') {
if ((0, validator_js_1.validateDate)(value)) {
return value;
}
throw (0, error_js_1.createGraphQLError)(`Date cannot represent an invalid date-string ${value}.`);
}
else {
throw (0, error_js_1.createGraphQLError)('Date cannot represent a non string, or non Date type ' + JSON.stringify(value));
}
},
parseValue(value) {
if (!(typeof value === 'string')) {
throw (0, error_js_1.createGraphQLError)(`Date cannot represent non string type ${JSON.stringify(value)}`);
}
if ((0, validator_js_1.validateDate)(value)) {
return (0, formatter_js_1.parseDate)(value);
}
throw (0, error_js_1.createGraphQLError)(`Date cannot represent an invalid date-string ${value}.`);
},
parseLiteral(ast) {
if (ast.kind !== graphql_1.Kind.STRING) {
throw (0, error_js_1.createGraphQLError)(`Date cannot represent non string type ${'value' in ast && ast.value}`, { nodes: ast });
}
const { value } = ast;
if ((0, validator_js_1.validateDate)(value)) {
return (0, formatter_js_1.parseDate)(value);
}
throw (0, error_js_1.createGraphQLError)(`Date cannot represent an invalid date-string ${String(value)}.`, {
nodes: ast,
});
},
extensions: {
codegenScalarType: 'Date | string',
jsonSchema: {
type: 'string',
format: 'date',
},
},
};
/**
* An RFC 3339 compliant date scalar.
*
* Input:
* This scalar takes an RFC 3339 date string as input and
* parses it to a javascript Date.
*
* Output:
* This scalar serializes javascript Dates and
* RFC 3339 date strings to RFC 3339 date strings.
*/
exports.GraphQLDate = new graphql_1.GraphQLScalarType(exports.GraphQLDateConfig);

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