fix(products): fix breadcrumbs and product filtering (backport from main)
Some checks failed
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

View File

@@ -0,0 +1,41 @@
"use strict";
exports.formatLong = void 0;
var _index = require("../../_lib/buildFormatLongFn.cjs");
const dateFormats = {
full: "d MMMM y EEEE",
long: "d MMMM y",
medium: "d MMM y",
short: "dd.MM.yyyy",
};
const timeFormats = {
full: "HH:mm:ss zzzz",
long: "HH:mm:ss z",
medium: "HH:mm:ss",
short: "HH:mm",
};
const dateTimeFormats = {
full: "{{date}} 'saat' {{time}}",
long: "{{date}} 'saat' {{time}}",
medium: "{{date}}, {{time}}",
short: "{{date}}, {{time}}",
};
const formatLong = (exports.formatLong = {
date: (0, _index.buildFormatLongFn)({
formats: dateFormats,
defaultWidth: "full",
}),
time: (0, _index.buildFormatLongFn)({
formats: timeFormats,
defaultWidth: "full",
}),
dateTime: (0, _index.buildFormatLongFn)({
formats: dateTimeFormats,
defaultWidth: "full",
}),
});

View File

@@ -0,0 +1,30 @@
/**
* Checks if `value` is a plain object, that is, an object created by the
* `Object` constructor or one with a `[[Prototype]]` of `null`.
*
* @static
* @memberOf _
* @since 0.8.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
* @example
*
* function Foo() {
* this.a = 1;
* }
*
* _.isPlainObject(new Foo);
* // => false
*
* _.isPlainObject([1, 2, 3]);
* // => false
*
* _.isPlainObject({ 'x': 0, 'y': 0 });
* // => true
*
* _.isPlainObject(Object.create(null));
* // => true
*/
export declare function isPlainObject(value: any): boolean;
//# sourceMappingURL=lodash.merge.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"hu.d.ts","sourceRoot":"","sources":["../../../src/exports/i18n/hu.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,uCAAuC,CAAA"}

View File

@@ -0,0 +1,21 @@
(function () {
if (typeof Prism === 'undefined' || typeof document === 'undefined') {
return;
}
Prism.hooks.add('before-sanity-check', function (env) {
if (env.code) {
var pre = env.element.parentNode;
var clsReg = /(?:^|\s)keep-initial-line-feed(?:\s|$)/;
if (
pre && pre.nodeName.toLowerCase() === 'pre' &&
// Apply only if nor the <pre> or the <code> have the class
(!clsReg.test(pre.className) && !clsReg.test(env.element.className))
) {
env.code = env.code.replace(/^(?:\r?\n|\r)/, '');
}
}
});
}());

View File

@@ -0,0 +1,114 @@
'use client';
import { dequal } from 'dequal/lite'; // lite: no need for Map and Set support
/**
* This function receives form state from the server and intelligently merges it into the client state.
* The server contains extra properties that the client may not have, e.g. custom components and error states.
* We typically do not want to merge properties that rely on user input, however, such as values, unless explicitly requested.
* Doing this would cause the client to lose any local changes to those fields.
*
* Note: Local state is the source of truth, not the new server state that is getting merged in. This is critical for array row
* manipulation specifically, where the user may have added, removed, or reordered rows while a request was pending and is now stale.
*
* This function applies some defaults, as well as cleans up the server response in preparation for the client.
* e.g. it will set `valid` and `passesCondition` to true if undefined, and remove `addedByServer` from the response.
*/
export const mergeServerFormState = ({
acceptValues,
currentState = {},
incomingState
}) => {
const newState = {
...currentState
};
for (const [path, incomingField] of Object.entries(incomingState || {})) {
if (!(path in currentState) && !incomingField.addedByServer) {
continue;
}
/**
* If it's a new field added by the server, always accept the value.
* Otherwise:
* a. accept all values when explicitly requested, e.g. on submit
* b. only accept values for unmodified fields, e.g. on autosave
*/
const shouldAcceptValue = incomingField.addedByServer || acceptValues === true || typeof acceptValues === 'object' && acceptValues !== null &&
// Note: Must be explicitly `false`, allow `null` or `undefined` to mean true
acceptValues.overrideLocalChanges === false && !currentState[path]?.isModified;
let sanitizedIncomingField = incomingField;
if (!shouldAcceptValue) {
/**
* Note: do not delete properties off `incomingField` as this will mutate the original object
* Instead, omit them from the destructured object by excluding specific keys
* This will also ensure we don't set `undefined` into the result unnecessarily
*/
const {
initialValue,
value,
...rest
} = incomingField;
sanitizedIncomingField = rest;
}
newState[path] = {
...currentState[path],
...sanitizedIncomingField
};
if (currentState[path] && 'errorPaths' in currentState[path] && !('errorPaths' in incomingField)) {
newState[path].errorPaths = [];
}
/**
* Deeply merge the rows array to ensure changes to local state are not lost while the request was pending
* For example, the server response could come back with a row which has been deleted on the client
* Loop over the incoming rows, if it exists in client side form state, merge in any new properties from the server
* Note: read `currentState` and not `newState` here, as the `rows` property have already been merged above
*/
if (Array.isArray(incomingField.rows) && path in currentState) {
newState[path].rows = [...(currentState[path]?.rows || [])]; // shallow copy to avoid mutating the original array
incomingField.rows.forEach(row => {
const indexInCurrentState = currentState[path].rows?.findIndex(existingRow => existingRow.id === row.id);
if (indexInCurrentState > -1) {
newState[path].rows[indexInCurrentState] = {
...currentState[path].rows[indexInCurrentState],
...row
};
} else if (row.addedByServer) {
/**
* Note: This is a known limitation of computed array and block rows
* If a new row was added by the server, we append it to the _end_ of this array
* This is because the client is the source of truth, and it has arrays ordered in a certain position
* For example, the user may have re-ordered rows client-side while a long running request is processing
* This means that we _cannot_ slice a new row into the second position on the server, for example
* By the time it gets back to the client, its index is stale
*/
const newRow = {
...row
};
delete newRow.addedByServer;
newState[path].rows.push(newRow);
}
});
}
// If `valid` is `undefined`, mark it as `true`
if (incomingField.valid !== false) {
newState[path].valid = true;
}
// If `passesCondition` is `undefined`, mark it as `true`
if (incomingField.passesCondition !== false) {
newState[path].passesCondition = true;
}
/**
* Undefined values for blocksFilterOptions coming back should be treated as "all blocks allowed" and
* should always be merged in.
* Without this, an undefined value coming back will incorrectly be ignored, and the previous filter will remain.
*/
if (!incomingField.blocksFilterOptions) {
delete newState[path].blocksFilterOptions;
}
// Strip away the `addedByServer` property from the client
// This will prevent it from being passed back to the server
delete newState[path].addedByServer;
}
// Return the original object reference if the state is unchanged
// This will avoid unnecessary re-renders and dependency updates
return dequal(newState, currentState) ? currentState : newState;
};
//# sourceMappingURL=mergeServerFormState.js.map

View File

@@ -0,0 +1,206 @@
import {
Document,
Node,
Plugin,
ProcessOptions,
Root,
SourceMap,
TransformCallback,
Warning,
WarningOptions
} from './postcss.js'
import Processor from './processor.js'
declare namespace Result {
export interface Message {
[others: string]: any
/**
* Source PostCSS plugin name.
*/
plugin?: string
/**
* Message type.
*/
type: string
}
export interface ResultOptions extends ProcessOptions {
/**
* The CSS node that was the source of the warning.
*/
node?: Node
/**
* Name of plugin that created this warning. `Result#warn` will fill it
* automatically with `Plugin#postcssPlugin` value.
*/
plugin?: string
}
// eslint-disable-next-line @typescript-eslint/no-use-before-define
export { Result_ as default }
}
/**
* Provides the result of the PostCSS transformations.
*
* A Result instance is returned by `LazyResult#then`
* or `Root#toResult` methods.
*
* ```js
* postcss([autoprefixer]).process(css).then(result => {
* console.log(result.css)
* })
* ```
*
* ```js
* const result2 = postcss.parse(css).toResult()
* ```
*/
declare class Result_<RootNode = Document | Root> {
/**
* A CSS string representing of `Result#root`.
*
* ```js
* postcss.parse('a{}').toResult().css //=> "a{}"
* ```
*/
css: string
/**
* Last runned PostCSS plugin.
*/
lastPlugin: Plugin | TransformCallback
/**
* An instance of `SourceMapGenerator` class from the `source-map` library,
* representing changes to the `Result#root` instance.
*
* ```js
* result.map.toJSON() //=> { version: 3, file: 'a.css', … }
* ```
*
* ```js
* if (result.map) {
* fs.writeFileSync(result.opts.to + '.map', result.map.toString())
* }
* ```
*/
map: SourceMap
/**
* Contains messages from plugins (e.g., warnings or custom messages).
* Each message should have type and plugin properties.
*
* ```js
* AtRule: {
* import: (atRule, { result }) {
* const importedFile = parseImport(atRule)
* result.messages.push({
* type: 'dependency',
* plugin: 'postcss-import',
* file: importedFile,
* parent: result.opts.from
* })
* }
* }
* ```
*/
messages: Result.Message[]
/**
* Options from the `Processor#process` or `Root#toResult` call
* that produced this Result instance.]
*
* ```js
* root.toResult(opts).opts === opts
* ```
*/
opts: Result.ResultOptions
/**
* The Processor instance used for this transformation.
*
* ```js
* for (const plugin of result.processor.plugins) {
* if (plugin.postcssPlugin === 'postcss-bad') {
* throw 'postcss-good is incompatible with postcss-bad'
* }
* })
* ```
*/
processor: Processor
/**
* Root node after all transformations.
*
* ```js
* root.toResult().root === root
* ```
*/
root: RootNode
/**
* @param processor Processor used for this transformation.
* @param root Root node after all transformations.
* @param opts Options from the `Processor#process` or `Root#toResult`.
*/
constructor(processor: Processor, root: RootNode, opts: Result.ResultOptions)
/**
* Returns for `Result#css` content.
*
* ```js
* result + '' === result.css
* ```
*
* @return String representing of `Result#root`.
*/
toString(): string
/**
* Creates an instance of `Warning` and adds it to `Result#messages`.
*
* ```js
* if (decl.important) {
* result.warn('Avoid !important', { node: decl, word: '!important' })
* }
* ```
*
* @param text Warning message.
* @param opts Warning options.
* @return Created warning.
*/
warn(message: string, options?: WarningOptions): Warning
/**
* Returns warnings from plugins. Filters `Warning` instances
* from `Result#messages`.
*
* ```js
* result.warnings().forEach(warn => {
* console.warn(warn.toString())
* })
* ```
*
* @return Warnings from plugins.
*/
warnings(): Warning[]
/**
* An alias for the `Result#css` property.
* Use it with syntaxes that generate non-CSS output.
*
* ```js
* result.css === result.content
* ```
*/
get content(): string
}
declare class Result<RootNode = Document | Root> extends Result_<RootNode> {}
export = Result

View File

@@ -0,0 +1,8 @@
function _define_property(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });
} else obj[key] = value;
return obj;
}
export { _define_property as _ };

View File

@@ -0,0 +1,26 @@
"use strict";
exports.nextFriday = nextFriday;
var _index = require("./nextDay.js");
/**
* @name nextFriday
* @category Weekday Helpers
* @summary When is the next Friday?
*
* @description
* When is the next Friday?
*
* @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 start counting from
*
* @returns The next Friday
*
* @example
* // When is the next Friday after Mar, 22, 2020?
* const result = nextFriday(new Date(2020, 2, 22))
* //=> Fri Mar 27 2020 00:00:00
*/
function nextFriday(date) {
return (0, _index.nextDay)(date, 5);
}

View File

@@ -0,0 +1,468 @@
import { Decimal } from "decimal.js";
import { S_UNICODE_REGEX } from "../regex.generated.js";
import "../types/number.js";
import { getPowerOf10 } from "./decimal-cache.js";
import "../types/plural-rules.js";
import { digitMapping } from "./digit-mapping.generated.js";
import { GetUnsignedRoundingMode } from "./GetUnsignedRoundingMode.js";
import { ToRawFixed } from "./ToRawFixed.js";
// This is from: unicode-12.1.0/General_Category/Symbol/regex.js
// IE11 does not support unicode flag, otherwise this is just /\p{S}/u.
// /^\p{S}/u
const CARET_S_UNICODE_REGEX = new RegExp(`^${S_UNICODE_REGEX.source}`);
// /\p{S}$/u
const S_DOLLAR_UNICODE_REGEX = new RegExp(`${S_UNICODE_REGEX.source}$`);
const CLDR_NUMBER_PATTERN = /[#0](?:[.,][#0]+)*/g;
export default function formatToParts(numberResult, data, pl, options) {
const { sign, exponent, magnitude } = numberResult;
const { notation, style, numberingSystem } = options;
const defaultNumberingSystem = data.numbers.nu[0];
// #region Part 1: partition and interpolate the CLDR number pattern.
// ----------------------------------------------------------
let compactNumberPattern = null;
if (notation === "compact" && magnitude) {
compactNumberPattern = getCompactDisplayPattern(numberResult, pl, data, style, options.compactDisplay, options.currencyDisplay, numberingSystem);
}
// This is used multiple times
let nonNameCurrencyPart;
if (style === "currency" && options.currencyDisplay !== "name") {
const byCurrencyDisplay = data.currencies[options.currency];
if (byCurrencyDisplay) {
switch (options.currencyDisplay) {
case "code":
nonNameCurrencyPart = options.currency;
break;
case "symbol":
nonNameCurrencyPart = byCurrencyDisplay.symbol;
break;
default:
nonNameCurrencyPart = byCurrencyDisplay.narrow;
break;
}
} else {
// Fallback for unknown currency
nonNameCurrencyPart = options.currency;
}
}
let numberPattern;
if (!compactNumberPattern) {
// Note: if the style is unit, or is currency and the currency display is name,
// its unit parts will be interpolated in part 2. So here we can fallback to decimal.
if (style === "decimal" || style === "unit" || style === "currency" && options.currencyDisplay === "name") {
// Shortcut for decimal
const decimalData = data.numbers.decimal[numberingSystem] || data.numbers.decimal[defaultNumberingSystem];
numberPattern = getPatternForSign(decimalData.standard, sign);
} else if (style === "currency") {
const currencyData = data.numbers.currency[numberingSystem] || data.numbers.currency[defaultNumberingSystem];
// We replace number pattern part with `0` for easier postprocessing.
numberPattern = getPatternForSign(currencyData[options.currencySign], sign);
} else {
// percent
const percentPattern = data.numbers.percent[numberingSystem] || data.numbers.percent[defaultNumberingSystem];
numberPattern = getPatternForSign(percentPattern, sign);
}
} else {
numberPattern = compactNumberPattern;
}
// Extract the decimal number pattern string. It looks like "#,##0,00", which will later be
// used to infer decimal group sizes.
const decimalNumberPattern = CLDR_NUMBER_PATTERN.exec(numberPattern)[0];
// Now we start to substitute patterns
// 1. replace strings like `0` and `#,##0.00` with `{0}`
// 2. unquote characters (invariant: the quoted characters does not contain the special tokens)
numberPattern = numberPattern.replace(CLDR_NUMBER_PATTERN, "{0}").replace(/'(.)'/g, "$1");
// Handle currency spacing (both compact and non-compact).
if (style === "currency" && options.currencyDisplay !== "name") {
const currencyData = data.numbers.currency[numberingSystem] || data.numbers.currency[defaultNumberingSystem];
// See `currencySpacing` substitution rule in TR-35.
// Here we always assume the currencyMatch is "[:^S:]" and surroundingMatch is "[:digit:]".
//
// Example 1: for pattern "#,##0.00¤" with symbol "US$", we replace "¤" with the symbol,
// but insert an extra non-break space before the symbol, because "[:^S:]" matches "U" in
// "US$" and "[:digit:]" matches the latn numbering system digits.
//
// Example 2: for pattern "¤#,##0.00" with symbol "US$", there is no spacing between symbol
// and number, because `$` does not match "[:^S:]".
//
// Implementation note: here we do the best effort to infer the insertion.
// We also assume that `beforeInsertBetween` and `afterInsertBetween` will never be `;`.
const afterCurrency = currencyData.currencySpacing.afterInsertBetween;
if (afterCurrency && !S_DOLLAR_UNICODE_REGEX.test(nonNameCurrencyPart)) {
numberPattern = numberPattern.replace("¤{0}", `¤${afterCurrency}{0}`);
}
const beforeCurrency = currencyData.currencySpacing.beforeInsertBetween;
if (beforeCurrency && !CARET_S_UNICODE_REGEX.test(nonNameCurrencyPart)) {
numberPattern = numberPattern.replace("{0}¤", `{0}${beforeCurrency}¤`);
}
}
// The following tokens are special: `{0}`, `¤`, `%`, `-`, `+`, `{c:...}.
const numberPatternParts = numberPattern.split(/({c:[^}]+}|\{0\}|[¤%\-+])/g);
const numberParts = [];
const symbols = data.numbers.symbols[numberingSystem] || data.numbers.symbols[defaultNumberingSystem];
for (const part of numberPatternParts) {
if (!part) {
continue;
}
switch (part) {
case "{0}": {
// We only need to handle scientific and engineering notation here.
numberParts.push(...partitionNumberIntoParts(
symbols,
numberResult,
notation,
exponent,
numberingSystem,
// If compact number pattern exists, do not insert group separators.
!compactNumberPattern && (options.useGrouping ?? true),
decimalNumberPattern,
style,
options.roundingIncrement,
GetUnsignedRoundingMode(options.roundingMode, sign === -1)
));
break;
}
case "-":
numberParts.push({
type: "minusSign",
value: symbols.minusSign
});
break;
case "+":
numberParts.push({
type: "plusSign",
value: symbols.plusSign
});
break;
case "%":
numberParts.push({
type: "percentSign",
value: symbols.percentSign
});
break;
case "¤":
// Computed above when handling currency spacing.
numberParts.push({
type: "currency",
value: nonNameCurrencyPart
});
break;
default:
if (part.startsWith("{c:")) {
numberParts.push({
type: "compact",
value: part.substring(3, part.length - 1)
});
} else {
// literal
numberParts.push({
type: "literal",
value: part
});
}
break;
}
}
// #endregion
// #region Part 2: interpolate unit pattern if necessary.
// ----------------------------------------------
switch (style) {
case "currency": {
// `currencyDisplay: 'name'` has similar pattern handling as units.
if (options.currencyDisplay === "name") {
const unitPattern = (data.numbers.currency[numberingSystem] || data.numbers.currency[defaultNumberingSystem]).unitPattern;
// Select plural
let unitName;
const currencyNameData = data.currencies[options.currency];
if (currencyNameData) {
unitName = selectPlural(pl, numberResult.roundedNumber.times(getPowerOf10(exponent)).toNumber(), currencyNameData.displayName);
} else {
// Fallback for unknown currency
unitName = options.currency;
}
// Do {0} and {1} substitution
const unitPatternParts = unitPattern.split(/(\{[01]\})/g);
const result = [];
for (const part of unitPatternParts) {
switch (part) {
case "{0}":
result.push(...numberParts);
break;
case "{1}":
result.push({
type: "currency",
value: unitName
});
break;
default:
if (part) {
result.push({
type: "literal",
value: part
});
}
break;
}
}
return result;
} else {
return numberParts;
}
}
case "unit": {
const { unit, unitDisplay } = options;
let unitData = data.units.simple[unit];
let unitPattern;
if (unitData) {
// Simple unit pattern
unitPattern = selectPlural(pl, numberResult.roundedNumber.times(getPowerOf10(exponent)).toNumber(), data.units.simple[unit][unitDisplay]);
} else {
// See: http://unicode.org/reports/tr35/tr35-general.html#perUnitPatterns
// If cannot find unit in the simple pattern, it must be "per" compound pattern.
// Implementation note: we are not following TR-35 here because we need to format to parts!
const [numeratorUnit, denominatorUnit] = unit.split("-per-");
unitData = data.units.simple[numeratorUnit];
const numeratorUnitPattern = selectPlural(pl, numberResult.roundedNumber.times(getPowerOf10(exponent)).toNumber(), data.units.simple[numeratorUnit][unitDisplay]);
const perUnitPattern = data.units.simple[denominatorUnit].perUnit[unitDisplay];
if (perUnitPattern) {
// perUnitPattern exists, combine it with numeratorUnitPattern
unitPattern = perUnitPattern.replace("{0}", numeratorUnitPattern);
} else {
// get compoundUnit pattern (e.g. "{0} per {1}"), repalce {0} with numerator pattern and {1} with
// the denominator pattern in singular form.
const perPattern = data.units.compound.per[unitDisplay];
const denominatorPattern = selectPlural(pl, 1, data.units.simple[denominatorUnit][unitDisplay]);
unitPattern = unitPattern = perPattern.replace("{0}", numeratorUnitPattern).replace("{1}", denominatorPattern.replace("{0}", ""));
}
}
const result = [];
// We need spacing around "{0}" because they are not treated as "unit" parts, but "literal".
for (const part of unitPattern.split(/(\s*\{0\}\s*)/)) {
const interpolateMatch = /^(\s*)\{0\}(\s*)$/.exec(part);
if (interpolateMatch) {
// Space before "{0}"
if (interpolateMatch[1]) {
result.push({
type: "literal",
value: interpolateMatch[1]
});
}
// "{0}" itself
result.push(...numberParts);
// Space after "{0}"
if (interpolateMatch[2]) {
result.push({
type: "literal",
value: interpolateMatch[2]
});
}
} else if (part) {
result.push({
type: "unit",
value: part
});
}
}
return result;
}
default: return numberParts;
}
// #endregion
}
// A subset of https://tc39.es/ecma402/#sec-partitionnotationsubpattern
// Plus the exponent parts handling.
function partitionNumberIntoParts(symbols, numberResult, notation, exponent, numberingSystem, useGrouping, decimalNumberPattern, style, roundingIncrement, unsignedRoundingMode) {
const result = [];
// eslint-disable-next-line prefer-const
let { formattedString: n, roundedNumber: x } = numberResult;
if (x.isNaN()) {
return [{
type: "nan",
value: n
}];
} else if (!x.isFinite()) {
return [{
type: "infinity",
value: n
}];
}
const digitReplacementTable = digitMapping[numberingSystem];
if (digitReplacementTable) {
n = n.replace(/\d/g, (digit) => digitReplacementTable[+digit] || digit);
}
// TODO: Else use an implementation dependent algorithm to map n to the appropriate
// representation of n in the given numbering system.
const decimalSepIndex = n.indexOf(".");
let integer;
let fraction;
if (decimalSepIndex > 0) {
integer = n.slice(0, decimalSepIndex);
fraction = n.slice(decimalSepIndex + 1);
} else {
integer = n;
}
// #region Grouping integer digits
// The weird compact and x >= 10000 check is to ensure consistency with Node.js and Chrome.
// Note that `de` does not have compact form for thousands, but Node.js does not insert grouping separator
// unless the rounded number is greater than 10000:
// NumberFormat('de', {notation: 'compact', compactDisplay: 'short'}).format(1234) //=> "1234"
// NumberFormat('de').format(1234) //=> "1.234"
let shouldUseGrouping = false;
if (useGrouping === "always") {
shouldUseGrouping = true;
} else if (useGrouping === "min2") {
shouldUseGrouping = x.greaterThanOrEqualTo(1e4);
} else if (useGrouping === "auto" || useGrouping) {
shouldUseGrouping = notation !== "compact" || x.greaterThanOrEqualTo(1e4);
}
if (shouldUseGrouping) {
// a. Let groupSepSymbol be the implementation-, locale-, and numbering system-dependent (ILND) String representing the grouping separator.
// For currency we should use `currencyGroup` instead of generic `group`
const groupSepSymbol = style === "currency" && symbols.currencyGroup != null ? symbols.currencyGroup : symbols.group;
const groups = [];
// > There may be two different grouping sizes: The primary grouping size used for the least
// > significant integer group, and the secondary grouping size used for more significant groups.
// > If a pattern contains multiple grouping separators, the interval between the last one and the
// > end of the integer defines the primary grouping size, and the interval between the last two
// > defines the secondary grouping size. All others are ignored.
const integerNumberPattern = decimalNumberPattern.split(".")[0];
const patternGroups = integerNumberPattern.split(",");
let primaryGroupingSize = 3;
let secondaryGroupingSize = 3;
if (patternGroups.length > 1) {
primaryGroupingSize = patternGroups[patternGroups.length - 1].length;
}
if (patternGroups.length > 2) {
secondaryGroupingSize = patternGroups[patternGroups.length - 2].length;
}
let i = integer.length - primaryGroupingSize;
if (i > 0) {
// Slice the least significant integer group
groups.push(integer.slice(i, i + primaryGroupingSize));
// Then iteratively push the more signicant groups
// TODO: handle surrogate pairs in some numbering system digits
for (i -= secondaryGroupingSize; i > 0; i -= secondaryGroupingSize) {
groups.push(integer.slice(i, i + secondaryGroupingSize));
}
groups.push(integer.slice(0, i + secondaryGroupingSize));
} else {
groups.push(integer);
}
while (groups.length > 0) {
const integerGroup = groups.pop();
result.push({
type: "integer",
value: integerGroup
});
if (groups.length > 0) {
result.push({
type: "group",
value: groupSepSymbol
});
}
}
} else {
result.push({
type: "integer",
value: integer
});
}
// #endregion
if (fraction !== undefined) {
const decimalSepSymbol = style === "currency" && symbols.currencyDecimal != null ? symbols.currencyDecimal : symbols.decimal;
result.push({
type: "decimal",
value: decimalSepSymbol
}, {
type: "fraction",
value: fraction
});
}
if ((notation === "scientific" || notation === "engineering") && x.isFinite()) {
result.push({
type: "exponentSeparator",
value: symbols.exponential
});
if (exponent < 0) {
result.push({
type: "exponentMinusSign",
value: symbols.minusSign
});
exponent = -exponent;
}
const exponentResult = ToRawFixed(new Decimal(exponent), 0, 0, roundingIncrement, unsignedRoundingMode);
result.push({
type: "exponentInteger",
value: exponentResult.formattedString
});
}
return result;
}
function getPatternForSign(pattern, sign) {
if (pattern.indexOf(";") < 0) {
pattern = `${pattern};-${pattern}`;
}
const [zeroPattern, negativePattern] = pattern.split(";");
switch (sign) {
case 0: return zeroPattern;
case -1: return negativePattern;
default: return negativePattern.indexOf("-") >= 0 ? negativePattern.replace(/-/g, "+") : `+${zeroPattern}`;
}
}
// Find the CLDR pattern for compact notation based on the magnitude of data and style.
//
// Example return value: "¤ {c:laki}000;¤{c:laki} -0" (`sw` locale):
// - Notice the `{c:...}` token that wraps the compact literal.
// - The consecutive zeros are normalized to single zero to match CLDR_NUMBER_PATTERN.
//
// Returning null means the compact display pattern cannot be found.
function getCompactDisplayPattern(numberResult, pl, data, style, compactDisplay, currencyDisplay, numberingSystem) {
const { roundedNumber, sign, magnitude } = numberResult;
let magnitudeKey = String(10 ** magnitude);
const defaultNumberingSystem = data.numbers.nu[0];
let pattern;
if (style === "currency" && currencyDisplay !== "name") {
const byNumberingSystem = data.numbers.currency;
const currencyData = byNumberingSystem[numberingSystem] || byNumberingSystem[defaultNumberingSystem];
// NOTE: compact notation ignores currencySign!
let compactPluralRules = currencyData.short?.[magnitudeKey];
// GH #4236: If magnitude exceeds available patterns, use the largest available
if (!compactPluralRules) {
const thresholds = Object.keys(currencyData.short || {});
if (thresholds.length > 0 && magnitudeKey > thresholds[thresholds.length - 1]) {
magnitudeKey = thresholds[thresholds.length - 1];
compactPluralRules = currencyData.short?.[magnitudeKey];
}
}
if (!compactPluralRules) {
return null;
}
pattern = selectPlural(pl, roundedNumber.toNumber(), compactPluralRules);
} else {
const byNumberingSystem = data.numbers.decimal;
const byCompactDisplay = byNumberingSystem[numberingSystem] || byNumberingSystem[defaultNumberingSystem];
let compactPlaralRule = byCompactDisplay[compactDisplay][magnitudeKey];
// GH #4236: If magnitude exceeds available patterns, use the largest available
if (!compactPlaralRule) {
const thresholds = Object.keys(byCompactDisplay[compactDisplay]);
if (thresholds.length > 0 && magnitudeKey > thresholds[thresholds.length - 1]) {
magnitudeKey = thresholds[thresholds.length - 1];
compactPlaralRule = byCompactDisplay[compactDisplay][magnitudeKey];
}
}
if (!compactPlaralRule) {
return null;
}
pattern = selectPlural(pl, roundedNumber.toNumber(), compactPlaralRule);
}
// See https://unicode.org/reports/tr35/tr35-numbers.html#Compact_Number_Formats
// > If the value is precisely “0”, either explicit or defaulted, then the normal number format
// > pattern for that sort of object is supplied.
if (pattern === "0") {
return null;
}
pattern = getPatternForSign(pattern, sign).replace(/([^\s;\-+\d¤]+)/g, "{c:$1}").replace(/0+/, "0");
return pattern;
}
function selectPlural(pl, x, rules) {
return rules[pl.select(x)] || rules.other;
}

