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,2 @@
var convert = require('./convert');
module.exports = convert(require('../number'));

View File

@@ -0,0 +1 @@
{"version":3,"file":"getLocalI18n.d.ts","sourceRoot":"","sources":["../../src/translations/getLocalI18n.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAIjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAEzD,eAAO,MAAM,YAAY,0BAGtB;IACD,MAAM,EAAE,eAAe,CAAA;IACvB,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,qDAKG,CAAA"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"JSON.d.ts","sourceRoot":"","sources":["../../../src/admin/fields/JSON.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAC9E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AACtE,OAAO,KAAK,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAA;AAC7F,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,UAAU,EACV,oBAAoB,EACpB,eAAe,EAChB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EACV,+BAA+B,EAC/B,+BAA+B,EAC/B,wBAAwB,EACxB,wBAAwB,EACxB,yBAAyB,EACzB,yBAAyB,EAC1B,MAAM,aAAa,CAAA;AAEpB,KAAK,0BAA0B,GAAG,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC,CAAA;AAEvE,KAAK,wBAAwB,GAAG;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,QAAQ,CAAC,EAAE,mBAAmB,CAAA;CACxC,CAAA;AAED,KAAK,wBAAwB,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,CAAA;AAExD,MAAM,MAAM,oBAAoB,GAAG,eAAe,CAAC,0BAA0B,CAAC,GAC5E,wBAAwB,CAAA;AAE1B,MAAM,MAAM,oBAAoB,GAAG,wBAAwB,GACzD,eAAe,CAAC,SAAS,EAAE,0BAA0B,CAAC,CAAA;AAExD,MAAM,MAAM,wBAAwB,GAAG,oBAAoB,CACzD,SAAS,EACT,0BAA0B,EAC1B,wBAAwB,CACzB,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG,oBAAoB,CACzD,0BAA0B,EAC1B,wBAAwB,CACzB,CAAA;AAED,MAAM,MAAM,6BAA6B,GAAG,yBAAyB,CACnE,SAAS,EACT,0BAA0B,CAC3B,CAAA;AAED,MAAM,MAAM,6BAA6B,GAAG,yBAAyB,CAAC,0BAA0B,CAAC,CAAA;AAEjG,MAAM,MAAM,mCAAmC,GAAG,+BAA+B,CAC/E,SAAS,EACT,0BAA0B,CAC3B,CAAA;AAED,MAAM,MAAM,mCAAmC,GAC7C,+BAA+B,CAAC,0BAA0B,CAAC,CAAA;AAE7D,MAAM,MAAM,6BAA6B,GAAG,yBAAyB,CACnE,SAAS,EACT,0BAA0B,CAC3B,CAAA;AAED,MAAM,MAAM,6BAA6B,GAAG,yBAAyB,CAAC,0BAA0B,CAAC,CAAA;AAEjG,MAAM,MAAM,4BAA4B,GAAG,wBAAwB,CAAC,SAAS,EAAE,eAAe,CAAC,CAAA;AAE/F,MAAM,MAAM,4BAA4B,GAAG,wBAAwB,CAAC,eAAe,CAAC,CAAA"}

View File

@@ -0,0 +1,27 @@
/**
* @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 Heater = createLucideIcon("Heater", [
["path", { d: "M11 8c2-3-2-3 0-6", key: "1ldv5m" }],
["path", { d: "M15.5 8c2-3-2-3 0-6", key: "1otqoz" }],
["path", { d: "M6 10h.01", key: "1lbq93" }],
["path", { d: "M6 14h.01", key: "zudwn7" }],
["path", { d: "M10 16v-4", key: "1c25yv" }],
["path", { d: "M14 16v-4", key: "1dkbt8" }],
["path", { d: "M18 16v-4", key: "1yg9me" }],
[
"path",
{ d: "M20 6a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h3", key: "1ubg90" }
],
["path", { d: "M5 20v2", key: "1abpe8" }],
["path", { d: "M19 20v2", key: "kqn6ft" }]
]);
export { Heater as default };
//# sourceMappingURL=heater.js.map

View File

@@ -0,0 +1,530 @@
(() => {
var _window$dateFns;function _typeof(o) {"@babel/helpers - typeof";return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;}, _typeof(o);}function ownKeys(e, r) {var t = Object.keys(e);if (Object.getOwnPropertySymbols) {var o = Object.getOwnPropertySymbols(e);r && (o = o.filter(function (r) {return Object.getOwnPropertyDescriptor(e, r).enumerable;})), t.push.apply(t, o);}return t;}function _objectSpread(e) {for (var r = 1; r < arguments.length; r++) {var t = null != arguments[r] ? arguments[r] : {};r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {_defineProperty(e, r, t[r]);}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));});}return e;}function _defineProperty(obj, key, value) {key = _toPropertyKey(key);if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _toPropertyKey(t) {var i = _toPrimitive(t, "string");return "symbol" == _typeof(i) ? i : String(i);}function _toPrimitive(t, r) {if ("object" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || "default");if ("object" != _typeof(i)) return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return ("string" === r ? String : Number)(t);}var __defProp = Object.defineProperty;
var __export = function __export(target, all) {
for (var name in all)
__defProp(target, name, {
get: all[name],
enumerable: true,
configurable: true,
set: function set(newValue) {return all[name] = function () {return newValue;};}
});
};
// lib/locale/en-US/_lib/formatDistance.js
var formatDistanceLocale = {
lessThanXSeconds: {
one: "less than a second",
other: "less than {{count}} seconds"
},
xSeconds: {
one: "1 second",
other: "{{count}} seconds"
},
halfAMinute: "half a minute",
lessThanXMinutes: {
one: "less than a minute",
other: "less than {{count}} minutes"
},
xMinutes: {
one: "1 minute",
other: "{{count}} minutes"
},
aboutXHours: {
one: "about 1 hour",
other: "about {{count}} hours"
},
xHours: {
one: "1 hour",
other: "{{count}} hours"
},
xDays: {
one: "1 day",
other: "{{count}} days"
},
aboutXWeeks: {
one: "about 1 week",
other: "about {{count}} weeks"
},
xWeeks: {
one: "1 week",
other: "{{count}} weeks"
},
aboutXMonths: {
one: "about 1 month",
other: "about {{count}} months"
},
xMonths: {
one: "1 month",
other: "{{count}} months"
},
aboutXYears: {
one: "about 1 year",
other: "about {{count}} years"
},
xYears: {
one: "1 year",
other: "{{count}} years"
},
overXYears: {
one: "over 1 year",
other: "over {{count}} years"
},
almostXYears: {
one: "almost 1 year",
other: "almost {{count}} years"
}
};
var formatDistance = function formatDistance(token, count, options) {
var result;
var tokenValue = formatDistanceLocale[token];
if (typeof tokenValue === "string") {
result = tokenValue;
} else if (count === 1) {
result = tokenValue.one;
} else {
result = tokenValue.other.replace("{{count}}", count.toString());
}
if (options !== null && options !== void 0 && options.addSuffix) {
if (options.comparison && options.comparison > 0) {
return "in " + result;
} else {
return result + " ago";
}
}
return result;
};
// lib/locale/_lib/buildFormatLongFn.js
function buildFormatLongFn(args) {
return function () {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var width = options.width ? String(options.width) : args.defaultWidth;
var format = args.formats[width] || args.formats[args.defaultWidth];
return format;
};
}
// lib/locale/en-AU/_lib/formatLong.js
var dateFormats = {
full: "EEEE, d MMMM yyyy",
long: "d MMMM yyyy",
medium: "d MMM yyyy",
short: "dd/MM/yyyy"
};
var timeFormats = {
full: "h:mm:ss a zzzz",
long: "h:mm:ss a z",
medium: "h:mm:ss a",
short: "h:mm a"
};
var dateTimeFormats = {
full: "{{date}} 'at' {{time}}",
long: "{{date}} 'at' {{time}}",
medium: "{{date}}, {{time}}",
short: "{{date}}, {{time}}"
};
var formatLong = {
date: buildFormatLongFn({
formats: dateFormats,
defaultWidth: "full"
}),
time: buildFormatLongFn({
formats: timeFormats,
defaultWidth: "full"
}),
dateTime: buildFormatLongFn({
formats: dateTimeFormats,
defaultWidth: "full"
})
};
// lib/locale/en-US/_lib/formatRelative.js
var formatRelativeLocale = {
lastWeek: "'last' eeee 'at' p",
yesterday: "'yesterday at' p",
today: "'today at' p",
tomorrow: "'tomorrow at' p",
nextWeek: "eeee 'at' p",
other: "P"
};
var formatRelative = function formatRelative(token, _date, _baseDate, _options) {return formatRelativeLocale[token];};
// lib/locale/_lib/buildLocalizeFn.js
function buildLocalizeFn(args) {
return function (value, options) {
var context = options !== null && options !== void 0 && options.context ? String(options.context) : "standalone";
var valuesArray;
if (context === "formatting" && args.formattingValues) {
var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
} else {
var _defaultWidth = args.defaultWidth;
var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
valuesArray = args.values[_width] || args.values[_defaultWidth];
}
var index = args.argumentCallback ? args.argumentCallback(value) : value;
return valuesArray[index];
};
}
// lib/locale/en-US/_lib/localize.js
var eraValues = {
narrow: ["B", "A"],
abbreviated: ["BC", "AD"],
wide: ["Before Christ", "Anno Domini"]
};
var quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
};
var monthValues = {
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
abbreviated: [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec"],
wide: [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"]
};
var dayValues = {
narrow: ["S", "M", "T", "W", "T", "F", "S"],
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
wide: [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday"]
};
var dayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "mi",
noon: "n",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night"
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night"
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night"
}
};
var formattingDayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "mi",
noon: "n",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night"
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "midnight",
noon: "noon",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night"
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "midnight",
noon: "noon",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night"
}
};
var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
var number = Number(dirtyNumber);
var rem100 = number % 100;
if (rem100 > 20 || rem100 < 10) {
switch (rem100 % 10) {
case 1:
return number + "st";
case 2:
return number + "nd";
case 3:
return number + "rd";
}
}
return number + "th";
};
var localize = {
ordinalNumber: ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide"
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: function argumentCallback(quarter) {return quarter - 1;}
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide"
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide"
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide"
})
};
// lib/locale/_lib/buildMatchFn.js
function buildMatchFn(args) {
return function (string) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var width = options.width;
var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
var matchResult = string.match(matchPattern);
if (!matchResult) {
return null;
}
var matchedString = matchResult[0];
var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {return pattern.test(matchedString);}) : findKey(parsePatterns, function (pattern) {return pattern.test(matchedString);});
var value;
value = args.valueCallback ? args.valueCallback(key) : key;
value = options.valueCallback ? options.valueCallback(value) : value;
var rest = string.slice(matchedString.length);
return { value: value, rest: rest };
};
}
function findKey(object, predicate) {
for (var key in object) {
if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) {
return key;
}
}
return;
}
function findIndex(array, predicate) {
for (var key = 0; key < array.length; key++) {
if (predicate(array[key])) {
return key;
}
}
return;
}
// lib/locale/_lib/buildMatchPatternFn.js
function buildMatchPatternFn(args) {
return function (string) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var matchResult = string.match(args.matchPattern);
if (!matchResult)
return null;
var matchedString = matchResult[0];
var parseResult = string.match(args.parsePattern);
if (!parseResult)
return null;
var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
value = options.valueCallback ? options.valueCallback(value) : value;
var rest = string.slice(matchedString.length);
return { value: value, rest: rest };
};
}
// lib/locale/en-US/_lib/match.js
var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
var parseOrdinalNumberPattern = /\d+/i;
var matchEraPatterns = {
narrow: /^(b|a)/i,
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
wide: /^(before christ|before common era|anno domini|common era)/i
};
var parseEraPatterns = {
any: [/^b/i, /^(a|c)/i]
};
var matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^q[1234]/i,
wide: /^[1234](th|st|nd|rd)? quarter/i
};
var parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i]
};
var matchMonthPatterns = {
narrow: /^[jfmasond]/i,
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
};
var parseMonthPatterns = {
narrow: [
/^j/i,
/^f/i,
/^m/i,
/^a/i,
/^m/i,
/^j/i,
/^j/i,
/^a/i,
/^s/i,
/^o/i,
/^n/i,
/^d/i],
any: [
/^ja/i,
/^f/i,
/^mar/i,
/^ap/i,
/^may/i,
/^jun/i,
/^jul/i,
/^au/i,
/^s/i,
/^o/i,
/^n/i,
/^d/i]
};
var matchDayPatterns = {
narrow: /^[smtwf]/i,
short: /^(su|mo|tu|we|th|fr|sa)/i,
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
};
var parseDayPatterns = {
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
};
var matchDayPeriodPatterns = {
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
};
var parseDayPeriodPatterns = {
any: {
am: /^a/i,
pm: /^p/i,
midnight: /^mi/i,
noon: /^no/i,
morning: /morning/i,
afternoon: /afternoon/i,
evening: /evening/i,
night: /night/i
}
};
var match = {
ordinalNumber: buildMatchPatternFn({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: function valueCallback(value) {return parseInt(value, 10);}
}),
era: buildMatchFn({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any"
}),
quarter: buildMatchFn({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: function valueCallback(index) {return index + 1;}
}),
month: buildMatchFn({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any"
}),
day: buildMatchFn({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any"
}),
dayPeriod: buildMatchFn({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any"
})
};
// lib/locale/en-AU.js
var enAU = {
code: "en-AU",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 1,
firstWeekContainsDate: 4
}
};
// lib/locale/en-AU/cdn.js
window.dateFns = _objectSpread(_objectSpread({},
window.dateFns), {}, {
locale: _objectSpread(_objectSpread({}, (_window$dateFns =
window.dateFns) === null || _window$dateFns === void 0 ? void 0 : _window$dateFns.locale), {}, {
enAU: enAU }) });
//# debugId=ADD7F8913DB0458264756E2164756E21
//# sourceMappingURL=cdn.js.map
})();

View File

@@ -0,0 +1,15 @@
"use strict";
exports.formatRelative = void 0;
const formatRelativeLocale = {
lastWeek: "'ovddit' eeee 'dii.' p",
yesterday: "'ikte dii.' p",
today: "'odne dii.' p",
tomorrow: "'ihtin dii.' p",
nextWeek: "EEEE 'dii.' p",
other: "P",
};
const formatRelative = (token, _date, _baseDate, _options) =>
formatRelativeLocale[token];
exports.formatRelative = formatRelative;

View File

@@ -0,0 +1,10 @@
interface LinkedErrorsOptions {
key?: string;
limit?: number;
}
/**
* Aggregrate linked errors in an event.
*/
export declare const linkedErrorsIntegration: (options?: LinkedErrorsOptions | undefined) => import("@sentry/core").Integration;
export {};
//# sourceMappingURL=linkederrors.d.ts.map

View File

@@ -0,0 +1,7 @@
import type { Event, EventHint } from '@sentry/core';
/**
* Event processor that will symbolicate errors by using the webpack/nextjs dev server that is used to show stack traces
* in the dev overlay.
*/
export declare function devErrorSymbolicationEventProcessor(event: Event, hint: EventHint): Promise<Event | null>;
//# sourceMappingURL=devErrorSymbolicationEventProcessor.d.ts.map

View File

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

View File

@@ -0,0 +1,21 @@
/**
* @deprecated The `node:constants` module is deprecated. When requiring access to constants
* relevant to specific Node.js builtin modules, developers should instead refer
* to the `constants` property exposed by the relevant module. For instance,
* `require('node:fs').constants` and `require('node:os').constants`.
*/
declare module "constants" {
const constants:
& typeof import("node:os").constants.dlopen
& typeof import("node:os").constants.errno
& typeof import("node:os").constants.priority
& typeof import("node:os").constants.signals
& typeof import("node:fs").constants
& typeof import("node:crypto").constants;
export = constants;
}
declare module "node:constants" {
import constants = require("constants");
export = constants;
}

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B zC"},B:{"1":"6 7 8 JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I","2":"C L M G N O P Q H R S T U V W X Y Z a b","132":"0 1 2 3 4 5 c d e f g h i j k l m n o p q r s t u v w x y z"},C:{"2":"0 1 2 3 4 5 6 7 8 9 0C VC J bB K D E F A B C L M G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B WC 6B XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R YC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC 1C 2C 3C 4C 5C"},D:{"1":"6 7 8 JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC","2":"9 J bB K D E F A B C L M G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B WC 6B XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R S T U V W X Y Z a b","132":"0 1 2 3 4 5 c d e f g h i j k l m n o p q r s t u v w x y z"},E:{"2":"J bB K D E F A B C L M G 6C bC 7C 8C 9C AD cC PC QC BD CD DD dC eC RC ED SC fC gC hC iC jC FD TC kC lC mC nC oC GD UC pC qC rC sC HD tC uC vC wC ID"},F:{"16":"0 1 2 3 4 5 6 7 8 9 F B C G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R YC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JD KD LD MD PC xC ND QC"},G:{"2":"E bC OD yC PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD eD fD gD hD dC eC RC iD SC fC gC hC iC jC jD TC kC lC mC nC oC kD UC pC qC rC sC lD tC uC vC wC"},H:{"2":"mD"},I:{"2":"VC J I nD oD pD qD yC rD sD"},J:{"2":"D A"},K:{"2":"A B C H PC xC QC"},L:{"194":"I"},M:{"2":"OC"},N:{"2":"A B"},O:{"2":"RC"},P:{"2":"9 J AB BB CB DB EB FB GB HB IB tD uD vD wD xD cC yD zD 0D 1D 2D SC TC UC 3D"},Q:{"2":"4D"},R:{"2":"5D"},S:{"2":"6D 7D"}},B:1,C:"CSS Module Scripts",D:false};

View File

@@ -0,0 +1,11 @@
import { Context } from '@opentelemetry/api';
import { AbstractAsyncHooksContextManager } from './abstract-async-hooks-context-manager';
export declare class AsyncLocalStorageContextManager extends AbstractAsyncHooksContextManager {
private _asyncLocalStorage;
constructor();
active(): Context;
with<A extends unknown[], F extends (...args: A) => ReturnType<F>>(context: Context, fn: F, thisArg?: ThisParameterType<F>, ...args: A): ReturnType<F>;
enable(): this;
disable(): this;
}
//# sourceMappingURL=async-local-storage-context-manager.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/elements/StepNav/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAEvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAO7C,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC1D,OAAO,cAAc,CAAA;AAErB,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAI5C,QAAA,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC;IACtB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACrC;;;;OAIG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CACpC,CA0DA,CAAA;AAED,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,UAAU,EAAE,CAAA"}

View File

@@ -0,0 +1,24 @@
import { AnyRecord } from "./any-record";
import { NonUndefinable } from "./non-undefinable";
export type DeepModify<Type> =
| (Type extends AnyRecord
? {
[Key in keyof Type]?: undefined extends {
[Key2 in keyof Type]: Key2;
}[Key]
? NonUndefinable<Type[Key]> extends object
? true | DeepModify<NonUndefinable<Type[Key]>>
: true
: Type[Key] extends object
? true | DeepModify<Type[Key]>
: true;
}
: never)
| (Type extends Array<infer Values> ? Array<DeepModify<Values>> : never)
| (Type extends Promise<infer Value> ? Promise<DeepModify<Value>> : never)
| (Type extends Set<infer Values> ? Set<DeepModify<Values>> : never)
| (Type extends ReadonlySet<infer Values> ? ReadonlySet<DeepModify<Values>> : never)
| (Type extends WeakSet<infer Values> ? WeakSet<DeepModify<Values>> : never)
| (Type extends Map<infer Keys, infer Values> ? Map<Keys, DeepModify<Values>> : never)
| (Type extends ReadonlyMap<infer Keys, infer Values> ? ReadonlyMap<Keys, DeepModify<Values>> : never)
| (Type extends WeakMap<infer Keys, infer Values> ? WeakMap<Keys, DeepModify<Values>> : never);

View File

@@ -0,0 +1 @@
{"version":3,"file":"growthbook.d.ts","sourceRoot":"","sources":["../../../../src/integrations/featureFlags/growthbook.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAQnE,UAAU,cAAc;IACtB,IAAI,CAAC,IAAI,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAC5E,eAAe,CAAC,IAAI,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;CAC/G;AAED,MAAM,MAAM,mBAAmB,GAAG,KAAK,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,cAAc,CAAC;AAE7E;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,qBAAqB,EAAE,aAwBnC,CAAC"}

View File

@@ -0,0 +1,7 @@
import type {Plugin} from "ajv"
import getDef from "../definitions/instanceof"
const instanceofPlugin: Plugin<undefined> = (ajv) => ajv.addKeyword(getDef())
export default instanceofPlugin
module.exports = instanceofPlugin

View File

@@ -0,0 +1,55 @@
import { entityKind } from "../../entity.js";
import { QueryPromise } from "../../query-promise.js";
import { type BuildQueryResult, type DBQueryConfig, type TableRelationalConfig, type TablesRelationalConfig } from "../../relations.js";
import type { RunnableQuery } from "../../runnable-query.js";
import type { Query, SQLWrapper } from "../../sql/sql.js";
import type { KnownKeysOnly } from "../../utils.js";
import type { SQLiteDialect } from "../dialect.js";
import type { PreparedQueryConfig, SQLitePreparedQuery, SQLiteSession } from "../session.js";
import type { SQLiteTable } from "../table.js";
export type SQLiteRelationalQueryKind<TMode extends 'sync' | 'async', TResult> = TMode extends 'async' ? SQLiteRelationalQuery<TMode, TResult> : SQLiteSyncRelationalQuery<TResult>;
export declare class RelationalQueryBuilder<TMode extends 'sync' | 'async', TFullSchema extends Record<string, unknown>, TSchema extends TablesRelationalConfig, TFields extends TableRelationalConfig> {
protected mode: TMode;
protected fullSchema: Record<string, unknown>;
protected schema: TSchema;
protected tableNamesMap: Record<string, string>;
protected table: SQLiteTable;
protected tableConfig: TableRelationalConfig;
protected dialect: SQLiteDialect;
protected session: SQLiteSession<'async', unknown, TFullSchema, TSchema>;
static readonly [entityKind]: string;
constructor(mode: TMode, fullSchema: Record<string, unknown>, schema: TSchema, tableNamesMap: Record<string, string>, table: SQLiteTable, tableConfig: TableRelationalConfig, dialect: SQLiteDialect, session: SQLiteSession<'async', unknown, TFullSchema, TSchema>);
findMany<TConfig extends DBQueryConfig<'many', true, TSchema, TFields>>(config?: KnownKeysOnly<TConfig, DBQueryConfig<'many', true, TSchema, TFields>>): SQLiteRelationalQueryKind<TMode, BuildQueryResult<TSchema, TFields, TConfig>[]>;
findFirst<TSelection extends Omit<DBQueryConfig<'many', true, TSchema, TFields>, 'limit'>>(config?: KnownKeysOnly<TSelection, Omit<DBQueryConfig<'many', true, TSchema, TFields>, 'limit'>>): SQLiteRelationalQueryKind<TMode, BuildQueryResult<TSchema, TFields, TSelection> | undefined>;
}
export declare class SQLiteRelationalQuery<TType extends 'sync' | 'async', TResult> extends QueryPromise<TResult> implements RunnableQuery<TResult, 'sqlite'>, SQLWrapper {
private fullSchema;
private schema;
private tableNamesMap;
private tableConfig;
private dialect;
private session;
private config;
static readonly [entityKind]: string;
readonly _: {
readonly dialect: 'sqlite';
readonly type: TType;
readonly result: TResult;
};
constructor(fullSchema: Record<string, unknown>, schema: TablesRelationalConfig, tableNamesMap: Record<string, string>,
/** @internal */
table: SQLiteTable, tableConfig: TableRelationalConfig, dialect: SQLiteDialect, session: SQLiteSession<'sync' | 'async', unknown, Record<string, unknown>, TablesRelationalConfig>, config: DBQueryConfig<'many', true> | true, mode: 'many' | 'first');
prepare(): SQLitePreparedQuery<PreparedQueryConfig & {
type: TType;
all: TResult;
get: TResult;
execute: TResult;
}>;
private _toSQL;
toSQL(): Query;
execute(): Promise<TResult>;
}
export declare class SQLiteSyncRelationalQuery<TResult> extends SQLiteRelationalQuery<'sync', TResult> {
static readonly [entityKind]: string;
sync(): TResult;
}

View File

@@ -0,0 +1,347 @@
import { PixelCrop, PercentCrop, Crop, Ords } from './types'
export const defaultCrop: PixelCrop = {
x: 0,
y: 0,
width: 0,
height: 0,
unit: 'px',
}
export const clamp = (num: number, min: number, max: number) => Math.min(Math.max(num, min), max)
export const cls = (...args: unknown[]) => args.filter(v => v && typeof v === 'string').join(' ')
export const areCropsEqual = (cropA: Partial<Crop>, cropB: Partial<Crop>) =>
cropA === cropB ||
(cropA.width === cropB.width &&
cropA.height === cropB.height &&
cropA.x === cropB.x &&
cropA.y === cropB.y &&
cropA.unit === cropB.unit)
export function makeAspectCrop(
crop: Pick<PercentCrop, 'unit'> & Partial<Omit<PercentCrop, 'unit'>>,
aspect: number,
containerWidth: number,
containerHeight: number
): PercentCrop
export function makeAspectCrop(
crop: Pick<PixelCrop, 'unit'> & Partial<Omit<PixelCrop, 'unit'>>,
aspect: number,
containerWidth: number,
containerHeight: number
): PixelCrop
export function makeAspectCrop(crop: Partial<Crop>, aspect: number, containerWidth: number, containerHeight: number) {
const pixelCrop = convertToPixelCrop(crop, containerWidth, containerHeight)
if (crop.width) {
pixelCrop.height = pixelCrop.width / aspect
}
if (crop.height) {
pixelCrop.width = pixelCrop.height * aspect
}
if (pixelCrop.y + pixelCrop.height > containerHeight) {
pixelCrop.height = containerHeight - pixelCrop.y
pixelCrop.width = pixelCrop.height * aspect
}
if (pixelCrop.x + pixelCrop.width > containerWidth) {
pixelCrop.width = containerWidth - pixelCrop.x
pixelCrop.height = pixelCrop.width / aspect
}
if (crop.unit === '%') {
return convertToPercentCrop(pixelCrop, containerWidth, containerHeight)
}
return pixelCrop
}
export function centerCrop(
crop: Pick<PercentCrop, 'unit'> & Partial<Omit<PercentCrop, 'unit'>>,
containerWidth: number,
containerHeight: number
): PercentCrop
export function centerCrop(
crop: Pick<PixelCrop, 'unit'> & Partial<Omit<PixelCrop, 'unit'>>,
containerWidth: number,
containerHeight: number
): PixelCrop
export function centerCrop(crop: Partial<Crop>, containerWidth: number, containerHeight: number) {
const pixelCrop = convertToPixelCrop(crop, containerWidth, containerHeight)
pixelCrop.x = (containerWidth - pixelCrop.width) / 2
pixelCrop.y = (containerHeight - pixelCrop.height) / 2
if (crop.unit === '%') {
return convertToPercentCrop(pixelCrop, containerWidth, containerHeight)
}
return pixelCrop
}
export function convertToPercentCrop(
crop: Partial<Crop>,
containerWidth: number,
containerHeight: number
): PercentCrop {
if (crop.unit === '%') {
return { ...defaultCrop, ...crop, unit: '%' }
}
return {
unit: '%',
x: crop.x ? (crop.x / containerWidth) * 100 : 0,
y: crop.y ? (crop.y / containerHeight) * 100 : 0,
width: crop.width ? (crop.width / containerWidth) * 100 : 0,
height: crop.height ? (crop.height / containerHeight) * 100 : 0,
}
}
export function convertToPixelCrop(crop: Partial<Crop>, containerWidth: number, containerHeight: number): PixelCrop {
if (!crop.unit) {
return { ...defaultCrop, ...crop, unit: 'px' }
}
if (crop.unit === 'px') {
return { ...defaultCrop, ...crop, unit: 'px' }
}
return {
unit: 'px',
x: crop.x ? (crop.x * containerWidth) / 100 : 0,
y: crop.y ? (crop.y * containerHeight) / 100 : 0,
width: crop.width ? (crop.width * containerWidth) / 100 : 0,
height: crop.height ? (crop.height * containerHeight) / 100 : 0,
}
}
// Sorry.
export function containCrop(
pixelCrop: PixelCrop,
aspect: number,
ord: Ords,
containerWidth: number,
containerHeight: number,
minWidth = 0,
minHeight = 0,
maxWidth = containerWidth,
maxHeight = containerHeight
) {
const containedCrop = { ...pixelCrop }
let _minWidth = Math.min(minWidth, containerWidth)
let _minHeight = Math.min(minHeight, containerHeight)
let _maxWidth = Math.min(maxWidth, containerWidth)
let _maxHeight = Math.min(maxHeight, containerHeight)
if (aspect) {
if (aspect > 1) {
// Landscape - increase width min + max.
_minWidth = minHeight ? minHeight * aspect : _minWidth
_minHeight = _minWidth / aspect
_maxWidth = maxWidth * aspect
} else {
// Portrait - increase height min + max.
_minHeight = minWidth ? minWidth / aspect : _minHeight
_minWidth = _minHeight * aspect
_maxHeight = maxHeight / aspect
}
}
// Stop underflow on top.
if (containedCrop.y < 0) {
containedCrop.height = Math.max(containedCrop.height + containedCrop.y, _minHeight)
containedCrop.y = 0
}
// Stop underflow on left.
if (containedCrop.x < 0) {
containedCrop.width = Math.max(containedCrop.width + containedCrop.x, _minWidth)
containedCrop.x = 0
}
// Stop overflow on right.
const xOverflow = containerWidth - (containedCrop.x + containedCrop.width)
if (xOverflow < 0) {
containedCrop.x = Math.min(containedCrop.x, containerWidth - _minWidth)
containedCrop.width += xOverflow
}
// Stop overflow on bottom.
const yOverflow = containerHeight - (containedCrop.y + containedCrop.height)
if (yOverflow < 0) {
containedCrop.y = Math.min(containedCrop.y, containerHeight - _minHeight)
containedCrop.height += yOverflow
}
// Make crop respect min width generally.
if (containedCrop.width < _minWidth) {
if (ord === 'sw' || ord == 'nw') {
// Stops box moving when min is hit.
containedCrop.x -= _minWidth - containedCrop.width
}
containedCrop.width = _minWidth
}
// Make crop respect min height generally.
if (containedCrop.height < _minHeight) {
if (ord === 'nw' || ord == 'ne') {
// Stops box moving when min is hit.
containedCrop.y -= _minHeight - containedCrop.height
}
containedCrop.height = _minHeight
}
// Make crop respect max width generally.
if (containedCrop.width > _maxWidth) {
if (ord === 'sw' || ord == 'nw') {
// Stops box moving when max is hit.
containedCrop.x -= _maxWidth - containedCrop.width
}
containedCrop.width = _maxWidth
}
// Make crop respect max height generally.
if (containedCrop.height > _maxHeight) {
if (ord === 'nw' || ord == 'ne') {
// Stops box moving when min is hit.
containedCrop.y -= _maxHeight - containedCrop.height
}
containedCrop.height = _maxHeight
}
// Maintain aspect after size fixing.
if (aspect) {
const currAspect = containedCrop.width / containedCrop.height
if (currAspect < aspect) {
// Crop is shrunk on the width so adjust the height.
const newHeight = Math.max(containedCrop.width / aspect, _minHeight)
if (ord === 'nw' || ord == 'ne') {
// Stops box moving when min is hit.
containedCrop.y -= newHeight - containedCrop.height
}
containedCrop.height = newHeight
} else if (currAspect > aspect) {
// Crop is shrunk on the height so adjust the width.
const newWidth = Math.max(containedCrop.height * aspect, _minWidth)
if (ord === 'sw' || ord == 'nw') {
// Stops box moving when max is hit.
containedCrop.x -= newWidth - containedCrop.width
}
containedCrop.width = newWidth
}
}
return containedCrop
}
export function nudgeCrop(pixelCrop: PixelCrop, key: string, offset: number, ord: Ords) {
const nextCrop = { ...pixelCrop }
if (key === 'ArrowLeft') {
if (ord === 'nw') {
nextCrop.x -= offset
nextCrop.y -= offset
nextCrop.width += offset
nextCrop.height += offset
} else if (ord === 'w') {
nextCrop.x -= offset
nextCrop.width += offset
} else if (ord === 'sw') {
nextCrop.x -= offset
nextCrop.width += offset
nextCrop.height += offset
} else if (ord === 'ne') {
nextCrop.y += offset
nextCrop.width -= offset
nextCrop.height -= offset
} else if (ord === 'e') {
nextCrop.width -= offset
} else if (ord === 'se') {
nextCrop.width -= offset
nextCrop.height -= offset
}
} else if (key === 'ArrowRight') {
if (ord === 'nw') {
nextCrop.x += offset
nextCrop.y += offset
nextCrop.width -= offset
nextCrop.height -= offset
} else if (ord === 'w') {
// Niche: Will move right if minWidth hit.
nextCrop.x += offset
nextCrop.width -= offset
} else if (ord === 'sw') {
nextCrop.x += offset
nextCrop.width -= offset
nextCrop.height -= offset
} else if (ord === 'ne') {
nextCrop.y -= offset
nextCrop.width += offset
nextCrop.height += offset
} else if (ord === 'e') {
nextCrop.width += offset
} else if (ord === 'se') {
nextCrop.width += offset
nextCrop.height += offset
}
}
if (key === 'ArrowUp') {
if (ord === 'nw') {
nextCrop.x -= offset
nextCrop.y -= offset
nextCrop.width += offset
nextCrop.height += offset
} else if (ord === 'n') {
nextCrop.y -= offset
nextCrop.height += offset
} else if (ord === 'ne') {
nextCrop.y -= offset
nextCrop.width += offset
nextCrop.height += offset
} else if (ord === 'sw') {
nextCrop.x += offset
nextCrop.width -= offset
nextCrop.height -= offset
} else if (ord === 's') {
nextCrop.height -= offset
} else if (ord === 'se') {
nextCrop.width -= offset
nextCrop.height -= offset
}
} else if (key === 'ArrowDown') {
if (ord === 'nw') {
nextCrop.x += offset
nextCrop.y += offset
nextCrop.width -= offset
nextCrop.height -= offset
} else if (ord === 'n') {
// Niche: Will move down if minHeight hit.
nextCrop.y += offset
nextCrop.height -= offset
} else if (ord === 'ne') {
nextCrop.y += offset
nextCrop.width -= offset
nextCrop.height -= offset
} else if (ord === 'sw') {
nextCrop.x -= offset
nextCrop.width += offset
nextCrop.height += offset
} else if (ord === 's') {
nextCrop.height += offset
} else if (ord === 'se') {
nextCrop.width += offset
nextCrop.height += offset
}
}
return nextCrop
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["React","baseClass","DrawerContentContainer","children","className","_jsx","filter","Boolean","join"],"sources":["../../../src/elements/DrawerContentContainer/index.tsx"],"sourcesContent":["import React from 'react'\n\nimport './index.scss'\n\nconst baseClass = 'drawer-content-container'\n\ntype Props = {\n readonly children: React.ReactNode\n readonly className?: string\n}\nexport function DrawerContentContainer({ children, className }: Props) {\n return <div className={[baseClass, className].filter(Boolean).join(' ')}>{children}</div>\n}\n"],"mappings":";AAAA,OAAOA,KAAA,MAAW;AAElB,OAAO;AAEP,MAAMC,SAAA,GAAY;AAMlB,OAAO,SAASC,uBAAuB;EAAEC,QAAQ;EAAEC;AAAS,CAAS;EACnE,oBAAOC,IAAA,CAAC;IAAID,SAAA,EAAW,CAACH,SAAA,EAAWG,SAAA,CAAU,CAACE,MAAM,CAACC,OAAA,EAASC,IAAI,CAAC;cAAOL;;AAC5E","ignoreList":[]}

View File

@@ -0,0 +1,117 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.parse32F = parse32F;
exports.parse64F = parse64F;
exports.parse32I = parse32I;
exports.parseU32 = parseU32;
exports.parse64I = parse64I;
exports.isInfLiteral = isInfLiteral;
exports.isNanLiteral = isNanLiteral;
var _long2 = _interopRequireDefault(require("@xtuc/long"));
var _floatingPointHexParser = _interopRequireDefault(require("@webassemblyjs/floating-point-hex-parser"));
var _helperApiError = require("@webassemblyjs/helper-api-error");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function parse32F(sourceString) {
if (isHexLiteral(sourceString)) {
return (0, _floatingPointHexParser["default"])(sourceString);
}
if (isInfLiteral(sourceString)) {
return sourceString[0] === "-" ? -1 : 1;
}
if (isNanLiteral(sourceString)) {
return (sourceString[0] === "-" ? -1 : 1) * (sourceString.includes(":") ? parseInt(sourceString.substring(sourceString.indexOf(":") + 1), 16) : 0x400000);
}
return parseFloat(sourceString);
}
function parse64F(sourceString) {
if (isHexLiteral(sourceString)) {
return (0, _floatingPointHexParser["default"])(sourceString);
}
if (isInfLiteral(sourceString)) {
return sourceString[0] === "-" ? -1 : 1;
}
if (isNanLiteral(sourceString)) {
return (sourceString[0] === "-" ? -1 : 1) * (sourceString.includes(":") ? parseInt(sourceString.substring(sourceString.indexOf(":") + 1), 16) : 0x8000000000000);
}
if (isHexLiteral(sourceString)) {
return (0, _floatingPointHexParser["default"])(sourceString);
}
return parseFloat(sourceString);
}
function parse32I(sourceString) {
var value = 0;
if (isHexLiteral(sourceString)) {
value = ~~parseInt(sourceString, 16);
} else if (isDecimalExponentLiteral(sourceString)) {
throw new Error("This number literal format is yet to be implemented.");
} else {
value = parseInt(sourceString, 10);
}
return value;
}
function parseU32(sourceString) {
var value = parse32I(sourceString);
if (value < 0) {
throw new _helperApiError.CompileError("Illegal value for u32: " + sourceString);
}
return value;
}
function parse64I(sourceString) {
// $FlowIgnore
var _long;
if (isHexLiteral(sourceString)) {
_long = _long2["default"].fromString(sourceString, false, 16);
} else if (isDecimalExponentLiteral(sourceString)) {
throw new Error("This number literal format is yet to be implemented.");
} else {
_long = _long2["default"].fromString(sourceString);
}
return {
high: _long.high,
low: _long.low
};
}
var NAN_WORD = /^\+?-?nan/;
var INF_WORD = /^\+?-?inf/;
function isInfLiteral(sourceString) {
return INF_WORD.test(sourceString.toLowerCase());
}
function isNanLiteral(sourceString) {
return NAN_WORD.test(sourceString.toLowerCase());
}
function isDecimalExponentLiteral(sourceString) {
return !isHexLiteral(sourceString) && sourceString.toUpperCase().includes("E");
}
function isHexLiteral(sourceString) {
return sourceString.substring(0, 2).toUpperCase() === "0X" || sourceString.substring(0, 3).toUpperCase() === "-0X";
}

View File

@@ -0,0 +1,143 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const node_worker_threads = require('node:worker_threads');
const core = require('@sentry/core');
const debug = require('../../utils/debug.js');
const common = require('./common.js');
// This string is a placeholder that gets overwritten with the worker code.
const base64WorkerScript = 'LyohIEBzZW50cnkvbm9kZS1jb3JlIDEwLjM5LjAgKGFiNTRjNWMpIHwgaHR0cHM6Ly9naXRodWIuY29tL2dldHNlbnRyeS9zZW50cnktamF2YXNjcmlwdCAqLwppbXBvcnR7U2Vzc2lvbiBhcyBlfWZyb20ibm9kZTppbnNwZWN0b3IvcHJvbWlzZXMiO2ltcG9ydHt3b3JrZXJEYXRhIGFzIHR9ZnJvbSJub2RlOndvcmtlcl90aHJlYWRzIjtjb25zdCBuPWdsb2JhbFRoaXMsaT17fTtjb25zdCBvPSJfX1NFTlRSWV9FUlJPUl9MT0NBTF9WQVJJQUJMRVNfXyI7Y29uc3QgYT10O2Z1bmN0aW9uIHMoLi4uZSl7YS5kZWJ1ZyYmZnVuY3Rpb24oZSl7aWYoISgiY29uc29sZSJpbiBuKSlyZXR1cm4gZSgpO2NvbnN0IHQ9bi5jb25zb2xlLG89e30sYT1PYmplY3Qua2V5cyhpKTthLmZvckVhY2goZT0+e2NvbnN0IG49aVtlXTtvW2VdPXRbZV0sdFtlXT1ufSk7dHJ5e3JldHVybiBlKCl9ZmluYWxseXthLmZvckVhY2goZT0+e3RbZV09b1tlXX0pfX0oKCk9PmNvbnNvbGUubG9nKCJbTG9jYWxWYXJpYWJsZXMgV29ya2VyXSIsLi4uZSkpfWFzeW5jIGZ1bmN0aW9uIGMoZSx0LG4saSl7Y29uc3Qgbz1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuZ2V0UHJvcGVydGllcyIse29iamVjdElkOnQsb3duUHJvcGVydGllczohMH0pO2lbbl09by5yZXN1bHQuZmlsdGVyKGU9PiJsZW5ndGgiIT09ZS5uYW1lJiYhaXNOYU4ocGFyc2VJbnQoZS5uYW1lLDEwKSkpLnNvcnQoKGUsdCk9PnBhcnNlSW50KGUubmFtZSwxMCktcGFyc2VJbnQodC5uYW1lLDEwKSkubWFwKGU9PmUudmFsdWU/LnZhbHVlKX1hc3luYyBmdW5jdGlvbiByKGUsdCxuLGkpe2NvbnN0IG89YXdhaXQgZS5wb3N0KCJSdW50aW1lLmdldFByb3BlcnRpZXMiLHtvYmplY3RJZDp0LG93blByb3BlcnRpZXM6ITB9KTtpW25dPW8ucmVzdWx0Lm1hcChlPT5bZS5uYW1lLGUudmFsdWU/LnZhbHVlXSkucmVkdWNlKChlLFt0LG5dKT0+KGVbdF09bixlKSx7fSl9ZnVuY3Rpb24gdShlLHQpe2UudmFsdWUmJigidmFsdWUiaW4gZS52YWx1ZT92b2lkIDA9PT1lLnZhbHVlLnZhbHVlfHxudWxsPT09ZS52YWx1ZS52YWx1ZT90W2UubmFtZV09YDwke2UudmFsdWUudmFsdWV9PmA6dFtlLm5hbWVdPWUudmFsdWUudmFsdWU6ImRlc2NyaXB0aW9uImluIGUudmFsdWUmJiJmdW5jdGlvbiIhPT1lLnZhbHVlLnR5cGU/dFtlLm5hbWVdPWA8JHtlLnZhbHVlLmRlc2NyaXB0aW9ufT5gOiJ1bmRlZmluZWQiPT09ZS52YWx1ZS50eXBlJiYodFtlLm5hbWVdPSI8dW5kZWZpbmVkPiIpKX1hc3luYyBmdW5jdGlvbiBsKGUsdCl7Y29uc3Qgbj1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuZ2V0UHJvcGVydGllcyIse29iamVjdElkOnQsb3duUHJvcGVydGllczohMH0pLGk9e307Zm9yKGNvbnN0IHQgb2Ygbi5yZXN1bHQpaWYodC52YWx1ZT8ub2JqZWN0SWQmJiJBcnJheSI9PT10LnZhbHVlLmNsYXNzTmFtZSl7Y29uc3Qgbj10LnZhbHVlLm9iamVjdElkO2F3YWl0IGMoZSxuLHQubmFtZSxpKX1lbHNlIGlmKHQudmFsdWU/Lm9iamVjdElkJiYiT2JqZWN0Ij09PXQudmFsdWUuY2xhc3NOYW1lKXtjb25zdCBuPXQudmFsdWUub2JqZWN0SWQ7YXdhaXQgcihlLG4sdC5uYW1lLGkpfWVsc2UgdC52YWx1ZSYmdSh0LGkpO3JldHVybiBpfWxldCBmOyhhc3luYyBmdW5jdGlvbigpe2NvbnN0IHQ9bmV3IGU7dC5jb25uZWN0VG9NYWluVGhyZWFkKCkscygiQ29ubmVjdGVkIHRvIG1haW4gdGhyZWFkIik7bGV0IG49ITE7dC5vbigiRGVidWdnZXIucmVzdW1lZCIsKCk9PntuPSExfSksdC5vbigiRGVidWdnZXIucGF1c2VkIixlPT57bj0hMCxhc3luYyBmdW5jdGlvbihlLHtyZWFzb246dCxkYXRhOntvYmplY3RJZDpufSxjYWxsRnJhbWVzOml9KXtpZigiZXhjZXB0aW9uIiE9PXQmJiJwcm9taXNlUmVqZWN0aW9uIiE9PXQpcmV0dXJuO2lmKGY/LigpLG51bGw9PW4pcmV0dXJuO2NvbnN0IGE9W107Zm9yKGxldCB0PTA7dDxpLmxlbmd0aDt0Kyspe2NvbnN0e3Njb3BlQ2hhaW46bixmdW5jdGlvbk5hbWU6byx0aGlzOnN9PWlbdF0sYz1uLmZpbmQoZT0+ImxvY2FsIj09PWUudHlwZSkscj0iZ2xvYmFsIiE9PXMuY2xhc3NOYW1lJiZzLmNsYXNzTmFtZT9gJHtzLmNsYXNzTmFtZX0uJHtvfWA6bztpZih2b2lkIDA9PT1jPy5vYmplY3Qub2JqZWN0SWQpYVt0XT17ZnVuY3Rpb246cn07ZWxzZXtjb25zdCBuPWF3YWl0IGwoZSxjLm9iamVjdC5vYmplY3RJZCk7YVt0XT17ZnVuY3Rpb246cix2YXJzOm59fX1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuY2FsbEZ1bmN0aW9uT24iLHtmdW5jdGlvbkRlY2xhcmF0aW9uOmBmdW5jdGlvbigpIHsgdGhpcy4ke299ID0gdGhpcy4ke299IHx8ICR7SlNPTi5zdHJpbmdpZnkoYSl9OyB9YCxzaWxlbnQ6ITAsb2JqZWN0SWQ6bn0pLGF3YWl0IGUucG9zdCgiUnVudGltZS5yZWxlYXNlT2JqZWN0Iix7b2JqZWN0SWQ6bn0pfSh0LGUucGFyYW1zKS50aGVuKGFzeW5jKCk9PntuJiZhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLnJlc3VtZSIpfSxhc3luYyBlPT57biYmYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5yZXN1bWUiKX0pfSksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5lbmFibGUiKTtjb25zdCBpPSExIT09YS5jYXB0dXJlQWxsRXhjZXB0aW9ucztpZihhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLnNldFBhdXNlT25FeGNlcHRpb25zIix7c3RhdGU6aT8iYWxsIjoidW5jYXVnaHQifSksaSl7Y29uc3QgZT1hLm1heEV4Y2VwdGlvbnNQZXJTZWNvbmR8fDUwO2Y9ZnVuY3Rpb24oZSx0LG4pe2xldCBpPTAsbz01LGE9MDtyZXR1cm4gc2V0SW50ZXJ2YWwoKCk9PnswPT09YT9pPmUmJihvKj0yLG4obyksbz44NjQwMCYmKG89ODY0MDApLGE9byk6KGEtPTEsMD09PWEmJnQoKSksaT0wfSwxZTMpLnVucmVmKCksKCk9PntpKz0xfX0oZSxhc3luYygpPT57cygiUmF0ZS1saW1pdCBsaWZ0ZWQuIiksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5zZXRQYXVzZU9uRXhjZXB0aW9ucyIse3N0YXRlOiJhbGwifSl9LGFzeW5jIGU9PntzKGBSYXRlLWxpbWl0IGV4Y2VlZGVkLiBEaXNhYmxpbmcgY2FwdHVyaW5nIG9mIGNhdWdodCBleGNlcHRpb25zIGZvciAke2V9IHNlY29uZHMuYCksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5zZXRQYXVzZU9uRXhjZXB0aW9ucyIse3N0YXRlOiJ1bmNhdWdodCJ9KX0pfX0pKCkuY2F0Y2goZT0+e3MoIkZhaWxlZCB0byBzdGFydCBkZWJ1Z2dlciIsZSl9KSxzZXRJbnRlcnZhbCgoKT0+e30sMWU0KTs=';
function log(...args) {
core.debug.log('[LocalVariables]', ...args);
}
/**
* Adds local variables to exception frames
*/
const localVariablesAsyncIntegration = core.defineIntegration(((
integrationOptions = {},
) => {
function addLocalVariablesToException(exception, localVariables) {
// Filter out frames where the function name is `new Promise` since these are in the error.stack frames
// but do not appear in the debugger call frames
const frames = (exception.stacktrace?.frames || []).filter(frame => frame.function !== 'new Promise');
for (let i = 0; i < frames.length; i++) {
// Sentry frames are in reverse order
const frameIndex = frames.length - i - 1;
const frameLocalVariables = localVariables[i];
const frame = frames[frameIndex];
if (!frame || !frameLocalVariables) {
// Drop out if we run out of frames to match up
break;
}
if (
// We need to have vars to add
frameLocalVariables.vars === undefined ||
// Only skip out-of-app frames if includeOutOfAppFrames is not true
(frame.in_app === false && integrationOptions.includeOutOfAppFrames !== true) ||
// The function names need to match
!common.functionNamesMatch(frame.function, frameLocalVariables.function)
) {
continue;
}
frame.vars = frameLocalVariables.vars;
}
}
function addLocalVariablesToEvent(event, hint) {
if (
hint.originalException &&
typeof hint.originalException === 'object' &&
common.LOCAL_VARIABLES_KEY in hint.originalException &&
Array.isArray(hint.originalException[common.LOCAL_VARIABLES_KEY])
) {
for (const exception of event.exception?.values || []) {
addLocalVariablesToException(exception, hint.originalException[common.LOCAL_VARIABLES_KEY]);
}
hint.originalException[common.LOCAL_VARIABLES_KEY] = undefined;
}
return event;
}
async function startInspector() {
// We load inspector dynamically because on some platforms Node is built without inspector support
const inspector = await import('node:inspector');
if (!inspector.url()) {
inspector.open(0);
}
}
function startWorker(options) {
const worker = new node_worker_threads.Worker(new URL(`data:application/javascript;base64,${base64WorkerScript}`), {
workerData: options,
// We don't want any Node args to be passed to the worker
execArgv: [],
env: { ...process.env, NODE_OPTIONS: undefined },
});
process.on('exit', () => {
// eslint-disable-next-line @typescript-eslint/no-floating-promises
worker.terminate();
});
worker.once('error', (err) => {
log('Worker error', err);
});
worker.once('exit', (code) => {
log('Worker exit', code);
});
// Ensure this thread can't block app exit
worker.unref();
}
return {
name: 'LocalVariablesAsync',
async setup(client) {
const clientOptions = client.getOptions();
if (!clientOptions.includeLocalVariables) {
return;
}
if (await debug.isDebuggerEnabled()) {
core.debug.warn('Local variables capture has been disabled because the debugger was already enabled');
return;
}
const options = {
...integrationOptions,
debug: core.debug.isEnabled(),
};
startInspector().then(
() => {
try {
startWorker(options);
} catch (e) {
core.debug.error('Failed to start worker', e);
}
},
e => {
core.debug.error('Failed to start inspector', e);
},
);
},
processEvent(event, hint) {
return addLocalVariablesToEvent(event, hint);
},
};
}) );
exports.base64WorkerScript = base64WorkerScript;
exports.localVariablesAsyncIntegration = localVariablesAsyncIntegration;
//# sourceMappingURL=local-variables-async.js.map

View File

@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('hasIn', require('../hasIn'));
func.placeholder = require('./placeholder');
module.exports = func;

View File

@@ -0,0 +1 @@
{"version":3,"file":"file-line-chart.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}

View File

@@ -0,0 +1,229 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
// eslint-disable-next-line @typescript-eslint/unbound-method
const objectToString = Object.prototype.toString;
/**
* Checks whether given value's type is one of a few Error or Error-like
* {@link isError}.
*
* @param wat A value to be checked.
* @returns A boolean representing the result.
*/
function isError(wat) {
switch (objectToString.call(wat)) {
case '[object Error]':
case '[object Exception]':
case '[object DOMException]':
case '[object WebAssembly.Exception]':
return true;
default:
return isInstanceOf(wat, Error);
}
}
/**
* Checks whether given value is an instance of the given built-in class.
*
* @param wat The value to be checked
* @param className
* @returns A boolean representing the result.
*/
function isBuiltin(wat, className) {
return objectToString.call(wat) === `[object ${className}]`;
}
/**
* Checks whether given value's type is ErrorEvent
* {@link isErrorEvent}.
*
* @param wat A value to be checked.
* @returns A boolean representing the result.
*/
function isErrorEvent(wat) {
return isBuiltin(wat, 'ErrorEvent');
}
/**
* Checks whether given value's type is DOMError
* {@link isDOMError}.
*
* @param wat A value to be checked.
* @returns A boolean representing the result.
*/
function isDOMError(wat) {
return isBuiltin(wat, 'DOMError');
}
/**
* Checks whether given value's type is DOMException
* {@link isDOMException}.
*
* @param wat A value to be checked.
* @returns A boolean representing the result.
*/
function isDOMException(wat) {
return isBuiltin(wat, 'DOMException');
}
/**
* Checks whether given value's type is a string
* {@link isString}.
*
* @param wat A value to be checked.
* @returns A boolean representing the result.
*/
function isString(wat) {
return isBuiltin(wat, 'String');
}
/**
* Checks whether given string is parameterized
* {@link isParameterizedString}.
*
* @param wat A value to be checked.
* @returns A boolean representing the result.
*/
function isParameterizedString(wat) {
return (
typeof wat === 'object' &&
wat !== null &&
'__sentry_template_string__' in wat &&
'__sentry_template_values__' in wat
);
}
/**
* Checks whether given value is a primitive (undefined, null, number, boolean, string, bigint, symbol)
* {@link isPrimitive}.
*
* @param wat A value to be checked.
* @returns A boolean representing the result.
*/
function isPrimitive(wat) {
return wat === null || isParameterizedString(wat) || (typeof wat !== 'object' && typeof wat !== 'function');
}
/**
* Checks whether given value's type is an object literal, or a class instance.
* {@link isPlainObject}.
*
* @param wat A value to be checked.
* @returns A boolean representing the result.
*/
function isPlainObject(wat) {
return isBuiltin(wat, 'Object');
}
/**
* Checks whether given value's type is an Event instance
* {@link isEvent}.
*
* @param wat A value to be checked.
* @returns A boolean representing the result.
*/
function isEvent(wat) {
return typeof Event !== 'undefined' && isInstanceOf(wat, Event);
}
/**
* Checks whether given value's type is an Element instance
* {@link isElement}.
*
* @param wat A value to be checked.
* @returns A boolean representing the result.
*/
function isElement(wat) {
return typeof Element !== 'undefined' && isInstanceOf(wat, Element);
}
/**
* Checks whether given value's type is an regexp
* {@link isRegExp}.
*
* @param wat A value to be checked.
* @returns A boolean representing the result.
*/
function isRegExp(wat) {
return isBuiltin(wat, 'RegExp');
}
/**
* Checks whether given value has a then function.
* @param wat A value to be checked.
*/
function isThenable(wat) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
return Boolean(wat?.then && typeof wat.then === 'function');
}
/**
* Checks whether given value's type is a SyntheticEvent
* {@link isSyntheticEvent}.
*
* @param wat A value to be checked.
* @returns A boolean representing the result.
*/
function isSyntheticEvent(wat) {
return isPlainObject(wat) && 'nativeEvent' in wat && 'preventDefault' in wat && 'stopPropagation' in wat;
}
/**
* Checks whether given value's type is an instance of provided constructor.
* {@link isInstanceOf}.
*
* @param wat A value to be checked.
* @param base A constructor to be used in a check.
* @returns A boolean representing the result.
*/
// TODO: fix in v11, convert any to unknown
// export function isInstanceOf<T>(wat: unknown, base: { new (...args: any[]): T }): wat is T {
function isInstanceOf(wat, base) {
try {
return wat instanceof base;
} catch {
return false;
}
}
/**
* Checks whether given value's type is a Vue ViewModel or a VNode.
*
* @param wat A value to be checked.
* @returns A boolean representing the result.
*/
function isVueViewModel(wat) {
// Not using Object.prototype.toString because in Vue 3 it would read the instance's Symbol(Symbol.toStringTag) property.
// We also need to check for __v_isVNode because Vue 3 component render instances have an internal __v_isVNode property.
return !!(
typeof wat === 'object' &&
wat !== null &&
((wat ).__isVue || (wat )._isVue || (wat ).__v_isVNode)
);
}
/**
* Checks whether the given parameter is a Standard Web API Request instance.
*
* Returns false if Request is not available in the current runtime.
*/
function isRequest(request) {
return typeof Request !== 'undefined' && isInstanceOf(request, Request);
}
exports.isDOMError = isDOMError;
exports.isDOMException = isDOMException;
exports.isElement = isElement;
exports.isError = isError;
exports.isErrorEvent = isErrorEvent;
exports.isEvent = isEvent;
exports.isInstanceOf = isInstanceOf;
exports.isParameterizedString = isParameterizedString;
exports.isPlainObject = isPlainObject;
exports.isPrimitive = isPrimitive;
exports.isRegExp = isRegExp;
exports.isRequest = isRequest;
exports.isString = isString;
exports.isSyntheticEvent = isSyntheticEvent;
exports.isThenable = isThenable;
exports.isVueViewModel = isVueViewModel;
//# sourceMappingURL=is.js.map

View File

@@ -0,0 +1,23 @@
import { Parser } from "../Parser.js";
import { parseNDigitsSigned } from "../utils.js";
export class ExtendedYearParser extends Parser {
priority = 130;
parse(dateString, token) {
if (token === "u") {
return parseNDigitsSigned(4, dateString);
}
return parseNDigitsSigned(token.length, dateString);
}
set(date, _flags, value) {
date.setFullYear(value, 0, 1);
date.setHours(0, 0, 0, 0);
return date;
}
incompatibleTokens = ["G", "y", "Y", "R", "w", "I", "i", "e", "c", "t", "T"];
}

View File

@@ -0,0 +1,3 @@
export * from "./declarations/src/index.js";
export { default } from "./declarations/src/index.js";
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlLWlzb21vcnBoaWMtbGF5b3V0LWVmZmVjdC5janMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4vZGVjbGFyYXRpb25zL3NyYy9pbmRleC5kLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBIn0=

View File

@@ -0,0 +1,278 @@
import * as core from "./core.js";
import type * as errors from "./errors.js";
import type * as schemas from "./schemas.js";
import * as util from "./util.js";
export interface $ZodCheckDef {
check: string;
error?: errors.$ZodErrorMap<never> | undefined;
/** If true, no later checks will be executed if this check fails. Default `false`. */
abort?: boolean | undefined;
/** If provided, this check will only be executed if the function returns `true`. Defaults to `payload => z.util.isAborted(payload)`. */
when?: ((payload: schemas.ParsePayload) => boolean) | undefined;
}
export interface $ZodCheckInternals<T> {
def: $ZodCheckDef;
/** The set of issues this check might throw. */
issc?: errors.$ZodIssueBase;
check(payload: schemas.ParsePayload<T>): util.MaybeAsync<void>;
onattach: ((schema: schemas.$ZodType) => void)[];
}
export interface $ZodCheck<in T = never> {
_zod: $ZodCheckInternals<T>;
}
export declare const $ZodCheck: core.$constructor<$ZodCheck<any>>;
export interface $ZodCheckLessThanDef extends $ZodCheckDef {
check: "less_than";
value: util.Numeric;
inclusive: boolean;
}
export interface $ZodCheckLessThanInternals<T extends util.Numeric = util.Numeric> extends $ZodCheckInternals<T> {
def: $ZodCheckLessThanDef;
issc: errors.$ZodIssueTooBig<T>;
}
export interface $ZodCheckLessThan<T extends util.Numeric = util.Numeric> extends $ZodCheck<T> {
_zod: $ZodCheckLessThanInternals<T>;
}
export declare const $ZodCheckLessThan: core.$constructor<$ZodCheckLessThan>;
export interface $ZodCheckGreaterThanDef extends $ZodCheckDef {
check: "greater_than";
value: util.Numeric;
inclusive: boolean;
}
export interface $ZodCheckGreaterThanInternals<T extends util.Numeric = util.Numeric> extends $ZodCheckInternals<T> {
def: $ZodCheckGreaterThanDef;
issc: errors.$ZodIssueTooSmall<T>;
}
export interface $ZodCheckGreaterThan<T extends util.Numeric = util.Numeric> extends $ZodCheck<T> {
_zod: $ZodCheckGreaterThanInternals<T>;
}
export declare const $ZodCheckGreaterThan: core.$constructor<$ZodCheckGreaterThan>;
export interface $ZodCheckMultipleOfDef<T extends number | bigint = number | bigint> extends $ZodCheckDef {
check: "multiple_of";
value: T;
}
export interface $ZodCheckMultipleOfInternals<T extends number | bigint = number | bigint> extends $ZodCheckInternals<T> {
def: $ZodCheckMultipleOfDef<T>;
issc: errors.$ZodIssueNotMultipleOf;
}
export interface $ZodCheckMultipleOf<T extends number | bigint = number | bigint> extends $ZodCheck<T> {
_zod: $ZodCheckMultipleOfInternals<T>;
}
export declare const $ZodCheckMultipleOf: core.$constructor<$ZodCheckMultipleOf<number | bigint>>;
export type $ZodNumberFormats = "int32" | "uint32" | "float32" | "float64" | "safeint";
export interface $ZodCheckNumberFormatDef extends $ZodCheckDef {
check: "number_format";
format: $ZodNumberFormats;
}
export interface $ZodCheckNumberFormatInternals extends $ZodCheckInternals<number> {
def: $ZodCheckNumberFormatDef;
issc: errors.$ZodIssueInvalidType | errors.$ZodIssueTooBig<"number"> | errors.$ZodIssueTooSmall<"number">;
}
export interface $ZodCheckNumberFormat extends $ZodCheck<number> {
_zod: $ZodCheckNumberFormatInternals;
}
export declare const $ZodCheckNumberFormat: core.$constructor<$ZodCheckNumberFormat>;
export type $ZodBigIntFormats = "int64" | "uint64";
export interface $ZodCheckBigIntFormatDef extends $ZodCheckDef {
check: "bigint_format";
format: $ZodBigIntFormats | undefined;
}
export interface $ZodCheckBigIntFormatInternals extends $ZodCheckInternals<bigint> {
def: $ZodCheckBigIntFormatDef;
issc: errors.$ZodIssueTooBig<"bigint"> | errors.$ZodIssueTooSmall<"bigint">;
}
export interface $ZodCheckBigIntFormat extends $ZodCheck<bigint> {
_zod: $ZodCheckBigIntFormatInternals;
}
export declare const $ZodCheckBigIntFormat: core.$constructor<$ZodCheckBigIntFormat>;
export interface $ZodCheckMaxSizeDef extends $ZodCheckDef {
check: "max_size";
maximum: number;
}
export interface $ZodCheckMaxSizeInternals<T extends util.HasSize = util.HasSize> extends $ZodCheckInternals<T> {
def: $ZodCheckMaxSizeDef;
issc: errors.$ZodIssueTooBig<T>;
}
export interface $ZodCheckMaxSize<T extends util.HasSize = util.HasSize> extends $ZodCheck<T> {
_zod: $ZodCheckMaxSizeInternals<T>;
}
export declare const $ZodCheckMaxSize: core.$constructor<$ZodCheckMaxSize>;
export interface $ZodCheckMinSizeDef extends $ZodCheckDef {
check: "min_size";
minimum: number;
}
export interface $ZodCheckMinSizeInternals<T extends util.HasSize = util.HasSize> extends $ZodCheckInternals<T> {
def: $ZodCheckMinSizeDef;
issc: errors.$ZodIssueTooSmall<T>;
}
export interface $ZodCheckMinSize<T extends util.HasSize = util.HasSize> extends $ZodCheck<T> {
_zod: $ZodCheckMinSizeInternals<T>;
}
export declare const $ZodCheckMinSize: core.$constructor<$ZodCheckMinSize>;
export interface $ZodCheckSizeEqualsDef extends $ZodCheckDef {
check: "size_equals";
size: number;
}
export interface $ZodCheckSizeEqualsInternals<T extends util.HasSize = util.HasSize> extends $ZodCheckInternals<T> {
def: $ZodCheckSizeEqualsDef;
issc: errors.$ZodIssueTooBig<T> | errors.$ZodIssueTooSmall<T>;
}
export interface $ZodCheckSizeEquals<T extends util.HasSize = util.HasSize> extends $ZodCheck<T> {
_zod: $ZodCheckSizeEqualsInternals<T>;
}
export declare const $ZodCheckSizeEquals: core.$constructor<$ZodCheckSizeEquals>;
export interface $ZodCheckMaxLengthDef extends $ZodCheckDef {
check: "max_length";
maximum: number;
}
export interface $ZodCheckMaxLengthInternals<T extends util.HasLength = util.HasLength> extends $ZodCheckInternals<T> {
def: $ZodCheckMaxLengthDef;
issc: errors.$ZodIssueTooBig<T>;
}
export interface $ZodCheckMaxLength<T extends util.HasLength = util.HasLength> extends $ZodCheck<T> {
_zod: $ZodCheckMaxLengthInternals<T>;
}
export declare const $ZodCheckMaxLength: core.$constructor<$ZodCheckMaxLength>;
export interface $ZodCheckMinLengthDef extends $ZodCheckDef {
check: "min_length";
minimum: number;
}
export interface $ZodCheckMinLengthInternals<T extends util.HasLength = util.HasLength> extends $ZodCheckInternals<T> {
def: $ZodCheckMinLengthDef;
issc: errors.$ZodIssueTooSmall<T>;
}
export interface $ZodCheckMinLength<T extends util.HasLength = util.HasLength> extends $ZodCheck<T> {
_zod: $ZodCheckMinLengthInternals<T>;
}
export declare const $ZodCheckMinLength: core.$constructor<$ZodCheckMinLength>;
export interface $ZodCheckLengthEqualsDef extends $ZodCheckDef {
check: "length_equals";
length: number;
}
export interface $ZodCheckLengthEqualsInternals<T extends util.HasLength = util.HasLength> extends $ZodCheckInternals<T> {
def: $ZodCheckLengthEqualsDef;
issc: errors.$ZodIssueTooBig<T> | errors.$ZodIssueTooSmall<T>;
}
export interface $ZodCheckLengthEquals<T extends util.HasLength = util.HasLength> extends $ZodCheck<T> {
_zod: $ZodCheckLengthEqualsInternals<T>;
}
export declare const $ZodCheckLengthEquals: core.$constructor<$ZodCheckLengthEquals>;
export type $ZodStringFormats = "email" | "url" | "emoji" | "uuid" | "guid" | "nanoid" | "cuid" | "cuid2" | "ulid" | "xid" | "ksuid" | "datetime" | "date" | "time" | "duration" | "ipv4" | "ipv6" | "cidrv4" | "cidrv6" | "base64" | "base64url" | "json_string" | "e164" | "lowercase" | "uppercase" | "regex" | "jwt" | "starts_with" | "ends_with" | "includes";
export interface $ZodCheckStringFormatDef<Format extends string = string> extends $ZodCheckDef {
check: "string_format";
format: Format;
pattern?: RegExp | undefined;
}
export interface $ZodCheckStringFormatInternals extends $ZodCheckInternals<string> {
def: $ZodCheckStringFormatDef;
issc: errors.$ZodIssueInvalidStringFormat;
}
export interface $ZodCheckStringFormat extends $ZodCheck<string> {
_zod: $ZodCheckStringFormatInternals;
}
export declare const $ZodCheckStringFormat: core.$constructor<$ZodCheckStringFormat>;
export interface $ZodCheckRegexDef extends $ZodCheckStringFormatDef {
format: "regex";
pattern: RegExp;
}
export interface $ZodCheckRegexInternals extends $ZodCheckInternals<string> {
def: $ZodCheckRegexDef;
issc: errors.$ZodIssueInvalidStringFormat;
}
export interface $ZodCheckRegex extends $ZodCheck<string> {
_zod: $ZodCheckRegexInternals;
}
export declare const $ZodCheckRegex: core.$constructor<$ZodCheckRegex>;
export interface $ZodCheckLowerCaseDef extends $ZodCheckStringFormatDef<"lowercase"> {
}
export interface $ZodCheckLowerCaseInternals extends $ZodCheckInternals<string> {
def: $ZodCheckLowerCaseDef;
issc: errors.$ZodIssueInvalidStringFormat;
}
export interface $ZodCheckLowerCase extends $ZodCheck<string> {
_zod: $ZodCheckLowerCaseInternals;
}
export declare const $ZodCheckLowerCase: core.$constructor<$ZodCheckLowerCase>;
export interface $ZodCheckUpperCaseDef extends $ZodCheckStringFormatDef<"uppercase"> {
}
export interface $ZodCheckUpperCaseInternals extends $ZodCheckInternals<string> {
def: $ZodCheckUpperCaseDef;
issc: errors.$ZodIssueInvalidStringFormat;
}
export interface $ZodCheckUpperCase extends $ZodCheck<string> {
_zod: $ZodCheckUpperCaseInternals;
}
export declare const $ZodCheckUpperCase: core.$constructor<$ZodCheckUpperCase>;
export interface $ZodCheckIncludesDef extends $ZodCheckStringFormatDef<"includes"> {
includes: string;
position?: number | undefined;
}
export interface $ZodCheckIncludesInternals extends $ZodCheckInternals<string> {
def: $ZodCheckIncludesDef;
issc: errors.$ZodIssueInvalidStringFormat;
}
export interface $ZodCheckIncludes extends $ZodCheck<string> {
_zod: $ZodCheckIncludesInternals;
}
export declare const $ZodCheckIncludes: core.$constructor<$ZodCheckIncludes>;
export interface $ZodCheckStartsWithDef extends $ZodCheckStringFormatDef<"starts_with"> {
prefix: string;
}
export interface $ZodCheckStartsWithInternals extends $ZodCheckInternals<string> {
def: $ZodCheckStartsWithDef;
issc: errors.$ZodIssueInvalidStringFormat;
}
export interface $ZodCheckStartsWith extends $ZodCheck<string> {
_zod: $ZodCheckStartsWithInternals;
}
export declare const $ZodCheckStartsWith: core.$constructor<$ZodCheckStartsWith>;
export interface $ZodCheckEndsWithDef extends $ZodCheckStringFormatDef<"ends_with"> {
suffix: string;
}
export interface $ZodCheckEndsWithInternals extends $ZodCheckInternals<string> {
def: $ZodCheckEndsWithDef;
issc: errors.$ZodIssueInvalidStringFormat;
}
export interface $ZodCheckEndsWith extends $ZodCheckInternals<string> {
_zod: $ZodCheckEndsWithInternals;
}
export declare const $ZodCheckEndsWith: core.$constructor<$ZodCheckEndsWith>;
export interface $ZodCheckPropertyDef extends $ZodCheckDef {
check: "property";
property: string;
schema: schemas.$ZodType;
}
export interface $ZodCheckPropertyInternals<T extends object = object> extends $ZodCheckInternals<T> {
def: $ZodCheckPropertyDef;
issc: errors.$ZodIssue;
}
export interface $ZodCheckProperty<T extends object = object> extends $ZodCheck<T> {
_zod: $ZodCheckPropertyInternals<T>;
}
export declare const $ZodCheckProperty: core.$constructor<$ZodCheckProperty>;
export interface $ZodCheckMimeTypeDef extends $ZodCheckDef {
check: "mime_type";
mime: util.MimeTypes[];
}
export interface $ZodCheckMimeTypeInternals<T extends File = File> extends $ZodCheckInternals<T> {
def: $ZodCheckMimeTypeDef;
issc: errors.$ZodIssueInvalidValue;
}
export interface $ZodCheckMimeType<T extends File = File> extends $ZodCheck<T> {
_zod: $ZodCheckMimeTypeInternals<T>;
}
export declare const $ZodCheckMimeType: core.$constructor<$ZodCheckMimeType>;
export interface $ZodCheckOverwriteDef<T = unknown> extends $ZodCheckDef {
check: "overwrite";
tx(value: T): T;
}
export interface $ZodCheckOverwriteInternals<T = unknown> extends $ZodCheckInternals<T> {
def: $ZodCheckOverwriteDef<T>;
issc: never;
}
export interface $ZodCheckOverwrite<T = unknown> extends $ZodCheck<T> {
_zod: $ZodCheckOverwriteInternals<T>;
}
export declare const $ZodCheckOverwrite: core.$constructor<$ZodCheckOverwrite>;
export type $ZodChecks = $ZodCheckLessThan | $ZodCheckGreaterThan | $ZodCheckMultipleOf | $ZodCheckNumberFormat | $ZodCheckBigIntFormat | $ZodCheckMaxSize | $ZodCheckMinSize | $ZodCheckSizeEquals | $ZodCheckMaxLength | $ZodCheckMinLength | $ZodCheckLengthEquals | $ZodCheckStringFormat | $ZodCheckProperty | $ZodCheckMimeType | $ZodCheckOverwrite;
export type $ZodStringFormatChecks = $ZodCheckRegex | $ZodCheckLowerCase | $ZodCheckUpperCase | $ZodCheckIncludes | $ZodCheckStartsWith | $ZodCheckEndsWith | schemas.$ZodStringFormatTypes;

View File

@@ -0,0 +1,87 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { diag } from '@opentelemetry/api';
export function sanitizeAttributes(attributes) {
const out = {};
if (typeof attributes !== 'object' || attributes == null) {
return out;
}
for (const key in attributes) {
if (!Object.prototype.hasOwnProperty.call(attributes, key)) {
continue;
}
if (!isAttributeKey(key)) {
diag.warn(`Invalid attribute key: ${key}`);
continue;
}
const val = attributes[key];
if (!isAttributeValue(val)) {
diag.warn(`Invalid attribute value set for key: ${key}`);
continue;
}
if (Array.isArray(val)) {
out[key] = val.slice();
}
else {
out[key] = val;
}
}
return out;
}
export function isAttributeKey(key) {
return typeof key === 'string' && key !== '';
}
export function isAttributeValue(val) {
if (val == null) {
return true;
}
if (Array.isArray(val)) {
return isHomogeneousAttributeValueArray(val);
}
return isValidPrimitiveAttributeValueType(typeof val);
}
function isHomogeneousAttributeValueArray(arr) {
let type;
for (const element of arr) {
// null/undefined elements are allowed
if (element == null)
continue;
const elementType = typeof element;
if (elementType === type) {
continue;
}
if (!type) {
if (isValidPrimitiveAttributeValueType(elementType)) {
type = elementType;
continue;
}
// encountered an invalid primitive
return false;
}
return false;
}
return true;
}
function isValidPrimitiveAttributeValueType(valType) {
switch (valType) {
case 'number':
case 'boolean':
case 'string':
return true;
}
return false;
}
//# sourceMappingURL=attributes.js.map

View File

@@ -0,0 +1,2 @@
import { difference } from "./index";
export = difference;

View File

@@ -0,0 +1 @@
{"version":3,"file":"Tokenizer.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/htmlparser2/c123610e003a1eaebc61febed01cabb6e41eb658/src/","sources":["Tokenizer.ts"],"names":[],"mappings":"AAkHA,oBAAY,SAAS;IACjB,OAAO,IAAI;IACX,QAAQ,IAAI;IACZ,MAAM,IAAI;IACV,MAAM,IAAI;CACb;AAED,MAAM,WAAW,SAAS;IACtB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACpD,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,WAAW,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACtD,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACpD,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClE,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAClD,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACpE,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACrD,KAAK,IAAI,IAAI,CAAC;IACd,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACrD,uBAAuB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/D,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACzC,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9C,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CACzC;AAiBD,MAAM,CAAC,OAAO,OAAO,SAAS;IA2BtB,OAAO,CAAC,QAAQ,CAAC,GAAG;IA1BxB,6CAA6C;IAC7C,OAAO,CAAC,KAAK,CAAc;IAC3B,uBAAuB;IACvB,OAAO,CAAC,MAAM,CAAM;IACpB,iEAAiE;IACjE,OAAO,CAAC,YAAY,CAAK;IACzB,oEAAoE;IACpE,OAAO,CAAC,KAAK,CAAK;IAClB,kIAAkI;IAClI,OAAO,CAAC,SAAS,CAAc;IAC/B,oEAAoE;IACpE,OAAO,CAAC,SAAS,CAAS;IAC1B,uDAAuD;IAChD,OAAO,UAAQ;IACtB,wCAAwC;IACxC,OAAO,CAAC,MAAM,CAAK;IAEnB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAU;IAClC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAU;IACzC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAc;gBAGrC,EACI,OAAe,EACf,cAAqB,GACxB,EAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAC;QAAC,cAAc,CAAC,EAAE,OAAO,CAAA;KAAE,EACjC,GAAG,EAAE,SAAS;IAO5B,KAAK,IAAI,IAAI;IAWb,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAM1B,GAAG,IAAI,IAAI;IAIX,KAAK,IAAI,IAAI;IAIb,MAAM,IAAI,IAAI;IAOrB;;OAEG;IACI,QAAQ,IAAI,MAAM;IAIzB;;OAEG;IACI,eAAe,IAAI,MAAM;IAIhC,OAAO,CAAC,SAAS;IAejB,OAAO,CAAC,eAAe,CAA0B;IACjD,OAAO,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC,yBAAyB;IAoBjC,mEAAmE;IACnE,OAAO,CAAC,iBAAiB;IAwCzB,OAAO,CAAC,kBAAkB;IAe1B;;;;;OAKG;IACH,OAAO,CAAC,aAAa;IAkBrB;;;;;;;OAOG;IACH,OAAO,CAAC,kBAAkB;IAwB1B;;;;;OAKG;IACH,OAAO,CAAC,cAAc;IAItB,OAAO,CAAC,YAAY;IAOpB,OAAO,CAAC,kBAAkB;IAyB1B,OAAO,CAAC,cAAc;IAQtB,OAAO,CAAC,yBAAyB;IAYjC,OAAO,CAAC,qBAAqB;IAQ7B,OAAO,CAAC,wBAAwB;IAQhC,OAAO,CAAC,wBAAwB;IAkBhC,OAAO,CAAC,qBAAqB;IAY7B,OAAO,CAAC,oBAAoB;IAQ5B,OAAO,CAAC,uBAAuB;IAa/B,OAAO,CAAC,yBAAyB;IAajC,OAAO,CAAC,sBAAsB;IAmB9B,OAAO,CAAC,iCAAiC;IAGzC,OAAO,CAAC,iCAAiC;IAGzC,OAAO,CAAC,6BAA6B;IAYrC,OAAO,CAAC,sBAAsB;IAW9B,OAAO,CAAC,kBAAkB;IAO1B,OAAO,CAAC,4BAA4B;IAOpC,OAAO,CAAC,kBAAkB;IAW1B,OAAO,CAAC,qBAAqB;IAO7B,OAAO,CAAC,mBAAmB;IAY3B,OAAO,CAAC,SAAS,CAAK;IACtB,OAAO,CAAC,WAAW,CAAK;IACxB,wFAAwF;IACxF,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,YAAY,CAAK;IAEzB,OAAO,CAAC,iBAAiB;IAiBzB,OAAO,CAAC,kBAAkB;IAiD1B,OAAO,CAAC,eAAe;IA8BvB,OAAO,CAAC,wBAAwB;IAUhC,OAAO,CAAC,iBAAiB;IAgBzB,OAAO,CAAC,oBAAoB;IAe5B,OAAO,CAAC,gBAAgB;IAoBxB,OAAO,CAAC,iBAAiB;IAQzB;;OAEG;IACH,OAAO,CAAC,OAAO;IAoBf,OAAO,CAAC,cAAc;IAItB;;;;OAIG;IACH,OAAO,CAAC,KAAK;IA8Hb,OAAO,CAAC,MAAM;IAYd,gCAAgC;IAChC,OAAO,CAAC,kBAAkB;IAwC1B,OAAO,CAAC,WAAW;IAUnB,OAAO,CAAC,aAAa;CAUxB"}

View File

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

View File

@@ -0,0 +1,174 @@
#!/usr/bin/env node
// Standalone semver comparison program.
// Exits successfully and prints matching version(s) if
// any supplied version is valid and passes all tests.
var argv = process.argv.slice(2)
var versions = []
var range = []
var inc = null
var version = require('../package.json').version
var loose = false
var includePrerelease = false
var coerce = false
var rtl = false
var identifier
var semver = require('../semver')
var reverse = false
var options = {}
main()
function main () {
if (!argv.length) return help()
while (argv.length) {
var a = argv.shift()
var indexOfEqualSign = a.indexOf('=')
if (indexOfEqualSign !== -1) {
a = a.slice(0, indexOfEqualSign)
argv.unshift(a.slice(indexOfEqualSign + 1))
}
switch (a) {
case '-rv': case '-rev': case '--rev': case '--reverse':
reverse = true
break
case '-l': case '--loose':
loose = true
break
case '-p': case '--include-prerelease':
includePrerelease = true
break
case '-v': case '--version':
versions.push(argv.shift())
break
case '-i': case '--inc': case '--increment':
switch (argv[0]) {
case 'major': case 'minor': case 'patch': case 'prerelease':
case 'premajor': case 'preminor': case 'prepatch':
inc = argv.shift()
break
default:
inc = 'patch'
break
}
break
case '--preid':
identifier = argv.shift()
break
case '-r': case '--range':
range.push(argv.shift())
break
case '-c': case '--coerce':
coerce = true
break
case '--rtl':
rtl = true
break
case '--ltr':
rtl = false
break
case '-h': case '--help': case '-?':
return help()
default:
versions.push(a)
break
}
}
var options = { loose: loose, includePrerelease: includePrerelease, rtl: rtl }
versions = versions.map(function (v) {
return coerce ? (semver.coerce(v, options) || { version: v }).version : v
}).filter(function (v) {
return semver.valid(v)
})
if (!versions.length) return fail()
if (inc && (versions.length !== 1 || range.length)) { return failInc() }
for (var i = 0, l = range.length; i < l; i++) {
versions = versions.filter(function (v) {
return semver.satisfies(v, range[i], options)
})
if (!versions.length) return fail()
}
return success(versions)
}
function failInc () {
console.error('--inc can only be used on a single version with no range')
fail()
}
function fail () { process.exit(1) }
function success () {
var compare = reverse ? 'rcompare' : 'compare'
versions.sort(function (a, b) {
return semver[compare](a, b, options)
}).map(function (v) {
return semver.clean(v, options)
}).map(function (v) {
return inc ? semver.inc(v, inc, options, identifier) : v
}).forEach(function (v, i, _) { console.log(v) })
}
function help () {
console.log(['SemVer ' + version,
'',
'A JavaScript implementation of the https://semver.org/ specification',
'Copyright Isaac Z. Schlueter',
'',
'Usage: semver [options] <version> [<version> [...]]',
'Prints valid versions sorted by SemVer precedence',
'',
'Options:',
'-r --range <range>',
' Print versions that match the specified range.',
'',
'-i --increment [<level>]',
' Increment a version by the specified level. Level can',
' be one of: major, minor, patch, premajor, preminor,',
" prepatch, or prerelease. Default level is 'patch'.",
' Only one version may be specified.',
'',
'--preid <identifier>',
' Identifier to be used to prefix premajor, preminor,',
' prepatch or prerelease version increments.',
'',
'-l --loose',
' Interpret versions and ranges loosely',
'',
'-p --include-prerelease',
' Always include prerelease versions in range matching',
'',
'-c --coerce',
' Coerce a string into SemVer if possible',
' (does not imply --loose)',
'',
'--rtl',
' Coerce version strings right to left',
'',
'--ltr',
' Coerce version strings left to right (default)',
'',
'Program exits successfully if any valid version satisfies',
'all supplied ranges, and prints all satisfying versions.',
'',
'If no satisfying versions are found, then exits failure.',
'',
'Versions are printed in ascending order, so supplying',
'multiple versions to the utility will just sort them.'
].join('\n'))
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"layouts.d.ts","sourceRoot":"","sources":["../../src/exports/layouts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAA"}

View File

@@ -0,0 +1,109 @@
import type * as http from 'node:http';
import type { InstrumentationConfig } from '@opentelemetry/instrumentation';
import { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
import type { Span } from '@sentry/core';
export type SentryHttpInstrumentationOptions = InstrumentationConfig & {
/**
* Whether breadcrumbs should be recorded for outgoing requests.
*
* @default `true`
*/
breadcrumbs?: boolean;
/**
* Whether to propagate Sentry trace headers in outgoing requests.
* By default this is done by the HttpInstrumentation, but if that is not added (e.g. because tracing is disabled)
* then this instrumentation can take over.
*
* @default `false`
*/
propagateTraceInOutgoingRequests?: boolean;
/**
* Do not capture breadcrumbs for outgoing HTTP requests to URLs where the given callback returns `true`.
* For the scope of this instrumentation, this callback only controls breadcrumb creation.
* The same option can be passed to the top-level httpIntegration where it controls both, breadcrumb and
* span creation.
*
* @param url Contains the entire URL, including query string (if any), protocol, host, etc. of the outgoing request.
* @param request Contains the {@type RequestOptions} object used to make the outgoing request.
*/
ignoreOutgoingRequests?: (url: string, request: http.RequestOptions) => boolean;
/**
* @deprecated This no longer does anything.
*/
spans?: boolean;
/**
* @depreacted This no longer does anything.
*/
extractIncomingTraceFromHeader?: boolean;
/**
* @deprecated This no longer does anything.
*/
ignoreStaticAssets?: boolean;
/**
* @deprecated This no longer does anything.
*/
disableIncomingRequestSpans?: boolean;
/**
* @deprecated This no longer does anything.
*/
ignoreSpansForIncomingRequests?: (urlPath: string, request: http.IncomingMessage) => boolean;
/**
* @deprecated This no longer does anything.
*/
ignoreIncomingRequestBody?: (url: string, request: http.RequestOptions) => boolean;
/**
* @deprecated This no longer does anything.
*/
maxIncomingRequestBodySize?: 'none' | 'small' | 'medium' | 'always';
/**
* @deprecated This no longer does anything.
*/
trackIncomingRequestsAsSessions?: boolean;
/**
* @deprecated This no longer does anything.
*/
instrumentation?: {
requestHook?: (span: Span, req: http.ClientRequest | http.IncomingMessage) => void;
responseHook?: (span: Span, response: http.IncomingMessage | http.ServerResponse) => void;
applyCustomAttributesOnSpan?: (span: Span, request: http.ClientRequest | http.IncomingMessage, response: http.IncomingMessage | http.ServerResponse) => void;
};
/**
* @deprecated This no longer does anything.
*/
sessionFlushingDelayMS?: number;
};
/**
* This custom HTTP instrumentation is used to isolate incoming requests and annotate them with additional information.
* It does not emit any spans.
*
* The reason this is isolated from the OpenTelemetry instrumentation is that users may overwrite this,
* which would lead to Sentry not working as expected.
*
* Important note: Contrary to other OTEL instrumentation, this one cannot be unwrapped.
* It only does minimal things though and does not emit any spans.
*
* This is heavily inspired & adapted from:
* https://github.com/open-telemetry/opentelemetry-js/blob/f8ab5592ddea5cba0a3b33bf8d74f27872c0367f/experimental/packages/opentelemetry-instrumentation-http/src/http.ts
*/
export declare class SentryHttpInstrumentation extends InstrumentationBase<SentryHttpInstrumentationOptions> {
private _propagationDecisionMap;
private _ignoreOutgoingRequestsMap;
constructor(config?: SentryHttpInstrumentationOptions);
/** @inheritdoc */
init(): [InstrumentationNodeModuleDefinition, InstrumentationNodeModuleDefinition];
/**
* This is triggered when an outgoing request finishes.
* It has access to the final request and response objects.
*/
private _onOutgoingRequestFinish;
/**
* This is triggered when an outgoing request is created.
* It has access to the request object, and can mutate it before the request is sent.
*/
private _onOutgoingRequestCreated;
/**
* Check if the given outgoing request should be ignored.
*/
private _shouldIgnoreOutgoingRequest;
}
//# sourceMappingURL=SentryHttpInstrumentation.d.ts.map

View File

@@ -0,0 +1,33 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
/** @typedef {import("./ModuleFactory").ModuleFactoryCallback} ModuleFactoryCallback */
/** @typedef {import("./ModuleFactory").ModuleFactoryCreateData} ModuleFactoryCreateData */
/** @typedef {import("./ModuleGraph")} ModuleGraph */
class SelfModuleFactory {
/**
* @param {ModuleGraph} moduleGraph module graph
*/
constructor(moduleGraph) {
this.moduleGraph = moduleGraph;
}
/**
* @param {ModuleFactoryCreateData} data data object
* @param {ModuleFactoryCallback} callback callback
* @returns {void}
*/
create(data, callback) {
const module = this.moduleGraph.getParentModule(data.dependencies[0]);
callback(null, {
module
});
}
}
module.exports = SelfModuleFactory;

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E zC","132":"A B","388":"F"},B:{"1":"0 1 2 3 4 5 6 7 8 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I","132":"C L M G N O P"},C:{"1":"0 1 2 3 4 5 6 7 8 yB zB 0B 1B 2B 3B 4B 5B WC 6B XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R YC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC 1C 2C 3C","16":"0C VC 4C 5C","132":"9 K D E F A B C L M G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB","388":"J bB"},D:{"1":"0 1 2 3 4 5 6 7 8 mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B WC 6B XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC","16":"J bB K D E F A B C L M","132":"9 G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB"},E:{"1":"B C L M G cC PC QC BD CD DD dC eC RC ED SC fC gC hC iC jC FD TC kC lC mC nC oC GD UC pC qC rC sC HD tC uC vC wC ID","16":"J bB K 6C bC","132":"D E F A 8C 9C AD","388":"7C"},F:{"1":"0 1 2 3 4 5 6 7 8 FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R YC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","16":"F B JD KD LD MD PC xC","132":"9 G N O P cB AB BB CB DB EB","516":"C ND QC"},G:{"1":"WD XD YD ZD aD bD cD dD eD fD gD hD dC eC RC iD SC fC gC hC iC jC jD TC kC lC mC nC oC kD UC pC qC rC sC lD tC uC vC wC","16":"bC OD yC PD QD","132":"E RD SD TD UD VD"},H:{"516":"mD"},I:{"1":"I","16":"VC nD oD pD sD","132":"rD","388":"J qD yC"},J:{"16":"D","132":"A"},K:{"1":"H","16":"A B C PC xC","516":"QC"},L:{"1":"I"},M:{"1":"OC"},N:{"132":"A B"},O:{"1":"RC"},P:{"1":"9 J AB BB CB DB EB FB GB HB IB tD uD vD wD xD cC yD zD 0D 1D 2D SC TC UC 3D"},Q:{"1":"4D"},R:{"1":"5D"},S:{"1":"7D","132":"6D"}},B:5,C:":indeterminate CSS pseudo-class",D:true};

View File

@@ -0,0 +1,21 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.default = camelizeStyleName;
var _camelize = _interopRequireDefault(require("./camelize"));
/**
* Copyright 2014-2015, Facebook, Inc.
* All rights reserved.
* https://github.com/facebook/react/blob/2aeb8a2a6beb00617a4217f7f8284924fa2ad819/src/vendor/core/camelizeStyleName.js
*/
var msPattern = /^-ms-/;
function camelizeStyleName(string) {
return (0, _camelize.default)(string.replace(msPattern, 'ms-'));
}
module.exports = exports["default"];

View File

@@ -0,0 +1 @@
module.exports={C:{"5":0.03101,"52":0.00443,"112":0.00443,"115":0.14176,"127":0.00443,"128":0.00443,"133":0.00443,"134":0.00443,"135":0.00443,"136":0.00443,"138":0.00443,"139":0.00443,"140":0.01329,"141":0.00443,"142":0.00443,"143":0.00443,"144":0.00886,"145":0.20378,"146":0.30124,"147":0.00443,_:"2 3 4 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 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 113 114 116 117 118 119 120 121 122 123 124 125 126 129 130 131 132 137 148 149 3.5 3.6"},D:{"43":0.00443,"49":0.00443,"50":0.00443,"56":0.00443,"62":0.00443,"63":0.00443,"64":0.00443,"65":0.00443,"66":0.00443,"68":0.01329,"69":0.03544,"70":0.00443,"71":0.00886,"72":0.00886,"73":0.00443,"74":0.01772,"75":0.00886,"76":0.00443,"77":0.01329,"78":0.00443,"79":0.00886,"80":0.01329,"81":0.00886,"83":0.00443,"84":0.00443,"85":0.00443,"86":0.00886,"87":0.01329,"88":0.00443,"89":0.00443,"91":0.00886,"93":0.01772,"95":0.00443,"96":0.00443,"100":0.00443,"102":0.01772,"103":0.19049,"104":0.11961,"105":0.09303,"106":0.09746,"107":0.09303,"108":0.09746,"109":1.48405,"110":0.09303,"111":0.12404,"112":5.86089,"113":0.00443,"114":0.01329,"115":0.00443,"116":0.23479,"117":0.09303,"119":0.01329,"120":0.10632,"121":0.00886,"122":0.06202,"123":0.00886,"124":0.10189,"125":1.61695,"126":1.53721,"127":0.01329,"128":0.02215,"129":0.01772,"130":0.03987,"131":0.25251,"132":0.20821,"133":0.21264,"134":0.03544,"135":0.04873,"136":0.0443,"137":0.06202,"138":0.2215,"139":0.09303,"140":0.19492,"141":0.68665,"142":7.72149,"143":9.57323,"144":0.01772,"145":0.00886,_:"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 44 45 46 47 48 51 52 53 54 55 57 58 59 60 61 67 90 92 94 97 98 99 101 118 146"},F:{"92":0.00886,"93":0.07974,"94":0.00443,"95":0.02658,"114":0.00443,"122":0.00443,"123":0.00443,"124":0.29238,"125":0.15505,_:"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 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 115 116 117 118 119 120 121 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"12":0.00886,"15":0.00443,"16":0.00443,"18":0.01772,"92":0.03544,"109":0.00886,"113":0.00443,"114":0.01772,"122":0.00443,"131":0.01329,"132":0.01329,"133":0.00443,"134":0.00443,"135":0.00886,"136":0.00886,"137":0.00443,"138":0.00443,"139":0.01772,"140":0.00886,"141":0.01772,"142":0.34554,"143":1.01004,_:"13 14 17 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 115 116 117 118 119 120 121 123 124 125 126 127 128 129 130"},E:{_:"0 4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 6.1 7.1 9.1 10.1 11.1 12.1 15.1 15.4 15.5 16.0 16.1 16.2 16.3 16.4 16.5 17.0 18.1 26.3","5.1":0.00443,"13.1":0.00443,"14.1":0.00443,"15.2-15.3":0.00443,"15.6":0.02658,"16.6":0.01329,"17.1":0.01329,"17.2":0.00443,"17.3":0.00443,"17.4":0.00443,"17.5":0.00443,"17.6":0.02215,"18.0":0.00443,"18.2":0.00886,"18.3":0.00886,"18.4":0.00886,"18.5-18.6":0.01329,"26.0":0.01772,"26.1":0.03544,"26.2":0.01772},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00056,"5.0-5.1":0,"6.0-6.1":0.00112,"7.0-7.1":0.00084,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.00225,"10.0-10.2":0.00028,"10.3":0.00393,"11.0-11.2":0.04829,"11.3-11.4":0.0014,"12.0-12.1":0.00112,"12.2-12.5":0.01263,"13.0-13.1":0.00028,"13.2":0.00197,"13.3":0.00056,"13.4-13.7":0.00197,"14.0-14.4":0.00393,"14.5-14.8":0.00421,"15.0-15.1":0.00449,"15.2-15.3":0.00337,"15.4":0.00365,"15.5":0.00393,"15.6-15.8":0.06092,"16.0":0.00702,"16.1":0.01347,"16.2":0.00702,"16.3":0.01263,"16.4":0.00309,"16.5":0.00533,"16.6-16.7":0.07917,"17.0":0.00449,"17.1":0.0073,"17.2":0.00533,"17.3":0.00814,"17.4":0.01376,"17.5":0.02695,"17.6-17.7":0.06232,"18.0":0.01404,"18.1":0.0292,"18.2":0.01544,"18.3":0.05025,"18.4":0.02583,"18.5-18.7":1.85449,"26.0":0.03621,"26.1":0.30122,"26.2":0.05727,"26.3":0.00253},P:{"4":0.02155,"22":0.01077,"23":0.01077,"24":0.01077,"25":0.02155,"26":0.0431,"27":0.01077,"28":0.05387,"29":0.44176,_:"20 21 5.0-5.4 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 18.0 19.0","7.2-7.4":0.01077,"17.0":0.02155},I:{"0":0.04449,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00001,"4.4":0,"4.4.3-4.4.4":0.00004},A:{"8":0.01071,"10":0.01071,"11":0.10706,_:"6 7 9 5.5"},K:{"0":1.74253,_:"10 11 12 11.1 11.5 12.1"},N:{_:"10 11"},S:{"2.5":0.06127,_:"3.0-3.1"},J:{_:"7 10"},Q:{"14.9":0.00557},O:{"0":0.53472},H:{"0":0.09},L:{"0":58.41186},R:{_:"0"},M:{"0":0.05013}};

View File

@@ -0,0 +1,39 @@
import { buildFormatLongFn } from "../../_lib/buildFormatLongFn.js";
const dateFormats = {
full: "EEEE d. MMMM y",
long: "d. MMMM y",
medium: "d. MMM y",
short: "dd.MM.y",
};
const timeFormats = {
full: "'kl'. HH:mm:ss zzzz",
long: "HH:mm:ss z",
medium: "HH:mm:ss",
short: "HH:mm",
};
const dateTimeFormats = {
full: "{{date}} 'kl.' {{time}}",
long: "{{date}} 'kl.' {{time}}",
medium: "{{date}} {{time}}",
short: "{{date}} {{time}}",
};
export const formatLong = {
date: buildFormatLongFn({
formats: dateFormats,
defaultWidth: "full",
}),
time: buildFormatLongFn({
formats: timeFormats,
defaultWidth: "full",
}),
dateTime: buildFormatLongFn({
formats: dateTimeFormats,
defaultWidth: "full",
}),
};

View File

@@ -0,0 +1,132 @@
import { buildMatchFn } from "../../_lib/buildMatchFn.mjs";
import { buildMatchPatternFn } from "../../_lib/buildMatchPatternFn.mjs";
const matchOrdinalNumberPattern = /^(\d+)(ye|yèm)?/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(av\.J\.K|ap\.J\.K|ap\.J\.-K)/i,
abbreviated: /^(av\.J\.-K|av\.J-K|apr\.J\.-K|apr\.J-K|ap\.J-K)/i,
wide: /^(avan Jezi Kris|apre Jezi Kris)/i,
};
const parseEraPatterns = {
any: [/^av/i, /^ap/i],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^t[1234]/i,
wide: /^[1234](ye|yèm)? trimès/i,
};
const parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i],
};
const matchMonthPatterns = {
narrow: /^[jfmasond]/i,
abbreviated: /^(janv|fevr|mas|avr|me|jen|jiyè|out|sept|okt|nov|des)\.?/i,
wide: /^(janvye|fevrye|mas|avril|me|jen|jiyè|out|septanm|oktòb|novanm|desanm)/i,
};
const parseMonthPatterns = {
narrow: [
/^j/i,
/^f/i,
/^m/i,
/^a/i,
/^m/i,
/^j/i,
/^j/i,
/^o/i,
/^s/i,
/^o/i,
/^n/i,
/^d/i,
],
any: [
/^ja/i,
/^f/i,
/^ma/i,
/^av/i,
/^me/i,
/^je/i,
/^ji/i,
/^ou/i,
/^s/i,
/^ok/i,
/^n/i,
/^d/i,
],
};
const matchDayPatterns = {
narrow: /^[lmjvsd]/i,
short: /^(di|le|ma|me|je|va|sa)/i,
abbreviated: /^(dim|len|mad|mèk|jed|van|sam)\.?/i,
wide: /^(dimanch|lendi|madi|mèkredi|jedi|vandredi|samdi)/i,
};
const parseDayPatterns = {
narrow: [/^d/i, /^l/i, /^m/i, /^m/i, /^j/i, /^v/i, /^s/i],
any: [/^di/i, /^le/i, /^ma/i, /^mè/i, /^je/i, /^va/i, /^sa/i],
};
const matchDayPeriodPatterns = {
narrow: /^(a|p|minwit|midi|mat\.?|ap\.?m\.?|swa)/i,
any: /^([ap]\.?\s?m\.?|nan maten|nan aprèmidi|nan aswè)/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^a/i,
pm: /^p/i,
midnight: /^min/i,
noon: /^mid/i,
morning: /mat/i,
afternoon: /ap/i,
evening: /sw/i,
night: /nwit/i,
},
};
export const match = {
ordinalNumber: buildMatchPatternFn({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: (value) => parseInt(value, 10),
}),
era: buildMatchFn({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any",
}),
quarter: buildMatchFn({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: (index) => index + 1,
}),
month: buildMatchFn({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any",
}),
day: buildMatchFn({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: buildMatchFn({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
};

View File

@@ -0,0 +1,21 @@
import { defineIntegration, isBrowser, consoleSandbox } from '@sentry/core';
/**
* This is a shim for the Statsig integration.
* We need this in order to not throw runtime errors when accidentally importing this on the server through a meta framework like Next.js.
*/
const statsigIntegrationShim = defineIntegration((_options) => {
if (!isBrowser()) {
consoleSandbox(() => {
// eslint-disable-next-line no-console
console.warn('The statsigIntegration() can only be used in the browser.');
});
}
return {
name: 'Statsig',
};
});
export { statsigIntegrationShim };
//# sourceMappingURL=statsig.js.map

View File

@@ -0,0 +1,15 @@
"use strict";
exports.formatRelative = void 0;
const formatRelativeLocale = {
lastWeek: "eeee 'گذشته در' p",
yesterday: "'دیروز در' p",
today: "'امروز در' p",
tomorrow: "'فردا در' p",
nextWeek: "eeee 'در' p",
other: "P",
};
const formatRelative = (token, _date, _baseDate, _options) =>
formatRelativeLocale[token];
exports.formatRelative = formatRelative;

View File

@@ -0,0 +1,65 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const equal = require("fast-deep-equal");
const SCALAR_TYPES = ["number", "integer", "string", "boolean", "null"];
function getDef() {
return {
keyword: "uniqueItemProperties",
type: "array",
schemaType: "array",
compile(keys, parentSchema) {
const scalar = getScalarKeys(keys, parentSchema);
return (data) => {
if (data.length <= 1)
return true;
for (let k = 0; k < keys.length; k++) {
const key = keys[k];
if (scalar[k]) {
const hash = {};
for (const x of data) {
if (!x || typeof x != "object")
continue;
let p = x[key];
if (p && typeof p == "object")
continue;
if (typeof p == "string")
p = '"' + p;
if (hash[p])
return false;
hash[p] = true;
}
}
else {
for (let i = data.length; i--;) {
const x = data[i];
if (!x || typeof x != "object")
continue;
for (let j = i; j--;) {
const y = data[j];
if (y && typeof y == "object" && equal(x[key], y[key]))
return false;
}
}
}
}
return true;
};
},
metaSchema: {
type: "array",
items: { type: "string" },
},
};
}
exports.default = getDef;
function getScalarKeys(keys, schema) {
return keys.map((key) => {
var _a, _b, _c;
const t = (_c = (_b = (_a = schema.items) === null || _a === void 0 ? void 0 : _a.properties) === null || _b === void 0 ? void 0 : _b[key]) === null || _c === void 0 ? void 0 : _c.type;
return Array.isArray(t)
? !t.includes("object") && !t.includes("array")
: SCALAR_TYPES.includes(t);
});
}
module.exports = getDef;
//# sourceMappingURL=uniqueItemProperties.js.map

View File

@@ -0,0 +1,9 @@
import type { Locale } from "./types.js";
/**
* @category Locales
* @summary Gujarati locale (India).
* @language Gujarati
* @iso-639-2 guj
* @author Manaday Mavani [@ManadayM](https://github.com/manadaym)
*/
export declare const gu: Locale;

View File

@@ -0,0 +1 @@
{"version":3,"file":"LockedAuth.d.ts","sourceRoot":"","sources":["../../src/errors/LockedAuth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAKzD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC,qBAAa,UAAW,SAAQ,QAAQ;gBAC1B,CAAC,CAAC,EAAE,SAAS;CAG1B"}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/fields/hooks/beforeChange/index.ts"],"sourcesContent":["import type { SanitizedCollectionConfig } from '../../../collections/config/types.js'\nimport type { ValidationFieldError } from '../../../errors/index.js'\nimport type { SanitizedGlobalConfig } from '../../../globals/config/types.js'\nimport type { RequestContext } from '../../../index.js'\nimport type { JsonObject, Operation, PayloadRequest } from '../../../types/index.js'\n\nimport { ValidationError } from '../../../errors/index.js'\nimport { deepCopyObjectSimple } from '../../../utilities/deepCopyObject.js'\nimport { traverseFields } from './traverseFields.js'\n\nexport type Args<T extends JsonObject> = {\n collection: null | SanitizedCollectionConfig\n context: RequestContext\n data: T\n doc: T\n docWithLocales: JsonObject\n global: null | SanitizedGlobalConfig\n id?: number | string\n operation: Operation\n overrideAccess?: boolean\n req: PayloadRequest\n skipValidation?: boolean\n}\n\n/**\n * This function is responsible for the following actions, in order:\n * - Run condition\n * - Execute field hooks\n * - Validate data\n * - Transform data for storage\n * - Unflatten locales. The input `data` is the normal document for one locale. The output result will become the document with locales.\n */\n\nexport const beforeChange = async <T extends JsonObject>({\n id,\n collection,\n context,\n data: incomingData,\n doc,\n docWithLocales,\n global,\n operation,\n overrideAccess,\n req,\n skipValidation,\n}: Args<T>): Promise<T> => {\n const data = deepCopyObjectSimple(incomingData)\n const mergeLocaleActions: (() => Promise<void> | void)[] = []\n const errors: ValidationFieldError[] = []\n\n await traverseFields({\n id,\n collection,\n context,\n data,\n doc,\n docWithLocales,\n errors,\n fieldLabelPath: '',\n fields: (collection?.fields || global?.fields)!,\n global,\n mergeLocaleActions,\n operation,\n overrideAccess: overrideAccess!,\n parentIndexPath: '',\n parentIsLocalized: false,\n parentPath: '',\n parentSchemaPath: '',\n req,\n siblingData: data,\n siblingDoc: doc,\n siblingDocWithLocales: docWithLocales,\n skipValidation,\n })\n\n if (errors.length > 0) {\n throw new ValidationError(\n {\n id,\n collection: collection?.slug,\n errors,\n global: global?.slug,\n req,\n },\n req.t,\n )\n }\n\n for (const action of mergeLocaleActions) {\n await action()\n }\n\n return data\n}\n"],"names":["ValidationError","deepCopyObjectSimple","traverseFields","beforeChange","id","collection","context","data","incomingData","doc","docWithLocales","global","operation","overrideAccess","req","skipValidation","mergeLocaleActions","errors","fieldLabelPath","fields","parentIndexPath","parentIsLocalized","parentPath","parentSchemaPath","siblingData","siblingDoc","siblingDocWithLocales","length","slug","t","action"],"mappings":"AAMA,SAASA,eAAe,QAAQ,2BAA0B;AAC1D,SAASC,oBAAoB,QAAQ,uCAAsC;AAC3E,SAASC,cAAc,QAAQ,sBAAqB;AAgBpD;;;;;;;CAOC,GAED,OAAO,MAAMC,eAAe,OAA6B,EACvDC,EAAE,EACFC,UAAU,EACVC,OAAO,EACPC,MAAMC,YAAY,EAClBC,GAAG,EACHC,cAAc,EACdC,MAAM,EACNC,SAAS,EACTC,cAAc,EACdC,GAAG,EACHC,cAAc,EACN;IACR,MAAMR,OAAON,qBAAqBO;IAClC,MAAMQ,qBAAqD,EAAE;IAC7D,MAAMC,SAAiC,EAAE;IAEzC,MAAMf,eAAe;QACnBE;QACAC;QACAC;QACAC;QACAE;QACAC;QACAO;QACAC,gBAAgB;QAChBC,QAASd,YAAYc,UAAUR,QAAQQ;QACvCR;QACAK;QACAJ;QACAC,gBAAgBA;QAChBO,iBAAiB;QACjBC,mBAAmB;QACnBC,YAAY;QACZC,kBAAkB;QAClBT;QACAU,aAAajB;QACbkB,YAAYhB;QACZiB,uBAAuBhB;QACvBK;IACF;IAEA,IAAIE,OAAOU,MAAM,GAAG,GAAG;QACrB,MAAM,IAAI3B,gBACR;YACEI;YACAC,YAAYA,YAAYuB;YACxBX;YACAN,QAAQA,QAAQiB;YAChBd;QACF,GACAA,IAAIe,CAAC;IAET;IAEA,KAAK,MAAMC,UAAUd,mBAAoB;QACvC,MAAMc;IACR;IAEA,OAAOvB;AACT,EAAC"}

View File

@@ -0,0 +1,16 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const SquareCheck = createLucideIcon("SquareCheck", [
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
]);
export { SquareCheck as default };
//# sourceMappingURL=square-check.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"job.d.ts","sourceRoot":"","sources":["../../../src/versions/schedule/job.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAA;AACxE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAA;AAE1D,KAAK,IAAI,GAAG;IACV,aAAa,EAAE,MAAM,CAAA;IACrB,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,sBAAsB,6CAIhC,IAAI,KAAG,UAAU,CAAC;IAAE,KAAK,EAAE,wBAAwB,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CA+FvE,CAAA"}

View File

@@ -0,0 +1,15 @@
// lib/types/utils.ts
new TextDecoder();
var getView = (input, offset) => new DataView(input.buffer, input.byteOffset + offset);
var readUInt32LE = (input, offset = 0) => getView(input, offset).getUint32(0, true);
// lib/types/dds.ts
var DDS = {
validate: (input) => readUInt32LE(input, 0) === 542327876,
calculate: (input) => ({
height: readUInt32LE(input, 12),
width: readUInt32LE(input, 16)
})
};
export { DDS };

View File

@@ -0,0 +1 @@
{"version":3,"file":"ListEmptyTrashButton.d.ts","sourceRoot":"","sources":["../../../../src/elements/ListHeader/TitleActions/ListEmptyTrashButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAOrD,OAAO,KAAK,MAAM,OAAO,CAAA;AAczB,wBAAgB,oBAAoB,CAAC,EACnC,gBAAgB,EAChB,mBAAmB,GACpB,EAAE;IACD,gBAAgB,EAAE,sBAAsB,CAAA;IACxC,mBAAmB,EAAE,OAAO,CAAA;CAC7B,qBA+KA"}

View File

@@ -0,0 +1,22 @@
The MIT License (MIT)
Copyright (c) 2016 David Frank
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,28 @@
"use strict";
exports.enZA = void 0;
var _index = require("./en-US/_lib/formatDistance.cjs");
var _index2 = require("./en-US/_lib/formatRelative.cjs");
var _index3 = require("./en-US/_lib/localize.cjs");
var _index4 = require("./en-US/_lib/match.cjs");
var _index5 = require("./en-ZA/_lib/formatLong.cjs");
/**
* @category Locales
* @summary English locale (South Africa).
* @language English
* @iso-639-2 eng
* @author Shaila Kavrakova [@shaykav](https://github.com/shaykav)
*/
const enZA = (exports.enZA = {
code: "en-ZA",
formatDistance: _index.formatDistance,
formatLong: _index5.formatLong,
formatRelative: _index2.formatRelative,
localize: _index3.localize,
match: _index4.match,
options: {
weekStartsOn: 0, // Sunday is the first day of the week.
firstWeekContainsDate: 1, // The week that contains Jan 1st is the first week of the year.
},
});

View File

@@ -0,0 +1,17 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const UsersRound = createLucideIcon("UsersRound", [
["path", { d: "M18 21a8 8 0 0 0-16 0", key: "3ypg7q" }],
["circle", { cx: "10", cy: "8", r: "5", key: "o932ke" }],
["path", { d: "M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3", key: "10s06x" }]
]);
export { UsersRound as default };
//# sourceMappingURL=users-round.js.map

View File

@@ -0,0 +1,97 @@
'use strict'
const os = require('node:os')
const { join } = require('node:path')
const { readFile } = require('node:fs').promises
const { watchFileCreated, file } = require('../helper')
const { test } = require('tap')
const pino = require('../../pino')
const { pid } = process
const hostname = os.hostname()
test('pino.transport with destination overridden by bundler', async ({ same, teardown }) => {
globalThis.__bundlerPathsOverrides = {
foobar: join(__dirname, '..', 'fixtures', 'to-file-transport.js')
}
const destination = file()
const transport = pino.transport({
target: 'foobar',
options: { destination }
})
teardown(transport.end.bind(transport))
const instance = pino(transport)
instance.info('hello')
await watchFileCreated(destination)
const result = JSON.parse(await readFile(destination))
delete result.time
same(result, {
pid,
hostname,
level: 30,
msg: 'hello'
})
globalThis.__bundlerPathsOverrides = undefined
})
test('pino.transport with worker destination overridden by bundler', async ({ same, teardown }) => {
globalThis.__bundlerPathsOverrides = {
'pino-worker': join(__dirname, '..', '..', 'lib/worker.js')
}
const destination = file()
const transport = pino.transport({
targets: [
{
target: join(__dirname, '..', 'fixtures', 'to-file-transport.js'),
options: { destination }
}
]
})
teardown(transport.end.bind(transport))
const instance = pino(transport)
instance.info('hello')
await watchFileCreated(destination)
const result = JSON.parse(await readFile(destination))
delete result.time
same(result, {
pid,
hostname,
level: 30,
msg: 'hello'
})
globalThis.__bundlerPathsOverrides = undefined
})
test('pino.transport with worker destination overridden by bundler and mjs transport', async ({ same, teardown }) => {
globalThis.__bundlerPathsOverrides = {
'pino-worker': join(__dirname, '..', '..', 'lib/worker.js')
}
const destination = file()
const transport = pino.transport({
targets: [
{
target: join(__dirname, '..', 'fixtures', 'ts', 'to-file-transport.es2017.cjs'),
options: { destination }
}
]
})
teardown(transport.end.bind(transport))
const instance = pino(transport)
instance.info('hello')
await watchFileCreated(destination)
const result = JSON.parse(await readFile(destination))
delete result.time
same(result, {
pid,
hostname,
level: 30,
msg: 'hello'
})
globalThis.__bundlerPathsOverrides = undefined
})

View File

@@ -0,0 +1,94 @@
import * as core from "./core.js";
import * as errors from "./errors.js";
import type * as schemas from "./schemas.js";
import * as util from "./util.js";
export type $ZodErrorClass = { new (issues: errors.$ZodIssue[]): errors.$ZodError };
/////////// METHODS ///////////
export type $Parse = <T extends schemas.$ZodType>(
schema: T,
value: unknown,
_ctx?: schemas.ParseContext<errors.$ZodIssue>,
_params?: { callee?: util.AnyFunc; Err?: $ZodErrorClass }
) => core.output<T>;
export const _parse: (_Err: $ZodErrorClass) => $Parse = (_Err) => (schema, value, _ctx, _params) => {
const ctx: schemas.ParseContextInternal = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
const result = schema._zod.run({ value, issues: [] }, ctx);
if (result instanceof Promise) {
throw new core.$ZodAsyncError();
}
if (result.issues.length) {
const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())));
util.captureStackTrace(e, _params?.callee);
throw e;
}
return result.value as core.output<typeof schema>;
};
export const parse: $Parse = /* @__PURE__*/ _parse(errors.$ZodRealError);
export type $ParseAsync = <T extends schemas.$ZodType>(
schema: T,
value: unknown,
_ctx?: schemas.ParseContext<errors.$ZodIssue>,
_params?: { callee?: util.AnyFunc; Err?: $ZodErrorClass }
) => Promise<core.output<T>>;
export const _parseAsync: (_Err: $ZodErrorClass) => $ParseAsync = (_Err) => async (schema, value, _ctx, params) => {
const ctx: schemas.ParseContextInternal = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
let result = schema._zod.run({ value, issues: [] }, ctx);
if (result instanceof Promise) result = await result;
if (result.issues.length) {
const e = new (params?.Err ?? _Err)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())));
util.captureStackTrace(e, params?.callee);
throw e;
}
return result.value as core.output<typeof schema>;
};
export const parseAsync: $ParseAsync = /* @__PURE__*/ _parseAsync(errors.$ZodRealError);
export type $SafeParse = <T extends schemas.$ZodType>(
schema: T,
value: unknown,
_ctx?: schemas.ParseContext<errors.$ZodIssue>
) => util.SafeParseResult<core.output<T>>;
export const _safeParse: (_Err: $ZodErrorClass) => $SafeParse = (_Err) => (schema, value, _ctx) => {
const ctx: schemas.ParseContextInternal = _ctx ? { ..._ctx, async: false } : { async: false };
const result = schema._zod.run({ value, issues: [] }, ctx);
if (result instanceof Promise) {
throw new core.$ZodAsyncError();
}
return result.issues.length
? {
success: false,
error: new (_Err ?? errors.$ZodError)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),
}
: ({ success: true, data: result.value } as any);
};
export const safeParse: $SafeParse = /* @__PURE__*/ _safeParse(errors.$ZodRealError);
export type $SafeParseAsync = <T extends schemas.$ZodType>(
schema: T,
value: unknown,
_ctx?: schemas.ParseContext<errors.$ZodIssue>
) => Promise<util.SafeParseResult<core.output<T>>>;
export const _safeParseAsync: (_Err: $ZodErrorClass) => $SafeParseAsync = (_Err) => async (schema, value, _ctx) => {
const ctx: schemas.ParseContextInternal = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
let result = schema._zod.run({ value, issues: [] }, ctx);
if (result instanceof Promise) result = await result;
return result.issues.length
? {
success: false,
error: new _Err(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),
}
: ({ success: true, data: result.value } as any);
};
export const safeParseAsync: $SafeParseAsync = /* @__PURE__*/ _safeParseAsync(errors.$ZodRealError);

View File

@@ -0,0 +1,29 @@
import { formatDistance } from "./is/_lib/formatDistance.mjs";
import { formatLong } from "./is/_lib/formatLong.mjs";
import { formatRelative } from "./is/_lib/formatRelative.mjs";
import { localize } from "./is/_lib/localize.mjs";
import { match } from "./is/_lib/match.mjs";
/**
* @category Locales
* @summary Icelandic locale.
* @language Icelandic
* @iso-639-2 isl
* @author Derek Blank [@derekblank](https://github.com/derekblank)
* @author Arnór Ýmir [@lamayg](https://github.com/lamayg)
*/
export const is = {
code: "is",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 1 /* Monday */,
firstWeekContainsDate: 4,
},
};
// Fallback for modularized imports:
export default is;

View File

@@ -0,0 +1,176 @@
'use client';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Fragment, useState, useRef, useEffect, useCallback, useReducer, } from 'react';
import { disableBodyScroll, enableBodyScroll } from 'body-scroll-lock';
import { generateCSS } from './generateCSS.js';
import { ModalContext } from './context.js';
import { reducer } from './reducer.js';
const getSearchQuery = () => {
if (typeof window !== 'undefined') {
return new URLSearchParams(window.location.search);
}
};
const getModalParamArray = () => {
const searchQuery = getSearchQuery();
let params = [];
if (searchQuery) {
const modalParam = searchQuery.get('modal');
if (modalParam) {
// Check if the parameter contains a comma, indicating multiple values
if (modalParam.includes(',')) {
params = modalParam.split(',');
}
else {
params = [modalParam];
}
}
}
return params;
};
export const ModalProvider = (props) => {
const { classPrefix, minifyCSS = true, generateCSS: shouldGenerateCSS = true, zIndex = 9999, handleParamChange, children, transTime = 250, } = props;
const containerRef = useRef(null);
const [modalState, dispatchModalState] = useReducer(reducer, {}, () => {
const initialParams = getModalParamArray();
const initialState = initialParams.reduce((acc, param) => {
acc[param] = {
slug: param,
isOpen: true,
openedOn: Date.now(),
};
return acc;
}, {});
return initialState;
});
const [oneIsOpen, setOneIsOpen] = useState(false);
const [closeOnBlur, setCloseOnBlur] = useState(false);
const [bodyScrollIsLocked, setBodyScrollIsLocked] = useState(false);
const [cssString, setCSSString] = useState('');
const escIsBound = useRef(false);
const bindEsc = useCallback((e) => {
if (e.keyCode === 27) {
dispatchModalState({
type: 'CLOSE_LATEST_MODAL',
});
}
}, []);
// Bind esc key to close all modals
useEffect(() => {
if (!escIsBound.current) {
document.addEventListener('keydown', (e) => bindEsc(e), false);
escIsBound.current = true;
}
return () => {
if (escIsBound.current) {
document.removeEventListener('keydown', (e) => bindEsc(e), false);
}
};
}, [bindEsc]);
// Generate CSS to inject into stylesheet
useEffect(() => {
if (shouldGenerateCSS) {
let newString = '';
newString = generateCSS({
classPrefix,
zIndex
});
if (minifyCSS)
newString = newString.replace(/\n/g, '').replace(/\s\s+/g, ' ');
setCSSString(newString);
}
}, [
shouldGenerateCSS,
minifyCSS,
zIndex,
classPrefix
]);
// Handle param changes
useEffect(() => {
if (typeof handleParamChange === 'function') {
handleParamChange(modalState);
}
if (typeof handleParamChange === 'boolean' && handleParamChange) {
const openModals = Object.keys(modalState).filter((slug) => modalState[slug].isOpen);
const params = new URLSearchParams();
for (const modal of openModals) {
params.append('modal', modal);
}
const queryWithModal = params.toString() ? `?${params}` : '';
const newURL = `${window.location.pathname}${queryWithModal}`;
window.history.pushState({}, '', newURL);
}
}, [
modalState,
handleParamChange,
]);
// Determine if any modals are open
useEffect(() => {
const isOneOpen = Object.keys(modalState).some((key) => modalState[key].isOpen);
setOneIsOpen(isOneOpen);
}, [modalState]);
const setBodyScrollLock = useCallback((shouldLock, excludingRef) => {
if (excludingRef) {
if (shouldLock) {
disableBodyScroll(excludingRef);
setBodyScrollIsLocked(true);
}
else {
enableBodyScroll(excludingRef);
setBodyScrollIsLocked(false);
}
}
}, []);
const setContainerRef = useCallback((ref) => {
containerRef.current = ref;
}, []);
const openModal = useCallback((slug) => {
dispatchModalState({
type: 'OPEN_MODAL',
payload: {
slug,
}
});
}, []);
const closeModal = useCallback((slug) => {
dispatchModalState({
type: 'CLOSE_MODAL',
payload: {
slug,
}
});
}, []);
const closeAllModals = useCallback(() => {
dispatchModalState({
type: 'CLOSE_ALL_MODALS'
});
}, []);
const toggleModal = useCallback((slug) => {
dispatchModalState({
type: 'TOGGLE_MODAL',
payload: {
slug,
}
});
}, []);
const isModalOpen = useCallback((slug) => {
return modalState[slug] && modalState[slug].isOpen;
}, [modalState]);
const inheritedProps = Object.assign({}, props);
delete inheritedProps.children;
return (_jsxs(Fragment, { children: [shouldGenerateCSS && _jsx("style", { dangerouslySetInnerHTML: { __html: cssString } }), _jsx(ModalContext.Provider, { value: Object.assign(Object.assign({}, inheritedProps), { transTime,
// state
containerRef,
modalState, oneModalIsOpen: oneIsOpen, isModalOpen,
closeOnBlur,
bodyScrollIsLocked,
classPrefix,
// methods
closeAllModals,
setCloseOnBlur,
openModal,
closeModal,
toggleModal,
setBodyScrollLock,
setContainerRef }), children: children })] }));
};
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,10 @@
import { SpanKind } from '@opentelemetry/api';
import type { AbstractSpan } from '../types';
/**
* Get the span kind from a span.
* For whatever reason, this is not public API on the generic "Span" type,
* so we need to check if we actually have a `SDKTraceBaseSpan` where we can fetch this from.
* Otherwise, we fall back to `SpanKind.INTERNAL`.
*/
export declare function getSpanKind(span: AbstractSpan): SpanKind;
//# sourceMappingURL=getSpanKind.d.ts.map

