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

This commit is contained in:
2026-02-24 16:04:21 +01:00
parent 915eb61613
commit 5397309103
43805 changed files with 4324295 additions and 3 deletions
@@ -0,0 +1,8 @@
export const simpleEstimator = (options)=>{
const defaultComplexity = options && typeof options.defaultComplexity === 'number' ? options.defaultComplexity : 1;
return (args)=>{
return defaultComplexity + args.childComplexity;
};
};
//# sourceMappingURL=index.js.map
@@ -0,0 +1,31 @@
import { IntegrationFn } from '@sentry/core';
declare const LazyLoadableIntegrations: {
readonly replayIntegration: "replay";
readonly replayCanvasIntegration: "replay-canvas";
readonly feedbackIntegration: "feedback";
readonly feedbackModalIntegration: "feedback-modal";
readonly feedbackScreenshotIntegration: "feedback-screenshot";
readonly captureConsoleIntegration: "captureconsole";
readonly contextLinesIntegration: "contextlines";
readonly linkedErrorsIntegration: "linkederrors";
readonly dedupeIntegration: "dedupe";
readonly extraErrorDataIntegration: "extraerrordata";
readonly graphqlClientIntegration: "graphqlclient";
readonly httpClientIntegration: "httpclient";
readonly reportingObserverIntegration: "reportingobserver";
readonly rewriteFramesIntegration: "rewriteframes";
readonly browserProfilingIntegration: "browserprofiling";
readonly moduleMetadataIntegration: "modulemetadata";
readonly instrumentAnthropicAiClient: "instrumentanthropicaiclient";
readonly instrumentOpenAiClient: "instrumentopenaiclient";
readonly instrumentGoogleGenAIClient: "instrumentgooglegenaiclient";
readonly instrumentLangGraph: "instrumentlanggraph";
readonly createLangChainCallbackHandler: "createlangchaincallbackhandler";
};
/**
* Lazy load an integration from the CDN.
* Rejects if the integration cannot be loaded.
*/
export declare function lazyLoadIntegration(name: keyof typeof LazyLoadableIntegrations, scriptNonce?: string): Promise<IntegrationFn>;
export {};
//# sourceMappingURL=lazyLoadIntegration.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["DragOverlay","getEventCoordinates","FolderFileCard","baseClass","DragOverlaySelection","item","selectedCount","_jsx","dropAnimation","modifiers","snapTopLeftToCursor","style","height","maxWidth","_jsxs","className","Array","from","length","map","_","index","right","top","id","isSelected","itemKey","title","value","_folderOrDocumentTitle","type","activatorEvent","draggingNodeRect","transform","activatorCoordinates","offsetX","x","left","offsetY","y"],"sources":["../../../../src/elements/FolderView/DragOverlaySelection/index.tsx"],"sourcesContent":["import type { Modifier } from '@dnd-kit/core'\nimport type { FolderOrDocument } from 'payload/shared'\n\nimport { DragOverlay } from '@dnd-kit/core'\nimport { getEventCoordinates } from '@dnd-kit/utilities'\n\nimport { FolderFileCard } from '../FolderFileCard/index.js'\nimport './index.scss'\n\nconst baseClass = 'drag-overlay-selection'\n\ntype DragCardsProps = {\n readonly item: FolderOrDocument\n readonly selectedCount: number\n}\nexport function DragOverlaySelection({ item, selectedCount }: DragCardsProps) {\n return (\n <DragOverlay\n dropAnimation={null}\n modifiers={[snapTopLeftToCursor]}\n style={{\n height: 'unset',\n maxWidth: '220px',\n }}\n >\n <div className={`${baseClass}__cards`}>\n {Array.from({ length: selectedCount > 1 ? 2 : 1 }).map((_, index) => (\n <div\n className={`${baseClass}__card`}\n key={index}\n style={{\n right: `${index * 3}px`,\n top: `-${index * 3}px`,\n }}\n >\n <FolderFileCard\n id={null}\n isSelected\n itemKey=\"overlay-card\"\n title={item.value._folderOrDocumentTitle}\n type=\"folder\"\n />\n </div>\n ))}\n {selectedCount > 1 ? (\n <span className={`${baseClass}__card-count`}>{selectedCount}</span>\n ) : null}\n </div>\n </DragOverlay>\n )\n}\n\nexport const snapTopLeftToCursor: Modifier = ({ activatorEvent, draggingNodeRect, transform }) => {\n if (draggingNodeRect && activatorEvent) {\n const activatorCoordinates = getEventCoordinates(activatorEvent)\n\n if (!activatorCoordinates) {\n return transform\n }\n\n const offsetX = activatorCoordinates.x - draggingNodeRect.left\n const offsetY = activatorCoordinates.y - draggingNodeRect.top\n\n return {\n ...transform,\n x: transform.x + offsetX + 5,\n y: transform.y + offsetY + 5,\n }\n }\n\n return transform\n}\n"],"mappings":";AAGA,SAASA,WAAW,QAAQ;AAC5B,SAASC,mBAAmB,QAAQ;AAEpC,SAASC,cAAc,QAAQ;AAC/B,OAAO;AAEP,MAAMC,SAAA,GAAY;AAMlB,OAAO,SAASC,qBAAqB;EAAEC,IAAI;EAAEC;AAAa,CAAkB;EAC1E,oBACEC,IAAA,CAACP,WAAA;IACCQ,aAAA,EAAe;IACfC,SAAA,EAAW,CAACC,mBAAA,CAAoB;IAChCC,KAAA,EAAO;MACLC,MAAA,EAAQ;MACRC,QAAA,EAAU;IACZ;cAEA,aAAAC,KAAA,CAAC;MAAIC,SAAA,EAAW,GAAGZ,SAAA,SAAkB;iBAClCa,KAAA,CAAMC,IAAI,CAAC;QAAEC,MAAA,EAAQZ,aAAA,GAAgB,IAAI,IAAI;MAAE,GAAGa,GAAG,CAAC,CAACC,CAAA,EAAGC,KAAA,kBACzDd,IAAA,CAAC;QACCQ,SAAA,EAAW,GAAGZ,SAAA,QAAiB;QAE/BQ,KAAA,EAAO;UACLW,KAAA,EAAO,GAAGD,KAAA,GAAQ,KAAK;UACvBE,GAAA,EAAK,IAAIF,KAAA,GAAQ;QACnB;kBAEA,aAAAd,IAAA,CAACL,cAAA;UACCsB,EAAA,EAAI;UACJC,UAAU;UACVC,OAAA,EAAQ;UACRC,KAAA,EAAOtB,IAAA,CAAKuB,KAAK,CAACC,sBAAsB;UACxCC,IAAA,EAAK;;SAXFT,KAAA,IAeRf,aAAA,GAAgB,iBACfC,IAAA,CAAC;QAAKQ,SAAA,EAAW,GAAGZ,SAAA,cAAuB;kBAAGG;WAC5C;;;AAIZ;AAEA,OAAO,MAAMI,mBAAA,GAAgCA,CAAC;EAAEqB,cAAc;EAAEC,gBAAgB;EAAEC;AAAS,CAAE;EAC3F,IAAID,gBAAA,IAAoBD,cAAA,EAAgB;IACtC,MAAMG,oBAAA,GAAuBjC,mBAAA,CAAoB8B,cAAA;IAEjD,IAAI,CAACG,oBAAA,EAAsB;MACzB,OAAOD,SAAA;IACT;IAEA,MAAME,OAAA,GAAUD,oBAAA,CAAqBE,CAAC,GAAGJ,gBAAA,CAAiBK,IAAI;IAC9D,MAAMC,OAAA,GAAUJ,oBAAA,CAAqBK,CAAC,GAAGP,gBAAA,CAAiBT,GAAG;IAE7D,OAAO;MACL,GAAGU,SAAS;MACZG,CAAA,EAAGH,SAAA,CAAUG,CAAC,GAAGD,OAAA,GAAU;MAC3BI,CAAA,EAAGN,SAAA,CAAUM,CAAC,GAAGD,OAAA,GAAU;IAC7B;EACF;EAEA,OAAOL,SAAA;AACT","ignoreList":[]}
@@ -0,0 +1,33 @@
import { Decimal } from "decimal.js";
import { ToPrimitive } from "./262.js";
/**
* https://tc39.es/ecma402/#sec-tointlmathematicalvalue
* Converts input to a mathematical value, supporting BigInt
*/
export function ToIntlMathematicalValue(input) {
// Handle BigInt directly before ToPrimitive, since ToPrimitive doesn't
// handle bigint in its type signature (though the spec says it should return it as-is)
if (typeof input === "bigint") {
return new Decimal(input.toString());
}
let primValue = ToPrimitive(input, "number");
// Handle other primitive types
if (primValue === undefined) {
return new Decimal(NaN);
}
if (primValue === true) {
return new Decimal(1);
}
if (primValue === false) {
return new Decimal(0);
}
if (primValue === null) {
return new Decimal(0);
}
// Try to convert to Decimal (handles numbers and strings)
try {
return new Decimal(primValue);
} catch {
return new Decimal(NaN);
}
}
@@ -0,0 +1 @@
{"version":3,"file":"panels.js","names":[],"sources":["../../../../src/rest/commands/delete/panels.ts"],"sourcesContent":["import type { DirectusPanel } from '../../../schema/panel.js';\nimport type { RestCommand } from '../../types.js';\nimport { throwIfEmpty } from '../../utils/index.js';\n\n/**\n * Delete multiple existing panels.\n * @param keys\n * @returns\n * @throws Will throw if keys is empty\n */\nexport const deletePanels =\n\t<Schema>(keys: DirectusPanel<Schema>['id'][]): RestCommand<void, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(keys, 'Keys cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/panels`,\n\t\t\tbody: JSON.stringify(keys),\n\t\t\tmethod: 'DELETE',\n\t\t};\n\t};\n\n/**\n * Delete an existing panel.\n * @param key\n * @returns\n * @throws Will throw if key is empty\n */\nexport const deletePanel =\n\t<Schema>(key: DirectusPanel<Schema>['id']): RestCommand<void, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(key, 'Key cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/panels/${key}`,\n\t\t\tmethod: 'DELETE',\n\t\t};\n\t};\n"],"mappings":"6DAUA,MAAa,EACH,QAER,EAAa,EAAM,uBAAuB,CAEnC,CACN,KAAM,UACN,KAAM,KAAK,UAAU,EAAK,CAC1B,OAAQ,SACR,EASU,EACH,QAER,EAAa,EAAK,sBAAsB,CAEjC,CACN,KAAM,WAAW,IACjB,OAAQ,SACR"}
@@ -0,0 +1,8 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.safeParseAsync = exports.parseAsync = exports.safeParse = exports.parse = void 0;
var index_js_1 = require("../core/index.cjs");
Object.defineProperty(exports, "parse", { enumerable: true, get: function () { return index_js_1.parse; } });
Object.defineProperty(exports, "safeParse", { enumerable: true, get: function () { return index_js_1.safeParse; } });
Object.defineProperty(exports, "parseAsync", { enumerable: true, get: function () { return index_js_1.parseAsync; } });
Object.defineProperty(exports, "safeParseAsync", { enumerable: true, get: function () { return index_js_1.safeParseAsync; } });
@@ -0,0 +1,40 @@
'use strict'
const { test } = require('node:test')
const { createWarning } = require('../')
const { withResolvers } = require('./promise')
test('a limited warning can be re-set', t => {
t.plan(4)
const { promise, resolve } = withResolvers()
let count = 0
process.on('warning', onWarning)
function onWarning () {
count++
}
const warn = createWarning({
name: 'TestDeprecation',
code: 'CODE',
message: 'Hello world'
})
warn()
t.assert.ok(warn.emitted)
warn()
t.assert.ok(warn.emitted)
warn.emitted = false
warn()
t.assert.ok(warn.emitted)
setImmediate(() => {
t.assert.deepStrictEqual(count, 2)
process.removeListener('warning', onWarning)
resolve()
})
return promise
})
@@ -0,0 +1 @@
{"version":3,"file":"decode-data-xml.js","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["generated/decode-data-xml.ts"],"names":[],"mappings":";AAAA,8CAA8C;;AAE9C,kBAAe,IAAI,WAAW;AAC1B,kBAAkB;AAClB,uFAAuF;KAClF,KAAK,CAAC,EAAE,CAAC;KACT,GAAG,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAf,CAAe,CAAC,CACnC,CAAC"}
@@ -0,0 +1,100 @@
export const elementNames = new Map([
"altGlyph",
"altGlyphDef",
"altGlyphItem",
"animateColor",
"animateMotion",
"animateTransform",
"clipPath",
"feBlend",
"feColorMatrix",
"feComponentTransfer",
"feComposite",
"feConvolveMatrix",
"feDiffuseLighting",
"feDisplacementMap",
"feDistantLight",
"feDropShadow",
"feFlood",
"feFuncA",
"feFuncB",
"feFuncG",
"feFuncR",
"feGaussianBlur",
"feImage",
"feMerge",
"feMergeNode",
"feMorphology",
"feOffset",
"fePointLight",
"feSpecularLighting",
"feSpotLight",
"feTile",
"feTurbulence",
"foreignObject",
"glyphRef",
"linearGradient",
"radialGradient",
"textPath",
].map((val) => [val.toLowerCase(), val]));
export const attributeNames = new Map([
"definitionURL",
"attributeName",
"attributeType",
"baseFrequency",
"baseProfile",
"calcMode",
"clipPathUnits",
"diffuseConstant",
"edgeMode",
"filterUnits",
"glyphRef",
"gradientTransform",
"gradientUnits",
"kernelMatrix",
"kernelUnitLength",
"keyPoints",
"keySplines",
"keyTimes",
"lengthAdjust",
"limitingConeAngle",
"markerHeight",
"markerUnits",
"markerWidth",
"maskContentUnits",
"maskUnits",
"numOctaves",
"pathLength",
"patternContentUnits",
"patternTransform",
"patternUnits",
"pointsAtX",
"pointsAtY",
"pointsAtZ",
"preserveAlpha",
"preserveAspectRatio",
"primitiveUnits",
"refX",
"refY",
"repeatCount",
"repeatDur",
"requiredExtensions",
"requiredFeatures",
"specularConstant",
"specularExponent",
"spreadMethod",
"startOffset",
"stdDeviation",
"stitchTiles",
"surfaceScale",
"systemLanguage",
"tableValues",
"targetX",
"targetY",
"textLength",
"viewBox",
"viewTarget",
"xChannelSelector",
"yChannelSelector",
"zoomAndPan",
].map((val) => [val.toLowerCase(), val]));
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('sortedUniqBy', require('../sortedUniqBy'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1,35 @@
# Brand Promise
Keeping user information safe and secure is a top priority, and we welcome the contribution of external security researchers.
# Scope
If you believe you've found a security issue in software that is maintained in this repository, we encourage you to notify us.
| Version | In scope | Source code |
| ------- | -------- | ----------- |
| >= 6.0.0 | ✅ | https://github.com/Hacker0x01/react-datepicker |
| < 2.0.0 | ❌ | https://github.com/Hacker0x01/react-datepicker/releases |
# How to Submit a Report
To submit a vulnerability report, please fill out this [form](https://hackerone.com/security). Your submission will be reviewed and validated by a member of our team.
# Safe Harbor
We support safe harbor for security researchers who:
* Make a good faith effort to avoid privacy violations, destruction of data, and interruption or degradation of our services.
* Only interact with accounts you own or with explicit permission of the account holder. If you do encounter Personally Identifiable Information (PII) contact us immediately, do not proceed with access, and immediately purge any local information.
* Provide us with a reasonable amount of time to resolve vulnerabilities prior to any disclosure to the public or a third-party.
We will consider activities conducted consistent with this policy to constitute "authorized" conduct and will not pursue civil action or initiate a complaint to law enforcement. We will help to the extent we can if legal action is initiated by a third party against you.
Please submit a report to us before engaging in conduct that may be inconsistent with or unaddressed by this policy.
# Preferences
* Please provide detailed reports with reproducible steps and a clearly defined impact.
* Include the version number of the vulnerable package in your report
* Social engineering (e.g. phishing, vishing, smishing) is prohibited.
@@ -0,0 +1,529 @@
function _typeof(o) {"@babel/helpers - typeof";return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;}, _typeof(o);}function ownKeys(e, r) {var t = Object.keys(e);if (Object.getOwnPropertySymbols) {var o = Object.getOwnPropertySymbols(e);r && (o = o.filter(function (r) {return Object.getOwnPropertyDescriptor(e, r).enumerable;})), t.push.apply(t, o);}return t;}function _objectSpread(e) {for (var r = 1; r < arguments.length; r++) {var t = null != arguments[r] ? arguments[r] : {};r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {_defineProperty(e, r, t[r]);}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));});}return e;}function _defineProperty(obj, key, value) {key = _toPropertyKey(key);if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _toPropertyKey(t) {var i = _toPrimitive(t, "string");return "symbol" == _typeof(i) ? i : String(i);}function _toPrimitive(t, r) {if ("object" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || "default");if ("object" != _typeof(i)) return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return ("string" === r ? String : Number)(t);}(function (_window$dateFns) {var __defProp = Object.defineProperty;
var __export = function __export(target, all) {
for (var name in all)
__defProp(target, name, {
get: all[name],
enumerable: true,
configurable: true,
set: function set(newValue) {return all[name] = function () {return newValue;};}
});
};
// lib/locale/en-US/_lib/formatDistance.mjs
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/en-US/_lib/formatRelative.mjs
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.mjs
function buildLocalizeFn(args) {
return function (value, options) {
var context = options !== null && options !== void 0 && options.context ? String(options.context) : "standalone";
var valuesArray;
if (context === "formatting" && args.formattingValues) {
var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
} else {
var _defaultWidth = args.defaultWidth;
var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
valuesArray = args.values[_width] || args.values[_defaultWidth];
}
var index = args.argumentCallback ? args.argumentCallback(value) : value;
return valuesArray[index];
};
}
// lib/locale/en-US/_lib/localize.mjs
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.mjs
function buildMatchFn(args) {
return function (string) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var width = options.width;
var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
var matchResult = string.match(matchPattern);
if (!matchResult) {
return null;
}
var matchedString = matchResult[0];
var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {return pattern.test(matchedString);}) : findKey(parsePatterns, function (pattern) {return pattern.test(matchedString);});
var value;
value = args.valueCallback ? args.valueCallback(key) : key;
value = options.valueCallback ? options.valueCallback(value) : value;
var rest = string.slice(matchedString.length);
return { value: value, rest: rest };
};
}
var findKey = function findKey(object, predicate) {
for (var key in object) {
if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) {
return key;
}
}
return;
};
var findIndex = function findIndex(array, predicate) {
for (var key = 0; key < array.length; key++) {
if (predicate(array[key])) {
return key;
}
}
return;
};
// lib/locale/_lib/buildMatchPatternFn.mjs
function buildMatchPatternFn(args) {
return function (string) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var matchResult = string.match(args.matchPattern);
if (!matchResult)
return null;
var matchedString = matchResult[0];
var parseResult = string.match(args.parsePattern);
if (!parseResult)
return null;
var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
value = options.valueCallback ? options.valueCallback(value) : value;
var rest = string.slice(matchedString.length);
return { value: value, rest: rest };
};
}
// lib/locale/en-US/_lib/match.mjs
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/_lib/buildFormatLongFn.mjs
function buildFormatLongFn(args) {
return function () {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var width = options.width ? String(options.width) : args.defaultWidth;
var format = args.formats[width] || args.formats[args.defaultWidth];
return format;
};
}
// lib/locale/en-ZA/_lib/formatLong.mjs
var dateFormats = {
full: "EEEE, dd MMMM yyyy",
long: "dd MMMM yyyy",
medium: "dd MMM yyyy",
short: "yyyy/MM/dd"
};
var timeFormats = {
full: "HH:mm:ss zzzz",
long: "HH:mm:ss z",
medium: "HH:mm:ss",
short: "HH:mm"
};
var dateTimeFormats = {
full: "{{date}} '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-ZA.mjs
var enZA = {
code: "en-ZA",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 0,
firstWeekContainsDate: 1
}
};
// lib/locale/en-ZA/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), {}, {
enZA: enZA }) });
//# debugId=DF793519D3751DB664756e2164756e21
})();
//# sourceMappingURL=cdn.js.map
@@ -0,0 +1,5 @@
const file11 = require("./file11.js")
module.exports = function () {
file11()
}
@@ -0,0 +1,9 @@
import { _ as _array_with_holes } from "./_array_with_holes.js";
import { _ as _iterable_to_array_limit } from "./_iterable_to_array_limit.js";
import { _ as _non_iterable_rest } from "./_non_iterable_rest.js";
import { _ as _unsupported_iterable_to_array } from "./_unsupported_iterable_to_array.js";
function _sliced_to_array(arr, i) {
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
}
export { _sliced_to_array as _ };
@@ -0,0 +1,4 @@
import type { MigrationConfig } from "../migrator.js";
import type { SingleStoreRemoteDatabase } from "./driver.js";
export type ProxyMigrator = (migrationQueries: string[]) => Promise<void>;
export declare function migrate<TSchema extends Record<string, unknown>>(db: SingleStoreRemoteDatabase<TSchema>, callback: ProxyMigrator, config: MigrationConfig): Promise<void>;
@@ -0,0 +1,9 @@
// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
import { setYear as fn } from "../setYear.js";
import { convertToFP } from "./_lib/convertToFP.js";
export const setYear = convertToFP(fn, 2);
// Fallback for modularized imports:
export default setYear;
@@ -0,0 +1,34 @@
/** Used for built-in method references. */
var arrayProto = Array.prototype;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeReverse = arrayProto.reverse;
/**
* Reverses `array` so that the first element becomes the last, the second
* element becomes the second to last, and so on.
*
* **Note:** This method mutates `array` and is based on
* [`Array#reverse`](https://mdn.io/Array/reverse).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to modify.
* @returns {Array} Returns `array`.
* @example
*
* var array = [1, 2, 3];
*
* _.reverse(array);
* // => [3, 2, 1]
*
* console.log(array);
* // => [3, 2, 1]
*/
function reverse(array) {
return array == null ? array : nativeReverse.call(array);
}
module.exports = reverse;
@@ -0,0 +1,9 @@
// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
import { set as fn } from "../set.js";
import { convertToFP } from "./_lib/convertToFP.js";
export const setWithOptions = convertToFP(fn, 3);
// Fallback for modularized imports:
export default setWithOptions;
@@ -0,0 +1 @@
{"version":3,"file":"reparentChildFolder.d.ts","sourceRoot":"","sources":["../../../src/folders/hooks/reparentChildFolder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAW,MAAM,gBAAgB,CAAA;AAmDxE;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,mBAAmB,yBAE7B;IACD,eAAe,EAAE,MAAM,CAAA;CACxB,KAAG,yBAkCH,CAAA"}
@@ -0,0 +1,39 @@
// Copyright 2017 Lovell Fuller and others.
// SPDX-License-Identifier: Apache-2.0
'use strict';
const interpreterPath = (elf) => {
if (elf.length < 64) {
return null;
}
if (elf.readUInt32BE(0) !== 0x7F454C46) {
// Unexpected magic bytes
return null;
}
if (elf.readUInt8(4) !== 2) {
// Not a 64-bit ELF
return null;
}
if (elf.readUInt8(5) !== 1) {
// Not little-endian
return null;
}
const offset = elf.readUInt32LE(32);
const size = elf.readUInt16LE(54);
const count = elf.readUInt16LE(56);
for (let i = 0; i < count; i++) {
const headerOffset = offset + (i * size);
const type = elf.readUInt32LE(headerOffset);
if (type === 3) {
const fileOffset = elf.readUInt32LE(headerOffset + 8);
const fileSize = elf.readUInt32LE(headerOffset + 32);
return elf.subarray(fileOffset, fileOffset + fileSize).toString().replace(/\0.*$/g, '');
}
}
return null;
};
module.exports = {
interpreterPath
};
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2021 Matteo Collina
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,10 @@
import type { AppRouterInstance } from 'next/dist/shared/lib/app-router-context.shared-runtime.js';
type GoBackProps = {
adminRoute: string;
collectionSlug: string;
router: AppRouterInstance;
serverURL?: string;
};
export declare const handleGoBack: ({ adminRoute, collectionSlug, router, serverURL }: GoBackProps) => void;
export {};
//# sourceMappingURL=handleGoBack.d.ts.map
@@ -0,0 +1,27 @@
import type { ContextOptions, DateArg } from "./types.js";
/**
* The {@link isThursday} function options.
*/
export interface IsThursdayOptions extends ContextOptions<Date> {}
/**
* @name isThursday
* @category Weekday Helpers
* @summary Is the given date Thursday?
*
* @description
* Is the given date Thursday?
*
* @param date - The date to check
* @param options - An object with options
*
* @returns The date is Thursday
*
* @example
* // Is 25 September 2014 Thursday?
* const result = isThursday(new Date(2014, 8, 25))
* //=> true
*/
export declare function isThursday(
date: DateArg<Date> & {},
options?: IsThursdayOptions | undefined,
): boolean;
@@ -0,0 +1,59 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var expressions_exports = {};
__export(expressions_exports, {
concat: () => concat,
dotProduct: () => dotProduct,
euclideanDistance: () => euclideanDistance,
substring: () => substring
});
module.exports = __toCommonJS(expressions_exports);
var import_expressions = require("../sql/expressions/index.cjs");
var import_sql = require("../sql/sql.cjs");
__reExport(expressions_exports, require("../sql/expressions/index.cjs"), module.exports);
function concat(column, value) {
return import_sql.sql`${column} || ${(0, import_expressions.bindIfParam)(value, column)}`;
}
function substring(column, { from, for: _for }) {
const chunks = [import_sql.sql`substring(`, column];
if (from !== void 0) {
chunks.push(import_sql.sql` from `, (0, import_expressions.bindIfParam)(from, column));
}
if (_for !== void 0) {
chunks.push(import_sql.sql` for `, (0, import_expressions.bindIfParam)(_for, column));
}
chunks.push(import_sql.sql`)`);
return import_sql.sql.join(chunks);
}
function dotProduct(column, value) {
return import_sql.sql`${column} <*> ${JSON.stringify(value)}`;
}
function euclideanDistance(column, value) {
return import_sql.sql`${column} <-> ${JSON.stringify(value)}`;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
concat,
dotProduct,
euclideanDistance,
substring,
...require("../sql/expressions/index.cjs")
});
//# sourceMappingURL=expressions.cjs.map
@@ -0,0 +1,14 @@
// Polyfills for the explicit resource management types added in TypeScript 5.2.
interface SymbolConstructor {
readonly dispose: unique symbol;
readonly asyncDispose: unique symbol;
}
interface Disposable {
[Symbol.dispose](): void;
}
interface AsyncDisposable {
[Symbol.asyncDispose](): PromiseLike<void>;
}
@@ -0,0 +1,28 @@
"use strict";
exports.startOfTomorrow = startOfTomorrow; /**
* @name startOfTomorrow
* @category Day Helpers
* @summary Return the start of tomorrow.
* @pure false
*
* @description
* Return the start of tomorrow.
*
* @returns The start of tomorrow
*
* @example
* // If today is 6 October 2014:
* const result = startOfTomorrow()
* //=> Tue Oct 7 2014 00:00:00
*/
function startOfTomorrow() {
const now = new Date();
const year = now.getFullYear();
const month = now.getMonth();
const day = now.getDate();
const date = new Date(0);
date.setFullYear(year, month, day + 1);
date.setHours(0, 0, 0, 0);
return date;
}
@@ -0,0 +1,183 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const genAiAttributes = require('../ai/gen-ai-attributes.js');
const utils = require('../langchain/utils.js');
/**
* Extract tool calls from messages
*/
function extractToolCalls(messages) {
if (!messages || messages.length === 0) {
return null;
}
const toolCalls = [];
for (const message of messages) {
if (message && typeof message === 'object') {
const msgToolCalls = message.tool_calls;
if (msgToolCalls && Array.isArray(msgToolCalls)) {
toolCalls.push(...msgToolCalls);
}
}
}
return toolCalls.length > 0 ? toolCalls : null;
}
/**
* Extract token usage from a message's usage_metadata or response_metadata
* Returns token counts without setting span attributes
*/
function extractTokenUsageFromMessage(message)
{
const msg = message ;
let inputTokens = 0;
let outputTokens = 0;
let totalTokens = 0;
// Extract from usage_metadata (newer format)
if (msg.usage_metadata && typeof msg.usage_metadata === 'object') {
const usage = msg.usage_metadata ;
if (typeof usage.input_tokens === 'number') {
inputTokens = usage.input_tokens;
}
if (typeof usage.output_tokens === 'number') {
outputTokens = usage.output_tokens;
}
if (typeof usage.total_tokens === 'number') {
totalTokens = usage.total_tokens;
}
return { inputTokens, outputTokens, totalTokens };
}
// Fallback: Extract from response_metadata.tokenUsage
if (msg.response_metadata && typeof msg.response_metadata === 'object') {
const metadata = msg.response_metadata ;
if (metadata.tokenUsage && typeof metadata.tokenUsage === 'object') {
const tokenUsage = metadata.tokenUsage ;
if (typeof tokenUsage.promptTokens === 'number') {
inputTokens = tokenUsage.promptTokens;
}
if (typeof tokenUsage.completionTokens === 'number') {
outputTokens = tokenUsage.completionTokens;
}
if (typeof tokenUsage.totalTokens === 'number') {
totalTokens = tokenUsage.totalTokens;
}
}
}
return { inputTokens, outputTokens, totalTokens };
}
/**
* Extract model and finish reason from a message's response_metadata
*/
function extractModelMetadata(span, message) {
const msg = message ;
if (msg.response_metadata && typeof msg.response_metadata === 'object') {
const metadata = msg.response_metadata ;
if (metadata.model_name && typeof metadata.model_name === 'string') {
span.setAttribute(genAiAttributes.GEN_AI_RESPONSE_MODEL_ATTRIBUTE, metadata.model_name);
}
if (metadata.finish_reason && typeof metadata.finish_reason === 'string') {
span.setAttribute(genAiAttributes.GEN_AI_RESPONSE_FINISH_REASONS_ATTRIBUTE, [metadata.finish_reason]);
}
}
}
/**
* Extract tools from compiled graph structure
*
* Tools are stored in: compiledGraph.builder.nodes.tools.runnable.tools
*/
function extractToolsFromCompiledGraph(compiledGraph) {
if (!compiledGraph.builder?.nodes?.tools?.runnable?.tools) {
return null;
}
const tools = compiledGraph.builder?.nodes?.tools?.runnable?.tools;
if (!tools || !Array.isArray(tools) || tools.length === 0) {
return null;
}
// Extract name, description, and schema from each tool's lc_kwargs
return tools.map((tool) => ({
name: tool.lc_kwargs?.name,
description: tool.lc_kwargs?.description,
schema: tool.lc_kwargs?.schema,
}));
}
/**
* Set response attributes on the span
*/
function setResponseAttributes(span, inputMessages, result) {
// Extract messages from result
const resultObj = result ;
const outputMessages = resultObj?.messages;
if (!outputMessages || !Array.isArray(outputMessages)) {
return;
}
// Get new messages (delta between input and output)
const inputCount = inputMessages?.length ?? 0;
const newMessages = outputMessages.length > inputCount ? outputMessages.slice(inputCount) : [];
if (newMessages.length === 0) {
return;
}
// Extract and set tool calls from new messages BEFORE normalization
// (normalization strips tool_calls, so we need to extract them first)
const toolCalls = extractToolCalls(newMessages );
if (toolCalls) {
span.setAttribute(genAiAttributes.GEN_AI_RESPONSE_TOOL_CALLS_ATTRIBUTE, JSON.stringify(toolCalls));
}
// Normalize the new messages
const normalizedNewMessages = utils.normalizeLangChainMessages(newMessages);
span.setAttribute(genAiAttributes.GEN_AI_RESPONSE_TEXT_ATTRIBUTE, JSON.stringify(normalizedNewMessages));
// Accumulate token usage across all messages
let totalInputTokens = 0;
let totalOutputTokens = 0;
let totalTokens = 0;
// Extract metadata from messages
for (const message of newMessages) {
// Accumulate token usage
const tokens = extractTokenUsageFromMessage(message);
totalInputTokens += tokens.inputTokens;
totalOutputTokens += tokens.outputTokens;
totalTokens += tokens.totalTokens;
// Extract model metadata (last message's metadata wins for model/finish_reason)
extractModelMetadata(span, message);
}
// Set accumulated token usage on span
if (totalInputTokens > 0) {
span.setAttribute(genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE, totalInputTokens);
}
if (totalOutputTokens > 0) {
span.setAttribute(genAiAttributes.GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE, totalOutputTokens);
}
if (totalTokens > 0) {
span.setAttribute(genAiAttributes.GEN_AI_USAGE_TOTAL_TOKENS_ATTRIBUTE, totalTokens);
}
}
exports.extractModelMetadata = extractModelMetadata;
exports.extractTokenUsageFromMessage = extractTokenUsageFromMessage;
exports.extractToolCalls = extractToolCalls;
exports.extractToolsFromCompiledGraph = extractToolsFromCompiledGraph;
exports.setResponseAttributes = setResponseAttributes;
//# sourceMappingURL=utils.js.map
@@ -0,0 +1,5 @@
import setPrototypeOf from "./setPrototypeOf.js";
function _inheritsLoose(t, o) {
t.prototype = Object.create(o.prototype), t.prototype.constructor = t, setPrototypeOf(t, o);
}
export { _inheritsLoose as default };
@@ -0,0 +1,8 @@
"use strict";
exports.roundToNearestHoursWithOptions = void 0;
var _index = require("../roundToNearestHours.cjs");
var _index2 = require("./_lib/convertToFP.cjs"); // This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
const roundToNearestHoursWithOptions = (exports.roundToNearestHoursWithOptions =
(0, _index2.convertToFP)(_index.roundToNearestHours, 2));
@@ -0,0 +1,24 @@
var test = require('tape')
var printf = require('pff')
var getTypeParser = require('../').getTypeParser
var types = require('./types')
test('types', function (t) {
Object.keys(types).forEach(function (typeName) {
var type = types[typeName]
t.test(typeName, function (t) {
var parser = getTypeParser(type.id, type.format)
type.tests.forEach(function (tests) {
var input = tests[0]
var expected = tests[1]
var result = parser(input)
if (typeof expected === 'function') {
return expected(t, result)
}
t.equal(result, expected)
})
t.end()
})
})
})
@@ -0,0 +1 @@
{"version":3,"file":"arrow-big-left.js","sources":["../../../src/icons/arrow-big-left.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ArrowBigLeft\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTggMTVoLTZ2NGwtNy03IDctN3Y0aDZ2NnoiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/arrow-big-left\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst ArrowBigLeft = createLucideIcon('ArrowBigLeft', [\n ['path', { d: 'M18 15h-6v4l-7-7 7-7v4h6v6z', key: 'lbrdak' }],\n]);\n\nexport default ArrowBigLeft;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,iBAAiB,cAAgB,CAAA,CAAA,CAAA;AAAA,CAAA,CACpD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA+B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC9D,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _objectDestructuringEmpty;
function _objectDestructuringEmpty(obj) {
if (obj == null) throw new TypeError("Cannot destructure " + obj);
}
//# sourceMappingURL=objectDestructuringEmpty.js.map
@@ -0,0 +1,62 @@
"use strict";
exports.DayOfYearParser = void 0;
var _constants = require("../constants.cjs");
var _Parser = require("../Parser.cjs");
var _utils = require("../utils.cjs");
class DayOfYearParser extends _Parser.Parser {
priority = 90;
subpriority = 1;
parse(dateString, token, match) {
switch (token) {
case "D":
case "DD":
return (0, _utils.parseNumericPattern)(
_constants.numericPatterns.dayOfYear,
dateString,
);
case "Do":
return match.ordinalNumber(dateString, { unit: "date" });
default:
return (0, _utils.parseNDigits)(token.length, dateString);
}
}
validate(date, value) {
const year = date.getFullYear();
const isLeapYear = (0, _utils.isLeapYearIndex)(year);
if (isLeapYear) {
return value >= 1 && value <= 366;
} else {
return value >= 1 && value <= 365;
}
}
set(date, _flags, value) {
date.setMonth(0, value);
date.setHours(0, 0, 0, 0);
return date;
}
incompatibleTokens = [
"Y",
"R",
"q",
"Q",
"M",
"L",
"w",
"I",
"d",
"E",
"i",
"e",
"c",
"t",
"T",
];
}
exports.DayOfYearParser = DayOfYearParser;
@@ -0,0 +1 @@
{"version":3,"file":"withPayload.utils.d.ts","sourceRoot":"","sources":["../../src/withPayload/withPayload.utils.js"],"names":[],"mappings":"AAqDA;;;;GAIG;AACH,mCAHW,MAAM,GACJ,MAAM,CAqBlB;AAED;;;GAGG;AACH,oCAFa,MAAM,GAAG,SAAS,CAyB9B;AAED;;;;;GAKG;AACH,4EAHW,MAAM,GAAG,SAAS,GAChB,OAAO,CAqCnB;;;;;oBA5Ga,MAAM;;;;oBACN,MAAM;YACN,MAAM;YACN,MAAM;YACN,MAAM;iBACN,MAAM"}
@@ -0,0 +1,8 @@
"use strict";
exports.isFirstDayOfMonthWithOptions = void 0;
var _index = require("../isFirstDayOfMonth.cjs");
var _index2 = require("./_lib/convertToFP.cjs"); // This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
const isFirstDayOfMonthWithOptions = (exports.isFirstDayOfMonthWithOptions = (0,
_index2.convertToFP)(_index.isFirstDayOfMonth, 2));
@@ -0,0 +1,16 @@
[![Build status][ci image]][ci]
64-bit big-endian signed integer-to-string conversion designed for [pg][].
```js
const readInt8 = require('pg-int8');
readInt8(Buffer.from([0, 1, 2, 3, 4, 5, 6, 7]))
// '283686952306183'
```
[pg]: https://github.com/brianc/node-postgres
[ci]: https://travis-ci.org/charmander/pg-int8
[ci image]: https://api.travis-ci.org/charmander/pg-int8.svg
@@ -0,0 +1,5 @@
import type { CodeKeywordDefinition } from "../../types";
import { DiscrError, DiscrErrorObj } from "../discriminator/types";
export type DiscriminatorError = DiscrErrorObj<DiscrError.Tag> | DiscrErrorObj<DiscrError.Mapping>;
declare const def: CodeKeywordDefinition;
export default def;
@@ -0,0 +1 @@
export { _ as default } from "../esm/_class_call_check.js";
@@ -0,0 +1,59 @@
import type { ReactNode } from 'react';
import type Formats from './Formats.js';
import type ICUArgs from './ICUArgs.js';
import type ICUTags from './ICUTags.js';
import type IntlConfig from './IntlConfig.js';
import type { MessageKeys, NamespaceKeys, NestedKeyOf, NestedValueOf } from './MessageKeys.js';
import type { MarkupTagsFunction, RichTagsFunction, TranslationValues } from './TranslationValues.js';
import { type Formatters, type IntlCache } from './formatters.js';
import type { Prettify } from './types.js';
type ICUArgsWithTags<MessageString extends string, TagsFn extends RichTagsFunction | MarkupTagsFunction = never> = ICUArgs<MessageString, {
ICUArgument: string;
ICUNumberArgument: number | bigint;
ICUDateArgument: Date;
}> & ([TagsFn] extends [never] ? {} : ICUTags<MessageString, TagsFn>);
type OnlyOptional<T> = Partial<T> extends T ? true : false;
export type TranslateArgs<Value extends string, TagsFn extends RichTagsFunction | MarkupTagsFunction = never> = string extends Value ? [
values?: Record<string, TranslationValues[string] | TagsFn>,
formats?: Formats
] : (Value extends any ? (key: ICUArgsWithTags<Value, TagsFn>) => void : never) extends (key: infer Args) => void ? OnlyOptional<Args> extends true ? [values?: undefined, formats?: Formats] : [values: Prettify<Args>, formats?: Formats] : never;
type IntlMessages = Record<string, any>;
type NamespacedMessageKeys<TranslatorMessages extends IntlMessages, Namespace extends NamespaceKeys<TranslatorMessages, NestedKeyOf<TranslatorMessages>> = never> = MessageKeys<NestedValueOf<{
'!': TranslatorMessages;
}, [
Namespace
] extends [never] ? '!' : `!.${Namespace}`>, NestedKeyOf<NestedValueOf<{
'!': TranslatorMessages;
}, [
Namespace
] extends [never] ? '!' : `!.${Namespace}`>>>;
type NamespacedValue<TranslatorMessages extends IntlMessages, Namespace extends NamespaceKeys<TranslatorMessages, NestedKeyOf<TranslatorMessages>>, TargetKey extends NamespacedMessageKeys<TranslatorMessages, Namespace>> = NestedValueOf<TranslatorMessages, [
Namespace
] extends [never] ? TargetKey : `${Namespace}.${TargetKey}`>;
/**
* @private Not intended for direct use.
*/
export type Translator<TranslatorMessages extends IntlMessages = IntlMessages, Namespace extends NamespaceKeys<TranslatorMessages, NestedKeyOf<TranslatorMessages>> = never> = {
<TargetKey extends NamespacedMessageKeys<TranslatorMessages, Namespace>>(key: TargetKey, ...args: TranslateArgs<NamespacedValue<TranslatorMessages, Namespace, TargetKey>>): string;
rich<TargetKey extends NamespacedMessageKeys<TranslatorMessages, Namespace>>(key: TargetKey, ...args: TranslateArgs<NamespacedValue<TranslatorMessages, Namespace, TargetKey>, RichTagsFunction>): ReactNode;
markup<TargetKey extends NamespacedMessageKeys<TranslatorMessages, Namespace>>(key: TargetKey, ...args: TranslateArgs<NamespacedValue<TranslatorMessages, Namespace, TargetKey>, MarkupTagsFunction>): string;
raw<TargetKey extends NamespacedMessageKeys<TranslatorMessages, Namespace>>(key: TargetKey): any;
has<TargetKey extends NamespacedMessageKeys<TranslatorMessages, Namespace>>(key: TargetKey): boolean;
};
/**
* Translates messages from the given namespace by using the ICU syntax.
* See https://formatjs.io/docs/core-concepts/icu-syntax.
*
* If no namespace is provided, all available messages are returned.
* The namespace can also indicate nesting by using a dot
* (e.g. `namespace.Component`).
*/
export default function createTranslator<const TranslatorMessages extends IntlMessages, const Namespace extends NamespaceKeys<TranslatorMessages, NestedKeyOf<TranslatorMessages>> = never>({ _cache, _formatters, getMessageFallback, messages, namespace, onError, ...rest }: Omit<IntlConfig, 'messages'> & {
messages?: TranslatorMessages;
namespace?: Namespace;
/** @private */
_formatters?: Formatters;
/** @private */
_cache?: IntlCache;
}): Translator<TranslatorMessages, Namespace>;
export {};
@@ -0,0 +1 @@
{"version":3,"file":"logger.js","sources":["../../../src/otel/logger.ts"],"sourcesContent":["import { diag, DiagLogLevel } from '@opentelemetry/api';\nimport { debug } from '@sentry/core';\n\n/**\n * Setup the OTEL logger to use our own debug logger.\n */\nexport function setupOpenTelemetryLogger(): void {\n // Disable diag, to ensure this works even if called multiple times\n diag.disable();\n diag.setLogger(\n {\n error: debug.error,\n warn: debug.warn,\n info: debug.log,\n debug: debug.log,\n verbose: debug.log,\n },\n DiagLogLevel.DEBUG,\n );\n}\n"],"names":[],"mappings":";;;AAGA;AACA;AACA;AACO,SAAS,wBAAwB,GAAS;AACjD;AACA,EAAE,IAAI,CAAC,OAAO,EAAE;AAChB,EAAE,IAAI,CAAC,SAAS;AAChB,IAAI;AACJ,MAAM,KAAK,EAAE,KAAK,CAAC,KAAK;AACxB,MAAM,IAAI,EAAE,KAAK,CAAC,IAAI;AACtB,MAAM,IAAI,EAAE,KAAK,CAAC,GAAG;AACrB,MAAM,KAAK,EAAE,KAAK,CAAC,GAAG;AACtB,MAAM,OAAO,EAAE,KAAK,CAAC,GAAG;AACxB,KAAK;AACL,IAAI,YAAY,CAAC,KAAK;AACtB,GAAG;AACH;;;;"}
@@ -0,0 +1,20 @@
declare namespace PostgresInterval {
export interface IPostgresInterval {
years?: number;
months?: number;
days?: number;
hours?: number;
minutes?: number;
seconds?: number;
milliseconds?: number;
toPostgres(): string;
toISO(): string;
toISOString(): string;
}
}
declare function PostgresInterval(raw: string): PostgresInterval.IPostgresInterval;
export = PostgresInterval;
@@ -0,0 +1,382 @@
/**
* Default maximum size in bytes for GenAI messages.
* Messages exceeding this limit will be truncated.
*/
const DEFAULT_GEN_AI_MESSAGES_BYTE_LIMIT = 20000;
/**
* Message format used by OpenAI and Anthropic APIs.
*/
/**
* Calculate the UTF-8 byte length of a string.
*/
const utf8Bytes = (text) => {
return new TextEncoder().encode(text).length;
};
/**
* Calculate the UTF-8 byte length of a value's JSON representation.
*/
const jsonBytes = (value) => {
return utf8Bytes(JSON.stringify(value));
};
/**
* Truncate a string to fit within maxBytes when encoded as UTF-8.
* Uses binary search for efficiency with multi-byte characters.
*
* @param text - The string to truncate
* @param maxBytes - Maximum byte length (UTF-8 encoded)
* @returns Truncated string that fits within maxBytes
*/
function truncateTextByBytes(text, maxBytes) {
if (utf8Bytes(text) <= maxBytes) {
return text;
}
let low = 0;
let high = text.length;
let bestFit = '';
while (low <= high) {
const mid = Math.floor((low + high) / 2);
const candidate = text.slice(0, mid);
const byteSize = utf8Bytes(candidate);
if (byteSize <= maxBytes) {
bestFit = candidate;
low = mid + 1;
} else {
high = mid - 1;
}
}
return bestFit;
}
/**
* Extract text content from a Google GenAI message part.
* Parts are either plain strings or objects with a text property.
*
* @returns The text content
*/
function getPartText(part) {
if (typeof part === 'string') {
return part;
}
if ('text' in part) return part.text;
return '';
}
/**
* Create a new part with updated text content while preserving the original structure.
*
* @param part - Original part (string or object)
* @param text - New text content
* @returns New part with updated text
*/
function withPartText(part, text) {
if (typeof part === 'string') {
return text;
}
return { ...part, text };
}
/**
* Check if a message has the OpenAI/Anthropic content format.
*/
function isContentMessage(message) {
return (
message !== null &&
typeof message === 'object' &&
'content' in message &&
typeof (message ).content === 'string'
);
}
/**
* Check if a message has the OpenAI/Anthropic content array format.
*/
function isContentArrayMessage(message) {
return message !== null && typeof message === 'object' && 'content' in message && Array.isArray(message.content);
}
/**
* Check if a content part is an OpenAI/Anthropic media source
*/
function isContentMedia(part) {
if (!part || typeof part !== 'object') return false;
return (
isContentMediaSource(part) ||
hasInlineData(part) ||
('media_type' in part && typeof part.media_type === 'string' && 'data' in part) ||
('image_url' in part && typeof part.image_url === 'string' && part.image_url.startsWith('data:')) ||
('type' in part && (part.type === 'blob' || part.type === 'base64')) ||
'b64_json' in part ||
('type' in part && 'result' in part && part.type === 'image_generation') ||
('uri' in part && typeof part.uri === 'string' && part.uri.startsWith('data:'))
);
}
function isContentMediaSource(part) {
return 'type' in part && typeof part.type === 'string' && 'source' in part && isContentMedia(part.source);
}
function hasInlineData(part) {
return (
'inlineData' in part &&
!!part.inlineData &&
typeof part.inlineData === 'object' &&
'data' in part.inlineData &&
typeof part.inlineData.data === 'string'
);
}
/**
* Check if a message has the Google GenAI parts format.
*/
function isPartsMessage(message) {
return (
message !== null &&
typeof message === 'object' &&
'parts' in message &&
Array.isArray((message ).parts) &&
(message ).parts.length > 0
);
}
/**
* Truncate a message with `content: string` format (OpenAI/Anthropic).
*
* @param message - Message with content property
* @param maxBytes - Maximum byte limit
* @returns Array with truncated message, or empty array if it doesn't fit
*/
function truncateContentMessage(message, maxBytes) {
// Calculate overhead (message structure without content)
const emptyMessage = { ...message, content: '' };
const overhead = jsonBytes(emptyMessage);
const availableForContent = maxBytes - overhead;
if (availableForContent <= 0) {
return [];
}
const truncatedContent = truncateTextByBytes(message.content, availableForContent);
return [{ ...message, content: truncatedContent }];
}
/**
* Truncate a message with `parts: [...]` format (Google GenAI).
* Keeps as many complete parts as possible, only truncating the first part if needed.
*
* @param message - Message with parts array
* @param maxBytes - Maximum byte limit
* @returns Array with truncated message, or empty array if it doesn't fit
*/
function truncatePartsMessage(message, maxBytes) {
const { parts } = message;
// Calculate overhead by creating empty text parts
const emptyParts = parts.map(part => withPartText(part, ''));
const overhead = jsonBytes({ ...message, parts: emptyParts });
let remainingBytes = maxBytes - overhead;
if (remainingBytes <= 0) {
return [];
}
// Include parts until we run out of space
const includedParts = [];
for (const part of parts) {
const text = getPartText(part);
const textSize = utf8Bytes(text);
if (textSize <= remainingBytes) {
// Part fits: include it as-is
includedParts.push(part);
remainingBytes -= textSize;
} else if (includedParts.length === 0) {
// First part doesn't fit: truncate it
const truncated = truncateTextByBytes(text, remainingBytes);
if (truncated) {
includedParts.push(withPartText(part, truncated));
}
break;
} else {
// Subsequent part doesn't fit: stop here
break;
}
}
/* c8 ignore start
* for type safety only, algorithm guarantees SOME text included */
if (includedParts.length <= 0) {
return [];
} else {
/* c8 ignore stop */
return [{ ...message, parts: includedParts }];
}
}
/**
* Truncate a single message to fit within maxBytes.
*
* Supports two message formats:
* - OpenAI/Anthropic: `{ ..., content: string }`
* - Google GenAI: `{ ..., parts: Array<string | {text: string} | non-text> }`
*
* @param message - The message to truncate
* @param maxBytes - Maximum byte limit for the message
* @returns Array containing the truncated message, or empty array if truncation fails
*/
function truncateSingleMessage(message, maxBytes) {
if (!message) return [];
// Handle plain strings (e.g., embeddings input)
if (typeof message === 'string') {
const truncated = truncateTextByBytes(message, maxBytes);
return truncated ? [truncated] : [];
}
if (typeof message !== 'object') {
return [];
}
if (isContentMessage(message)) {
return truncateContentMessage(message, maxBytes);
}
if (isPartsMessage(message)) {
return truncatePartsMessage(message, maxBytes);
}
// Unknown message format: cannot truncate safely
return [];
}
const REMOVED_STRING = '[Filtered]';
const MEDIA_FIELDS = ['image_url', 'data', 'content', 'b64_json', 'result', 'uri'] ;
function stripInlineMediaFromSingleMessage(part) {
const strip = { ...part };
if (isContentMedia(strip.source)) {
strip.source = stripInlineMediaFromSingleMessage(strip.source);
}
// google genai inline data blob objects
if (hasInlineData(part)) {
strip.inlineData = { ...part.inlineData, data: REMOVED_STRING };
}
for (const field of MEDIA_FIELDS) {
if (typeof strip[field] === 'string') strip[field] = REMOVED_STRING;
}
return strip;
}
/**
* Strip the inline media from message arrays.
*
* This returns a stripped message. We do NOT want to mutate the data in place,
* because of course we still want the actual API/client to handle the media.
*/
function stripInlineMediaFromMessages(messages) {
const stripped = messages.map(message => {
let newMessage = undefined;
if (!!message && typeof message === 'object') {
if (isContentArrayMessage(message)) {
newMessage = {
...message,
content: stripInlineMediaFromMessages(message.content),
};
} else if ('content' in message && isContentMedia(message.content)) {
newMessage = {
...message,
content: stripInlineMediaFromSingleMessage(message.content),
};
}
if (isPartsMessage(message)) {
newMessage = {
// might have to strip content AND parts
...(newMessage ?? message),
parts: stripInlineMediaFromMessages(message.parts),
};
}
if (isContentMedia(newMessage)) {
newMessage = stripInlineMediaFromSingleMessage(newMessage);
} else if (isContentMedia(message)) {
newMessage = stripInlineMediaFromSingleMessage(message);
}
}
return newMessage ?? message;
});
return stripped;
}
/**
* Truncate an array of messages to fit within a byte limit.
*
* Strategy:
* - Always keeps only the last (newest) message
* - Strips inline media from the message
* - Truncates the message content if it exceeds the byte limit
*
* @param messages - Array of messages to truncate
* @param maxBytes - Maximum total byte limit for the message
* @returns Array containing only the last message (possibly truncated)
*
* @example
* ```ts
* const messages = [msg1, msg2, msg3, msg4]; // newest is msg4
* const truncated = truncateMessagesByBytes(messages, 10000);
* // Returns [msg4] (truncated if needed)
* ```
*/
function truncateMessagesByBytes(messages, maxBytes) {
// Early return for empty or invalid input
if (!Array.isArray(messages) || messages.length === 0) {
return messages;
}
// Always keep only the last message
const lastMessage = messages[messages.length - 1];
// Strip inline media from the single message
const stripped = stripInlineMediaFromMessages([lastMessage]);
const strippedMessage = stripped[0];
// Check if it fits
const messageBytes = jsonBytes(strippedMessage);
if (messageBytes <= maxBytes) {
return stripped;
}
// Truncate the single message if needed
return truncateSingleMessage(strippedMessage, maxBytes);
}
/**
* Truncate GenAI messages using the default byte limit.
*
* Convenience wrapper around `truncateMessagesByBytes` with the default limit.
*
* @param messages - Array of messages to truncate
* @returns Truncated array of messages
*/
function truncateGenAiMessages(messages) {
return truncateMessagesByBytes(messages, DEFAULT_GEN_AI_MESSAGES_BYTE_LIMIT);
}
/**
* Truncate GenAI string input using the default byte limit.
*
* @param input - The string to truncate
* @returns Truncated string
*/
function truncateGenAiStringInput(input) {
return truncateTextByBytes(input, DEFAULT_GEN_AI_MESSAGES_BYTE_LIMIT);
}
export { DEFAULT_GEN_AI_MESSAGES_BYTE_LIMIT, truncateGenAiMessages, truncateGenAiStringInput };
//# sourceMappingURL=messageTruncation.js.map
@@ -0,0 +1,16 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Section = createLucideIcon("Section", [
["path", { d: "M16 5a4 3 0 0 0-8 0c0 4 8 3 8 7a4 3 0 0 1-8 0", key: "vqan6v" }],
["path", { d: "M8 19a4 3 0 0 0 8 0c0-4-8-3-8-7a4 3 0 0 1 8 0", key: "wdjd8o" }]
]);
export { Section as default };
//# sourceMappingURL=section.js.map
@@ -0,0 +1,8 @@
// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
import { differenceInMonths as fn } from "../differenceInMonths.mjs";
import { convertToFP } from "./_lib/convertToFP.mjs";
export const differenceInMonths = convertToFP(fn, 2);
// Fallback for modularized imports:
export default differenceInMonths;
@@ -0,0 +1 @@
module.exports={C:{"52":0.00726,"60":0.0363,"78":0.07985,"91":0.00726,"102":0.05081,"104":0.01452,"108":0.05081,"115":0.19599,"128":0.14518,"133":0.00726,"134":0.00726,"136":0.0363,"138":0.00726,"139":0.02904,"140":2.37369,"142":0.1234,"143":0.02904,"144":0.05807,"145":1.14692,"146":1.27758,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 53 54 55 56 57 58 59 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 79 80 81 82 83 84 85 86 87 88 89 90 92 93 94 95 96 97 98 99 100 101 103 105 106 107 109 110 111 112 113 114 116 117 118 119 120 121 122 123 124 125 126 127 129 130 131 132 135 137 141 147 148 149 3.5 3.6"},D:{"74":0.00726,"77":0.19599,"79":0.06533,"87":0.00726,"92":0.00726,"102":0.01452,"103":0.0363,"104":0.00726,"108":0.0363,"109":0.39925,"112":0.00726,"114":0.16696,"116":0.11614,"118":0.42828,"119":0.02904,"120":0.00726,"121":0.00726,"122":0.0363,"123":0.00726,"125":33.70354,"126":0.00726,"128":0.04355,"129":0.00726,"130":0.00726,"131":0.04355,"132":0.02178,"133":0.05081,"134":0.10163,"135":0.05807,"136":0.07259,"137":0.20325,"138":0.39199,"139":0.15244,"140":0.08711,"141":0.4428,"142":8.59466,"143":6.70006,"144":0.02178,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 75 76 78 80 81 83 84 85 86 88 89 90 91 93 94 95 96 97 98 99 100 101 105 106 107 110 111 113 115 117 124 127 145 146"},F:{"93":0.02904,"95":0.01452,"96":0.02178,"114":0.01452,"117":0.01452,"123":0.00726,"124":0.55894,"125":0.2831,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 94 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 115 116 118 119 120 121 122 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"108":0.01452,"109":0.00726,"120":0.0363,"122":0.00726,"129":0.00726,"131":0.00726,"133":0.01452,"134":0.02178,"136":0.00726,"137":0.01452,"138":0.01452,"139":0.00726,"140":0.10163,"141":0.07259,"142":1.66231,"143":3.04152,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 110 111 112 113 114 115 116 117 118 119 121 123 124 125 126 127 128 130 132 135"},E:{_:"0 4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 15.2-15.3 15.4 26.3","13.1":0.00726,"14.1":0.01452,"15.1":0.00726,"15.5":0.00726,"15.6":0.07259,"16.0":0.00726,"16.1":0.02178,"16.2":0.00726,"16.3":0.01452,"16.4":0.00726,"16.5":0.01452,"16.6":0.10163,"17.0":0.00726,"17.1":0.1597,"17.2":0.05081,"17.3":0.10163,"17.4":0.06533,"17.5":0.10163,"17.6":0.34117,"18.0":0.00726,"18.1":0.0363,"18.2":0.17422,"18.3":0.22503,"18.4":0.19599,"18.5-18.6":0.37747,"26.0":0.22503,"26.1":0.67509,"26.2":0.19599},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.0024,"5.0-5.1":0,"6.0-6.1":0.0048,"7.0-7.1":0.0036,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.00959,"10.0-10.2":0.0012,"10.3":0.01679,"11.0-11.2":0.20626,"11.3-11.4":0.006,"12.0-12.1":0.0048,"12.2-12.5":0.05396,"13.0-13.1":0.0012,"13.2":0.00839,"13.3":0.0024,"13.4-13.7":0.00839,"14.0-14.4":0.01679,"14.5-14.8":0.01799,"15.0-15.1":0.01919,"15.2-15.3":0.01439,"15.4":0.01559,"15.5":0.01679,"15.6-15.8":0.26022,"16.0":0.02998,"16.1":0.05756,"16.2":0.02998,"16.3":0.05396,"16.4":0.01319,"16.5":0.02278,"16.6-16.7":0.33817,"17.0":0.01919,"17.1":0.03118,"17.2":0.02278,"17.3":0.03478,"17.4":0.05876,"17.5":0.11512,"17.6-17.7":0.26622,"18.0":0.05996,"18.1":0.12472,"18.2":0.06596,"18.3":0.21465,"18.4":0.11033,"18.5-18.7":7.92183,"26.0":0.1547,"26.1":1.28673,"26.2":0.24463,"26.3":0.01079},P:{"4":0.53095,"22":0.01041,"25":0.01041,"26":0.01041,"27":0.01041,"28":0.07288,"29":2.74844,_:"20 21 23 24 5.0-5.4 6.2-6.4 7.2-7.4 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0","8.2":0.01041},I:{"0":0.01368,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0.00001},A:{"11":0.02904,_:"6 7 8 9 10 5.5"},K:{"0":0.09594,_:"10 11 12 11.1 11.5 12.1"},N:{_:"10 11"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},Q:{"14.9":0.00274},O:{"0":0.02467},H:{"0":0},L:{"0":12.29254},R:{_:"0"},M:{"0":1.0498}};
@@ -0,0 +1,253 @@
import { isObjectLike } from '../jsutils/isObjectLike.mjs';
import { getLocation } from '../language/location.mjs';
import {
printLocation,
printSourceLocation,
} from '../language/printLocation.mjs';
function toNormalizedOptions(args) {
const firstArg = args[0];
if (firstArg == null || 'kind' in firstArg || 'length' in firstArg) {
return {
nodes: firstArg,
source: args[1],
positions: args[2],
path: args[3],
originalError: args[4],
extensions: args[5],
};
}
return firstArg;
}
/**
* A GraphQLError describes an Error found during the parse, validate, or
* execute phases of performing a GraphQL operation. In addition to a message
* and stack trace, it also includes information about the locations in a
* GraphQL document and/or execution result that correspond to the Error.
*/
export class GraphQLError extends Error {
/**
* An array of `{ line, column }` locations within the source GraphQL document
* which correspond to this error.
*
* Errors during validation often contain multiple locations, for example to
* point out two things with the same name. Errors during execution include a
* single location, the field which produced the error.
*
* Enumerable, and appears in the result of JSON.stringify().
*/
/**
* An array describing the JSON-path into the execution response which
* corresponds to this error. Only included for errors during execution.
*
* Enumerable, and appears in the result of JSON.stringify().
*/
/**
* An array of GraphQL AST Nodes corresponding to this error.
*/
/**
* The source GraphQL document for the first location of this error.
*
* Note that if this Error represents more than one node, the source may not
* represent nodes after the first node.
*/
/**
* An array of character offsets within the source GraphQL document
* which correspond to this error.
*/
/**
* The original error thrown from a field resolver during execution.
*/
/**
* Extension fields to add to the formatted error.
*/
/**
* @deprecated Please use the `GraphQLErrorOptions` constructor overload instead.
*/
constructor(message, ...rawArgs) {
var _this$nodes, _nodeLocations$, _ref;
const { nodes, source, positions, path, originalError, extensions } =
toNormalizedOptions(rawArgs);
super(message);
this.name = 'GraphQLError';
this.path = path !== null && path !== void 0 ? path : undefined;
this.originalError =
originalError !== null && originalError !== void 0
? originalError
: undefined; // Compute list of blame nodes.
this.nodes = undefinedIfEmpty(
Array.isArray(nodes) ? nodes : nodes ? [nodes] : undefined,
);
const nodeLocations = undefinedIfEmpty(
(_this$nodes = this.nodes) === null || _this$nodes === void 0
? void 0
: _this$nodes.map((node) => node.loc).filter((loc) => loc != null),
); // Compute locations in the source for the given nodes/positions.
this.source =
source !== null && source !== void 0
? source
: nodeLocations === null || nodeLocations === void 0
? void 0
: (_nodeLocations$ = nodeLocations[0]) === null ||
_nodeLocations$ === void 0
? void 0
: _nodeLocations$.source;
this.positions =
positions !== null && positions !== void 0
? positions
: nodeLocations === null || nodeLocations === void 0
? void 0
: nodeLocations.map((loc) => loc.start);
this.locations =
positions && source
? positions.map((pos) => getLocation(source, pos))
: nodeLocations === null || nodeLocations === void 0
? void 0
: nodeLocations.map((loc) => getLocation(loc.source, loc.start));
const originalExtensions = isObjectLike(
originalError === null || originalError === void 0
? void 0
: originalError.extensions,
)
? originalError === null || originalError === void 0
? void 0
: originalError.extensions
: undefined;
this.extensions =
(_ref =
extensions !== null && extensions !== void 0
? extensions
: originalExtensions) !== null && _ref !== void 0
? _ref
: Object.create(null); // Only properties prescribed by the spec should be enumerable.
// Keep the rest as non-enumerable.
Object.defineProperties(this, {
message: {
writable: true,
enumerable: true,
},
name: {
enumerable: false,
},
nodes: {
enumerable: false,
},
source: {
enumerable: false,
},
positions: {
enumerable: false,
},
originalError: {
enumerable: false,
},
}); // Include (non-enumerable) stack trace.
/* c8 ignore start */
// FIXME: https://github.com/graphql/graphql-js/issues/2317
if (
originalError !== null &&
originalError !== void 0 &&
originalError.stack
) {
Object.defineProperty(this, 'stack', {
value: originalError.stack,
writable: true,
configurable: true,
});
} else if (Error.captureStackTrace) {
Error.captureStackTrace(this, GraphQLError);
} else {
Object.defineProperty(this, 'stack', {
value: Error().stack,
writable: true,
configurable: true,
});
}
/* c8 ignore stop */
}
get [Symbol.toStringTag]() {
return 'GraphQLError';
}
toString() {
let output = this.message;
if (this.nodes) {
for (const node of this.nodes) {
if (node.loc) {
output += '\n\n' + printLocation(node.loc);
}
}
} else if (this.source && this.locations) {
for (const location of this.locations) {
output += '\n\n' + printSourceLocation(this.source, location);
}
}
return output;
}
toJSON() {
const formattedError = {
message: this.message,
};
if (this.locations != null) {
formattedError.locations = this.locations;
}
if (this.path != null) {
formattedError.path = this.path;
}
if (this.extensions != null && Object.keys(this.extensions).length > 0) {
formattedError.extensions = this.extensions;
}
return formattedError;
}
}
function undefinedIfEmpty(array) {
return array === undefined || array.length === 0 ? undefined : array;
}
/**
* See: https://spec.graphql.org/draft/#sec-Errors
*/
/**
* Prints a GraphQLError to a string, representing useful location information
* about the error's position in the source.
*
* @deprecated Please use `error.toString` instead. Will be removed in v17
*/
export function printError(error) {
return error.toString();
}
/**
* Given a GraphQLError, format it according to the rules described by the
* Response Format, Errors section of the GraphQL Specification.
*
* @deprecated Please use `error.toJSON` instead. Will be removed in v17
*/
export function formatError(error) {
return error.toJSON();
}
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('mean', require('../mean'), require('./_falseOptions'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1,18 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
*/
import type {HeadingTagType} from '@lexical/rich-text';
import type {LexicalEditor, NodeKey} from 'lexical';
declare export function TableOfContentsPlugin({
children: (
tableOfContents: Array<[NodeKey, string, HeadingTagType]>,
editor: LexicalEditor,
) => React.Node,
}): React.Node;
@@ -0,0 +1,5 @@
//#region src/utils/format-fields.d.ts
declare const formatFields: (fields: (string | Record<string, any>)[]) => string[];
//#endregion
export { formatFields };
//# sourceMappingURL=format-fields.d.cts.map
@@ -0,0 +1,84 @@
import pgClient from "postgres";
import { entityKind } from "../entity.js";
import { DefaultLogger } from "../logger.js";
import { PgDatabase } from "../pg-core/db.js";
import { PgDialect } from "../pg-core/dialect.js";
import {
createTableRelationsHelpers,
extractTablesRelationalConfig
} from "../relations.js";
import { isConfig } from "../utils.js";
import { PostgresJsSession } from "./session.js";
class PostgresJsDatabase extends PgDatabase {
static [entityKind] = "PostgresJsDatabase";
}
function construct(client, config = {}) {
const transparentParser = (val) => val;
for (const type of ["1184", "1082", "1083", "1114", "1182", "1185", "1115", "1231"]) {
client.options.parsers[type] = transparentParser;
client.options.serializers[type] = transparentParser;
}
client.options.serializers["114"] = transparentParser;
client.options.serializers["3802"] = transparentParser;
const dialect = new PgDialect({ casing: config.casing });
let logger;
if (config.logger === true) {
logger = new DefaultLogger();
} else if (config.logger !== false) {
logger = config.logger;
}
let schema;
if (config.schema) {
const tablesConfig = extractTablesRelationalConfig(
config.schema,
createTableRelationsHelpers
);
schema = {
fullSchema: config.schema,
schema: tablesConfig.tables,
tableNamesMap: tablesConfig.tableNamesMap
};
}
const session = new PostgresJsSession(client, dialect, schema, { logger, cache: config.cache });
const db = new PostgresJsDatabase(dialect, session, schema);
db.$client = client;
db.$cache = config.cache;
if (db.$cache) {
db.$cache["invalidate"] = config.cache?.onMutate;
}
return db;
}
function drizzle(...params) {
if (typeof params[0] === "string") {
const instance = pgClient(params[0]);
return construct(instance, params[1]);
}
if (isConfig(params[0])) {
const { connection, client, ...drizzleConfig } = params[0];
if (client) return construct(client, drizzleConfig);
if (typeof connection === "object" && connection.url !== void 0) {
const { url, ...config } = connection;
const instance2 = pgClient(url, config);
return construct(instance2, drizzleConfig);
}
const instance = pgClient(connection);
return construct(instance, drizzleConfig);
}
return construct(params[0], params[1]);
}
((drizzle2) => {
function mock(config) {
return construct({
options: {
parsers: {},
serializers: {}
}
}, config);
}
drizzle2.mock = mock;
})(drizzle || (drizzle = {}));
export {
PostgresJsDatabase,
drizzle
};
//# sourceMappingURL=driver.js.map
@@ -0,0 +1,28 @@
'use strict';
const DatePart = require('./datepart');
class Seconds extends DatePart {
constructor(opts={}) {
super(opts);
}
up() {
this.date.setSeconds(this.date.getSeconds() + 1);
}
down() {
this.date.setSeconds(this.date.getSeconds() - 1);
}
setTo(val) {
this.date.setSeconds(parseInt(val.substr(-2)));
}
toString() {
let s = this.date.getSeconds();
return this.token.length > 1 ? String(s).padStart(2, '0') : s;
}
}
module.exports = Seconds;
@@ -0,0 +1 @@
{"version":3,"file":"chart-pie.js","sources":["../../../src/icons/chart-pie.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ChartPie\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjEgMTJjLjU1MiAwIDEuMDA1LS40NDkuOTUtLjk5OGExMCAxMCAwIDAgMC04Ljk1My04Ljk1MWMtLjU1LS4wNTUtLjk5OC4zOTgtLjk5OC45NXY4YTEgMSAwIDAgMCAxIDF6IiAvPgogIDxwYXRoIGQ9Ik0yMS4yMSAxNS44OUExMCAxMCAwIDEgMSA4IDIuODMiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/chart-pie\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst ChartPie = createLucideIcon('ChartPie', [\n [\n 'path',\n {\n d: 'M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z',\n key: 'pzmjnu',\n },\n ],\n ['path', { d: 'M21.21 15.89A10 10 0 1 1 8 2.83', key: 'k2fpak' }],\n]);\n\nexport default ChartPie;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,iBAAiB,UAAY,CAAA,CAAA,CAAA;AAAA,CAC5C,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAmC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAClE,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"ice-cream-2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,19 @@
'use strict';
// lib/types/utils.ts
var decoder = new TextDecoder();
var toUTF8String = (input, start = 0, end = input.length) => decoder.decode(input.slice(start, end));
var getView = (input, offset) => new DataView(input.buffer, input.byteOffset + offset);
var readUInt16LE = (input, offset = 0) => getView(input, offset).getUint16(0, true);
// lib/types/gif.ts
var gifRegexp = /^GIF8[79]a/;
var GIF = {
validate: (input) => gifRegexp.test(toUTF8String(input, 0, 6)),
calculate: (input) => ({
height: readUInt16LE(input, 8),
width: readUInt16LE(input, 6)
})
};
exports.GIF = GIF;
@@ -0,0 +1,117 @@
'use client';
import { c as _c } from "react/compiler-runtime";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { ConfirmPasswordField, Form, FormSubmit, HiddenField, PasswordField, useAuth, useConfig, useTranslation } from '@payloadcms/ui';
import { useRouter } from 'next/navigation.js';
import { formatAdminURL } from 'payload/shared';
import React from 'react';
export const ResetPasswordForm = t0 => {
const $ = _c(11);
const {
token
} = t0;
const i18n = useTranslation();
const {
config: t1
} = useConfig();
const {
admin: t2,
routes: t3
} = t1;
const {
routes: t4,
user: userSlug
} = t2;
const {
login: loginRoute
} = t4;
const {
admin: adminRoute,
api: apiRoute
} = t3;
const history = useRouter();
const {
fetchFullUser
} = useAuth();
let t5;
if ($[0] !== adminRoute || $[1] !== fetchFullUser || $[2] !== history || $[3] !== loginRoute) {
t5 = async () => {
const user = await fetchFullUser();
if (user) {
history.push(adminRoute);
} else {
history.push(formatAdminURL({
adminRoute,
path: loginRoute
}));
}
};
$[0] = adminRoute;
$[1] = fetchFullUser;
$[2] = history;
$[3] = loginRoute;
$[4] = t5;
} else {
t5 = $[4];
}
const onSuccess = t5;
let t6;
if ($[5] !== apiRoute || $[6] !== i18n || $[7] !== onSuccess || $[8] !== token || $[9] !== userSlug) {
const initialState = {
"confirm-password": {
initialValue: "",
valid: false,
value: ""
},
password: {
initialValue: "",
valid: false,
value: ""
},
token: {
initialValue: token,
valid: true,
value: token
}
};
t6 = _jsxs(Form, {
action: formatAdminURL({
apiRoute,
path: `/${userSlug}/reset-password`
}),
initialState,
method: "POST",
onSuccess,
children: [_jsxs("div", {
className: "inputWrap",
children: [_jsx(PasswordField, {
field: {
name: "password",
label: i18n.t("authentication:newPassword"),
required: true
},
path: "password",
schemaPath: `${userSlug}.password`
}), _jsx(ConfirmPasswordField, {}), _jsx(HiddenField, {
path: "token",
schemaPath: `${userSlug}.token`,
value: token
})]
}), _jsx(FormSubmit, {
size: "large",
children: i18n.t("authentication:resetPassword")
})]
});
$[5] = apiRoute;
$[6] = i18n;
$[7] = onSuccess;
$[8] = token;
$[9] = userSlug;
$[10] = t6;
} else {
t6 = $[10];
}
return t6;
};
//# sourceMappingURL=index.js.map
@@ -0,0 +1,18 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Component = createLucideIcon("Component", [
["path", { d: "M5.5 8.5 9 12l-3.5 3.5L2 12l3.5-3.5Z", key: "1kciei" }],
["path", { d: "m12 2 3.5 3.5L12 9 8.5 5.5 12 2Z", key: "1ome0g" }],
["path", { d: "M18.5 8.5 22 12l-3.5 3.5L15 12l3.5-3.5Z", key: "vbupec" }],
["path", { d: "m12 15 3.5 3.5L12 22l-3.5-3.5L12 15Z", key: "16csic" }]
]);
export { Component as default };
//# sourceMappingURL=component.js.map
@@ -0,0 +1,81 @@
import { isSameWeek } from "../../../isSameWeek.mjs";
// https://www.unicode.org/cldr/charts/32/summary/sk.html?hide#1308
const accusativeWeekdays = [
"nedeľu",
"pondelok",
"utorok",
"stredu",
"štvrtok",
"piatok",
"sobotu",
];
function lastWeek(day) {
const weekday = accusativeWeekdays[day];
switch (day) {
case 0: /* Sun */
case 3: /* Wed */
case 6 /* Sat */:
return "'minulú " + weekday + " o' p";
default:
return "'minulý' eeee 'o' p";
}
}
function thisWeek(day) {
const weekday = accusativeWeekdays[day];
if (day === 4 /* Thu */) {
return "'vo' eeee 'o' p";
} else {
return "'v " + weekday + " o' p";
}
}
function nextWeek(day) {
const weekday = accusativeWeekdays[day];
switch (day) {
case 0: /* Sun */
case 4: /* Wed */
case 6 /* Sat */:
return "'budúcu " + weekday + " o' p";
default:
return "'budúci' eeee 'o' p";
}
}
const formatRelativeLocale = {
lastWeek: (date, baseDate, options) => {
const day = date.getDay();
if (isSameWeek(date, baseDate, options)) {
return thisWeek(day);
} else {
return lastWeek(day);
}
},
yesterday: "'včera o' p",
today: "'dnes o' p",
tomorrow: "'zajtra o' p",
nextWeek: (date, baseDate, options) => {
const day = date.getDay();
if (isSameWeek(date, baseDate, options)) {
return thisWeek(day);
} else {
return nextWeek(day);
}
},
other: "P",
};
export const formatRelative = (token, date, baseDate, options) => {
const format = formatRelativeLocale[token];
if (typeof format === "function") {
return format(date, baseDate, options);
}
return format;
};
@@ -0,0 +1,28 @@
import { GraphQLScalarType, Kind } from 'graphql';
import { createGraphQLError } from '../error.js';
import { processValue } from './utilities.js';
export const GraphQLNonNegativeFloatConfig = /*#__PURE__*/ {
name: 'NonNegativeFloat',
description: 'Floats that will have a value of 0 or more.',
serialize(value) {
return processValue(value, 'NonNegativeFloat');
},
parseValue(value) {
return processValue(value, 'NonNegativeFloat');
},
parseLiteral(ast) {
if (ast.kind !== Kind.FLOAT && ast.kind !== Kind.INT) {
throw createGraphQLError(`Can only validate floating point numbers as non-negative floating point numbers but got a: ${ast.kind}`, { nodes: ast });
}
return processValue(ast.value, 'NonNegativeFloat');
},
extensions: {
codegenScalarType: 'number',
jsonSchema: {
title: 'NonNegativeFloat',
type: 'number',
minimum: 0,
},
},
};
export const GraphQLNonNegativeFloat = /*#__PURE__*/ new GraphQLScalarType(GraphQLNonNegativeFloatConfig);
@@ -0,0 +1,48 @@
import type { ContextOptions, DateArg, DateValues } from "./types.js";
/**
* The {@link set} function options.
*/
export interface SetOptions<DateType extends Date = Date>
extends ContextOptions<DateType> {}
/**
* @name set
* @category Common Helpers
* @summary Set date values to a given date.
*
* @description
* Set date values to a given date.
*
* Sets time values to date from object `values`.
* A value is not set if it is undefined or null or doesn't exist in `values`.
*
* Note about bundle size: `set` does not internally use `setX` functions from date-fns but instead opts
* to use native `Date#setX` methods. If you use this function, you may not want to include the
* other `setX` functions that date-fns provides if you are concerned about the bundle size.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The date to be changed
* @param values - The date values to be set
* @param options - The options
*
* @returns The new date with options set
*
* @example
* // Transform 1 September 2014 into 20 October 2015 in a single line:
* const result = set(new Date(2014, 8, 20), { year: 2015, month: 9, date: 20 })
* //=> Tue Oct 20 2015 00:00:00
*
* @example
* // Set 12 PM to 1 September 2014 01:23:45 to 1 September 2014 12:00:00:
* const result = set(new Date(2014, 8, 1, 1, 23, 45), { hours: 12 })
* //=> Mon Sep 01 2014 12:23:45
*/
export declare function set<
DateType extends Date,
ResultDate extends Date = DateType,
>(
date: DateArg<DateType>,
values: DateValues,
options?: SetOptions<ResultDate>,
): ResultDate;
@@ -0,0 +1,9 @@
@import '../../scss/styles.scss';
@layer payload-default {
.login-fields {
display: flex;
flex-direction: column;
gap: var(--base);
}
}
@@ -0,0 +1,8 @@
/**
* Given an invalid input string and a list of valid options, returns a filtered
* list of valid options sorted based on their similarity with the input.
*/
export declare function suggestionList(
input: string,
options: ReadonlyArray<string>,
): Array<string>;
@@ -0,0 +1,164 @@
@import '../../scss/styles.scss';
@layer payload-default {
.collapsible {
position: relative;
--toggle-pad-h: #{base(0.75)};
--toggle-pad-v: #{base(0.6)};
border-radius: $style-radius-m;
&__toggle-wrap {
position: relative;
padding: base(0.4) base(0.4) base(0.4) base(0.8);
display: flex;
align-items: center;
justify-content: space-between;
background: var(--theme-elevation-50);
line-height: base(1.2);
gap: base(0.2);
border-top-right-radius: $style-radius-m;
border-top-left-radius: $style-radius-m;
width: 100%;
&:not(.toggle-disabled):hover {
background: var(--theme-elevation-100);
}
&:has(.collapsible__drag) {
padding-inline-start: base(0.4);
}
}
&__drag {
display: flex;
opacity: 0.5;
top: var(--toggle-pad-v);
width: base(1.2);
height: base(1.2);
padding: base(0.1);
icon {
width: 100%;
height: 100%;
}
}
&__toggle {
@extend %btn-reset;
@extend %body;
text-align: left;
border-top-right-radius: $style-radius-m;
border-top-left-radius: $style-radius-m;
width: 100%;
height: 100%;
color: transparent;
position: absolute;
top: 0;
left: 0;
&:not(.toggle-disabled) {
cursor: pointer;
}
span {
user-select: none;
}
}
&--style-default {
border: 1px solid var(--theme-elevation-200);
&:hover {
border: 1px solid var(--theme-elevation-300);
}
> .collapsible__toggle-wrap {
.row-label {
color: var(--theme-text);
}
}
}
&--style-error {
border: 1px solid var(--theme-error-400);
> .collapsible__toggle-wrap {
background-color: var(--theme-error-100);
&:hover {
background: var(--theme-error-150);
}
.row-label {
color: var(--theme-error-950);
}
}
}
&__header-wrap {
top: 0;
right: base(3);
bottom: 0;
left: 0;
pointer-events: none;
width: 100%;
overflow: hidden;
max-width: 100%;
}
&__header-wrap--has-drag-handle {
left: base(1);
}
&--collapsed {
.collapsible__toggle-wrap {
border-bottom-right-radius: $style-radius-m;
border-bottom-left-radius: $style-radius-m;
}
}
&__actions-wrap {
pointer-events: none;
display: flex;
gap: base(0.2);
margin-inline-end: base(0.2);
}
&__actions {
pointer-events: all;
display: flex;
align-items: center;
justify-content: center;
width: base(1.2);
height: base(1.2);
&.icon {
padding: base(0.1);
}
}
&__indicator {
display: flex;
align-items: center;
justify-content: center;
width: base(1.2);
height: base(1.2);
&.icon {
padding: base(0.1);
}
}
&__content {
background-color: var(--theme-elevation-0);
border-bottom-left-radius: $style-radius-m;
border-bottom-right-radius: $style-radius-m;
padding: var(--base);
}
@include small-break {
&__content {
padding: var(--gutter-h);
}
}
}
}
@@ -0,0 +1,25 @@
export interface StylisElement {
type: string
value: string
props: Array<string> | string
root: StylisElement | null
parent: StylisElement | null
children: Array<StylisElement> | string
line: number
column: number
length: number
return: string
}
export type StylisPluginCallback = (
element: StylisElement,
index: number,
children: Array<StylisElement>,
callback: StylisPluginCallback
) => string | void
export type StylisPlugin = (
element: StylisElement,
index: number,
children: Array<StylisElement>,
callback: StylisPluginCallback
) => string | void
@@ -0,0 +1,123 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.extendErrors = exports.resetErrorsCount = exports.reportExtraError = exports.reportError = exports.keyword$DataError = exports.keywordError = void 0;
const codegen_1 = require("./codegen");
const util_1 = require("./util");
const names_1 = require("./names");
exports.keywordError = {
message: ({ keyword }) => (0, codegen_1.str) `must pass "${keyword}" keyword validation`,
};
exports.keyword$DataError = {
message: ({ keyword, schemaType }) => schemaType
? (0, codegen_1.str) `"${keyword}" keyword must be ${schemaType} ($data)`
: (0, codegen_1.str) `"${keyword}" keyword is invalid ($data)`,
};
function reportError(cxt, error = exports.keywordError, errorPaths, overrideAllErrors) {
const { it } = cxt;
const { gen, compositeRule, allErrors } = it;
const errObj = errorObjectCode(cxt, error, errorPaths);
if (overrideAllErrors !== null && overrideAllErrors !== void 0 ? overrideAllErrors : (compositeRule || allErrors)) {
addError(gen, errObj);
}
else {
returnErrors(it, (0, codegen_1._) `[${errObj}]`);
}
}
exports.reportError = reportError;
function reportExtraError(cxt, error = exports.keywordError, errorPaths) {
const { it } = cxt;
const { gen, compositeRule, allErrors } = it;
const errObj = errorObjectCode(cxt, error, errorPaths);
addError(gen, errObj);
if (!(compositeRule || allErrors)) {
returnErrors(it, names_1.default.vErrors);
}
}
exports.reportExtraError = reportExtraError;
function resetErrorsCount(gen, errsCount) {
gen.assign(names_1.default.errors, errsCount);
gen.if((0, codegen_1._) `${names_1.default.vErrors} !== null`, () => gen.if(errsCount, () => gen.assign((0, codegen_1._) `${names_1.default.vErrors}.length`, errsCount), () => gen.assign(names_1.default.vErrors, null)));
}
exports.resetErrorsCount = resetErrorsCount;
function extendErrors({ gen, keyword, schemaValue, data, errsCount, it, }) {
/* istanbul ignore if */
if (errsCount === undefined)
throw new Error("ajv implementation error");
const err = gen.name("err");
gen.forRange("i", errsCount, names_1.default.errors, (i) => {
gen.const(err, (0, codegen_1._) `${names_1.default.vErrors}[${i}]`);
gen.if((0, codegen_1._) `${err}.instancePath === undefined`, () => gen.assign((0, codegen_1._) `${err}.instancePath`, (0, codegen_1.strConcat)(names_1.default.instancePath, it.errorPath)));
gen.assign((0, codegen_1._) `${err}.schemaPath`, (0, codegen_1.str) `${it.errSchemaPath}/${keyword}`);
if (it.opts.verbose) {
gen.assign((0, codegen_1._) `${err}.schema`, schemaValue);
gen.assign((0, codegen_1._) `${err}.data`, data);
}
});
}
exports.extendErrors = extendErrors;
function addError(gen, errObj) {
const err = gen.const("err", errObj);
gen.if((0, codegen_1._) `${names_1.default.vErrors} === null`, () => gen.assign(names_1.default.vErrors, (0, codegen_1._) `[${err}]`), (0, codegen_1._) `${names_1.default.vErrors}.push(${err})`);
gen.code((0, codegen_1._) `${names_1.default.errors}++`);
}
function returnErrors(it, errs) {
const { gen, validateName, schemaEnv } = it;
if (schemaEnv.$async) {
gen.throw((0, codegen_1._) `new ${it.ValidationError}(${errs})`);
}
else {
gen.assign((0, codegen_1._) `${validateName}.errors`, errs);
gen.return(false);
}
}
const E = {
keyword: new codegen_1.Name("keyword"),
schemaPath: new codegen_1.Name("schemaPath"), // also used in JTD errors
params: new codegen_1.Name("params"),
propertyName: new codegen_1.Name("propertyName"),
message: new codegen_1.Name("message"),
schema: new codegen_1.Name("schema"),
parentSchema: new codegen_1.Name("parentSchema"),
};
function errorObjectCode(cxt, error, errorPaths) {
const { createErrors } = cxt.it;
if (createErrors === false)
return (0, codegen_1._) `{}`;
return errorObject(cxt, error, errorPaths);
}
function errorObject(cxt, error, errorPaths = {}) {
const { gen, it } = cxt;
const keyValues = [
errorInstancePath(it, errorPaths),
errorSchemaPath(cxt, errorPaths),
];
extraErrorProps(cxt, error, keyValues);
return gen.object(...keyValues);
}
function errorInstancePath({ errorPath }, { instancePath }) {
const instPath = instancePath
? (0, codegen_1.str) `${errorPath}${(0, util_1.getErrorPath)(instancePath, util_1.Type.Str)}`
: errorPath;
return [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, instPath)];
}
function errorSchemaPath({ keyword, it: { errSchemaPath } }, { schemaPath, parentSchema }) {
let schPath = parentSchema ? errSchemaPath : (0, codegen_1.str) `${errSchemaPath}/${keyword}`;
if (schemaPath) {
schPath = (0, codegen_1.str) `${schPath}${(0, util_1.getErrorPath)(schemaPath, util_1.Type.Str)}`;
}
return [E.schemaPath, schPath];
}
function extraErrorProps(cxt, { params, message }, keyValues) {
const { keyword, data, schemaValue, it } = cxt;
const { opts, propertyName, topSchemaRef, schemaPath } = it;
keyValues.push([E.keyword, keyword], [E.params, typeof params == "function" ? params(cxt) : params || (0, codegen_1._) `{}`]);
if (opts.messages) {
keyValues.push([E.message, typeof message == "function" ? message(cxt) : message]);
}
if (opts.verbose) {
keyValues.push([E.schema, schemaValue], [E.parentSchema, (0, codegen_1._) `${topSchemaRef}${schemaPath}`], [names_1.default.data, data]);
}
if (propertyName)
keyValues.push([E.propertyName, propertyName]);
}
//# sourceMappingURL=errors.js.map
@@ -0,0 +1,43 @@
Prism.languages.gettext = {
'comment': [
{
pattern: /# .*/,
greedy: true,
alias: 'translator-comment'
},
{
pattern: /#\..*/,
greedy: true,
alias: 'extracted-comment'
},
{
pattern: /#:.*/,
greedy: true,
alias: 'reference-comment'
},
{
pattern: /#,.*/,
greedy: true,
alias: 'flag-comment'
},
{
pattern: /#\|.*/,
greedy: true,
alias: 'previously-untranslated-comment'
},
{
pattern: /#.*/,
greedy: true
},
],
'string': {
pattern: /(^|[^\\])"(?:[^"\\]|\\.)*"/,
lookbehind: true,
greedy: true
},
'keyword': /^msg(?:ctxt|id|id_plural|str)\b/m,
'number': /\b\d+\b/,
'punctuation': /[\[\]]/
};
Prism.languages.po = Prism.languages.gettext;
@@ -0,0 +1,67 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var enum_exports = {};
__export(enum_exports, {
SingleStoreEnumColumn: () => SingleStoreEnumColumn,
SingleStoreEnumColumnBuilder: () => SingleStoreEnumColumnBuilder,
singlestoreEnum: () => singlestoreEnum
});
module.exports = __toCommonJS(enum_exports);
var import_entity = require("../../entity.cjs");
var import_utils = require("../../utils.cjs");
var import_common = require("./common.cjs");
class SingleStoreEnumColumnBuilder extends import_common.SingleStoreColumnBuilder {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
generatedAlwaysAs(as, config) {
throw new Error("Method not implemented.");
}
static [import_entity.entityKind] = "SingleStoreEnumColumnBuilder";
constructor(name, values) {
super(name, "string", "SingleStoreEnumColumn");
this.config.enumValues = values;
}
/** @internal */
build(table) {
return new SingleStoreEnumColumn(
table,
this.config
);
}
}
class SingleStoreEnumColumn extends import_common.SingleStoreColumn {
static [import_entity.entityKind] = "SingleStoreEnumColumn";
enumValues = this.config.enumValues;
getSQLType() {
return `enum(${this.enumValues.map((value) => `'${value}'`).join(",")})`;
}
}
function singlestoreEnum(a, b) {
const { name, config: values } = (0, import_utils.getColumnNameAndConfig)(a, b);
if (values.length === 0) {
throw new Error(`You have an empty array for "${name}" enum values`);
}
return new SingleStoreEnumColumnBuilder(name, values);
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
SingleStoreEnumColumn,
SingleStoreEnumColumnBuilder,
singlestoreEnum
});
//# sourceMappingURL=enum.cjs.map
@@ -0,0 +1 @@
{"version":3,"sources":["../../src/exports/migration-utils.ts"],"sourcesContent":["export { getBlocksToJsonMigrator } from '@payloadcms/drizzle'\nexport { migratePostgresV2toV3 } from '@payloadcms/drizzle/postgres'\n"],"names":["getBlocksToJsonMigrator","migratePostgresV2toV3"],"mappings":"AAAA,SAASA,uBAAuB,QAAQ,sBAAqB;AAC7D,SAASC,qBAAqB,QAAQ,+BAA8B"}
@@ -0,0 +1,6 @@
export declare const endOfISOWeekYearWithOptions: import("./types.js").FPFn2<
Date,
| import("../endOfISOWeekYear.js").EndOfISOWeekYearOptions<Date>
| undefined,
import("../fp.js").DateArg<Date>
>;
@@ -0,0 +1,8 @@
import type $Refs from "./refs.js";
import type { ParserOptions } from "./options.js";
import type { JSONSchema } from "./types/index.js";
/**
* Reads and parses the specified file path or URL.
*/
declare function parse<S extends object = JSONSchema, O extends ParserOptions<S> = ParserOptions<S>>(path: string, $refs: $Refs<S, O>, options: O): Promise<string | Buffer<ArrayBufferLike> | S | undefined>;
export default parse;
@@ -0,0 +1,104 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.getStringListFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = exports.getNumberFromEnv = void 0;
const api_1 = require("@opentelemetry/api");
const util_1 = require("util");
/**
* Retrieves a number from an environment variable.
* - Returns `undefined` if the environment variable is empty, unset, contains only whitespace, or is not a number.
* - Returns a number in all other cases.
*
* @param {string} key - The name of the environment variable to retrieve.
* @returns {number | undefined} - The number value or `undefined`.
*/
function getNumberFromEnv(key) {
const raw = process.env[key];
if (raw == null || raw.trim() === '') {
return undefined;
}
const value = Number(raw);
if (isNaN(value)) {
api_1.diag.warn(`Unknown value ${(0, util_1.inspect)(raw)} for ${key}, expected a number, using defaults`);
return undefined;
}
return value;
}
exports.getNumberFromEnv = getNumberFromEnv;
/**
* Retrieves a string from an environment variable.
* - Returns `undefined` if the environment variable is empty, unset, or contains only whitespace.
*
* @param {string} key - The name of the environment variable to retrieve.
* @returns {string | undefined} - The string value or `undefined`.
*/
function getStringFromEnv(key) {
const raw = process.env[key];
if (raw == null || raw.trim() === '') {
return undefined;
}
return raw;
}
exports.getStringFromEnv = getStringFromEnv;
/**
* Retrieves a boolean value from an environment variable.
* - Trims leading and trailing whitespace and ignores casing.
* - Returns `false` if the environment variable is empty, unset, or contains only whitespace.
* - Returns `false` for strings that cannot be mapped to a boolean.
*
* @param {string} key - The name of the environment variable to retrieve.
* @returns {boolean} - The boolean value or `false` if the environment variable is unset empty, unset, or contains only whitespace.
*/
function getBooleanFromEnv(key) {
const raw = process.env[key]?.trim().toLowerCase();
if (raw == null || raw === '') {
// NOTE: falling back to `false` instead of `undefined` as required by the specification.
// If you have a use-case that requires `undefined`, consider using `getStringFromEnv()` and applying the necessary
// normalizations in the consuming code.
return false;
}
if (raw === 'true') {
return true;
}
else if (raw === 'false') {
return false;
}
else {
api_1.diag.warn(`Unknown value ${(0, util_1.inspect)(raw)} for ${key}, expected 'true' or 'false', falling back to 'false' (default)`);
return false;
}
}
exports.getBooleanFromEnv = getBooleanFromEnv;
/**
* Retrieves a list of strings from an environment variable.
* - Uses ',' as the delimiter.
* - Trims leading and trailing whitespace from each entry.
* - Excludes empty entries.
* - Returns `undefined` if the environment variable is empty or contains only whitespace.
* - Returns an empty array if all entries are empty or whitespace.
*
* @param {string} key - The name of the environment variable to retrieve.
* @returns {string[] | undefined} - The list of strings or `undefined`.
*/
function getStringListFromEnv(key) {
return getStringFromEnv(key)
?.split(',')
.map(v => v.trim())
.filter(s => s !== '');
}
exports.getStringListFromEnv = getStringListFromEnv;
//# sourceMappingURL=environment.js.map
@@ -0,0 +1,84 @@
argparse
========
[![Build Status](https://secure.travis-ci.org/nodeca/argparse.svg?branch=master)](http://travis-ci.org/nodeca/argparse)
[![NPM version](https://img.shields.io/npm/v/argparse.svg)](https://www.npmjs.org/package/argparse)
CLI arguments parser for node.js, with [sub-commands](https://docs.python.org/3.9/library/argparse.html#sub-commands) support. Port of python's [argparse](http://docs.python.org/dev/library/argparse.html) (version [3.9.0](https://github.com/python/cpython/blob/v3.9.0rc1/Lib/argparse.py)).
**Difference with original.**
- JS has no keyword arguments support.
- Pass options instead: `new ArgumentParser({ description: 'example', add_help: true })`.
- JS has no python's types `int`, `float`, ...
- Use string-typed names: `.add_argument('-b', { type: 'int', help: 'help' })`.
- `%r` format specifier uses `require('util').inspect()`.
More details in [doc](./doc).
Example
-------
`test.js` file:
```javascript
#!/usr/bin/env node
'use strict';
const { ArgumentParser } = require('argparse');
const { version } = require('./package.json');
const parser = new ArgumentParser({
description: 'Argparse example'
});
parser.add_argument('-v', '--version', { action: 'version', version });
parser.add_argument('-f', '--foo', { help: 'foo bar' });
parser.add_argument('-b', '--bar', { help: 'bar foo' });
parser.add_argument('--baz', { help: 'baz bar' });
console.dir(parser.parse_args());
```
Display help:
```
$ ./test.js -h
usage: test.js [-h] [-v] [-f FOO] [-b BAR] [--baz BAZ]
Argparse example
optional arguments:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-f FOO, --foo FOO foo bar
-b BAR, --bar BAR bar foo
--baz BAZ baz bar
```
Parse arguments:
```
$ ./test.js -f=3 --bar=4 --baz 5
{ foo: '3', bar: '4', baz: '5' }
```
API docs
--------
Since this is a port with minimal divergence, there's no separate documentation.
Use original one instead, with notes about difference.
1. [Original doc](https://docs.python.org/3.9/library/argparse.html).
2. [Original tutorial](https://docs.python.org/3.9/howto/argparse.html).
3. [Difference with python](./doc).
argparse for enterprise
-----------------------
Available as part of the Tidelift Subscription
The maintainers of argparse and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-argparse?utm_source=npm-argparse&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
@@ -0,0 +1,321 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const currentScopes = require('./currentScopes.js');
const semanticAttributes = require('./semanticAttributes.js');
const spanUtils = require('./utils/spanUtils.js');
const spanstatus = require('./tracing/spanstatus.js');
const is = require('./utils/is.js');
const hasSpansEnabled = require('./utils/hasSpansEnabled.js');
const baggage = require('./utils/baggage.js');
const sentryNonRecordingSpan = require('./tracing/sentryNonRecordingSpan.js');
const trace = require('./tracing/trace.js');
const traceData = require('./utils/traceData.js');
const url = require('./utils/url.js');
/**
* Create and track fetch request spans for usage in combination with `addFetchInstrumentationHandler`.
*
* @returns Span if a span was created, otherwise void.
*/
function instrumentFetchRequest(
handlerData,
shouldCreateSpan,
shouldAttachHeaders,
spans,
spanOriginOrOptions,
) {
if (!handlerData.fetchData) {
return undefined;
}
const { method, url } = handlerData.fetchData;
const shouldCreateSpanResult = hasSpansEnabled.hasSpansEnabled() && shouldCreateSpan(url);
if (handlerData.endTimestamp && shouldCreateSpanResult) {
const spanId = handlerData.fetchData.__span;
if (!spanId) return;
const span = spans[spanId];
if (span) {
endSpan(span, handlerData);
_callOnRequestSpanEnd(span, handlerData, spanOriginOrOptions);
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
delete spans[spanId];
}
return undefined;
}
// Backwards-compatible with the old signature. Needed to introduce the combined optional parameter
// to avoid API breakage for anyone calling this function with the optional spanOrigin parameter
// TODO (v11): remove this backwards-compatible code and only accept the options parameter
const { spanOrigin = 'auto.http.browser', propagateTraceparent = false } =
typeof spanOriginOrOptions === 'object' ? spanOriginOrOptions : { spanOrigin: spanOriginOrOptions };
const hasParent = !!spanUtils.getActiveSpan();
const span =
shouldCreateSpanResult && hasParent
? trace.startInactiveSpan(getSpanStartOptions(url, method, spanOrigin))
: new sentryNonRecordingSpan.SentryNonRecordingSpan();
handlerData.fetchData.__span = span.spanContext().spanId;
spans[span.spanContext().spanId] = span;
if (shouldAttachHeaders(handlerData.fetchData.url)) {
const request = handlerData.args[0];
// Shallow clone the options object to avoid mutating the original user-provided object
// Examples: users re-using same options object for multiple fetch calls, frozen objects
const options = { ...(handlerData.args[1] || {}) };
const headers = _addTracingHeadersToFetchRequest(
request,
options,
// If performance is disabled (TWP) or there's no active root span (pageload/navigation/interaction),
// we do not want to use the span as base for the trace headers,
// which means that the headers will be generated from the scope and the sampling decision is deferred
hasSpansEnabled.hasSpansEnabled() && hasParent ? span : undefined,
propagateTraceparent,
);
if (headers) {
// Ensure this is actually set, if no options have been passed previously
handlerData.args[1] = options;
options.headers = headers;
}
}
const client = currentScopes.getClient();
if (client) {
const fetchHint = {
input: handlerData.args,
response: handlerData.response,
startTimestamp: handlerData.startTimestamp,
endTimestamp: handlerData.endTimestamp,
} ;
client.emit('beforeOutgoingRequestSpan', span, fetchHint);
}
return span;
}
/**
* Calls the onRequestSpanEnd callback if it is defined.
*/
function _callOnRequestSpanEnd(
span,
handlerData,
spanOriginOrOptions,
) {
const onRequestSpanEnd =
typeof spanOriginOrOptions === 'object' && spanOriginOrOptions !== null
? spanOriginOrOptions.onRequestSpanEnd
: undefined;
onRequestSpanEnd?.(span, {
headers: handlerData.response?.headers,
error: handlerData.error,
});
}
/**
* Adds sentry-trace and baggage headers to the various forms of fetch headers.
* exported only for testing purposes
*
* When we determine if we should add a baggage header, there are 3 cases:
* 1. No previous baggage header -> add baggage
* 2. Previous baggage header has no sentry baggage values -> add our baggage
* 3. Previous baggage header has sentry baggage values -> do nothing (might have been added manually by users)
*/
// eslint-disable-next-line complexity -- yup it's this complicated :(
function _addTracingHeadersToFetchRequest(
request,
fetchOptionsObj
,
span,
propagateTraceparent,
) {
const traceHeaders = traceData.getTraceData({ span, propagateTraceparent });
const sentryTrace = traceHeaders['sentry-trace'];
const baggage = traceHeaders.baggage;
const traceparent = traceHeaders.traceparent;
// Nothing to do, when we return undefined here, the original headers will be used
if (!sentryTrace) {
return undefined;
}
const originalHeaders = fetchOptionsObj.headers || (is.isRequest(request) ? request.headers : undefined);
if (!originalHeaders) {
return { ...traceHeaders };
} else if (isHeaders(originalHeaders)) {
const newHeaders = new Headers(originalHeaders);
// We don't want to override manually added sentry headers
if (!newHeaders.get('sentry-trace')) {
newHeaders.set('sentry-trace', sentryTrace);
}
if (propagateTraceparent && traceparent && !newHeaders.get('traceparent')) {
newHeaders.set('traceparent', traceparent);
}
if (baggage) {
const prevBaggageHeader = newHeaders.get('baggage');
if (!prevBaggageHeader) {
newHeaders.set('baggage', baggage);
} else if (!baggageHeaderHasSentryBaggageValues(prevBaggageHeader)) {
newHeaders.set('baggage', `${prevBaggageHeader},${baggage}`);
}
}
return newHeaders;
} else if (Array.isArray(originalHeaders)) {
const newHeaders = [...originalHeaders];
if (!originalHeaders.find(header => header[0] === 'sentry-trace')) {
newHeaders.push(['sentry-trace', sentryTrace]);
}
if (propagateTraceparent && traceparent && !originalHeaders.find(header => header[0] === 'traceparent')) {
newHeaders.push(['traceparent', traceparent]);
}
const prevBaggageHeaderWithSentryValues = originalHeaders.find(
header => header[0] === 'baggage' && baggageHeaderHasSentryBaggageValues(header[1]),
);
if (baggage && !prevBaggageHeaderWithSentryValues) {
// If there are multiple entries with the same key, the browser will merge the values into a single request header.
// Its therefore safe to simply push a "baggage" entry, even though there might already be another baggage header.
newHeaders.push(['baggage', baggage]);
}
return newHeaders ;
} else {
const existingSentryTraceHeader = 'sentry-trace' in originalHeaders ? originalHeaders['sentry-trace'] : undefined;
const existingTraceparentHeader = 'traceparent' in originalHeaders ? originalHeaders.traceparent : undefined;
const existingBaggageHeader = 'baggage' in originalHeaders ? originalHeaders.baggage : undefined;
const newBaggageHeaders = existingBaggageHeader
? Array.isArray(existingBaggageHeader)
? [...existingBaggageHeader]
: [existingBaggageHeader]
: [];
const prevBaggageHeaderWithSentryValues =
existingBaggageHeader &&
(Array.isArray(existingBaggageHeader)
? existingBaggageHeader.find(headerItem => baggageHeaderHasSentryBaggageValues(headerItem))
: baggageHeaderHasSentryBaggageValues(existingBaggageHeader));
if (baggage && !prevBaggageHeaderWithSentryValues) {
newBaggageHeaders.push(baggage);
}
const newHeaders
= {
...originalHeaders,
'sentry-trace': (existingSentryTraceHeader ) ?? sentryTrace,
baggage: newBaggageHeaders.length > 0 ? newBaggageHeaders.join(',') : undefined,
};
if (propagateTraceparent && traceparent && !existingTraceparentHeader) {
newHeaders.traceparent = traceparent;
}
return newHeaders;
}
}
function endSpan(span, handlerData) {
if (handlerData.response) {
spanstatus.setHttpStatus(span, handlerData.response.status);
const contentLength = handlerData.response?.headers?.get('content-length');
if (contentLength) {
const contentLengthNum = parseInt(contentLength);
if (contentLengthNum > 0) {
span.setAttribute('http.response_content_length', contentLengthNum);
}
}
} else if (handlerData.error) {
span.setStatus({ code: spanstatus.SPAN_STATUS_ERROR, message: 'internal_error' });
}
span.end();
}
function baggageHeaderHasSentryBaggageValues(baggageHeader) {
return baggageHeader.split(',').some(baggageEntry => baggageEntry.trim().startsWith(baggage.SENTRY_BAGGAGE_KEY_PREFIX));
}
function isHeaders(headers) {
return typeof Headers !== 'undefined' && is.isInstanceOf(headers, Headers);
}
function getSpanStartOptions(
url$1,
method,
spanOrigin,
) {
// Data URLs need special handling because parseStringToURLObject treats them as "relative"
// (no "://"), causing getSanitizedUrlStringFromUrlObject to return just the pathname
// without the "data:" prefix, making later stripDataUrlContent calls ineffective.
// So for data URLs, we strip the content first and use that directly.
if (url$1.startsWith('data:')) {
const sanitizedUrl = url.stripDataUrlContent(url$1);
return {
name: `${method} ${sanitizedUrl}`,
attributes: getFetchSpanAttributes(url$1, undefined, method, spanOrigin),
};
}
const parsedUrl = url.parseStringToURLObject(url$1);
const sanitizedUrl = parsedUrl ? url.getSanitizedUrlStringFromUrlObject(parsedUrl) : url$1;
return {
name: `${method} ${sanitizedUrl}`,
attributes: getFetchSpanAttributes(url$1, parsedUrl, method, spanOrigin),
};
}
function getFetchSpanAttributes(
url$1,
parsedUrl,
method,
spanOrigin,
) {
const attributes = {
url: url.stripDataUrlContent(url$1),
type: 'fetch',
'http.method': method,
[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: spanOrigin,
[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'http.client',
};
if (parsedUrl) {
if (!url.isURLObjectRelative(parsedUrl)) {
attributes['http.url'] = url.stripDataUrlContent(parsedUrl.href);
attributes['server.address'] = parsedUrl.host;
}
if (parsedUrl.search) {
attributes['http.query'] = parsedUrl.search;
}
if (parsedUrl.hash) {
attributes['http.fragment'] = parsedUrl.hash;
}
}
return attributes;
}
exports._addTracingHeadersToFetchRequest = _addTracingHeadersToFetchRequest;
exports._callOnRequestSpanEnd = _callOnRequestSpanEnd;
exports.instrumentFetchRequest = instrumentFetchRequest;
//# sourceMappingURL=fetch.js.map
@@ -0,0 +1,6 @@
@layer payload-default {
.icon--folder {
height: var(--base);
width: var(--base);
}
}
@@ -0,0 +1,28 @@
import { formatDistance } from "./lb/_lib/formatDistance.mjs";
import { formatLong } from "./lb/_lib/formatLong.mjs";
import { formatRelative } from "./lb/_lib/formatRelative.mjs";
import { localize } from "./lb/_lib/localize.mjs";
import { match } from "./lb/_lib/match.mjs";
/**
* @category Locales
* @summary Luxembourgish locale.
* @language Luxembourgish
* @iso-639-2 ltz
* @author Daniel Waxweiler [@dwaxweiler](https://github.com/dwaxweiler)
*/
export const lb = {
code: "lb",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 1 /* Monday */,
firstWeekContainsDate: 4,
},
};
// Fallback for modularized imports:
export default lb;
@@ -0,0 +1,144 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.parsedType = void 0;
exports.default = default_1;
const util = __importStar(require("../core/util.cjs"));
const parsedType = (data) => {
const t = typeof data;
switch (t) {
case "number": {
return Number.isNaN(data) ? "NaN" : "nombro";
}
case "object": {
if (Array.isArray(data)) {
return "tabelo";
}
if (data === null) {
return "senvalora";
}
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
return data.constructor.name;
}
}
}
return t;
};
exports.parsedType = parsedType;
const error = () => {
const Sizable = {
string: { unit: "karaktrojn", verb: "havi" },
file: { unit: "bajtojn", verb: "havi" },
array: { unit: "elementojn", verb: "havi" },
set: { unit: "elementojn", verb: "havi" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const Nouns = {
regex: "enigo",
email: "retadreso",
url: "URL",
emoji: "emoĝio",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "ISO-datotempo",
date: "ISO-dato",
time: "ISO-tempo",
duration: "ISO-daŭro",
ipv4: "IPv4-adreso",
ipv6: "IPv6-adreso",
cidrv4: "IPv4-rango",
cidrv6: "IPv6-rango",
base64: "64-ume kodita karaktraro",
base64url: "URL-64-ume kodita karaktraro",
json_string: "JSON-karaktraro",
e164: "E.164-nombro",
jwt: "JWT",
template_literal: "enigo",
};
return (issue) => {
switch (issue.code) {
case "invalid_type":
return `Nevalida enigo: atendiĝis ${issue.expected}, riceviĝis ${(0, exports.parsedType)(issue.input)}`;
case "invalid_value":
if (issue.values.length === 1)
return `Nevalida enigo: atendiĝis ${util.stringifyPrimitive(issue.values[0])}`;
return `Nevalida opcio: atendiĝis unu el ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return `Tro granda: atendiĝis ke ${issue.origin ?? "valoro"} havu ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementojn"}`;
return `Tro granda: atendiĝis ke ${issue.origin ?? "valoro"} havu ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `Tro malgranda: atendiĝis ke ${issue.origin} havu ${adj}${issue.minimum.toString()} ${sizing.unit}`;
}
return `Tro malgranda: atendiĝis ke ${issue.origin} estu ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with")
return `Nevalida karaktraro: devas komenciĝi per "${_issue.prefix}"`;
if (_issue.format === "ends_with")
return `Nevalida karaktraro: devas finiĝi per "${_issue.suffix}"`;
if (_issue.format === "includes")
return `Nevalida karaktraro: devas inkluzivi "${_issue.includes}"`;
if (_issue.format === "regex")
return `Nevalida karaktraro: devas kongrui kun la modelo ${_issue.pattern}`;
return `Nevalida ${Nouns[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Nevalida nombro: devas esti oblo de ${issue.divisor}`;
case "unrecognized_keys":
return `Nekonata${issue.keys.length > 1 ? "j" : ""} ŝlosilo${issue.keys.length > 1 ? "j" : ""}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Nevalida ŝlosilo en ${issue.origin}`;
case "invalid_union":
return "Nevalida enigo";
case "invalid_element":
return `Nevalida valoro en ${issue.origin}`;
default:
return `Nevalida enigo`;
}
};
};
function default_1() {
return {
localeError: error(),
};
}
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E zC","132":"F A B"},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","1028":"C L M G N O P"},C:{"1":"0 1 2 3 4 5 6 7 8 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","2":"0C VC","260":"J bB K D E F A B C L M G 4C 5C","1028":"9 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"},D:{"1":"0 1 2 3 4 5 6 7 8 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","548":"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","1028":"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"},E:{"1":"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","2":"6C bC","548":"J bB K D E F A B C L M G 7C 8C 9C AD cC PC QC BD CD DD dC eC RC ED"},F:{"1":"0 1 2 3 4 5 6 7 8 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 QC","2":"F","548":"B C JD KD LD MD PC xC ND","1028":"9 G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B"},G:{"1":"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","548":"E 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"},H:{"132":"mD"},I:{"1":"I","16":"nD oD","548":"VC J pD qD yC","1028":"rD sD"},J:{"548":"D A"},K:{"1":"H QC","548":"A B C PC xC"},L:{"1":"I"},M:{"1":"OC"},N:{"132":"A B"},O:{"1":"RC"},P:{"1":"9 AB BB CB DB EB FB GB HB IB cC yD zD 0D 1D 2D SC TC UC 3D","1028":"J tD uD vD wD xD"},Q:{"1":"4D"},R:{"1":"5D"},S:{"1":"6D 7D"}},B:4,C:"Media Queries: resolution feature",D:true};
@@ -0,0 +1,130 @@
import { buildMatchFn } from "../../_lib/buildMatchFn.js";
import { buildMatchPatternFn } from "../../_lib/buildMatchPatternFn.js";
const matchOrdinalNumberPattern = /^\d+\./i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(e\.m\.a|m\.a\.j|eKr|pKr)/i,
abbreviated: /^(e\.m\.a|m\.a\.j|eKr|pKr)/i,
wide: /^(enne meie ajaarvamist|meie ajaarvamise järgi|enne Kristust|pärast Kristust)/i,
};
const parseEraPatterns = {
any: [/^e/i, /^(m|p)/i],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^K[1234]/i,
wide: /^[1234](\.)? kvartal/i,
};
const parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i],
};
const matchMonthPatterns = {
narrow: /^[jvmasond]/i,
abbreviated: /^(jaan|veebr|märts|apr|mai|juuni|juuli|aug|sept|okt|nov|dets)/i,
wide: /^(jaanuar|veebruar|märts|aprill|mai|juuni|juuli|august|september|oktoober|november|detsember)/i,
};
const parseMonthPatterns = {
narrow: [
/^j/i,
/^v/i,
/^m/i,
/^a/i,
/^m/i,
/^j/i,
/^j/i,
/^a/i,
/^s/i,
/^o/i,
/^n/i,
/^d/i,
],
any: [
/^ja/i,
/^v/i,
/^mär/i,
/^ap/i,
/^mai/i,
/^juun/i,
/^juul/i,
/^au/i,
/^s/i,
/^o/i,
/^n/i,
/^d/i,
],
};
const matchDayPatterns = {
narrow: /^[petknrl]/i,
short: /^[petknrl]/i,
abbreviated: /^(püh?|esm?|tei?|kolm?|nel?|ree?|laup?)\.?/i,
wide: /^(pühapäev|esmaspäev|teisipäev|kolmapäev|neljapäev|reede|laupäev)/i,
};
const parseDayPatterns = {
any: [/^p/i, /^e/i, /^t/i, /^k/i, /^n/i, /^r/i, /^l/i],
};
const matchDayPeriodPatterns = {
any: /^(am|pm|keskööl?|keskpäev(al)?|hommik(ul)?|pärastlõunal?|õhtul?|öö(sel)?)/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^a/i,
pm: /^p/i,
midnight: /^keskö/i,
noon: /^keskp/i,
morning: /hommik/i,
afternoon: /pärastlõuna/i,
evening: /õhtu/i,
night: /öö/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",
}),
};
@@ -0,0 +1,4 @@
export {
useAsync
} from "./react-select-async.cjs.js";
export { _default as default } from "./react-select-async.cjs.default.js";
@@ -0,0 +1,6 @@
export declare type Arguments<T> = T extends (...args: infer U) => any ? U : never;
export declare type DeepRequired<T> = {
[K in keyof T]-?: Required<T[K]>;
};
export declare type FirstArgument<T> = T extends (firstArg: infer U, ...args: Array<any>) => any ? U : never;
export declare type Without<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
@@ -0,0 +1,14 @@
/**
* The function extracts UTC offset in minutes from the given date in specified
* time zone.
*
* Unlike `Date.prototype.getTimezoneOffset`, this function returns the value
* mirrored to the sign of the offset in the time zone. For Asia/Singapore
* (UTC+8), `tzOffset` returns 480, while `getTimezoneOffset` returns -480.
*
* @param timeZone - Time zone name (IANA or UTC offset)
* @param date - Date to check the offset for
*
* @returns UTC offset in minutes
*/
export declare function tzOffset(timeZone: string | undefined, date: Date): number;
@@ -0,0 +1 @@
{"version":3,"file":"message-square-diff.js","sources":["../../../src/icons/message-square-diff.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name MessageSquareDiff\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtNSAxOS0yIDJWNWEyIDIgMCAwIDEgMi0yaDE0YTIgMiAwIDAgMSAyIDJ2MTBhMiAyIDAgMCAxLTIgMiIgLz4KICA8cGF0aCBkPSJNOSAxMGg2IiAvPgogIDxwYXRoIGQ9Ik0xMiA3djYiIC8+CiAgPHBhdGggZD0iTTkgMTdoNiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/message-square-diff\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst MessageSquareDiff = createLucideIcon('MessageSquareDiff', [\n ['path', { d: 'm5 19-2 2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2', key: '1xuzuj' }],\n ['path', { d: 'M9 10h6', key: '9gxzsh' }],\n ['path', { d: 'M12 7v6', key: 'lw1j43' }],\n ['path', { d: 'M9 17h6', key: 'r8uit2' }],\n]);\n\nexport default MessageSquareDiff;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAoB,iBAAiB,mBAAqB,CAAA,CAAA,CAAA;AAAA,CAAA,CAC9D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA+D,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC5F,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC1C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,29 @@
/**
* @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 EggOff = createLucideIcon("EggOff", [
[
"path",
{
d: "M6.399 6.399C5.362 8.157 4.65 10.189 4.5 12c-.37 4.43 1.27 9.95 7.5 10 3.256-.026 5.259-1.547 6.375-3.625",
key: "6et380"
}
],
[
"path",
{
d: "M19.532 13.875A14.07 14.07 0 0 0 19.5 12c-.36-4.34-3.95-9.96-7.5-10-1.04.012-2.082.502-3.046 1.297",
key: "gcdc3f"
}
],
["line", { x1: "2", x2: "22", y1: "2", y2: "22", key: "a6p6uj" }]
]);
export { EggOff as default };
//# sourceMappingURL=egg-off.js.map
@@ -0,0 +1,95 @@
'use client';
import { c as _c } from "react/compiler-runtime";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { confirmPassword } from 'payload/shared';
import React from 'react';
import { useField } from '../../forms/useField/index.js';
import { useTranslation } from '../../providers/Translation/index.js';
import { FieldError } from '../FieldError/index.js';
import { FieldLabel } from '../FieldLabel/index.js';
import { fieldBaseClass } from '../shared/index.js';
import './index.scss';
export const ConfirmPasswordField = props => {
const $ = _c(12);
const {
disabled: disabledFromProps,
path: t0
} = props;
const path = t0 === undefined ? "confirm-password" : t0;
const {
t
} = useTranslation();
let t1;
if ($[0] !== path) {
t1 = {
path,
validate: _temp
};
$[0] = path;
$[1] = t1;
} else {
t1 = $[1];
}
const {
disabled,
setValue,
showError,
value: value_0
} = useField(t1);
const t2 = showError && "error";
let t3;
if ($[2] !== t2) {
t3 = [fieldBaseClass, "confirm-password", t2].filter(Boolean);
$[2] = t2;
$[3] = t3;
} else {
t3 = $[3];
}
const t4 = t3.join(" ");
let t5;
if ($[4] !== disabled || $[5] !== disabledFromProps || $[6] !== path || $[7] !== setValue || $[8] !== t || $[9] !== t4 || $[10] !== value_0) {
t5 = _jsxs("div", {
className: t4,
children: [_jsx(FieldLabel, {
htmlFor: "field-confirm-password",
label: t("authentication:confirmPassword"),
required: true
}), _jsxs("div", {
className: `${fieldBaseClass}__wrap`,
children: [_jsx(FieldError, {
path
}), _jsx("input", {
"aria-label": t("authentication:confirmPassword"),
autoComplete: "off",
disabled: !!(disabled || disabledFromProps),
id: "field-confirm-password",
name: "confirm-password",
onChange: setValue,
type: "password",
value: value_0 || ""
})]
})]
});
$[4] = disabled;
$[5] = disabledFromProps;
$[6] = path;
$[7] = setValue;
$[8] = t;
$[9] = t4;
$[10] = value_0;
$[11] = t5;
} else {
t5 = $[11];
}
return t5;
};
function _temp(value, options) {
return confirmPassword(value, {
name: "confirm-password",
type: "text",
required: true,
...options
});
}
//# sourceMappingURL=index.js.map
@@ -0,0 +1,45 @@
var baseIteratee = require('./_baseIteratee'),
baseWhile = require('./_baseWhile');
/**
* Creates a slice of `array` with elements taken from the beginning. Elements
* are taken until `predicate` returns falsey. The predicate is invoked with
* three arguments: (value, index, array).
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to query.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @returns {Array} Returns the slice of `array`.
* @example
*
* var users = [
* { 'user': 'barney', 'active': false },
* { 'user': 'fred', 'active': false },
* { 'user': 'pebbles', 'active': true }
* ];
*
* _.takeWhile(users, function(o) { return !o.active; });
* // => objects for ['barney', 'fred']
*
* // The `_.matches` iteratee shorthand.
* _.takeWhile(users, { 'user': 'barney', 'active': false });
* // => objects for ['barney']
*
* // The `_.matchesProperty` iteratee shorthand.
* _.takeWhile(users, ['active', false]);
* // => objects for ['barney', 'fred']
*
* // The `_.property` iteratee shorthand.
* _.takeWhile(users, 'active');
* // => []
*/
function takeWhile(array, predicate) {
return (array && array.length)
? baseWhile(array, baseIteratee(predicate, 3))
: [];
}
module.exports = takeWhile;
@@ -0,0 +1 @@
{"version":3,"sources":["../../src/uploads/generateFilePathOrURL.ts"],"sourcesContent":["import type { Config } from '../config/types.js'\n\nimport { formatAdminURL } from '../utilities/formatAdminURL.js'\n\n/**\n * Generates a file path or URL based on the provided parameters.\n *\n * If urlOrPath is an external URL, it returns it as is.\n * If a filename is provided, it constructs a URL using the collection slug and API route.\n * If neither condition is met, it returns null.\n *\n * If you set relative to true, the returned URL will be relative to the serverURL (unless external).\n */\nexport function generateFilePathOrURL({\n collectionSlug,\n config,\n filename,\n relative,\n serverURL,\n urlOrPath,\n}: {\n collectionSlug: string\n config: Config\n filename?: string\n relative: boolean\n serverURL?: string\n urlOrPath: string | undefined\n}): null | string {\n if (urlOrPath) {\n if (!urlOrPath.startsWith('/') && !urlOrPath.startsWith(serverURL || '')) {\n // external url\n return urlOrPath\n }\n }\n\n if (filename) {\n // local file url\n return formatAdminURL({\n apiRoute: config.routes?.api || '',\n path: `/${collectionSlug}/file/${encodeURIComponent(filename)}`,\n relative,\n serverURL: config.serverURL,\n })\n }\n\n return null\n}\n"],"names":["formatAdminURL","generateFilePathOrURL","collectionSlug","config","filename","relative","serverURL","urlOrPath","startsWith","apiRoute","routes","api","path","encodeURIComponent"],"mappings":"AAEA,SAASA,cAAc,QAAQ,iCAAgC;AAE/D;;;;;;;;CAQC,GACD,OAAO,SAASC,sBAAsB,EACpCC,cAAc,EACdC,MAAM,EACNC,QAAQ,EACRC,QAAQ,EACRC,SAAS,EACTC,SAAS,EAQV;IACC,IAAIA,WAAW;QACb,IAAI,CAACA,UAAUC,UAAU,CAAC,QAAQ,CAACD,UAAUC,UAAU,CAACF,aAAa,KAAK;YACxE,eAAe;YACf,OAAOC;QACT;IACF;IAEA,IAAIH,UAAU;QACZ,iBAAiB;QACjB,OAAOJ,eAAe;YACpBS,UAAUN,OAAOO,MAAM,EAAEC,OAAO;YAChCC,MAAM,CAAC,CAAC,EAAEV,eAAe,MAAM,EAAEW,mBAAmBT,WAAW;YAC/DC;YACAC,WAAWH,OAAOG,SAAS;QAC7B;IACF;IAEA,OAAO;AACT"}
@@ -0,0 +1,14 @@
import { jsx as _jsx } from "react/jsx-runtime";
import React from 'react';
import './index.scss';
export const CalendarIcon = () => /*#__PURE__*/_jsx("svg", {
className: "icon icon--calendar",
viewBox: "0 0 20 20",
xmlns: "http://www.w3.org/2000/svg",
children: /*#__PURE__*/_jsx("path", {
className: "stroke",
d: "M7.33333 3.33334V6M12.6667 3.33334V6M4 8.66667H16M5.33333 4.66667H14.6667C15.403 4.66667 16 5.26362 16 6V15.3333C16 16.0697 15.403 16.6667 14.6667 16.6667H5.33333C4.59695 16.6667 4 16.0697 4 15.3333V6C4 5.26362 4.59695 4.66667 5.33333 4.66667Z",
strokeLinecap: "square"
})
});
//# sourceMappingURL=index.js.map
@@ -0,0 +1,105 @@
"use strict";
exports.formatDistance = void 0;
const formatDistanceLocale = {
lessThanXSeconds: {
one: "bir saniyeden az",
other: "{{count}} saniyeden az",
},
xSeconds: {
one: "1 saniye",
other: "{{count}} saniye",
},
halfAMinute: "yarım dakika",
lessThanXMinutes: {
one: "bir dakikadan az",
other: "{{count}} dakikadan az",
},
xMinutes: {
one: "1 dakika",
other: "{{count}} dakika",
},
aboutXHours: {
one: "yaklaşık 1 saat",
other: "yaklaşık {{count}} saat",
},
xHours: {
one: "1 saat",
other: "{{count}} saat",
},
xDays: {
one: "1 gün",
other: "{{count}} gün",
},
aboutXWeeks: {
one: "yaklaşık 1 hafta",
other: "yaklaşık {{count}} hafta",
},
xWeeks: {
one: "1 hafta",
other: "{{count}} hafta",
},
aboutXMonths: {
one: "yaklaşık 1 ay",
other: "yaklaşık {{count}} ay",
},
xMonths: {
one: "1 ay",
other: "{{count}} ay",
},
aboutXYears: {
one: "yaklaşık 1 yıl",
other: "yaklaşık {{count}} yıl",
},
xYears: {
one: "1 yıl",
other: "{{count}} yıl",
},
overXYears: {
one: "1 yıldan fazla",
other: "{{count}} yıldan fazla",
},
almostXYears: {
one: "neredeyse 1 yıl",
other: "neredeyse {{count}} yıl",
},
};
const formatDistance = (token, count, options) => {
let result;
const 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?.addSuffix) {
if (options.comparison && options.comparison > 0) {
return result + " sonra";
} else {
return result + " önce";
}
}
return result;
};
exports.formatDistance = formatDistance;
@@ -0,0 +1,81 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var unique_constraint_exports = {};
__export(unique_constraint_exports, {
UniqueConstraint: () => UniqueConstraint,
UniqueConstraintBuilder: () => UniqueConstraintBuilder,
UniqueOnConstraintBuilder: () => UniqueOnConstraintBuilder,
unique: () => unique,
uniqueKeyName: () => uniqueKeyName
});
module.exports = __toCommonJS(unique_constraint_exports);
var import_entity = require("../entity.cjs");
var import_table_utils = require("../table.utils.cjs");
function uniqueKeyName(table, columns) {
return `${table[import_table_utils.TableName]}_${columns.join("_")}_unique`;
}
function unique(name) {
return new UniqueOnConstraintBuilder(name);
}
class UniqueConstraintBuilder {
constructor(columns, name) {
this.name = name;
this.columns = columns;
}
static [import_entity.entityKind] = "SQLiteUniqueConstraintBuilder";
/** @internal */
columns;
/** @internal */
build(table) {
return new UniqueConstraint(table, this.columns, this.name);
}
}
class UniqueOnConstraintBuilder {
static [import_entity.entityKind] = "SQLiteUniqueOnConstraintBuilder";
/** @internal */
name;
constructor(name) {
this.name = name;
}
on(...columns) {
return new UniqueConstraintBuilder(columns, this.name);
}
}
class UniqueConstraint {
constructor(table, columns, name) {
this.table = table;
this.columns = columns;
this.name = name ?? uniqueKeyName(this.table, this.columns.map((column) => column.name));
}
static [import_entity.entityKind] = "SQLiteUniqueConstraint";
columns;
name;
getName() {
return this.name;
}
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
UniqueConstraint,
UniqueConstraintBuilder,
UniqueOnConstraintBuilder,
unique,
uniqueKeyName
});
//# sourceMappingURL=unique-constraint.cjs.map
@@ -0,0 +1,11 @@
import { Client } from '@sentry/core';
/**
* Manually report the end of the page load, resulting in the SDK ending the pageload span.
* This only works if {@link BrowserTracingOptions.enableReportPageLoaded} is set to `true`.
* Otherwise, the pageload span will end itself based on the {@link BrowserTracingOptions.finalTimeout},
* {@link BrowserTracingOptions.idleTimeout} and {@link BrowserTracingOptions.childSpanTimeout}.
*
* @param client - The client to use. If not provided, the global client will be used.
*/
export declare function reportPageLoaded(client?: Client | undefined): void;
//# sourceMappingURL=reportPageLoaded.d.ts.map
@@ -0,0 +1,172 @@
"use strict";
exports.localize = void 0;
var _index = require("../../_lib/buildLocalizeFn.cjs");
const eraValues = {
narrow: ["ម.គស", "គស"],
abbreviated: ["មុនគ.ស", "គ.ស"],
wide: ["មុនគ្រិស្តសករាជ", "នៃគ្រិស្តសករាជ"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
wide: ["ត្រីមាសទី 1", "ត្រីមាសទី 2", "ត្រីមាសទី 3", "ត្រីមាសទី 4"],
};
const monthValues = {
narrow: [
"ម.ក",
"ក.ម",
"មិ",
"ម.ស",
"ឧ.ស",
"ម.ថ",
"ក.ដ",
"សី",
"កញ",
"តុ",
"វិ",
"ធ",
],
abbreviated: [
"មករា",
"កុម្ភៈ",
"មីនា",
"មេសា",
"ឧសភា",
"មិថុនា",
"កក្កដា",
"សីហា",
"កញ្ញា",
"តុលា",
"វិច្ឆិកា",
"ធ្នូ",
],
wide: [
"មករា",
"កុម្ភៈ",
"មីនា",
"មេសា",
"ឧសភា",
"មិថុនា",
"កក្កដា",
"សីហា",
"កញ្ញា",
"តុលា",
"វិច្ឆិកា",
"ធ្នូ",
],
};
const dayValues = {
narrow: ["អា", "ច", "អ", "ព", "ព្រ", "សុ", "ស"],
short: ["អា", "ច", "អ", "ព", "ព្រ", "សុ", "ស"],
abbreviated: ["អា", "ច", "អ", "ព", "ព្រ", "សុ", "ស"],
wide: ["អាទិត្យ", "ចន្ទ", "អង្គារ", "ពុធ", "ព្រហស្បតិ៍", "សុក្រ", "សៅរ៍"],
};
const dayPeriodValues = {
narrow: {
am: "ព្រឹក",
pm: "ល្ងាច",
midnight: "​ពេលកណ្ដាលអធ្រាត្រ",
noon: "ពេលថ្ងៃត្រង់",
morning: "ពេលព្រឹក",
afternoon: "ពេលរសៀល",
evening: "ពេលល្ងាច",
night: "ពេលយប់",
},
abbreviated: {
am: "ព្រឹក",
pm: "ល្ងាច",
midnight: "​ពេលកណ្ដាលអធ្រាត្រ",
noon: "ពេលថ្ងៃត្រង់",
morning: "ពេលព្រឹក",
afternoon: "ពេលរសៀល",
evening: "ពេលល្ងាច",
night: "ពេលយប់",
},
wide: {
am: "ព្រឹក",
pm: "ល្ងាច",
midnight: "​ពេលកណ្ដាលអធ្រាត្រ",
noon: "ពេលថ្ងៃត្រង់",
morning: "ពេលព្រឹក",
afternoon: "ពេលរសៀល",
evening: "ពេលល្ងាច",
night: "ពេលយប់",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "ព្រឹក",
pm: "ល្ងាច",
midnight: "​ពេលកណ្ដាលអធ្រាត្រ",
noon: "ពេលថ្ងៃត្រង់",
morning: "ពេលព្រឹក",
afternoon: "ពេលរសៀល",
evening: "ពេលល្ងាច",
night: "ពេលយប់",
},
abbreviated: {
am: "ព្រឹក",
pm: "ល្ងាច",
midnight: "​ពេលកណ្ដាលអធ្រាត្រ",
noon: "ពេលថ្ងៃត្រង់",
morning: "ពេលព្រឹក",
afternoon: "ពេលរសៀល",
evening: "ពេលល្ងាច",
night: "ពេលយប់",
},
wide: {
am: "ព្រឹក",
pm: "ល្ងាច",
midnight: "​ពេលកណ្ដាលអធ្រាត្រ",
noon: "ពេលថ្ងៃត្រង់",
morning: "ពេលព្រឹក",
afternoon: "ពេលរសៀល",
evening: "ពេលល្ងាច",
night: "ពេលយប់",
},
};
const ordinalNumber = (dirtyNumber, _) => {
const number = Number(dirtyNumber);
return number.toString();
};
const localize = (exports.localize = {
ordinalNumber,
era: (0, _index.buildLocalizeFn)({
values: eraValues,
defaultWidth: "wide",
}),
quarter: (0, _index.buildLocalizeFn)({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: (0, _index.buildLocalizeFn)({
values: monthValues,
defaultWidth: "wide",
}),
day: (0, _index.buildLocalizeFn)({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: (0, _index.buildLocalizeFn)({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
});
@@ -0,0 +1,16 @@
export const rollbackTransaction = async function rollbackTransaction(incomingID = '') {
const transactionID = incomingID instanceof Promise ? await incomingID : incomingID;
// if multiple operations are using the same transaction, the first will flow through and delete the session.
// subsequent calls should be ignored.
if (!this.sessions[transactionID]) {
return;
}
const session = this.sessions[transactionID];
// Delete from registry FIRST to prevent race conditions
// This ensures other operations can't retrieve this session while we're ending it
delete this.sessions[transactionID];
// end the session promise in failure by calling reject
await session.reject();
};
//# sourceMappingURL=rollbackTransaction.js.map
@@ -0,0 +1,250 @@
import { expect, expectTypeOf, test } from "vitest";
import * as z from "zod/v4";
test("transform ctx.addIssue with parse", () => {
const strs = ["foo", "bar"];
const schema = z.string().transform((data, ctx) => {
const i = strs.indexOf(data);
if (i === -1) {
ctx.addIssue({
input: data,
code: "custom",
message: `${data} is not one of our allowed strings`,
});
}
return data.length;
});
const result = schema.safeParse("asdf");
expect(result.success).toEqual(false);
expect(result.error!).toMatchInlineSnapshot(`
[ZodError: [
{
"code": "custom",
"message": "asdf is not one of our allowed strings",
"path": []
}
]]
`);
});
test("transform ctx.addIssue with parseAsync", async () => {
const strs = ["foo", "bar"];
const result = await z
.string()
.transform(async (data, ctx) => {
const i = strs.indexOf(data);
if (i === -1) {
ctx.addIssue({
input: data,
code: "custom",
message: `${data} is not one of our allowed strings`,
});
}
return data.length;
})
.safeParseAsync("asdf");
expect(result).toMatchInlineSnapshot(`
{
"error": [ZodError: [
{
"code": "custom",
"message": "asdf is not one of our allowed strings",
"path": []
}
]],
"success": false,
}
`);
});
test("z.NEVER in transform", () => {
const foo = z
.number()
.optional()
.transform((val, ctx) => {
if (!val) {
ctx.addIssue({
input: val,
code: z.ZodIssueCode.custom,
message: "bad",
});
return z.NEVER;
}
return val;
});
type foo = z.infer<typeof foo>;
expectTypeOf<foo>().toEqualTypeOf<number>();
const arg = foo.safeParse(undefined);
if (!arg.success) {
expect(arg.error.issues[0].message).toEqual("bad");
}
});
test("basic transformations", () => {
const r1 = z
.string()
.transform((data) => data.length)
.parse("asdf");
expect(r1).toEqual(4);
});
test("coercion", () => {
const numToString = z.number().transform((n) => String(n));
const data = z
.object({
id: numToString,
})
.parse({ id: 5 });
expect(data).toEqual({ id: "5" });
});
test("async coercion", async () => {
const numToString = z.number().transform(async (n) => String(n));
const data = await z
.object({
id: numToString,
})
.parseAsync({ id: 5 });
expect(data).toEqual({ id: "5" });
});
test("sync coercion async error", async () => {
const asyncNumberToString = z.number().transform(async (n) => String(n));
expect(() =>
z
.object({
id: asyncNumberToString,
})
.parse({ id: 5 })
).toThrow();
// expect(data).toEqual({ id: '5' });
});
test("default", () => {
const data = z.string().default("asdf").parse(undefined); // => "asdf"
expect(data).toEqual("asdf");
});
test("dynamic default", () => {
const data = z
.string()
.default(() => "string")
.parse(undefined); // => "asdf"
expect(data).toEqual("string");
});
test("default when property is null or undefined", () => {
const data = z
.object({
foo: z.boolean().nullable().default(true),
bar: z.boolean().default(true),
})
.parse({ foo: null });
expect(data).toEqual({ foo: null, bar: true });
});
test("default with falsy values", () => {
const schema = z.object({
emptyStr: z.string().default("def"),
zero: z.number().default(5),
falseBoolean: z.boolean().default(true),
});
const input = { emptyStr: "", zero: 0, falseBoolean: true };
const output = schema.parse(input);
// defaults are not supposed to be used
expect(output).toEqual(input);
});
test("object typing", () => {
const stringToNumber = z.string().transform((arg) => Number.parseFloat(arg));
const t1 = z.object({
stringToNumber,
});
type t1 = z.input<typeof t1>;
type t2 = z.output<typeof t1>;
expectTypeOf<t1>().toEqualTypeOf<{ stringToNumber: string }>();
expectTypeOf<t2>().toEqualTypeOf<{ stringToNumber: number }>();
});
test("transform method overloads", () => {
const t1 = z.string().transform((val) => val.toUpperCase());
expect(t1.parse("asdf")).toEqual("ASDF");
const t2 = z.string().transform((val) => val.length);
expect(t2.parse("asdf")).toEqual(4);
});
test("multiple transformers", () => {
const stringToNumber = z.string().transform((arg) => Number.parseFloat(arg));
const doubler = stringToNumber.transform((val) => {
return val * 2;
});
expect(doubler.parse("5")).toEqual(10);
});
test("short circuit on dirty", () => {
const schema = z
.string()
.refine(() => false)
.transform((val) => val.toUpperCase());
const result = schema.safeParse("asdf");
expect(result.success).toEqual(false);
expect(result.error).toMatchInlineSnapshot(`
[ZodError: [
{
"code": "custom",
"path": [],
"message": "Invalid input"
}
]]
`);
const result2 = schema.safeParse(1234);
expect(result2.success).toEqual(false);
if (!result2.success) {
expect(result2.error.issues[0].code).toEqual(z.ZodIssueCode.invalid_type);
}
});
test("async short circuit on dirty", async () => {
const schema = z
.string()
.refine(() => false)
.transform((val) => val.toUpperCase());
const result = await schema.spa("asdf");
expect(result.success).toEqual(false);
expect(result.error).toMatchInlineSnapshot(`
[ZodError: [
{
"code": "custom",
"path": [],
"message": "Invalid input"
}
]]
`);
const result2 = await schema.spa(1234);
expect(result2.success).toEqual(false);
expect(result2.error).toMatchInlineSnapshot(`
[ZodError: [
{
"expected": "string",
"code": "invalid_type",
"path": [],
"message": "Invalid input: expected string, received number"
}
]]
`);
});

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