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,117 @@
import * as util from "../core/util.js";
export const parsedType = (data) => {
const t = typeof data;
switch (t) {
case "number": {
return Number.isNaN(data) ? "NaN" : "number";
}
case "object": {
if (Array.isArray(data)) {
return "array";
}
if (data === null) {
return "null";
}
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
return data.constructor.name;
}
}
}
return t;
};
const error = () => {
const Sizable = {
string: { unit: "characters", verb: "to have" },
file: { unit: "bytes", verb: "to have" },
array: { unit: "items", verb: "to have" },
set: { unit: "items", verb: "to have" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const Nouns = {
regex: "input",
email: "email address",
url: "URL",
emoji: "emoji",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "ISO datetime",
date: "ISO date",
time: "ISO time",
duration: "ISO duration",
ipv4: "IPv4 address",
ipv6: "IPv6 address",
cidrv4: "IPv4 range",
cidrv6: "IPv6 range",
base64: "base64-encoded string",
base64url: "base64url-encoded string",
json_string: "JSON string",
e164: "E.164 number",
jwt: "JWT",
template_literal: "input",
};
return (issue) => {
switch (issue.code) {
case "invalid_type":
return `Invalid input: expected ${issue.expected}, received ${parsedType(issue.input)}`;
case "invalid_value":
if (issue.values.length === 1)
return `Invalid input: expected ${util.stringifyPrimitive(issue.values[0])}`;
return `Invalid option: expected one of ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return `Too big: expected ${issue.origin ?? "value"} to have ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elements"}`;
return `Too big: expected ${issue.origin ?? "value"} to be ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `Too small: expected ${issue.origin} to have ${adj}${issue.minimum.toString()} ${sizing.unit}`;
}
return `Too small: expected ${issue.origin} to be ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with") {
return `Invalid string: must start with "${_issue.prefix}"`;
}
if (_issue.format === "ends_with")
return `Invalid string: must end with "${_issue.suffix}"`;
if (_issue.format === "includes")
return `Invalid string: must include "${_issue.includes}"`;
if (_issue.format === "regex")
return `Invalid string: must match pattern ${_issue.pattern}`;
return `Invalid ${Nouns[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Invalid number: must be a multiple of ${issue.divisor}`;
case "unrecognized_keys":
return `Unrecognized key${issue.keys.length > 1 ? "s" : ""}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Invalid key in ${issue.origin}`;
case "invalid_union":
return "Invalid input";
case "invalid_element":
return `Invalid value in ${issue.origin}`;
default:
return `Invalid input`;
}
};
};
export default function () {
return {
localeError: error(),
};
}

View File

@@ -0,0 +1,8 @@
"use strict";
function _instanceof(left, right) {
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
return !!right[Symbol.hasInstance](left);
} else return left instanceof right;
}
exports._ = _instanceof;

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/fields/baseFields/slug/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAA;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAA;AACtF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAI7D,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,UAAU,GAAG,GAAG,IAAI,CAAC,IAAI,EAAE;IACvD,IAAI,EAAE,CAAC,CAAA;IACP,GAAG,EAAE,cAAc,CAAA;IACnB,cAAc,CAAC,EAAE,GAAG,CAAA;CACrB,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,MAAM,GAAG,SAAS,CAAA;AAEtD,MAAM,MAAM,aAAa,GAAG;IAC1B;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,CAAA;IAClC;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,QAAQ,CAAA;IACzC,QAAQ,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAA;IACjC;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,CAAA;IAChC;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,SAAS,GAAG,CAAC,IAAI,CAAC,EAAE,aAAa,KAAK,QAAQ,CAAA;AAE1D,MAAM,MAAM,wBAAwB,GAAG,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC,CAAA;AACvE;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,wBAAwB,GAAG,oBAAoB,CAAA;AAElF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,SAAS,EAAE,SAsEvB,CAAA"}

View File