View File

@@ -0,0 +1,34 @@
// Same as fr
import { formatDistance } from "./fr/_lib/formatDistance.js";
import { localize } from "./fr/_lib/localize.js";
import { match } from "./fr/_lib/match.js";
// Unique for fr-CH
import { formatLong } from "./fr-CH/_lib/formatLong.js";
import { formatRelative } from "./fr-CH/_lib/formatRelative.js";
/**
* @category Locales
* @summary French locale (Switzerland).
* @language French
* @iso-639-2 fra
* @author Jean Dupouy [@izeau](https://github.com/izeau)
* @author François B [@fbonzon](https://github.com/fbonzon)
* @author Van Vuong Ngo [@vanvuongngo](https://github.com/vanvuongngo)
* @author Alex Hoeing [@dcbn](https://github.com/dcbn)
*/
export const frCH = {
code: "fr-CH",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 1 /* Monday */,
firstWeekContainsDate: 4,
},
};
// Fallback for modularized imports:
export default frCH;

View File

@@ -0,0 +1,85 @@
import type {
CodeKeywordDefinition,
KeywordErrorDefinition,
ErrorObject,
AnySchema,
} from "../../types"
import {_, not, and, Name, Code} from "../../compile/codegen"
import {alwaysValidSchema, Type} from "../../compile/util"
import N from "../../compile/names"
export type UnevaluatedPropertiesError = ErrorObject<
"unevaluatedProperties",
{unevaluatedProperty: string},
AnySchema
>
const error: KeywordErrorDefinition = {
message: "must NOT have unevaluated properties",
params: ({params}) => _`{unevaluatedProperty: ${params.unevaluatedProperty}}`,
}
const def: CodeKeywordDefinition = {
keyword: "unevaluatedProperties",
type: "object",
schemaType: ["boolean", "object"],
trackErrors: true,
error,
code(cxt) {
const {gen, schema, data, errsCount, it} = cxt
/* istanbul ignore if */
if (!errsCount) throw new Error("ajv implementation error")
const {allErrors, props} = it
if (props instanceof Name) {
gen.if(_`${props} !== true`, () =>
gen.forIn("key", data, (key: Name) =>
gen.if(unevaluatedDynamic(props, key), () => unevaluatedPropCode(key))
)
)
} else if (props !== true) {
gen.forIn("key", data, (key: Name) =>
props === undefined
? unevaluatedPropCode(key)
: gen.if(unevaluatedStatic(props, key), () => unevaluatedPropCode(key))
)
}
it.props = true
cxt.ok(_`${errsCount} === ${N.errors}`)
function unevaluatedPropCode(key: Name): void {
if (schema === false) {
cxt.setParams({unevaluatedProperty: key})
cxt.error()
if (!allErrors) gen.break()
return
}
if (!alwaysValidSchema(it, schema)) {
const valid = gen.name("valid")
cxt.subschema(
{
keyword: "unevaluatedProperties",
dataProp: key,
dataPropType: Type.Str,
},
valid
)
if (!allErrors) gen.if(not(valid), () => gen.break())
}
}
function unevaluatedDynamic(evaluatedProps: Name, key: Name): Code {
return _`!${evaluatedProps} || !${evaluatedProps}[${key}]`
}
function unevaluatedStatic(evaluatedProps: {[K in string]?: true}, key: Name): Code {
const ps: Code[] = []
for (const p in evaluatedProps) {
if (evaluatedProps[p] === true) ps.push(_`${key} !== ${p}`)
}
return and(...ps)
}
},
}
export default def