View File

@@ -0,0 +1,120 @@
import { Span } from '@opentelemetry/api';
import { InstrumentationConfig } from '@opentelemetry/instrumentation';
export interface FirebaseOptions {
[key: string]: any;
apiKey?: string;
authDomain?: string;
databaseURL?: string;
projectId?: string;
storageBucket?: string;
messagingSenderId?: string;
appId?: string;
measurementId?: string;
}
export interface FirebaseApp {
name: string;
options: FirebaseOptions;
automaticDataCollectionEnabled: boolean;
delete(): Promise<void>;
}
export interface DocumentData {
[field: string]: any;
}
export type WithFieldValue<T> = T;
export type PartialWithFieldValue<T> = Partial<T>;
export interface SetOptions {
merge?: boolean;
mergeFields?: (string | number | symbol)[];
}
export interface DocumentReference<T = DocumentData, U extends DocumentData = DocumentData> {
id: string;
firestore: {
app: FirebaseApp;
settings: FirestoreSettings;
useEmulator: (host: string, port: number) => void;
toJSON: () => {
app: FirebaseApp;
settings: FirestoreSettings;
};
};
type: 'collection' | 'document' | string;
path: string;
parent: CollectionReference<T, U>;
}
export interface CollectionReference<T = DocumentData, U extends DocumentData = DocumentData> {
id: string;
firestore: {
app: FirebaseApp;
settings: FirestoreSettings;
useEmulator: (host: string, port: number) => void;
toJSON: () => {
app: FirebaseApp;
settings: FirestoreSettings;
};
};
type: string;
path: string;
parent: DocumentReference<T, U> | null;
}
export interface QuerySnapshot<T = DocumentData, U extends DocumentData = DocumentData> {
docs: Array<DocumentReference<T, U>>;
size: number;
empty: boolean;
}
export interface FirestoreSettings {
host?: string;
ssl?: boolean;
ignoreUndefinedProperties?: boolean;
cacheSizeBytes?: number;
experimentalForceLongPolling?: boolean;
experimentalAutoDetectLongPolling?: boolean;
useFetchStreams?: boolean;
}
/**
* Firebase Auto Instrumentation
*/
export interface FirebaseInstrumentationConfig extends InstrumentationConfig {
firestoreSpanCreationHook?: FirestoreSpanCreationHook;
functions?: FunctionsConfig;
}
export interface FunctionsConfig {
requestHook?: RequestHook;
responseHook?: ResponseHook;
errorHook?: ErrorHook;
}
export type RequestHook = (span: Span) => void;
export type ResponseHook = (span: Span, error?: unknown) => void;
export type ErrorHook = (span: Span, error?: unknown) => Promise<void> | void;
export interface FirestoreSpanCreationHook {
(span: Span): void;
}
export type GetDocsType<AppModelType = DocumentData, DbModelType extends DocumentData = DocumentData> = (query: CollectionReference<AppModelType, DbModelType>) => Promise<QuerySnapshot<AppModelType, DbModelType>>;
export type SetDocType<AppModelType = DocumentData, DbModelType extends DocumentData = DocumentData> = ((reference: DocumentReference<AppModelType, DbModelType>, data: WithFieldValue<AppModelType>) => Promise<void>) & ((reference: DocumentReference<AppModelType, DbModelType>, data: PartialWithFieldValue<AppModelType>, options: SetOptions) => Promise<void>);
export type AddDocType<AppModelType, DbModelType extends DocumentData> = (reference: CollectionReference<AppModelType, DbModelType>, data: WithFieldValue<AppModelType>) => Promise<DocumentReference<AppModelType, DbModelType>>;
export type DeleteDocType<AppModelType, DbModelType extends DocumentData> = (reference: DocumentReference<AppModelType, DbModelType>) => Promise<void>;
export type OverloadedParameters<T> = T extends {
(...args: infer A1): unknown;
(...args: infer A2): unknown;
} ? A1 | A2 : T extends (...args: infer A) => unknown ? A : unknown;
/**
* A bare minimum of how Cloud Functions for Firebase (v2) are defined.
*/
export type FirebaseFunctions = ((handler: () => Promise<unknown> | unknown) => (...args: unknown[]) => Promise<unknown> | unknown) | ((documentOrOptions: string | string[] | Record<string, unknown>, handler: () => Promise<unknown> | unknown) => (...args: unknown[]) => Promise<unknown> | unknown);
export type AvailableFirebaseFunctions = {
onRequest: FirebaseFunctions;
onCall: FirebaseFunctions;
onDocumentCreated: FirebaseFunctions;
onDocumentUpdated: FirebaseFunctions;
onDocumentDeleted: FirebaseFunctions;
onDocumentWritten: FirebaseFunctions;
onDocumentCreatedWithAuthContext: FirebaseFunctions;
onDocumentUpdatedWithAuthContext: FirebaseFunctions;
onDocumentDeletedWithAuthContext: FirebaseFunctions;
onDocumentWrittenWithAuthContext: FirebaseFunctions;
onSchedule: FirebaseFunctions;
onObjectFinalized: FirebaseFunctions;
onObjectArchived: FirebaseFunctions;
onObjectDeleted: FirebaseFunctions;
onObjectMetadataUpdated: FirebaseFunctions;
};
//# sourceMappingURL=types.d.ts.map

View File

@@ -0,0 +1,4 @@
import type { LibSQLDatabase } from 'drizzle-orm/libsql';
import type { DrizzleAdapter, PostgresDB } from '../types.js';
export declare const migrationTableExists: (adapter: DrizzleAdapter, db?: LibSQLDatabase | PostgresDB) => Promise<boolean>;
//# sourceMappingURL=migrationTableExists.d.ts.map

View File

@@ -0,0 +1,94 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const syncpromise = require('./syncpromise.js');
const timer = require('./timer.js');
const SENTRY_BUFFER_FULL_ERROR = Symbol.for('SentryBufferFullError');
/**
* Creates an new PromiseBuffer object with the specified limit
* @param limit max number of promises that can be stored in the buffer
*/
function makePromiseBuffer(limit = 100) {
const buffer = new Set();
function isReady() {
return buffer.size < limit;
}
/**
* Remove a promise from the queue.
*
* @param task Can be any PromiseLike<T>
* @returns Removed promise.
*/
function remove(task) {
buffer.delete(task);
}
/**
* Add a promise (representing an in-flight action) to the queue, and set it to remove itself on fulfillment.
*
* @param taskProducer A function producing any PromiseLike<T>; In previous versions this used to be `task:
* PromiseLike<T>`, but under that model, Promises were instantly created on the call-site and their executor
* functions therefore ran immediately. Thus, even if the buffer was full, the action still happened. By
* requiring the promise to be wrapped in a function, we can defer promise creation until after the buffer
* limit check.
* @returns The original promise.
*/
function add(taskProducer) {
if (!isReady()) {
return syncpromise.rejectedSyncPromise(SENTRY_BUFFER_FULL_ERROR);
}
// start the task and add its promise to the queue
const task = taskProducer();
buffer.add(task);
void task.then(
() => remove(task),
() => remove(task),
);
return task;
}
/**
* Wait for all promises in the queue to resolve or for timeout to expire, whichever comes first.
*
* @param timeout The time, in ms, after which to resolve to `false` if the queue is still non-empty. Passing `0` (or
* not passing anything) will make the promise wait as long as it takes for the queue to drain before resolving to
* `true`.
* @returns A promise which will resolve to `true` if the queue is already empty or drains before the timeout, and
* `false` otherwise
*/
function drain(timeout) {
if (!buffer.size) {
return syncpromise.resolvedSyncPromise(true);
}
// We want to resolve even if one of the promises rejects
const drainPromise = Promise.allSettled(Array.from(buffer)).then(() => true);
if (!timeout) {
return drainPromise;
}
const promises = [
drainPromise,
new Promise(resolve => timer.safeUnref(setTimeout(() => resolve(false), timeout))),
];
return Promise.race(promises);
}
return {
get $() {
return Array.from(buffer);
},
add,
drain,
};
}
exports.SENTRY_BUFFER_FULL_ERROR = SENTRY_BUFFER_FULL_ERROR;
exports.makePromiseBuffer = makePromiseBuffer;
//# sourceMappingURL=promisebuffer.js.map

View File

@@ -0,0 +1,68 @@
import { isPrimitive } from '../utils/is.js';
import { normalize } from '../utils/normalize.js';
import { GLOBAL_OBJ } from '../utils/worldwide.js';
/**
* Formats the given values into a string.
*
* @param values - The values to format.
* @param normalizeDepth - The depth to normalize the values.
* @param normalizeMaxBreadth - The max breadth to normalize the values.
* @returns The formatted string.
*/
function formatConsoleArgs(values, normalizeDepth, normalizeMaxBreadth) {
return 'util' in GLOBAL_OBJ && typeof (GLOBAL_OBJ ).util.format === 'function'
? (GLOBAL_OBJ ).util.format(...values)
: safeJoinConsoleArgs(values, normalizeDepth, normalizeMaxBreadth);
}
/**
* Joins the given values into a string.
*
* @param values - The values to join.
* @param normalizeDepth - The depth to normalize the values.
* @param normalizeMaxBreadth - The max breadth to normalize the values.
* @returns The joined string.
*/
function safeJoinConsoleArgs(values, normalizeDepth, normalizeMaxBreadth) {
return values
.map(value =>
isPrimitive(value) ? String(value) : JSON.stringify(normalize(value, normalizeDepth, normalizeMaxBreadth)),
)
.join(' ');
}
/**
* Checks if a string contains console substitution patterns like %s, %d, %i, %f, %o, %O, %c.
*
* @param str - The string to check
* @returns true if the string contains console substitution patterns
*/
function hasConsoleSubstitutions(str) {
// Match console substitution patterns: %s, %d, %i, %f, %o, %O, %c
return /%[sdifocO]/.test(str);
}
/**
* Creates template attributes for multiple console arguments.
*
* @param args - The console arguments
* @returns An object with template and parameter attributes
*/
function createConsoleTemplateAttributes(firstArg, followingArgs) {
const attributes = {};
// Create template with placeholders for each argument
const template = new Array(followingArgs.length).fill('{}').join(' ');
attributes['sentry.message.template'] = `${firstArg} ${template}`;
// Add each argument as a parameter
followingArgs.forEach((arg, index) => {
attributes[`sentry.message.parameter.${index}`] = arg;
});
return attributes;
}
export { createConsoleTemplateAttributes, formatConsoleArgs, hasConsoleSubstitutions, safeJoinConsoleArgs };
//# sourceMappingURL=utils.js.map

View File

@@ -0,0 +1,11 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/**
* This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.
*
* ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.
*/
const DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__);
exports.DEBUG_BUILD = DEBUG_BUILD;
//# sourceMappingURL=debug-build.js.map

View File

@@ -0,0 +1,4 @@
import type { KeywordCxt } from "../../compile/validate";
import { Code, Name } from "../../compile/codegen";
export declare function checkNullable({ gen, data, parentSchema }: KeywordCxt, cond?: Code): [Name, Code];
export declare function checkNullableObject(cxt: KeywordCxt, cond: Code): [Name, Code];

View File

@@ -0,0 +1 @@
import e from"path";import t from"icu-minify/compile";import{getFormatExtension as s,resolveCodec as o}from"./format/index.js";import{setNestedProperty as r}from"./utils.js";let a=null;const n=new Map;function i(i){const c=this.getOptions(),l=this.async(),f=s(c.messages.format);(async function(e,t){return a||(a=await o(e.messages.format,t)),a})(c,this.rootContext).then((s=>{const o=e.basename(this.resourcePath,f);let a;if(c.messages.precompile){const e=function(e,s){const o={},a=new Set(s.keys());for(const n of e){a.delete(n.id);const e=n.message;if(Array.isArray(e))throw new Error(`Message at \`${n.id}\` resolved to an array, but only strings are supported. See https://next-intl.dev/docs/usage/translations#arrays-of-messages`);if("object"==typeof e)throw new Error(`Message at \`${n.id}\` resolved to \`${typeof e}\`, but only strings are supported. Use a \`.\` to retrieve nested messages. See https://next-intl.dev/docs/usage/translations#structuring-messages`);const i=s.get(n.id);let c;i?.messageValue===e?c=i.compiledMessage:(c=t(e),s.set(n.id,{compiledMessage:c,messageValue:e})),r(o,n.id,c)}for(const e of a)s.delete(e);return o}(s.decode(i,{locale:o}),function(e){let t=n.get(e);return t||(t=new Map,n.set(e,t)),t}(this.resourcePath));a=JSON.stringify(e)}else a=s.toJSONString(i,{locale:o});const m=`export default JSON.parse(${JSON.stringify(a)});`;l(null,m)})).catch(l)}export{i as default};

View File

@@ -0,0 +1,4 @@
import type { Coordinates } from '../../types';
export declare function getScrollXCoordinate(element: Element | typeof window): number;
export declare function getScrollYCoordinate(element: Element | typeof window): number;
export declare function getScrollCoordinates(element: Element | typeof window): Coordinates;

View File

@@ -0,0 +1,9 @@
// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
import { formatDuration as fn } from "../formatDuration.js";
import { convertToFP } from "./_lib/convertToFP.js";
export const formatDuration = convertToFP(fn, 1);
// Fallback for modularized imports:
export default formatDuration;

View File

@@ -0,0 +1,64 @@
'use strict'
const Client = require('./client')
const defaults = require('./defaults')
const Connection = require('./connection')
const Result = require('./result')
const utils = require('./utils')
const Pool = require('pg-pool')
const TypeOverrides = require('./type-overrides')
const { DatabaseError } = require('pg-protocol')
const { escapeIdentifier, escapeLiteral } = require('./utils')
const poolFactory = (Client) => {
return class BoundPool extends Pool {
constructor(options) {
super(options, Client)
}
}
}
const PG = function (clientConstructor) {
this.defaults = defaults
this.Client = clientConstructor
this.Query = this.Client.Query
this.Pool = poolFactory(this.Client)
this._pools = []
this.Connection = Connection
this.types = require('pg-types')
this.DatabaseError = DatabaseError
this.TypeOverrides = TypeOverrides
this.escapeIdentifier = escapeIdentifier
this.escapeLiteral = escapeLiteral
this.Result = Result
this.utils = utils
}
if (typeof process.env.NODE_PG_FORCE_NATIVE !== 'undefined') {
module.exports = new PG(require('./native'))
} else {
module.exports = new PG(Client)
// lazy require native module...the native module may not have installed
Object.defineProperty(module.exports, 'native', {
configurable: true,
enumerable: false,
get() {
let native = null
try {
native = new PG(require('./native'))
} catch (err) {
if (err.code !== 'MODULE_NOT_FOUND') {
throw err
}
}
// overwrite module.exports.native so that getter is never called again
Object.defineProperty(module.exports, 'native', {
value: native,
})
return native
},
})
}

View File