@@ -0,0 +1,22 @@
/**
* @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 ShieldBan = createLucideIcon("ShieldBan", [
[
"path",
{
d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",
key: "oel41y"
}
],
["path", { d: "m4.243 5.21 14.39 12.472", key: "1c9a7c" }]
]);
export { ShieldBan as default };
//# sourceMappingURL=shield-ban.js.map

View File

@@ -0,0 +1,139 @@
'use client';
import { c as _c } from "react/compiler-runtime";
import { jsx as _jsx } from "react/jsx-runtime";
import { getTranslation } from '@payloadcms/translations';
import React from 'react';
import { useTranslation } from '../../../../providers/Translation/index.js';
import { ReactSelect } from '../../../ReactSelect/index.js';
import './index.scss';
const baseClass = 'condition-value-number';
export const NumberFilter = props => {
const $ = _c(20);
const {
disabled,
field: t0,
onChange,
operator,
value
} = props;
const {
admin,
hasMany
} = t0;
const {
i18n,
t
} = useTranslation();
let t1;
if ($[0] !== hasMany || $[1] !== operator) {
t1 = ["in", "not_in"].includes(operator) || hasMany;
$[0] = hasMany;
$[1] = operator;
$[2] = t1;
} else {
t1 = $[2];
}
const isMulti = t1;
let t2;
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
t2 = [];
$[3] = t2;
} else {
t2 = $[3];
}
const [valueToRender, setValueToRender] = React.useState(t2);
let t3;
if ($[4] !== isMulti || $[5] !== onChange) {
t3 = selectedOption => {
let newValue;
if (!selectedOption) {
newValue = [];
} else {
if (isMulti) {
if (Array.isArray(selectedOption)) {
newValue = selectedOption.map(_temp);
} else {
newValue = [Number(selectedOption.value?.value || selectedOption.value)];
}
}
}
onChange(newValue);
};
$[4] = isMulti;
$[5] = onChange;
$[6] = t3;
} else {
t3 = $[6];
}
const onSelect = t3;
let t4;
let t5;
if ($[7] !== value) {
t4 = () => {
if (Array.isArray(value)) {
setValueToRender(value.map(_temp2));
} else {
setValueToRender([]);
}
};
t5 = [value];
$[7] = value;
$[8] = t4;
$[9] = t5;
} else {
t4 = $[8];
t5 = $[9];
}
React.useEffect(t4, t5);
let t6;
if ($[10] !== admin?.placeholder || $[11] !== disabled || $[12] !== i18n || $[13] !== isMulti || $[14] !== onChange || $[15] !== onSelect || $[16] !== t || $[17] !== value || $[18] !== valueToRender) {
const placeholder = getTranslation(admin?.placeholder, i18n) || t("general:enterAValue");
t6 = isMulti ? _jsx(ReactSelect, {
disabled,
isClearable: true,
isCreatable: true,
isMulti,
isSortable: true,
numberOnly: true,
onChange: onSelect,
options: [],
placeholder,
value: valueToRender || []
}) : _jsx("input", {
className: baseClass,
disabled,
onChange: e => onChange(e.target.value),
placeholder,
type: "number",
value
});
$[10] = admin?.placeholder;
$[11] = disabled;
$[12] = i18n;
$[13] = isMulti;
$[14] = onChange;
$[15] = onSelect;
$[16] = t;
$[17] = value;
$[18] = valueToRender;
$[19] = t6;
} else {
t6 = $[19];
}
return t6;
};
function _temp(option) {
return Number(option.value?.value || option.value);
}
function _temp2(val, index) {
return {
id: `${val}${index}`,
label: `${val}`,
value: {
toString: () => `${val}${index}`,
value: val?.value || val
}
};
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,2 @@
import{throwIfEmpty as e}from"../../utils/throw-if-empty.js";const t=e=>()=>({path:`/permissions`,params:e??{},method:`GET`}),n=(t,n)=>()=>(e(String(t),`Key cannot be empty`),{path:`/permissions/${t}`,params:n??{},method:`GET`}),r=(t,n)=>()=>(e(String(t),`Collection cannot be empty`),{path:`/permissions/me/${n?`${t}/${n}`:`${t}`}`,method:`GET`}),i=()=>()=>({path:`/permissions/me`,method:`GET`});export{r as readItemPermissions,n as readPermission,t as readPermissions,i as readUserPermissions};
//# sourceMappingURL=permissions.js.map

View File

@@ -0,0 +1,10 @@
import React from 'react';
import { useScrollInfo } from '../useScrollInfo/index.js';
export const withScrollInfo = (PassedComponent) => {
const ScrollInfoWrap = (props) => {
const scrollInfoContext = useScrollInfo();
return (React.createElement(PassedComponent, Object.assign({}, props, { scrollInfo: scrollInfoContext })));
};
return ScrollInfoWrap;
};
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
!function(e){for(var t="\\(\\*(?:[^(*]|\\((?!\\*)|\\*(?!\\))|<self>)*\\*\\)",i=0;i<2;i++)t=t.replace(/<self>/g,(function(){return t}));t=t.replace(/<self>/g,"[]"),e.languages.coq={comment:RegExp(t),string:{pattern:/"(?:[^"]|"")*"(?!")/,greedy:!0},attribute:[{pattern:RegExp('#\\[(?:[^\\[\\]("]|"(?:[^"]|"")*"(?!")|\\((?!\\*)|<comment>)*\\]'.replace(/<comment>/g,(function(){return t}))),greedy:!0,alias:"attr-name",inside:{comment:RegExp(t),string:{pattern:/"(?:[^"]|"")*"(?!")/,greedy:!0},operator:/=/,punctuation:/^#\[|\]$|[,()]/}},{pattern:/\b(?:Cumulative|Global|Local|Monomorphic|NonCumulative|Polymorphic|Private|Program)\b/,alias:"attr-name"}],keyword:/\b(?:Abort|About|Add|Admit|Admitted|All|Arguments|As|Assumptions|Axiom|Axioms|Back|BackTo|Backtrace|BinOp|BinOpSpec|BinRel|Bind|Blacklist|Canonical|Case|Cd|Check|Class|Classes|Close|CoFixpoint|CoInductive|Coercion|Coercions|Collection|Combined|Compute|Conjecture|Conjectures|Constant|Constants|Constraint|Constructors|Context|Corollary|Create|CstOp|Custom|Cut|Debug|Declare|Defined|Definition|Delimit|Dependencies|Dependent|Derive|Diffs|Drop|Elimination|End|Entry|Equality|Eval|Example|Existential|Existentials|Existing|Export|Extern|Extraction|Fact|Fail|Field|File|Firstorder|Fixpoint|Flags|Focus|From|Funclass|Function|Functional|GC|Generalizable|Goal|Grab|Grammar|Graph|Guarded|Haskell|Heap|Hide|Hint|HintDb|Hints|Hypotheses|Hypothesis|IF|Identity|Immediate|Implicit|Implicits|Import|Include|Induction|Inductive|Infix|Info|Initial|InjTyp|Inline|Inspect|Instance|Instances|Intro|Intros|Inversion|Inversion_clear|JSON|Language|Left|Lemma|Let|Lia|Libraries|Library|Load|LoadPath|Locate|Ltac|Ltac2|ML|Match|Method|Minimality|Module|Modules|Morphism|Next|NoInline|Notation|Number|OCaml|Obligation|Obligations|Opaque|Open|Optimize|Parameter|Parameters|Parametric|Path|Paths|Prenex|Preterm|Primitive|Print|Profile|Projections|Proof|Prop|PropBinOp|PropOp|PropUOp|Property|Proposition|Pwd|Qed|Quit|Rec|Record|Recursive|Redirect|Reduction|Register|Relation|Remark|Remove|Require|Reserved|Reset|Resolve|Restart|Rewrite|Right|Ring|Rings|SProp|Saturate|Save|Scheme|Scope|Scopes|Search|SearchHead|SearchPattern|SearchRewrite|Section|Separate|Set|Setoid|Show|Signatures|Solve|Solver|Sort|Sortclass|Sorted|Spec|Step|Strategies|Strategy|String|Structure|SubClass|Subgraph|SuchThat|Tactic|Term|TestCompile|Theorem|Time|Timeout|To|Transparent|Type|Typeclasses|Types|Typing|UnOp|UnOpSpec|Undelimit|Undo|Unfocus|Unfocused|Unfold|Universe|Universes|Unshelve|Variable|Variables|Variant|Verbose|View|Visibility|Zify|_|apply|as|at|by|cofix|else|end|exists|exists2|fix|for|forall|fun|if|in|let|match|measure|move|removed|return|struct|then|using|wf|where|with)\b/,number:/\b(?:0x[a-f0-9][a-f0-9_]*(?:\.[a-f0-9_]+)?(?:p[+-]?\d[\d_]*)?|\d[\d_]*(?:\.[\d_]+)?(?:e[+-]?\d[\d_]*)?)\b/i,punct:{pattern:/@\{|\{\||\[=|:>/,alias:"punctuation"},operator:/\/\\|\\\/|\.{2,3}|:{1,2}=|\*\*|[-=]>|<(?:->?|[+:=>]|<:)|>(?:=|->)|\|[-|]?|[-!%&*+/<=>?@^~']/,punctuation:/\.\(|`\(|@\{|`\{|\{\||\[=|:>|[:.,;(){}\[\]]/}}(Prism);

View File

@@ -0,0 +1 @@
{"version":3,"file":"composable.js","names":["defaultConfigValues: RestConfig","fetchOptions: RequestInit"],"sources":["../../src/rest/composable.ts"],"sourcesContent":["import type { StaticTokenClient } from '../auth/types.js';\nimport type { DirectusClient } from '../types/client.js';\nimport { getRequestUrl } from '../utils/get-request-url.js';\nimport { request } from '../utils/request.js';\nimport type { RestClient, RestCommand, RestConfig } from './types.js';\n\nconst defaultConfigValues: RestConfig = {};\n\n/**\n * Creates a client to communicate with the Directus REST API.\n *\n * @returns A Directus REST client.\n */\nexport const rest = (config: Partial<RestConfig> = {}) => {\n\treturn <Schema>(client: DirectusClient<Schema>): RestClient<Schema> => {\n\t\tconst restConfig = { ...defaultConfigValues, ...config };\n\t\treturn {\n\t\t\tasync request<Output = any>(getOptions: RestCommand<Output, Schema>): Promise<Output> {\n\t\t\t\tconst options = getOptions();\n\n\t\t\t\t// all api requests require this content type\n\t\t\t\tif (!options.headers) {\n\t\t\t\t\toptions.headers = {};\n\t\t\t\t}\n\n\t\t\t\tif ('Content-Type' in options.headers === false) {\n\t\t\t\t\toptions.headers['Content-Type'] = 'application/json';\n\t\t\t\t} else if (options.headers['Content-Type'] === 'multipart/form-data') {\n\t\t\t\t\t// let the fetch function deal with multipart boundaries\n\t\t\t\t\tdelete options.headers['Content-Type'];\n\t\t\t\t}\n\n\t\t\t\t// we need to use THIS here instead of client to access overridden functions\n\t\t\t\tif ('getToken' in this && 'Authorization' in options.headers === false) {\n\t\t\t\t\tconst token = await (this.getToken as StaticTokenClient<Schema>['getToken'])();\n\n\t\t\t\t\tif (token) {\n\t\t\t\t\t\toptions.headers['Authorization'] = `Bearer ${token}`;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst requestUrl = getRequestUrl(client.url, options.path, options.params);\n\n\t\t\t\tlet fetchOptions: RequestInit = {\n\t\t\t\t\tmethod: options.method ?? 'GET',\n\t\t\t\t\theaders: options.headers ?? {},\n\t\t\t\t};\n\n\t\t\t\tif ('credentials' in restConfig) {\n\t\t\t\t\tfetchOptions.credentials = restConfig.credentials;\n\t\t\t\t}\n\n\t\t\t\tif (options.body) {\n\t\t\t\t\tfetchOptions['body'] = options.body;\n\t\t\t\t}\n\n\t\t\t\t// apply onRequest hook from command\n\t\t\t\tif (options.onRequest) {\n\t\t\t\t\tfetchOptions = await options.onRequest(fetchOptions);\n\t\t\t\t}\n\n\t\t\t\t// apply global onRequest hook\n\t\t\t\tif (restConfig.onRequest) {\n\t\t\t\t\tfetchOptions = await restConfig.onRequest(fetchOptions);\n\t\t\t\t}\n\n\t\t\t\tlet result = await request<Output>(requestUrl.toString(), fetchOptions, client.globals.fetch);\n\n\t\t\t\t// apply onResponse hook from command\n\t\t\t\tif ('onResponse' in options) {\n\t\t\t\t\tresult = await options.onResponse(result, fetchOptions);\n\t\t\t\t}\n\n\t\t\t\t// apply global onResponse hook\n\t\t\t\tif ('onResponse' in config) {\n\t\t\t\t\tresult = await config.onResponse(result, fetchOptions);\n\t\t\t\t}\n\n\t\t\t\treturn result as Output;\n\t\t\t},\n\t\t};\n\t};\n};\n"],"mappings":"0GAMA,MAAMA,EAAkC,EAAE,CAO7B,GAAQ,EAA8B,EAAE,GACpC,GAAuD,CACtE,IAAM,EAAa,CAAE,GAAG,EAAqB,GAAG,EAAQ,CACxD,MAAO,CACN,MAAM,QAAsB,EAA0D,CACrF,IAAM,EAAU,GAAY,CAe5B,GAZA,AACC,EAAQ,UAAU,EAAE,CAGjB,iBAAkB,EAAQ,QAEnB,EAAQ,QAAQ,kBAAoB,uBAE9C,OAAO,EAAQ,QAAQ,gBAHvB,EAAQ,QAAQ,gBAAkB,mBAO/B,aAAc,MAAQ,oBAAmB,EAAQ,SAAmB,CACvE,IAAM,EAAQ,MAAO,KAAK,UAAoD,CAE1E,IACH,EAAQ,QAAQ,cAAmB,UAAU,KAI/C,IAAM,EAAa,EAAc,EAAO,IAAK,EAAQ,KAAM,EAAQ,OAAO,CAEtEC,EAA4B,CAC/B,OAAQ,EAAQ,QAAU,MAC1B,QAAS,EAAQ,SAAW,EAAE,CAC9B,CAEG,gBAAiB,IACpB,EAAa,YAAc,EAAW,aAGnC,EAAQ,OACX,EAAa,KAAU,EAAQ,MAI5B,EAAQ,YACX,EAAe,MAAM,EAAQ,UAAU,EAAa,EAIjD,EAAW,YACd,EAAe,MAAM,EAAW,UAAU,EAAa,EAGxD,IAAI,EAAS,MAAM,EAAgB,EAAW,UAAU,CAAE,EAAc,EAAO,QAAQ,MAAM,CAY7F,MATI,eAAgB,IACnB,EAAS,MAAM,EAAQ,WAAW,EAAQ,EAAa,EAIpD,eAAgB,IACnB,EAAS,MAAM,EAAO,WAAW,EAAQ,EAAa,EAGhD,GAER"}

View File

@@ -0,0 +1,229 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true,
});
exports.collectFields = collectFields;
exports.collectSubfields = collectSubfields;
var _kinds = require('../language/kinds.js');
var _definition = require('../type/definition.js');
var _directives = require('../type/directives.js');
var _typeFromAST = require('../utilities/typeFromAST.js');
var _values = require('./values.js');
/**
* Given a selectionSet, collects all of the fields and returns them.
*
* CollectFields requires the "runtime type" of an object. For a field that
* returns an Interface or Union type, the "runtime type" will be the actual
* object type returned by that field.
*
* @internal
*/
function collectFields(
schema,
fragments,
variableValues,
runtimeType,
selectionSet,
) {
const fields = new Map();
collectFieldsImpl(
schema,
fragments,
variableValues,
runtimeType,
selectionSet,
fields,
new Set(),
);
return fields;
}
/**
* Given an array of field nodes, collects all of the subfields of the passed
* in fields, and returns them at the end.
*
* CollectSubFields requires the "return type" of an object. For a field that
* returns an Interface or Union type, the "return type" will be the actual
* object type returned by that field.
*
* @internal
*/
function collectSubfields(
schema,
fragments,
variableValues,
returnType,
fieldNodes,
) {
const subFieldNodes = new Map();
const visitedFragmentNames = new Set();
for (const node of fieldNodes) {
if (node.selectionSet) {
collectFieldsImpl(
schema,
fragments,
variableValues,
returnType,
node.selectionSet,
subFieldNodes,
visitedFragmentNames,
);
}
}
return subFieldNodes;
}
function collectFieldsImpl(
schema,
fragments,
variableValues,
runtimeType,
selectionSet,
fields,
visitedFragmentNames,
) {
for (const selection of selectionSet.selections) {
switch (selection.kind) {
case _kinds.Kind.FIELD: {
if (!shouldIncludeNode(variableValues, selection)) {
continue;
}
const name = getFieldEntryKey(selection);
const fieldList = fields.get(name);
if (fieldList !== undefined) {
fieldList.push(selection);
} else {
fields.set(name, [selection]);
}
break;
}
case _kinds.Kind.INLINE_FRAGMENT: {
if (
!shouldIncludeNode(variableValues, selection) ||
!doesFragmentConditionMatch(schema, selection, runtimeType)
) {
continue;
}
collectFieldsImpl(
schema,
fragments,
variableValues,
runtimeType,
selection.selectionSet,
fields,
visitedFragmentNames,
);
break;
}
case _kinds.Kind.FRAGMENT_SPREAD: {
const fragName = selection.name.value;
if (
visitedFragmentNames.has(fragName) ||
!shouldIncludeNode(variableValues, selection)
) {
continue;
}
visitedFragmentNames.add(fragName);
const fragment = fragments[fragName];
if (
!fragment ||
!doesFragmentConditionMatch(schema, fragment, runtimeType)
) {
continue;
}
collectFieldsImpl(
schema,
fragments,
variableValues,
runtimeType,
fragment.selectionSet,
fields,
visitedFragmentNames,
);
break;
}
}
}
}
/**
* Determines if a field should be included based on the `@include` and `@skip`
* directives, where `@skip` has higher precedence than `@include`.
*/
function shouldIncludeNode(variableValues, node) {
const skip = (0, _values.getDirectiveValues)(
_directives.GraphQLSkipDirective,
node,
variableValues,
);
if ((skip === null || skip === void 0 ? void 0 : skip.if) === true) {
return false;
}
const include = (0, _values.getDirectiveValues)(
_directives.GraphQLIncludeDirective,
node,
variableValues,
);
if (
(include === null || include === void 0 ? void 0 : include.if) === false
) {
return false;
}
return true;
}
/**
* Determines if a fragment is applicable to the given type.
*/
function doesFragmentConditionMatch(schema, fragment, type) {
const typeConditionNode = fragment.typeCondition;
if (!typeConditionNode) {
return true;
}
const conditionalType = (0, _typeFromAST.typeFromAST)(
schema,
typeConditionNode,
);
if (conditionalType === type) {
return true;
}
if ((0, _definition.isAbstractType)(conditionalType)) {
return schema.isSubType(conditionalType, type);
}
return false;
}
/**
* Implements the logic to compute the key of a given field's entry
*/
function getFieldEntryKey(node) {
return node.alias ? node.alias.value : node.name.value;
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"mongo.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tracing/mongo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAOhF,eAAO,MAAM,eAAe;;CAS3B,CAAC;AAEF;;GAEG;AACH,wBAAgB,6BAA6B,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAGzF;AAgDD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gBAAgB,0CAAuC,CAAC"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["c","_c","Hamburger","useNav","React","NavHamburger","t0","$","baseClass","navOpen","setNavOpen","t1","t2","t3","undefined","t4","_jsx","className","onClick","tabIndex","type","children","isActive"],"sources":["../../../../src/elements/Nav/NavHamburger/index.tsx"],"sourcesContent":["'use client'\nimport { Hamburger, useNav } from '@payloadcms/ui'\nimport React from 'react'\n\n/**\n * @internal\n */\nexport const NavHamburger: React.FC<{\n baseClass?: string\n}> = ({ baseClass }) => {\n const { navOpen, setNavOpen } = useNav()\n\n return (\n <button\n className={`${baseClass}__mobile-close`}\n onClick={() => {\n setNavOpen(false)\n }}\n tabIndex={!navOpen ? -1 : undefined}\n type=\"button\"\n >\n <Hamburger isActive />\n </button>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,SAASC,SAAS,EAAEC,MAAM,QAAQ;AAClC,OAAOC,KAAA,MAAW;AAElB;;;AAGA,OAAO,MAAMC,YAAA,GAERC,EAAA;EAAA,MAAAC,CAAA,GAAAN,EAAA;EAAC;IAAAO;EAAA,IAAAF,EAAa;EACjB;IAAAG,OAAA;IAAAC;EAAA,IAAgCP,MAAA;EAIjB,MAAAQ,EAAA,MAAGH,SAAA,gBAAyB;EAAA,IAAAI,EAAA;EAAA,IAAAL,CAAA,QAAAG,UAAA;IAC9BE,EAAA,GAAAA,CAAA;MACPF,UAAA,MAAW;IAAA;IACbH,CAAA,MAAAG,UAAA;IAAAH,CAAA,MAAAK,EAAA;EAAA;IAAAA,EAAA,GAAAL,CAAA;EAAA;EACU,MAAAM,EAAA,IAACJ,OAAA,QAAAK,SAAe;EAAA,IAAAC,EAAA;EAAA,IAAAR,CAAA,QAAAI,EAAA,IAAAJ,CAAA,QAAAK,EAAA,IAAAL,CAAA,QAAAM,EAAA;IAL5BE,EAAA,GAAAC,IAAA,CAAC;MAAAC,SAAA,EACYN,EAA4B;MAAAO,OAAA,EAC9BN,EAET;MAAAO,QAAA,EACUN,EAAgB;MAAAO,IAAA,EACrB;MAAAC,QAAA,EAELL,IAAA,CAAAd,SAAA;QAAAoB,QAAA;MAAA,C;;;;;;;;;SARFP,E;CAWJ","ignoreList":[]}

View File

@@ -0,0 +1 @@
{"version":3,"file":"reducer.js","names":["defaultLoadingOverlayState","isLoading","loaders","loadingText","overlayType","reducer","state","action","loadersCopy","type","key","payload","push","index","findIndex","item","splice","nextLoader","length","Boolean"],"sources":["../../../src/elements/LoadingOverlay/reducer.ts"],"sourcesContent":["'use client'\nimport type { Action, State } from './types.js'\n\nexport const defaultLoadingOverlayState = {\n isLoading: false,\n loaders: [],\n loadingText: '',\n overlayType: null,\n}\n\nexport const reducer = (state: State, action: Action): State => {\n const loadersCopy = [...state.loaders]\n const { type = 'fullscreen', key = 'user', loadingText } = action.payload\n\n if (action.type === 'add') {\n loadersCopy.push({ type, key, loadingText })\n } else if (action.type === 'remove') {\n const index = loadersCopy.findIndex((item) => item.key === key && item.type === type)\n loadersCopy.splice(index, 1)\n }\n\n const nextLoader = loadersCopy?.length > 0 ? loadersCopy[loadersCopy.length - 1] : null\n\n return {\n isLoading: Boolean(nextLoader),\n loaders: loadersCopy,\n loadingText: nextLoader?.loadingText || state?.loadingText,\n overlayType: nextLoader?.type || state?.overlayType,\n }\n}\n"],"mappings":"AAAA;;AAGA,OAAO,MAAMA,0BAAA,GAA6B;EACxCC,SAAA,EAAW;EACXC,OAAA,EAAS,EAAE;EACXC,WAAA,EAAa;EACbC,WAAA,EAAa;AACf;AAEA,OAAO,MAAMC,OAAA,GAAUA,CAACC,KAAA,EAAcC,MAAA;EACpC,MAAMC,WAAA,GAAc,C,GAAIF,KAAA,CAAMJ,OAAO,CAAC;EACtC,MAAM;IAAEO,IAAA,GAAO,YAAY;IAAEC,GAAA,GAAM,MAAM;IAAEP;EAAW,CAAE,GAAGI,MAAA,CAAOI,OAAO;EAEzE,IAAIJ,MAAA,CAAOE,IAAI,KAAK,OAAO;IACzBD,WAAA,CAAYI,IAAI,CAAC;MAAEH,IAAA;MAAMC,GAAA;MAAKP;IAAY;EAC5C,OAAO,IAAII,MAAA,CAAOE,IAAI,KAAK,UAAU;IACnC,MAAMI,KAAA,GAAQL,WAAA,CAAYM,SAAS,CAAEC,IAAA,IAASA,IAAA,CAAKL,GAAG,KAAKA,GAAA,IAAOK,IAAA,CAAKN,IAAI,KAAKA,IAAA;IAChFD,WAAA,CAAYQ,MAAM,CAACH,KAAA,EAAO;EAC5B;EAEA,MAAMI,UAAA,GAAaT,WAAA,EAAaU,MAAA,GAAS,IAAIV,WAAW,CAACA,WAAA,CAAYU,MAAM,GAAG,EAAE,GAAG;EAEnF,OAAO;IACLjB,SAAA,EAAWkB,OAAA,CAAQF,UAAA;IACnBf,OAAA,EAASM,WAAA;IACTL,WAAA,EAAac,UAAA,EAAYd,WAAA,IAAeG,KAAA,EAAOH,WAAA;IAC/CC,WAAA,EAAaa,UAAA,EAAYR,IAAA,IAAQH,KAAA,EAAOF;EAC1C;AACF","ignoreList":[]}

View File

@@ -0,0 +1,11 @@
/**
* 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.
*
*/
'use strict'
const LexicalErrorBoundary = process.env.NODE_ENV !== 'production' ? require('./LexicalErrorBoundary.dev.js') : require('./LexicalErrorBoundary.prod.js');
module.exports = LexicalErrorBoundary;

View File

@@ -0,0 +1,15 @@
import * as _builtins from './lib/builtins';
export const builtins: typeof _builtins.builtins;
export type TypeId = _builtins.builtins;
export type TypesBuiltins = typeof _builtins.builtins;
export type TypeParser<I extends (string | Buffer), T> = (value: I) => T;
export function setTypeParser<T>(oid: number | TypeId, parseFn: TypeParser<string, T>): void;
export function setTypeParser<T>(oid: number | TypeId, format: 'text', parseFn: TypeParser<string, T>): void;
export function setTypeParser<T>(oid: number | TypeId, format: 'binary', parseFn: TypeParser<Buffer, T>): void;
export function getTypeParser<T>(oid: number | TypeId): TypeParser<string, T | string>;
export function getTypeParser<T>(oid: number | TypeId, format: 'text'): TypeParser<string, T | string>;
export function getTypeParser<T>(oid: number | TypeId, format: 'binary'): TypeParser<Buffer, T | string>;

View File

@@ -0,0 +1,24 @@
import type { MarkOptional } from 'ts-essentials';
import type { JoinField, JoinFieldClient } from '../../fields/config/types.js';
import type { FieldErrorClientComponent, FieldErrorServerComponent } from '../forms/Error.js';
import type { ClientFieldBase, FieldClientComponent, FieldPaths, FieldServerComponent, ServerFieldBase } from '../forms/Field.js';
import type { FieldDescriptionClientComponent, FieldDescriptionServerComponent, FieldDiffClientComponent, FieldDiffServerComponent, FieldLabelClientComponent, FieldLabelServerComponent } from '../types.js';
type JoinFieldClientWithoutType = MarkOptional<JoinFieldClient, 'type'>;
type JoinFieldBaseClientProps = {
readonly path: string;
};
type JoinFieldBaseServerProps = Pick<FieldPaths, 'path'>;
export type JoinFieldClientProps = ClientFieldBase<JoinFieldClientWithoutType> & JoinFieldBaseClientProps;
export type JoinFieldServerProps = JoinFieldBaseServerProps & ServerFieldBase<JoinField>;
export type JoinFieldServerComponent = FieldServerComponent<JoinField, JoinFieldClientWithoutType, JoinFieldBaseServerProps>;
export type JoinFieldClientComponent = FieldClientComponent<JoinFieldClientWithoutType, JoinFieldBaseClientProps>;
export type JoinFieldLabelServerComponent = FieldLabelServerComponent<JoinField>;
export type JoinFieldLabelClientComponent = FieldLabelClientComponent<JoinFieldClientWithoutType>;
export type JoinFieldDescriptionServerComponent = FieldDescriptionServerComponent<JoinField, JoinFieldClientWithoutType>;
export type JoinFieldDescriptionClientComponent = FieldDescriptionClientComponent<JoinFieldClientWithoutType>;
export type JoinFieldErrorServerComponent = FieldErrorServerComponent<JoinField, JoinFieldClientWithoutType>;
export type JoinFieldErrorClientComponent = FieldErrorClientComponent<JoinFieldClientWithoutType>;
export type JoinFieldDiffServerComponent = FieldDiffServerComponent<JoinField, JoinFieldClient>;
export type JoinFieldDiffClientComponent = FieldDiffClientComponent<JoinFieldClient>;
export {};
//# sourceMappingURL=Join.d.ts.map

View File

@@ -0,0 +1,6 @@
/**
* Merge two baggage headers into one, where the existing one takes precedence.
* The order of the existing baggage will be preserved, and new entries will be added to the end.
*/
export declare function mergeBaggageHeaders<Existing extends string | string[] | number | undefined>(existing: Existing, baggage: string): string | undefined | Existing;
//# sourceMappingURL=baggage.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/elements/Table/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAErC,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,cAAc,CAAA;AAIrB,MAAM,MAAM,KAAK,GAAG;IAClB,QAAQ,CAAC,UAAU,CAAC,EAAE,WAAW,GAAG,SAAS,CAAA;IAC7C,QAAQ,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;CACzC,CAAA;AAED,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAqDjC,CAAA"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"mail.js","sources":["../../../src/icons/mail.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Mail\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMjAiIGhlaWdodD0iMTYiIHg9IjIiIHk9IjQiIHJ4PSIyIiAvPgogIDxwYXRoIGQ9Im0yMiA3LTguOTcgNS43YTEuOTQgMS45NCAwIDAgMS0yLjA2IDBMMiA3IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/mail\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 Mail = createLucideIcon('Mail', [\n ['rect', { width: '20', height: '16', x: '2', y: '4', rx: '2', key: '18n3k1' }],\n ['path', { d: 'm22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7', key: '1ocrg3' }],\n]);\n\nexport default Mail;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,iBAAiB,MAAQ,CAAA,CAAA,CAAA;AAAA,CAAA,CACpC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,MAAM,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAK,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,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA6C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC5E,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1 @@
exports._default = require("./emotion-unitless.cjs.js").default;

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAO,MAAM,QAAQ,GAAG,CACtB,CAAkB,EAClB,CAAkB,EAClB,GAAW,EACX,EAAE;IACF,MAAM,EAAE,GAAG,CAAC,YAAY,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACvD,MAAM,EAAE,GAAG,CAAC,YAAY,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAEvD,MAAM,CAAC,GAAG,EAAE,KAAK,IAAI,IAAI,EAAE,IAAI,IAAI,IAAI,IAAA,aAAK,EAAC,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,CAAA;IAEzD,OAAO,CACL,CAAC,IAAI;QACH,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;QACX,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;QACT,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACvB,IAAI,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACvC,IAAI,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC;KAClC,CACF,CAAA;AACH,CAAC,CAAA;AAnBY,QAAA,QAAQ,YAmBpB;AAED,MAAM,UAAU,GAAG,CAAC,GAAW,EAAE,GAAW,EAAE,EAAE;IAC9C,MAAM,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IACxB,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;AACxB,CAAC,CAAA;AAEM,MAAM,KAAK,GAAG,CACnB,CAAS,EACT,CAAS,EACT,GAAW,EACmB,EAAE;IAChC,IAAI,IAAc,EAChB,GAAuB,EACvB,IAAY,EACZ,KAAK,GAAuB,SAAS,EACrC,MAAoC,CAAA;IACtC,IAAI,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IACvB,IAAI,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAA;IAC/B,IAAI,CAAC,GAAG,EAAE,CAAA;IAEV,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;QACtB,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YACZ,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA;QACjB,CAAC;QACD,IAAI,GAAG,EAAE,CAAA;QACT,IAAI,GAAG,GAAG,CAAC,MAAM,CAAA;QAEjB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACzB,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC;gBACb,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;gBACZ,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAA;YAC5B,CAAC;iBAAM,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC7B,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;gBACpB,IAAI,CAAC,KAAK,SAAS;oBAAE,MAAM,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;YACvC,CAAC;iBAAM,CAAC;gBACN,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;gBAChB,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,GAAG,IAAI,EAAE,CAAC;oBACpC,IAAI,GAAG,GAAG,CAAA;oBACV,KAAK,GAAG,EAAE,CAAA;gBACZ,CAAC;gBAED,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAA;YAC5B,CAAC;YAED,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;QAClC,CAAC;QAED,IAAI,IAAI,CAAC,MAAM,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACvC,MAAM,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QACxB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AA/CY,QAAA,KAAK,SA+CjB","sourcesContent":["export const balanced = (\n a: string | RegExp,\n b: string | RegExp,\n str: string,\n) => {\n const ma = a instanceof RegExp ? maybeMatch(a, str) : a\n const mb = b instanceof RegExp ? maybeMatch(b, str) : b\n\n const r = ma !== null && mb != null && range(ma, mb, str)\n\n return (\n r && {\n start: r[0],\n end: r[1],\n pre: str.slice(0, r[0]),\n body: str.slice(r[0] + ma.length, r[1]),\n post: str.slice(r[1] + mb.length),\n }\n )\n}\n\nconst maybeMatch = (reg: RegExp, str: string) => {\n const m = str.match(reg)\n return m ? m[0] : null\n}\n\nexport const range = (\n a: string,\n b: string,\n str: string,\n): undefined | [number, number] => {\n let begs: number[],\n beg: number | undefined,\n left: number,\n right: number | undefined = undefined,\n result: undefined | [number, number]\n let ai = str.indexOf(a)\n let bi = str.indexOf(b, ai + 1)\n let i = ai\n\n if (ai >= 0 && bi > 0) {\n if (a === b) {\n return [ai, bi]\n }\n begs = []\n left = str.length\n\n while (i >= 0 && !result) {\n if (i === ai) {\n begs.push(i)\n ai = str.indexOf(a, i + 1)\n } else if (begs.length === 1) {\n const r = begs.pop()\n if (r !== undefined) result = [r, bi]\n } else {\n beg = begs.pop()\n if (beg !== undefined && beg < left) {\n left = beg\n right = bi\n }\n\n bi = str.indexOf(b, i + 1)\n }\n\n i = ai < bi && ai >= 0 ? ai : bi\n }\n\n if (begs.length && right !== undefined) {\n result = [left, right]\n }\n }\n\n return result\n}\n"]}

View File

@@ -0,0 +1,56 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Natsu @xiaoxiaojx
*/
"use strict";
const RuntimeGlobals = require("../RuntimeGlobals");
const RuntimeModule = require("../RuntimeModule");
const Template = require("../Template");
/** @typedef {import("../Chunk")} Chunk */
class CssMergeStyleSheetsRuntimeModule extends RuntimeModule {
constructor() {
super("css merge stylesheets");
}
/**
* @returns {string | null} runtime code
*/
generate() {
const { runtimeTemplate } = /** @type {import("../Compilation")} */ (
this.compilation
);
return Template.asString([
`${RuntimeGlobals.cssMergeStyleSheets} = ${runtimeTemplate.basicFunction(
"sheets",
[
"var sheetsArray = Array.isArray(sheets) ? sheets : [sheets];",
"var cssTexts = [];",
"for (var i = 0; i < sheetsArray.length; i++) {",
Template.indent([
"var s = sheetsArray[i];",
"if (!s) continue;",
"if (typeof s === 'string') {",
Template.indent("cssTexts.push(s);"),
"} else if (s.cssRules) {",
Template.indent([
"var rules = s.cssRules;",
"for (var j = 0; j < rules.length; j++) {",
Template.indent("cssTexts.push(rules[j].cssText);"),
"}"
]),
"}"
]),
"}",
"return cssTexts.join('');"
]
)};`
]);
}
}
module.exports = CssMergeStyleSheetsRuntimeModule;

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/fields/baseFields/baseIDField.ts"],"sourcesContent":["import ObjectIdImport from 'bson-objectid'\n\nimport type { TextField } from '../config/types.js'\n\nconst ObjectId = 'default' in ObjectIdImport ? ObjectIdImport.default : ObjectIdImport\n\nexport const baseIDField: TextField = {\n name: 'id',\n type: 'text',\n admin: {\n hidden: true,\n },\n defaultValue: () => new ObjectId().toHexString(),\n hooks: {\n beforeChange: [({ value }) => value || new ObjectId().toHexString()],\n // ID field values for arrays and blocks need to be unique when duplicating, as on postgres they are stored on the same table as primary keys.\n beforeDuplicate: [() => new ObjectId().toHexString()],\n },\n label: 'ID',\n}\n"],"names":["ObjectIdImport","ObjectId","default","baseIDField","name","type","admin","hidden","defaultValue","toHexString","hooks","beforeChange","value","beforeDuplicate","label"],"mappings":"AAAA,OAAOA,oBAAoB,gBAAe;AAI1C,MAAMC,WAAW,aAAaD,iBAAiBA,eAAeE,OAAO,GAAGF;AAExE,OAAO,MAAMG,cAAyB;IACpCC,MAAM;IACNC,MAAM;IACNC,OAAO;QACLC,QAAQ;IACV;IACAC,cAAc,IAAM,IAAIP,WAAWQ,WAAW;IAC9CC,OAAO;QACLC,cAAc;YAAC,CAAC,EAAEC,KAAK,EAAE,GAAKA,SAAS,IAAIX,WAAWQ,WAAW;SAAG;QACpE,8IAA8I;QAC9II,iBAAiB;YAAC,IAAM,IAAIZ,WAAWQ,WAAW;SAAG;IACvD;IACAK,OAAO;AACT,EAAC"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"wrapApiHandlerWithSentryVercelCrons.d.ts","sourceRoot":"","sources":["../../../../src/common/pages-router-instrumentation/wrapApiHandlerWithSentryVercelCrons.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAOlD;;GAEG;AAEH,wBAAgB,mCAAmC,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EACnF,OAAO,EAAE,CAAC,EACV,iBAAiB,EAAE,iBAAiB,GACnC,CAAC,CA0FH"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["FieldDiffContainer","FieldDiffLabel","FolderTableCell","FolderField","getHTMLDiffComponents","_internal_renderFieldHandler","File","CheckIcon","copyDataFromLocaleHandler","getColumns","getFolderResultsComponentAndData","handleLivePreview","handlePreview","renderFilters","renderTable","resolveFilterOptions","upsertPreferences","CollectionCards"],"sources":["../../../src/exports/rsc/index.ts"],"sourcesContent":["export { FieldDiffContainer } from '../../elements/FieldDiffContainer/index.js'\nexport { FieldDiffLabel } from '../../elements/FieldDiffLabel/index.js'\nexport { FolderTableCell } from '../../elements/FolderView/Cell/index.server.js'\nexport { FolderField } from '../../elements/FolderView/FolderField/index.server.js'\nexport { getHTMLDiffComponents } from '../../elements/HTMLDiff/index.js'\nexport { _internal_renderFieldHandler } from '../../forms/fieldSchemasToFormState/serverFunctions/renderFieldServerFn.js'\nexport { File } from '../../graphics/File/index.js'\nexport { CheckIcon } from '../../icons/Check/index.js'\nexport { copyDataFromLocaleHandler } from '../../utilities/copyDataFromLocale.js'\nexport { getColumns } from '../../utilities/getColumns.js'\nexport { getFolderResultsComponentAndData } from '../../utilities/getFolderResultsComponentAndData.js'\nexport { handleLivePreview } from '../../utilities/handleLivePreview.js'\nexport { handlePreview } from '../../utilities/handlePreview.js'\nexport { renderFilters, renderTable } from '../../utilities/renderTable.js'\nexport { resolveFilterOptions } from '../../utilities/resolveFilterOptions.js'\nexport { upsertPreferences } from '../../utilities/upsertPreferences.js'\nexport { CollectionCards } from '../../widgets/CollectionCards/index.js'\n"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ;AACnC,SAASC,cAAc,QAAQ;AAC/B,SAASC,eAAe,QAAQ;AAChC,SAASC,WAAW,QAAQ;AAC5B,SAASC,qBAAqB,QAAQ;AACtC,SAASC,4BAA4B,QAAQ;AAC7C,SAASC,IAAI,QAAQ;AACrB,SAASC,SAAS,QAAQ;AAC1B,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,UAAU,QAAQ;AAC3B,SAASC,gCAAgC,QAAQ;AACjD,SAASC,iBAAiB,QAAQ;AAClC,SAASC,aAAa,QAAQ;AAC9B,SAASC,aAAa,EAAEC,WAAW,QAAQ;AAC3C,SAASC,oBAAoB,QAAQ;AACrC,SAASC,iBAAiB,QAAQ;AAClC,SAASC,eAAe,QAAQ","ignoreList":[]}

View File

@@ -0,0 +1,129 @@
/**
* prism.js Dark theme for JavaScript, CSS and HTML
* Based on the slides of the talk “/Reg(exp){2}lained/”
* @author Lea Verou
*/
code[class*="language-"],
pre[class*="language-"] {
color: white;
background: none;
text-shadow: 0 -.1em .2em black;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
font-size: 1em;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
@media print {
code[class*="language-"],
pre[class*="language-"] {
text-shadow: none;
}
}
pre[class*="language-"],
:not(pre) > code[class*="language-"] {
background: hsl(30, 20%, 25%);
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
border: .3em solid hsl(30, 20%, 40%);
border-radius: .5em;
box-shadow: 1px 1px .5em black inset;
}
/* Inline code */
:not(pre) > code[class*="language-"] {
padding: .15em .2em .05em;
border-radius: .3em;
border: .13em solid hsl(30, 20%, 40%);
box-shadow: 1px 1px .3em -.1em black inset;
white-space: normal;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: hsl(30, 20%, 50%);
}
.token.punctuation {
opacity: .7;
}
.token.namespace {
opacity: .7;
}
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol {
color: hsl(350, 40%, 70%);
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: hsl(75, 70%, 60%);
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string,
.token.variable {
color: hsl(40, 90%, 60%);
}
.token.atrule,
.token.attr-value,
.token.keyword {
color: hsl(350, 40%, 70%);
}
.token.regex,
.token.important {
color: #e90;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}
.token.deleted {
color: red;
}

View File

@@ -0,0 +1,4 @@
export declare type Coordinates = {
x: number;
y: number;
};

View File

@@ -0,0 +1,22 @@
/**
* @name endOfDecade
* @category Decade Helpers
* @summary Return the end of a decade for the given date.
*
* @description
* Return the end of a decade for the given date.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The original date
*
* @returns The end of a decade
*
* @example
* // The end of a decade for 12 May 1984 00:00:00:
* const result = endOfDecade(new Date(1984, 4, 12, 00, 00, 00))
* //=> Dec 31 1989 23:59:59.999
*/
export declare function endOfDecade<DateType extends Date>(
date: DateType | number | string,
): DateType;

View File

@@ -0,0 +1,34 @@
import type { SanitizedCollectionConfig } from '../../../collections/config/types.js';
import type { SanitizedGlobalConfig } from '../../../globals/config/types.js';
import type { RequestContext } from '../../../index.js';
import type { JsonObject, PayloadRequest } from '../../../types/index.js';
import type { Field, TabAsField } from '../../config/types.js';
type Args = {
/**
* Data of the nearest parent block. If no parent block exists, this will be the `undefined`
*/
blockData?: JsonObject;
collection: null | SanitizedCollectionConfig;
context: RequestContext;
data: JsonObject;
doc: JsonObject;
fields: (Field | TabAsField)[];
global: null | SanitizedGlobalConfig;
operation: 'create' | 'update';
parentIndexPath: string;
/**
* @todo make required in v4.0
*/
parentIsLocalized?: boolean;
parentPath: string;
parentSchemaPath: string;
previousDoc: JsonObject;
previousSiblingDoc: JsonObject;
req: PayloadRequest;
siblingData: JsonObject;
siblingDoc: JsonObject;
siblingFields?: (Field | TabAsField)[];
};
export declare const traverseFields: ({ blockData, collection, context, data, doc, fields, global, operation, parentIndexPath, parentIsLocalized, parentPath, parentSchemaPath, previousDoc, previousSiblingDoc, req, siblingData, siblingDoc, siblingFields, }: Args) => Promise<void>;
export {};
//# sourceMappingURL=traverseFields.d.ts.map

View File

@@ -0,0 +1,18 @@
// Uses custom one instead of geometry() from drizzle-orm/pg-core because it's broken on pushDevSchema
// Why?
// It tries to give us a prompt "you're about to change.. from geometry(Point) to geometry(point)"
import { customType } from 'drizzle-orm/pg-core';
import { parseEWKB } from 'drizzle-orm/pg-core/columns/postgis_extension/utils';
export const geometryColumn = (name)=>customType({
dataType () {
return `geometry(Point)`;
},
fromDriver (value) {
return parseEWKB(value);
},
toDriver (value) {
return `SRID=4326;point(${value[0]} ${value[1]})`;
}
})(name);
//# sourceMappingURL=geometryColumn.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"box-select.js","sources":["../../../src/icons/box-select.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name BoxSelect\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNSAzYTIgMiAwIDAgMC0yIDIiIC8+CiAgPHBhdGggZD0iTTE5IDNhMiAyIDAgMCAxIDIgMiIgLz4KICA8cGF0aCBkPSJNMjEgMTlhMiAyIDAgMCAxLTIgMiIgLz4KICA8cGF0aCBkPSJNNSAyMWEyIDIgMCAwIDEtMi0yIiAvPgogIDxwYXRoIGQ9Ik05IDNoMSIgLz4KICA8cGF0aCBkPSJNOSAyMWgxIiAvPgogIDxwYXRoIGQ9Ik0xNCAzaDEiIC8+CiAgPHBhdGggZD0iTTE0IDIxaDEiIC8+CiAgPHBhdGggZD0iTTMgOXYxIiAvPgogIDxwYXRoIGQ9Ik0yMSA5djEiIC8+CiAgPHBhdGggZD0iTTMgMTR2MSIgLz4KICA8cGF0aCBkPSJNMjEgMTR2MSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/box-select\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 BoxSelect = createLucideIcon('BoxSelect', [\n ['path', { d: 'M5 3a2 2 0 0 0-2 2', key: 'y57alp' }],\n ['path', { d: 'M19 3a2 2 0 0 1 2 2', key: '18rm91' }],\n ['path', { d: 'M21 19a2 2 0 0 1-2 2', key: '1j7049' }],\n ['path', { d: 'M5 21a2 2 0 0 1-2-2', key: 'sbafld' }],\n ['path', { d: 'M9 3h1', key: '1yesri' }],\n ['path', { d: 'M9 21h1', key: '15o7lz' }],\n ['path', { d: 'M14 3h1', key: '1ec4yj' }],\n ['path', { d: 'M14 21h1', key: 'v9vybs' }],\n ['path', { d: 'M3 9v1', key: '1r0deq' }],\n ['path', { d: 'M21 9v1', key: 'mxsmne' }],\n ['path', { d: 'M3 14v1', key: 'vnatye' }],\n ['path', { d: 'M21 14v1', key: '169vum' }],\n]);\n\nexport default BoxSelect;\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,CAAsB,CAAA,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,CACnD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAuB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACpD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAwB,CAAA,CAAA,CAAA,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,CACrD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAuB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACpD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACvC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,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,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACvC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,98 @@
import type { MutableRefObject } from 'react';
import type { DeepRequired } from '@dnd-kit/utilities';
import type { SyntheticListeners } from '../hooks/utilities';
import type { Collision } from '../utilities/algorithms';
import type { MeasuringConfiguration } from '../components';
import type { Coordinates, ClientRect, UniqueIdentifier } from '../types';
import type { Actions } from './actions';
import type { DroppableContainersMap } from './constructors';
export interface DraggableElement {
node: DraggableNode;
id: UniqueIdentifier;
index: number;
collection: string;
disabled: boolean;
}
declare type AnyData = Record<string, any>;
export declare type Data<T = AnyData> = T & AnyData;
export declare type DataRef<T = AnyData> = MutableRefObject<Data<T> | undefined>;
export interface DroppableContainer {
id: UniqueIdentifier;
key: UniqueIdentifier;
data: DataRef;
disabled: boolean;
node: MutableRefObject<HTMLElement | null>;
rect: MutableRefObject<ClientRect | null>;
}
export interface Active {
id: UniqueIdentifier;
data: DataRef;
rect: MutableRefObject<{
initial: ClientRect | null;
translated: ClientRect | null;
}>;
}
export interface Over {
id: UniqueIdentifier;
rect: ClientRect;
disabled: boolean;
data: DataRef;
}
export declare type DraggableNode = {
id: UniqueIdentifier;
key: UniqueIdentifier;
node: MutableRefObject<HTMLElement | null>;
activatorNode: MutableRefObject<HTMLElement | null>;
data: DataRef;
};
export declare type DraggableNodes = Map<UniqueIdentifier, DraggableNode | undefined>;
export declare type DroppableContainers = DroppableContainersMap;
export declare type RectMap = Map<UniqueIdentifier, ClientRect>;
export interface State {
droppable: {
containers: DroppableContainers;
};
draggable: {
active: UniqueIdentifier | null;
initialCoordinates: Coordinates;
nodes: DraggableNodes;
translate: Coordinates;
};
}
export interface PublicContextDescriptor {
activatorEvent: Event | null;
active: Active | null;
activeNode: HTMLElement | null;
activeNodeRect: ClientRect | null;
collisions: Collision[] | null;
containerNodeRect: ClientRect | null;
draggableNodes: DraggableNodes;
droppableContainers: DroppableContainers;
droppableRects: RectMap;
over: Over | null;
dragOverlay: {
nodeRef: MutableRefObject<HTMLElement | null>;
rect: ClientRect | null;
setRef: (element: HTMLElement | null) => void;
};
scrollableAncestors: Element[];
scrollableAncestorRects: ClientRect[];
measuringConfiguration: DeepRequired<MeasuringConfiguration>;
measureDroppableContainers(ids: UniqueIdentifier[]): void;
measuringScheduled: boolean;
windowRect: ClientRect | null;
}
export interface InternalContextDescriptor {
activatorEvent: Event | null;
activators: SyntheticListeners;
active: Active | null;
activeNodeRect: ClientRect | null;
ariaDescribedById: {
draggable: string;
};
dispatch: React.Dispatch<Actions>;
draggableNodes: DraggableNodes;
over: Over | null;
measureDroppableContainers(ids: UniqueIdentifier[]): void;
}
export {};

View File

@@ -0,0 +1,53 @@
import { constructFrom } from "./constructFrom.js";
import { startOfISOWeek } from "./startOfISOWeek.js";
import { toDate } from "./toDate.js";
/**
* The {@link getISOWeekYear} function options.
*/
/**
* @name getISOWeekYear
* @category ISO Week-Numbering Year Helpers
* @summary Get the ISO week-numbering year of the given date.
*
* @description
* Get the ISO week-numbering year of the given date,
* which always starts 3 days before the year's first Thursday.
*
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
*
* @param date - The given date
*
* @returns The ISO week-numbering year
*
* @example
* // Which ISO-week numbering year is 2 January 2005?
* const result = getISOWeekYear(new Date(2005, 0, 2))
* //=> 2004
*/
export function getISOWeekYear(date, options) {
const _date = toDate(date, options?.in);
const year = _date.getFullYear();
const fourthOfJanuaryOfNextYear = constructFrom(_date, 0);
fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);
const fourthOfJanuaryOfThisYear = constructFrom(_date, 0);
fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);
fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);
const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);
if (_date.getTime() >= startOfNextYear.getTime()) {
return year + 1;
} else if (_date.getTime() >= startOfThisYear.getTime()) {
return year;
} else {
return year - 1;
}
}
// Fallback for modularized imports:
export default getISOWeekYear;

View File

@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Context = void 0;
var logger_1 = require("./logger");
var Context = /** @class */ (function () {
function Context() {
var _this = this;
this.logger = logger_1.logger;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
this._cache = {};
this.cache = {
addImage: jest.fn().mockImplementation(function (src) {
var result = Promise.resolve();
_this._cache[src] = result;
return result;
})
};
}
return Context;
}());
exports.Context = Context;
//# sourceMappingURL=context.js.map

View File

@@ -0,0 +1,42 @@
import type { DateArg } from "./types.js";
/**
* @name isSameSecond
* @category Second Helpers
* @summary Are the given dates in the same second (and hour and day)?
*
* @description
* Are the given dates in the same second (and hour and day)?
*
* @param laterDate - The first date to check
* @param earlierDate - The second date to check
*
* @returns The dates are in the same second (and hour and day)
*
* @example
* // Are 4 September 2014 06:30:15.000 and 4 September 2014 06:30.15.500 in the same second?
* const result = isSameSecond(
* new Date(2014, 8, 4, 6, 30, 15),
* new Date(2014, 8, 4, 6, 30, 15, 500)
* )
* //=> true
*
* @example
* // Are 4 September 2014 06:00:15.000 and 4 September 2014 06:01.15.000 in the same second?
* const result = isSameSecond(
* new Date(2014, 8, 4, 6, 0, 15),
* new Date(2014, 8, 4, 6, 1, 15)
* )
* //=> false
*
* @example
* // Are 4 September 2014 06:00:15.000 and 5 September 2014 06:00.15.000 in the same second?
* const result = isSameSecond(
* new Date(2014, 8, 4, 6, 0, 15),
* new Date(2014, 8, 5, 6, 0, 15)
* )
* //=> false
*/
export declare function isSameSecond(
laterDate: DateArg<Date> & {},
earlierDate: DateArg<Date> & {},
): boolean;

View File

@@ -0,0 +1,29 @@
import { formatDistance } from "./ht/_lib/formatDistance.mjs";
import { formatLong } from "./ht/_lib/formatLong.mjs";
import { formatRelative } from "./ht/_lib/formatRelative.mjs";
import { localize } from "./ht/_lib/localize.mjs";
import { match } from "./ht/_lib/match.mjs";
/**
* @category Locales
* @summary Haitian Creole locale.
* @language Haitian Creole
* @iso-639-2 hat
* @author Rubens Mariuzzo [@rmariuzzo](https://github.com/rmariuzzo)
* @author Watson Marcelain [@watsongm24](https://github.com/watsongm24)
*/
export const ht = {
code: "ht",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 1 /* Monday */,
firstWeekContainsDate: 4,
},
};
// Fallback for modularized imports:
export default ht;

View File

@@ -0,0 +1,142 @@
var should = require("should");
var ObjectID = require("../");
describe("ObjectIDs", function() {
it("should construct with no arguments", function() {
var o = new ObjectID();
o.should.be.instanceof(ObjectID);
});
it("should have an `id` property", function() {
var o = new ObjectID();
o.should.have.property("id");
o.id.should.have.length(12);
ObjectID.isValid(o.id).should.be.ok;
});
it("should construct with a `time` argument", function() {
var time = 1414093117;
var o = new ObjectID(time);
o.should.be.instanceof(ObjectID);
o.toHexString().substr(0,8).should.eql("5449593d");
});
it("should construct with a `buffer` argument", function() {
var buffer = Buffer.from([ 84, 73, 90, 217, 76, 147, 71, 33, 237, 231, 109, 144 ]);
var o = new ObjectID(buffer);
o.should.be.instanceof(ObjectID);
o.toHexString().should.eql("54495ad94c934721ede76d90");
});
it("should not be valid with invalid buffer", function() {
var buffer = Buffer.from('hello');
ObjectID.isValid(buffer).should.not.be.ok;
});
it("should construct with a `hexString` argument", function() {
var hexString = "54495ad94c934721ede76d90";
var o = new ObjectID(hexString);
o.should.be.instanceof(ObjectID);
o.toHexString().should.eql(hexString);
});
it("should construct with a `idString` argument", function() {
var idString = "TIZÙL“G!íçm";
var o = new ObjectID(idString);
o.should.be.instanceof(ObjectID);
o.id.should.eql(idString);
});
it("should construct with `ObjectID.createFromTime(time)` and should have 0's at the end", function() {
var time = 1414093117;
var o = ObjectID.createFromTime(time);
o.should.be.instanceof(ObjectID);
o.toHexString().should.eql("5449593d0000000000000000");
});
it("should construct with `ObjectID.createFromHexString(hexString)`", function() {
var hexString = "54495ad94c934721ede76d90";
var o = ObjectID.createFromHexString(hexString);
o.should.be.instanceof(ObjectID);
o.toHexString().should.eql(hexString);
});
it("should correctly retrieve timestamp", function() {
var testDate = new Date();
var object1 = new ObjectID();
var seconds1 = Math.floor(testDate.getTime()/1000);
var seconds2 = Math.floor(object1.getTimestamp().getTime()/1000);
seconds1.should.eql(seconds2);
});
it("should validate valid hex strings", function() {
ObjectID.isValid("54495ad94c934721ede76d90").should.be.ok;
ObjectID.isValid("aaaaaaaaaaaaaaaaaaaaaaaa").should.be.ok;
ObjectID.isValid("AAAAAAAAAAAAAAAAAAAAAAAA").should.be.ok;
ObjectID.isValid("000000000000000000000000").should.be.ok;
});
it("should validate legit ObjectID objects", function() {
var o = new ObjectID();
ObjectID.isValid(o).should.be.ok;
});
it("should invalidate bad strings", function() {
ObjectID.isValid().should.not.be.ok;
ObjectID.isValid(null).should.not.be.ok;
ObjectID.isValid({}).should.not.be.ok;
ObjectID.isValid([]).should.not.be.ok;
ObjectID.isValid(true).should.not.be.ok;
ObjectID.isValid("invalid").should.not.be.ok;
ObjectID.isValid("").should.not.be.ok;
ObjectID.isValid("zzzzzzzzzzzzzzzzzzzzzzzz").should.not.be.ok;
ObjectID.isValid("54495-ad94c934721ede76d9").should.not.be.ok;
});
it("should evaluate equality with .equals()", function() {
var id1 = ObjectID();
var id2 = ObjectID(id1.toHexString());
(id1.equals(id2)).should.be.true;
});
it("should evaluate equality with via deepEqual", function() {
var id1 = ObjectID();
var id2 = ObjectID(id1.toHexString());
id1.should.eql(id2);
var id3 = ObjectID();
id1.should.not.eql(id3, "id1 is not the same as id3");
});
it("should convert to a hex string for JSON.stringify", function() {
var hexString = "54495ad94c934721ede76d90";
var o = {o:new ObjectID(hexString)};
var strngd = JSON.stringify(o);
strngd.should.eql('{"o":"54495ad94c934721ede76d90"}');
});
it("should convert to a hex string for ObjectID.toString()", function() {
var hexString = "54495ad94c934721ede76d90";
var o = new ObjectID(hexString);
o.toString().should.eql("54495ad94c934721ede76d90");
});
it("should throw and error if constructing with an invalid string", function() {
(function(){
var o = new ObjectID("tttttttttttttttttttttttt");
}).should.throw();
});
it("should not throw an error for objects without toString", function() {
var obj = Object.create({}, { toString: { value: false, writeable: false } });
obj.toString.should.not.be.ok;
ObjectID.isValid(obj).should.not.be.ok;
});
it("should use Buffer when _Buffer is undefined", function() {
var obj = { id: Buffer.from("54495ad94c934721ede76d90"), toHexString: () => "" };
ObjectID.isValid(obj).should.be.true;
});
});

View File

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

View File

@@ -0,0 +1,76 @@
{
"name": "enhanced-resolve",
"version": "5.19.0",
"description": "Offers a async require.resolve function. It's highly configurable.",
"homepage": "http://github.com/webpack/enhanced-resolve",
"repository": {
"type": "git",
"url": "git://github.com/webpack/enhanced-resolve.git"
},
"license": "MIT",
"author": "Tobias Koppers @sokra",
"main": "lib/index.js",
"browser": {
"process": "./lib/util/process-browser.js",
"module": "./lib/util/module-browser.js"
},
"types": "types.d.ts",
"files": [
"lib",
"types.d.ts",
"LICENSE"
],
"scripts": {
"prepare": "husky",
"lint": "npm run lint:code && npm run lint:types && npm run lint:types-test && npm run lint:special && npm run fmt:check && npm run lint:spellcheck",
"lint:code": "eslint --cache .",
"lint:special": "node node_modules/tooling/inherit-types && node node_modules/tooling/generate-types",
"lint:types": "tsc",
"lint:types-test": "tsc -p tsconfig.types.test.json",
"lint:spellcheck": "cspell --cache --no-must-find-files --quiet \"**/*.*\"",
"fmt": "npm run fmt:base -- --loglevel warn --write",
"fmt:check": "npm run fmt:base -- --check",
"fmt:base": "node_modules/prettier/bin/prettier.cjs --cache --ignore-unknown .",
"fix": "npm run fix:code && npm run fix:special",
"fix:code": "npm run lint:code -- --fix",
"fix:special": "node node_modules/tooling/inherit-types --write && node node_modules/tooling/generate-types --write",
"type-report": "rimraf coverage && npm run cover:types && npm run cover:report && open-cli coverage/lcov-report/index.html",
"pretest": "npm run lint",
"test": "npm run test:coverage",
"test:only": "jest",
"test:watch": "npm run test:only -- --watch",
"test:coverage": "npm run test:only -- --collectCoverageFrom=\"lib/**/*.js\" --coverage"
},
"lint-staged": {
"*.{js,cjs,mjs}": [
"eslint --cache --fix"
],
"*": [
"prettier --cache --write --ignore-unknown",
"cspell --cache --no-must-find-files"
]
},
"dependencies": {
"graceful-fs": "^4.2.4",
"tapable": "^2.3.0"
},
"devDependencies": {
"@types/graceful-fs": "^4.1.6",
"@types/jest": "^27.5.1",
"@types/node": "^24.10.4",
"cspell": "^9.4.0",
"eslint": "^9.39.2",
"eslint-config-webpack": "^4.9.0",
"husky": "^9.1.7",
"jest": "^27.5.1",
"lint-staged": "^16.2.7",
"memfs": "^3.5.3",
"prettier": "^3.7.4",
"prettier-2": "npm:prettier@^2",
"tooling": "webpack/tooling#v1.24.4",
"typescript": "^5.9.3"
},
"engines": {
"node": ">=10.13.0"
}
}

View File

@@ -0,0 +1,32 @@
import * as base64url from '../runtime/base64url.js';
import { decoder } from '../lib/buffer_utils.js';
import { JWTInvalid } from '../util/errors.js';
import jwtPayload from '../lib/jwt_claims_set.js';
import { ProduceJWT } from './produce.js';
export class UnsecuredJWT extends ProduceJWT {
encode() {
const header = base64url.encode(JSON.stringify({ alg: 'none' }));
const payload = base64url.encode(JSON.stringify(this._payload));
return `${header}.${payload}.`;
}
static decode(jwt, options) {
if (typeof jwt !== 'string') {
throw new JWTInvalid('Unsecured JWT must be a string');
}
const { 0: encodedHeader, 1: encodedPayload, 2: signature, length } = jwt.split('.');
if (length !== 3 || signature !== '') {
throw new JWTInvalid('Invalid Unsecured JWT');
}
let header;
try {
header = JSON.parse(decoder.decode(base64url.decode(encodedHeader)));
if (header.alg !== 'none')
throw new Error();
}
catch {
throw new JWTInvalid('Invalid Unsecured JWT');
}
const payload = jwtPayload(header, base64url.decode(encodedPayload), options);
return { payload, header };
}
}

View File

@@ -0,0 +1,49 @@
'use strict'
const Benchmark = require('benchmark')
const sjson = require('..')
const internals = {
text: '{ "a": 5, "b": 6, "__proto__": { "x": 7 }, "c": { "d": 0, "e": "text", "__proto__": { "y": 8 }, "f": { "g": 2 } } }',
invalid: '{ "a": 5, "b": 6, "__proto__": { "x": 7 }, "c": { "d": 0, "e": "text", "__proto__": { "y": 8 }, "f": { "g": 2 } } } }'
}
const suite = new Benchmark.Suite()
suite
.add('JSON.parse valid', () => {
JSON.parse(internals.text)
})
.add('JSON.parse error', () => {
try {
JSON.parse(internals.invalid)
} catch { }
})
.add('secure-json-parse parse', () => {
try {
sjson.parse(internals.invalid)
} catch { }
})
.add('secure-json-parse safeParse', () => {
sjson.safeParse(internals.invalid)
})
.add('reviver', () => {
try {
JSON.parse(internals.invalid, internals.reviver)
} catch { }
})
.on('cycle', (event) => {
console.log(String(event.target))
})
.on('complete', function () {
console.log('Fastest is ' + this.filter('fastest').map('name'))
})
.run({ async: true })
internals.reviver = function (key, value) {
if (key === '__proto__') {
throw new Error('kaboom')
}
return value
}

View File

@@ -0,0 +1,20 @@
var baseIndexOf = require('./_baseIndexOf');
/**
* Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
* that is not found in the character symbols.
*
* @private
* @param {Array} strSymbols The string symbols to inspect.
* @param {Array} chrSymbols The character symbols to find.
* @returns {number} Returns the index of the first unmatched string symbol.
*/
function charsStartIndex(strSymbols, chrSymbols) {
var index = -1,
length = strSymbols.length;
while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
return index;
}
module.exports = charsStartIndex;

View File

@@ -0,0 +1,85 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const core = require('@sentry/core');
const WINDOW = core.GLOBAL_OBJ ;
const INTEGRATION_NAME = 'ReportingObserver';
const SETUP_CLIENTS = new WeakMap();
const _reportingObserverIntegration = ((options = {}) => {
const types = options.types || ['crash', 'deprecation', 'intervention'];
/** Handler for the reporting observer. */
function handler(reports) {
if (!SETUP_CLIENTS.has(core.getClient() )) {
return;
}
for (const report of reports) {
core.withScope(scope => {
scope.setExtra('url', report.url);
const label = `ReportingObserver [${report.type}]`;
let details = 'No details available';
if (report.body) {
// Object.keys doesn't work on ReportBody, as all properties are inherited
const plainBody
= {};
// eslint-disable-next-line guard-for-in
for (const prop in report.body) {
plainBody[prop] = report.body[prop];
}
scope.setExtra('body', plainBody);
if (report.type === 'crash') {
const body = report.body ;
// A fancy way to create a message out of crashId OR reason OR both OR fallback
details = [body.crashId || '', body.reason || ''].join(' ').trim() || details;
} else {
const body = report.body ;
details = body.message || details;
}
}
core.captureMessage(`${label}: ${details}`);
});
}
}
return {
name: INTEGRATION_NAME,
setupOnce() {
if (!core.supportsReportingObserver()) {
return;
}
const observer = new (WINDOW ).ReportingObserver(
handler,
{
buffered: true,
types,
},
);
observer.observe();
},
setup(client) {
SETUP_CLIENTS.set(client, true);
},
};
}) ;
/**
* Reporting API integration - https://w3c.github.io/reporting/
*/
const reportingObserverIntegration = core.defineIntegration(_reportingObserverIntegration);
exports.reportingObserverIntegration = reportingObserverIntegration;
//# sourceMappingURL=reportingobserver.js.map

View File

@@ -0,0 +1 @@
module.exports={C:{"145":0.4179,"146":1.36793,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 147 148 149 3.5 3.6"},D:{"109":0.039,"120":0.039,"125":0.07522,"140":0.53213,"141":0.8358,"142":2.43218,"143":2.43218,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 114 115 116 117 118 119 121 122 123 124 126 127 128 129 130 131 132 133 134 135 136 137 138 139 144 145 146"},F:{"93":0.64635,"123":0.039,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 124 125 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"138":0.07522,"142":1.17848,"143":2.28173,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 139 140 141"},E:{_:"0 4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 13.1 14.1 15.1 15.2-15.3 15.4 15.5 15.6 16.0 16.1 16.2 16.3 16.4 16.5 17.0 17.1 17.2 17.3 17.4 17.5 18.0 18.1 18.2 18.3 18.4 26.0 26.2 26.3","16.6":0.22845,"17.6":0.039,"18.5-18.6":0.039,"26.1":0.039},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00206,"5.0-5.1":0,"6.0-6.1":0.00412,"7.0-7.1":0.00309,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.00825,"10.0-10.2":0.00103,"10.3":0.01443,"11.0-11.2":0.17731,"11.3-11.4":0.00515,"12.0-12.1":0.00412,"12.2-12.5":0.04639,"13.0-13.1":0.00103,"13.2":0.00722,"13.3":0.00206,"13.4-13.7":0.00722,"14.0-14.4":0.01443,"14.5-14.8":0.01546,"15.0-15.1":0.01649,"15.2-15.3":0.01237,"15.4":0.0134,"15.5":0.01443,"15.6-15.8":0.2237,"16.0":0.02577,"16.1":0.04948,"16.2":0.02577,"16.3":0.04639,"16.4":0.01134,"16.5":0.01959,"16.6-16.7":0.29071,"17.0":0.01649,"17.1":0.0268,"17.2":0.01959,"17.3":0.0299,"17.4":0.05051,"17.5":0.09896,"17.6-17.7":0.22886,"18.0":0.05154,"18.1":0.10721,"18.2":0.0567,"18.3":0.18453,"18.4":0.09484,"18.5-18.7":6.81,"26.0":0.13298,"26.1":1.10613,"26.2":0.2103,"26.3":0.00928},P:{"24":0.08406,"27":0.04203,"28":0.75653,"29":3.95076,_:"4 20 21 22 23 25 26 5.0-5.4 6.2-6.4 7.2-7.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0"},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0},A:{_:"6 7 8 9 10 11 5.5"},K:{"0":1.63758,_:"10 11 12 11.1 11.5 12.1"},N:{_:"10 11"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},Q:{_:"14.9"},O:{"0":0.51941},H:{"0":0},L:{"0":68.38754},R:{_:"0"},M:{_:"0"}};

View File

@@ -0,0 +1,41 @@
import type { ContextOptions, DateArg } from "./types.js";
/**
* The {@link differenceInCalendarDays} function options.
*/
export interface DifferenceInCalendarDaysOptions extends ContextOptions<Date> {}
/**
* @name differenceInCalendarDays
* @category Day Helpers
* @summary Get the number of calendar days between the given dates.
*
* @description
* Get the number of calendar days between the given dates. This means that the times are removed
* from the dates and then the difference in days is calculated.
*
* @param laterDate - The later date
* @param earlierDate - The earlier date
* @param options - The options object
*
* @returns The number of calendar days
*
* @example
* // How many calendar days are between
* // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?
* const result = differenceInCalendarDays(
* new Date(2012, 6, 2, 0, 0),
* new Date(2011, 6, 2, 23, 0)
* )
* //=> 366
* // How many calendar days are between
* // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?
* const result = differenceInCalendarDays(
* new Date(2011, 6, 3, 0, 1),
* new Date(2011, 6, 2, 23, 59)
* )
* //=> 1
*/
export declare function differenceInCalendarDays(
laterDate: DateArg<Date> & {},
earlierDate: DateArg<Date> & {},
options?: DifferenceInCalendarDaysOptions | undefined,
): number;

View File

@@ -0,0 +1,12 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import type { Transformer } from '@lexical/markdown';
export declare const DEFAULT_TRANSFORMERS: Transformer[];
export declare function MarkdownShortcutPlugin({ transformers, }: Readonly<{
transformers?: Array<Transformer>;
}>): null;

View File

@@ -0,0 +1,358 @@
/** Used to map aliases to their real names. */
exports.aliasToReal = {
// Lodash aliases.
'each': 'forEach',
'eachRight': 'forEachRight',
'entries': 'toPairs',
'entriesIn': 'toPairsIn',
'extend': 'assignIn',
'extendAll': 'assignInAll',
'extendAllWith': 'assignInAllWith',
'extendWith': 'assignInWith',
'first': 'head',
// Methods that are curried variants of others.
'conforms': 'conformsTo',
'matches': 'isMatch',
'property': 'get',
// Ramda aliases.
'__': 'placeholder',
'F': 'stubFalse',
'T': 'stubTrue',
'all': 'every',
'allPass': 'overEvery',
'always': 'constant',
'any': 'some',
'anyPass': 'overSome',
'apply': 'spread',
'assoc': 'set',
'assocPath': 'set',
'complement': 'negate',
'compose': 'flowRight',
'contains': 'includes',
'dissoc': 'unset',
'dissocPath': 'unset',
'dropLast': 'dropRight',
'dropLastWhile': 'dropRightWhile',
'equals': 'isEqual',
'identical': 'eq',
'indexBy': 'keyBy',
'init': 'initial',
'invertObj': 'invert',
'juxt': 'over',
'omitAll': 'omit',
'nAry': 'ary',
'path': 'get',
'pathEq': 'matchesProperty',
'pathOr': 'getOr',
'paths': 'at',
'pickAll': 'pick',
'pipe': 'flow',
'pluck': 'map',
'prop': 'get',
'propEq': 'matchesProperty',
'propOr': 'getOr',
'props': 'at',
'symmetricDifference': 'xor',
'symmetricDifferenceBy': 'xorBy',
'symmetricDifferenceWith': 'xorWith',
'takeLast': 'takeRight',
'takeLastWhile': 'takeRightWhile',
'unapply': 'rest',
'unnest': 'flatten',
'useWith': 'overArgs',
'where': 'conformsTo',
'whereEq': 'isMatch',
'zipObj': 'zipObject'
};
/** Used to map ary to method names. */
exports.aryMethod = {
'1': [
'assignAll', 'assignInAll', 'attempt', 'castArray', 'ceil', 'create',
'curry', 'curryRight', 'defaultsAll', 'defaultsDeepAll', 'floor', 'flow',
'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method', 'mergeAll',
'methodOf', 'mixin', 'nthArg', 'over', 'overEvery', 'overSome','rest', 'reverse',
'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd', 'trimStart',
'uniqueId', 'words', 'zipAll'
],
'2': [
'add', 'after', 'ary', 'assign', 'assignAllWith', 'assignIn', 'assignInAllWith',
'at', 'before', 'bind', 'bindAll', 'bindKey', 'chunk', 'cloneDeepWith',
'cloneWith', 'concat', 'conformsTo', 'countBy', 'curryN', 'curryRightN',
'debounce', 'defaults', 'defaultsDeep', 'defaultTo', 'delay', 'difference',
'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'eq',
'every', 'filter', 'find', 'findIndex', 'findKey', 'findLast', 'findLastIndex',
'findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth', 'forEach',
'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight', 'get',
'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf', 'intersection',
'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch', 'join', 'keyBy',
'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues', 'matchesProperty',
'maxBy', 'meanBy', 'merge', 'mergeAllWith', 'minBy', 'multiply', 'nth', 'omit',
'omitBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt', 'partial',
'partialRight', 'partition', 'pick', 'pickBy', 'propertyOf', 'pull', 'pullAll',
'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove',
'repeat', 'restFrom', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex',
'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy',
'split', 'spreadFrom', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight',
'takeRightWhile', 'takeWhile', 'tap', 'throttle', 'thru', 'times', 'trimChars',
'trimCharsEnd', 'trimCharsStart', 'truncate', 'union', 'uniqBy', 'uniqWith',
'unset', 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject',
'zipObjectDeep'
],
'3': [
'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith',
'findFrom', 'findIndexFrom', 'findLastFrom', 'findLastIndexFrom', 'getOr',
'includesFrom', 'indexOfFrom', 'inRange', 'intersectionBy', 'intersectionWith',
'invokeArgs', 'invokeArgsMap', 'isEqualWith', 'isMatchWith', 'flatMapDepth',
'lastIndexOfFrom', 'mergeWith', 'orderBy', 'padChars', 'padCharsEnd',
'padCharsStart', 'pullAllBy', 'pullAllWith', 'rangeStep', 'rangeStepRight',
'reduce', 'reduceRight', 'replace', 'set', 'slice', 'sortedIndexBy',
'sortedLastIndexBy', 'transform', 'unionBy', 'unionWith', 'update', 'xorBy',
'xorWith', 'zipWith'
],
'4': [
'fill', 'setWith', 'updateWith'
]
};
/** Used to map ary to rearg configs. */
exports.aryRearg = {
'2': [1, 0],
'3': [2, 0, 1],
'4': [3, 2, 0, 1]
};
/** Used to map method names to their iteratee ary. */
exports.iterateeAry = {
'dropRightWhile': 1,
'dropWhile': 1,
'every': 1,
'filter': 1,
'find': 1,
'findFrom': 1,
'findIndex': 1,
'findIndexFrom': 1,
'findKey': 1,
'findLast': 1,
'findLastFrom': 1,
'findLastIndex': 1,
'findLastIndexFrom': 1,
'findLastKey': 1,
'flatMap': 1,
'flatMapDeep': 1,
'flatMapDepth': 1,
'forEach': 1,
'forEachRight': 1,
'forIn': 1,
'forInRight': 1,
'forOwn': 1,
'forOwnRight': 1,
'map': 1,
'mapKeys': 1,
'mapValues': 1,
'partition': 1,
'reduce': 2,
'reduceRight': 2,
'reject': 1,
'remove': 1,
'some': 1,
'takeRightWhile': 1,
'takeWhile': 1,
'times': 1,
'transform': 2
};
/** Used to map method names to iteratee rearg configs. */
exports.iterateeRearg = {
'mapKeys': [1],
'reduceRight': [1, 0]
};
/** Used to map method names to rearg configs. */
exports.methodRearg = {
'assignInAllWith': [1, 0],
'assignInWith': [1, 2, 0],
'assignAllWith': [1, 0],
'assignWith': [1, 2, 0],
'differenceBy': [1, 2, 0],
'differenceWith': [1, 2, 0],
'getOr': [2, 1, 0],
'intersectionBy': [1, 2, 0],
'intersectionWith': [1, 2, 0],
'isEqualWith': [1, 2, 0],
'isMatchWith': [2, 1, 0],
'mergeAllWith': [1, 0],
'mergeWith': [1, 2, 0],
'padChars': [2, 1, 0],
'padCharsEnd': [2, 1, 0],
'padCharsStart': [2, 1, 0],
'pullAllBy': [2, 1, 0],
'pullAllWith': [2, 1, 0],
'rangeStep': [1, 2, 0],
'rangeStepRight': [1, 2, 0],
'setWith': [3, 1, 2, 0],
'sortedIndexBy': [2, 1, 0],
'sortedLastIndexBy': [2, 1, 0],
'unionBy': [1, 2, 0],
'unionWith': [1, 2, 0],
'updateWith': [3, 1, 2, 0],
'xorBy': [1, 2, 0],
'xorWith': [1, 2, 0],
'zipWith': [1, 2, 0]
};
/** Used to map method names to spread configs. */
exports.methodSpread = {
'assignAll': { 'start': 0 },
'assignAllWith': { 'start': 0 },
'assignInAll': { 'start': 0 },
'assignInAllWith': { 'start': 0 },
'defaultsAll': { 'start': 0 },
'defaultsDeepAll': { 'start': 0 },
'invokeArgs': { 'start': 2 },
'invokeArgsMap': { 'start': 2 },
'mergeAll': { 'start': 0 },
'mergeAllWith': { 'start': 0 },
'partial': { 'start': 1 },
'partialRight': { 'start': 1 },
'without': { 'start': 1 },
'zipAll': { 'start': 0 }
};
/** Used to identify methods which mutate arrays or objects. */
exports.mutate = {
'array': {
'fill': true,
'pull': true,
'pullAll': true,
'pullAllBy': true,
'pullAllWith': true,
'pullAt': true,
'remove': true,
'reverse': true
},
'object': {
'assign': true,
'assignAll': true,
'assignAllWith': true,
'assignIn': true,
'assignInAll': true,
'assignInAllWith': true,
'assignInWith': true,
'assignWith': true,
'defaults': true,
'defaultsAll': true,
'defaultsDeep': true,
'defaultsDeepAll': true,
'merge': true,
'mergeAll': true,
'mergeAllWith': true,
'mergeWith': true,
},
'set': {
'set': true,
'setWith': true,
'unset': true,
'update': true,
'updateWith': true
}
};
/** Used to map real names to their aliases. */
exports.realToAlias = (function() {
var hasOwnProperty = Object.prototype.hasOwnProperty,
object = exports.aliasToReal,
result = {};
for (var key in object) {
var value = object[key];
if (hasOwnProperty.call(result, value)) {
result[value].push(key);
} else {
result[value] = [key];
}
}
return result;
}());
/** Used to map method names to other names. */
exports.remap = {
'assignAll': 'assign',
'assignAllWith': 'assignWith',
'assignInAll': 'assignIn',
'assignInAllWith': 'assignInWith',
'curryN': 'curry',
'curryRightN': 'curryRight',
'defaultsAll': 'defaults',
'defaultsDeepAll': 'defaultsDeep',
'findFrom': 'find',
'findIndexFrom': 'findIndex',
'findLastFrom': 'findLast',
'findLastIndexFrom': 'findLastIndex',
'getOr': 'get',
'includesFrom': 'includes',
'indexOfFrom': 'indexOf',
'invokeArgs': 'invoke',
'invokeArgsMap': 'invokeMap',
'lastIndexOfFrom': 'lastIndexOf',
'mergeAll': 'merge',
'mergeAllWith': 'mergeWith',
'padChars': 'pad',
'padCharsEnd': 'padEnd',
'padCharsStart': 'padStart',
'propertyOf': 'get',
'rangeStep': 'range',
'rangeStepRight': 'rangeRight',
'restFrom': 'rest',
'spreadFrom': 'spread',
'trimChars': 'trim',
'trimCharsEnd': 'trimEnd',
'trimCharsStart': 'trimStart',
'zipAll': 'zip'
};
/** Used to track methods that skip fixing their arity. */
exports.skipFixed = {
'castArray': true,
'flow': true,
'flowRight': true,
'iteratee': true,
'mixin': true,
'rearg': true,
'runInContext': true
};
/** Used to track methods that skip rearranging arguments. */
exports.skipRearg = {
'add': true,
'assign': true,
'assignIn': true,
'bind': true,
'bindKey': true,
'concat': true,
'difference': true,
'divide': true,
'eq': true,
'gt': true,
'gte': true,
'isEqual': true,
'lt': true,
'lte': true,
'matchesProperty': true,
'merge': true,
'multiply': true,
'overArgs': true,
'partial': true,
'partialRight': true,
'propertyOf': true,
'random': true,
'range': true,
'rangeRight': true,
'subtract': true,
'zip': true,
'zipObject': true,
'zipObjectDeep': true
};

View File

@@ -0,0 +1,31 @@
"use strict";
exports.getTimezoneOffsetInMilliseconds = getTimezoneOffsetInMilliseconds;
var _index = require("../toDate.js");
/**
* Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
* They usually appear for dates that denote time before the timezones were introduced
* (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
* and GMT+01:00:00 after that date)
*
* Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
* which would lead to incorrect calculations.
*
* This function returns the timezone offset in milliseconds that takes seconds in account.
*/
function getTimezoneOffsetInMilliseconds(date) {
const _date = (0, _index.toDate)(date);
const utcDate = new Date(
Date.UTC(
_date.getFullYear(),
_date.getMonth(),
_date.getDate(),
_date.getHours(),
_date.getMinutes(),
_date.getSeconds(),
_date.getMilliseconds(),
),
);
utcDate.setUTCFullYear(_date.getFullYear());
return +date - +utcDate;
}

View File

@@ -0,0 +1,18 @@
export function isRowCollapsed({
collapsedPrefs,
field,
previousRow,
row
}) {
if (previousRow && 'collapsed' in previousRow) {
return previousRow.collapsed ?? false;
}
// If previousFormState is `undefined`, check preferences
if (collapsedPrefs !== undefined) {
return collapsedPrefs.includes(row.id) // Check if collapsed in preferences
;
}
// If neither exists, fallback to `field.admin.initCollapsed`
return field.admin.initCollapsed;
}
//# sourceMappingURL=isRowCollapsed.js.map

View File

@@ -0,0 +1,683 @@
/**
* The `node:zlib` module provides compression functionality implemented using
* Gzip, Deflate/Inflate, and Brotli.
*
* To access it:
*
* ```js
* import zlib from 'node:zlib';
* ```
*
* Compression and decompression are built around the Node.js
* [Streams API](https://nodejs.org/docs/latest-v22.x/api/stream.html).
*
* Compressing or decompressing a stream (such as a file) can be accomplished by
* piping the source stream through a `zlib` `Transform` stream into a destination
* stream:
*
* ```js
* import { createGzip } from 'node:zlib';
* import { pipeline } from 'node:stream';
* import {
* createReadStream,
* createWriteStream,
* } from 'node:fs';
*
* const gzip = createGzip();
* const source = createReadStream('input.txt');
* const destination = createWriteStream('input.txt.gz');
*
* pipeline(source, gzip, destination, (err) => {
* if (err) {
* console.error('An error occurred:', err);
* process.exitCode = 1;
* }
* });
*
* // Or, Promisified
*
* import { promisify } from 'node:util';
* const pipe = promisify(pipeline);
*
* async function do_gzip(input, output) {
* const gzip = createGzip();
* const source = createReadStream(input);
* const destination = createWriteStream(output);
* await pipe(source, gzip, destination);
* }
*
* do_gzip('input.txt', 'input.txt.gz')
* .catch((err) => {
* console.error('An error occurred:', err);
* process.exitCode = 1;
* });
* ```
*
* It is also possible to compress or decompress data in a single step:
*
* ```js
* import { deflate, unzip } from 'node:zlib';
*
* const input = '.................................';
* deflate(input, (err, buffer) => {
* if (err) {
* console.error('An error occurred:', err);
* process.exitCode = 1;
* }
* console.log(buffer.toString('base64'));
* });
*
* const buffer = Buffer.from('eJzT0yMAAGTvBe8=', 'base64');
* unzip(buffer, (err, buffer) => {
* if (err) {
* console.error('An error occurred:', err);
* process.exitCode = 1;
* }
* console.log(buffer.toString());
* });
*
* // Or, Promisified
*
* import { promisify } from 'node:util';
* const do_unzip = promisify(unzip);
*
* do_unzip(buffer)
* .then((buf) => console.log(buf.toString()))
* .catch((err) => {
* console.error('An error occurred:', err);
* process.exitCode = 1;
* });
* ```
* @since v0.5.8
* @see [source](https://github.com/nodejs/node/blob/v22.x/lib/zlib.js)
*/
declare module "zlib" {
import { NonSharedBuffer } from "node:buffer";
import * as stream from "node:stream";
interface ZlibOptions {
/**
* @default constants.Z_NO_FLUSH
*/
flush?: number | undefined;
/**
* @default constants.Z_FINISH
*/
finishFlush?: number | undefined;
/**
* @default 16*1024
*/
chunkSize?: number | undefined;
windowBits?: number | undefined;
level?: number | undefined; // compression only
memLevel?: number | undefined; // compression only
strategy?: number | undefined; // compression only
dictionary?: NodeJS.ArrayBufferView | ArrayBuffer | undefined; // deflate/inflate only, empty dictionary by default
/**
* If `true`, returns an object with `buffer` and `engine`.
*/
info?: boolean | undefined;
/**
* Limits output size when using convenience methods.
* @default buffer.kMaxLength
*/
maxOutputLength?: number | undefined;
}
interface BrotliOptions {
/**
* @default constants.BROTLI_OPERATION_PROCESS
*/
flush?: number | undefined;
/**
* @default constants.BROTLI_OPERATION_FINISH
*/
finishFlush?: number | undefined;
/**
* @default 16*1024
*/
chunkSize?: number | undefined;
params?:
| {
/**
* Each key is a `constants.BROTLI_*` constant.
*/
[key: number]: boolean | number;
}
| undefined;
/**
* Limits output size when using [convenience methods](https://nodejs.org/docs/latest-v22.x/api/zlib.html#convenience-methods).
* @default buffer.kMaxLength
*/
maxOutputLength?: number | undefined;
/**
* If `true`, returns an object with `buffer` and `engine`.
*/
info?: boolean | undefined;
}
interface ZstdOptions {
/**
* @default constants.ZSTD_e_continue
*/
flush?: number | undefined;
/**
* @default constants.ZSTD_e_end
*/
finishFlush?: number | undefined;
/**
* @default 16 * 1024
*/
chunkSize?: number | undefined;
/**
* Key-value object containing indexed
* [Zstd parameters](https://nodejs.org/docs/latest-v22.x/api/zlib.html#zstd-constants).
*/
params?: { [key: number]: number | boolean } | undefined;
/**
* Limits output size when using
* [convenience methods](https://nodejs.org/docs/latest-v22.x/api/zlib.html#convenience-methods).
* @default buffer.kMaxLength
*/
maxOutputLength?: number | undefined;
/**
* If `true`, returns an object with `buffer` and `engine`.
*/
info?: boolean | undefined;
/**
* Optional dictionary used to improve compression efficiency when compressing or decompressing data that
* shares common patterns with the dictionary.
* @since v22.19.0
*/
dictionary?: NodeJS.ArrayBufferView | undefined;
}
interface Zlib {
/** @deprecated Use bytesWritten instead. */
readonly bytesRead: number;
readonly bytesWritten: number;
shell?: boolean | string | undefined;
close(callback?: () => void): void;
flush(kind?: number, callback?: () => void): void;
flush(callback?: () => void): void;
}
interface ZlibParams {
params(level: number, strategy: number, callback: () => void): void;
}
interface ZlibReset {
reset(): void;
}
interface BrotliCompress extends stream.Transform, Zlib {}
interface BrotliDecompress extends stream.Transform, Zlib {}
interface Gzip extends stream.Transform, Zlib {}
interface Gunzip extends stream.Transform, Zlib {}
interface Deflate extends stream.Transform, Zlib, ZlibReset, ZlibParams {}
interface Inflate extends stream.Transform, Zlib, ZlibReset {}
interface DeflateRaw extends stream.Transform, Zlib, ZlibReset, ZlibParams {}
interface InflateRaw extends stream.Transform, Zlib, ZlibReset {}
interface Unzip extends stream.Transform, Zlib {}
/**
* @since v22.15.0
* @experimental
*/
interface ZstdCompress extends stream.Transform, Zlib {}
/**
* @since v22.15.0
* @experimental
*/
interface ZstdDecompress extends stream.Transform, Zlib {}
/**
* Computes a 32-bit [Cyclic Redundancy Check](https://en.wikipedia.org/wiki/Cyclic_redundancy_check) checksum of `data`.
* If `value` is specified, it is used as the starting value of the checksum, otherwise, 0 is used as the starting value.
* @param data When `data` is a string, it will be encoded as UTF-8 before being used for computation.
* @param value An optional starting value. It must be a 32-bit unsigned integer. @default 0
* @returns A 32-bit unsigned integer containing the checksum.
* @since v22.2.0
*/
function crc32(data: string | NodeJS.ArrayBufferView, value?: number): number;
/**
* Creates and returns a new `BrotliCompress` object.
* @since v11.7.0, v10.16.0
*/
function createBrotliCompress(options?: BrotliOptions): BrotliCompress;
/**
* Creates and returns a new `BrotliDecompress` object.
* @since v11.7.0, v10.16.0
*/
function createBrotliDecompress(options?: BrotliOptions): BrotliDecompress;
/**
* Creates and returns a new `Gzip` object.
* See `example`.
* @since v0.5.8
*/
function createGzip(options?: ZlibOptions): Gzip;
/**
* Creates and returns a new `Gunzip` object.
* @since v0.5.8
*/
function createGunzip(options?: ZlibOptions): Gunzip;
/**
* Creates and returns a new `Deflate` object.
* @since v0.5.8
*/
function createDeflate(options?: ZlibOptions): Deflate;
/**
* Creates and returns a new `Inflate` object.
* @since v0.5.8
*/
function createInflate(options?: ZlibOptions): Inflate;
/**
* Creates and returns a new `DeflateRaw` object.
*
* An upgrade of zlib from 1.2.8 to 1.2.11 changed behavior when `windowBits` is set to 8 for raw deflate streams. zlib would automatically set `windowBits` to 9 if was initially set to 8. Newer
* versions of zlib will throw an exception,
* so Node.js restored the original behavior of upgrading a value of 8 to 9,
* since passing `windowBits = 9` to zlib actually results in a compressed stream
* that effectively uses an 8-bit window only.
* @since v0.5.8
*/
function createDeflateRaw(options?: ZlibOptions): DeflateRaw;
/**
* Creates and returns a new `InflateRaw` object.
* @since v0.5.8
*/
function createInflateRaw(options?: ZlibOptions): InflateRaw;
/**
* Creates and returns a new `Unzip` object.
* @since v0.5.8
*/
function createUnzip(options?: ZlibOptions): Unzip;
/**
* Creates and returns a new `ZstdCompress` object.
* @since v22.15.0
*/
function createZstdCompress(options?: ZstdOptions): ZstdCompress;
/**
* Creates and returns a new `ZstdDecompress` object.
* @since v22.15.0
*/
function createZstdDecompress(options?: ZstdOptions): ZstdDecompress;
type InputType = string | ArrayBuffer | NodeJS.ArrayBufferView;
type CompressCallback = (error: Error | null, result: NonSharedBuffer) => void;
/**
* @since v11.7.0, v10.16.0
*/
function brotliCompress(buf: InputType, options: BrotliOptions, callback: CompressCallback): void;
function brotliCompress(buf: InputType, callback: CompressCallback): void;
namespace brotliCompress {
function __promisify__(buffer: InputType, options?: BrotliOptions): Promise<NonSharedBuffer>;
}
/**
* Compress a chunk of data with `BrotliCompress`.
* @since v11.7.0, v10.16.0
*/
function brotliCompressSync(buf: InputType, options?: BrotliOptions): NonSharedBuffer;
/**
* @since v11.7.0, v10.16.0
*/
function brotliDecompress(buf: InputType, options: BrotliOptions, callback: CompressCallback): void;
function brotliDecompress(buf: InputType, callback: CompressCallback): void;
namespace brotliDecompress {
function __promisify__(buffer: InputType, options?: BrotliOptions): Promise<NonSharedBuffer>;
}
/**
* Decompress a chunk of data with `BrotliDecompress`.
* @since v11.7.0, v10.16.0
*/
function brotliDecompressSync(buf: InputType, options?: BrotliOptions): NonSharedBuffer;
/**
* @since v0.6.0
*/
function deflate(buf: InputType, callback: CompressCallback): void;
function deflate(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
namespace deflate {
function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<NonSharedBuffer>;
}
/**
* Compress a chunk of data with `Deflate`.
* @since v0.11.12
*/
function deflateSync(buf: InputType, options?: ZlibOptions): NonSharedBuffer;
/**
* @since v0.6.0
*/
function deflateRaw(buf: InputType, callback: CompressCallback): void;
function deflateRaw(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
namespace deflateRaw {
function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<NonSharedBuffer>;
}
/**
* Compress a chunk of data with `DeflateRaw`.
* @since v0.11.12
*/
function deflateRawSync(buf: InputType, options?: ZlibOptions): NonSharedBuffer;
/**
* @since v0.6.0
*/
function gzip(buf: InputType, callback: CompressCallback): void;
function gzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
namespace gzip {
function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<NonSharedBuffer>;
}
/**
* Compress a chunk of data with `Gzip`.
* @since v0.11.12
*/
function gzipSync(buf: InputType, options?: ZlibOptions): NonSharedBuffer;
/**
* @since v0.6.0
*/
function gunzip(buf: InputType, callback: CompressCallback): void;
function gunzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
namespace gunzip {
function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<NonSharedBuffer>;
}
/**
* Decompress a chunk of data with `Gunzip`.
* @since v0.11.12
*/
function gunzipSync(buf: InputType, options?: ZlibOptions): NonSharedBuffer;
/**
* @since v0.6.0
*/
function inflate(buf: InputType, callback: CompressCallback): void;
function inflate(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
namespace inflate {
function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<NonSharedBuffer>;
}
/**
* Decompress a chunk of data with `Inflate`.
* @since v0.11.12
*/
function inflateSync(buf: InputType, options?: ZlibOptions): NonSharedBuffer;
/**
* @since v0.6.0
*/
function inflateRaw(buf: InputType, callback: CompressCallback): void;
function inflateRaw(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
namespace inflateRaw {
function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<NonSharedBuffer>;
}
/**
* Decompress a chunk of data with `InflateRaw`.
* @since v0.11.12
*/
function inflateRawSync(buf: InputType, options?: ZlibOptions): NonSharedBuffer;
/**
* @since v0.6.0
*/
function unzip(buf: InputType, callback: CompressCallback): void;
function unzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
namespace unzip {
function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<NonSharedBuffer>;
}
/**
* Decompress a chunk of data with `Unzip`.
* @since v0.11.12
*/
function unzipSync(buf: InputType, options?: ZlibOptions): NonSharedBuffer;
/**
* @since v22.15.0
* @experimental
*/
function zstdCompress(buf: InputType, callback: CompressCallback): void;
function zstdCompress(buf: InputType, options: ZstdOptions, callback: CompressCallback): void;
namespace zstdCompress {
function __promisify__(buffer: InputType, options?: ZstdOptions): Promise<NonSharedBuffer>;
}
/**
* Compress a chunk of data with `ZstdCompress`.
* @since v22.15.0
* @experimental
*/
function zstdCompressSync(buf: InputType, options?: ZstdOptions): NonSharedBuffer;
/**
* @since v22.15.0
* @experimental
*/
function zstdDecompress(buf: InputType, callback: CompressCallback): void;
function zstdDecompress(buf: InputType, options: ZstdOptions, callback: CompressCallback): void;
namespace zstdDecompress {
function __promisify__(buffer: InputType, options?: ZstdOptions): Promise<NonSharedBuffer>;
}
/**
* Decompress a chunk of data with `ZstdDecompress`.
* @since v22.15.0
* @experimental
*/
function zstdDecompressSync(buf: InputType, options?: ZstdOptions): NonSharedBuffer;
namespace constants {
const BROTLI_DECODE: number;
const BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: number;
const BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP: number;
const BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES: number;
const BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1: number;
const BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2: number;
const BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS: number;
const BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET: number;
const BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1: number;
const BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2: number;
const BROTLI_DECODER_ERROR_FORMAT_CL_SPACE: number;
const BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT: number;
const BROTLI_DECODER_ERROR_FORMAT_DICTIONARY: number;
const BROTLI_DECODER_ERROR_FORMAT_DISTANCE: number;
const BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE: number;
const BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE: number;
const BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE: number;
const BROTLI_DECODER_ERROR_FORMAT_PADDING_1: number;
const BROTLI_DECODER_ERROR_FORMAT_PADDING_2: number;
const BROTLI_DECODER_ERROR_FORMAT_RESERVED: number;
const BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET: number;
const BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME: number;
const BROTLI_DECODER_ERROR_FORMAT_TRANSFORM: number;
const BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS: number;
const BROTLI_DECODER_ERROR_INVALID_ARGUMENTS: number;
const BROTLI_DECODER_ERROR_UNREACHABLE: number;
const BROTLI_DECODER_NEEDS_MORE_INPUT: number;
const BROTLI_DECODER_NEEDS_MORE_OUTPUT: number;
const BROTLI_DECODER_NO_ERROR: number;
const BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION: number;
const BROTLI_DECODER_PARAM_LARGE_WINDOW: number;
const BROTLI_DECODER_RESULT_ERROR: number;
const BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT: number;
const BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT: number;
const BROTLI_DECODER_RESULT_SUCCESS: number;
const BROTLI_DECODER_SUCCESS: number;
const BROTLI_DEFAULT_MODE: number;
const BROTLI_DEFAULT_QUALITY: number;
const BROTLI_DEFAULT_WINDOW: number;
const BROTLI_ENCODE: number;
const BROTLI_LARGE_MAX_WINDOW_BITS: number;
const BROTLI_MAX_INPUT_BLOCK_BITS: number;
const BROTLI_MAX_QUALITY: number;
const BROTLI_MAX_WINDOW_BITS: number;
const BROTLI_MIN_INPUT_BLOCK_BITS: number;
const BROTLI_MIN_QUALITY: number;
const BROTLI_MIN_WINDOW_BITS: number;
const BROTLI_MODE_FONT: number;
const BROTLI_MODE_GENERIC: number;
const BROTLI_MODE_TEXT: number;
const BROTLI_OPERATION_EMIT_METADATA: number;
const BROTLI_OPERATION_FINISH: number;
const BROTLI_OPERATION_FLUSH: number;
const BROTLI_OPERATION_PROCESS: number;
const BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING: number;
const BROTLI_PARAM_LARGE_WINDOW: number;
const BROTLI_PARAM_LGBLOCK: number;
const BROTLI_PARAM_LGWIN: number;
const BROTLI_PARAM_MODE: number;
const BROTLI_PARAM_NDIRECT: number;
const BROTLI_PARAM_NPOSTFIX: number;
const BROTLI_PARAM_QUALITY: number;
const BROTLI_PARAM_SIZE_HINT: number;
const DEFLATE: number;
const DEFLATERAW: number;
const GUNZIP: number;
const GZIP: number;
const INFLATE: number;
const INFLATERAW: number;
const UNZIP: number;
const ZLIB_VERNUM: number;
const ZSTD_CLEVEL_DEFAULT: number;
const ZSTD_COMPRESS: number;
const ZSTD_DECOMPRESS: number;
const ZSTD_btlazy2: number;
const ZSTD_btopt: number;
const ZSTD_btultra: number;
const ZSTD_btultra2: number;
const ZSTD_c_chainLog: number;
const ZSTD_c_checksumFlag: number;
const ZSTD_c_compressionLevel: number;
const ZSTD_c_contentSizeFlag: number;
const ZSTD_c_dictIDFlag: number;
const ZSTD_c_enableLongDistanceMatching: number;
const ZSTD_c_hashLog: number;
const ZSTD_c_jobSize: number;
const ZSTD_c_ldmBucketSizeLog: number;
const ZSTD_c_ldmHashLog: number;
const ZSTD_c_ldmHashRateLog: number;
const ZSTD_c_ldmMinMatch: number;
const ZSTD_c_minMatch: number;
const ZSTD_c_nbWorkers: number;
const ZSTD_c_overlapLog: number;
const ZSTD_c_searchLog: number;
const ZSTD_c_strategy: number;
const ZSTD_c_targetLength: number;
const ZSTD_c_windowLog: number;
const ZSTD_d_windowLogMax: number;
const ZSTD_dfast: number;
const ZSTD_e_continue: number;
const ZSTD_e_end: number;
const ZSTD_e_flush: number;
const ZSTD_error_GENERIC: number;
const ZSTD_error_checksum_wrong: number;
const ZSTD_error_corruption_detected: number;
const ZSTD_error_dictionaryCreation_failed: number;
const ZSTD_error_dictionary_corrupted: number;
const ZSTD_error_dictionary_wrong: number;
const ZSTD_error_dstBuffer_null: number;
const ZSTD_error_dstSize_tooSmall: number;
const ZSTD_error_frameParameter_unsupported: number;
const ZSTD_error_frameParameter_windowTooLarge: number;
const ZSTD_error_init_missing: number;
const ZSTD_error_literals_headerWrong: number;
const ZSTD_error_maxSymbolValue_tooLarge: number;
const ZSTD_error_maxSymbolValue_tooSmall: number;
const ZSTD_error_memory_allocation: number;
const ZSTD_error_noForwardProgress_destFull: number;
const ZSTD_error_noForwardProgress_inputEmpty: number;
const ZSTD_error_no_error: number;
const ZSTD_error_parameter_combination_unsupported: number;
const ZSTD_error_parameter_outOfBound: number;
const ZSTD_error_parameter_unsupported: number;
const ZSTD_error_prefix_unknown: number;
const ZSTD_error_srcSize_wrong: number;
const ZSTD_error_stabilityCondition_notRespected: number;
const ZSTD_error_stage_wrong: number;
const ZSTD_error_tableLog_tooLarge: number;
const ZSTD_error_version_unsupported: number;
const ZSTD_error_workSpace_tooSmall: number;
const ZSTD_fast: number;
const ZSTD_greedy: number;
const ZSTD_lazy: number;
const ZSTD_lazy2: number;
const Z_BEST_COMPRESSION: number;
const Z_BEST_SPEED: number;
const Z_BLOCK: number;
const Z_BUF_ERROR: number;
const Z_DATA_ERROR: number;
const Z_DEFAULT_CHUNK: number;
const Z_DEFAULT_COMPRESSION: number;
const Z_DEFAULT_LEVEL: number;
const Z_DEFAULT_MEMLEVEL: number;
const Z_DEFAULT_STRATEGY: number;
const Z_DEFAULT_WINDOWBITS: number;
const Z_ERRNO: number;
const Z_FILTERED: number;
const Z_FINISH: number;
const Z_FIXED: number;
const Z_FULL_FLUSH: number;
const Z_HUFFMAN_ONLY: number;
const Z_MAX_CHUNK: number;
const Z_MAX_LEVEL: number;
const Z_MAX_MEMLEVEL: number;
const Z_MAX_WINDOWBITS: number;
const Z_MEM_ERROR: number;
const Z_MIN_CHUNK: number;
const Z_MIN_LEVEL: number;
const Z_MIN_MEMLEVEL: number;
const Z_MIN_WINDOWBITS: number;
const Z_NEED_DICT: number;
const Z_NO_COMPRESSION: number;
const Z_NO_FLUSH: number;
const Z_OK: number;
const Z_PARTIAL_FLUSH: number;
const Z_RLE: number;
const Z_STREAM_END: number;
const Z_STREAM_ERROR: number;
const Z_SYNC_FLUSH: number;
const Z_VERSION_ERROR: number;
}
// Allowed flush values.
/** @deprecated Use `constants.Z_NO_FLUSH` */
const Z_NO_FLUSH: number;
/** @deprecated Use `constants.Z_PARTIAL_FLUSH` */
const Z_PARTIAL_FLUSH: number;
/** @deprecated Use `constants.Z_SYNC_FLUSH` */
const Z_SYNC_FLUSH: number;
/** @deprecated Use `constants.Z_FULL_FLUSH` */
const Z_FULL_FLUSH: number;
/** @deprecated Use `constants.Z_FINISH` */
const Z_FINISH: number;
/** @deprecated Use `constants.Z_BLOCK` */
const Z_BLOCK: number;
// Return codes for the compression/decompression functions.
// Negative values are errors, positive values are used for special but normal events.
/** @deprecated Use `constants.Z_OK` */
const Z_OK: number;
/** @deprecated Use `constants.Z_STREAM_END` */
const Z_STREAM_END: number;
/** @deprecated Use `constants.Z_NEED_DICT` */
const Z_NEED_DICT: number;
/** @deprecated Use `constants.Z_ERRNO` */
const Z_ERRNO: number;
/** @deprecated Use `constants.Z_STREAM_ERROR` */
const Z_STREAM_ERROR: number;
/** @deprecated Use `constants.Z_DATA_ERROR` */
const Z_DATA_ERROR: number;
/** @deprecated Use `constants.Z_MEM_ERROR` */
const Z_MEM_ERROR: number;
/** @deprecated Use `constants.Z_BUF_ERROR` */
const Z_BUF_ERROR: number;
/** @deprecated Use `constants.Z_VERSION_ERROR` */
const Z_VERSION_ERROR: number;
// Compression levels.
/** @deprecated Use `constants.Z_NO_COMPRESSION` */
const Z_NO_COMPRESSION: number;
/** @deprecated Use `constants.Z_BEST_SPEED` */
const Z_BEST_SPEED: number;
/** @deprecated Use `constants.Z_BEST_COMPRESSION` */
const Z_BEST_COMPRESSION: number;
/** @deprecated Use `constants.Z_DEFAULT_COMPRESSION` */
const Z_DEFAULT_COMPRESSION: number;
// Compression strategy.
/** @deprecated Use `constants.Z_FILTERED` */
const Z_FILTERED: number;
/** @deprecated Use `constants.Z_HUFFMAN_ONLY` */
const Z_HUFFMAN_ONLY: number;
/** @deprecated Use `constants.Z_RLE` */
const Z_RLE: number;
/** @deprecated Use `constants.Z_FIXED` */
const Z_FIXED: number;
/** @deprecated Use `constants.Z_DEFAULT_STRATEGY` */
const Z_DEFAULT_STRATEGY: number;
/** @deprecated */
const Z_BINARY: number;
/** @deprecated */
const Z_TEXT: number;
/** @deprecated */
const Z_ASCII: number;
/** @deprecated */
const Z_UNKNOWN: number;
/** @deprecated */
const Z_DEFLATED: number;
}
declare module "node:zlib" {
export * from "zlib";
}

View File

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

View File

@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9saWIvc3RyaWN0LW9taXQvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEFueUFycmF5IH0gZnJvbSBcIi4uL2FueS1hcnJheVwiO1xuaW1wb3J0IHsgQW55UmVjb3JkIH0gZnJvbSBcIi4uL2FueS1yZWNvcmRcIjtcblxuZXhwb3J0IHR5cGUgU3RyaWN0T21pdDxUeXBlIGV4dGVuZHMgQW55UmVjb3JkLCBLZXlzIGV4dGVuZHMga2V5b2YgVHlwZT4gPSBUeXBlIGV4dGVuZHMgQW55QXJyYXlcbiAgPyBuZXZlclxuICA6IE9taXQ8VHlwZSwgS2V5cz47XG4iXX0=

View File

@@ -0,0 +1 @@
{"version":3,"file":"cache.cjs","names":[],"sources":["../../../../src/rest/commands/utils/cache.ts"],"sourcesContent":["import type { RestCommand } from '../../types.js';\n\n/**\n * Resets both the data and schema cache of Directus. This endpoint is only available to admin users.\n * @returns Nothing\n */\nexport const clearCache =\n\t<Schema>(): RestCommand<void, Schema> =>\n\t(system = false) => ({\n\t\tmethod: 'POST',\n\t\tpath: `/utils/cache/clear${system ? '?system' : ''}`,\n\t});\n"],"mappings":"AAMA,MAAa,OAEX,EAAS,MAAW,CACpB,OAAQ,OACR,KAAM,qBAAqB,EAAS,UAAY,KAChD"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"WritableStream.js","sourceRoot":"https://raw.githubusercontent.com/fb55/htmlparser2/c123610e003a1eaebc61febed01cabb6e41eb658/src/","sources":["WritableStream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAA0B,MAAM,aAAa,CAAC;AAC7D;;;GAGG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,2GAA2G;AAC3G,SAAS,QAAQ,CAAC,MAAuB,EAAE,QAAgB;IACvD,OAAO,QAAQ,KAAK,QAAQ,CAAC;AACjC,CAAC;AAED;;;;GAIG;AACH,MAAM,OAAO,cAAe,SAAQ,QAAQ;IAIxC,YAAY,GAAqB,EAAE,OAAuB;QACtD,KAAK,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC,CAAC;QAHnB,aAAQ,GAAG,IAAI,aAAa,EAAE,CAAC;QAI5C,IAAI,CAAC,OAAO,GAAG,IAAI,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC;IAEQ,MAAM,CACX,KAAsB,EACtB,QAAgB,EAChB,QAAoB;QAEpB,IAAI,CAAC,OAAO,CAAC,KAAK,CACd,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CACjE,CAAC;QACF,QAAQ,EAAE,CAAC;IACf,CAAC;IAEQ,MAAM,CAAC,QAAoB;QAChC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC;QACtC,QAAQ,EAAE,CAAC;IACf,CAAC;CACJ"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"getRequestSpanData.d.ts","sourceRoot":"","sources":["../../../src/utils/getRequestSpanData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAOlE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAIzD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,GAAG,YAAY,GAAG,OAAO,CAAC,oBAAoB,CAAC,CA0C3F"}

View File

@@ -0,0 +1,90 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const { DEFAULTS } = require("../config/defaults");
const {
compareModulesByPreOrderIndexOrIdentifier
} = require("../util/comparators");
const createSchemaValidation = require("../util/create-schema-validation");
const createHash = require("../util/createHash");
const {
getFullModuleName,
getUsedModuleIdsAndModules
} = require("./IdHelpers");
/** @typedef {import("../../declarations/plugins/ids/HashedModuleIdsPlugin").HashedModuleIdsPluginOptions} HashedModuleIdsPluginOptions */
/** @typedef {import("../Compiler")} Compiler */
const validate = createSchemaValidation(
require("../../schemas/plugins/ids/HashedModuleIdsPlugin.check"),
() => require("../../schemas/plugins/ids/HashedModuleIdsPlugin.json"),
{
name: "Hashed Module Ids Plugin",
baseDataPath: "options"
}
);
const PLUGIN_NAME = "HashedModuleIdsPlugin";
class HashedModuleIdsPlugin {
/**
* @param {HashedModuleIdsPluginOptions=} options options object
*/
constructor(options = {}) {
validate(options);
/** @type {Required<Omit<HashedModuleIdsPluginOptions, "context">> & { context?: string | undefined }} */
this.options = {
context: undefined,
hashFunction: DEFAULTS.HASH_FUNCTION,
hashDigest: "base64",
hashDigestLength: 4,
...options
};
}
/**
* Apply the plugin
* @param {Compiler} compiler the compiler instance
* @returns {void}
*/
apply(compiler) {
const options = this.options;
compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
compilation.hooks.moduleIds.tap(PLUGIN_NAME, () => {
const chunkGraph = compilation.chunkGraph;
const context = this.options.context
? this.options.context
: compiler.context;
const [usedIds, modules] = getUsedModuleIdsAndModules(compilation);
const modulesInNaturalOrder = modules.sort(
compareModulesByPreOrderIndexOrIdentifier(compilation.moduleGraph)
);
for (const module of modulesInNaturalOrder) {
const ident = getFullModuleName(module, context, compiler.root);
const hash = createHash(
/** @type {NonNullable<HashedModuleIdsPluginOptions["hashFunction"]>} */ (
options.hashFunction
)
);
hash.update(ident || "");
const hashId = hash.digest(options.hashDigest);
let len = options.hashDigestLength;
while (usedIds.has(hashId.slice(0, len))) {
/** @type {number} */ (len)++;
}
const moduleId = hashId.slice(0, len);
chunkGraph.setModuleId(module, moduleId);
usedIds.add(moduleId);
}
});
});
}
}
module.exports = HashedModuleIdsPlugin;

View File

@@ -0,0 +1,26 @@
"use strict";
exports.previousFriday = previousFriday;
var _index = require("./previousDay.js");
/**
* @name previousFriday
* @category Weekday Helpers
* @summary When is the previous Friday?
*
* @description
* When is the previous 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 previous Friday
*
* @example
* // When is the previous Friday before Jun, 19, 2021?
* const result = previousFriday(new Date(2021, 5, 19))
* //=> Fri June 18 2021 00:00:00
*/
function previousFriday(date) {
return (0, _index.previousDay)(date, 5);
}

View File

@@ -0,0 +1,9 @@
import { IPropertyIdentValueDescriptor } from '../IPropertyDescriptor';
export declare const enum FLOAT {
NONE = 0,
LEFT = 1,
RIGHT = 2,
INLINE_START = 3,
INLINE_END = 4
}
export declare const float: IPropertyIdentValueDescriptor<FLOAT>;

View File

@@ -0,0 +1,28 @@
/**
* 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.
*
* @flow strict
*/
import type {BaseSelection, EditorState, LexicalEditor} from 'lexical';
export type HistoryStateEntry = {
editor: LexicalEditor,
editorState: EditorState,
undoSelection?: BaseSelection | null,
};
export type HistoryState = {
current: null | HistoryStateEntry,
redoStack: Array<HistoryStateEntry>,
undoStack: Array<HistoryStateEntry>,
};
declare export function HistoryPlugin({
externalHistoryState?: HistoryState,
}): React.Node;
declare export function createEmptyHistoryState(): HistoryState;

View File

@@ -0,0 +1,3 @@
import type { GenerateViewMetadata } from '../Root/index.js';
export declare const generateAccountViewMetadata: GenerateViewMetadata;
//# sourceMappingURL=metadata.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/utilities/getTranslatedLabel.ts"],"sourcesContent":["import { getTranslation, type I18n } from '@payloadcms/translations'\n\nimport type { LabelFunction, StaticLabel } from '../config/types.js'\n\nexport const getTranslatedLabel = (\n label: LabelFunction | StaticLabel | undefined,\n i18n?: I18n,\n): string | undefined => {\n if (typeof label === 'function') {\n return label({ i18n: i18n!, t: i18n!.t })\n }\n\n if (typeof label === 'object') {\n return getTranslation(label, i18n!)\n }\n\n return label\n}\n"],"names":["getTranslation","getTranslatedLabel","label","i18n","t"],"mappings":"AAAA,SAASA,cAAc,QAAmB,2BAA0B;AAIpE,OAAO,MAAMC,qBAAqB,CAChCC,OACAC;IAEA,IAAI,OAAOD,UAAU,YAAY;QAC/B,OAAOA,MAAM;YAAEC,MAAMA;YAAOC,GAAGD,KAAMC,CAAC;QAAC;IACzC;IAEA,IAAI,OAAOF,UAAU,UAAU;QAC7B,OAAOF,eAAeE,OAAOC;IAC/B;IAEA,OAAOD;AACT,EAAC"}

View File

@@ -0,0 +1,10 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const dynamicDefaults_1 = __importDefault(require("../definitions/dynamicDefaults"));
const dynamicDefaults = (ajv) => ajv.addKeyword((0, dynamicDefaults_1.default)());
exports.default = dynamicDefaults;
module.exports = dynamicDefaults;
//# sourceMappingURL=dynamicDefaults.js.map

View File

@@ -0,0 +1,19 @@
import { ShimWrapped } from './types';
/**
* function to execute patched function and being able to catch errors
* @param execute - function to be executed
* @param onFinish - callback to run when execute finishes
*/
export declare function safeExecuteInTheMiddle<T>(execute: () => T, onFinish: (e: Error | undefined, result: T | undefined) => void, preventThrowingError?: boolean): T;
/**
* Async function to execute patched function and being able to catch errors
* @param execute - function to be executed
* @param onFinish - callback to run when execute finishes
*/
export declare function safeExecuteInTheMiddleAsync<T>(execute: () => T, onFinish: (e: Error | undefined, result: T | undefined) => void, preventThrowingError?: boolean): Promise<T>;
/**
* Checks if certain function has been already wrapped
* @param func
*/
export declare function isWrapped(func: unknown): func is ShimWrapped;
//# sourceMappingURL=utils.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"hard-drive.js","sources":["../../../src/icons/hard-drive.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name HardDrive\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8bGluZSB4MT0iMjIiIHgyPSIyIiB5MT0iMTIiIHkyPSIxMiIgLz4KICA8cGF0aCBkPSJNNS40NSA1LjExIDIgMTJ2NmEyIDIgMCAwIDAgMiAyaDE2YTIgMiAwIDAgMCAyLTJ2LTZsLTMuNDUtNi44OUEyIDIgMCAwIDAgMTYuNzYgNEg3LjI0YTIgMiAwIDAgMC0xLjc5IDEuMTF6IiAvPgogIDxsaW5lIHgxPSI2IiB4Mj0iNi4wMSIgeTE9IjE2IiB5Mj0iMTYiIC8+CiAgPGxpbmUgeDE9IjEwIiB4Mj0iMTAuMDEiIHkxPSIxNiIgeTI9IjE2IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/hard-drive\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 HardDrive = createLucideIcon('HardDrive', [\n ['line', { x1: '22', x2: '2', y1: '12', y2: '12', key: '1y58io' }],\n [\n 'path',\n {\n d: 'M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z',\n key: 'oot6mr',\n },\n ],\n ['line', { x1: '6', x2: '6.01', y1: '16', y2: '16', key: 'sgf278' }],\n ['line', { x1: '10', x2: '10.01', y1: '16', y2: '16', key: '1l4acy' }],\n]);\n\nexport default HardDrive;\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,CAC9C,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACjE,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACnE,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACvE,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,239 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const attributes = require('../attributes.js');
const carrier = require('../carrier.js');
const currentScopes = require('../currentScopes.js');
const debugBuild = require('../debug-build.js');
const debugLogger = require('../utils/debug-logger.js');
const scopeData = require('../utils/scopeData.js');
const spanOnScope = require('../utils/spanOnScope.js');
const time = require('../utils/time.js');
const traceInfo = require('../utils/trace-info.js');
const envelope = require('./envelope.js');
const MAX_METRIC_BUFFER_SIZE = 1000;
/**
* Sets a metric attribute if the value exists and the attribute key is not already present.
*
* @param metricAttributes - The metric attributes object to modify.
* @param key - The attribute key to set.
* @param value - The value to set (only sets if truthy and key not present).
* @param setEvenIfPresent - Whether to set the attribute if it is present. Defaults to true.
*/
function setMetricAttribute(
metricAttributes,
key,
value,
setEvenIfPresent = true,
) {
if (value && (setEvenIfPresent || !(key in metricAttributes))) {
metricAttributes[key] = value;
}
}
/**
* Captures a serialized metric event and adds it to the metric buffer for the given client.
*
* @param client - A client. Uses the current client if not provided.
* @param serializedMetric - The serialized metric event to capture.
*
* @experimental This method will experience breaking changes. This is not yet part of
* the stable Sentry SDK API and can be changed or removed without warning.
*/
function _INTERNAL_captureSerializedMetric(client, serializedMetric) {
const bufferMap = _getBufferMap();
const metricBuffer = _INTERNAL_getMetricBuffer(client);
if (metricBuffer === undefined) {
bufferMap.set(client, [serializedMetric]);
} else {
if (metricBuffer.length >= MAX_METRIC_BUFFER_SIZE) {
_INTERNAL_flushMetricsBuffer(client, metricBuffer);
bufferMap.set(client, [serializedMetric]);
} else {
bufferMap.set(client, [...metricBuffer, serializedMetric]);
}
}
}
/**
* Options for capturing a metric internally.
*/
/**
* Enriches metric with all contextual attributes (user, SDK metadata, replay, etc.)
*/
function _enrichMetricAttributes(beforeMetric, client, user) {
const { release, environment } = client.getOptions();
const processedMetricAttributes = {
...beforeMetric.attributes,
};
// Add user attributes
setMetricAttribute(processedMetricAttributes, 'user.id', user.id, false);
setMetricAttribute(processedMetricAttributes, 'user.email', user.email, false);
setMetricAttribute(processedMetricAttributes, 'user.name', user.username, false);
// Add Sentry metadata
setMetricAttribute(processedMetricAttributes, 'sentry.release', release);
setMetricAttribute(processedMetricAttributes, 'sentry.environment', environment);
// Add SDK metadata
const { name, version } = client.getSdkMetadata()?.sdk ?? {};
setMetricAttribute(processedMetricAttributes, 'sentry.sdk.name', name);
setMetricAttribute(processedMetricAttributes, 'sentry.sdk.version', version);
// Add replay metadata
const replay = client.getIntegrationByName
('Replay');
const replayId = replay?.getReplayId(true);
setMetricAttribute(processedMetricAttributes, 'sentry.replay_id', replayId);
if (replayId && replay?.getRecordingMode() === 'buffer') {
setMetricAttribute(processedMetricAttributes, 'sentry._internal.replay_is_buffering', true);
}
return {
...beforeMetric,
attributes: processedMetricAttributes,
};
}
/**
* Creates a serialized metric ready to be sent to Sentry.
*/
function _buildSerializedMetric(
metric,
client,
currentScope,
scopeAttributes,
) {
// Get trace context
const [, traceContext] = traceInfo._getTraceInfoFromScope(client, currentScope);
const span = spanOnScope._getSpanForScope(currentScope);
const traceId = span ? span.spanContext().traceId : traceContext?.trace_id;
const spanId = span ? span.spanContext().spanId : undefined;
return {
timestamp: time.timestampInSeconds(),
trace_id: traceId ?? '',
span_id: spanId,
name: metric.name,
type: metric.type,
unit: metric.unit,
value: metric.value,
attributes: {
...attributes.serializeAttributes(scopeAttributes),
...attributes.serializeAttributes(metric.attributes, 'skip-undefined'),
},
};
}
/**
* Captures a metric event and sends it to Sentry.
*
* @param metric - The metric event to capture.
* @param options - Options for capturing the metric.
*
* @experimental This method will experience breaking changes. This is not yet part of
* the stable Sentry SDK API and can be changed or removed without warning.
*/
function _INTERNAL_captureMetric(beforeMetric, options) {
const currentScope = options?.scope ?? currentScopes.getCurrentScope();
const captureSerializedMetric = options?.captureSerializedMetric ?? _INTERNAL_captureSerializedMetric;
const client = currentScope?.getClient() ?? currentScopes.getClient();
if (!client) {
debugBuild.DEBUG_BUILD && debugLogger.debug.warn('No client available to capture metric.');
return;
}
const { _experiments, enableMetrics, beforeSendMetric } = client.getOptions();
// todo(v11): Remove the experimental flag
// eslint-disable-next-line deprecation/deprecation
const metricsEnabled = enableMetrics ?? _experiments?.enableMetrics ?? true;
if (!metricsEnabled) {
debugBuild.DEBUG_BUILD && debugLogger.debug.warn('metrics option not enabled, metric will not be captured.');
return;
}
// Enrich metric with contextual attributes
const { user, attributes: scopeAttributes } = scopeData.getCombinedScopeData(currentScopes.getIsolationScope(), currentScope);
const enrichedMetric = _enrichMetricAttributes(beforeMetric, client, user);
client.emit('processMetric', enrichedMetric);
// todo(v11): Remove the experimental `beforeSendMetric`
// eslint-disable-next-line deprecation/deprecation
const beforeSendCallback = beforeSendMetric || _experiments?.beforeSendMetric;
const processedMetric = beforeSendCallback ? beforeSendCallback(enrichedMetric) : enrichedMetric;
if (!processedMetric) {
debugBuild.DEBUG_BUILD && debugLogger.debug.log('`beforeSendMetric` returned `null`, will not send metric.');
return;
}
const serializedMetric = _buildSerializedMetric(processedMetric, client, currentScope, scopeAttributes);
debugBuild.DEBUG_BUILD && debugLogger.debug.log('[Metric]', serializedMetric);
captureSerializedMetric(client, serializedMetric);
client.emit('afterCaptureMetric', processedMetric);
}
/**
* Flushes the metrics buffer to Sentry.
*
* @param client - A client.
* @param maybeMetricBuffer - A metric buffer. Uses the metric buffer for the given client if not provided.
*
* @experimental This method will experience breaking changes. This is not yet part of
* the stable Sentry SDK API and can be changed or removed without warning.
*/
function _INTERNAL_flushMetricsBuffer(client, maybeMetricBuffer) {
const metricBuffer = maybeMetricBuffer ?? _INTERNAL_getMetricBuffer(client) ?? [];
if (metricBuffer.length === 0) {
return;
}
const clientOptions = client.getOptions();
const envelope$1 = envelope.createMetricEnvelope(metricBuffer, clientOptions._metadata, clientOptions.tunnel, client.getDsn());
// Clear the metric buffer after envelopes have been constructed.
_getBufferMap().set(client, []);
client.emit('flushMetrics');
// sendEnvelope should not throw
// eslint-disable-next-line @typescript-eslint/no-floating-promises
client.sendEnvelope(envelope$1);
}
/**
* Returns the metric buffer for a given client.
*
* Exported for testing purposes.
*
* @param client - The client to get the metric buffer for.
* @returns The metric buffer for the given client.
*/
function _INTERNAL_getMetricBuffer(client) {
return _getBufferMap().get(client);
}
function _getBufferMap() {
// The reference to the Client <> MetricBuffer map is stored on the carrier to ensure it's always the same
return carrier.getGlobalSingleton('clientToMetricBufferMap', () => new WeakMap());
}
exports._INTERNAL_captureMetric = _INTERNAL_captureMetric;
exports._INTERNAL_captureSerializedMetric = _INTERNAL_captureSerializedMetric;
exports._INTERNAL_flushMetricsBuffer = _INTERNAL_flushMetricsBuffer;
exports._INTERNAL_getMetricBuffer = _INTERNAL_getMetricBuffer;
//# sourceMappingURL=internal.js.map

View File

@@ -0,0 +1,31 @@
import build, { OnUnknown } from "../../index";
import { expectType } from "tsd";
import { Transform } from "stream";
/**
* If enablePipelining is set to true, the function passed as an argument
* must return a transform. The unknown event should be listened to on the
* stream passed in the first argument.
*/
expectType<Transform>(build((source) => source, { enablePipelining: true }));
/**
* If expectPinoConfig is set with enablePipelining, build returns a promise
*/
expectType<(Promise<Transform>)>(build((source) => source, { enablePipelining: true, expectPinoConfig: true }));
/**
* If enablePipelining is not set the unknown event can be listened to on
* the returned stream.
*/
expectType<Transform & OnUnknown>(build((source) => {}));
/**
* If expectPinoConfig is set, build returns a promise
*/
expectType<(Promise<Transform & OnUnknown>)>(build((source) => {}, { expectPinoConfig: true }));
/**
* build also accepts an async function
*/
expectType<Transform & OnUnknown>(build(async (source) => {}));

View File

@@ -0,0 +1 @@
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/browser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACzC,eAAO,MAAM,MAAM,EAAE,CACnB,EAAE,EAAE,OAAO,EACX,IAAI,EAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,KAC3B,MAAM,IAAqB,CAAA;AAChC,eAAO,MAAM,IAAI,YAAW,CAAA;AAC5B,eAAO,MAAM,MAAM,YAAW,CAAA"}

View File

@@ -0,0 +1,4 @@
import type { DocumentViewClientProps } from 'payload';
import React from 'react';
export declare const EditView: React.FC<DocumentViewClientProps>;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,6 @@
import type { AdminViewServerProps } from 'payload';
import React from 'react';
import './index.scss';
export declare const loginBaseClass = "login";
export declare function LoginView({ initPageResult, params, searchParams }: AdminViewServerProps): React.JSX.Element;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,9 @@
class Feature {
constructor(node) {
this.isMounted = false;
this.node = node;
}
update() { }
}
export { Feature };

View File

@@ -0,0 +1,43 @@
import type { ContextOptions, DateArg } from "./types.js";
/**
* The {@link eachWeekendOfMonth} function options.
*/
export interface EachWeekendOfMonthOptions<DateType extends Date = Date>
extends ContextOptions<DateType> {}
/**
* @name eachWeekendOfMonth
* @category Month Helpers
* @summary List all the Saturdays and Sundays in the given month.
*
* @description
* Get all the Saturdays and Sundays in the given month.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The given month
* @param options - An object with options
*
* @returns An array containing all the Saturdays and Sundays
*
* @example
* // Lists all Saturdays and Sundays in the given month
* const result = eachWeekendOfMonth(new Date(2022, 1, 1))
* //=> [
* // Sat Feb 05 2022 00:00:00,
* // Sun Feb 06 2022 00:00:00,
* // Sat Feb 12 2022 00:00:00,
* // Sun Feb 13 2022 00:00:00,
* // Sat Feb 19 2022 00:00:00,
* // Sun Feb 20 2022 00:00:00,
* // Sat Feb 26 2022 00:00:00,
* // Sun Feb 27 2022 00:00:00
* // ]
*/
export declare function eachWeekendOfMonth<
DateType extends Date,
ResultDate extends Date = DateType,
>(
date: DateArg<DateType>,
options?: EachWeekendOfMonthOptions<ResultDate>,
): ResultDate[];

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/utilities/escapeSQLValue.ts"],"sourcesContent":["import { APIError } from 'payload'\n\nexport const SAFE_STRING_REGEX = /^[\\w @.\\-+:]*$/\n\nexport const escapeSQLValue = (value: unknown): boolean | null | number | string => {\n if (value === null) {\n return null\n }\n\n if (typeof value === 'number' || typeof value === 'boolean') {\n return value\n }\n\n if (typeof value !== 'string') {\n throw new Error('Invalid value type')\n }\n\n if (!SAFE_STRING_REGEX.test(value)) {\n throw new APIError(`${value} is not allowed as a JSON query value`, 400)\n }\n\n const escaped = value.replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"')\n\n return escaped\n}\n"],"names":["APIError","SAFE_STRING_REGEX","escapeSQLValue","value","Error","test","escaped","replace"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,UAAS;AAElC,OAAO,MAAMC,oBAAoB,iBAAgB;AAEjD,OAAO,MAAMC,iBAAiB,CAACC;IAC7B,IAAIA,UAAU,MAAM;QAClB,OAAO;IACT;IAEA,IAAI,OAAOA,UAAU,YAAY,OAAOA,UAAU,WAAW;QAC3D,OAAOA;IACT;IAEA,IAAI,OAAOA,UAAU,UAAU;QAC7B,MAAM,IAAIC,MAAM;IAClB;IAEA,IAAI,CAACH,kBAAkBI,IAAI,CAACF,QAAQ;QAClC,MAAM,IAAIH,SAAS,GAAGG,MAAM,qCAAqC,CAAC,EAAE;IACtE;IAEA,MAAMG,UAAUH,MAAMI,OAAO,CAAC,OAAO,QAAQA,OAAO,CAAC,MAAM;IAE3D,OAAOD;AACT,EAAC"}

View File

@@ -0,0 +1,100 @@
/**
PostgreSQL builtin type OIDs
DO NOT EDIT THIS FILE BY HAND!
This file is generated automatically by the generator in generator/generate.js
To modify the types, edit the generator script and run: npm run generate
Generated by querying PostgreSQL 11, 14 to ensure comprehensive
type coverage for parsing.
Query used:
SELECT json_object_agg(UPPER(PT.typname), PT.oid::int4 ORDER BY pt.oid)
FROM pg_type PT
WHERE typnamespace = (SELECT pgn.oid FROM pg_namespace pgn WHERE nspname = 'pg_catalog') -- Take only builting Postgres types with stable OID (extension types are not guaranted to be stable)
AND typtype IN ('b', 'r', 'm') -- Only basic (b), range (r), and multirange (m) types
AND typelem = 0 -- Ignore aliases
AND typisdefined -- Ignore undefined types
*/
module.exports = {
BOOL: 16,
BYTEA: 17,
CHAR: 18,
INT8: 20,
INT2: 21,
INT4: 23,
REGPROC: 24,
TEXT: 25,
OID: 26,
TID: 27,
XID: 28,
CID: 29,
JSON: 114,
XML: 142,
PG_NODE_TREE: 194,
SMGR: 210,
PATH: 602,
POLYGON: 604,
CIDR: 650,
FLOAT4: 700,
FLOAT8: 701,
ABSTIME: 702,
RELTIME: 703,
TINTERVAL: 704,
CIRCLE: 718,
MACADDR8: 774,
MONEY: 790,
MACADDR: 829,
INET: 869,
ACLITEM: 1033,
BPCHAR: 1042,
VARCHAR: 1043,
DATE: 1082,
TIME: 1083,
TIMESTAMP: 1114,
TIMESTAMPTZ: 1184,
INTERVAL: 1186,
TIMETZ: 1266,
BIT: 1560,
VARBIT: 1562,
NUMERIC: 1700,
REFCURSOR: 1790,
REGPROCEDURE: 2202,
REGOPER: 2203,
REGOPERATOR: 2204,
REGCLASS: 2205,
REGTYPE: 2206,
UUID: 2950,
TXID_SNAPSHOT: 2970,
PG_LSN: 3220,
PG_NDISTINCT: 3361,
PG_DEPENDENCIES: 3402,
TSVECTOR: 3614,
TSQUERY: 3615,
GTSVECTOR: 3642,
REGCONFIG: 3734,
REGDICTIONARY: 3769,
JSONB: 3802,
INT4RANGE: 3904,
NUMRANGE: 3906,
TSRANGE: 3908,
TSTZRANGE: 3910,
DATERANGE: 3912,
INT8RANGE: 3926,
JSONPATH: 4072,
REGNAMESPACE: 4089,
REGROLE: 4096,
REGCOLLATION: 4191,
INT4MULTIRANGE: 4451,
NUMMULTIRANGE: 4532,
TSMULTIRANGE: 4533,
TSTZMULTIRANGE: 4534,
DATEMULTIRANGE: 4535,
INT8MULTIRANGE: 4536,
PG_BRIN_BLOOM_SUMMARY: 4600,
PG_BRIN_MINMAX_MULTI_SUMMARY: 4601,
PG_MCV_LIST: 5017,
PG_SNAPSHOT: 5038,
XID8: 5069
}

View File

@@ -0,0 +1,28 @@
import { toDate } from "./toDate.mjs";
/**
* @name isWeekend
* @category Weekday Helpers
* @summary Does the given date fall on a weekend?
*
* @description
* Does the given date fall on a weekend?
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The date to check
*
* @returns The date falls on a weekend
*
* @example
* // Does 5 October 2014 fall on a weekend?
* const result = isWeekend(new Date(2014, 9, 5))
* //=> true
*/
export function isWeekend(date) {
const day = toDate(date).getDay();
return day === 0 || day === 6;
}
// Fallback for modularized imports:
export default isWeekend;

View File

@@ -0,0 +1,215 @@
'use client';
import { jsx as _jsx } from "react/jsx-runtime";
import { useSearchParams } from 'next/navigation.js';
import * as qs from 'qs-esm';
import React, { createContext, use, useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { parseSearchParams } from '../../utilities/parseSearchParams.js';
import { useAuth } from '../Auth/index.js';
import { useListQuery } from '../ListQuery/index.js';
import { useLocale } from '../Locale/index.js';
export var SelectAllStatus = /*#__PURE__*/function (SelectAllStatus) {
SelectAllStatus["AllAvailable"] = "allAvailable";
SelectAllStatus["AllInPage"] = "allInPage";
SelectAllStatus["None"] = "none";
SelectAllStatus["Some"] = "some";
return SelectAllStatus;
}({});
const Context = /*#__PURE__*/createContext({
count: undefined,
getQueryParams: additionalParams => '',
getSelectedIds: () => [],
selectAll: undefined,
selected: new Map(),
selectedIDs: [],
setSelection: id => {},
toggleAll: toggleAll => {},
totalDocs: undefined
});
const reduceActiveSelections = selected => {
const ids = [];
for (const [key, value] of selected) {
if (value) {
ids.push(key);
}
}
return ids;
};
export const SelectionProvider = ({
children,
docs = [],
totalDocs
}) => {
const contextRef = useRef({});
const {
user
} = useAuth();
const {
code: locale
} = useLocale();
const [selected, setSelected] = useState(() => {
const rows = new Map();
docs.forEach(({
id
}) => {
rows.set(id, false);
});
return rows;
});
const [selectAll, setSelectAll] = useState("none");
const [count, setCount] = useState(0);
const searchParams = useSearchParams();
const {
query
} = useListQuery();
const toggleAll = useCallback((allAvailable = false) => {
const rows_0 = new Map();
if (allAvailable) {
setSelectAll("allAvailable");
docs.forEach(({
id: id_0,
_isLocked,
_userEditing
}) => {
if (!_isLocked || _userEditing?.id === user?.id) {
rows_0.set(id_0, true);
}
});
} else if (
// Reset back to `None` if we previously had any type of selection
selectAll === "allAvailable" || selectAll === "allInPage") {
setSelectAll("none");
} else {
const shouldSelect = selectAll !== "some";
docs.forEach(({
id: id_1,
_isLocked: _isLocked_0,
_userEditing: _userEditing_0
}) => {
if (!_isLocked_0 || _userEditing_0?.id === user?.id) {
rows_0.set(id_1, shouldSelect);
}
});
// Set selectAll synchronously to avoid race conditions with useEffect
if (shouldSelect && rows_0.size > 0) {
if (rows_0.size === docs.length) {
setSelectAll("allInPage");
} else {
setSelectAll("some");
}
} else {
setSelectAll("none");
}
}
setSelected(rows_0);
}, [docs, selectAll, user?.id]);
const setSelection = useCallback(id_2 => {
const doc_0 = docs.find(doc => doc.id === id_2);
if (doc_0?._isLocked && user?.id !== doc_0?._userEditing.id) {
return; // Prevent selection if the document is locked
}
const existingValue = selected.get(id_2);
const isSelected = typeof existingValue === 'boolean' ? !existingValue : true;
const newMap = new Map(selected.set(id_2, isSelected));
// If previously selected all and now deselecting, adjust status
if (selectAll === "allAvailable" && !isSelected) {
setSelectAll("some");
}
setSelected(newMap);
}, [selected, docs, selectAll, user?.id]);
const getQueryParams = useCallback(additionalWhereParams => {
let where;
if (selectAll === "allAvailable") {
const params = parseSearchParams(searchParams)?.where;
where = params || {
id: {
not_equals: ''
}
};
} else {
const ids = [];
for (const [key, value] of selected) {
if (value) {
ids.push(key);
}
}
where = {
id: {
in: ids
}
};
}
if (additionalWhereParams) {
where = {
and: [{
...additionalWhereParams
}, where]
};
}
return qs.stringify({
locale,
where
}, {
addQueryPrefix: true
});
}, [selectAll, selected, locale, searchParams]);
const getSelectedIds = useCallback(() => reduceActiveSelections(selected), [selected]);
useEffect(() => {
if (selectAll === "allAvailable") {
return;
}
let some = false;
let all = true;
if (!selected.size) {
all = false;
some = false;
} else {
for (const [_, value_0] of selected) {
all = all && value_0;
some = some || value_0;
}
}
if (all && selected.size === docs.length) {
setSelectAll("allInPage");
} else if (some) {
setSelectAll("some");
} else {
setSelectAll("none");
}
}, [selectAll, selected, totalDocs, docs]);
useEffect(() => {
let newCount = 0;
if (selectAll === "allAvailable") {
newCount = totalDocs;
} else {
for (const [__0, value_1] of selected) {
if (value_1) {
newCount++;
}
}
}
setCount(newCount);
}, [selectAll, selected, totalDocs]);
useEffect(() => {
setSelectAll("none");
setSelected(new Map());
}, [query]);
const selectedIDs = useMemo(() => reduceActiveSelections(selected), [selected]);
contextRef.current = {
count,
getQueryParams,
getSelectedIds,
selectAll,
selected,
selectedIDs,
setSelection,
toggleAll,
totalDocs
};
return /*#__PURE__*/_jsx(Context, {
value: contextRef.current,
children: children
});
};
export const useSelection = () => use(Context);
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,56 @@
import { Client } from '../client';
import { CaptureContext, ScopeContext } from '../scope';
import { Scope } from '../scope';
import { Event, EventHint } from '../types-hoist/event';
import { ClientOptions } from '../types-hoist/options';
import { StackParser } from '../types-hoist/stacktrace';
/**
* This type makes sure that we get either a CaptureContext, OR an EventHint.
* It does not allow mixing them, which could lead to unexpected outcomes, e.g. this is disallowed:
* { user: { id: '123' }, mechanism: { handled: false } }
*/
export type ExclusiveEventHintOrCaptureContext = (CaptureContext & Partial<{
[key in keyof EventHint]: never;
}>) | (EventHint & Partial<{
[key in keyof ScopeContext]: never;
}>);
/**
* Adds common information to events.
*
* The information includes release and environment from `options`,
* breadcrumbs and context (extra, tags and user) from the scope.
*
* Information that is already present in the event is never overwritten. For
* nested objects, such as the context, keys are merged.
*
* @param event The original event.
* @param hint May contain additional information about the original exception.
* @param scope A scope containing event metadata.
* @returns A new event with more information.
* @hidden
*/
export declare function prepareEvent(options: ClientOptions, event: Event, hint: EventHint, scope?: Scope, client?: Client, isolationScope?: Scope): PromiseLike<Event | null>;
/**
* Enhances event using the client configuration.
* It takes care of all "static" values like environment, release and `dist`,
* as well as truncating overly long values.
*
* Only exported for tests.
*
* @param event event instance to be enhanced
*/
export declare function applyClientOptions(event: Event, options: ClientOptions): void;
/**
* Puts debug IDs into the stack frames of an error event.
*/
export declare function applyDebugIds(event: Event, stackParser: StackParser): void;
/**
* Moves debug IDs from the stack frames of an error event into the debug_meta field.
*/
export declare function applyDebugMeta(event: Event): void;
/**
* Parse either an `EventHint` directly, or convert a `CaptureContext` to an `EventHint`.
* This is used to allow to update method signatures that used to accept a `CaptureContext` but should now accept an `EventHint`.
*/
export declare function parseEventHintOrCaptureContext(hint: ExclusiveEventHintOrCaptureContext | undefined): EventHint | undefined;
//# sourceMappingURL=prepareEvent.d.ts.map

View File

@@ -0,0 +1,41 @@
"use strict";
exports.formatLong = void 0;
var _index = require("../../_lib/buildFormatLongFn.js");
const dateFormats = {
full: "yねんMがつdにちEEEE",
long: "yねんMがつdにち",
medium: "y/MM/dd",
short: "y/MM/dd",
};
const timeFormats = {
full: "Hじmmふんssびょう zzzz",
long: "H:mm:ss z",
medium: "H:mm:ss",
short: "H:mm",
};
const dateTimeFormats = {
full: "{{date}} {{time}}",
long: "{{date}} {{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 @@
{"version":3,"names":["_gensync","data","require","_index","_index2","_rewriteStackTrace","transformFromAstRunner","gensync","ast","code","opts","config","loadConfig","Error","run","transformFromAst","exports","optsOrCallback","maybeCallback","callback","undefined","beginHiddenCallStack","sync","errback","transformFromAstSync","args","transformFromAstAsync","async"],"sources":["../src/transform-ast.ts"],"sourcesContent":["import gensync, { type Handler } from \"gensync\";\n\nimport loadConfig from \"./config/index.ts\";\nimport type { InputOptions, ResolvedConfig } from \"./config/index.ts\";\nimport { run } from \"./transformation/index.ts\";\nimport type * as t from \"@babel/types\";\n\nimport { beginHiddenCallStack } from \"./errors/rewrite-stack-trace.ts\";\n\nimport type { FileResult, FileResultCallback } from \"./transformation/index.ts\";\ntype AstRoot = t.File | t.Program;\n\ntype TransformFromAst = {\n (ast: AstRoot, code: string, callback: FileResultCallback): void;\n (\n ast: AstRoot,\n code: string,\n opts: InputOptions | undefined | null,\n callback: FileResultCallback,\n ): void;\n (ast: AstRoot, code: string, opts?: InputOptions | null): FileResult | null;\n};\n\nconst transformFromAstRunner = gensync(function* (\n ast: AstRoot,\n code: string,\n opts: InputOptions | undefined | null,\n): Handler<FileResult | null> {\n const config: ResolvedConfig | null = yield* loadConfig(opts);\n if (config === null) return null;\n\n if (!ast) throw new Error(\"No AST given\");\n\n return yield* run(config, code, ast);\n});\n\nexport const transformFromAst: TransformFromAst = function transformFromAst(\n ast,\n code,\n optsOrCallback?: InputOptions | null | undefined | FileResultCallback,\n maybeCallback?: FileResultCallback,\n) {\n let opts: InputOptions | undefined | null;\n let callback: FileResultCallback | undefined;\n if (typeof optsOrCallback === \"function\") {\n callback = optsOrCallback;\n opts = undefined;\n } else {\n opts = optsOrCallback;\n callback = maybeCallback;\n }\n\n if (callback === undefined) {\n if (process.env.BABEL_8_BREAKING) {\n throw new Error(\n \"Starting from Babel 8.0.0, the 'transformFromAst' function expects a callback. If you need to call it synchronously, please use 'transformFromAstSync'.\",\n );\n } else {\n // console.warn(\n // \"Starting from Babel 8.0.0, the 'transformFromAst' function will expect a callback. If you need to call it synchronously, please use 'transformFromAstSync'.\",\n // );\n return beginHiddenCallStack(transformFromAstRunner.sync)(ast, code, opts);\n }\n }\n\n beginHiddenCallStack(transformFromAstRunner.errback)(\n ast,\n code,\n opts,\n callback,\n );\n};\n\nexport function transformFromAstSync(\n ...args: Parameters<typeof transformFromAstRunner.sync>\n) {\n return beginHiddenCallStack(transformFromAstRunner.sync)(...args);\n}\n\nexport function transformFromAstAsync(\n ...args: Parameters<typeof transformFromAstRunner.async>\n) {\n return beginHiddenCallStack(transformFromAstRunner.async)(...args);\n}\n"],"mappings":";;;;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,IAAAE,MAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AAGA,IAAAG,kBAAA,GAAAH,OAAA;AAgBA,MAAMI,sBAAsB,GAAGC,SAAMA,CAAC,CAAC,WACrCC,GAAY,EACZC,IAAY,EACZC,IAAqC,EACT;EAC5B,MAAMC,MAA6B,GAAG,OAAO,IAAAC,cAAU,EAACF,IAAI,CAAC;EAC7D,IAAIC,MAAM,KAAK,IAAI,EAAE,OAAO,IAAI;EAEhC,IAAI,CAACH,GAAG,EAAE,MAAM,IAAIK,KAAK,CAAC,cAAc,CAAC;EAEzC,OAAO,OAAO,IAAAC,WAAG,EAACH,MAAM,EAAEF,IAAI,EAAED,GAAG,CAAC;AACtC,CAAC,CAAC;AAEK,MAAMO,gBAAkC,GAAAC,OAAA,CAAAD,gBAAA,GAAG,SAASA,gBAAgBA,CACzEP,GAAG,EACHC,IAAI,EACJQ,cAAqE,EACrEC,aAAkC,EAClC;EACA,IAAIR,IAAqC;EACzC,IAAIS,QAAwC;EAC5C,IAAI,OAAOF,cAAc,KAAK,UAAU,EAAE;IACxCE,QAAQ,GAAGF,cAAc;IACzBP,IAAI,GAAGU,SAAS;EAClB,CAAC,MAAM;IACLV,IAAI,GAAGO,cAAc;IACrBE,QAAQ,GAAGD,aAAa;EAC1B;EAEA,IAAIC,QAAQ,KAAKC,SAAS,EAAE;IASxB,OAAO,IAAAC,uCAAoB,EAACf,sBAAsB,CAACgB,IAAI,CAAC,CAACd,GAAG,EAAEC,IAAI,EAAEC,IAAI,CAAC;EAE7E;EAEA,IAAAW,uCAAoB,EAACf,sBAAsB,CAACiB,OAAO,CAAC,CAClDf,GAAG,EACHC,IAAI,EACJC,IAAI,EACJS,QACF,CAAC;AACH,CAAC;AAEM,SAASK,oBAAoBA,CAClC,GAAGC,IAAoD,EACvD;EACA,OAAO,IAAAJ,uCAAoB,EAACf,sBAAsB,CAACgB,IAAI,CAAC,CAAC,GAAGG,IAAI,CAAC;AACnE;AAEO,SAASC,qBAAqBA,CACnC,GAAGD,IAAqD,EACxD;EACA,OAAO,IAAAJ,uCAAoB,EAACf,sBAAsB,CAACqB,KAAK,CAAC,CAAC,GAAGF,IAAI,CAAC;AACpE;AAAC","ignoreList":[]}

View File

@@ -0,0 +1,15 @@
import { useRef } from 'react';
import { useIsomorphicLayoutEffect } from './use-isomorphic-effect.mjs';
function useIsMounted() {
const isMounted = useRef(false);
useIsomorphicLayoutEffect(() => {
isMounted.current = true;
return () => {
isMounted.current = false;
};
}, []);
return isMounted;
}
export { useIsMounted };

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/og/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAc7C,eAAO,MAAM,OAAO,WAAW,CAAA;AAE/B,eAAO,MAAM,WAAW,cAAc,CAAA;AAEtC,eAAO,MAAM,eAAe,EAAE,cA8D7B,CAAA"}

View File

@@ -0,0 +1,69 @@
'use client';
import { c as _c } from "react/compiler-runtime";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import React, { useState } from 'react';
import { LockIcon } from '../../icons/Lock/index.js';
import { useTranslation } from '../../providers/Translation/index.js';
import { isClientUserObject } from '../../utilities/isClientUserObject.js';
import { Tooltip } from '../Tooltip/index.js';
import './index.scss';
const baseClass = 'locked';
export const Locked = t0 => {
const $ = _c(8);
const {
className,
user
} = t0;
const [hovered, setHovered] = useState(false);
const {
t
} = useTranslation();
const userToUse = isClientUserObject(user) ? user.email ?? user.id : t("general:anotherUser");
let t1;
if ($[0] !== className) {
t1 = [baseClass, className].filter(Boolean);
$[0] = className;
$[1] = t1;
} else {
t1 = $[1];
}
const t2 = t1.join(" ");
let t3;
let t4;
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
t3 = () => setHovered(true);
t4 = () => setHovered(false);
$[2] = t3;
$[3] = t4;
} else {
t3 = $[2];
t4 = $[3];
}
const t5 = `${userToUse} ${t("general:isEditing")}`;
let t6;
if ($[4] !== hovered || $[5] !== t2 || $[6] !== t5) {
t6 = _jsxs("div", {
className: t2,
onMouseEnter: t3,
onMouseLeave: t4,
role: "button",
tabIndex: 0,
children: [_jsx(Tooltip, {
alignCaret: "left",
className: `${baseClass}__tooltip`,
position: "top",
show: hovered,
children: t5
}), _jsx(LockIcon, {})]
});
$[4] = hovered;
$[5] = t2;
$[6] = t5;
$[7] = t6;
} else {
t6 = $[7];
}
return t6;
};
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,9 @@
export { default as v1 } from './v1.js';
export { default as v3 } from './v3.js';
export { default as v4 } from './v4.js';
export { default as v5 } from './v5.js';
export { default as NIL } from './nil.js';
export { default as version } from './version.js';
export { default as validate } from './validate.js';
export { default as stringify } from './stringify.js';
export { default as parse } from './parse.js';

View File

@@ -0,0 +1,22 @@
import { Bench } from 'tinybench'
import { nonSimpleDomain } from '../lib/utils.js'
const benchNonSimpleDomain = new Bench({ name: 'nonSimpleDomain' })
const exampleCom = 'example.com'
const exaumlmpleCom = 'exämple.com'
const longDomain = 'abc'.repeat(100) + '.com'
console.assert(nonSimpleDomain(exampleCom) === false, 'example.com should be a simple domain')
console.assert(nonSimpleDomain(exaumlmpleCom) === true, 'exämple.com should not be a simple domain')
console.assert(nonSimpleDomain(longDomain) === false, `${longDomain} should be a simple domain?`)
benchNonSimpleDomain.add('nonSimpleDomain', function () {
nonSimpleDomain(exampleCom)
nonSimpleDomain(exaumlmpleCom)
nonSimpleDomain(longDomain)
})
await benchNonSimpleDomain.run()
console.log(benchNonSimpleDomain.name)
console.table(benchNonSimpleDomain.table())

View File

@@ -0,0 +1,26 @@
"use strict";
exports.FractionOfSecondParser = void 0;
var _Parser = require("../Parser.cjs");
var _utils = require("../utils.cjs");
class FractionOfSecondParser extends _Parser.Parser {
priority = 30;
parse(dateString, token) {
const valueCallback = (value) =>
Math.trunc(value * Math.pow(10, -token.length + 3));
return (0, _utils.mapValue)(
(0, _utils.parseNDigits)(token.length, dateString),
valueCallback,
);
}
set(date, _flags, value) {
date.setMilliseconds(value);
return date;
}
incompatibleTokens = ["t", "T"];
}
exports.FractionOfSecondParser = FractionOfSecondParser;

View File

@@ -0,0 +1,37 @@
import { SQL } from "../index.cjs";
import { Subquery } from "../subquery.cjs";
import type { Check } from "./checks.cjs";
import type { ForeignKey } from "./foreign-keys.cjs";
import type { Index } from "./indexes.cjs";
import type { PrimaryKey } from "./primary-keys.cjs";
import type { IndexForHint } from "./query-builders/select.cjs";
import { MySqlTable } from "./table.cjs";
import { type UniqueConstraint } from "./unique-constraint.cjs";
import type { MySqlViewBase } from "./view-base.cjs";
import type { MySqlView } from "./view.cjs";
export declare function extractUsedTable(table: MySqlTable | Subquery | MySqlViewBase | SQL): string[];
export declare function getTableConfig(table: MySqlTable): {
columns: import("./index.ts").MySqlColumn<import("../index.ts").ColumnBaseConfig<import("../index.ts").ColumnDataType, string>, {}, {}>[];
indexes: Index[];
foreignKeys: ForeignKey[];
checks: Check[];
primaryKeys: PrimaryKey[];
uniqueConstraints: UniqueConstraint[];
name: string;
schema: string | undefined;
baseName: string;
};
export declare function getViewConfig<TName extends string = string, TExisting extends boolean = boolean>(view: MySqlView<TName, TExisting>): {
algorithm?: "undefined" | "merge" | "temptable";
sqlSecurity?: "definer" | "invoker";
withCheckOption?: "cascaded" | "local";
name: TName;
originalName: TName;
schema: string | undefined;
selectedFields: import("../index.ts").ColumnsSelection;
isExisting: TExisting;
query: TExisting extends true ? undefined : SQL<unknown>;
isAlias: boolean;
};
export declare function convertIndexToString(indexes: IndexForHint[]): string[];
export declare function toArray<T>(value: T | T[]): T[];

View File

@@ -0,0 +1 @@
{"version":3,"file":"table.js","sources":["../../../src/icons/table.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Table\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgM3YxOCIgLz4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjMiIHJ4PSIyIiAvPgogIDxwYXRoIGQ9Ik0zIDloMTgiIC8+CiAgPHBhdGggZD0iTTMgMTVoMTgiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/table\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 Table = createLucideIcon('Table', [\n ['path', { d: 'M12 3v18', key: '108xh3' }],\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2', key: 'afitv7' }],\n ['path', { d: 'M3 9h18', key: '1pudct' }],\n ['path', { d: 'M3 15h18', key: '5xshup' }],\n]);\n\nexport default Table;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,iBAAiB,OAAS,CAAA,CAAA,CAAA;AAAA,CAAA,CACtC,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,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,MAAM,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAK,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,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,419 @@
'use strict'
const fs = require('fs')
const path = require('path')
const SonicBoom = require('../')
const { file, runTests } = require('./helper')
const proxyquire = require('proxyquire')
runTests(buildTests)
function buildTests (test, sync) {
// Reset the unmask for testing
process.umask(0o000)
test('append', (t) => {
t.plan(4)
const dest = file()
fs.writeFileSync(dest, 'hello world\n')
const stream = new SonicBoom({ dest, append: false, sync })
stream.on('ready', () => {
t.pass('ready emitted')
})
t.ok(stream.write('something else\n'))
stream.flush()
stream.on('drain', () => {
fs.readFile(dest, 'utf8', (err, data) => {
t.error(err)
t.equal(data, 'something else\n')
stream.end()
})
})
})
test('mkdir', (t) => {
t.plan(4)
const dest = path.join(file(), 'out.log')
const stream = new SonicBoom({ dest, mkdir: true, sync })
stream.on('ready', () => {
t.pass('ready emitted')
})
t.ok(stream.write('hello world\n'))
stream.flush()
stream.on('drain', () => {
fs.readFile(dest, 'utf8', (err, data) => {
t.error(err)
t.equal(data, 'hello world\n')
stream.end()
})
})
})
test('flush', (t) => {
t.plan(5)
const dest = file()
const fd = fs.openSync(dest, 'w')
const stream = new SonicBoom({ fd, minLength: 4096, sync })
stream.on('ready', () => {
t.pass('ready emitted')
})
t.ok(stream.write('hello world\n'))
t.ok(stream.write('something else\n'))
stream.flush()
stream.on('drain', () => {
fs.readFile(dest, 'utf8', (err, data) => {
t.error(err)
t.equal(data, 'hello world\nsomething else\n')
stream.end()
})
})
})
test('flush with no data', (t) => {
t.plan(2)
const dest = file()
const fd = fs.openSync(dest, 'w')
const stream = new SonicBoom({ fd, minLength: 4096, sync })
stream.on('ready', () => {
t.pass('ready emitted')
})
stream.flush()
stream.on('drain', () => {
t.pass('drain emitted')
})
})
test('call flush cb after flushed', (t) => {
t.plan(4)
const dest = file()
const fd = fs.openSync(dest, 'w')
const stream = new SonicBoom({ fd, minLength: 4096, sync })
stream.on('ready', () => {
t.pass('ready emitted')
})
t.ok(stream.write('hello world\n'))
t.ok(stream.write('something else\n'))
stream.flush((err) => {
if (err) t.fail(err)
else t.pass('flush cb called')
})
})
test('only call fsyncSync and not fsync when fsync: true', (t) => {
t.plan(6)
const fakeFs = Object.create(fs)
const SonicBoom = proxyquire('../', {
fs: fakeFs
})
const dest = file()
const fd = fs.openSync(dest, 'w')
const stream = new SonicBoom({
fd,
sync,
fsync: true,
minLength: 4096
})
stream.on('ready', () => {
t.pass('ready emitted')
})
fakeFs.fsync = function (fd, cb) {
t.fail('fake fs.fsync called while should not')
cb()
}
fakeFs.fsyncSync = function (fd) {
t.pass('fake fsyncSync called')
}
function successOnAsyncOrSyncFn (isSync, originalFn) {
return function (...args) {
t.pass(`fake fs.${originalFn.name} called`)
fakeFs[originalFn.name] = originalFn
return fakeFs[originalFn.name](...args)
}
}
if (sync) {
fakeFs.writeSync = successOnAsyncOrSyncFn(true, fs.writeSync)
} else {
fakeFs.write = successOnAsyncOrSyncFn(false, fs.write)
}
t.ok(stream.write('hello world\n'))
stream.flush((err) => {
if (err) t.fail(err)
else t.pass('flush cb called')
process.nextTick(() => {
// to make sure fsync is not called as well
t.pass('nextTick after flush called')
})
})
})
test('call flush cb with error when fsync failed', (t) => {
t.plan(5)
const fakeFs = Object.create(fs)
const SonicBoom = proxyquire('../', {
fs: fakeFs
})
const dest = file()
const fd = fs.openSync(dest, 'w')
const stream = new SonicBoom({
fd,
sync,
minLength: 4096
})
stream.on('ready', () => {
t.pass('ready emitted')
})
const err = new Error('other')
err.code = 'other'
function onFsyncOnFsyncSync (isSync, originalFn) {
return function (...args) {
Error.captureStackTrace(err)
t.pass(`fake fs.${originalFn.name} called`)
fakeFs[originalFn.name] = originalFn
const cb = args[args.length - 1]
cb(err)
}
}
// only one is called depends on sync
fakeFs.fsync = onFsyncOnFsyncSync(false, fs.fsync)
function successOnAsyncOrSyncFn (isSync, originalFn) {
return function (...args) {
t.pass(`fake fs.${originalFn.name} called`)
fakeFs[originalFn.name] = originalFn
return fakeFs[originalFn.name](...args)
}
}
if (sync) {
fakeFs.writeSync = successOnAsyncOrSyncFn(true, fs.writeSync)
} else {
fakeFs.write = successOnAsyncOrSyncFn(false, fs.write)
}
t.ok(stream.write('hello world\n'))
stream.flush((err) => {
if (err) t.equal(err.code, 'other')
else t.fail('flush cb called without an error')
})
})
test('call flush cb even when have no data', (t) => {
t.plan(2)
const dest = file()
const fd = fs.openSync(dest, 'w')
const stream = new SonicBoom({ fd, minLength: 4096, sync })
stream.on('ready', () => {
t.pass('ready emitted')
stream.flush((err) => {
if (err) t.fail(err)
else t.pass('flush cb called')
})
})
})
test('call flush cb even when minLength is 0', (t) => {
t.plan(1)
const dest = file()
const fd = fs.openSync(dest, 'w')
const stream = new SonicBoom({ fd, minLength: 0, sync })
stream.flush((err) => {
if (err) t.fail(err)
else t.pass('flush cb called')
})
})
test('call flush cb with an error when trying to flush destroyed stream', (t) => {
t.plan(1)
const dest = file()
const fd = fs.openSync(dest, 'w')
const stream = new SonicBoom({ fd, minLength: 4096, sync })
stream.destroy()
stream.flush((err) => {
if (err) t.pass(err)
else t.fail('flush cb called without an error')
})
})
test('call flush cb with an error when failed to flush', (t) => {
t.plan(5)
const fakeFs = Object.create(fs)
const SonicBoom = proxyquire('../', {
fs: fakeFs
})
const dest = file()
const fd = fs.openSync(dest, 'w')
const stream = new SonicBoom({
fd,
sync,
minLength: 4096
})
stream.on('ready', () => {
t.pass('ready emitted')
})
const err = new Error('other')
err.code = 'other'
function onWriteOrWriteSync (isSync, originalFn) {
return function (...args) {
Error.captureStackTrace(err)
t.pass(`fake fs.${originalFn.name} called`)
fakeFs[originalFn.name] = originalFn
if (isSync) throw err
const cb = args[args.length - 1]
cb(err)
}
}
// only one is called depends on sync
fakeFs.write = onWriteOrWriteSync(false, fs.write)
fakeFs.writeSync = onWriteOrWriteSync(true, fs.writeSync)
t.ok(stream.write('hello world\n'))
stream.flush((err) => {
if (err) t.equal(err.code, 'other')
else t.fail('flush cb called without an error')
})
stream.end()
stream.on('close', () => {
t.pass('close emitted')
})
})
test('call flush cb when finish writing when currently in the middle', (t) => {
t.plan(4)
const fakeFs = Object.create(fs)
const SonicBoom = proxyquire('../', {
fs: fakeFs
})
const dest = file()
const fd = fs.openSync(dest, 'w')
const stream = new SonicBoom({
fd,
sync,
// to trigger write without calling flush
minLength: 1
})
stream.on('ready', () => {
t.pass('ready emitted')
})
function onWriteOrWriteSync (originalFn) {
return function (...args) {
stream.flush((err) => {
if (err) t.fail(err)
else t.pass('flush cb called')
})
t.pass(`fake fs.${originalFn.name} called`)
fakeFs[originalFn.name] = originalFn
return originalFn(...args)
}
}
// only one is called depends on sync
fakeFs.write = onWriteOrWriteSync(fs.write)
fakeFs.writeSync = onWriteOrWriteSync(fs.writeSync)
t.ok(stream.write('hello world\n'))
})
test('call flush cb when writing and trying to flush before ready (on async)', (t) => {
t.plan(4)
const fakeFs = Object.create(fs)
const SonicBoom = proxyquire('../', {
fs: fakeFs
})
fakeFs.open = fsOpen
const dest = file()
const stream = new SonicBoom({
fd: dest,
// only async as sync is part of the constructor so the user will not be able to call write/flush
// before ready
sync: false,
// to not trigger write without calling flush
minLength: 4096
})
stream.on('ready', () => {
t.pass('ready emitted')
})
function fsOpen (...args) {
process.nextTick(() => {
// try writing and flushing before ready and in the middle of opening
t.pass('fake fs.open called')
t.ok(stream.write('hello world\n'))
// calling flush
stream.flush((err) => {
if (err) t.fail(err)
else t.pass('flush cb called')
})
fakeFs.open = fs.open
fs.open(...args)
})
}
})
}

View File

@@ -0,0 +1,29 @@
'use strict'
const { UndiciError } = require('../core/errors')
const kMockNotMatchedError = Symbol.for('undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED')
/**
* The request does not match any registered mock dispatches.
*/
class MockNotMatchedError extends UndiciError {
constructor (message) {
super(message)
this.name = 'MockNotMatchedError'
this.message = message || 'The request does not match any registered mock dispatches'
this.code = 'UND_MOCK_ERR_MOCK_NOT_MATCHED'
}
static [Symbol.hasInstance] (instance) {
return instance && instance[kMockNotMatchedError] === true
}
get [kMockNotMatchedError] () {
return true
}
}
module.exports = {
MockNotMatchedError
}

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