View File

@@ -0,0 +1,199 @@
import { defaultLocale } from "./_lib/defaultLocale.js";
import { getDefaultOptions } from "./_lib/defaultOptions.js";
import { getTimezoneOffsetInMilliseconds } from "./_lib/getTimezoneOffsetInMilliseconds.js";
import { normalizeDates } from "./_lib/normalizeDates.js";
import { compareAsc } from "./compareAsc.js";
import { minutesInDay, minutesInMonth } from "./constants.js";
import { differenceInMonths } from "./differenceInMonths.js";
import { differenceInSeconds } from "./differenceInSeconds.js";
/**
* The {@link formatDistance} function options.
*/
/**
* @name formatDistance
* @category Common Helpers
* @summary Return the distance between the given dates in words.
*
* @description
* Return the distance between the given dates in words.
*
* | Distance between dates | Result |
* |-------------------------------------------------------------------|---------------------|
* | 0 ... 30 secs | less than a minute |
* | 30 secs ... 1 min 30 secs | 1 minute |
* | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes |
* | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour |
* | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours |
* | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day |
* | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days |
* | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month |
* | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months |
* | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months |
* | 1 yr ... 1 yr 3 months | about 1 year |
* | 1 yr 3 months ... 1 yr 9 month s | over 1 year |
* | 1 yr 9 months ... 2 yrs | almost 2 years |
* | N yrs ... N yrs 3 months | about N years |
* | N yrs 3 months ... N yrs 9 months | over N years |
* | N yrs 9 months ... N+1 yrs | almost N+1 years |
*
* With `options.includeSeconds == true`:
* | Distance between dates | Result |
* |------------------------|----------------------|
* | 0 secs ... 5 secs | less than 5 seconds |
* | 5 secs ... 10 secs | less than 10 seconds |
* | 10 secs ... 20 secs | less than 20 seconds |
* | 20 secs ... 40 secs | half a minute |
* | 40 secs ... 60 secs | less than a minute |
* | 60 secs ... 90 secs | 1 minute |
*
* @param laterDate - The date
* @param earlierDate - The date to compare with
* @param options - An object with options
*
* @returns The distance in words
*
* @throws `date` must not be Invalid Date
* @throws `baseDate` must not be Invalid Date
* @throws `options.locale` must contain `formatDistance` property
*
* @example
* // What is the distance between 2 July 2014 and 1 January 2015?
* const result = formatDistance(new Date(2014, 6, 2), new Date(2015, 0, 1))
* //=> '6 months'
*
* @example
* // What is the distance between 1 January 2015 00:00:15
* // and 1 January 2015 00:00:00, including seconds?
* const result = formatDistance(
* new Date(2015, 0, 1, 0, 0, 15),
* new Date(2015, 0, 1, 0, 0, 0),
* { includeSeconds: true }
* )
* //=> 'less than 20 seconds'
*
* @example
* // What is the distance from 1 January 2016
* // to 1 January 2015, with a suffix?
* const result = formatDistance(new Date(2015, 0, 1), new Date(2016, 0, 1), {
* addSuffix: true
* })
* //=> 'about 1 year ago'
*
* @example
* // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto?
* import { eoLocale } from 'date-fns/locale/eo'
* const result = formatDistance(new Date(2016, 7, 1), new Date(2015, 0, 1), {
* locale: eoLocale
* })
* //=> 'pli ol 1 jaro'
*/
export function formatDistance(laterDate, earlierDate, options) {
const defaultOptions = getDefaultOptions();
const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;
const minutesInAlmostTwoDays = 2520;
const comparison = compareAsc(laterDate, earlierDate);
if (isNaN(comparison)) throw new RangeError("Invalid time value");
const localizeOptions = Object.assign({}, options, {
addSuffix: options?.addSuffix,
comparison: comparison,
});
const [laterDate_, earlierDate_] = normalizeDates(
options?.in,
...(comparison > 0 ? [earlierDate, laterDate] : [laterDate, earlierDate]),
);
const seconds = differenceInSeconds(earlierDate_, laterDate_);
const offsetInSeconds =
(getTimezoneOffsetInMilliseconds(earlierDate_) -
getTimezoneOffsetInMilliseconds(laterDate_)) /
1000;
const minutes = Math.round((seconds - offsetInSeconds) / 60);
let months;
// 0 up to 2 mins
if (minutes < 2) {
if (options?.includeSeconds) {
if (seconds < 5) {
return locale.formatDistance("lessThanXSeconds", 5, localizeOptions);
} else if (seconds < 10) {
return locale.formatDistance("lessThanXSeconds", 10, localizeOptions);
} else if (seconds < 20) {
return locale.formatDistance("lessThanXSeconds", 20, localizeOptions);
} else if (seconds < 40) {
return locale.formatDistance("halfAMinute", 0, localizeOptions);
} else if (seconds < 60) {
return locale.formatDistance("lessThanXMinutes", 1, localizeOptions);
} else {
return locale.formatDistance("xMinutes", 1, localizeOptions);
}
} else {
if (minutes === 0) {
return locale.formatDistance("lessThanXMinutes", 1, localizeOptions);
} else {
return locale.formatDistance("xMinutes", minutes, localizeOptions);
}
}
// 2 mins up to 0.75 hrs
} else if (minutes < 45) {
return locale.formatDistance("xMinutes", minutes, localizeOptions);
// 0.75 hrs up to 1.5 hrs
} else if (minutes < 90) {
return locale.formatDistance("aboutXHours", 1, localizeOptions);
// 1.5 hrs up to 24 hrs
} else if (minutes < minutesInDay) {
const hours = Math.round(minutes / 60);
return locale.formatDistance("aboutXHours", hours, localizeOptions);
// 1 day up to 1.75 days
} else if (minutes < minutesInAlmostTwoDays) {
return locale.formatDistance("xDays", 1, localizeOptions);
// 1.75 days up to 30 days
} else if (minutes < minutesInMonth) {
const days = Math.round(minutes / minutesInDay);
return locale.formatDistance("xDays", days, localizeOptions);
// 1 month up to 2 months
} else if (minutes < minutesInMonth * 2) {
months = Math.round(minutes / minutesInMonth);
return locale.formatDistance("aboutXMonths", months, localizeOptions);
}
months = differenceInMonths(earlierDate_, laterDate_);
// 2 months up to 12 months
if (months < 12) {
const nearestMonth = Math.round(minutes / minutesInMonth);
return locale.formatDistance("xMonths", nearestMonth, localizeOptions);
// 1 year up to max Date
} else {
const monthsSinceStartOfYear = months % 12;
const years = Math.trunc(months / 12);
// N years up to 1 years 3 months
if (monthsSinceStartOfYear < 3) {
return locale.formatDistance("aboutXYears", years, localizeOptions);
// N years 3 months up to N years 9 months
} else if (monthsSinceStartOfYear < 9) {
return locale.formatDistance("overXYears", years, localizeOptions);
// N years 9 months up to N year 12 months
} else {
return locale.formatDistance("almostXYears", years + 1, localizeOptions);
}
}
}
// Fallback for modularized imports:
export default formatDistance;