@@ -0,0 +1,63 @@
Prism.languages.bqn = {
'shebang': {
pattern: /^#![ \t]*\/.*/,
alias: 'important',
greedy: true
},
'comment': {
pattern: /#.*/,
greedy: true
},
'string-literal': {
pattern: /"(?:[^"]|"")*"/,
greedy: true,
alias: 'string'
},
'character-literal': {
pattern: /'(?:[\s\S]|[\uD800-\uDBFF][\uDC00-\uDFFF])'/,
greedy: true,
alias: 'char'
},
'function': /•[\w¯.∞π]+[\w¯.∞π]*/,
'dot-notation-on-brackets': {
pattern: /\{(?=.*\}\.)|\}\./,
alias: 'namespace'
},
'special-name': {
pattern: /(?:𝕨|𝕩|𝕗|𝕘|𝕤|𝕣|𝕎|𝕏|𝔽|𝔾|𝕊|_𝕣_|_𝕣)/,
alias: 'keyword'
},
'dot-notation-on-name': {
pattern: /[A-Za-z_][\w¯∞π]*\./,
alias: 'namespace'
},
'word-number-scientific': {
pattern: /\d+(?:\.\d+)?[eE]¯?\d+/,
alias: 'number'
},
'word-name': {
pattern: /[A-Za-z_][\w¯∞π]*/,
alias: 'symbol'
},
'word-number': {
pattern: /[¯∞π]?(?:\d*\.?\b\d+(?:e[+¯]?\d+|E[+¯]?\d+)?|¯|∞|π)(?:j¯?(?:(?:\d+(?:\.\d+)?|\.\d+)(?:e[+¯]?\d+|E[+¯]?\d+)?|¯|∞|π))?/,
alias: 'number'
},
'null-literal': {
pattern: /@/,
alias: 'char'
},
'primitive-functions': {
pattern: /[-+×÷⋆√⌊⌈|¬∧∨<>≠=≤≥≡≢⊣⊢⥊∾≍⋈↑↓↕«»⌽⍉/⍋⍒⊏⊑⊐⊒∊⍷⊔!]/,
alias: 'operator'
},
'primitive-1-operators': {
pattern: /[`˜˘¨⁼⌜´˝˙]/,
alias: 'operator'
},
'primitive-2-operators': {
pattern: /[∘⊸⟜○⌾⎉⚇⍟⊘◶⎊]/,
alias: 'operator'
},
'punctuation': /[←⇐↩(){}⟨⟩[\]‿·⋄,.;:?]/
};

View File

@@ -0,0 +1,24 @@
import { debug as coreDebug } from '@sentry/core';
interface LoggerConfig {
captureExceptions: boolean;
traceInternals: boolean;
}
type CoreDebugLogger = typeof coreDebug;
interface ReplayDebugLogger extends CoreDebugLogger {
/**
* Calls `debug.log` but saves breadcrumb in the next tick due to race
* conditions before replay is initialized.
*/
infoTick: CoreDebugLogger['log'];
/**
* Captures exceptions (`Error`) if "capture internal exceptions" is enabled
*/
exception: CoreDebugLogger['error'];
/**
* Configures the logger with additional debugging behavior
*/
setConfig(config: Partial<LoggerConfig>): void;
}
export declare const debug: ReplayDebugLogger;
export {};
//# sourceMappingURL=logger.d.ts.map

View File

@@ -0,0 +1,932 @@
import { htmlDecodeTree, xmlDecodeTree, BinTrieFlags, determineBranch, replaceCodePoint, } from "entities/lib/decode.js";
var CharCodes;
(function (CharCodes) {
CharCodes[CharCodes["Tab"] = 9] = "Tab";
CharCodes[CharCodes["NewLine"] = 10] = "NewLine";
CharCodes[CharCodes["FormFeed"] = 12] = "FormFeed";
CharCodes[CharCodes["CarriageReturn"] = 13] = "CarriageReturn";
CharCodes[CharCodes["Space"] = 32] = "Space";
CharCodes[CharCodes["ExclamationMark"] = 33] = "ExclamationMark";
CharCodes[CharCodes["Number"] = 35] = "Number";
CharCodes[CharCodes["Amp"] = 38] = "Amp";
CharCodes[CharCodes["SingleQuote"] = 39] = "SingleQuote";
CharCodes[CharCodes["DoubleQuote"] = 34] = "DoubleQuote";
CharCodes[CharCodes["Dash"] = 45] = "Dash";
CharCodes[CharCodes["Slash"] = 47] = "Slash";
CharCodes[CharCodes["Zero"] = 48] = "Zero";
CharCodes[CharCodes["Nine"] = 57] = "Nine";
CharCodes[CharCodes["Semi"] = 59] = "Semi";
CharCodes[CharCodes["Lt"] = 60] = "Lt";
CharCodes[CharCodes["Eq"] = 61] = "Eq";
CharCodes[CharCodes["Gt"] = 62] = "Gt";
CharCodes[CharCodes["Questionmark"] = 63] = "Questionmark";
CharCodes[CharCodes["UpperA"] = 65] = "UpperA";
CharCodes[CharCodes["LowerA"] = 97] = "LowerA";
CharCodes[CharCodes["UpperF"] = 70] = "UpperF";
CharCodes[CharCodes["LowerF"] = 102] = "LowerF";
CharCodes[CharCodes["UpperZ"] = 90] = "UpperZ";
CharCodes[CharCodes["LowerZ"] = 122] = "LowerZ";
CharCodes[CharCodes["LowerX"] = 120] = "LowerX";
CharCodes[CharCodes["OpeningSquareBracket"] = 91] = "OpeningSquareBracket";
})(CharCodes || (CharCodes = {}));
/** All the states the tokenizer can be in. */
var State;
(function (State) {
State[State["Text"] = 1] = "Text";
State[State["BeforeTagName"] = 2] = "BeforeTagName";
State[State["InTagName"] = 3] = "InTagName";
State[State["InSelfClosingTag"] = 4] = "InSelfClosingTag";
State[State["BeforeClosingTagName"] = 5] = "BeforeClosingTagName";
State[State["InClosingTagName"] = 6] = "InClosingTagName";
State[State["AfterClosingTagName"] = 7] = "AfterClosingTagName";
// Attributes
State[State["BeforeAttributeName"] = 8] = "BeforeAttributeName";
State[State["InAttributeName"] = 9] = "InAttributeName";
State[State["AfterAttributeName"] = 10] = "AfterAttributeName";
State[State["BeforeAttributeValue"] = 11] = "BeforeAttributeValue";
State[State["InAttributeValueDq"] = 12] = "InAttributeValueDq";
State[State["InAttributeValueSq"] = 13] = "InAttributeValueSq";
State[State["InAttributeValueNq"] = 14] = "InAttributeValueNq";
// Declarations
State[State["BeforeDeclaration"] = 15] = "BeforeDeclaration";
State[State["InDeclaration"] = 16] = "InDeclaration";
// Processing instructions
State[State["InProcessingInstruction"] = 17] = "InProcessingInstruction";
// Comments & CDATA
State[State["BeforeComment"] = 18] = "BeforeComment";
State[State["CDATASequence"] = 19] = "CDATASequence";
State[State["InSpecialComment"] = 20] = "InSpecialComment";
State[State["InCommentLike"] = 21] = "InCommentLike";
// Special tags
State[State["BeforeSpecialS"] = 22] = "BeforeSpecialS";
State[State["SpecialStartSequence"] = 23] = "SpecialStartSequence";
State[State["InSpecialTag"] = 24] = "InSpecialTag";
State[State["BeforeEntity"] = 25] = "BeforeEntity";
State[State["BeforeNumericEntity"] = 26] = "BeforeNumericEntity";
State[State["InNamedEntity"] = 27] = "InNamedEntity";
State[State["InNumericEntity"] = 28] = "InNumericEntity";
State[State["InHexEntity"] = 29] = "InHexEntity";
})(State || (State = {}));
function isWhitespace(c) {
return (c === CharCodes.Space ||
c === CharCodes.NewLine ||
c === CharCodes.Tab ||
c === CharCodes.FormFeed ||
c === CharCodes.CarriageReturn);
}
function isEndOfTagSection(c) {
return c === CharCodes.Slash || c === CharCodes.Gt || isWhitespace(c);
}
function isNumber(c) {
return c >= CharCodes.Zero && c <= CharCodes.Nine;
}
function isASCIIAlpha(c) {
return ((c >= CharCodes.LowerA && c <= CharCodes.LowerZ) ||
(c >= CharCodes.UpperA && c <= CharCodes.UpperZ));
}
function isHexDigit(c) {
return ((c >= CharCodes.UpperA && c <= CharCodes.UpperF) ||
(c >= CharCodes.LowerA && c <= CharCodes.LowerF));
}
export var QuoteType;
(function (QuoteType) {
QuoteType[QuoteType["NoValue"] = 0] = "NoValue";
QuoteType[QuoteType["Unquoted"] = 1] = "Unquoted";
QuoteType[QuoteType["Single"] = 2] = "Single";
QuoteType[QuoteType["Double"] = 3] = "Double";
})(QuoteType || (QuoteType = {}));
/**
* Sequences used to match longer strings.
*
* We don't have `Script`, `Style`, or `Title` here. Instead, we re-use the *End
* sequences with an increased offset.
*/
const Sequences = {
Cdata: new Uint8Array([0x43, 0x44, 0x41, 0x54, 0x41, 0x5b]),
CdataEnd: new Uint8Array([0x5d, 0x5d, 0x3e]),
CommentEnd: new Uint8Array([0x2d, 0x2d, 0x3e]),
ScriptEnd: new Uint8Array([0x3c, 0x2f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74]),
StyleEnd: new Uint8Array([0x3c, 0x2f, 0x73, 0x74, 0x79, 0x6c, 0x65]),
TitleEnd: new Uint8Array([0x3c, 0x2f, 0x74, 0x69, 0x74, 0x6c, 0x65]), // `</title`
};
export default class Tokenizer {
constructor({ xmlMode = false, decodeEntities = true, }, cbs) {
this.cbs = cbs;
/** The current state the tokenizer is in. */
this.state = State.Text;
/** The read buffer. */
this.buffer = "";
/** The beginning of the section that is currently being read. */
this.sectionStart = 0;
/** The index within the buffer that we are currently looking at. */
this.index = 0;
/** Some behavior, eg. when decoding entities, is done while we are in another state. This keeps track of the other state type. */
this.baseState = State.Text;
/** For special parsing behavior inside of script and style tags. */
this.isSpecial = false;
/** Indicates whether the tokenizer has been paused. */
this.running = true;
/** The offset of the current buffer. */
this.offset = 0;
this.currentSequence = undefined;
this.sequenceIndex = 0;
this.trieIndex = 0;
this.trieCurrent = 0;
/** For named entities, the index of the value. For numeric entities, the code point. */
this.entityResult = 0;
this.entityExcess = 0;
this.xmlMode = xmlMode;
this.decodeEntities = decodeEntities;
this.entityTrie = xmlMode ? xmlDecodeTree : htmlDecodeTree;
}
reset() {
this.state = State.Text;
this.buffer = "";
this.sectionStart = 0;
this.index = 0;
this.baseState = State.Text;
this.currentSequence = undefined;
this.running = true;
this.offset = 0;
}
write(chunk) {
this.offset += this.buffer.length;
this.buffer = chunk;
this.parse();
}
end() {
if (this.running)
this.finish();
}
pause() {
this.running = false;
}
resume() {
this.running = true;
if (this.index < this.buffer.length + this.offset) {
this.parse();
}
}
/**
* The current index within all of the written data.
*/
getIndex() {
return this.index;
}
/**
* The start of the current section.
*/
getSectionStart() {
return this.sectionStart;
}
stateText(c) {
if (c === CharCodes.Lt ||
(!this.decodeEntities && this.fastForwardTo(CharCodes.Lt))) {
if (this.index > this.sectionStart) {
this.cbs.ontext(this.sectionStart, this.index);
}
this.state = State.BeforeTagName;
this.sectionStart = this.index;
}
else if (this.decodeEntities && c === CharCodes.Amp) {
this.state = State.BeforeEntity;
}
}
stateSpecialStartSequence(c) {
const isEnd = this.sequenceIndex === this.currentSequence.length;
const isMatch = isEnd
? // If we are at the end of the sequence, make sure the tag name has ended
isEndOfTagSection(c)
: // Otherwise, do a case-insensitive comparison
(c | 0x20) === this.currentSequence[this.sequenceIndex];
if (!isMatch) {
this.isSpecial = false;
}
else if (!isEnd) {
this.sequenceIndex++;
return;
}
this.sequenceIndex = 0;
this.state = State.InTagName;
this.stateInTagName(c);
}
/** Look for an end tag. For <title> tags, also decode entities. */
stateInSpecialTag(c) {
if (this.sequenceIndex === this.currentSequence.length) {
if (c === CharCodes.Gt || isWhitespace(c)) {
const endOfText = this.index - this.currentSequence.length;
if (this.sectionStart < endOfText) {
// Spoof the index so that reported locations match up.
const actualIndex = this.index;
this.index = endOfText;
this.cbs.ontext(this.sectionStart, endOfText);
this.index = actualIndex;
}
this.isSpecial = false;
this.sectionStart = endOfText + 2; // Skip over the `</`
this.stateInClosingTagName(c);
return; // We are done; skip the rest of the function.
}
this.sequenceIndex = 0;
}
if ((c | 0x20) === this.currentSequence[this.sequenceIndex]) {
this.sequenceIndex += 1;
}
else if (this.sequenceIndex === 0) {
if (this.currentSequence === Sequences.TitleEnd) {
// We have to parse entities in <title> tags.
if (this.decodeEntities && c === CharCodes.Amp) {
this.state = State.BeforeEntity;
}
}
else if (this.fastForwardTo(CharCodes.Lt)) {
// Outside of <title> tags, we can fast-forward.
this.sequenceIndex = 1;
}
}
else {
// If we see a `<`, set the sequence index to 1; useful for eg. `<</script>`.
this.sequenceIndex = Number(c === CharCodes.Lt);
}
}
stateCDATASequence(c) {
if (c === Sequences.Cdata[this.sequenceIndex]) {
if (++this.sequenceIndex === Sequences.Cdata.length) {
this.state = State.InCommentLike;
this.currentSequence = Sequences.CdataEnd;
this.sequenceIndex = 0;
this.sectionStart = this.index + 1;
}
}
else {
this.sequenceIndex = 0;
this.state = State.InDeclaration;
this.stateInDeclaration(c); // Reconsume the character
}
}
/**
* When we wait for one specific character, we can speed things up
* by skipping through the buffer until we find it.
*
* @returns Whether the character was found.
*/
fastForwardTo(c) {
while (++this.index < this.buffer.length + this.offset) {
if (this.buffer.charCodeAt(this.index - this.offset) === c) {
return true;
}
}
/*
* We increment the index at the end of the `parse` loop,
* so set it to `buffer.length - 1` here.
*
* TODO: Refactor `parse` to increment index before calling states.
*/
this.index = this.buffer.length + this.offset - 1;
return false;
}
/**
* Comments and CDATA end with `-->` and `]]>`.
*
* Their common qualities are:
* - Their end sequences have a distinct character they start with.
* - That character is then repeated, so we have to check multiple repeats.
* - All characters but the start character of the sequence can be skipped.
*/
stateInCommentLike(c) {
if (c === this.currentSequence[this.sequenceIndex]) {
if (++this.sequenceIndex === this.currentSequence.length) {
if (this.currentSequence === Sequences.CdataEnd) {
this.cbs.oncdata(this.sectionStart, this.index, 2);
}
else {
this.cbs.oncomment(this.sectionStart, this.index, 2);
}
this.sequenceIndex = 0;
this.sectionStart = this.index + 1;
this.state = State.Text;
}
}
else if (this.sequenceIndex === 0) {
// Fast-forward to the first character of the sequence
if (this.fastForwardTo(this.currentSequence[0])) {
this.sequenceIndex = 1;
}
}
else if (c !== this.currentSequence[this.sequenceIndex - 1]) {
// Allow long sequences, eg. --->, ]]]>
this.sequenceIndex = 0;
}
}
/**
* HTML only allows ASCII alpha characters (a-z and A-Z) at the beginning of a tag name.
*
* XML allows a lot more characters here (@see https://www.w3.org/TR/REC-xml/#NT-NameStartChar).
* We allow anything that wouldn't end the tag.
*/
isTagStartChar(c) {
return this.xmlMode ? !isEndOfTagSection(c) : isASCIIAlpha(c);
}
startSpecial(sequence, offset) {
this.isSpecial = true;
this.currentSequence = sequence;
this.sequenceIndex = offset;
this.state = State.SpecialStartSequence;
}
stateBeforeTagName(c) {
if (c === CharCodes.ExclamationMark) {
this.state = State.BeforeDeclaration;
this.sectionStart = this.index + 1;
}
else if (c === CharCodes.Questionmark) {
this.state = State.InProcessingInstruction;
this.sectionStart = this.index + 1;
}
else if (this.isTagStartChar(c)) {
const lower = c | 0x20;
this.sectionStart = this.index;
if (!this.xmlMode && lower === Sequences.TitleEnd[2]) {
this.startSpecial(Sequences.TitleEnd, 3);
}
else {
this.state =
!this.xmlMode && lower === Sequences.ScriptEnd[2]
? State.BeforeSpecialS
: State.InTagName;
}
}
else if (c === CharCodes.Slash) {
this.state = State.BeforeClosingTagName;
}
else {
this.state = State.Text;
this.stateText(c);
}
}
stateInTagName(c) {
if (isEndOfTagSection(c)) {
this.cbs.onopentagname(this.sectionStart, this.index);
this.sectionStart = -1;
this.state = State.BeforeAttributeName;
this.stateBeforeAttributeName(c);
}
}
stateBeforeClosingTagName(c) {
if (isWhitespace(c)) {
// Ignore
}
else if (c === CharCodes.Gt) {
this.state = State.Text;
}
else {
this.state = this.isTagStartChar(c)
? State.InClosingTagName
: State.InSpecialComment;
this.sectionStart = this.index;
}
}
stateInClosingTagName(c) {
if (c === CharCodes.Gt || isWhitespace(c)) {
this.cbs.onclosetag(this.sectionStart, this.index);
this.sectionStart = -1;
this.state = State.AfterClosingTagName;
this.stateAfterClosingTagName(c);
}
}
stateAfterClosingTagName(c) {
// Skip everything until ">"
if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {
this.state = State.Text;
this.baseState = State.Text;
this.sectionStart = this.index + 1;
}
}
stateBeforeAttributeName(c) {
if (c === CharCodes.Gt) {
this.cbs.onopentagend(this.index);
if (this.isSpecial) {
this.state = State.InSpecialTag;
this.sequenceIndex = 0;
}
else {
this.state = State.Text;
}
this.baseState = this.state;
this.sectionStart = this.index + 1;
}
else if (c === CharCodes.Slash) {
this.state = State.InSelfClosingTag;
}
else if (!isWhitespace(c)) {
this.state = State.InAttributeName;
this.sectionStart = this.index;
}
}
stateInSelfClosingTag(c) {
if (c === CharCodes.Gt) {
this.cbs.onselfclosingtag(this.index);
this.state = State.Text;
this.baseState = State.Text;
this.sectionStart = this.index + 1;
this.isSpecial = false; // Reset special state, in case of self-closing special tags
}
else if (!isWhitespace(c)) {
this.state = State.BeforeAttributeName;
this.stateBeforeAttributeName(c);
}
}
stateInAttributeName(c) {
if (c === CharCodes.Eq || isEndOfTagSection(c)) {
this.cbs.onattribname(this.sectionStart, this.index);
this.sectionStart = -1;
this.state = State.AfterAttributeName;
this.stateAfterAttributeName(c);
}
}
stateAfterAttributeName(c) {
if (c === CharCodes.Eq) {
this.state = State.BeforeAttributeValue;
}
else if (c === CharCodes.Slash || c === CharCodes.Gt) {
this.cbs.onattribend(QuoteType.NoValue, this.index);
this.state = State.BeforeAttributeName;
this.stateBeforeAttributeName(c);
}
else if (!isWhitespace(c)) {
this.cbs.onattribend(QuoteType.NoValue, this.index);
this.state = State.InAttributeName;
this.sectionStart = this.index;
}
}
stateBeforeAttributeValue(c) {
if (c === CharCodes.DoubleQuote) {
this.state = State.InAttributeValueDq;
this.sectionStart = this.index + 1;
}
else if (c === CharCodes.SingleQuote) {
this.state = State.InAttributeValueSq;
this.sectionStart = this.index + 1;
}
else if (!isWhitespace(c)) {
this.sectionStart = this.index;
this.state = State.InAttributeValueNq;
this.stateInAttributeValueNoQuotes(c); // Reconsume token
}
}
handleInAttributeValue(c, quote) {
if (c === quote ||
(!this.decodeEntities && this.fastForwardTo(quote))) {
this.cbs.onattribdata(this.sectionStart, this.index);
this.sectionStart = -1;
this.cbs.onattribend(quote === CharCodes.DoubleQuote
? QuoteType.Double
: QuoteType.Single, this.index);
this.state = State.BeforeAttributeName;
}
else if (this.decodeEntities && c === CharCodes.Amp) {
this.baseState = this.state;
this.state = State.BeforeEntity;
}
}
stateInAttributeValueDoubleQuotes(c) {
this.handleInAttributeValue(c, CharCodes.DoubleQuote);
}
stateInAttributeValueSingleQuotes(c) {
this.handleInAttributeValue(c, CharCodes.SingleQuote);
}
stateInAttributeValueNoQuotes(c) {
if (isWhitespace(c) || c === CharCodes.Gt) {
this.cbs.onattribdata(this.sectionStart, this.index);
this.sectionStart = -1;
this.cbs.onattribend(QuoteType.Unquoted, this.index);
this.state = State.BeforeAttributeName;
this.stateBeforeAttributeName(c);
}
else if (this.decodeEntities && c === CharCodes.Amp) {
this.baseState = this.state;
this.state = State.BeforeEntity;
}
}
stateBeforeDeclaration(c) {
if (c === CharCodes.OpeningSquareBracket) {
this.state = State.CDATASequence;
this.sequenceIndex = 0;
}
else {
this.state =
c === CharCodes.Dash
? State.BeforeComment
: State.InDeclaration;
}
}
stateInDeclaration(c) {
if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {
this.cbs.ondeclaration(this.sectionStart, this.index);
this.state = State.Text;
this.sectionStart = this.index + 1;
}
}
stateInProcessingInstruction(c) {
if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {
this.cbs.onprocessinginstruction(this.sectionStart, this.index);
this.state = State.Text;
this.sectionStart = this.index + 1;
}
}
stateBeforeComment(c) {
if (c === CharCodes.Dash) {
this.state = State.InCommentLike;
this.currentSequence = Sequences.CommentEnd;
// Allow short comments (eg. <!-->)
this.sequenceIndex = 2;
this.sectionStart = this.index + 1;
}
else {
this.state = State.InDeclaration;
}
}
stateInSpecialComment(c) {
if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {
this.cbs.oncomment(this.sectionStart, this.index, 0);
this.state = State.Text;
this.sectionStart = this.index + 1;
}
}
stateBeforeSpecialS(c) {
const lower = c | 0x20;
if (lower === Sequences.ScriptEnd[3]) {
this.startSpecial(Sequences.ScriptEnd, 4);
}
else if (lower === Sequences.StyleEnd[3]) {
this.startSpecial(Sequences.StyleEnd, 4);
}
else {
this.state = State.InTagName;
this.stateInTagName(c); // Consume the token again
}
}
stateBeforeEntity(c) {
// Start excess with 1 to include the '&'
this.entityExcess = 1;
this.entityResult = 0;
if (c === CharCodes.Number) {
this.state = State.BeforeNumericEntity;
}
else if (c === CharCodes.Amp) {
// We have two `&` characters in a row. Stay in the current state.
}
else {
this.trieIndex = 0;
this.trieCurrent = this.entityTrie[0];
this.state = State.InNamedEntity;
this.stateInNamedEntity(c);
}
}
stateInNamedEntity(c) {
this.entityExcess += 1;
this.trieIndex = determineBranch(this.entityTrie, this.trieCurrent, this.trieIndex + 1, c);
if (this.trieIndex < 0) {
this.emitNamedEntity();
this.index--;
return;
}
this.trieCurrent = this.entityTrie[this.trieIndex];
const masked = this.trieCurrent & BinTrieFlags.VALUE_LENGTH;
// If the branch is a value, store it and continue
if (masked) {
// The mask is the number of bytes of the value, including the current byte.
const valueLength = (masked >> 14) - 1;
// If we have a legacy entity while parsing strictly, just skip the number of bytes
if (!this.allowLegacyEntity() && c !== CharCodes.Semi) {
this.trieIndex += valueLength;
}
else {
// Add 1 as we have already incremented the excess
const entityStart = this.index - this.entityExcess + 1;
if (entityStart > this.sectionStart) {
this.emitPartial(this.sectionStart, entityStart);
}
// If this is a surrogate pair, consume the next two bytes
this.entityResult = this.trieIndex;
this.trieIndex += valueLength;
this.entityExcess = 0;
this.sectionStart = this.index + 1;
if (valueLength === 0) {
this.emitNamedEntity();
}
}
}
}
emitNamedEntity() {
this.state = this.baseState;
if (this.entityResult === 0) {
return;
}
const valueLength = (this.entityTrie[this.entityResult] & BinTrieFlags.VALUE_LENGTH) >>
14;
switch (valueLength) {
case 1: {
this.emitCodePoint(this.entityTrie[this.entityResult] &
~BinTrieFlags.VALUE_LENGTH);
break;
}
case 2: {
this.emitCodePoint(this.entityTrie[this.entityResult + 1]);
break;
}
case 3: {
this.emitCodePoint(this.entityTrie[this.entityResult + 1]);
this.emitCodePoint(this.entityTrie[this.entityResult + 2]);
}
}
}
stateBeforeNumericEntity(c) {
if ((c | 0x20) === CharCodes.LowerX) {
this.entityExcess++;
this.state = State.InHexEntity;
}
else {
this.state = State.InNumericEntity;
this.stateInNumericEntity(c);
}
}
emitNumericEntity(strict) {
const entityStart = this.index - this.entityExcess - 1;
const numberStart = entityStart + 2 + Number(this.state === State.InHexEntity);
if (numberStart !== this.index) {
// Emit leading data if any
if (entityStart > this.sectionStart) {
this.emitPartial(this.sectionStart, entityStart);
}
this.sectionStart = this.index + Number(strict);
this.emitCodePoint(replaceCodePoint(this.entityResult));
}
this.state = this.baseState;
}
stateInNumericEntity(c) {
if (c === CharCodes.Semi) {
this.emitNumericEntity(true);
}
else if (isNumber(c)) {
this.entityResult = this.entityResult * 10 + (c - CharCodes.Zero);
this.entityExcess++;
}
else {
if (this.allowLegacyEntity()) {
this.emitNumericEntity(false);
}
else {
this.state = this.baseState;
}
this.index--;
}
}
stateInHexEntity(c) {
if (c === CharCodes.Semi) {
this.emitNumericEntity(true);
}
else if (isNumber(c)) {
this.entityResult = this.entityResult * 16 + (c - CharCodes.Zero);
this.entityExcess++;
}
else if (isHexDigit(c)) {
this.entityResult =
this.entityResult * 16 + ((c | 0x20) - CharCodes.LowerA + 10);
this.entityExcess++;
}
else {
if (this.allowLegacyEntity()) {
this.emitNumericEntity(false);
}
else {
this.state = this.baseState;
}
this.index--;
}
}
allowLegacyEntity() {
return (!this.xmlMode &&
(this.baseState === State.Text ||
this.baseState === State.InSpecialTag));
}
/**
* Remove data that has already been consumed from the buffer.
*/
cleanup() {
// If we are inside of text or attributes, emit what we already have.
if (this.running && this.sectionStart !== this.index) {
if (this.state === State.Text ||
(this.state === State.InSpecialTag && this.sequenceIndex === 0)) {
this.cbs.ontext(this.sectionStart, this.index);
this.sectionStart = this.index;
}
else if (this.state === State.InAttributeValueDq ||
this.state === State.InAttributeValueSq ||
this.state === State.InAttributeValueNq) {
this.cbs.onattribdata(this.sectionStart, this.index);
this.sectionStart = this.index;
}
}
}
shouldContinue() {
return this.index < this.buffer.length + this.offset && this.running;
}
/**
* Iterates through the buffer, calling the function corresponding to the current state.
*
* States that are more likely to be hit are higher up, as a performance improvement.
*/
parse() {
while (this.shouldContinue()) {
const c = this.buffer.charCodeAt(this.index - this.offset);
switch (this.state) {
case State.Text: {
this.stateText(c);
break;
}
case State.SpecialStartSequence: {
this.stateSpecialStartSequence(c);
break;
}
case State.InSpecialTag: {
this.stateInSpecialTag(c);
break;
}
case State.CDATASequence: {
this.stateCDATASequence(c);
break;
}
case State.InAttributeValueDq: {
this.stateInAttributeValueDoubleQuotes(c);
break;
}
case State.InAttributeName: {
this.stateInAttributeName(c);
break;
}
case State.InCommentLike: {
this.stateInCommentLike(c);
break;
}
case State.InSpecialComment: {
this.stateInSpecialComment(c);
break;
}
case State.BeforeAttributeName: {
this.stateBeforeAttributeName(c);
break;
}
case State.InTagName: {
this.stateInTagName(c);
break;
}
case State.InClosingTagName: {
this.stateInClosingTagName(c);
break;
}
case State.BeforeTagName: {
this.stateBeforeTagName(c);
break;
}
case State.AfterAttributeName: {
this.stateAfterAttributeName(c);
break;
}
case State.InAttributeValueSq: {
this.stateInAttributeValueSingleQuotes(c);
break;
}
case State.BeforeAttributeValue: {
this.stateBeforeAttributeValue(c);
break;
}
case State.BeforeClosingTagName: {
this.stateBeforeClosingTagName(c);
break;
}
case State.AfterClosingTagName: {
this.stateAfterClosingTagName(c);
break;
}
case State.BeforeSpecialS: {
this.stateBeforeSpecialS(c);
break;
}
case State.InAttributeValueNq: {
this.stateInAttributeValueNoQuotes(c);
break;
}
case State.InSelfClosingTag: {
this.stateInSelfClosingTag(c);
break;
}
case State.InDeclaration: {
this.stateInDeclaration(c);
break;
}
case State.BeforeDeclaration: {
this.stateBeforeDeclaration(c);
break;
}
case State.BeforeComment: {
this.stateBeforeComment(c);
break;
}
case State.InProcessingInstruction: {
this.stateInProcessingInstruction(c);
break;
}
case State.InNamedEntity: {
this.stateInNamedEntity(c);
break;
}
case State.BeforeEntity: {
this.stateBeforeEntity(c);
break;
}
case State.InHexEntity: {
this.stateInHexEntity(c);
break;
}
case State.InNumericEntity: {
this.stateInNumericEntity(c);
break;
}
default: {
// `this._state === State.BeforeNumericEntity`
this.stateBeforeNumericEntity(c);
}
}
this.index++;
}
this.cleanup();
}
finish() {
if (this.state === State.InNamedEntity) {
this.emitNamedEntity();
}
// If there is remaining data, emit it in a reasonable way
if (this.sectionStart < this.index) {
this.handleTrailingData();
}
this.cbs.onend();
}
/** Handle any trailing data. */
handleTrailingData() {
const endIndex = this.buffer.length + this.offset;
if (this.state === State.InCommentLike) {
if (this.currentSequence === Sequences.CdataEnd) {
this.cbs.oncdata(this.sectionStart, endIndex, 0);
}
else {
this.cbs.oncomment(this.sectionStart, endIndex, 0);
}
}
else if (this.state === State.InNumericEntity &&
this.allowLegacyEntity()) {
this.emitNumericEntity(false);
// All trailing data will have been consumed
}
else if (this.state === State.InHexEntity &&
this.allowLegacyEntity()) {
this.emitNumericEntity(false);
// All trailing data will have been consumed
}
else if (this.state === State.InTagName ||
this.state === State.BeforeAttributeName ||
this.state === State.BeforeAttributeValue ||
this.state === State.AfterAttributeName ||
this.state === State.InAttributeName ||
this.state === State.InAttributeValueSq ||
this.state === State.InAttributeValueDq ||
this.state === State.InAttributeValueNq ||
this.state === State.InClosingTagName) {
/*
* If we are currently in an opening or closing tag, us not calling the
* respective callback signals that the tag should be ignored.
*/
}
else {
this.cbs.ontext(this.sectionStart, endIndex);
}
}
emitPartial(start, endIndex) {
if (this.baseState !== State.Text &&
this.baseState !== State.InSpecialTag) {
this.cbs.onattribdata(start, endIndex);
}
else {
this.cbs.ontext(start, endIndex);
}
}
emitCodePoint(cp) {
if (this.baseState !== State.Text &&
this.baseState !== State.InSpecialTag) {
this.cbs.onattribentity(cp);
}
else {
this.cbs.ontextentity(cp);
}
}
}
//# sourceMappingURL=Tokenizer.js.map

View File

@@ -0,0 +1,227 @@
import { buildLocalizeFn } from "../../_lib/buildLocalizeFn.mjs";
const eraValues = {
narrow: ["pr.n.e.", "AD"],
abbreviated: ["pr. Hr.", "po. Hr."],
wide: ["Prije Hrista", "Poslije Hrista"],
};
const quarterValues = {
narrow: ["1.", "2.", "3.", "4."],
abbreviated: ["1. kv.", "2. kv.", "3. kv.", "4. kv."],
wide: ["1. kvartal", "2. kvartal", "3. kvartal", "4. kvartal"],
};
const monthValues = {
narrow: [
"1.",
"2.",
"3.",
"4.",
"5.",
"6.",
"7.",
"8.",
"9.",
"10.",
"11.",
"12.",
],
abbreviated: [
"jan",
"feb",
"mar",
"apr",
"maj",
"jun",
"jul",
"avg",
"sep",
"okt",
"nov",
"dec",
],
wide: [
"januar",
"februar",
"mart",
"april",
"maj",
"juni",
"juli",
"avgust",
"septembar",
"oktobar",
"novembar",
"decembar",
],
};
const formattingMonthValues = {
narrow: [
"1.",
"2.",
"3.",
"4.",
"5.",
"6.",
"7.",
"8.",
"9.",
"10.",
"11.",
"12.",
],
abbreviated: [
"jan",
"feb",
"mar",
"apr",
"maj",
"jun",
"jul",
"avg",
"sep",
"okt",
"nov",
"dec",
],
wide: [
"januar",
"februar",
"mart",
"april",
"maj",
"juni",
"juli",
"avgust",
"septembar",
"oktobar",
"novembar",
"decembar",
],
};
const dayValues = {
narrow: ["N", "P", "U", "S", "Č", "P", "S"],
short: ["ned", "pon", "uto", "sre", "čet", "pet", "sub"],
abbreviated: ["ned", "pon", "uto", "sre", "čet", "pet", "sub"],
wide: [
"nedjelja",
"ponedjeljak",
"utorak",
"srijeda",
"četvrtak",
"petak",
"subota",
],
};
const dayPeriodValues = {
narrow: {
am: "AM",
pm: "PM",
midnight: "ponoć",
noon: "podne",
morning: "ujutru",
afternoon: "popodne",
evening: "uveče",
night: "noću",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "ponoć",
noon: "podne",
morning: "ujutru",
afternoon: "popodne",
evening: "uveče",
night: "noću",
},
wide: {
am: "AM",
pm: "PM",
midnight: "ponoć",
noon: "podne",
morning: "ujutru",
afternoon: "poslije podne",
evening: "uveče",
night: "noću",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "AM",
pm: "PM",
midnight: "ponoć",
noon: "podne",
morning: "ujutru",
afternoon: "popodne",
evening: "uveče",
night: "noću",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "ponoć",
noon: "podne",
morning: "ujutru",
afternoon: "popodne",
evening: "uveče",
night: "noću",
},
wide: {
am: "AM",
pm: "PM",
midnight: "ponoć",
noon: "podne",
morning: "ujutru",
afternoon: "poslije podne",
evening: "uveče",
night: "noću",
},
};
const ordinalNumber = (dirtyNumber, _options) => {
const number = Number(dirtyNumber);
return String(number) + ".";
};
export const localize = {
ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide",
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide",
formattingValues: formattingMonthValues,
defaultFormattingWidth: "wide",
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
};

View File

@@ -0,0 +1,2 @@
export { ScrollInfoProvider, useScrollInfo } from '@faceless-ui/scroll-info';
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"getClientConfig.d.ts","sourceRoot":"","sources":["../../src/utilities/getClientConfig.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAanE,eAAO,MAAM,eAAe,sCACU,sBAAsB,KAAG,YAgC9D,CAAA"}

View File

@@ -0,0 +1,101 @@
import { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
import { SDK_VERSION, _INTERNAL_shouldSkipAiProviderWrapping, ANTHROPIC_AI_INTEGRATION_NAME, getClient, instrumentAnthropicAiClient } from '@sentry/core';
const supportedVersions = ['>=0.19.2 <1.0.0'];
/**
* Sentry Anthropic AI instrumentation using OpenTelemetry.
*/
class SentryAnthropicAiInstrumentation extends InstrumentationBase {
constructor(config = {}) {
super('@sentry/instrumentation-anthropic-ai', SDK_VERSION, config);
}
/**
* Initializes the instrumentation by defining the modules to be patched.
*/
init() {
const module = new InstrumentationNodeModuleDefinition(
'@anthropic-ai/sdk',
supportedVersions,
this._patch.bind(this),
);
return module;
}
/**
* Core patch logic applying instrumentation to the Anthropic AI client constructor.
*/
_patch(exports$1) {
const Original = exports$1.Anthropic;
const config = this.getConfig();
const WrappedAnthropic = function ( ...args) {
// Check if wrapping should be skipped (e.g., when LangChain is handling instrumentation)
if (_INTERNAL_shouldSkipAiProviderWrapping(ANTHROPIC_AI_INTEGRATION_NAME)) {
return Reflect.construct(Original, args) ;
}
const instance = Reflect.construct(Original, args);
const client = getClient();
const defaultPii = Boolean(client?.getOptions().sendDefaultPii);
const recordInputs = config.recordInputs ?? defaultPii;
const recordOutputs = config.recordOutputs ?? defaultPii;
return instrumentAnthropicAiClient(instance , {
recordInputs,
recordOutputs,
});
} ;
// Preserve static and prototype chains
Object.setPrototypeOf(WrappedAnthropic, Original);
Object.setPrototypeOf(WrappedAnthropic.prototype, Original.prototype);
for (const key of Object.getOwnPropertyNames(Original)) {
if (!['length', 'name', 'prototype'].includes(key)) {
const descriptor = Object.getOwnPropertyDescriptor(Original, key);
if (descriptor) {
Object.defineProperty(WrappedAnthropic, key, descriptor);
}
}
}
// Constructor replacement - handle read-only properties
// The Anthropic property might have only a getter, so use defineProperty
try {
exports$1.Anthropic = WrappedAnthropic;
} catch (error) {
// If direct assignment fails, override the property descriptor
Object.defineProperty(exports$1, 'Anthropic', {
value: WrappedAnthropic,
writable: true,
configurable: true,
enumerable: true,
});
}
// Wrap the default export if it points to the original constructor
// Constructor replacement - handle read-only properties
// The Anthropic property might have only a getter, so use defineProperty
if (exports$1.default === Original) {
try {
exports$1.default = WrappedAnthropic;
} catch (error) {
// If direct assignment fails, override the property descriptor
Object.defineProperty(exports$1, 'default', {
value: WrappedAnthropic,
writable: true,
configurable: true,
enumerable: true,
});
}
}
return exports$1;
}
}
export { SentryAnthropicAiInstrumentation };
//# sourceMappingURL=instrumentation.js.map

View File

@@ -0,0 +1,229 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const is = require('./is.js');
const misc = require('./misc.js');
const normalize = require('./normalize.js');
const object = require('./object.js');
/**
* Extracts stack frames from the error.stack string
*/
function parseStackFrames(stackParser, error) {
return stackParser(error.stack || '', 1);
}
function hasSentryFetchUrlHost(error) {
return is.isError(error) && '__sentry_fetch_url_host__' in error && typeof error.__sentry_fetch_url_host__ === 'string';
}
/**
* Enhances the error message with the hostname for better Sentry error reporting.
* This allows third-party packages to still match on the original error message,
* while Sentry gets the enhanced version with context.
*
* Only used internally
* @hidden
*/
function _enhanceErrorWithSentryInfo(error) {
// If the error has a __sentry_fetch_url_host__ property (added by fetch instrumentation),
// enhance the error message with the hostname.
if (hasSentryFetchUrlHost(error)) {
return `${error.message} (${error.__sentry_fetch_url_host__})`;
}
return error.message;
}
/**
* Extracts stack frames from the error and builds a Sentry Exception
*/
function exceptionFromError(stackParser, error) {
const exception = {
type: error.name || error.constructor.name,
value: _enhanceErrorWithSentryInfo(error),
};
const frames = parseStackFrames(stackParser, error);
if (frames.length) {
exception.stacktrace = { frames };
}
return exception;
}
/** If a plain object has a property that is an `Error`, return this error. */
function getErrorPropertyFromObject(obj) {
for (const prop in obj) {
if (Object.prototype.hasOwnProperty.call(obj, prop)) {
const value = obj[prop];
if (value instanceof Error) {
return value;
}
}
}
return undefined;
}
function getMessageForObject(exception) {
if ('name' in exception && typeof exception.name === 'string') {
let message = `'${exception.name}' captured as exception`;
if ('message' in exception && typeof exception.message === 'string') {
message += ` with message '${exception.message}'`;
}
return message;
} else if ('message' in exception && typeof exception.message === 'string') {
return exception.message;
}
const keys = object.extractExceptionKeysForMessage(exception);
// Some ErrorEvent instances do not have an `error` property, which is why they are not handled before
// We still want to try to get a decent message for these cases
if (is.isErrorEvent(exception)) {
return `Event \`ErrorEvent\` captured as exception with message \`${exception.message}\``;
}
const className = getObjectClassName(exception);
return `${
className && className !== 'Object' ? `'${className}'` : 'Object'
} captured as exception with keys: ${keys}`;
}
function getObjectClassName(obj) {
try {
const prototype = Object.getPrototypeOf(obj);
return prototype ? prototype.constructor.name : undefined;
} catch {
// ignore errors here
}
}
function getException(
client,
mechanism,
exception,
hint,
) {
if (is.isError(exception)) {
return [exception, undefined];
}
// Mutate this!
mechanism.synthetic = true;
if (is.isPlainObject(exception)) {
const normalizeDepth = client?.getOptions().normalizeDepth;
const extras = { ['__serialized__']: normalize.normalizeToSize(exception, normalizeDepth) };
const errorFromProp = getErrorPropertyFromObject(exception);
if (errorFromProp) {
return [errorFromProp, extras];
}
const message = getMessageForObject(exception);
const ex = hint?.syntheticException || new Error(message);
ex.message = message;
return [ex, extras];
}
// This handles when someone does: `throw "something awesome";`
// We use synthesized Error here so we can extract a (rough) stack trace.
const ex = hint?.syntheticException || new Error(exception );
ex.message = `${exception}`;
return [ex, undefined];
}
/**
* Builds and Event from a Exception
* @hidden
*/
function eventFromUnknownInput(
client,
stackParser,
exception,
hint,
) {
const providedMechanism = hint?.data && (hint.data ).mechanism;
const mechanism = providedMechanism || {
handled: true,
type: 'generic',
};
const [ex, extras] = getException(client, mechanism, exception, hint);
const event = {
exception: {
values: [exceptionFromError(stackParser, ex)],
},
};
if (extras) {
event.extra = extras;
}
misc.addExceptionTypeValue(event, undefined, undefined);
misc.addExceptionMechanism(event, mechanism);
return {
...event,
event_id: hint?.event_id,
};
}
/**
* Builds and Event from a Message
* @hidden
*/
function eventFromMessage(
stackParser,
message,
level = 'info',
hint,
attachStacktrace,
) {
const event = {
event_id: hint?.event_id,
level,
};
if (attachStacktrace && hint?.syntheticException) {
const frames = parseStackFrames(stackParser, hint.syntheticException);
if (frames.length) {
event.exception = {
values: [
{
value: message,
stacktrace: { frames },
},
],
};
misc.addExceptionMechanism(event, { synthetic: true });
}
}
if (is.isParameterizedString(message)) {
const { __sentry_template_string__, __sentry_template_values__ } = message;
event.logentry = {
message: __sentry_template_string__,
params: __sentry_template_values__,
};
return event;
}
event.message = message;
return event;
}
exports._enhanceErrorWithSentryInfo = _enhanceErrorWithSentryInfo;
exports.eventFromMessage = eventFromMessage;
exports.eventFromUnknownInput = eventFromUnknownInput;
exports.exceptionFromError = exceptionFromError;
exports.parseStackFrames = parseStackFrames;
//# sourceMappingURL=eventbuilder.js.map

View File

@@ -0,0 +1,152 @@
"use strict";
exports.__esModule = true;
exports.default = void 0;
var _propTypes = _interopRequireDefault(require("prop-types"));
var _react = _interopRequireDefault(require("react"));
var _reactDom = _interopRequireDefault(require("react-dom"));
var _TransitionGroup = _interopRequireDefault(require("./TransitionGroup"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
/**
* The `<ReplaceTransition>` component is a specialized `Transition` component
* that animates between two children.
*
* ```jsx
* <ReplaceTransition in>
* <Fade><div>I appear first</div></Fade>
* <Fade><div>I replace the above</div></Fade>
* </ReplaceTransition>
* ```
*/
var ReplaceTransition = /*#__PURE__*/function (_React$Component) {
_inheritsLoose(ReplaceTransition, _React$Component);
function ReplaceTransition() {
var _this;
for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
_args[_key] = arguments[_key];
}
_this = _React$Component.call.apply(_React$Component, [this].concat(_args)) || this;
_this.handleEnter = function () {
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
return _this.handleLifecycle('onEnter', 0, args);
};
_this.handleEntering = function () {
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
args[_key3] = arguments[_key3];
}
return _this.handleLifecycle('onEntering', 0, args);
};
_this.handleEntered = function () {
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
args[_key4] = arguments[_key4];
}
return _this.handleLifecycle('onEntered', 0, args);
};
_this.handleExit = function () {
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
args[_key5] = arguments[_key5];
}
return _this.handleLifecycle('onExit', 1, args);
};
_this.handleExiting = function () {
for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
args[_key6] = arguments[_key6];
}
return _this.handleLifecycle('onExiting', 1, args);
};
_this.handleExited = function () {
for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
args[_key7] = arguments[_key7];
}
return _this.handleLifecycle('onExited', 1, args);
};
return _this;
}
var _proto = ReplaceTransition.prototype;
_proto.handleLifecycle = function handleLifecycle(handler, idx, originalArgs) {
var _child$props;
var children = this.props.children;
var child = _react.default.Children.toArray(children)[idx];
if (child.props[handler]) (_child$props = child.props)[handler].apply(_child$props, originalArgs);
if (this.props[handler]) {
var maybeNode = child.props.nodeRef ? undefined : _reactDom.default.findDOMNode(this);
this.props[handler](maybeNode);
}
};
_proto.render = function render() {
var _this$props = this.props,
children = _this$props.children,
inProp = _this$props.in,
props = _objectWithoutPropertiesLoose(_this$props, ["children", "in"]);
var _React$Children$toArr = _react.default.Children.toArray(children),
first = _React$Children$toArr[0],
second = _React$Children$toArr[1];
delete props.onEnter;
delete props.onEntering;
delete props.onEntered;
delete props.onExit;
delete props.onExiting;
delete props.onExited;
return /*#__PURE__*/_react.default.createElement(_TransitionGroup.default, props, inProp ? _react.default.cloneElement(first, {
key: 'first',
onEnter: this.handleEnter,
onEntering: this.handleEntering,
onEntered: this.handleEntered
}) : _react.default.cloneElement(second, {
key: 'second',
onEnter: this.handleExit,
onEntering: this.handleExiting,
onEntered: this.handleExited
}));
};
return ReplaceTransition;
}(_react.default.Component);
ReplaceTransition.propTypes = process.env.NODE_ENV !== "production" ? {
in: _propTypes.default.bool.isRequired,
children: function children(props, propName) {
if (_react.default.Children.count(props[propName]) !== 2) return new Error("\"" + propName + "\" must be exactly two transition components.");
return null;
}
} : {};
var _default = ReplaceTransition;
exports.default = _default;
module.exports = exports.default;

View File

@@ -0,0 +1,83 @@
import toSnakeCase from 'to-snake-case';
import { findMany } from './find/findMany.js';
import { upsertRow } from './upsertRow/index.js';
import { shouldUseOptimizedUpsertRow } from './upsertRow/shouldUseOptimizedUpsertRow.js';
import { getTransaction } from './utilities/getTransaction.js';
export const updateJobs = async function updateMany({ id, data, limit: limitArg, req, returning, sort: sortArg, where: whereArg }) {
if (!data?.log?.length && !(data.log && typeof data.log === 'object' && '$push' in data.log)) {
delete data.log;
}
const whereToUse = id ? {
id: {
equals: id
}
} : whereArg;
const limit = id ? 1 : limitArg;
const collection = this.payload.collections['payload-jobs'].config;
const tableName = this.tableNameMap.get(toSnakeCase(collection.slug));
const sort = sortArg !== undefined && sortArg !== null ? sortArg : collection.defaultSort;
const useOptimizedUpsertRow = shouldUseOptimizedUpsertRow({
data,
fields: collection.flattenedFields
});
if (useOptimizedUpsertRow && id) {
const db = await getTransaction(this, req);
const result = await upsertRow({
id,
adapter: this,
collectionSlug: 'payload-jobs',
data,
db,
fields: collection.flattenedFields,
ignoreResult: returning === false,
operation: 'update',
req,
tableName
});
return returning === false ? null : [
result
];
}
const jobs = await findMany({
adapter: this,
collectionSlug: 'payload-jobs',
fields: collection.flattenedFields,
limit: id ? 1 : limit,
pagination: false,
req,
sort,
tableName,
where: whereToUse
});
if (!jobs.docs.length) {
return [];
}
const db = await getTransaction(this, req);
const results = [];
// TODO: We need to batch this to reduce the amount of db calls. This can get very slow if we are updating a lot of rows.
for (const job of jobs.docs){
const updateData = useOptimizedUpsertRow ? data : {
...job,
...data
};
const result = await upsertRow({
id: job.id,
adapter: this,
collectionSlug: 'payload-jobs',
data: updateData,
db,
fields: collection.flattenedFields,
ignoreResult: returning === false,
operation: 'update',
req,
tableName
});
results.push(result);
}
if (returning === false) {
return null;
}
return results;
};
//# sourceMappingURL=updateJobs.js.map

View File