View File

@@ -0,0 +1,5 @@
import type { TypedUser } from 'payload';
export declare const ResetPreferences: React.FC<{
readonly user?: TypedUser;
}>;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,30 @@
'use strict'
const { readFileSync } = require('node:fs')
const { join } = require('node:path')
const packageVersions = new Map()
/**
* Retrieves the version of a package from its package.json file.
* If the package.json file cannot be read, it defaults to the Node.js version.
* @param {string} baseDir - The base directory where the package.json file is located.
* @returns {string} The version of the package or the Node.js version if the package.json cannot be read.
*/
function getPackageVersion(baseDir) {
if (packageVersions.has(baseDir)) {
return packageVersions.get(baseDir)
}
try {
const packageJsonPath = join(baseDir, 'package.json')
const jsonFile = readFileSync(packageJsonPath)
const { version } = JSON.parse(jsonFile)
packageVersions.set(baseDir, version)
return version
} catch {
return process.version.slice(1)
}
}
module.exports = getPackageVersion

View File

@@ -0,0 +1 @@
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/collections/endpoints/update.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAO3D,eAAO,MAAM,aAAa,EAAE,cAsF3B,CAAA"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"restoreVersion.d.ts","sourceRoot":"","sources":["../../../../src/collections/operations/local/restoreVersion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,WAAW,EACX,OAAO,EACP,cAAc,EACd,WAAW,EACZ,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAEjG,OAAO,KAAK,EACV,sBAAsB,EACtB,2BAA2B,EAC5B,MAAM,uBAAuB,CAAA;AAM9B,KAAK,WAAW,CAAC,KAAK,SAAS,cAAc,IAAI;IAC/C;;OAEG;IACH,UAAU,EAAE,KAAK,CAAA;IACjB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,cAAc,CAAC,EAAE,KAAK,GAAG,WAAW,CAAA;IACpC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IACV;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;OAEG;IACH,QAAQ,CAAC,EAAE,YAAY,CAAA;IACvB;;;OAGG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAA;IAC7B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAE1B;;OAEG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAA;CAChB,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,UAAU,CAAC,EAAE,QAAQ,CAAC,CAAA;AAElD,MAAM,MAAM,OAAO,CAAC,KAAK,SAAS,cAAc,IAC9C,WAAW,CAAC,KAAK,CAAC,GAAG,2BAA2B,CAAC,KAAK,CAAC,CAAA;AAEzD,wBAAsB,mBAAmB,CAAC,KAAK,SAAS,cAAc,EACpE,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,GACtB,OAAO,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAkCxC"}

View File

@@ -0,0 +1,134 @@
<p align="center">
<a href="https://rollupjs.org/"><img src="https://rollupjs.org/rollup-logo.svg" width="150" /></a>
</p>
<p align="center">
<a href="https://www.npmjs.com/package/rollup">
<img src="https://img.shields.io/npm/v/rollup.svg" alt="npm version" >
</a>
<a href="https://nodejs.org/en/about/previous-releases">
<img src="https://img.shields.io/node/v/rollup.svg" alt="node compatibility">
</a>
<a href="https://packagephobia.now.sh/result?p=rollup">
<img src="https://packagephobia.now.sh/badge?p=rollup" alt="install size" >
</a>
<a href="https://codecov.io/gh/rollup/rollup">
<img src="https://codecov.io/gh/rollup/rollup/graph/badge.svg" alt="code coverage" >
</a>
<a href="#backers" alt="sponsors on Open Collective">
<img src="https://opencollective.com/rollup/backers/badge.svg" alt="backers" >
</a>
<a href="#sponsors" alt="Sponsors on Open Collective">
<img src="https://opencollective.com/rollup/sponsors/badge.svg" alt="sponsors" >
</a>
<a href="https://github.com/rollup/rollup/blob/master/LICENSE.md">
<img src="https://img.shields.io/npm/l/rollup.svg" alt="license">
</a>
<a href='https://is.gd/rollup_chat?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge'>
<img src='https://img.shields.io/discord/466787075518365708?color=778cd1&label=chat' alt='Join the chat at https://is.gd/rollup_chat'>
</a>
</p>
<h1 align="center">Rollup</h1>
## Overview
Rollup is a module bundler for JavaScript which compiles small pieces of code into something larger and more complex, such as a library or application. It uses the standardized ES module format for code, instead of previous idiosyncratic solutions such as CommonJS and AMD. ES modules let you freely and seamlessly combine the most useful individual functions from your favorite libraries. Rollup can optimize ES modules for faster native loading in modern browsers, or output a legacy module format allowing ES module workflows today.
## Quick Start Guide
Install with `npm install --global rollup`. Rollup can be used either through a [command line interface](https://rollupjs.org/command-line-interface/) with an optional configuration file or else through its [JavaScript API](https://rollupjs.org/javascript-api/). Run `rollup --help` to see the available options and parameters. The starter project templates, [rollup-starter-lib](https://github.com/rollup/rollup-starter-lib) and [rollup-starter-app](https://github.com/rollup/rollup-starter-app), demonstrate common configuration options, and more detailed instructions are available throughout the [user guide](https://rollupjs.org/introduction/).
### Commands
These commands assume the entry point to your application is named main.js, and that you'd like all imports compiled into a single file named bundle.js.
For browsers:
```bash
# compile to a <script> containing a self-executing function
rollup main.js --format iife --name "myBundle" --file bundle.js
```
For Node.js:
```bash
# compile to a CommonJS module
rollup main.js --format cjs --file bundle.js
```
For both browsers and Node.js:
```bash
# UMD format requires a bundle name
rollup main.js --format umd --name "myBundle" --file bundle.js
```
## Why
Developing software is usually easier if you break your project into smaller separate pieces, since that often removes unexpected interactions and dramatically reduces the complexity of the problems you'll need to solve, and simply writing smaller projects in the first place [isn't necessarily the answer](https://medium.com/@Rich_Harris/small-modules-it-s-not-quite-that-simple-3ca532d65de4). Unfortunately, JavaScript has not historically included this capability as a core feature in the language.
This finally changed with ES modules support in JavaScript, which provides a syntax for importing and exporting functions and data so they can be shared between separate scripts. Most browsers and Node.js support ES modules. However, Node.js releases before 12.17 support ES modules only behind the `--experimental-modules` flag, and older browsers like Internet Explorer do not support ES modules at all. Rollup allows you to write your code using ES modules, and run your application even in environments that do not support ES modules natively. For environments that support them, Rollup can output optimized ES modules; for environments that don't, Rollup can compile your code to other formats such as CommonJS modules, AMD modules, and IIFE-style scripts. This means that you get to _write future-proof code_, and you also get the tremendous benefits of...
## Tree Shaking
In addition to enabling the use of ES modules, Rollup also statically analyzes and optimizes the code you are importing, and will exclude anything that isn't actually used. This allows you to build on top of existing tools and modules without adding extra dependencies or bloating the size of your project.
For example, with CommonJS, the _entire tool or library must be imported_.
```js
// import the entire utils object with CommonJS
var utils = require('node:utils');
var query = 'Rollup';
// use the ajax method of the utils object
utils.ajax('https://api.example.com?search=' + query).then(handleResponse);
```
But with ES modules, instead of importing the whole `utils` object, we can just import the one `ajax` function we need:
```js
// import the ajax function with an ES import statement
import { ajax } from 'node:utils';
var query = 'Rollup';
// call the ajax function
ajax('https://api.example.com?search=' + query).then(handleResponse);
```
Because Rollup includes the bare minimum, it results in lighter, faster, and less complicated libraries and applications. Since this approach is based on explicit `import` and `export` statements, it is vastly more effective than simply running an automated minifier to detect unused variables in the compiled output code.
## Compatibility
### Importing CommonJS
Rollup can import existing CommonJS modules [through a plugin](https://github.com/rollup/plugins/tree/master/packages/commonjs).
### Publishing ES Modules
To make sure your ES modules are immediately usable by tools that work with CommonJS such as Node.js and webpack, you can use Rollup to compile to UMD or CommonJS format, and then point to that compiled version with the `main` property in your `package.json` file. If your `package.json` file also has a `module` field, ES-module-aware tools like Rollup and [webpack](https://webpack.js.org/) will [import the ES module version](https://github.com/rollup/rollup/wiki/pkg.module) directly.
## Contributors
This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)]. <a href="https://github.com/rollup/rollup/graphs/contributors"><img src="https://opencollective.com/rollup/contributors.svg?width=890" /></a>. If you want to contribute yourself, head over to the [contribution guidelines](CONTRIBUTING.md).
## Backers
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/rollup#backer)]
<a href="https://opencollective.com/rollup#backers" target="_blank"><img src="https://opencollective.com/rollup/backers.svg?width=890"></a>
## Sponsors
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/rollup#sponsor)]
<a href="https://opencollective.com/rollup/sponsor/0/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/0/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/1/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/1/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/2/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/2/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/3/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/3/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/4/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/4/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/5/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/5/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/6/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/6/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/7/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/7/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/8/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/8/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/9/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/9/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/10/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/10/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/11/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/11/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/12/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/12/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/13/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/13/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/14/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/14/avatar.svg"></a>
## Special Sponsor
<a href="https://www.tngtech.com/en/index.html" target="_blank"><img src="https://avatars.githubusercontent.com/u/432256?s=200&v=4" alt="TNG Logo"/></a>
TNG has been supporting the work of [Lukas Taegert-Atkinson](https://github.com/lukastaegert) on Rollup since 2017.
## License
[MIT](https://github.com/rollup/rollup/blob/master/LICENSE.md)

View File

@@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = isScope;
var _index = require("./generated/index.js");
function isScope(node, parent) {
if ((0, _index.isBlockStatement)(node) && ((0, _index.isFunction)(parent) || (0, _index.isCatchClause)(parent))) {
return false;
}
if ((0, _index.isPattern)(node) && ((0, _index.isFunction)(parent) || (0, _index.isCatchClause)(parent))) {
return true;
}
return (0, _index.isScopable)(node);
}
//# sourceMappingURL=isScope.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"withPayload.d.ts","sourceRoot":"","sources":["../../src/withPayload/withPayload.js"],"names":[],"mappings":"AAsBO,yCAJI,OAAO,MAAM,EAAE,UAAU,YAEjC;IAA0B,uBAAuB,GAAzC,OAAO;CAA6F,6BA6P9G"}

View File

@@ -0,0 +1,22 @@
'use strict'
const build = require('../..')
module.exports = async function (threadStreamOpts) {
const { port, opts = {} } = threadStreamOpts
return build(
async function (source) {
for await (const obj of source) {
port.postMessage({
data: obj,
pinoConfig: {
levels: source.levels,
messageKey: source.messageKey,
errorKey: source.errorKey
}
})
}
},
opts
)
}

View File

@@ -0,0 +1,13 @@
import { browserTracingIntegration as originalBrowserTracingIntegration } from '@sentry/browser';
import { Integration } from '@sentry/core';
/**
* A custom browser tracing integration for TanStack Router.
*
* The minimum compatible version of `@tanstack/react-router` is `1.64.0`.
*
* @param router A TanStack Router `Router` instance that should be used for routing instrumentation.
* @param options Sentry browser tracing configuration.
*/
export declare function tanstackRouterBrowserTracingIntegration(router: any, // This is `any` because we don't want any type mismatches if TanStack Router changes their types
options?: Parameters<typeof originalBrowserTracingIntegration>[0]): Integration;
//# sourceMappingURL=tanstackrouter.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/utilities/parseParams/index.ts"],"sourcesContent":["import type { JoinQuery, PopulateType, SelectType, Where } from '../../types/index.js'\nimport type { JoinParams } from '../sanitizeJoinParams.js'\n\nimport { isNumber } from '../isNumber.js'\nimport { parseBooleanString } from '../parseBooleanString.js'\nimport { sanitizeJoinParams } from '../sanitizeJoinParams.js'\nimport { sanitizePopulateParam } from '../sanitizePopulateParam.js'\nimport { sanitizeSelectParam } from '../sanitizeSelectParam.js'\nimport { sanitizeSortParams } from '../sanitizeSortParams.js'\n\ntype RawParams = {\n [key: string]: unknown\n autosave?: string\n data?: string\n depth?: string\n draft?: string\n field?: string\n flattenLocales?: string\n joins?: JoinParams\n limit?: string\n overrideLock?: string\n page?: string\n pagination?: string\n populate?: unknown\n publishAllLocales?: string\n publishSpecificLocale?: string\n select?: unknown\n selectedLocales?: string\n sort?: string | string[]\n trash?: string\n unpublishAllLocales?: string\n where?: Where\n}\n\ntype ParsedParams = {\n autosave?: boolean\n data?: Record<string, unknown>\n depth?: number\n draft?: boolean\n field?: string\n flattenLocales?: boolean\n joins?: JoinQuery\n limit?: number\n overrideLock?: boolean\n page?: number\n pagination?: boolean\n populate?: PopulateType\n publishAllLocales?: boolean\n publishSpecificLocale?: string\n select?: SelectType\n selectedLocales?: string[]\n sort?: string[]\n trash?: boolean\n unpublishAllLocales?: boolean\n where?: Where\n} & Record<string, unknown>\n\nexport const booleanParams = [\n 'autosave',\n 'draft',\n 'trash',\n 'overrideLock',\n 'pagination',\n 'flattenLocales',\n]\n\nexport const numberParams = ['depth', 'limit', 'page']\n\n/**\n * Takes raw query parameters and parses them into the correct types that Payload expects.\n * Examples:\n * a. `draft` provided as a string of \"true\" is converted to a boolean\n * b. `depth` provided as a string of \"0\" is converted to a number\n * c. `sort` provided as a comma-separated string or array is converted to an array of strings\n */\nexport const parseParams = (params: RawParams): ParsedParams => {\n const parsedParams = (params || {}) as ParsedParams\n\n // iterate through known params to make this very fast\n for (const key of booleanParams) {\n if (key in params) {\n parsedParams[key] = parseBooleanString(params[key] as boolean | string)\n }\n }\n\n for (const key of numberParams) {\n if (key in params) {\n if (isNumber(params[key])) {\n parsedParams[key] = Number(params[key])\n }\n }\n }\n\n if ('populate' in params) {\n parsedParams.populate = sanitizePopulateParam(params.populate)\n }\n\n if ('select' in params) {\n parsedParams.select = sanitizeSelectParam(params.select)\n }\n\n if ('joins' in params) {\n parsedParams.joins = sanitizeJoinParams(params.joins as JoinParams)\n }\n\n if ('sort' in params) {\n parsedParams.sort = sanitizeSortParams(params.sort)\n }\n\n if ('data' in params && typeof params.data === 'string' && params.data.length > 0) {\n parsedParams.data = JSON.parse(params.data)\n }\n\n return parsedParams\n}\n"],"names":["isNumber","parseBooleanString","sanitizeJoinParams","sanitizePopulateParam","sanitizeSelectParam","sanitizeSortParams","booleanParams","numberParams","parseParams","params","parsedParams","key","Number","populate","select","joins","sort","data","length","JSON","parse"],"mappings":"AAGA,SAASA,QAAQ,QAAQ,iBAAgB;AACzC,SAASC,kBAAkB,QAAQ,2BAA0B;AAC7D,SAASC,kBAAkB,QAAQ,2BAA0B;AAC7D,SAASC,qBAAqB,QAAQ,8BAA6B;AACnE,SAASC,mBAAmB,QAAQ,4BAA2B;AAC/D,SAASC,kBAAkB,QAAQ,2BAA0B;AAiD7D,OAAO,MAAMC,gBAAgB;IAC3B;IACA;IACA;IACA;IACA;IACA;CACD,CAAA;AAED,OAAO,MAAMC,eAAe;IAAC;IAAS;IAAS;CAAO,CAAA;AAEtD;;;;;;CAMC,GACD,OAAO,MAAMC,cAAc,CAACC;IAC1B,MAAMC,eAAgBD,UAAU,CAAC;IAEjC,sDAAsD;IACtD,KAAK,MAAME,OAAOL,cAAe;QAC/B,IAAIK,OAAOF,QAAQ;YACjBC,YAAY,CAACC,IAAI,GAAGV,mBAAmBQ,MAAM,CAACE,IAAI;QACpD;IACF;IAEA,KAAK,MAAMA,OAAOJ,aAAc;QAC9B,IAAII,OAAOF,QAAQ;YACjB,IAAIT,SAASS,MAAM,CAACE,IAAI,GAAG;gBACzBD,YAAY,CAACC,IAAI,GAAGC,OAAOH,MAAM,CAACE,IAAI;YACxC;QACF;IACF;IAEA,IAAI,cAAcF,QAAQ;QACxBC,aAAaG,QAAQ,GAAGV,sBAAsBM,OAAOI,QAAQ;IAC/D;IAEA,IAAI,YAAYJ,QAAQ;QACtBC,aAAaI,MAAM,GAAGV,oBAAoBK,OAAOK,MAAM;IACzD;IAEA,IAAI,WAAWL,QAAQ;QACrBC,aAAaK,KAAK,GAAGb,mBAAmBO,OAAOM,KAAK;IACtD;IAEA,IAAI,UAAUN,QAAQ;QACpBC,aAAaM,IAAI,GAAGX,mBAAmBI,OAAOO,IAAI;IACpD;IAEA,IAAI,UAAUP,UAAU,OAAOA,OAAOQ,IAAI,KAAK,YAAYR,OAAOQ,IAAI,CAACC,MAAM,GAAG,GAAG;QACjFR,aAAaO,IAAI,GAAGE,KAAKC,KAAK,CAACX,OAAOQ,IAAI;IAC5C;IAEA,OAAOP;AACT,EAAC"}

View File

@@ -0,0 +1,2 @@
import type { Coordinates, ClientRect } from '../../types';
export declare function getRectDelta(rect1: ClientRect | null, rect2: ClientRect | null): Coordinates;

View File

@@ -0,0 +1 @@
{"version":3,"file":"getRequestLanguage.js","names":["getRequestLanguage","cookies","defaultLanguage","headers","acceptLanguage","get","cookieLanguage","value"],"sources":["../../src/utilities/getRequestLanguage.ts"],"sourcesContent":["import type { ReadonlyRequestCookies } from 'next/dist/server/web/spec-extension/adapters/request-cookies.js'\n\ntype GetRequestLanguageArgs = {\n cookies: Map<string, string> | ReadonlyRequestCookies\n defaultLanguage?: string\n headers: Request['headers']\n}\n\nexport const getRequestLanguage = ({\n cookies,\n defaultLanguage = 'en',\n headers,\n}: GetRequestLanguageArgs): string => {\n const acceptLanguage = headers.get('Accept-Language')\n const cookieLanguage = cookies.get('lng')\n\n return (\n acceptLanguage ||\n (typeof cookieLanguage === 'string' ? cookieLanguage : cookieLanguage.value) ||\n defaultLanguage\n )\n}\n"],"mappings":"AAQA,OAAO,MAAMA,kBAAA,GAAqBA,CAAC;EACjCC,OAAO;EACPC,eAAA,GAAkB,IAAI;EACtBC;AAAO,CACgB;EACvB,MAAMC,cAAA,GAAiBD,OAAA,CAAQE,GAAG,CAAC;EACnC,MAAMC,cAAA,GAAiBL,OAAA,CAAQI,GAAG,CAAC;EAEnC,OACED,cAAA,KACC,OAAOE,cAAA,KAAmB,WAAWA,cAAA,GAAiBA,cAAA,CAAeC,KAAK,CAAD,IAC1EL,eAAA;AAEJ","ignoreList":[]}

View File

@@ -0,0 +1,84 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.prefixRadialGradient = void 0;
var parser_1 = require("../../syntax/parser");
var gradient_1 = require("./gradient");
var length_percentage_1 = require("../length-percentage");
var length_1 = require("../length");
var radial_gradient_1 = require("./radial-gradient");
var prefixRadialGradient = function (context, tokens) {
var shape = 0 /* CIRCLE */;
var size = 3 /* FARTHEST_CORNER */;
var stops = [];
var position = [];
parser_1.parseFunctionArgs(tokens).forEach(function (arg, i) {
var isColorStop = true;
if (i === 0) {
isColorStop = arg.reduce(function (acc, token) {
if (parser_1.isIdentToken(token)) {
switch (token.value) {
case 'center':
position.push(length_percentage_1.FIFTY_PERCENT);
return false;
case 'top':
case 'left':
position.push(length_percentage_1.ZERO_LENGTH);
return false;
case 'right':
case 'bottom':
position.push(length_percentage_1.HUNDRED_PERCENT);
return false;
}
}
else if (length_percentage_1.isLengthPercentage(token) || length_1.isLength(token)) {
position.push(token);
return false;
}
return acc;
}, isColorStop);
}
else if (i === 1) {
isColorStop = arg.reduce(function (acc, token) {
if (parser_1.isIdentToken(token)) {
switch (token.value) {
case radial_gradient_1.CIRCLE:
shape = 0 /* CIRCLE */;
return false;
case radial_gradient_1.ELLIPSE:
shape = 1 /* ELLIPSE */;
return false;
case radial_gradient_1.CONTAIN:
case radial_gradient_1.CLOSEST_SIDE:
size = 0 /* CLOSEST_SIDE */;
return false;
case radial_gradient_1.FARTHEST_SIDE:
size = 1 /* FARTHEST_SIDE */;
return false;
case radial_gradient_1.CLOSEST_CORNER:
size = 2 /* CLOSEST_CORNER */;
return false;
case radial_gradient_1.COVER:
case radial_gradient_1.FARTHEST_CORNER:
size = 3 /* FARTHEST_CORNER */;
return false;
}
}
else if (length_1.isLength(token) || length_percentage_1.isLengthPercentage(token)) {
if (!Array.isArray(size)) {
size = [];
}
size.push(token);
return false;
}
return acc;
}, isColorStop);
}
if (isColorStop) {
var colorStop = gradient_1.parseColorStop(context, arg);
stops.push(colorStop);
}
});
return { size: size, shape: shape, stops: stops, position: position, type: 2 /* RADIAL_GRADIENT */ };
};
exports.prefixRadialGradient = prefixRadialGradient;
//# sourceMappingURL=-prefix-radial-gradient.js.map

View File

@@ -0,0 +1,78 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const debugBuild = require('../debug-build.js');
const debugLogger = require('./debug-logger.js');
const string = require('./string.js');
function logIgnoredSpan(droppedSpan) {
debugLogger.debug.log(`Ignoring span ${droppedSpan.op} - ${droppedSpan.description} because it matches \`ignoreSpans\`.`);
}
/**
* Check if a span should be ignored based on the ignoreSpans configuration.
*/
function shouldIgnoreSpan(
span,
ignoreSpans,
) {
if (!ignoreSpans?.length || !span.description) {
return false;
}
for (const pattern of ignoreSpans) {
if (isStringOrRegExp(pattern)) {
if (string.isMatchingPattern(span.description, pattern)) {
debugBuild.DEBUG_BUILD && logIgnoredSpan(span);
return true;
}
continue;
}
if (!pattern.name && !pattern.op) {
continue;
}
const nameMatches = pattern.name ? string.isMatchingPattern(span.description, pattern.name) : true;
const opMatches = pattern.op ? span.op && string.isMatchingPattern(span.op, pattern.op) : true;
// This check here is only correct because we can guarantee that we ran `isMatchingPattern`
// for at least one of `nameMatches` and `opMatches`. So in contrary to how this looks,
// not both op and name actually have to match. This is the most efficient way to check
// for all combinations of name and op patterns.
if (nameMatches && opMatches) {
debugBuild.DEBUG_BUILD && logIgnoredSpan(span);
return true;
}
}
return false;
}
/**
* Takes a list of spans, and a span that was dropped, and re-parents the child spans of the dropped span to the parent of the dropped span, if possible.
* This mutates the spans array in place!
*/
function reparentChildSpans(spans, dropSpan) {
const droppedSpanParentId = dropSpan.parent_span_id;
const droppedSpanId = dropSpan.span_id;
// This should generally not happen, as we do not apply this on root spans
// but to be safe, we just bail in this case
if (!droppedSpanParentId) {
return;
}
for (const span of spans) {
if (span.parent_span_id === droppedSpanId) {
span.parent_span_id = droppedSpanParentId;
}
}
}
function isStringOrRegExp(value) {
return typeof value === 'string' || value instanceof RegExp;
}
exports.reparentChildSpans = reparentChildSpans;
exports.shouldIgnoreSpan = shouldIgnoreSpan;
//# sourceMappingURL=should-ignore-span.js.map

View File

@@ -0,0 +1,5 @@
function eachAxis(callback) {
return [callback("x"), callback("y")];
}
export { eachAxis };

View File

@@ -0,0 +1,13 @@
import type { Where } from 'payload';
import React from 'react';
import type { PublishManyProps } from './index.js';
type PublishManyDrawerContentProps = {
drawerSlug: string;
ids: (number | string)[];
onSuccess?: () => void;
selectAll: boolean;
where?: Where;
} & PublishManyProps;
export declare function PublishManyDrawerContent(props: PublishManyDrawerContentProps): React.JSX.Element;
export {};
//# sourceMappingURL=DrawerContent.d.ts.map

View File

@@ -0,0 +1,341 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const core = require('@sentry/core');
const browserUtils = require('@sentry-internal/browser-utils');
const debugBuild = require('../debug-build.js');
const helpers = require('../helpers.js');
/** maxStringLength gets capped to prevent 100 breadcrumbs exceeding 1MB event payload size */
const MAX_ALLOWED_STRING_LENGTH = 1024;
const INTEGRATION_NAME = 'Breadcrumbs';
const _breadcrumbsIntegration = ((options = {}) => {
const _options = {
console: true,
dom: true,
fetch: true,
history: true,
sentry: true,
xhr: true,
...options,
};
return {
name: INTEGRATION_NAME,
setup(client) {
// TODO(v11): Remove this functionality and use `consoleIntegration` from @sentry/core instead.
if (_options.console) {
core.addConsoleInstrumentationHandler(_getConsoleBreadcrumbHandler(client));
}
if (_options.dom) {
browserUtils.addClickKeypressInstrumentationHandler(_getDomBreadcrumbHandler(client, _options.dom));
}
if (_options.xhr) {
browserUtils.addXhrInstrumentationHandler(_getXhrBreadcrumbHandler(client));
}
if (_options.fetch) {
core.addFetchInstrumentationHandler(_getFetchBreadcrumbHandler(client));
}
if (_options.history) {
browserUtils.addHistoryInstrumentationHandler(_getHistoryBreadcrumbHandler(client));
}
if (_options.sentry) {
client.on('beforeSendEvent', _getSentryBreadcrumbHandler(client));
}
},
};
}) ;
const breadcrumbsIntegration = core.defineIntegration(_breadcrumbsIntegration);
/**
* Adds a breadcrumb for Sentry events or transactions if this option is enabled.
*/
function _getSentryBreadcrumbHandler(client) {
return function addSentryBreadcrumb(event) {
if (core.getClient() !== client) {
return;
}
core.addBreadcrumb(
{
category: `sentry.${event.type === 'transaction' ? 'transaction' : 'event'}`,
event_id: event.event_id,
level: event.level,
message: core.getEventDescription(event),
},
{
event,
},
);
};
}
/**
* A HOC that creates a function that creates breadcrumbs from DOM API calls.
* This is a HOC so that we get access to dom options in the closure.
*/
function _getDomBreadcrumbHandler(
client,
dom,
) {
return function _innerDomBreadcrumb(handlerData) {
if (core.getClient() !== client) {
return;
}
let target;
let componentName;
let keyAttrs = typeof dom === 'object' ? dom.serializeAttribute : undefined;
let maxStringLength =
typeof dom === 'object' && typeof dom.maxStringLength === 'number' ? dom.maxStringLength : undefined;
if (maxStringLength && maxStringLength > MAX_ALLOWED_STRING_LENGTH) {
debugBuild.DEBUG_BUILD &&
core.debug.warn(
`\`dom.maxStringLength\` cannot exceed ${MAX_ALLOWED_STRING_LENGTH}, but a value of ${maxStringLength} was configured. Sentry will use ${MAX_ALLOWED_STRING_LENGTH} instead.`,
);
maxStringLength = MAX_ALLOWED_STRING_LENGTH;
}
if (typeof keyAttrs === 'string') {
keyAttrs = [keyAttrs];
}
// Accessing event.target can throw (see getsentry/raven-js#838, #768)
try {
const event = handlerData.event ;
const element = _isEvent(event) ? event.target : event;
target = core.htmlTreeAsString(element, { keyAttrs, maxStringLength });
componentName = core.getComponentName(element);
} catch {
target = '<unknown>';
}
if (target.length === 0) {
return;
}
const breadcrumb = {
category: `ui.${handlerData.name}`,
message: target,
};
if (componentName) {
breadcrumb.data = { 'ui.component_name': componentName };
}
core.addBreadcrumb(breadcrumb, {
event: handlerData.event,
name: handlerData.name,
global: handlerData.global,
});
};
}
/**
* Creates breadcrumbs from console API calls
*/
function _getConsoleBreadcrumbHandler(client) {
return function _consoleBreadcrumb(handlerData) {
if (core.getClient() !== client) {
return;
}
const breadcrumb = {
category: 'console',
data: {
arguments: handlerData.args,
logger: 'console',
},
level: core.severityLevelFromString(handlerData.level),
message: core.safeJoin(handlerData.args, ' '),
};
if (handlerData.level === 'assert') {
if (handlerData.args[0] === false) {
breadcrumb.message = `Assertion failed: ${core.safeJoin(handlerData.args.slice(1), ' ') || 'console.assert'}`;
breadcrumb.data.arguments = handlerData.args.slice(1);
} else {
// Don't capture a breadcrumb for passed assertions
return;
}
}
core.addBreadcrumb(breadcrumb, {
input: handlerData.args,
level: handlerData.level,
});
};
}
/**
* Creates breadcrumbs from XHR API calls
*/
function _getXhrBreadcrumbHandler(client) {
return function _xhrBreadcrumb(handlerData) {
if (core.getClient() !== client) {
return;
}
const { startTimestamp, endTimestamp } = handlerData;
const sentryXhrData = handlerData.xhr[browserUtils.SENTRY_XHR_DATA_KEY];
// We only capture complete, non-sentry requests
if (!startTimestamp || !endTimestamp || !sentryXhrData) {
return;
}
const { method, url, status_code, body } = sentryXhrData;
const data = {
method,
url,
status_code,
};
const hint = {
xhr: handlerData.xhr,
input: body,
startTimestamp,
endTimestamp,
};
const breadcrumb = {
category: 'xhr',
data,
type: 'http',
level: core.getBreadcrumbLogLevelFromHttpStatusCode(status_code),
};
client.emit('beforeOutgoingRequestBreadcrumb', breadcrumb, hint );
core.addBreadcrumb(breadcrumb, hint);
};
}
/**
* Creates breadcrumbs from fetch API calls
*/
function _getFetchBreadcrumbHandler(client) {
return function _fetchBreadcrumb(handlerData) {
if (core.getClient() !== client) {
return;
}
const { startTimestamp, endTimestamp } = handlerData;
// We only capture complete fetch requests
if (!endTimestamp) {
return;
}
if (handlerData.fetchData.url.match(/sentry_key/) && handlerData.fetchData.method === 'POST') {
// We will not create breadcrumbs for fetch requests that contain `sentry_key` (internal sentry requests)
return;
}
({
method: handlerData.fetchData.method,
url: handlerData.fetchData.url,
});
if (handlerData.error) {
const data = handlerData.fetchData;
const hint = {
data: handlerData.error,
input: handlerData.args,
startTimestamp,
endTimestamp,
};
const breadcrumb = {
category: 'fetch',
data,
level: 'error',
type: 'http',
} ;
client.emit('beforeOutgoingRequestBreadcrumb', breadcrumb, hint );
core.addBreadcrumb(breadcrumb, hint);
} else {
const response = handlerData.response ;
const data = {
...handlerData.fetchData,
status_code: response?.status,
};
handlerData.fetchData.request_body_size;
handlerData.fetchData.response_body_size;
response?.status;
const hint = {
input: handlerData.args,
response,
startTimestamp,
endTimestamp,
};
const breadcrumb = {
category: 'fetch',
data,
type: 'http',
level: core.getBreadcrumbLogLevelFromHttpStatusCode(data.status_code),
};
client.emit('beforeOutgoingRequestBreadcrumb', breadcrumb, hint );
core.addBreadcrumb(breadcrumb, hint);
}
};
}
/**
* Creates breadcrumbs from history API calls
*/
function _getHistoryBreadcrumbHandler(client) {
return function _historyBreadcrumb(handlerData) {
if (core.getClient() !== client) {
return;
}
let from = handlerData.from;
let to = handlerData.to;
const parsedLoc = core.parseUrl(helpers.WINDOW.location.href);
let parsedFrom = from ? core.parseUrl(from) : undefined;
const parsedTo = core.parseUrl(to);
// Initial pushState doesn't provide `from` information
if (!parsedFrom?.path) {
parsedFrom = parsedLoc;
}
// Use only the path component of the URL if the URL matches the current
// document (almost all the time when using pushState)
if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host) {
to = parsedTo.relative;
}
if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host) {
from = parsedFrom.relative;
}
core.addBreadcrumb({
category: 'navigation',
data: {
from,
to,
},
});
};
}
function _isEvent(event) {
return !!event && !!(event ).target;
}
exports.breadcrumbsIntegration = breadcrumbsIntegration;
//# sourceMappingURL=breadcrumbs.js.map

View File

@@ -0,0 +1,2 @@
const e=(e,t)=>()=>({path:`/dashboards`,params:t??{},body:JSON.stringify(e),method:`POST`}),t=(e,t)=>()=>({path:`/dashboards`,params:t??{},body:JSON.stringify(e),method:`POST`});export{t as createDashboard,e as createDashboards};
//# sourceMappingURL=dashboards.js.map

View File

@@ -0,0 +1,17 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Workflow = createLucideIcon("Workflow", [
["rect", { width: "8", height: "8", x: "3", y: "3", rx: "2", key: "by2w9f" }],
["path", { d: "M7 11v4a2 2 0 0 0 2 2h4", key: "xkn7yn" }],
["rect", { width: "8", height: "8", x: "13", y: "13", rx: "2", key: "1cgmvn" }]
]);
export { Workflow as default };
//# sourceMappingURL=workflow.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/folders/hooks/dissasociateAfterDelete.ts"],"sourcesContent":["import type { CollectionAfterDeleteHook } from '../../index.js'\n\ntype Args = {\n collectionSlugs: string[]\n folderFieldName: string\n}\nexport const dissasociateAfterDelete = ({\n collectionSlugs,\n folderFieldName,\n}: Args): CollectionAfterDeleteHook => {\n return async ({ id, req }) => {\n for (const collectionSlug of collectionSlugs) {\n await req.payload.update({\n collection: collectionSlug,\n data: {\n [folderFieldName]: null,\n },\n req,\n where: {\n [folderFieldName]: {\n equals: id,\n },\n },\n })\n }\n }\n}\n"],"names":["dissasociateAfterDelete","collectionSlugs","folderFieldName","id","req","collectionSlug","payload","update","collection","data","where","equals"],"mappings":"AAMA,OAAO,MAAMA,0BAA0B,CAAC,EACtCC,eAAe,EACfC,eAAe,EACV;IACL,OAAO,OAAO,EAAEC,EAAE,EAAEC,GAAG,EAAE;QACvB,KAAK,MAAMC,kBAAkBJ,gBAAiB;YAC5C,MAAMG,IAAIE,OAAO,CAACC,MAAM,CAAC;gBACvBC,YAAYH;gBACZI,MAAM;oBACJ,CAACP,gBAAgB,EAAE;gBACrB;gBACAE;gBACAM,OAAO;oBACL,CAACR,gBAAgB,EAAE;wBACjBS,QAAQR;oBACV;gBACF;YACF;QACF;IACF;AACF,EAAC"}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/database/migrations/migrationsCollection.ts"],"sourcesContent":["import type { CollectionConfig } from '../../collections/config/types.js'\n\nexport const migrationsCollection: CollectionConfig = {\n slug: 'payload-migrations',\n admin: {\n hidden: true,\n },\n endpoints: false,\n fields: [\n {\n name: 'name',\n type: 'text',\n },\n {\n name: 'batch',\n type: 'number',\n // NOTE: This value is -1 if it is a \"dev push\"\n },\n ],\n graphQL: false,\n lockDocuments: false,\n}\n"],"names":["migrationsCollection","slug","admin","hidden","endpoints","fields","name","type","graphQL","lockDocuments"],"mappings":"AAEA,OAAO,MAAMA,uBAAyC;IACpDC,MAAM;IACNC,OAAO;QACLC,QAAQ;IACV;IACAC,WAAW;IACXC,QAAQ;QACN;YACEC,MAAM;YACNC,MAAM;QACR;QACA;YACED,MAAM;YACNC,MAAM;QAER;KACD;IACDC,SAAS;IACTC,eAAe;AACjB,EAAC"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAuDH,IAAY,kBAMX;AAND,WAAY,kBAAkB;IAC5B,sDAAgC,CAAA;IAChC,uDAAiC,CAAA;IACjC,4CAAsB,CAAA;IACtB,qCAAe,CAAA;IACf,yCAAmB,CAAA;AACrB,CAAC,EANW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAM7B","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { InstrumentationConfig } from '@opentelemetry/instrumentation';\nimport { Span } from '@opentelemetry/api';\n\nexport interface MongoDBInstrumentationExecutionResponseHook {\n (span: Span, responseInfo: MongoResponseHookInformation): void;\n}\n\n/**\n * Function that can be used to serialize db.statement tag\n * @param cmd - MongoDB command object\n *\n * @returns serialized string that will be used as the db.statement attribute.\n */\nexport type DbStatementSerializer = (cmd: Record<string, unknown>) => string;\n\nexport interface MongoDBInstrumentationConfig extends InstrumentationConfig {\n /**\n * If true, additional information about query parameters and\n * results will be attached (as `attributes`) to spans representing\n * database operations.\n */\n enhancedDatabaseReporting?: boolean;\n\n /**\n * Hook that allows adding custom span attributes based on the data\n * returned from MongoDB actions.\n *\n * @default undefined\n */\n responseHook?: MongoDBInstrumentationExecutionResponseHook;\n\n /**\n * Custom serializer function for the db.statement tag\n */\n dbStatementSerializer?: DbStatementSerializer;\n\n /**\n * Require parent to create mongodb span, default when unset is true\n */\n requireParentSpan?: boolean;\n}\n\nexport interface MongoResponseHookInformation {\n data: CommandResult;\n}\n\n// https://github.com/mongodb/node-mongodb-native/blob/3.6/lib/core/connection/command_result.js\nexport type CommandResult = {\n result?: unknown;\n connection?: unknown;\n message?: unknown;\n};\n\nexport enum MongodbCommandType {\n CREATE_INDEXES = 'createIndexes',\n FIND_AND_MODIFY = 'findAndModify',\n IS_MASTER = 'isMaster',\n COUNT = 'count',\n UNKNOWN = 'unknown',\n}\n"]}

View File

@@ -0,0 +1,26 @@
import { type MessageFormatElement } from "./types.js";
/**
* Hoist all selectors to the beginning of the AST & flatten the
* resulting options. E.g:
* "I have {count, plural, one{a dog} other{many dogs}}"
* becomes "{count, plural, one{I have a dog} other{I have many dogs}}".
* If there are multiple selectors, the order of which one is hoisted 1st
* is non-deterministic.
* The goal is to provide as many full sentences as possible since fragmented
* sentences are not translator-friendly
* @param ast AST
*/
export declare function hoistSelectors(ast: MessageFormatElement[]): MessageFormatElement[];
interface IsStructurallySameResult {
error?: Error;
success: boolean;
}
/**
* Check if 2 ASTs are structurally the same. This primarily means that
* they have the same variables with the same type
* @param a
* @param b
* @returns
*/
export declare function isStructurallySame(a: MessageFormatElement[], b: MessageFormatElement[]): IsStructurallySameResult;
export {};

View File

@@ -0,0 +1,37 @@
"use strict";
exports.lastDayOfDecade = lastDayOfDecade;
var _index = require("./toDate.cjs");
/**
* The {@link lastDayOfDecade} function options.
*/
/**
* @name lastDayOfDecade
* @category Decade Helpers
* @summary Return the last day of a decade for the given date.
*
* @description
* Return the last day of a decade for the given date.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows using extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type; inferred from arguments or specified by context.
*
* @param date - The original date
* @param options - The options
*
* @returns The last day of a decade
*
* @example
* // The last day of a decade for 21 December 2012 21:12:00:
* const result = lastDayOfDecade(new Date(2012, 11, 21, 21, 12, 00))
* //=> Wed Dec 31 2019 00:00:00
*/
function lastDayOfDecade(date, options) {
const _date = (0, _index.toDate)(date, options?.in);
const year = _date.getFullYear();
const decade = 9 + Math.floor(year / 10) * 10;
_date.setFullYear(decade + 1, 0, 0);
_date.setHours(0, 0, 0, 0);
return (0, _index.toDate)(_date, options?.in);
}

View File

@@ -0,0 +1,11 @@
/**
* Pipe
* Compose other transformers to run linearily
* pipe(min(20), max(40))
* @param {...functions} transformers
* @return {function}
*/
const combineFunctions = (a, b) => (v) => b(a(v));
const pipe = (...transformers) => transformers.reduce(combineFunctions);
export { pipe };

View File

@@ -0,0 +1,22 @@
/**
* Checks if `value` is `null`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is `null`, else `false`.
* @example
*
* _.isNull(null);
* // => true
*
* _.isNull(void 0);
* // => false
*/
function isNull(value) {
return value === null;
}
module.exports = isNull;

View File

@@ -0,0 +1 @@
{"version":3,"file":"sleep.js","names":[],"sources":["../../../src/realtime/utils/sleep.ts"],"sourcesContent":["/**\n * Wait for a certain amount of ms\n * @param delay number in MS\n * @returns void\n */\nexport const sleep = (delay: number) => new Promise<void>((resolve) => setTimeout(() => resolve(), delay));\n"],"mappings":"AAKA,MAAa,EAAS,GAAkB,IAAI,QAAe,GAAY,eAAiB,GAAS,CAAE,EAAM,CAAC"}

View File

@@ -0,0 +1,713 @@
// NOTE: separate `:not()` selectors has broader browser support than the newer
// `:not([inert], [inert] *)` (Feb 2023)
const candidateSelectors = [
'input:not([inert]):not([inert] *)',
'select:not([inert]):not([inert] *)',
'textarea:not([inert]):not([inert] *)',
'a[href]:not([inert]):not([inert] *)',
'button:not([inert]):not([inert] *)',
'[tabindex]:not(slot):not([inert]):not([inert] *)',
'audio[controls]:not([inert]):not([inert] *)',
'video[controls]:not([inert]):not([inert] *)',
'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',
'details>summary:first-of-type:not([inert]):not([inert] *)',
'details:not([inert]):not([inert] *)',
];
const candidateSelector = /* #__PURE__ */ candidateSelectors.join(',');
const NoElement = typeof Element === 'undefined';
const matches = NoElement
? function () {}
: Element.prototype.matches ||
Element.prototype.msMatchesSelector ||
Element.prototype.webkitMatchesSelector;
const getRootNode =
!NoElement && Element.prototype.getRootNode
? (element) => element?.getRootNode?.()
: (element) => element?.ownerDocument;
/**
* Determines if a node is inert or in an inert ancestor.
* @param {Node} [node]
* @param {boolean} [lookUp] If true and `node` is not inert, looks up at ancestors to
* see if any of them are inert. If false, only `node` itself is considered.
* @returns {boolean} True if inert itself or by way of being in an inert ancestor.
* False if `node` is falsy.
*/
const isInert = function (node, lookUp = true) {
// CAREFUL: JSDom does not support inert at all, so we can't use the `HTMLElement.inert`
// JS API property; we have to check the attribute, which can either be empty or 'true';
// if it's `null` (not specified) or 'false', it's an active element
const inertAtt = node?.getAttribute?.('inert');
const inert = inertAtt === '' || inertAtt === 'true';
// NOTE: this could also be handled with `node.matches('[inert], :is([inert] *)')`
// if it weren't for `matches()` not being a function on shadow roots; the following
// code works for any kind of node
const result =
inert ||
(lookUp &&
node &&
// closest does not exist on shadow roots, so we fall back to a manual
// lookup upward, in case it is not defined.
(typeof node.closest === 'function'
? node.closest('[inert]')
: isInert(node.parentNode)));
return result;
};
/**
* Determines if a node's content is editable.
* @param {Element} [node]
* @returns True if it's content-editable; false if it's not or `node` is falsy.
*/
const isContentEditable = function (node) {
// CAREFUL: JSDom does not support the `HTMLElement.isContentEditable` API so we have
// to use the attribute directly to check for this, which can either be empty or 'true';
// if it's `null` (not specified) or 'false', it's a non-editable element
const attValue = node?.getAttribute?.('contenteditable');
return attValue === '' || attValue === 'true';
};
/**
* @param {Element} el container to check in
* @param {boolean} includeContainer add container to check
* @param {(node: Element) => boolean} filter filter candidates
* @returns {Element[]}
*/
const getCandidates = function (el, includeContainer, filter) {
// even if `includeContainer=false`, we still have to check it for inertness because
// if it's inert (either by itself or via its parent), then all its children are inert
if (isInert(el)) {
return [];
}
let candidates = Array.prototype.slice.apply(
el.querySelectorAll(candidateSelector)
);
if (includeContainer && matches.call(el, candidateSelector)) {
candidates.unshift(el);
}
candidates = candidates.filter(filter);
return candidates;
};
/**
* @callback GetShadowRoot
* @param {Element} element to check for shadow root
* @returns {ShadowRoot|boolean} ShadowRoot if available or boolean indicating if a shadowRoot is attached but not available.
*/
/**
* @callback ShadowRootFilter
* @param {Element} shadowHostNode the element which contains shadow content
* @returns {boolean} true if a shadow root could potentially contain valid candidates.
*/
/**
* @typedef {Object} CandidateScope
* @property {Element} scopeParent contains inner candidates
* @property {Element[]} candidates list of candidates found in the scope parent
*/
/**
* @typedef {Object} IterativeOptions
* @property {GetShadowRoot|boolean} getShadowRoot true if shadow support is enabled; falsy if not;
* if a function, implies shadow support is enabled and either returns the shadow root of an element
* or a boolean stating if it has an undisclosed shadow root
* @property {(node: Element) => boolean} filter filter candidates
* @property {boolean} flatten if true then result will flatten any CandidateScope into the returned list
* @property {ShadowRootFilter} shadowRootFilter filter shadow roots;
*/
/**
* @param {Element[]} elements list of element containers to match candidates from
* @param {boolean} includeContainer add container list to check
* @param {IterativeOptions} options
* @returns {Array.<Element|CandidateScope>}
*/
const getCandidatesIteratively = function (
elements,
includeContainer,
options
) {
const candidates = [];
const elementsToCheck = Array.from(elements);
while (elementsToCheck.length) {
const element = elementsToCheck.shift();
if (isInert(element, false)) {
// no need to look up since we're drilling down
// anything inside this container will also be inert
continue;
}
if (element.tagName === 'SLOT') {
// add shadow dom slot scope (slot itself cannot be focusable)
const assigned = element.assignedElements();
const content = assigned.length ? assigned : element.children;
const nestedCandidates = getCandidatesIteratively(content, true, options);
if (options.flatten) {
candidates.push(...nestedCandidates);
} else {
candidates.push({
scopeParent: element,
candidates: nestedCandidates,
});
}
} else {
// check candidate element
const validCandidate = matches.call(element, candidateSelector);
if (
validCandidate &&
options.filter(element) &&
(includeContainer || !elements.includes(element))
) {
candidates.push(element);
}
// iterate over shadow content if possible
const shadowRoot =
element.shadowRoot ||
// check for an undisclosed shadow
(typeof options.getShadowRoot === 'function' &&
options.getShadowRoot(element));
// no inert look up because we're already drilling down and checking for inertness
// on the way down, so all containers to this root node should have already been
// vetted as non-inert
const validShadowRoot =
!isInert(shadowRoot, false) &&
(!options.shadowRootFilter || options.shadowRootFilter(element));
if (shadowRoot && validShadowRoot) {
// add shadow dom scope IIF a shadow root node was given; otherwise, an undisclosed
// shadow exists, so look at light dom children as fallback BUT create a scope for any
// child candidates found because they're likely slotted elements (elements that are
// children of the web component element (which has the shadow), in the light dom, but
// slotted somewhere _inside_ the undisclosed shadow) -- the scope is created below,
// _after_ we return from this recursive call
const nestedCandidates = getCandidatesIteratively(
shadowRoot === true ? element.children : shadowRoot.children,
true,
options
);
if (options.flatten) {
candidates.push(...nestedCandidates);
} else {
candidates.push({
scopeParent: element,
candidates: nestedCandidates,
});
}
} else {
// there's not shadow so just dig into the element's (light dom) children
// __without__ giving the element special scope treatment
elementsToCheck.unshift(...element.children);
}
}
}
return candidates;
};
/**
* @private
* Determines if the node has an explicitly specified `tabindex` attribute.
* @param {HTMLElement} node
* @returns {boolean} True if so; false if not.
*/
const hasTabIndex = function (node) {
return !isNaN(parseInt(node.getAttribute('tabindex'), 10));
};
/**
* Determine the tab index of a given node.
* @param {HTMLElement} node
* @returns {number} Tab order (negative, 0, or positive number).
* @throws {Error} If `node` is falsy.
*/
const getTabIndex = function (node) {
if (!node) {
throw new Error('No node provided');
}
if (node.tabIndex < 0) {
// in Chrome, <details/>, <audio controls/> and <video controls/> elements get a default
// `tabIndex` of -1 when the 'tabindex' attribute isn't specified in the DOM,
// yet they are still part of the regular tab order; in FF, they get a default
// `tabIndex` of 0; since Chrome still puts those elements in the regular tab
// order, consider their tab index to be 0.
// Also browsers do not return `tabIndex` correctly for contentEditable nodes;
// so if they don't have a tabindex attribute specifically set, assume it's 0.
if (
(/^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) ||
isContentEditable(node)) &&
!hasTabIndex(node)
) {
return 0;
}
}
return node.tabIndex;
};
/**
* Determine the tab index of a given node __for sort order purposes__.
* @param {HTMLElement} node
* @param {boolean} [isScope] True for a custom element with shadow root or slot that, by default,
* has tabIndex -1, but needs to be sorted by document order in order for its content to be
* inserted into the correct sort position.
* @returns {number} Tab order (negative, 0, or positive number).
*/
const getSortOrderTabIndex = function (node, isScope) {
const tabIndex = getTabIndex(node);
if (tabIndex < 0 && isScope && !hasTabIndex(node)) {
return 0;
}
return tabIndex;
};
const sortOrderedTabbables = function (a, b) {
return a.tabIndex === b.tabIndex
? a.documentOrder - b.documentOrder
: a.tabIndex - b.tabIndex;
};
const isInput = function (node) {
return node.tagName === 'INPUT';
};
const isHiddenInput = function (node) {
return isInput(node) && node.type === 'hidden';
};
const isDetailsWithSummary = function (node) {
const r =
node.tagName === 'DETAILS' &&
Array.prototype.slice
.apply(node.children)
.some((child) => child.tagName === 'SUMMARY');
return r;
};
const getCheckedRadio = function (nodes, form) {
for (let i = 0; i < nodes.length; i++) {
if (nodes[i].checked && nodes[i].form === form) {
return nodes[i];
}
}
};
const isTabbableRadio = function (node) {
if (!node.name) {
return true;
}
const radioScope = node.form || getRootNode(node);
const queryRadios = function (name) {
return radioScope.querySelectorAll(
'input[type="radio"][name="' + name + '"]'
);
};
let radioSet;
if (
typeof window !== 'undefined' &&
typeof window.CSS !== 'undefined' &&
typeof window.CSS.escape === 'function'
) {
radioSet = queryRadios(window.CSS.escape(node.name));
} else {
try {
radioSet = queryRadios(node.name);
} catch (err) {
// eslint-disable-next-line no-console
console.error(
'Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s',
err.message
);
return false;
}
}
const checked = getCheckedRadio(radioSet, node.form);
return !checked || checked === node;
};
const isRadio = function (node) {
return isInput(node) && node.type === 'radio';
};
const isNonTabbableRadio = function (node) {
return isRadio(node) && !isTabbableRadio(node);
};
// determines if a node is ultimately attached to the window's document
const isNodeAttached = function (node) {
// The root node is the shadow root if the node is in a shadow DOM; some document otherwise
// (but NOT _the_ document; see second 'If' comment below for more).
// If rootNode is shadow root, it'll have a host, which is the element to which the shadow
// is attached, and the one we need to check if it's in the document or not (because the
// shadow, and all nodes it contains, is never considered in the document since shadows
// behave like self-contained DOMs; but if the shadow's HOST, which is part of the document,
// is hidden, or is not in the document itself but is detached, it will affect the shadow's
// visibility, including all the nodes it contains). The host could be any normal node,
// or a custom element (i.e. web component). Either way, that's the one that is considered
// part of the document, not the shadow root, nor any of its children (i.e. the node being
// tested).
// To further complicate things, we have to look all the way up until we find a shadow HOST
// that is attached (or find none) because the node might be in nested shadows...
// If rootNode is not a shadow root, it won't have a host, and so rootNode should be the
// document (per the docs) and while it's a Document-type object, that document does not
// appear to be the same as the node's `ownerDocument` for some reason, so it's safer
// to ignore the rootNode at this point, and use `node.ownerDocument`. Otherwise,
// using `rootNode.contains(node)` will _always_ be true we'll get false-positives when
// node is actually detached.
// NOTE: If `nodeRootHost` or `node` happens to be the `document` itself (which is possible
// if a tabbable/focusable node was quickly added to the DOM, focused, and then removed
// from the DOM as in https://github.com/focus-trap/focus-trap-react/issues/905), then
// `ownerDocument` will be `null`, hence the optional chaining on it.
let nodeRoot = node && getRootNode(node);
let nodeRootHost = nodeRoot?.host;
// in some cases, a detached node will return itself as the root instead of a document or
// shadow root object, in which case, we shouldn't try to look further up the host chain
let attached = false;
if (nodeRoot && nodeRoot !== node) {
attached = !!(
nodeRootHost?.ownerDocument?.contains(nodeRootHost) ||
node?.ownerDocument?.contains(node)
);
while (!attached && nodeRootHost) {
// since it's not attached and we have a root host, the node MUST be in a nested shadow DOM,
// which means we need to get the host's host and check if that parent host is contained
// in (i.e. attached to) the document
nodeRoot = getRootNode(nodeRootHost);
nodeRootHost = nodeRoot?.host;
attached = !!nodeRootHost?.ownerDocument?.contains(nodeRootHost);
}
}
return attached;
};
const isZeroArea = function (node) {
const { width, height } = node.getBoundingClientRect();
return width === 0 && height === 0;
};
const isHidden = function (node, { displayCheck, getShadowRoot }) {
if (displayCheck === 'full-native') {
if ('checkVisibility' in node) {
// Chrome >= 105, Edge >= 105, Firefox >= 106, Safari >= 17.4
// @see https://developer.mozilla.org/en-US/docs/Web/API/Element/checkVisibility#browser_compatibility
const visible = node.checkVisibility({
// Checking opacity might be desirable for some use cases, but natively,
// opacity zero elements _are_ focusable and tabbable.
checkOpacity: false,
opacityProperty: false,
contentVisibilityAuto: true,
visibilityProperty: true,
// This is an alias for `visibilityProperty`. Contemporary browsers
// support both. However, this alias has wider browser support (Chrome
// >= 105 and Firefox >= 106, vs. Chrome >= 121 and Firefox >= 122), so
// we include it anyway.
checkVisibilityCSS: true,
});
return !visible;
}
// Fall through to manual visibility checks
}
// NOTE: visibility will be `undefined` if node is detached from the document
// (see notes about this further down), which means we will consider it visible
// (this is legacy behavior from a very long way back)
// NOTE: we check this regardless of `displayCheck="none"` because this is a
// _visibility_ check, not a _display_ check
if (getComputedStyle(node).visibility === 'hidden') {
return true;
}
const isDirectSummary = matches.call(node, 'details>summary:first-of-type');
const nodeUnderDetails = isDirectSummary ? node.parentElement : node;
if (matches.call(nodeUnderDetails, 'details:not([open]) *')) {
return true;
}
if (
!displayCheck ||
displayCheck === 'full' ||
// full-native can run this branch when it falls through in case
// Element#checkVisibility is unsupported
displayCheck === 'full-native' ||
displayCheck === 'legacy-full'
) {
if (typeof getShadowRoot === 'function') {
// figure out if we should consider the node to be in an undisclosed shadow and use the
// 'non-zero-area' fallback
const originalNode = node;
while (node) {
const parentElement = node.parentElement;
const rootNode = getRootNode(node);
if (
parentElement &&
!parentElement.shadowRoot &&
getShadowRoot(parentElement) === true // check if there's an undisclosed shadow
) {
// node has an undisclosed shadow which means we can only treat it as a black box, so we
// fall back to a non-zero-area test
return isZeroArea(node);
} else if (node.assignedSlot) {
// iterate up slot
node = node.assignedSlot;
} else if (!parentElement && rootNode !== node.ownerDocument) {
// cross shadow boundary
node = rootNode.host;
} else {
// iterate up normal dom
node = parentElement;
}
}
node = originalNode;
}
// else, `getShadowRoot` might be true, but all that does is enable shadow DOM support
// (i.e. it does not also presume that all nodes might have undisclosed shadows); or
// it might be a falsy value, which means shadow DOM support is disabled
// Since we didn't find it sitting in an undisclosed shadow (or shadows are disabled)
// now we can just test to see if it would normally be visible or not, provided it's
// attached to the main document.
// NOTE: We must consider case where node is inside a shadow DOM and given directly to
// `isTabbable()` or `isFocusable()` -- regardless of `getShadowRoot` option setting.
if (isNodeAttached(node)) {
// this works wherever the node is: if there's at least one client rect, it's
// somehow displayed; it also covers the CSS 'display: contents' case where the
// node itself is hidden in place of its contents; and there's no need to search
// up the hierarchy either
return !node.getClientRects().length;
}
// Else, the node isn't attached to the document, which means the `getClientRects()`
// API will __always__ return zero rects (this can happen, for example, if React
// is used to render nodes onto a detached tree, as confirmed in this thread:
// https://github.com/facebook/react/issues/9117#issuecomment-284228870)
//
// It also means that even window.getComputedStyle(node).display will return `undefined`
// because styles are only computed for nodes that are in the document.
//
// NOTE: THIS HAS BEEN THE CASE FOR YEARS. It is not new, nor is it caused by tabbable
// somehow. Though it was never stated officially, anyone who has ever used tabbable
// APIs on nodes in detached containers has actually implicitly used tabbable in what
// was later (as of v5.2.0 on Apr 9, 2021) called `displayCheck="none"` mode -- essentially
// considering __everything__ to be visible because of the innability to determine styles.
//
// v6.0.0: As of this major release, the default 'full' option __no longer treats detached
// nodes as visible with the 'none' fallback.__
if (displayCheck !== 'legacy-full') {
return true; // hidden
}
// else, fallback to 'none' mode and consider the node visible
} else if (displayCheck === 'non-zero-area') {
// NOTE: Even though this tests that the node's client rect is non-zero to determine
// whether it's displayed, and that a detached node will __always__ have a zero-area
// client rect, we don't special-case for whether the node is attached or not. In
// this mode, we do want to consider nodes that have a zero area to be hidden at all
// times, and that includes attached or not.
return isZeroArea(node);
}
// visible, as far as we can tell, or per current `displayCheck=none` mode, we assume
// it's visible
return false;
};
// form fields (nested) inside a disabled fieldset are not focusable/tabbable
// unless they are in the _first_ <legend> element of the top-most disabled
// fieldset
const isDisabledFromFieldset = function (node) {
if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(node.tagName)) {
let parentNode = node.parentElement;
// check if `node` is contained in a disabled <fieldset>
while (parentNode) {
if (parentNode.tagName === 'FIELDSET' && parentNode.disabled) {
// look for the first <legend> among the children of the disabled <fieldset>
for (let i = 0; i < parentNode.children.length; i++) {
const child = parentNode.children.item(i);
// when the first <legend> (in document order) is found
if (child.tagName === 'LEGEND') {
// if its parent <fieldset> is not nested in another disabled <fieldset>,
// return whether `node` is a descendant of its first <legend>
return matches.call(parentNode, 'fieldset[disabled] *')
? true
: !child.contains(node);
}
}
// the disabled <fieldset> containing `node` has no <legend>
return true;
}
parentNode = parentNode.parentElement;
}
}
// else, node's tabbable/focusable state should not be affected by a fieldset's
// enabled/disabled state
return false;
};
const isNodeMatchingSelectorFocusable = function (options, node) {
if (
node.disabled ||
isHiddenInput(node) ||
isHidden(node, options) ||
// For a details element with a summary, the summary element gets the focus
isDetailsWithSummary(node) ||
isDisabledFromFieldset(node)
) {
return false;
}
return true;
};
const isNodeMatchingSelectorTabbable = function (options, node) {
if (
isNonTabbableRadio(node) ||
getTabIndex(node) < 0 ||
!isNodeMatchingSelectorFocusable(options, node)
) {
return false;
}
return true;
};
const isShadowRootTabbable = function (shadowHostNode) {
const tabIndex = parseInt(shadowHostNode.getAttribute('tabindex'), 10);
if (isNaN(tabIndex) || tabIndex >= 0) {
return true;
}
// If a custom element has an explicit negative tabindex,
// browsers will not allow tab targeting said element's children.
return false;
};
/**
* @param {Array.<Element|CandidateScope>} candidates
* @returns Element[]
*/
const sortByOrder = function (candidates) {
const regularTabbables = [];
const orderedTabbables = [];
candidates.forEach(function (item, i) {
const isScope = !!item.scopeParent;
const element = isScope ? item.scopeParent : item;
const candidateTabindex = getSortOrderTabIndex(element, isScope);
const elements = isScope ? sortByOrder(item.candidates) : element;
if (candidateTabindex === 0) {
isScope
? regularTabbables.push(...elements)
: regularTabbables.push(element);
} else {
orderedTabbables.push({
documentOrder: i,
tabIndex: candidateTabindex,
item: item,
isScope: isScope,
content: elements,
});
}
});
return orderedTabbables
.sort(sortOrderedTabbables)
.reduce((acc, sortable) => {
sortable.isScope
? acc.push(...sortable.content)
: acc.push(sortable.content);
return acc;
}, [])
.concat(regularTabbables);
};
const tabbable = function (container, options) {
options = options || {};
let candidates;
if (options.getShadowRoot) {
candidates = getCandidatesIteratively(
[container],
options.includeContainer,
{
filter: isNodeMatchingSelectorTabbable.bind(null, options),
flatten: false,
getShadowRoot: options.getShadowRoot,
shadowRootFilter: isShadowRootTabbable,
}
);
} else {
candidates = getCandidates(
container,
options.includeContainer,
isNodeMatchingSelectorTabbable.bind(null, options)
);
}
return sortByOrder(candidates);
};
const focusable = function (container, options) {
options = options || {};
let candidates;
if (options.getShadowRoot) {
candidates = getCandidatesIteratively(
[container],
options.includeContainer,
{
filter: isNodeMatchingSelectorFocusable.bind(null, options),
flatten: true,
getShadowRoot: options.getShadowRoot,
}
);
} else {
candidates = getCandidates(
container,
options.includeContainer,
isNodeMatchingSelectorFocusable.bind(null, options)
);
}
return candidates;
};
const isTabbable = function (node, options) {
options = options || {};
if (!node) {
throw new Error('No node provided');
}
if (matches.call(node, candidateSelector) === false) {
return false;
}
return isNodeMatchingSelectorTabbable(options, node);
};
const focusableCandidateSelector = /* #__PURE__ */ candidateSelectors
.concat('iframe:not([inert]):not([inert] *)')
.join(',');
const isFocusable = function (node, options) {
options = options || {};
if (!node) {
throw new Error('No node provided');
}
if (matches.call(node, focusableCandidateSelector) === false) {
return false;
}
return isNodeMatchingSelectorFocusable(options, node);
};
export { tabbable, focusable, isTabbable, isFocusable, getTabIndex };