@@ -0,0 +1,217 @@
"use strict";
exports.localize = void 0;
var _index = require("../../_lib/buildLocalizeFn.cjs");
const eraValues = {
narrow: ["до н.е.", "н.е."],
abbreviated: ["до н. е.", "н. е."],
wide: ["до нашої ери", "нашої ери"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["1-й кв.", "2-й кв.", "3-й кв.", "4-й кв."],
wide: ["1-й квартал", "2-й квартал", "3-й квартал", "4-й квартал"],
};
const monthValues = {
// ДСТУ 3582:2013
narrow: ["С", "Л", "Б", "К", "Т", "Ч", "Л", "С", "В", "Ж", "Л", "Г"],
abbreviated: [
"січ.",
"лют.",
"берез.",
"квіт.",
"трав.",
"черв.",
"лип.",
"серп.",
"верес.",
"жовт.",
"листоп.",
"груд.",
],
wide: [
"січень",
"лютий",
"березень",
"квітень",
"травень",
"червень",
"липень",
"серпень",
"вересень",
"жовтень",
"листопад",
"грудень",
],
};
const formattingMonthValues = {
narrow: ["С", "Л", "Б", "К", "Т", "Ч", "Л", "С", "В", "Ж", "Л", "Г"],
abbreviated: [
"січ.",
"лют.",
"берез.",
"квіт.",
"трав.",
"черв.",
"лип.",
"серп.",
"верес.",
"жовт.",
"листоп.",
"груд.",
],
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 unit = String(options?.unit);
const number = Number(dirtyNumber);
let suffix;
if (unit === "date") {
if (number === 3 || number === 23) {
suffix = "-є";
} else {
suffix = "-е";
}
} else if (unit === "minute" || unit === "second" || unit === "hour") {
suffix = "-а";
} else {
suffix = "-й";
}
return number + suffix;
};
const localize = (exports.localize = {
ordinalNumber,
era: (0, _index.buildLocalizeFn)({
values: eraValues,
defaultWidth: "wide",
}),
quarter: (0, _index.buildLocalizeFn)({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: (0, _index.buildLocalizeFn)({
values: monthValues,
defaultWidth: "wide",
formattingValues: formattingMonthValues,
defaultFormattingWidth: "wide",
}),
day: (0, _index.buildLocalizeFn)({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: (0, _index.buildLocalizeFn)({
values: dayPeriodValues,
defaultWidth: "any",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
});

View File

@@ -0,0 +1 @@
{"version":3,"file":"RandomIdGenerator.js","sourceRoot":"","sources":["../../../../src/platform/browser/RandomIdGenerator.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAIH,MAAM,cAAc,GAAG,EAAE,CAAC;AAC1B,MAAM,aAAa,GAAG,CAAC,CAAC;AAExB,MAAM,YAAY,GAAG,IAAI,UAAU,CAAC,cAAc,CAAC,CAAC;AACpD,MAAM,WAAW,GAAG,IAAI,UAAU,CAAC,aAAa,CAAC,CAAC;AAElD,6DAA6D;AAC7D,MAAM,GAAG,GAAa,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CACzD,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAChC,CAAC;AAEF;;;GAGG;AACH,SAAS,UAAU,CAAC,GAAe;IACjC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACnC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC;KACtC;IACD,kBAAkB;IAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACnC,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;YAAE,OAAO;KACxB;IACD,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;AAC1B,CAAC;AAED,SAAS,KAAK,CAAC,GAAe;IAC5B,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACnC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;KACpB;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAa,iBAAiB;IAC5B;;;OAGG;IACH,eAAe;QACb,UAAU,CAAC,YAAY,CAAC,CAAC;QACzB,OAAO,KAAK,CAAC,YAAY,CAAC,CAAC;IAC7B,CAAC;IAED;;;OAGG;IACH,cAAc;QACZ,UAAU,CAAC,WAAW,CAAC,CAAC;QACxB,OAAO,KAAK,CAAC,WAAW,CAAC,CAAC;IAC5B,CAAC;CACF;AAlBD,8CAkBC","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 { IdGenerator } from '../../IdGenerator';\n\nconst TRACE_ID_BYTES = 16;\nconst SPAN_ID_BYTES = 8;\n\nconst TRACE_BUFFER = new Uint8Array(TRACE_ID_BYTES);\nconst SPAN_BUFFER = new Uint8Array(SPAN_ID_BYTES);\n\n// Byte-to-hex lookup is faster than toString(16) in browsers\nconst HEX: string[] = Array.from({ length: 256 }, (_, i) =>\n i.toString(16).padStart(2, '0')\n);\n\n/**\n * Fills buffer with random bytes, ensuring at least one is non-zero\n * per W3C Trace Context spec.\n */\nfunction randomFill(buf: Uint8Array): void {\n for (let i = 0; i < buf.length; i++) {\n buf[i] = (Math.random() * 256) >>> 0;\n }\n // Ensure non-zero\n for (let i = 0; i < buf.length; i++) {\n if (buf[i] > 0) return;\n }\n buf[buf.length - 1] = 1;\n}\n\nfunction toHex(buf: Uint8Array): string {\n let hex = '';\n for (let i = 0; i < buf.length; i++) {\n hex += HEX[buf[i]];\n }\n return hex;\n}\n\nexport class RandomIdGenerator implements IdGenerator {\n /**\n * Returns a random 16-byte trace ID formatted/encoded as a 32 lowercase hex\n * characters corresponding to 128 bits.\n */\n generateTraceId(): string {\n randomFill(TRACE_BUFFER);\n return toHex(TRACE_BUFFER);\n }\n\n /**\n * Returns a random 8-byte span ID formatted/encoded as a 16 lowercase hex\n * characters corresponding to 64 bits.\n */\n generateSpanId(): string {\n randomFill(SPAN_BUFFER);\n return toHex(SPAN_BUFFER);\n }\n}\n"]}

View File

@@ -0,0 +1,7 @@
"use strict";
exports.setDay = void 0;
var _index = require("../setDay.js");
var _index2 = require("./_lib/convertToFP.js"); // This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
const setDay = (exports.setDay = (0, _index2.convertToFP)(_index.setDay, 2));

View File

@@ -0,0 +1 @@
{"version":3,"file":"countVersions.d.ts","sourceRoot":"","sources":["../../../../src/collections/operations/local/countVersions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC7F,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAO9E,MAAM,MAAM,oBAAoB,CAAC,KAAK,SAAS,cAAc,IAAI;IAC/D;;OAEG;IACH,UAAU,EAAE,KAAK,CAAA;IACjB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;;OAGG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAA;IAE7B;;OAEG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,CAAA;AAED,wBAAsB,kBAAkB,CAAC,KAAK,SAAS,cAAc,EACnE,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,oBAAoB,CAAC,KAAK,CAAC,GACnC,OAAO,CAAC;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAkBhC"}

View File

@@ -0,0 +1,20 @@
export type XOrds = 'e' | 'w'
export type YOrds = 'n' | 's'
export type XYOrds = 'nw' | 'ne' | 'se' | 'sw'
export type Ords = XOrds | YOrds | XYOrds
export interface Crop {
x: number
y: number
width: number
height: number
unit: 'px' | '%'
}
export interface PixelCrop extends Crop {
unit: 'px'
}
export interface PercentCrop extends Crop {
unit: '%'
}

View File

@@ -0,0 +1,5 @@
export declare const lastDayOfWeekWithOptions: import("./types.js").FPFn2<
Date,
import("../lastDayOfWeek.js").LastDayOfWeekOptions<Date> | undefined,
import("../fp.js").DateArg<Date>
>;

View File

@@ -0,0 +1,26 @@
/**
* @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 Stamp = createLucideIcon("Stamp", [
["path", { d: "M5 22h14", key: "ehvnwv" }],
[
"path",
{
d: "M19.27 13.73A2.5 2.5 0 0 0 17.5 13h-11A2.5 2.5 0 0 0 4 15.5V17a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-1.5c0-.66-.26-1.3-.73-1.77Z",
key: "1sy9ra"
}
],
[
"path",
{ d: "M14 13V8.5C14 7 15 7 15 5a3 3 0 0 0-3-3c-1.66 0-3 1-3 3s1 2 1 3.5V13", key: "cnxgux" }
]
]);
export { Stamp as default };
//# sourceMappingURL=stamp.js.map

View File

@@ -0,0 +1,46 @@
import { toDate } from "./toDate.js";
/**
* @name compareAsc
* @category Common Helpers
* @summary Compare the two dates and return -1, 0 or 1.
*
* @description
* Compare the two dates and return 1 if the first date is after the second,
* -1 if the first date is before the second or 0 if dates are equal.
*
* @param dateLeft - The first date to compare
* @param dateRight - The second date to compare
*
* @returns The result of the comparison
*
* @example
* // Compare 11 February 1987 and 10 July 1989:
* const result = compareAsc(new Date(1987, 1, 11), new Date(1989, 6, 10))
* //=> -1
*
* @example
* // Sort the array of dates:
* const result = [
* new Date(1995, 6, 2),
* new Date(1987, 1, 11),
* new Date(1989, 6, 10)
* ].sort(compareAsc)
* //=> [
* // Wed Feb 11 1987 00:00:00,
* // Mon Jul 10 1989 00:00:00,
* // Sun Jul 02 1995 00:00:00
* // ]
*/
export function compareAsc(dateLeft, dateRight) {
const diff = +toDate(dateLeft) - +toDate(dateRight);
if (diff < 0) return -1;
else if (diff > 0) return 1;
// Return 0 if diff is 0; return NaN if diff is NaN
return diff;
}
// Fallback for modularized imports:
export default compareAsc;

View File

@@ -0,0 +1,31 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.endSpan = void 0;
const api_1 = require("@opentelemetry/api");
const endSpan = (span, err) => {
if (err) {
span.recordException(err);
span.setStatus({
code: api_1.SpanStatusCode.ERROR,
message: err.message,
});
}
span.end();
};
exports.endSpan = endSpan;
//# sourceMappingURL=utils.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"useRelatedCollections.js","names":["c","_c","useState","useConfig","useRelatedCollections","relationTo","$","getEntityConfig","t0","relations","map","relation","collectionSlug","relatedCollections"],"sources":["../../src/hooks/useRelatedCollections.ts"],"sourcesContent":["'use client'\nimport type { ClientCollectionConfig } from 'payload'\n\nimport { useState } from 'react'\n\nimport { useConfig } from '../providers/Config/index.js'\n\n/**\n * Gets the corresponding client collection config(s) for the given collection slug.\n */\nexport const useRelatedCollections = (relationTo: string | string[]): ClientCollectionConfig[] => {\n const { getEntityConfig } = useConfig()\n\n const [relatedCollections] = useState(() => {\n if (relationTo) {\n const relations = typeof relationTo === 'string' ? [relationTo] : relationTo\n return relations.map((relation) => getEntityConfig({ collectionSlug: relation }))\n }\n return []\n })\n\n return relatedCollections\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;AAGA,SAASC,QAAQ,QAAQ;AAEzB,SAASC,SAAS,QAAQ;AAE1B;;;AAGA,OAAO,MAAMC,qBAAA,GAAwBC,UAAA;EAAA,MAAAC,CAAA,GAAAL,EAAA;EACnC;IAAAM;EAAA,IAA4BJ,SAAA;EAAA,IAAAK,EAAA;EAAA,IAAAF,CAAA,QAAAC,eAAA,IAAAD,CAAA,QAAAD,UAAA;IAEUG,EAAA,GAAAA,CAAA;MAAA,IAChCH,UAAA;QACF,MAAAI,SAAA,GAAkB,OAAOJ,UAAA,KAAe,YAAYA,UAAA,IAAcA,UAAA;QAAA,OAC3DI,SAAA,CAAAC,GAAA,CAAAC,QAAA,IAA4BJ,eAAA;UAAAK,cAAA,EAAkCD;QAAA,CAAS;MAAA;MAAA;IAAA;IAGlFL,CAAA,MAAAC,eAAA;IAAAD,CAAA,MAAAD,UAAA;IAAAC,CAAA,MAAAE,EAAA;EAAA;IAAAA,EAAA,GAAAF,CAAA;EAAA;EANA,OAAAO,kBAAA,IAA6BX,QAAA,CAASM,EAMtC;EAAA,OAEOK,kBAAA;AAAA,CACT","ignoreList":[]}

View File

@@ -0,0 +1,324 @@
/*
@license
Rollup.js v4.58.0
Fri, 20 Feb 2026 12:44:20 GMT - commit 33f39c1f205ea2eadaf4b589e493453e2baa3662
https://github.com/rollup/rollup
Released under the MIT License.
*/
'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const rollup = require('./rollup.js');
const path = require('node:path');
const process = require('node:process');
const index = require('./index.js');
const node_os = require('node:os');
require('./parseAst.js');
require('../native.js');
require('path');
require('node:perf_hooks');
require('node:fs/promises');
require('fs');
require('util');
require('stream');
require('os');
require('./fsevents-importer.js');
require('events');
class FileWatcher {
constructor(task, chokidarOptions) {
this.transformWatchers = new Map();
this.chokidarOptions = chokidarOptions;
this.task = task;
this.watcher = this.createWatcher(null);
}
close() {
this.watcher.close();
for (const watcher of this.transformWatchers.values()) {
watcher.close();
}
}
unwatch(id) {
this.watcher.unwatch(id);
const transformWatcher = this.transformWatchers.get(id);
if (transformWatcher) {
this.transformWatchers.delete(id);
transformWatcher.close();
}
}
watch(id, isTransformDependency) {
if (isTransformDependency) {
const watcher = this.transformWatchers.get(id) ?? this.createWatcher(id);
watcher.add(id);
this.transformWatchers.set(id, watcher);
}
else {
this.watcher.add(id);
}
}
createWatcher(transformWatcherId) {
const task = this.task;
const isLinux = node_os.platform() === 'linux';
const isFreeBSD = node_os.platform() === 'freebsd';
const isTransformDependency = transformWatcherId !== null;
const handleChange = (id, event) => {
const changedId = transformWatcherId || id;
if (isLinux || isFreeBSD) {
// unwatching and watching fixes an issue with chokidar where on certain systems,
// a file that was unlinked and immediately recreated would create a change event
// but then no longer any further events
watcher.unwatch(changedId);
watcher.add(changedId);
}
task.invalidate(changedId, { event, isTransformDependency });
};
const watcher = index.chokidar
.watch([], this.chokidarOptions)
.on('add', id => handleChange(id, 'create'))
.on('change', id => handleChange(id, 'update'))
.on('unlink', id => handleChange(id, 'delete'));
return watcher;
}
}
const eventsRewrites = {
create: {
create: 'buggy',
delete: null, //delete file from map
update: 'create'
},
delete: {
create: 'update',
delete: 'buggy',
update: 'buggy'
},
update: {
create: 'buggy',
delete: 'delete',
update: 'update'
}
};
class Watcher {
constructor(optionsList, emitter) {
this.buildDelay = 0;
this.buildTimeout = null;
this.closed = false;
this.invalidatedIds = new Map();
this.rerun = false;
this.running = true;
this.emitter = emitter;
emitter.close = this.close.bind(this);
this.tasks = optionsList.map(options => new Task(this, options));
for (const { watch } of optionsList) {
if (watch && typeof watch.buildDelay === 'number') {
this.buildDelay = Math.max(this.buildDelay, watch.buildDelay);
}
}
process.nextTick(() => this.run());
}
async close() {
if (this.closed)
return;
this.closed = true;
if (this.buildTimeout)
clearTimeout(this.buildTimeout);
for (const task of this.tasks) {
task.close();
}
await this.emitter.emit('close');
this.emitter.removeAllListeners();
}
invalidate(file) {
if (file) {
const previousEvent = this.invalidatedIds.get(file.id);
const event = previousEvent ? eventsRewrites[previousEvent][file.event] : file.event;
if (event === 'buggy') {
//TODO: throws or warn? Currently just ignore, uses new event
this.invalidatedIds.set(file.id, file.event);
}
else if (event === null) {
this.invalidatedIds.delete(file.id);
}
else {
this.invalidatedIds.set(file.id, event);
}
}
if (this.running) {
this.rerun = true;
return;
}
if (this.buildTimeout)
clearTimeout(this.buildTimeout);
this.buildTimeout = setTimeout(async () => {
this.buildTimeout = null;
try {
await Promise.all([...this.invalidatedIds].map(([id, event]) => this.emitter.emit('change', id, { event })));
this.invalidatedIds.clear();
await this.emitter.emit('restart');
this.emitter.removeListenersForCurrentRun();
this.run();
}
catch (error) {
this.invalidatedIds.clear();
await this.emitter.emit('event', {
code: 'ERROR',
error,
result: null
});
await this.emitter.emit('event', {
code: 'END'
});
}
}, this.buildDelay);
}
async run() {
this.running = true;
await this.emitter.emit('event', {
code: 'START'
});
for (const task of this.tasks) {
await task.run();
}
this.running = false;
await this.emitter.emit('event', {
code: 'END'
});
if (this.rerun) {
this.rerun = false;
this.invalidate();
}
}
}
class Task {
constructor(watcher, options) {
this.cache = { modules: [] };
this.watchFiles = [];
this.closed = false;
this.invalidated = true;
this.watched = new Set();
this.watcher = watcher;
this.options = options;
this.skipWrite = Boolean(options.watch && options.watch.skipWrite);
this.outputs = this.options.output;
this.outputFiles = this.outputs.map(output => {
if (output.file || output.dir)
return path.resolve(output.file || output.dir);
return undefined;
});
this.watchOptions = this.options.watch || {};
this.filter = rollup.createFilter(this.watchOptions.include, this.watchOptions.exclude);
this.fileWatcher = new FileWatcher(this, {
...this.watchOptions.chokidar,
disableGlobbing: true,
ignoreInitial: true
});
}
close() {
this.closed = true;
this.fileWatcher.close();
}
invalidate(id, details) {
this.invalidated = true;
if (details.isTransformDependency) {
for (const module of this.cache.modules) {
if (!module.transformDependencies.includes(id))
continue;
// effective invalidation
module.originalCode = null;
}
}
this.watcher.invalidate({ event: details.event, id });
this.watchOptions.onInvalidate?.(id);
}
async run() {
if (!this.invalidated)
return;
this.invalidated = false;
const options = {
...this.options,
cache: this.cache
};
const start = Date.now();
await this.watcher.emitter.emit('event', {
code: 'BUNDLE_START',
input: this.options.input,
output: this.outputFiles
});
let result = null;
try {
result = await rollup.rollupInternal(options, this.watcher.emitter);
if (this.closed) {
return;
}
this.updateWatchedFiles(result);
if (!this.skipWrite) {
await Promise.all(this.outputs.map(output => result.write(output)));
if (this.closed) {
return;
}
this.updateWatchedFiles(result);
}
await this.watcher.emitter.emit('event', {
code: 'BUNDLE_END',
duration: Date.now() - start,
input: this.options.input,
output: this.outputFiles,
result
});
}
catch (error) {
if (!this.closed) {
if (Array.isArray(error.watchFiles)) {
for (const id of error.watchFiles) {
this.watchFile(id);
}
}
if (error.id) {
this.cache.modules = this.cache.modules.filter(module => module.id !== error.id);
}
}
await this.watcher.emitter.emit('event', {
code: 'ERROR',
error,
result
});
}
}
updateWatchedFiles(result) {
const previouslyWatched = this.watched;
this.watched = new Set();
this.watchFiles = result.watchFiles;
this.cache = result.cache;
for (const id of this.watchFiles) {
this.watchFile(id);
}
for (const module of this.cache.modules) {
for (const depId of module.transformDependencies) {
this.watchFile(depId, true);
}
}
for (const id of previouslyWatched) {
if (!this.watched.has(id)) {
this.fileWatcher.unwatch(id);
}
}
}
watchFile(id, isTransformDependency = false) {
if (!this.filter(id))
return;
this.watched.add(id);
if (this.outputFiles.includes(id)) {
throw new Error('Cannot import the generated bundle');
}
// this is necessary to ensure that any 'renamed' files
// continue to be watched following an error
this.fileWatcher.watch(id, isTransformDependency);
}
}
exports.Task = Task;
exports.Watcher = Watcher;
//# sourceMappingURL=watch.js.map

View File

@@ -0,0 +1,25 @@
import { entityKind } from "./entity.js";
class Subquery {
static [entityKind] = "Subquery";
constructor(sql, fields, alias, isWith = false, usedTables = []) {
this._ = {
brand: "Subquery",
sql,
selectedFields: fields,
alias,
isWith,
usedTables
};
}
// getSQL(): SQL<unknown> {
// return new SQL([this]);
// }
}
class WithSubquery extends Subquery {
static [entityKind] = "WithSubquery";
}
export {
Subquery,
WithSubquery
};
//# sourceMappingURL=subquery.js.map

View File

@@ -0,0 +1,9 @@
/**
* ValueType for "auto"
*/
const auto = {
test: (v) => v === "auto",
parse: (v) => v,
};
export { auto };

View File

@@ -0,0 +1,18 @@
/**
* 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 mod = await (process.env.NODE_ENV !== 'production' ? import('./LexicalRichText.dev.mjs') : import('./LexicalRichText.prod.mjs'));
export const $createHeadingNode = mod.$createHeadingNode;
export const $createQuoteNode = mod.$createQuoteNode;
export const $isHeadingNode = mod.$isHeadingNode;
export const $isQuoteNode = mod.$isQuoteNode;
export const DRAG_DROP_PASTE = mod.DRAG_DROP_PASTE;
export const HeadingNode = mod.HeadingNode;
export const QuoteNode = mod.QuoteNode;
export const eventFiles = mod.eventFiles;
export const registerRichText = mod.registerRichText;

View File

@@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.webkitTextStrokeWidth = void 0;
var parser_1 = require("../syntax/parser");
exports.webkitTextStrokeWidth = {
name: "-webkit-text-stroke-width",
initialValue: '0',
type: 0 /* VALUE */,
prefix: false,
parse: function (_context, token) {
if (parser_1.isDimensionToken(token)) {
return token.number;
}
return 0;
}
};
//# sourceMappingURL=webkit-text-stroke-width.js.map

View File

@@ -0,0 +1,21 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = setFunctionName;
function setFunctionName(fn, name, prefix) {
if (typeof name === "symbol") {
name = name.description;
name = name ? "[" + name + "]" : "";
}
try {
Object.defineProperty(fn, "name", {
configurable: true,
value: prefix ? prefix + " " + name : name
});
} catch (_) {}
return fn;
}
//# sourceMappingURL=setFunctionName.js.map

View File

@@ -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 Rewind = createLucideIcon("Rewind", [
["polygon", { points: "11 19 2 12 11 5 11 19", key: "14yba5" }],
["polygon", { points: "22 19 13 12 22 5 22 19", key: "1pi1cj" }]
]);
export { Rewind as default };
//# sourceMappingURL=rewind.js.map

View File

@@ -0,0 +1,64 @@
"use strict";
exports.formatRFC7231 = formatRFC7231;
var _index = require("./isValid.js");
var _index2 = require("./toDate.js");
var _index3 = require("./_lib/addLeadingZeros.js");
const days = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
const months = [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec",
];
/**
* @name formatRFC7231
* @category Common Helpers
* @summary Format the date according to the RFC 7231 standard (https://tools.ietf.org/html/rfc7231#section-7.1.1.1).
*
* @description
* Return the formatted date string in RFC 7231 format.
* The result will always be in UTC timezone.
*
* @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 original date
*
* @returns The formatted date string
*
* @throws `date` must not be Invalid Date
*
* @example
* // Represent 18 September 2019 in RFC 7231 format:
* const result = formatRFC7231(new Date(2019, 8, 18, 19, 0, 52))
* //=> 'Wed, 18 Sep 2019 19:00:52 GMT'
*/
function formatRFC7231(date) {
const _date = (0, _index2.toDate)(date);
if (!(0, _index.isValid)(_date)) {
throw new RangeError("Invalid time value");
}
const dayName = days[_date.getUTCDay()];
const dayOfMonth = (0, _index3.addLeadingZeros)(_date.getUTCDate(), 2);
const monthName = months[_date.getUTCMonth()];
const year = _date.getUTCFullYear();
const hour = (0, _index3.addLeadingZeros)(_date.getUTCHours(), 2);
const minute = (0, _index3.addLeadingZeros)(_date.getUTCMinutes(), 2);
const second = (0, _index3.addLeadingZeros)(_date.getUTCSeconds(), 2);
// Result variables.
return `${dayName}, ${dayOfMonth} ${monthName} ${year} ${hour}:${minute}:${second} GMT`;
}

View File

@@ -0,0 +1,13 @@
@import '../../scss/styles';
@layer payload-default {
.icon--calendar {
height: $baseline;
width: $baseline;
.stroke {
stroke: currentColor;
stroke-width: $style-stroke-width-s;
}
}
}

View File

@@ -0,0 +1,137 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Ivan Kopeykin @vankop
*/
"use strict";
const InitFragment = require("../InitFragment");
const makeSerializable = require("../util/makeSerializable");
/** @typedef {import("webpack-sources").Source} Source */
/** @typedef {import("../Generator").GenerateContext} GenerateContext */
/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */
/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */
/** @typedef {{ name: string, value?: string }[]} ArrayImportSpecifiers */
/** @typedef {Set<string>} ImportSpecifier */
/** @typedef {Map<string, ImportSpecifier>} ImportSpecifiers */
/**
* @extends {InitFragment<GenerateContext>}
*/
class ExternalModuleInitFragment extends InitFragment {
/**
* @param {string} importedModule imported module
* @param {ArrayImportSpecifiers | ImportSpecifiers} specifiers import specifiers
* @param {string=} defaultImport default import
*/
constructor(importedModule, specifiers, defaultImport) {
super(
undefined,
InitFragment.STAGE_CONSTANTS,
0,
`external module imports|${importedModule}|${defaultImport || "null"}`
);
this.importedModule = importedModule;
if (Array.isArray(specifiers)) {
/** @type {ImportSpecifiers} */
this.specifiers = new Map();
for (const { name, value } of specifiers) {
let specifiers = this.specifiers.get(name);
if (!specifiers) {
/** @type {ImportSpecifier} */
specifiers = new Set();
this.specifiers.set(name, specifiers);
}
specifiers.add(value || name);
}
} else {
this.specifiers = specifiers;
}
this.defaultImport = defaultImport;
}
/**
* @param {ExternalModuleInitFragment} other other
* @returns {ExternalModuleInitFragment} ExternalModuleInitFragment
*/
merge(other) {
const newSpecifiersMap = new Map(this.specifiers);
for (const [name, specifiers] of other.specifiers) {
if (newSpecifiersMap.has(name)) {
const currentSpecifiers =
/** @type {Set<string>} */
(newSpecifiersMap.get(name));
for (const spec of specifiers) currentSpecifiers.add(spec);
} else {
newSpecifiersMap.set(name, specifiers);
}
}
return new ExternalModuleInitFragment(
this.importedModule,
newSpecifiersMap,
this.defaultImport
);
}
/**
* @param {GenerateContext} context context
* @returns {string | Source | undefined} the source code that will be included as initialization code
*/
getContent({ runtimeRequirements }) {
/** @type {string[]} */
const namedImports = [];
for (const [name, specifiers] of this.specifiers) {
for (const spec of specifiers) {
if (spec === name) {
namedImports.push(name);
} else {
namedImports.push(`${name} as ${spec}`);
}
}
}
let importsString =
namedImports.length > 0 ? `{${namedImports.join(",")}}` : "";
if (this.defaultImport) {
importsString = `${this.defaultImport}${
importsString ? `, ${importsString}` : ""
}`;
}
return `import ${importsString} from ${JSON.stringify(
this.importedModule
)};\n`;
}
/**
* @param {ObjectSerializerContext} context context
*/
serialize(context) {
super.serialize(context);
const { write } = context;
write(this.importedModule);
write(this.specifiers);
write(this.defaultImport);
}
/**
* @param {ObjectDeserializerContext} context context
*/
deserialize(context) {
super.deserialize(context);
const { read } = context;
this.importedModule = read();
this.specifiers = read();
this.defaultImport = read();
}
}
makeSerializable(
ExternalModuleInitFragment,
"webpack/lib/dependencies/ExternalModuleInitFragment"
);
module.exports = ExternalModuleInitFragment;

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 176 33"><g fill="#770C56" fill-rule="evenodd"><path d="M.1 16.5A22.7 22.7 0 017.1 0h4.4a22 22 0 00-7 16.5 22 22 0 007 16.4H7A22.5 22.5 0 01.1 16.5zm40.2 0a22.7 22.7 0 01-7 16.4H29a22 22 0 007-16.4 22 22 0 00-7-16.5h4.5a22.5 22.5 0 016.9 16.5z" fill-rule="nonzero"/><path d="M16.6 2.2h3v16.7h-3z"/><path d="M19.6 18.9l-2-2L29.7 5.2l2 2zM53.4 17.5c0 2 .5 3.8 1.4 5.2.8 1.4 2.2 2 4.2 2 1.5 0 2.7-.6 3.7-1.9 1-1.3 1.4-3.1 1.4-5.5 0-2.5-.5-4.3-1.5-5.5a4.7 4.7 0 00-3.7-1.7c-1.6 0-3 .6-4 1.8-1 1.3-1.5 3.1-1.5 5.6zm5-10.3c1.4 0 2.7.3 3.7 1 .5.3 1.2 1 2 1.9V.3h3v26.6h-2.9v-2.7a7 7 0 01-2.7 2.6c-1 .5-2.2.8-3.5.8-2.2 0-4-.9-5.6-2.7a10.6 10.6 0 01-2.4-7.2c0-2.9.7-5.3 2.2-7.4a7 7 0 016.1-3zm15.1 14.6c0 1 .4 1.7 1 2.2.8.5 1.6.8 2.5.8 1.2 0 2.3-.3 3.3-.8a4.5 4.5 0 002.7-4.3V17l-1.5.6-1.8.4-2 .2c-1.2.2-2 .4-2.7.8-1 .5-1.5 1.4-1.5 2.7zm8-6.6c.7-.1 1.2-.4 1.4-1 .2-.2.2-.7.2-1.2 0-1.1-.4-1.9-1.1-2.4-.8-.5-2-.8-3.4-.8-1.7 0-3 .5-3.6 1.4-.4.5-.7 1.3-.8 2.3h-3c0-2.4.8-4 2.3-5 1.5-1 3.2-1.4 5.1-1.4 2.3 0 4.2.4 5.6 1.3 1.4.9 2.1 2.2 2.1 4v11.2c0 .3 0 .6.2.8.1.2.4.3.9.3a5 5 0 001 0V27a9 9 0 01-1.1.3h-1c-1.2 0-2-.4-2.5-1.2-.3-.4-.5-1-.6-1.7a8.8 8.8 0 01-7 3.2c-1.7 0-3.2-.6-4.3-1.7a5.4 5.4 0 01-1.8-4c0-1.9.6-3.2 1.7-4.2a8 8 0 014.4-1.9l5.2-.6zm9.9-13h3.3v5.4h3v2.6h-3V23c0 .6.2 1 .7 1.3l1.2.2a15.2 15.2 0 001.2 0v2.5l-1.2.3h-1.3c-1.5 0-2.6-.4-3.1-1.1-.6-.8-.8-1.8-.8-3V10.1h-2.6V7.6h2.6V2.2zm16.8 5a8.8 8.8 0 016.9 3.4c.7 1 1 2.1 1.3 3.4.2 1 .3 2.3.3 4.3h-14.2c0 2 .5 3.5 1.4 4.7.9 1.2 2.2 1.8 4 1.8a5.2 5.2 0 005.3-4h3.2c0 .8-.3 1.6-.8 2.4a7.6 7.6 0 01-5.3 4c-.8.3-1.7.4-2.6.4-2.4 0-4.5-.9-6.2-2.6a10.2 10.2 0 01-2.5-7.4c0-3 .9-5.6 2.6-7.6 1.6-1.9 3.8-2.9 6.6-2.9zm5.2 8.5a8.4 8.4 0 00-1-3.4c-.9-1.5-2.3-2.3-4.4-2.3a5 5 0 00-3.8 1.6c-1 1-1.5 2.4-1.6 4.1h10.8zm5.5-.8h9.1v3.4h-9v-3.4zM132 4.6c0-1.3.3-2.3.7-3 .8-1 2.2-1.6 4.4-1.6a11.4 11.4 0 011.4 0v3a26.4 26.4 0 00-1.2 0c-1 0-1.5.2-1.7.7-.2.6-.3 1.9-.3 4h3.2v2.5h-3.3V27H132V10.2h-2.7V7.7h2.7v-3zm8.6 3h3v2.7c1-1.1 2-2 3-2.4 1-.5 2.1-.8 3.4-.8 2.7 0 4.6 1 5.6 3 .5 1 .8 2.5.8 4.4V27H153V14.7c0-1.2-.2-2.1-.6-2.8-.5-1.2-1.6-1.8-3.1-1.8a4.9 4.9 0 00-4.2 1.8c-.6.6-1 1.3-1.1 2-.2.6-.3 1.6-.3 2.9v10.1h-3.2V7.6zm21.6 13.2c0 1.1.4 2 .8 2.5.8 1 2.3 1.6 4.3 1.6 1.2 0 2.2-.2 3.2-.8.9-.5 1.3-1.3 1.3-2.4a2 2 0 00-1-1.9c-.5-.3-1.5-.6-2.9-1l-2.5-.6c-1.7-.4-3-.8-3.7-1.3a4.1 4.1 0 01-2-3.7c0-1.8.6-3.3 1.9-4.4 1.3-1.2 3-1.7 5.3-1.7 3 0 5 .8 6.3 2.5.8 1.1 1.2 2.3 1.2 3.5h-3c-.1-.7-.4-1.4-.9-2-.7-.8-2-1.3-3.8-1.3-1.3 0-2.2.3-2.8.8-.7.4-1 1-1 1.8 0 .9.4 1.5 1.3 2 .4.3 1.2.6 2.1.8l2.1.6c2.4.5 4 1 4.7 1.6 1.3.8 2 2.1 2 4a6 6 0 01-2 4.4c-1.3 1.2-3.3 1.9-6 1.9-2.9 0-5-.7-6.1-2a7.4 7.4 0 01-2-4.9h3.2z"/></g></svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@@ -0,0 +1,119 @@
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { getTranslation } from '@payloadcms/translations';
import React from 'react';
import { formatDate } from '../../../utilities/formatDocTitle/formatDateTitle.js';
import { Button } from '../../Button/index.js';
import { Pill } from '../../Pill/index.js';
export const buildUpcomingColumns = ({
dateFormat,
deleteHandler,
docs,
i18n,
localization,
supportedTimezones,
t
}) => {
const columns = [{
accessor: 'input.type',
active: true,
field: {
name: '',
type: 'text'
},
Heading: /*#__PURE__*/_jsx("span", {
children: t('version:type')
}),
renderedCells: docs.map(doc => {
const type = doc.input?.type;
return /*#__PURE__*/_jsxs(Pill, {
pillStyle: type === 'publish' ? 'success' : 'warning',
size: "small",
children: [type === 'publish' && t('version:publish'), type === 'unpublish' && t('version:unpublish')]
}, doc.id);
})
}, {
accessor: 'waitUntil',
active: true,
field: {
name: '',
type: 'date'
},
Heading: /*#__PURE__*/_jsx("span", {
children: t('general:time')
}),
renderedCells: docs.map(doc => /*#__PURE__*/_jsx("span", {
children: formatDate({
date: doc.waitUntil,
i18n,
pattern: dateFormat,
timezone: doc.input.timezone
})
}, doc.id))
}, {
accessor: 'input.timezone',
active: true,
field: {
name: '',
type: 'text'
},
Heading: /*#__PURE__*/_jsx("span", {
children: t('general:timezone')
}),
renderedCells: docs.map(doc => {
const matchedTimezone = supportedTimezones.find(timezone => timezone.value === doc.input.timezone);
const timezone = matchedTimezone?.label || doc.input.timezone;
return /*#__PURE__*/_jsx("span", {
children: timezone || t('general:noValue')
}, doc.id);
})
}];
if (localization) {
columns.push({
accessor: 'input.locale',
active: true,
field: {
name: '',
type: 'text'
},
Heading: /*#__PURE__*/_jsx("span", {
children: t('general:locale')
}),
renderedCells: docs.map(doc => {
if (doc.input.locale) {
const matchedLocale = localization.locales.find(locale => locale.code === doc.input.locale);
if (matchedLocale) {
return /*#__PURE__*/_jsx("span", {
children: getTranslation(matchedLocale.label, i18n)
}, doc.id);
}
}
return /*#__PURE__*/_jsx("span", {
children: t('general:all')
}, doc.id);
})
});
}
columns.push({
accessor: 'delete',
active: true,
field: {
name: 'delete',
type: 'text'
},
Heading: /*#__PURE__*/_jsx("span", {
children: t('general:delete')
}),
renderedCells: docs.map(doc => /*#__PURE__*/_jsx(Button, {
buttonStyle: "icon-label",
className: "schedule-publish__delete",
icon: "x",
onClick: e => {
e.preventDefault();
deleteHandler(doc.id);
},
tooltip: t('general:delete')
}, doc.id))
});
return columns;
};
//# sourceMappingURL=buildUpcomingColumns.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"globalhandlers.d.ts","sourceRoot":"","sources":["../../../../src/integrations/globalhandlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAU,KAAK,EAAiB,SAAS,EAAe,MAAM,cAAc,CAAC;AAmBzF,KAAK,oCAAoC,GAAG,SAAS,GAAG,sBAAsB,CAAC;AAE/E,KAAK,0BAA0B,GAAG,MAAM,CAAC,oCAAoC,EAAE,OAAO,CAAC,CAAC;AA6BxF,eAAO,MAAM,yBAAyB,mGAAgD,CAAC;AAyDvF;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CA0BnE;AAED;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAAC,MAAM,EAAE,SAAS,GAAG,KAAK,CAYzE"}

View File

@@ -0,0 +1,126 @@
#!/usr/bin/env node
'use strict';
/*eslint-disable no-console*/
var fs = require('fs');
var argparse = require('argparse');
var yaml = require('..');
////////////////////////////////////////////////////////////////////////////////
var cli = new argparse.ArgumentParser({
prog: 'js-yaml',
add_help: true
});
cli.add_argument('-v', '--version', {
action: 'version',
version: require('../package.json').version
});
cli.add_argument('-c', '--compact', {
help: 'Display errors in compact mode',
action: 'store_true'
});
// deprecated (not needed after we removed output colors)
// option suppressed, but not completely removed for compatibility
cli.add_argument('-j', '--to-json', {
help: argparse.SUPPRESS,
dest: 'json',
action: 'store_true'
});
cli.add_argument('-t', '--trace', {
help: 'Show stack trace on error',
action: 'store_true'
});
cli.add_argument('file', {
help: 'File to read, utf-8 encoded without BOM',
nargs: '?',
default: '-'
});
////////////////////////////////////////////////////////////////////////////////
var options = cli.parse_args();
////////////////////////////////////////////////////////////////////////////////
function readFile(filename, encoding, callback) {
if (options.file === '-') {
// read from stdin
var chunks = [];
process.stdin.on('data', function (chunk) {
chunks.push(chunk);
});
process.stdin.on('end', function () {
return callback(null, Buffer.concat(chunks).toString(encoding));
});
} else {
fs.readFile(filename, encoding, callback);
}
}
readFile(options.file, 'utf8', function (error, input) {
var output, isYaml;
if (error) {
if (error.code === 'ENOENT') {
console.error('File not found: ' + options.file);
process.exit(2);
}
console.error(
options.trace && error.stack ||
error.message ||
String(error));
process.exit(1);
}
try {
output = JSON.parse(input);
isYaml = false;
} catch (err) {
if (err instanceof SyntaxError) {
try {
output = [];
yaml.loadAll(input, function (doc) { output.push(doc); }, {});
isYaml = true;
if (output.length === 0) output = null;
else if (output.length === 1) output = output[0];
} catch (e) {
if (options.trace && err.stack) console.error(e.stack);
else console.error(e.toString(options.compact));
process.exit(1);
}
} else {
console.error(
options.trace && err.stack ||
err.message ||
String(err));
process.exit(1);
}
}
if (isYaml) console.log(JSON.stringify(output, null, ' '));
else console.log(yaml.dump(output));
});

View File

@@ -0,0 +1,138 @@
/**
* Copyright (c) 2019-present, GraphQL Foundation
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/**
* DataLoader creates a public API for loading data from a particular
* data back-end with unique keys such as the id column of a SQL table
* or document name in a MongoDB database, given a batch loading function.
*
* Each DataLoader instance contains a unique memoized cache. Use caution
* when used in long-lived applications or those which serve many users
* with different access permissions and consider creating a new instance
* per web request.
*/
declare class DataLoader<K, V, C = K> {
constructor(
batchLoadFn: DataLoader.BatchLoadFn<K, V>,
options?: DataLoader.Options<K, V, C>,
);
/**
* Loads a key, returning a `Promise` for the value represented by that key.
*/
load(key: K): Promise<V>;
/**
* Loads multiple keys, promising an array of values:
*
* var [ a, b ] = await myLoader.loadMany([ 'a', 'b' ]);
*
* This is equivalent to the more verbose:
*
* var [ a, b ] = await Promise.all([
* myLoader.load('a'),
* myLoader.load('b')
* ]);
*
*/
loadMany(keys: ArrayLike<K>): Promise<Array<V | Error>>;
/**
* Clears the value at `key` from the cache, if it exists. Returns itself for
* method chaining.
*/
clear(key: K): this;
/**
* Clears the entire cache. To be used when some event results in unknown
* invalidations across this particular `DataLoader`. Returns itself for
* method chaining.
*/
clearAll(): this;
/**
* Adds the provided key and value to the cache. If the key already exists, no
* change is made. Returns itself for method chaining.
*/
prime(key: K, value: V | PromiseLike<V> | Error): this;
/**
* The name given to this `DataLoader` instance. Useful for APM tools.
*
* Is `null` if not set in the constructor.
*/
name: string | null;
}
declare namespace DataLoader {
// If a custom cache is provided, it must be of this type (a subset of ES6 Map).
export type CacheMap<K, V> = {
get(key: K): V | void;
set(key: K, value: V): any;
delete(key: K): any;
clear(): any;
};
// A Function, which when given an Array of keys, returns a Promise of an Array
// of values or Errors.
export type BatchLoadFn<K, V> = (
keys: ReadonlyArray<K>,
) => PromiseLike<ArrayLike<V | Error>>;
// Optionally turn off batching or caching or provide a cache key function or a
// custom cache instance.
export type Options<K, V, C = K> = {
/**
* Default `true`. Set to `false` to disable batching, invoking
* `batchLoadFn` with a single load key. This is equivalent to setting
* `maxBatchSize` to `1`.
*/
batch?: boolean;
/**
* Default `Infinity`. Limits the number of items that get passed in to the
* `batchLoadFn`. May be set to `1` to disable batching.
*/
maxBatchSize?: number;
/**
* Default see https://github.com/graphql/dataloader#batch-scheduling.
* A function to schedule the later execution of a batch. The function is
* expected to call the provided callback in the immediate future.
*/
batchScheduleFn?: (callback: () => void) => void;
/**
* Default `true`. Set to `false` to disable memoization caching, creating a
* new Promise and new key in the `batchLoadFn` for every load of the same
* key. This is equivalent to setting `cacheMap` to `null`.
*/
cache?: boolean;
/**
* Default `key => key`. Produces cache key for a given load key. Useful
* when keys are objects and two objects should be considered equivalent.
*/
cacheKeyFn?: (key: K) => C;
/**
* Default `new Map()`. Instance of `Map` (or an object with a similar API)
* to be used as cache. May be set to `null` to disable caching.
*/
cacheMap?: CacheMap<C, Promise<V>> | null;
/**
* The name given to this `DataLoader` instance. Useful for APM tools.
*
* Is `null` if not set in the constructor.
*/
name?: string | null;
};
}
export = DataLoader;

View File

@@ -0,0 +1,64 @@
import { diffieHellman, generateKeyPair as generateKeyPairCb, KeyObject } from 'node:crypto';
import { promisify } from 'node:util';
import getNamedCurve from './get_named_curve.js';
import { encoder, concat, uint32be, lengthAndInput, concatKdf } from '../lib/buffer_utils.js';
import { JOSENotSupported } from '../util/errors.js';
import { isCryptoKey } from './webcrypto.js';
import { checkEncCryptoKey } from '../lib/crypto_key.js';
import isKeyObject from './is_key_object.js';
import invalidKeyInput from '../lib/invalid_key_input.js';
import { types } from './is_key_like.js';
const generateKeyPair = promisify(generateKeyPairCb);
export async function deriveKey(publicKee, privateKee, algorithm, keyLength, apu = new Uint8Array(0), apv = new Uint8Array(0)) {
let publicKey;
if (isCryptoKey(publicKee)) {
checkEncCryptoKey(publicKee, 'ECDH');
publicKey = KeyObject.from(publicKee);
}
else if (isKeyObject(publicKee)) {
publicKey = publicKee;
}
else {
throw new TypeError(invalidKeyInput(publicKee, ...types));
}
let privateKey;
if (isCryptoKey(privateKee)) {
checkEncCryptoKey(privateKee, 'ECDH', 'deriveBits');
privateKey = KeyObject.from(privateKee);
}
else if (isKeyObject(privateKee)) {
privateKey = privateKee;
}
else {
throw new TypeError(invalidKeyInput(privateKee, ...types));
}
const value = concat(lengthAndInput(encoder.encode(algorithm)), lengthAndInput(apu), lengthAndInput(apv), uint32be(keyLength));
const sharedSecret = diffieHellman({ privateKey, publicKey });
return concatKdf(sharedSecret, keyLength, value);
}
export async function generateEpk(kee) {
let key;
if (isCryptoKey(kee)) {
key = KeyObject.from(kee);
}
else if (isKeyObject(kee)) {
key = kee;
}
else {
throw new TypeError(invalidKeyInput(kee, ...types));
}
switch (key.asymmetricKeyType) {
case 'x25519':
return generateKeyPair('x25519');
case 'x448': {
return generateKeyPair('x448');
}
case 'ec': {
const namedCurve = getNamedCurve(key);
return generateKeyPair('ec', { namedCurve });
}
default:
throw new JOSENotSupported('Invalid or unsupported EPK');
}
}
export const ecdhAllowed = (key) => ['P-256', 'P-384', 'P-521', 'X25519', 'X448'].includes(getNamedCurve(key));

View File

@@ -0,0 +1,25 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
// The source (has been changed) is https://github.com/facebook/react/issues/5465#issuecomment-157888325
var CANCELATION_MESSAGE = {
type: 'cancelation',
msg: 'operation is manually canceled'
};
function makeCancelable(promise) {
var hasCanceled_ = false;
var wrappedPromise = new Promise(function (resolve, reject) {
promise.then(function (val) {
return hasCanceled_ ? reject(CANCELATION_MESSAGE) : resolve(val);
});
promise["catch"](reject);
});
return wrappedPromise.cancel = function () {
return hasCanceled_ = true;
}, wrappedPromise;
}
exports.CANCELATION_MESSAGE = CANCELATION_MESSAGE;
exports.default = makeCancelable;

View File

@@ -0,0 +1 @@
{"version":3,"file":"remapping.d.ts","sourceRoot":"","sources":["../src/remapping.ts"],"names":[],"mappings":"AAEA,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACxE,YAAY,EACV,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,IAAI,YAAY,EAChC,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,aAAa,EACb,OAAO,GACR,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,SAAS,EAAE,CAAC;AAE1B;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,KAAK,EAAE,cAAc,GAAG,cAAc,EAAE,EACxC,MAAM,EAAE,eAAe,EACvB,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,GAC1B,SAAS,CAKX"}

View File

@@ -0,0 +1,8 @@
// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
import { previousThursday as fn } from "../previousThursday.mjs";
import { convertToFP } from "./_lib/convertToFP.mjs";
export const previousThursday = convertToFP(fn, 1);
// Fallback for modularized imports:
export default previousThursday;

View File

@@ -0,0 +1 @@
{"version":3,"file":"file-question.js","sources":["../../../src/icons/file-question.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name FileQuestion\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgMTdoLjAxIiAvPgogIDxwYXRoIGQ9Ik0xNSAySDZhMiAyIDAgMCAwLTIgMnYxNmEyIDIgMCAwIDAgMiAyaDEyYTIgMiAwIDAgMCAyLTJWN3oiIC8+CiAgPHBhdGggZD0iTTkuMSA5YTMgMyAwIDAgMSA1LjgyIDFjMCAyLTMgMy0zIDMiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/file-question\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 FileQuestion = createLucideIcon('FileQuestion', [\n ['path', { d: 'M12 17h.01', key: 'p32p05' }],\n ['path', { d: 'M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z', key: '1mlx9k' }],\n ['path', { d: 'M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3', key: 'mhlwft' }],\n]);\n\nexport default FileQuestion;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,iBAAiB,cAAgB,CAAA,CAAA,CAAA;AAAA,CAAA,CACpD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC3C,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,CAAuC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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;AACtE,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,8 @@
// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
import { isBefore as fn } from "../isBefore.mjs";
import { convertToFP } from "./_lib/convertToFP.mjs";
export const isBefore = convertToFP(fn, 2);
// Fallback for modularized imports:
export default isBefore;

View File

@@ -0,0 +1,8 @@
import type { Endpoint } from '../../config/types.js';
/**
* GET /api/payload-jobs/handle-schedules endpoint
*
* This endpoint is GET instead of POST to allow it to be used in a Vercel Cron.
*/
export declare const handleSchedulesJobsEndpoint: Endpoint;
//# sourceMappingURL=handleSchedules.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.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 { ContextManager, TextMapPropagator } from '@opentelemetry/api';\nimport { Resource } from '@opentelemetry/resources';\nimport { IdGenerator } from './IdGenerator';\nimport { Sampler } from './Sampler';\nimport { SpanProcessor } from './SpanProcessor';\n\n/**\n * TracerConfig provides an interface for configuring a Basic Tracer.\n */\nexport interface TracerConfig {\n /**\n * Sampler determines if a span should be recorded or should be a NoopSpan.\n */\n sampler?: Sampler;\n\n /** General Limits */\n generalLimits?: GeneralLimits;\n\n /** Span Limits */\n spanLimits?: SpanLimits;\n\n /** Resource associated with trace telemetry */\n resource?: Resource;\n\n /**\n * Generator of trace and span IDs\n * The default idGenerator generates random ids\n */\n idGenerator?: IdGenerator;\n\n /**\n * How long the forceFlush can run before it is cancelled.\n * The default value is 30000ms\n */\n forceFlushTimeoutMillis?: number;\n\n /**\n * List of SpanProcessor for the tracer\n */\n spanProcessors?: SpanProcessor[];\n}\n\n/**\n * Configuration options for registering the API with the SDK.\n * Undefined values may be substituted for defaults, and null\n * values will not be registered.\n */\nexport interface SDKRegistrationConfig {\n /** Propagator to register as the global propagator */\n propagator?: TextMapPropagator | null;\n\n /** Context manager to register as the global context manager */\n contextManager?: ContextManager | null;\n}\n\n/** Global configuration limits of trace service */\nexport interface GeneralLimits {\n /** attributeValueLengthLimit is maximum allowed attribute value size */\n attributeValueLengthLimit?: number;\n /** attributeCountLimit is number of attributes per trace */\n attributeCountLimit?: number;\n}\n\n/** Global configuration of trace service */\nexport interface SpanLimits {\n /** attributeValueLengthLimit is maximum allowed attribute value size */\n attributeValueLengthLimit?: number;\n /** attributeCountLimit is number of attributes per span */\n attributeCountLimit?: number;\n /** linkCountLimit is number of links per span */\n linkCountLimit?: number;\n /** eventCountLimit is number of message events per span */\n eventCountLimit?: number;\n /** attributePerEventCountLimit is the maximum number of attributes allowed per span event */\n attributePerEventCountLimit?: number;\n /** attributePerLinkCountLimit is the maximum number of attributes allowed per span link */\n attributePerLinkCountLimit?: number;\n}\n\n/** Interface configuration for a buffer. */\nexport interface BufferConfig {\n /** The maximum batch size of every export. It must be smaller or equal to\n * maxQueueSize. The default value is 512. */\n maxExportBatchSize?: number;\n\n /** The delay interval in milliseconds between two consecutive exports.\n * The default value is 5000ms. */\n scheduledDelayMillis?: number;\n\n /** How long the export can run before it is cancelled.\n * The default value is 30000ms */\n exportTimeoutMillis?: number;\n\n /** The maximum queue size. After the size is reached spans are dropped.\n * The default value is 2048. */\n maxQueueSize?: number;\n}\n\n/** Interface configuration for BatchSpanProcessor on browser */\nexport interface BatchSpanProcessorBrowserConfig extends BufferConfig {\n /** Disable flush when a user navigates to a new page, closes the tab or the browser, or,\n * on mobile, switches to a different app. Auto flush is enabled by default. */\n disableAutoFlushOnDocumentHide?: boolean;\n}\n"]}

View File

@@ -0,0 +1,27 @@
export const appendVersionToQueryKey = (query = {})=>{
return Object.entries(query).reduce((res, [key, val])=>{
if ([
'AND',
'and',
'OR',
'or'
].includes(key) && Array.isArray(val)) {
return {
...res,
[key.toLowerCase()]: val.map((subQuery)=>appendVersionToQueryKey(subQuery))
};
}
if (key !== 'id') {
return {
...res,
[`version.${key}`]: val
};
}
return {
...res,
parent: val
};
}, {});
};
//# sourceMappingURL=appendVersionToQueryKey.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/sql/functions/index.ts"],"sourcesContent":["export * from './aggregate.ts';\nexport * from './vector.ts';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,8BAAc,2BAAd;AACA,8BAAc,wBADd;","names":[]}

View File

@@ -0,0 +1,2 @@
const e=require(`../../utils/throw-if-empty.cjs`),t=(t,n,r)=>()=>(e.throwIfEmpty(t,`Keys cannot be empty`),{path:`/dashboards`,params:r??{},body:JSON.stringify({keys:t,data:n}),method:`PATCH`}),n=(e,t)=>()=>({path:`/dashboards`,params:t??{},body:JSON.stringify(e),method:`PATCH`}),r=(t,n,r)=>()=>(e.throwIfEmpty(t,`Key cannot be empty`),{path:`/dashboards/${t}`,params:r??{},body:JSON.stringify(n),method:`PATCH`});exports.updateDashboard=r,exports.updateDashboards=t,exports.updateDashboardsBatch=n;
//# sourceMappingURL=dashboards.cjs.map

View File

@@ -0,0 +1,36 @@
import type { Interval, StepOptions } from "./types.js";
/**
* The {@link eachYearOfInterval} function options.
*/
export interface EachYearOfIntervalOptions extends StepOptions {}
/**
* @name eachYearOfInterval
* @category Interval Helpers
* @summary Return the array of yearly timestamps within the specified time interval.
*
* @description
* Return the array of yearly timestamps within the specified time interval.
*
* @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 interval - The interval.
*
* @returns The array with starts of yearly timestamps from the month of the interval start to the month of the interval end
*
* @example
* // Each year between 6 February 2014 and 10 August 2017:
* const result = eachYearOfInterval({
* start: new Date(2014, 1, 6),
* end: new Date(2017, 7, 10)
* })
* //=> [
* // Wed Jan 01 2014 00:00:00,
* // Thu Jan 01 2015 00:00:00,
* // Fri Jan 01 2016 00:00:00,
* // Sun Jan 01 2017 00:00:00
* // ]
*/
export declare function eachYearOfInterval<DateType extends Date>(
interval: Interval<DateType>,
options?: EachYearOfIntervalOptions,
): DateType[];

View File

@@ -0,0 +1,4 @@
export declare const min: import("./types.js").FPFn1<
Date,
import("../fp.js").DateArg<Date>[]
>;

View File

@@ -0,0 +1,136 @@
import { buildMatchFn } from "../../_lib/buildMatchFn.js";
import { buildMatchPatternFn } from "../../_lib/buildMatchPatternFn.js";
const matchOrdinalNumberPattern = /^(\d+)(º)?/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(ac|dc|a|d)/i,
abbreviated: /^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,
wide: /^(antes de cristo|antes da era com[uú]n|despois de cristo|era com[uú]n)/i,
};
const parseEraPatterns = {
any: [/^ac/i, /^dc/i],
wide: [
/^(antes de cristo|antes da era com[uú]n)/i,
/^(despois de cristo|era com[uú]n)/i,
],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^T[1234]/i,
wide: /^[1234](º)? trimestre/i,
};
const parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i],
};
const matchMonthPatterns = {
narrow: /^[xfmasond]/i,
abbreviated: /^(xan|feb|mar|abr|mai|xun|xul|ago|set|out|nov|dec)/i,
wide: /^(xaneiro|febreiro|marzo|abril|maio|xuño|xullo|agosto|setembro|outubro|novembro|decembro)/i,
};
const parseMonthPatterns = {
narrow: [
/^x/i,
/^f/i,
/^m/i,
/^a/i,
/^m/i,
/^x/i,
/^x/i,
/^a/i,
/^s/i,
/^o/i,
/^n/i,
/^d/i,
],
any: [
/^xan/i,
/^feb/i,
/^mar/i,
/^abr/i,
/^mai/i,
/^xun/i,
/^xul/i,
/^ago/i,
/^set/i,
/^out/i,
/^nov/i,
/^dec/i,
],
};
const matchDayPatterns = {
narrow: /^[dlmxvs]/i,
short: /^(do|lu|ma|me|xo|ve|sa)/i,
abbreviated: /^(dom|lun|mar|mer|xov|ven|sab)/i,
wide: /^(domingo|luns|martes|m[eé]rcores|xoves|venres|s[áa]bado)/i,
};
const parseDayPatterns = {
narrow: [/^d/i, /^l/i, /^m/i, /^m/i, /^x/i, /^v/i, /^s/i],
any: [/^do/i, /^lu/i, /^ma/i, /^me/i, /^xo/i, /^ve/i, /^sa/i],
};
const matchDayPeriodPatterns = {
narrow: /^(a|p|mn|md|(da|[aá]s) (mañ[aá]|tarde|noite))/i,
any: /^([ap]\.?\s?m\.?|medianoite|mediod[ií]a|(da|[aá]s) (mañ[aá]|tarde|noite))/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^a/i,
pm: /^p/i,
midnight: /^mn/i,
noon: /^md/i,
morning: /mañ[aá]/i,
afternoon: /tarde/i,
evening: /tardiña/i,
night: /noite/i,
},
};
export const match = {
ordinalNumber: buildMatchPatternFn({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: (value) => parseInt(value, 10),
}),
era: buildMatchFn({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any",
}),
quarter: buildMatchFn({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: (index) => index + 1,
}),
month: buildMatchFn({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any",
}),
day: buildMatchFn({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: buildMatchFn({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
};

View File

@@ -0,0 +1,18 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=tracer_provider.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"deleteByID.d.ts","sourceRoot":"","sources":["../../../src/collections/operations/deleteByID.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACjE,OAAO,KAAK,EACV,cAAc,EACd,YAAY,EACZ,UAAU,EACV,6BAA6B,EAC9B,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,UAAU,EAA0B,MAAM,oBAAoB,CAAA;AAqB5E,MAAM,MAAM,SAAS,CAAC,KAAK,SAAS,cAAc,EAAE,OAAO,SAAS,UAAU,IAAI;IAChF,UAAU,EAAE,UAAU,CAAA;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,QAAQ,CAAC,EAAE,YAAY,CAAA;IACvB,GAAG,EAAE,cAAc,CAAA;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,QAAQ,CAAC,CAAA;AAE/C,eAAO,MAAM,mBAAmB,GAAU,KAAK,SAAS,cAAc,EAAE,OAAO,SAAS,UAAU,gBAClF,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC,KACtC,OAAO,CAAC,6BAA6B,CAAC,KAAK,EAAE,OAAO,CAAC,CAuPvD,CAAA"}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/versions/migrations/localizeStatus/sql/migrateMainCollection.ts"],"sourcesContent":["import type { Payload } from '../../../../types/index.js'\n\nimport { toSnakeCase } from '../shared.js'\n\n/**\n * Migrates main collection documents from _status to per-locale status object\n */\nexport async function migrateMainCollectionStatus({\n collectionSlug,\n db,\n locales,\n payload,\n sql,\n versionsTable,\n}: {\n collectionSlug: string\n db: any\n locales: string[]\n payload: Payload\n sql: any\n versionsTable: string\n}): Promise<void> {\n const mainTable = toSnakeCase(collectionSlug)\n const mainLocalesTable = `${mainTable}_locales`\n\n payload.logger.info({ msg: `Migrating main collection locales for: ${mainLocalesTable}` })\n\n // Get all documents\n const documents = await db.execute({\n drizzle: db.drizzle,\n sql: sql`\n SELECT DISTINCT id\n FROM ${sql.identifier(mainTable)}\n `,\n })\n\n for (const doc of documents.rows) {\n // For each locale, get the latest version status\n for (const locale of locales) {\n const latestVersionStatus = await db.execute({\n drizzle: db.drizzle,\n sql: sql`\n SELECT l.version__status as _status\n FROM ${sql.identifier(versionsTable)} v\n JOIN ${sql.raw(`${versionsTable}_locales`)} l ON l._parent_id = v.id\n WHERE v.parent_id = ${doc.id}\n AND l._locale = ${locale}\n ORDER BY v.created_at DESC\n LIMIT 1\n `,\n })\n\n const status = latestVersionStatus.rows[0]?._status || 'draft'\n\n // Update the main collection's locales table with this status\n await db.execute({\n drizzle: db.drizzle,\n sql: sql`\n UPDATE ${sql.identifier(mainLocalesTable)}\n SET _status = ${status}\n WHERE _parent_id = ${doc.id}\n AND _locale = ${locale}\n `,\n })\n }\n }\n\n payload.logger.info({ msg: `Migrated ${documents.rows.length} collection documents` })\n}\n"],"names":["toSnakeCase","migrateMainCollectionStatus","collectionSlug","db","locales","payload","sql","versionsTable","mainTable","mainLocalesTable","logger","info","msg","documents","execute","drizzle","identifier","doc","rows","locale","latestVersionStatus","raw","id","status","_status","length"],"mappings":"AAEA,SAASA,WAAW,QAAQ,eAAc;AAE1C;;CAEC,GACD,OAAO,eAAeC,4BAA4B,EAChDC,cAAc,EACdC,EAAE,EACFC,OAAO,EACPC,OAAO,EACPC,GAAG,EACHC,aAAa,EAQd;IACC,MAAMC,YAAYR,YAAYE;IAC9B,MAAMO,mBAAmB,GAAGD,UAAU,QAAQ,CAAC;IAE/CH,QAAQK,MAAM,CAACC,IAAI,CAAC;QAAEC,KAAK,CAAC,uCAAuC,EAAEH,kBAAkB;IAAC;IAExF,oBAAoB;IACpB,MAAMI,YAAY,MAAMV,GAAGW,OAAO,CAAC;QACjCC,SAASZ,GAAGY,OAAO;QACnBT,KAAKA,GAAG,CAAC;;WAEF,EAAEA,IAAIU,UAAU,CAACR,WAAW;IACnC,CAAC;IACH;IAEA,KAAK,MAAMS,OAAOJ,UAAUK,IAAI,CAAE;QAChC,iDAAiD;QACjD,KAAK,MAAMC,UAAUf,QAAS;YAC5B,MAAMgB,sBAAsB,MAAMjB,GAAGW,OAAO,CAAC;gBAC3CC,SAASZ,GAAGY,OAAO;gBACnBT,KAAKA,GAAG,CAAC;;eAEF,EAAEA,IAAIU,UAAU,CAACT,eAAe;eAChC,EAAED,IAAIe,GAAG,CAAC,GAAGd,cAAc,QAAQ,CAAC,EAAE;8BACvB,EAAEU,IAAIK,EAAE,CAAC;0BACb,EAAEH,OAAO;;;QAG3B,CAAC;YACH;YAEA,MAAMI,SAASH,oBAAoBF,IAAI,CAAC,EAAE,EAAEM,WAAW;YAEvD,8DAA8D;YAC9D,MAAMrB,GAAGW,OAAO,CAAC;gBACfC,SAASZ,GAAGY,OAAO;gBACnBT,KAAKA,GAAG,CAAC;iBACA,EAAEA,IAAIU,UAAU,CAACP,kBAAkB;wBAC5B,EAAEc,OAAO;6BACJ,EAAEN,IAAIK,EAAE,CAAC;wBACd,EAAEH,OAAO;QACzB,CAAC;YACH;QACF;IACF;IAEAd,QAAQK,MAAM,CAACC,IAAI,CAAC;QAAEC,KAAK,CAAC,SAAS,EAAEC,UAAUK,IAAI,CAACO,MAAM,CAAC,qBAAqB,CAAC;IAAC;AACtF"}

View File

@@ -0,0 +1,19 @@
export interface NodeSchedule {
scheduleJob(nameOrExpression: string | Date | object, expressionOrCallback: string | Date | object | (() => void), callback?: () => void): unknown;
}
/**
* Instruments the `node-schedule` library to send a check-in event to Sentry for each job execution.
*
* ```ts
* import * as Sentry from '@sentry/node';
* import * as schedule from 'node-schedule';
*
* const scheduleWithCheckIn = Sentry.cron.instrumentNodeSchedule(schedule);
*
* const job = scheduleWithCheckIn.scheduleJob('my-cron-job', '* * * * *', () => {
* console.log('You will see this message every minute');
* });
* ```
*/
export declare function instrumentNodeSchedule<T>(lib: T & NodeSchedule): T;
//# sourceMappingURL=node-schedule.d.ts.map

View File

@@ -0,0 +1,48 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const instrumentationKafkajs = require('@opentelemetry/instrumentation-kafkajs');
const core = require('@sentry/core');
const nodeCore = require('@sentry/node-core');
const INTEGRATION_NAME = 'Kafka';
const instrumentKafka = nodeCore.generateInstrumentOnce(
INTEGRATION_NAME,
() =>
new instrumentationKafkajs.KafkaJsInstrumentation({
consumerHook(span) {
nodeCore.addOriginToSpan(span, 'auto.kafkajs.otel.consumer');
},
producerHook(span) {
nodeCore.addOriginToSpan(span, 'auto.kafkajs.otel.producer');
},
}),
);
const _kafkaIntegration = (() => {
return {
name: INTEGRATION_NAME,
setupOnce() {
instrumentKafka();
},
};
}) ;
/**
* Adds Sentry tracing instrumentation for the [kafkajs](https://www.npmjs.com/package/kafkajs) library.
*
* For more information, see the [`kafkaIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/kafka/).
*
* @example
* ```javascript
* const Sentry = require('@sentry/node');
*
* Sentry.init({
* integrations: [Sentry.kafkaIntegration()],
* });
*/
const kafkaIntegration = core.defineIntegration(_kafkaIntegration);
exports.instrumentKafka = instrumentKafka;
exports.kafkaIntegration = kafkaIntegration;
//# sourceMappingURL=kafka.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/mysql2/migrator.ts"],"sourcesContent":["import type { MigrationConfig } from '~/migrator.ts';\nimport { readMigrationFiles } from '~/migrator.ts';\nimport type { MySql2Database } from './driver.ts';\n\nexport async function migrate<TSchema extends Record<string, unknown>>(\n\tdb: MySql2Database<TSchema>,\n\tconfig: MigrationConfig,\n) {\n\tconst migrations = readMigrationFiles(config);\n\tawait db.dialect.migrate(migrations, db.session, config);\n}\n"],"mappings":"AACA,SAAS,0BAA0B;AAGnC,eAAsB,QACrB,IACA,QACC;AACD,QAAM,aAAa,mBAAmB,MAAM;AAC5C,QAAM,GAAG,QAAQ,QAAQ,YAAY,GAAG,SAAS,MAAM;AACxD;","names":[]}

View File

@@ -0,0 +1,26 @@
import type { PaginatedDocs, SanitizedCollectionConfig } from 'payload';
import type { CompareOption } from '../Default/types.js';
export type Props = {
collectionSlug?: string;
docID?: number | string;
globalSlug?: string;
onChange: (val: CompareOption) => void;
versionFromID?: string;
versionFromOptions: CompareOption[];
};
type CLEAR = {
required: boolean;
type: 'CLEAR';
};
type ADD = {
collection: SanitizedCollectionConfig;
data: PaginatedDocs<any>;
type: 'ADD';
};
export type Action = ADD | CLEAR;
export type ValueWithRelation = {
relationTo: string;
value: string;
};
export {};
//# sourceMappingURL=types.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"git-graph.js","sources":["../../../src/icons/git-graph.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name GitGraph\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSI1IiBjeT0iNiIgcj0iMyIgLz4KICA8cGF0aCBkPSJNNSA5djYiIC8+CiAgPGNpcmNsZSBjeD0iNSIgY3k9IjE4IiByPSIzIiAvPgogIDxwYXRoIGQ9Ik0xMiAzdjE4IiAvPgogIDxjaXJjbGUgY3g9IjE5IiBjeT0iNiIgcj0iMyIgLz4KICA8cGF0aCBkPSJNMTYgMTUuN0E5IDkgMCAwIDAgMTkgOSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/git-graph\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 GitGraph = createLucideIcon('GitGraph', [\n ['circle', { cx: '5', cy: '6', r: '3', key: '1qnov2' }],\n ['path', { d: 'M5 9v6', key: '158jrl' }],\n ['circle', { cx: '5', cy: '18', r: '3', key: '104gr9' }],\n ['path', { d: 'M12 3v18', key: '108xh3' }],\n ['circle', { cx: '19', cy: '6', r: '3', key: '108a5v' }],\n ['path', { d: 'M16 15.7A9 9 0 0 0 19 9', key: '1e3vqb' }],\n]);\n\nexport default GitGraph;\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,CAC5C,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,EAAK,CAAI,CAAA,CAAA,CAAA,GAAA,CAAK,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CAAA,CACtD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACvC,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,EAAK,CAAI,CAAA,CAAA,CAAA,IAAA,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CAAA,CACvD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACzC,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAM,CAAI,CAAA,CAAA,CAAA,GAAA,CAAK,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CAAA,CACvD,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;AAC1D,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"chart-column-big.js","sources":["../../../src/icons/chart-column-big.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ChartColumnBig\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMyAzdjE2YTIgMiAwIDAgMCAyIDJoMTYiIC8+CiAgPHJlY3QgeD0iMTUiIHk9IjUiIHdpZHRoPSI0IiBoZWlnaHQ9IjEyIiByeD0iMSIgLz4KICA8cmVjdCB4PSI3IiB5PSI4IiB3aWR0aD0iNCIgaGVpZ2h0PSI5IiByeD0iMSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/chart-column-big\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 ChartColumnBig = createLucideIcon('ChartColumnBig', [\n ['path', { d: 'M3 3v16a2 2 0 0 0 2 2h16', key: 'c24i48' }],\n ['rect', { x: '15', y: '5', width: '4', height: '12', rx: '1', key: 'q8uenq' }],\n ['rect', { x: '7', y: '8', width: '4', height: '9', rx: '1', key: 'sr5ea' }],\n]);\n\nexport default ChartColumnBig;\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,CAAiB,iBAAiB,gBAAkB,CAAA,CAAA,CAAA;AAAA,CAAA,CACxD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA4B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAG,KAAK,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,SAAS,CAAA;AAC7E,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4DAA4D;AAC/C,QAAA,OAAO,GAAG,QAAQ,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// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '1.39.0';\n"]}

View File

@@ -0,0 +1 @@
export { _ as default } from "../esm/_is_native_function.js";

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/elements/RelationshipTable/cells/DrawerLink/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAKlD,OAAO,cAAc,CAAA;AAErB,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC;IAChC,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,YAAY,EAAE,YAAY,CAAA;CAC3B,CAiBA,CAAA"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"arrow-down.js","sources":["../../../src/icons/arrow-down.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ArrowDown\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgNXYxNCIgLz4KICA8cGF0aCBkPSJtMTkgMTItNyA3LTctNyIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/arrow-down\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst ArrowDown = createLucideIcon('ArrowDown', [\n ['path', { d: 'M12 5v14', key: 's699le' }],\n ['path', { d: 'm19 12-7 7-7-7', key: '1idqje' }],\n]);\n\nexport default ArrowDown;\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,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAkB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACjD,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,9 @@
// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
import { eachWeekOfInterval as fn } from "../eachWeekOfInterval.js";
import { convertToFP } from "./_lib/convertToFP.js";
export const eachWeekOfInterval = convertToFP(fn, 1);
// Fallback for modularized imports:
export default eachWeekOfInterval;

View File

@@ -0,0 +1,3 @@
import type { DeleteMany } from 'payload';
export declare const deleteMany: DeleteMany;
//# sourceMappingURL=deleteMany.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"normalizeRelationshipValue.js","names":["normalizeRelationshipValue","value","relationTo","isPoly","Array","isArray","idValue","id"],"sources":["../../src/utilities/normalizeRelationshipValue.ts"],"sourcesContent":["/**\n * Normalizes relationship/upload field values by extracting IDs from nested objects\n * and returning them in the appropriate format based on whether the field is polymorphic.\n *\n * @param value - The value to normalize (can be a simple ID, or an object with relationTo and value)\n * @param relationTo - The relationTo config (string for monomorphic, array for polymorphic)\n * @returns The normalized value (simple ID for monomorphic, {relationTo, value} for polymorphic)\n *\n * @example\n * // Monomorphic field - returns simple ID\n * normalizeRelationshipValue('123', 'users') // '123'\n * normalizeRelationshipValue({ relationTo: 'users', value: '123' }, 'users') // '123'\n *\n * @example\n * // Polymorphic field - returns {relationTo, value}\n * normalizeRelationshipValue('123', ['users', 'posts']) // '123' (kept as-is, no relationTo to infer)\n * normalizeRelationshipValue({ relationTo: 'users', value: '123' }, ['users', 'posts'])\n * // { relationTo: 'users', value: '123' }\n *\n * @example\n * // Handles nested value objects (populated documents)\n * normalizeRelationshipValue(\n * { relationTo: 'users', value: { id: '123', name: 'John' } },\n * ['users', 'posts']\n * )\n * // { relationTo: 'users', value: '123' }\n */\nexport function normalizeRelationshipValue(value: any, relationTo: string | string[]): any {\n const isPoly = Array.isArray(relationTo)\n\n // If it's already a simple ID (string or number), return as-is for non-poly or wrap for poly\n if (typeof value === 'string' || typeof value === 'number') {\n return value\n }\n\n // If it's an object with relationTo and value\n if (value && typeof value === 'object' && 'relationTo' in value && 'value' in value) {\n // Extract the actual ID value, handling nested objects\n let idValue: any = value.value\n while (idValue && typeof idValue === 'object' && idValue !== null && 'value' in idValue) {\n idValue = idValue.value\n }\n\n // If the nested value is a populated document with an ID, extract it\n if (idValue && typeof idValue === 'object' && idValue !== null && 'id' in idValue) {\n idValue = idValue.id\n }\n\n // Return the normalized structure\n if (isPoly) {\n return { relationTo: value.relationTo, value: idValue }\n }\n return idValue\n }\n\n // If it's a populated document object (has id but no relationTo/value structure)\n if (value && typeof value === 'object' && 'id' in value) {\n return value.id\n }\n\n return value\n}\n"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BA,OAAO,SAASA,2BAA2BC,KAAU,EAAEC,UAA6B;EAClF,MAAMC,MAAA,GAASC,KAAA,CAAMC,OAAO,CAACH,UAAA;EAE7B;EACA,IAAI,OAAOD,KAAA,KAAU,YAAY,OAAOA,KAAA,KAAU,UAAU;IAC1D,OAAOA,KAAA;EACT;EAEA;EACA,IAAIA,KAAA,IAAS,OAAOA,KAAA,KAAU,YAAY,gBAAgBA,KAAA,IAAS,WAAWA,KAAA,EAAO;IACnF;IACA,IAAIK,OAAA,GAAeL,KAAA,CAAMA,KAAK;IAC9B,OAAOK,OAAA,IAAW,OAAOA,OAAA,KAAY,YAAYA,OAAA,KAAY,QAAQ,WAAWA,OAAA,EAAS;MACvFA,OAAA,GAAUA,OAAA,CAAQL,KAAK;IACzB;IAEA;IACA,IAAIK,OAAA,IAAW,OAAOA,OAAA,KAAY,YAAYA,OAAA,KAAY,QAAQ,QAAQA,OAAA,EAAS;MACjFA,OAAA,GAAUA,OAAA,CAAQC,EAAE;IACtB;IAEA;IACA,IAAIJ,MAAA,EAAQ;MACV,OAAO;QAAED,UAAA,EAAYD,KAAA,CAAMC,UAAU;QAAED,KAAA,EAAOK;MAAQ;IACxD;IACA,OAAOA,OAAA;EACT;EAEA;EACA,IAAIL,KAAA,IAAS,OAAOA,KAAA,KAAU,YAAY,QAAQA,KAAA,EAAO;IACvD,OAAOA,KAAA,CAAMM,EAAE;EACjB;EAEA,OAAON,KAAA;AACT","ignoreList":[]}

View File

@@ -0,0 +1,17 @@
/**
* @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 AlignEndVertical = createLucideIcon("AlignEndVertical", [
["rect", { width: "16", height: "6", x: "2", y: "4", rx: "2", key: "10wcwx" }],
["rect", { width: "9", height: "6", x: "9", y: "14", rx: "2", key: "4p5bwg" }],
["path", { d: "M22 22V2", key: "12ipfv" }]
]);
export { AlignEndVertical as default };
//# sourceMappingURL=align-end-vertical.js.map

View File

@@ -0,0 +1,88 @@
import { defaultLocale } from "./_lib/defaultLocale.js";
import { getDefaultOptions } from "./_lib/defaultOptions.js";
import { normalizeDates } from "./_lib/normalizeDates.js";
import { differenceInCalendarDays } from "./differenceInCalendarDays.js";
import { format } from "./format.js";
/**
* The {@link formatRelative} function options.
*/
/**
* @name formatRelative
* @category Common Helpers
* @summary Represent the date in words relative to the given base date.
*
* @description
* Represent the date in words relative to the given base date.
*
* | Distance to the base date | Result |
* |---------------------------|---------------------------|
* | Previous 6 days | last Sunday at 04:30 AM |
* | Last day | yesterday at 04:30 AM |
* | Same day | today at 04:30 AM |
* | Next day | tomorrow at 04:30 AM |
* | Next 6 days | Sunday at 04:30 AM |
* | Other | 12/31/2017 |
*
* @param date - The date to format
* @param baseDate - The date to compare with
* @param options - An object with options
*
* @returns The date in words
*
* @throws `date` must not be Invalid Date
* @throws `baseDate` must not be Invalid Date
* @throws `options.locale` must contain `localize` property
* @throws `options.locale` must contain `formatLong` property
* @throws `options.locale` must contain `formatRelative` property
*
* @example
* // Represent the date of 6 days ago in words relative to the given base date. In this example, today is Wednesday
* const result = formatRelative(subDays(new Date(), 6), new Date())
* //=> "last Thursday at 12:45 AM"
*/
export function formatRelative(date, baseDate, options) {
const [date_, baseDate_] = normalizeDates(options?.in, date, baseDate);
const defaultOptions = getDefaultOptions();
const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;
const weekStartsOn =
options?.weekStartsOn ??
options?.locale?.options?.weekStartsOn ??
defaultOptions.weekStartsOn ??
defaultOptions.locale?.options?.weekStartsOn ??
0;
const diff = differenceInCalendarDays(date_, baseDate_);
if (isNaN(diff)) {
throw new RangeError("Invalid time value");
}
let token;
if (diff < -6) {
token = "other";
} else if (diff < -1) {
token = "lastWeek";
} else if (diff < 0) {
token = "yesterday";
} else if (diff < 1) {
token = "today";
} else if (diff < 2) {
token = "tomorrow";
} else if (diff < 7) {
token = "nextWeek";
} else {
token = "other";
}
const formatStr = locale.formatRelative(token, date_, baseDate_, {
locale,
weekStartsOn,
});
return format(date_, formatStr, { locale, weekStartsOn });
}
// Fallback for modularized imports:
export default formatRelative;

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/sqlite-core/view-common.ts"],"sourcesContent":["export const SQLiteViewConfig = Symbol.for('drizzle:SQLiteViewConfig');\n"],"mappings":"AAAO,MAAM,mBAAmB,OAAO,IAAI,0BAA0B;","names":[]}

View File

@@ -0,0 +1 @@
{"version":3,"file":"culturecontext.d.ts","sourceRoot":"","sources":["../../../../src/integrations/culturecontext.ts"],"names":[],"mappings":"AAsBA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,yBAAyB,0CAAgD,CAAC"}

View File

@@ -0,0 +1,17 @@
import { RestCommand } from "../../types.js";
//#region src/rest/commands/auth/providers.d.ts
interface ReadProviderOutput {
name: string;
driver: string;
icon?: string | null;
}
/**
* List all the configured auth providers.
*
* @returns Array of configured auth providers.
*/
declare const readProviders: <Schema>(sessionOnly?: boolean) => RestCommand<ReadProviderOutput[], Schema>;
//#endregion
export { ReadProviderOutput, readProviders };
//# sourceMappingURL=providers.d.ts.map

View File

@@ -0,0 +1,46 @@
import { isBuild } from '../utils/isBuild.js';
import { withTracedServerSideDataFetcher, withErrorInstrumentation } from '../utils/wrapperUtils.js';
/**
* Create a wrapped version of the user's exported `getInitialProps` function in
* a custom document ("_document.js").
*
* @param origDocumentGetInitialProps The user's `getInitialProps` function
* @param parameterizedRoute The page's parameterized route
* @returns A wrapped version of the function
*/
function wrapDocumentGetInitialPropsWithSentry(
origDocumentGetInitialProps,
) {
return new Proxy(origDocumentGetInitialProps, {
apply: async (wrappingTarget, thisArg, args) => {
if (isBuild()) {
return wrappingTarget.apply(thisArg, args);
}
const [context] = args;
const { req, res } = context;
const errorWrappedGetInitialProps = withErrorInstrumentation(wrappingTarget);
// Generally we can assume that `req` and `res` are always defined on the server:
// https://nextjs.org/docs/api-reference/data-fetching/get-initial-props#context-object
// This does not seem to be the case in dev mode. Because we have no clean way of associating the the data fetcher
// span with each other when there are no req or res objects, we simply do not trace them at all here.
if (req && res) {
const tracedGetInitialProps = withTracedServerSideDataFetcher(errorWrappedGetInitialProps, req, res, {
dataFetcherRouteName: '/_document',
requestedRouteName: context.pathname,
dataFetchingMethodName: 'getInitialProps',
});
const { data } = await tracedGetInitialProps.apply(thisArg, args);
return data;
} else {
return errorWrappedGetInitialProps.apply(thisArg, args);
}
},
});
}
export { wrapDocumentGetInitialPropsWithSentry };
//# sourceMappingURL=wrapDocumentGetInitialPropsWithSentry.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/context/context.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAIH,qDAAqD;AACrD,SAAgB,gBAAgB,CAAC,WAAmB;IAClD,0EAA0E;IAC1E,2EAA2E;IAC3E,wEAAwE;IACxE,mDAAmD;IACnD,EAAE;IACF,8EAA8E;IAC9E,OAAO,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;AACjC,CAAC;AARD,4CAQC;AAED,MAAM,WAAW;IAGf;;;;OAIG;IACH,YAAY,aAAoC;QAC9C,mBAAmB;QACnB,MAAM,IAAI,GAAG,IAAI,CAAC;QAElB,IAAI,CAAC,eAAe,GAAG,aAAa,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC;QAE1E,IAAI,CAAC,QAAQ,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAE/D,IAAI,CAAC,QAAQ,GAAG,CAAC,GAAW,EAAE,KAAc,EAAW,EAAE;YACvD,MAAM,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YACtD,OAAO,CAAC,eAAe,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;YACxC,OAAO,OAAO,CAAC;QACjB,CAAC,CAAC;QAEF,IAAI,CAAC,WAAW,GAAG,CAAC,GAAW,EAAW,EAAE;YAC1C,MAAM,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YACtD,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACpC,OAAO,OAAO,CAAC;QACjB,CAAC,CAAC;IACJ,CAAC;CAyBF;AAED,6FAA6F;AAChF,QAAA,YAAY,GAAY,IAAI,WAAW,EAAE,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\nimport { Context } from './types';\n\n/** Get a key to uniquely identify a context value */\nexport function createContextKey(description: string) {\n // The specification states that for the same input, multiple calls should\n // return different keys. Due to the nature of the JS dependency management\n // system, this creates problems where multiple versions of some package\n // could hold different keys for the same property.\n //\n // Therefore, we use Symbol.for which returns the same key for the same input.\n return Symbol.for(description);\n}\n\nclass BaseContext implements Context {\n private _currentContext!: Map<symbol, unknown>;\n\n /**\n * Construct a new context which inherits values from an optional parent context.\n *\n * @param parentContext a context from which to inherit values\n */\n constructor(parentContext?: Map<symbol, unknown>) {\n // for minification\n const self = this;\n\n self._currentContext = parentContext ? new Map(parentContext) : new Map();\n\n self.getValue = (key: symbol) => self._currentContext.get(key);\n\n self.setValue = (key: symbol, value: unknown): Context => {\n const context = new BaseContext(self._currentContext);\n context._currentContext.set(key, value);\n return context;\n };\n\n self.deleteValue = (key: symbol): Context => {\n const context = new BaseContext(self._currentContext);\n context._currentContext.delete(key);\n return context;\n };\n }\n\n /**\n * Get a value from the context.\n *\n * @param key key which identifies a context value\n */\n public getValue!: (key: symbol) => unknown;\n\n /**\n * Create a new context which inherits from this context and has\n * the given key set to the given value.\n *\n * @param key context key for which to set the value\n * @param value value to set for the given key\n */\n public setValue!: (key: symbol, value: unknown) => Context;\n\n /**\n * Return a new context which inherits from this context but does\n * not contain a value for the given key.\n *\n * @param key context key for which to clear a value\n */\n public deleteValue!: (key: symbol) => Context;\n}\n\n/** The root context is used as the default parent context when there is no active context */\nexport const ROOT_CONTEXT: Context = new BaseContext();\n"]}

View File

@@ -0,0 +1 @@
{"version":3,"file":"semconvStability.js","sourceRoot":"","sources":["../../src/semconvStability.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,IAAY,gBAOX;AAPD,WAAY,gBAAgB;IAC1B,6CAA6C;IAC7C,2DAAY,CAAA;IACZ,0CAA0C;IAC1C,qDAAS,CAAA;IACT,qDAAqD;IACrD,iEAAqB,CAAA;AACvB,CAAC,EAPW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAO3B;AAWD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,SAAgB,uBAAuB,CACrC,SAAoC,EACpC,GAAuB;IAEvB,IAAI,gBAAgB,GAAG,gBAAgB,CAAC,GAAG,CAAC;IAE5C,yEAAyE;IACzE,MAAM,OAAO,GAAG,GAAG;QACjB,EAAE,KAAK,CAAC,GAAG,CAAC;SACX,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SAClB,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;IACzB,KAAK,MAAM,KAAK,IAAI,OAAO,IAAI,EAAE,EAAE;QACjC,IAAI,KAAK,CAAC,WAAW,EAAE,KAAK,SAAS,GAAG,MAAM,EAAE;YAC9C,sCAAsC;YACtC,gBAAgB,GAAG,gBAAgB,CAAC,SAAS,CAAC;YAC9C,MAAM;SACP;aAAM,IAAI,KAAK,CAAC,WAAW,EAAE,KAAK,SAAS,EAAE;YAC5C,gBAAgB,GAAG,gBAAgB,CAAC,MAAM,CAAC;SAC5C;KACF;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAtBD,0DAsBC","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\nexport enum SemconvStability {\n /** Emit only stable semantic conventions. */\n STABLE = 0x1,\n /** Emit only old semantic conventions. */\n OLD = 0x2,\n /** Emit both stable and old semantic conventions. */\n DUPLICATE = 0x1 | 0x2,\n}\n\n// Common namespaces mentioned in semantic-conventions docs, but allow\n// other custom strings.\ntype SemConvStabilityNamespace =\n | 'http'\n | 'messaging'\n | 'database'\n | 'k8s'\n | (string & {});\n\n/**\n * Determine the appropriate semconv stability for the given namespace.\n *\n * This will parse the given string of comma-separated values (often\n * `process.env.OTEL_SEMCONV_STABILITY_OPT_IN`) looking for the `${namespace}`\n * or `${namespace}/dup` tokens. This is a pattern defined by a number of\n * non-normative semconv documents.\n *\n * For example:\n * - namespace 'http': https://opentelemetry.io/docs/specs/semconv/non-normative/http-migration/\n * - namespace 'database': https://opentelemetry.io/docs/specs/semconv/non-normative/database-migration/\n * - namespace 'k8s': https://opentelemetry.io/docs/specs/semconv/non-normative/k8s-migration/\n *\n * Usage:\n *\n * import {SemconvStability, semconvStabilityFromStr} from '@opentelemetry/instrumentation';\n *\n * export class FooInstrumentation extends InstrumentationBase<FooInstrumentationConfig> {\n * private _semconvStability: SemconvStability;\n * constructor(config: FooInstrumentationConfig = {}) {\n * super('@opentelemetry/instrumentation-foo', VERSION, config);\n *\n * // When supporting the OTEL_SEMCONV_STABILITY_OPT_IN envvar\n * this._semconvStability = semconvStabilityFromStr(\n * 'http',\n * process.env.OTEL_SEMCONV_STABILITY_OPT_IN\n * );\n *\n * // or when supporting a `semconvStabilityOptIn` config option (e.g. for\n * // the web where there are no envvars).\n * this._semconvStability = semconvStabilityFromStr(\n * 'http',\n * config?.semconvStabilityOptIn\n * );\n * }\n * }\n *\n * // Then, to apply semconv, use the following or similar:\n * if (this._semconvStability & SemconvStability.OLD) {\n * // ...\n * }\n * if (this._semconvStability & SemconvStability.STABLE) {\n * // ...\n * }\n *\n */\nexport function semconvStabilityFromStr(\n namespace: SemConvStabilityNamespace,\n str: string | undefined\n) {\n let semconvStability = SemconvStability.OLD;\n\n // The same parsing of `str` as `getStringListFromEnv` from the core pkg.\n const entries = str\n ?.split(',')\n .map(v => v.trim())\n .filter(s => s !== '');\n for (const entry of entries ?? []) {\n if (entry.toLowerCase() === namespace + '/dup') {\n // DUPLICATE takes highest precedence.\n semconvStability = SemconvStability.DUPLICATE;\n break;\n } else if (entry.toLowerCase() === namespace) {\n semconvStability = SemconvStability.STABLE;\n }\n }\n\n return semconvStability;\n}\n"]}

View File

@@ -0,0 +1,65 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var tinyint_exports = {};
__export(tinyint_exports, {
MySqlTinyInt: () => MySqlTinyInt,
MySqlTinyIntBuilder: () => MySqlTinyIntBuilder,
tinyint: () => tinyint
});
module.exports = __toCommonJS(tinyint_exports);
var import_entity = require("../../entity.cjs");
var import_utils = require("../../utils.cjs");
var import_common = require("./common.cjs");
class MySqlTinyIntBuilder extends import_common.MySqlColumnBuilderWithAutoIncrement {
static [import_entity.entityKind] = "MySqlTinyIntBuilder";
constructor(name, config) {
super(name, "number", "MySqlTinyInt");
this.config.unsigned = config ? config.unsigned : false;
}
/** @internal */
build(table) {
return new MySqlTinyInt(
table,
this.config
);
}
}
class MySqlTinyInt extends import_common.MySqlColumnWithAutoIncrement {
static [import_entity.entityKind] = "MySqlTinyInt";
getSQLType() {
return `tinyint${this.config.unsigned ? " unsigned" : ""}`;
}
mapFromDriverValue(value) {
if (typeof value === "string") {
return Number(value);
}
return value;
}
}
function tinyint(a, b) {
const { name, config } = (0, import_utils.getColumnNameAndConfig)(a, b);
return new MySqlTinyIntBuilder(name, config);
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
MySqlTinyInt,
MySqlTinyIntBuilder,
tinyint
});
//# sourceMappingURL=tinyint.cjs.map

View File

@@ -0,0 +1,133 @@
'use client';
import { c as _c } from "react/compiler-runtime";
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
import { getTranslation } from '@payloadcms/translations';
import { BrowseByFolderButton, Link, NavGroup, useConfig, useTranslation } from '@payloadcms/ui';
import { EntityType } from '@payloadcms/ui/shared';
import { usePathname } from 'next/navigation.js';
import { formatAdminURL } from 'payload/shared';
import React, { Fragment } from 'react';
const baseClass = 'nav';
/**
* @internal
*/
export const DefaultNavClient = t0 => {
const $ = _c(13);
const {
groups,
navPreferences
} = t0;
const pathname = usePathname();
const {
config: t1
} = useConfig();
const {
admin: t2,
folders,
routes: t3
} = t1;
const {
routes: t4
} = t2;
const {
browseByFolder: foldersRoute
} = t4;
const {
admin: adminRoute
} = t3;
const {
i18n
} = useTranslation();
let t5;
if ($[0] !== adminRoute || $[1] !== folders || $[2] !== foldersRoute || $[3] !== groups || $[4] !== i18n || $[5] !== navPreferences?.groups || $[6] !== pathname) {
const folderURL = formatAdminURL({
adminRoute,
path: foldersRoute
});
const viewingRootFolderView = pathname.startsWith(folderURL);
let t6;
if ($[8] !== adminRoute || $[9] !== i18n || $[10] !== navPreferences?.groups || $[11] !== pathname) {
t6 = (t7, key) => {
const {
entities,
label
} = t7;
return _jsx(NavGroup, {
isOpen: navPreferences?.groups?.[label]?.open,
label,
children: entities.map((t8, i) => {
const {
slug,
type,
label: label_0
} = t8;
let href;
let id;
if (type === EntityType.collection) {
href = formatAdminURL({
adminRoute,
path: `/collections/${slug}`
});
id = `nav-${slug}`;
}
if (type === EntityType.global) {
href = formatAdminURL({
adminRoute,
path: `/globals/${slug}`
});
id = `nav-global-${slug}`;
}
const isActive = pathname.startsWith(href) && ["/", undefined].includes(pathname[href.length]);
const Label = _jsxs(_Fragment, {
children: [isActive && _jsx("div", {
className: `${baseClass}__link-indicator`
}), _jsx("span", {
className: `${baseClass}__link-label`,
children: getTranslation(label_0, i18n)
})]
});
if (pathname === href) {
return _jsx("div", {
className: `${baseClass}__link`,
id,
children: Label
}, i);
}
return _jsx(Link, {
className: `${baseClass}__link`,
href,
id,
prefetch: false,
children: Label
}, i);
})
}, key);
};
$[8] = adminRoute;
$[9] = i18n;
$[10] = navPreferences?.groups;
$[11] = pathname;
$[12] = t6;
} else {
t6 = $[12];
}
t5 = _jsxs(Fragment, {
children: [folders && folders.browseByFolder && _jsx(BrowseByFolderButton, {
active: viewingRootFolderView
}), groups.map(t6)]
});
$[0] = adminRoute;
$[1] = folders;
$[2] = foldersRoute;
$[3] = groups;
$[4] = i18n;
$[5] = navPreferences?.groups;
$[6] = pathname;
$[7] = t5;
} else {
t5 = $[7];
}
return t5;
};
//# sourceMappingURL=index.client.js.map

View File

@@ -0,0 +1,114 @@
/**
* Convert an "ADD COLUMN" statement to an "ALTER COLUMN" statement.
* Works with or without a schema name.
*
* Examples:
* 'ALTER TABLE "pages_blocks_my_block" ADD COLUMN "person_id" integer NOT NULL;'
* => 'ALTER TABLE "pages_blocks_my_block" ALTER COLUMN "person_id" SET NOT NULL;'
*
* 'ALTER TABLE "public"."pages_blocks_my_block" ADD COLUMN "person_id" integer NOT NULL;'
* => 'ALTER TABLE "public"."pages_blocks_my_block" ALTER COLUMN "person_id" SET NOT NULL;'
*/ function convertAddColumnToAlterColumn(sql) {
// Regular expression to match the ADD COLUMN statement with its constraints
const regex = /ALTER TABLE ((?:"[^"]+"\.)?"[^"]+") ADD COLUMN ("[^"]+") [^;]*?NOT NULL;/i;
// Replace the matched part with "ALTER COLUMN ... SET NOT NULL;"
return sql.replace(regex, 'ALTER TABLE $1 ALTER COLUMN $2 SET NOT NULL;');
}
export const groupUpSQLStatements = (list)=>{
const groups = {
/**
* example: ALTER TABLE "posts" ADD COLUMN "category_id" integer
*/ addColumn: 'ADD COLUMN',
/**
* example:
* DO $$ BEGIN
* ALTER TABLE "pages_blocks_my_block" ADD CONSTRAINT "pages_blocks_my_block_person_id_users_id_fk" FOREIGN KEY ("person_id") REFERENCES "users"("id") ON DELETE cascade ON UPDATE no action;
* EXCEPTION
* WHEN duplicate_object THEN null;
* END $$;
*/ addConstraint: 'ADD CONSTRAINT',
/**
* example: CREATE TABLE IF NOT EXISTS "payload_locked_documents" (
* "id" serial PRIMARY KEY NOT NULL,
* "global_slug" varchar,
* "updated_at" timestamp(3) with time zone DEFAULT now() NOT NULL,
* "created_at" timestamp(3) with time zone DEFAULT now() NOT NULL
* );
*/ createTable: 'CREATE TABLE',
/**
* example: ALTER TABLE "_posts_v_rels" DROP COLUMN IF EXISTS "posts_id";
*/ dropColumn: 'DROP COLUMN',
/**
* example: ALTER TABLE "_posts_v_rels" DROP CONSTRAINT "_posts_v_rels_posts_fk";
*/ dropConstraint: 'DROP CONSTRAINT',
/**
* example: DROP TABLE "pages_rels";
*/ dropTable: 'DROP TABLE',
/**
* example: ALTER TABLE "pages_blocks_my_block" ALTER COLUMN "person_id" SET NOT NULL;
*/ notNull: 'NOT NULL',
/**
* example: CREATE TYPE "public"."enum__pages_v_published_locale" AS ENUM('en', 'es');
*/ createType: 'CREATE TYPE',
/**
* example: ALTER TYPE "public"."enum_pages_blocks_cta" ADD VALUE 'copy';
*/ alterType: 'ALTER TYPE',
/**
* example: ALTER TABLE "categories_rels" DISABLE ROW LEVEL SECURITY;
*/ disableRowSecurity: 'DISABLE ROW LEVEL SECURITY;',
/**
* example: DROP INDEX IF EXISTS "pages_title_idx";
*/ dropIndex: 'DROP INDEX IF EXISTS',
/**
* example: ALTER TABLE "pages" ALTER COLUMN "_status" SET DEFAULT 'draft';
*/ setDefault: 'SET DEFAULT',
/**
* example: CREATE INDEX IF NOT EXISTS "payload_locked_documents_global_slug_idx" ON "payload_locked_documents" USING btree ("global_slug");
*/ createIndex: 'INDEX IF NOT EXISTS',
/**
* example: DROP TYPE "public"."enum__pages_v_published_locale";
*/ dropType: 'DROP TYPE',
/**
* columns were renamed from camelCase to snake_case
* example: ALTER TABLE "forms" RENAME COLUMN "confirmationType" TO "confirmation_type";
*/ renameColumn: 'RENAME COLUMN'
};
const result = Object.keys(groups).reduce((result, group)=>{
result[group] = [];
return result;
}, {});
// push multi-line changes to a single grouping
let isCreateTable = false;
for (const line of list){
if (isCreateTable) {
result.createTable.push(line);
if (line.includes(');')) {
isCreateTable = false;
}
continue;
}
Object.entries(groups).some(([key, value])=>{
if (line.endsWith('NOT NULL;')) {
// split up the ADD COLUMN and ALTER COLUMN NOT NULL statements
// example: ALTER TABLE "pages_blocks_my_block" ADD COLUMN "person_id" integer NOT NULL;
// becomes two separate statements:
// 1. ALTER TABLE "pages_blocks_my_block" ADD COLUMN "person_id" integer;
// 2. ALTER TABLE "pages_blocks_my_block" ALTER COLUMN "person_id" SET NOT NULL;
result.addColumn.push(line.replace(' NOT NULL;', ';'));
result.notNull.push(convertAddColumnToAlterColumn(line));
return true;
}
if (line.includes(value)) {
let statement = line;
if (key === 'dropConstraint') {
statement = line.replace('" DROP CONSTRAINT "', '" DROP CONSTRAINT IF EXISTS "');
}
result[key].push(statement);
return true;
}
});
}
return result;
};
//# sourceMappingURL=groupUpSQLStatements.js.map

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