View File

@@ -0,0 +1 @@
{"version":3,"file":"abortAndIgnore.js","names":["abortAndIgnore","abortController","abort","_err","handleAbortRef","abortControllerRef","newController","AbortController","current"],"sources":["../../src/utilities/abortAndIgnore.ts"],"sourcesContent":["export function abortAndIgnore(abortController: AbortController) {\n if (abortController) {\n try {\n abortController.abort()\n } catch (_err) {\n // swallow error\n }\n }\n}\n\n/**\n * Use this function when an effect is triggered multiple times over and you want to cancel the previous effect.\n * It will abort the previous effect and create a new AbortController for the next effect.\n * Important: You must also _reset_ the `abortControllerRef` after the effect is done, otherwise the next effect will be aborted immediately.\n * For example, run `abortControllerRef.current = null` in a `finally` block or after an awaited promise.\n * @param abortControllerRef\n * @returns {AbortController}\n */\nexport function handleAbortRef(\n abortControllerRef: React.RefObject<AbortController>,\n): AbortController {\n const newController = new AbortController()\n\n if (abortControllerRef.current) {\n try {\n abortControllerRef.current.abort()\n } catch (_err) {\n // swallow error\n }\n }\n\n abortControllerRef.current = newController\n\n return newController\n}\n"],"mappings":"AAAA,OAAO,SAASA,eAAeC,eAAgC;EAC7D,IAAIA,eAAA,EAAiB;IACnB,IAAI;MACFA,eAAA,CAAgBC,KAAK;IACvB,EAAE,OAAOC,IAAA,EAAM;MACb;IAAA;EAEJ;AACF;AAEA;;;;;;;;AAQA,OAAO,SAASC,eACdC,kBAAoD;EAEpD,MAAMC,aAAA,GAAgB,IAAIC,eAAA;EAE1B,IAAIF,kBAAA,CAAmBG,OAAO,EAAE;IAC9B,IAAI;MACFH,kBAAA,CAAmBG,OAAO,CAACN,KAAK;IAClC,EAAE,OAAOC,IAAA,EAAM;MACb;IAAA;EAEJ;EAEAE,kBAAA,CAAmBG,OAAO,GAAGF,aAAA;EAE7B,OAAOA,aAAA;AACT","ignoreList":[]}

View File

@@ -0,0 +1,19 @@
import type { DateArg } from "./types.js";
/**
* @name getMilliseconds
* @category Millisecond Helpers
* @summary Get the milliseconds of the given date.
*
* @description
* Get the milliseconds of the given date.
*
* @param date - The given date
*
* @returns The milliseconds
*
* @example
* // Get the milliseconds of 29 February 2012 11:45:05.123:
* const result = getMilliseconds(new Date(2012, 1, 29, 11, 45, 5, 123))
* //=> 123
*/
export declare function getMilliseconds(date: DateArg<Date> & {}): number;

View File

@@ -0,0 +1,25 @@
import { monthsInYear } from "./constants.js";
/**
* @name yearsToMonths
* @category Conversion Helpers
* @summary Convert years to months.
*
* @description
* Convert a number of years to a full number of months.
*
* @param years - The number of years to be converted
*
* @returns The number of years converted in months
*
* @example
* // Convert 2 years into months
* const result = yearsToMonths(2)
* //=> 24
*/
export function yearsToMonths(years) {
return Math.trunc(years * monthsInYear);
}
// Fallback for modularized imports:
export default yearsToMonths;

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