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

This commit is contained in:
2026-02-24 16:04:21 +01:00
parent 915eb61613
commit 5397309103
43805 changed files with 4324295 additions and 3 deletions

View File

@@ -0,0 +1,21 @@
interface RequestDataIncludeOptions {
cookies?: boolean;
data?: boolean;
headers?: boolean;
ip?: boolean;
query_string?: boolean;
url?: boolean;
}
type RequestDataIntegrationOptions = {
/**
* Controls what data is pulled from the request and added to the event.
*/
include?: RequestDataIncludeOptions;
};
/**
* Add data about a request to an event. Primarily for use in Node-based SDKs, but included in `@sentry/core`
* so it can be used in cross-platform SDKs like `@sentry/nextjs`.
*/
export declare const requestDataIntegration: (options?: RequestDataIntegrationOptions | undefined) => import("../types-hoist/integration").Integration;
export {};
//# sourceMappingURL=requestdata.d.ts.map

View File

@@ -0,0 +1,16 @@
import type { ASTVisitor } from '../../language/visitor';
import type {
SDLValidationContext,
ValidationContext,
} from '../ValidationContext';
/**
* Unique directive names per location
*
* A GraphQL document is only valid if all non-repeatable directives at
* a given location are uniquely named.
*
* See https://spec.graphql.org/draft/#sec-Directives-Are-Unique-Per-Location
*/
export declare function UniqueDirectivesPerLocationRule(
context: ValidationContext | SDLValidationContext,
): ASTVisitor;

View File

@@ -0,0 +1,491 @@
import * as React from 'react';
import { AriaAttributes, Component, FocusEventHandler, FormEventHandler, JSX, KeyboardEventHandler, MouseEventHandler, ReactNode, RefCallback, TouchEventHandler } from 'react';
import { FilterOptionOption } from './filters';
import { AriaLiveMessages, AriaSelection } from './accessibility/index';
import { SelectComponentsConfig } from './components/index';
import { ClassNamesConfig, StylesConfig, StylesProps } from './styles';
import { ThemeConfig } from './theme';
import { ActionMeta, FocusDirection, GetOptionLabel, GetOptionValue, GroupBase, InputActionMeta, MenuPlacement, MenuPosition, OnChangeValue, Options, OptionsOrGroups, PropsValue, SetValueAction } from './types';
export declare type FormatOptionLabelContext = 'menu' | 'value';
export interface FormatOptionLabelMeta<Option> {
context: FormatOptionLabelContext;
inputValue: string;
selectValue: Options<Option>;
}
export interface Props<Option, IsMulti extends boolean, Group extends GroupBase<Option>> {
/** HTML ID of an element containing an error message related to the input**/
'aria-errormessage'?: AriaAttributes['aria-errormessage'];
/** Indicate if the value entered in the field is invalid **/
'aria-invalid'?: AriaAttributes['aria-invalid'];
/** Aria label (for assistive tech) */
'aria-label'?: AriaAttributes['aria-label'];
/** HTML ID of an element that should be used as the label (for assistive tech) */
'aria-labelledby'?: AriaAttributes['aria-labelledby'];
/** Used to set the priority with which screen reader should treat updates to live regions. The possible settings are: off, polite (default) or assertive */
'aria-live'?: AriaAttributes['aria-live'];
/** Customise the messages used by the aria-live component */
ariaLiveMessages?: AriaLiveMessages<Option, IsMulti, Group>;
/** Focus the control when it is mounted */
autoFocus?: boolean;
/** Remove the currently focused option when the user presses backspace when Select isClearable or isMulti */
backspaceRemovesValue: boolean;
/** Remove focus from the input when the user selects an option (handy for dismissing the keyboard on touch devices) */
blurInputOnSelect: boolean;
/** When the user reaches the top/bottom of the menu, prevent scroll on the scroll-parent */
captureMenuScroll: boolean;
/** Sets a className attribute on the outer component */
className?: string;
/**
* If provided, all inner components will be given a prefixed className attribute.
*
* This is useful when styling via CSS classes instead of the Styles API approach.
*/
classNamePrefix?: string | null;
/**
* Provide classNames based on state for each inner component
*/
classNames: ClassNamesConfig<Option, IsMulti, Group>;
/** Close the select menu when the user selects an option */
closeMenuOnSelect: boolean;
/**
* If `true`, close the select menu when the user scrolls the document/body.
*
* If a function, takes a standard javascript `ScrollEvent` you return a boolean:
*
* `true` => The menu closes
*
* `false` => The menu stays open
*
* This is useful when you have a scrollable modal and want to portal the menu out,
* but want to avoid graphical issues.
*/
closeMenuOnScroll: boolean | ((event: Event) => boolean);
/**
* This complex object includes all the compositional components that are used
* in `react-select`. If you wish to overwrite a component, pass in an object
* with the appropriate namespace.
*
* If you only wish to restyle a component, we recommend using the `styles` prop
* instead. For a list of the components that can be passed in, and the shape
* that will be passed to them, see [the components docs](/components)
*/
components: SelectComponentsConfig<Option, IsMulti, Group>;
/** Whether the value of the select, e.g. SingleValue, should be displayed in the control. */
controlShouldRenderValue: boolean;
/** Delimiter used to join multiple values into a single HTML Input value */
delimiter?: string;
/** Clear all values when the user presses escape AND the menu is closed */
escapeClearsValue: boolean;
/** Custom method to filter whether an option should be displayed in the menu */
filterOption: ((option: FilterOptionOption<Option>, inputValue: string) => boolean) | null;
/**
* Formats group labels in the menu as React components
*
* An example can be found in the [Replacing builtins](/advanced#replacing-builtins) documentation.
*/
formatGroupLabel: (group: Group) => ReactNode;
/** Formats option labels in the menu and control as React components */
formatOptionLabel?: (data: Option, formatOptionLabelMeta: FormatOptionLabelMeta<Option>) => ReactNode;
/**
* Resolves option data to a string to be displayed as the label by components
*
* Note: Failure to resolve to a string type can interfere with filtering and
* screen reader support.
*/
getOptionLabel: GetOptionLabel<Option>;
/** Resolves option data to a string to compare options and specify value attributes */
getOptionValue: GetOptionValue<Option>;
/** Hide the selected option from the menu */
hideSelectedOptions?: boolean;
/** The id to set on the SelectContainer component. */
id?: string;
/** The value of the search input */
inputValue: string;
/** The id of the search input */
inputId?: string;
/** Define an id prefix for the select components e.g. {your-id}-value */
instanceId?: number | string;
/** Is the select value clearable */
isClearable?: boolean;
/** Is the select disabled */
isDisabled: boolean;
/** Is the select in a state of loading (async) */
isLoading: boolean;
/**
* Override the built-in logic to detect whether an option is disabled
*
* An example can be found in the [Replacing builtins](/advanced#replacing-builtins) documentation.
*/
isOptionDisabled: (option: Option, selectValue: Options<Option>) => boolean;
/** Override the built-in logic to detect whether an option is selected */
isOptionSelected?: (option: Option, selectValue: Options<Option>) => boolean;
/** Support multiple selected options */
isMulti: IsMulti;
/** Is the select direction right-to-left */
isRtl: boolean;
/** Whether to enable search functionality */
isSearchable: boolean;
/** Async: Text to display when loading options */
loadingMessage: (obj: {
inputValue: string;
}) => ReactNode;
/** Minimum height of the menu before flipping */
minMenuHeight: number;
/** Maximum height of the menu before scrolling */
maxMenuHeight: number;
/** Whether the menu is open */
menuIsOpen: boolean;
/**
* Default placement of the menu in relation to the control. 'auto' will flip
* when there isn't enough space below the control.
*/
menuPlacement: MenuPlacement;
/** The CSS position value of the menu, when "fixed" extra layout management is required */
menuPosition: MenuPosition;
/**
* Whether the menu should use a portal, and where it should attach
*
* An example can be found in the [Portaling](/advanced#portaling) documentation
*/
menuPortalTarget?: HTMLElement | null;
/** Whether to block scroll events when the menu is open */
menuShouldBlockScroll: boolean;
/** Whether the menu should be scrolled into view when it opens */
menuShouldScrollIntoView: boolean;
/** Name of the HTML Input (optional - without this, no input will be rendered) */
name?: string;
/** Text to display when there are no options */
noOptionsMessage: (obj: {
inputValue: string;
}) => ReactNode;
/** Handle blur events on the control */
onBlur?: FocusEventHandler<HTMLInputElement>;
/** Handle change events on the select */
onChange: (newValue: OnChangeValue<Option, IsMulti>, actionMeta: ActionMeta<Option>) => void;
/** Handle focus events on the control */
onFocus?: FocusEventHandler<HTMLInputElement>;
/** Handle change events on the input */
onInputChange: (newValue: string, actionMeta: InputActionMeta) => void;
/** Handle key down events on the select */
onKeyDown?: KeyboardEventHandler<HTMLDivElement>;
/** Handle the menu opening */
onMenuOpen: () => void;
/** Handle the menu closing */
onMenuClose: () => void;
/** Fired when the user scrolls to the top of the menu */
onMenuScrollToTop?: (event: WheelEvent | TouchEvent) => void;
/** Fired when the user scrolls to the bottom of the menu */
onMenuScrollToBottom?: (event: WheelEvent | TouchEvent) => void;
/** Allows control of whether the menu is opened when the Select is focused */
openMenuOnFocus: boolean;
/** Allows control of whether the menu is opened when the Select is clicked */
openMenuOnClick: boolean;
/** Array of options that populate the select menu */
options: OptionsOrGroups<Option, Group>;
/** Number of options to jump in menu when page{up|down} keys are used */
pageSize: number;
/** Placeholder for the select value */
placeholder: ReactNode;
/** Status to relay to screen readers */
screenReaderStatus: (obj: {
count: number;
}) => string;
/**
* Style modifier methods
*
* A basic example can be found at the bottom of the [Replacing builtins](/advanced#replacing-builtins) documentation.
*/
styles: StylesConfig<Option, IsMulti, Group>;
/** Theme modifier method */
theme?: ThemeConfig;
/** Sets the tabIndex attribute on the input */
tabIndex: number;
/** Select the currently focused option when the user presses tab */
tabSelectsValue: boolean;
/** Remove all non-essential styles */
unstyled: boolean;
/** The value of the select; reflected by the selected option */
value: PropsValue<Option>;
/** Sets the form attribute on the input */
form?: string;
/** Marks the value-holding input as required for form validation */
required?: boolean;
}
export declare const defaultProps: {
'aria-live': string;
backspaceRemovesValue: boolean;
blurInputOnSelect: boolean;
captureMenuScroll: boolean;
classNames: {};
closeMenuOnSelect: boolean;
closeMenuOnScroll: boolean;
components: {};
controlShouldRenderValue: boolean;
escapeClearsValue: boolean;
filterOption: (option: FilterOptionOption<unknown>, rawInput: string) => boolean;
formatGroupLabel: <Option, Group extends GroupBase<Option>>(group: Group) => string;
getOptionLabel: <Option_1>(option: Option_1) => string;
getOptionValue: <Option_2>(option: Option_2) => string;
isDisabled: boolean;
isLoading: boolean;
isMulti: boolean;
isRtl: boolean;
isSearchable: boolean;
isOptionDisabled: <Option_3>(option: Option_3) => boolean;
loadingMessage: () => string;
maxMenuHeight: number;
minMenuHeight: number;
menuIsOpen: boolean;
menuPlacement: string;
menuPosition: string;
menuShouldBlockScroll: boolean;
menuShouldScrollIntoView: boolean;
noOptionsMessage: () => string;
openMenuOnFocus: boolean;
openMenuOnClick: boolean;
options: never[];
pageSize: number;
placeholder: string;
screenReaderStatus: ({ count }: {
count: number;
}) => string;
styles: {};
tabIndex: number;
tabSelectsValue: boolean;
unstyled: boolean;
};
interface State<Option, IsMulti extends boolean, Group extends GroupBase<Option>> {
ariaSelection: AriaSelection<Option, IsMulti> | null;
inputIsHidden: boolean;
isFocused: boolean;
focusedOption: Option | null;
focusedOptionId: string | null;
focusableOptionsWithIds: FocusableOptionWithId<Option>[];
focusedValue: Option | null;
selectValue: Options<Option>;
clearFocusValueOnUpdate: boolean;
prevWasFocused: boolean;
inputIsHiddenAfterUpdate: boolean | null | undefined;
prevProps: Props<Option, IsMulti, Group> | void;
instancePrefix: string;
}
interface CategorizedOption<Option> {
type: 'option';
data: Option;
isDisabled: boolean;
isSelected: boolean;
label: string;
value: string;
index: number;
}
interface FocusableOptionWithId<Option> {
data: Option;
id: string;
}
interface CategorizedGroup<Option, Group extends GroupBase<Option>> {
type: 'group';
data: Group;
options: readonly CategorizedOption<Option>[];
index: number;
}
declare type CategorizedGroupOrOption<Option, Group extends GroupBase<Option>> = CategorizedGroup<Option, Group> | CategorizedOption<Option>;
export default class Select<Option = unknown, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>> extends Component<Props<Option, IsMulti, Group>, State<Option, IsMulti, Group>> {
static defaultProps: {
'aria-live': string;
backspaceRemovesValue: boolean;
blurInputOnSelect: boolean;
captureMenuScroll: boolean;
classNames: {};
closeMenuOnSelect: boolean;
closeMenuOnScroll: boolean;
components: {};
controlShouldRenderValue: boolean;
escapeClearsValue: boolean;
filterOption: (option: FilterOptionOption<unknown>, rawInput: string) => boolean;
formatGroupLabel: <Option_1, Group_1 extends GroupBase<Option_1>>(group: Group_1) => string;
getOptionLabel: <Option_2>(option: Option_2) => string;
getOptionValue: <Option_3>(option: Option_3) => string;
isDisabled: boolean;
isLoading: boolean;
isMulti: boolean;
isRtl: boolean;
isSearchable: boolean;
isOptionDisabled: <Option_4>(option: Option_4) => boolean;
loadingMessage: () => string;
maxMenuHeight: number;
minMenuHeight: number;
menuIsOpen: boolean;
menuPlacement: string;
menuPosition: string;
menuShouldBlockScroll: boolean;
menuShouldScrollIntoView: boolean;
noOptionsMessage: () => string;
openMenuOnFocus: boolean;
openMenuOnClick: boolean;
options: never[];
pageSize: number;
placeholder: string;
screenReaderStatus: ({ count }: {
count: number;
}) => string;
styles: {};
tabIndex: number;
tabSelectsValue: boolean;
unstyled: boolean;
};
state: State<Option, IsMulti, Group>;
blockOptionHover: boolean;
isComposing: boolean;
commonProps: any;
initialTouchX: number;
initialTouchY: number;
openAfterFocus: boolean;
scrollToFocusedOptionOnUpdate: boolean;
userIsDragging?: boolean;
isAppleDevice: boolean;
controlRef: HTMLDivElement | null;
getControlRef: RefCallback<HTMLDivElement>;
focusedOptionRef: HTMLDivElement | null;
getFocusedOptionRef: RefCallback<HTMLDivElement>;
menuListRef: HTMLDivElement | null;
getMenuListRef: RefCallback<HTMLDivElement>;
inputRef: HTMLInputElement | null;
getInputRef: RefCallback<HTMLInputElement>;
constructor(props: Props<Option, IsMulti, Group>);
static getDerivedStateFromProps(props: Props<unknown, boolean, GroupBase<unknown>>, state: State<unknown, boolean, GroupBase<unknown>>): {
prevProps: Props<unknown, boolean, GroupBase<unknown>>;
ariaSelection: AriaSelection<unknown, boolean> | null;
prevWasFocused: boolean;
inputIsHidden: boolean;
inputIsHiddenAfterUpdate: undefined;
} | {
prevProps: Props<unknown, boolean, GroupBase<unknown>>;
ariaSelection: AriaSelection<unknown, boolean> | null;
prevWasFocused: boolean;
inputIsHidden?: undefined;
inputIsHiddenAfterUpdate?: undefined;
};
componentDidMount(): void;
componentDidUpdate(prevProps: Props<Option, IsMulti, Group>): void;
componentWillUnmount(): void;
onMenuOpen(): void;
onMenuClose(): void;
onInputChange(newValue: string, actionMeta: InputActionMeta): void;
focusInput(): void;
blurInput(): void;
focus: () => void;
blur: () => void;
openMenu(focusOption: 'first' | 'last'): void;
focusValue(direction: 'previous' | 'next'): void;
focusOption(direction?: FocusDirection): void;
onChange: (newValue: OnChangeValue<Option, IsMulti>, actionMeta: ActionMeta<Option>) => void;
setValue: (newValue: OnChangeValue<Option, IsMulti>, action: SetValueAction, option?: Option | undefined) => void;
selectOption: (newValue: Option) => void;
removeValue: (removedValue: Option) => void;
clearValue: () => void;
popValue: () => void;
getTheme(): import("./types").Theme;
getFocusedOptionId: (focusedOption: Option) => string | null;
getFocusableOptionsWithIds: () => FocusableOptionWithId<Option>[];
getValue: () => Options<Option>;
cx: (...args: any) => string;
getCommonProps(): {
clearValue: () => void;
cx: (...args: any) => string;
getStyles: <Key extends keyof StylesProps<Option, IsMulti, Group>>(key: Key, props: StylesProps<Option, IsMulti, Group>[Key]) => import("./types").CSSObjectWithLabel;
getClassNames: <Key_1 extends keyof StylesProps<Option, IsMulti, Group>>(key: Key_1, props: StylesProps<Option, IsMulti, Group>[Key_1]) => string | undefined;
getValue: () => Options<Option>;
hasValue: boolean;
isMulti: IsMulti;
isRtl: boolean;
options: OptionsOrGroups<Option, Group>;
selectOption: (newValue: Option) => void;
selectProps: Readonly<Props<Option, IsMulti, Group>> & Readonly<{
children?: React.ReactNode;
}>;
setValue: (newValue: OnChangeValue<Option, IsMulti>, action: SetValueAction, option?: Option | undefined) => void;
theme: import("./types").Theme;
};
getOptionLabel: (data: Option) => string;
getOptionValue: (data: Option) => string;
getStyles: <Key extends keyof StylesProps<Option, IsMulti, Group>>(key: Key, props: StylesProps<Option, IsMulti, Group>[Key]) => import("./types").CSSObjectWithLabel;
getClassNames: <Key extends keyof StylesProps<Option, IsMulti, Group>>(key: Key, props: StylesProps<Option, IsMulti, Group>[Key]) => string | undefined;
getElementId: (element: 'group' | 'input' | 'listbox' | 'option' | 'placeholder' | 'live-region') => string;
getComponents: () => {
ClearIndicator: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>(props: import(".").ClearIndicatorProps<Option_1, IsMulti_1, Group_1>) => import("@emotion/react").jsx.JSX.Element;
Control: <Option_2, IsMulti_2 extends boolean, Group_2 extends GroupBase<Option_2>>(props: import(".").ControlProps<Option_2, IsMulti_2, Group_2>) => import("@emotion/react").jsx.JSX.Element;
DropdownIndicator: <Option_3, IsMulti_3 extends boolean, Group_3 extends GroupBase<Option_3>>(props: import(".").DropdownIndicatorProps<Option_3, IsMulti_3, Group_3>) => import("@emotion/react").jsx.JSX.Element;
DownChevron: (props: import("./components/indicators").DownChevronProps) => import("@emotion/react").jsx.JSX.Element;
CrossIcon: (props: import("./components/indicators").CrossIconProps) => import("@emotion/react").jsx.JSX.Element;
Group: <Option_4, IsMulti_4 extends boolean, Group_4 extends GroupBase<Option_4>>(props: import(".").GroupProps<Option_4, IsMulti_4, Group_4>) => import("@emotion/react").jsx.JSX.Element;
GroupHeading: <Option_5, IsMulti_5 extends boolean, Group_5 extends GroupBase<Option_5>>(props: import(".").GroupHeadingProps<Option_5, IsMulti_5, Group_5>) => import("@emotion/react").jsx.JSX.Element;
IndicatorsContainer: <Option_6, IsMulti_6 extends boolean, Group_6 extends GroupBase<Option_6>>(props: import(".").IndicatorsContainerProps<Option_6, IsMulti_6, Group_6>) => import("@emotion/react").jsx.JSX.Element;
IndicatorSeparator: <Option_7, IsMulti_7 extends boolean, Group_7 extends GroupBase<Option_7>>(props: import(".").IndicatorSeparatorProps<Option_7, IsMulti_7, Group_7>) => import("@emotion/react").jsx.JSX.Element;
Input: <Option_8, IsMulti_8 extends boolean, Group_8 extends GroupBase<Option_8>>(props: import(".").InputProps<Option_8, IsMulti_8, Group_8>) => import("@emotion/react").jsx.JSX.Element;
LoadingIndicator: <Option_9, IsMulti_9 extends boolean, Group_9 extends GroupBase<Option_9>>({ innerProps, isRtl, size, ...restProps }: import(".").LoadingIndicatorProps<Option_9, IsMulti_9, Group_9>) => import("@emotion/react").jsx.JSX.Element;
Menu: <Option_10, IsMulti_10 extends boolean, Group_10 extends GroupBase<Option_10>>(props: import("./components/Menu").MenuProps<Option_10, IsMulti_10, Group_10>) => import("@emotion/react").jsx.JSX.Element;
MenuList: <Option_11, IsMulti_11 extends boolean, Group_11 extends GroupBase<Option_11>>(props: import("./components/Menu").MenuListProps<Option_11, IsMulti_11, Group_11>) => import("@emotion/react").jsx.JSX.Element;
MenuPortal: <Option_12, IsMulti_12 extends boolean, Group_12 extends GroupBase<Option_12>>(props: import("./components/Menu").MenuPortalProps<Option_12, IsMulti_12, Group_12>) => import("@emotion/react").jsx.JSX.Element | null;
LoadingMessage: <Option_13, IsMulti_13 extends boolean, Group_13 extends GroupBase<Option_13>>({ children, innerProps, ...restProps }: import("./components/Menu").NoticeProps<Option_13, IsMulti_13, Group_13>) => import("@emotion/react").jsx.JSX.Element;
NoOptionsMessage: <Option_14, IsMulti_14 extends boolean, Group_14 extends GroupBase<Option_14>>({ children, innerProps, ...restProps }: import("./components/Menu").NoticeProps<Option_14, IsMulti_14, Group_14>) => import("@emotion/react").jsx.JSX.Element;
MultiValue: <Option_15, IsMulti_15 extends boolean, Group_15 extends GroupBase<Option_15>>(props: import(".").MultiValueProps<Option_15, IsMulti_15, Group_15>) => import("@emotion/react").jsx.JSX.Element;
MultiValueContainer: <Option_16, IsMulti_16 extends boolean, Group_16 extends GroupBase<Option_16>>({ children, innerProps, }: import(".").MultiValueGenericProps<Option_16, IsMulti_16, Group_16>) => import("@emotion/react").jsx.JSX.Element;
MultiValueLabel: <Option_16, IsMulti_16 extends boolean, Group_16 extends GroupBase<Option_16>>({ children, innerProps, }: import(".").MultiValueGenericProps<Option_16, IsMulti_16, Group_16>) => import("@emotion/react").jsx.JSX.Element;
MultiValueRemove: typeof import("./components/MultiValue").MultiValueRemove;
Option: <Option_17, IsMulti_17 extends boolean, Group_17 extends GroupBase<Option_17>>(props: import(".").OptionProps<Option_17, IsMulti_17, Group_17>) => import("@emotion/react").jsx.JSX.Element;
Placeholder: <Option_18, IsMulti_18 extends boolean, Group_18 extends GroupBase<Option_18>>(props: import(".").PlaceholderProps<Option_18, IsMulti_18, Group_18>) => import("@emotion/react").jsx.JSX.Element;
SelectContainer: <Option_19, IsMulti_19 extends boolean, Group_19 extends GroupBase<Option_19>>(props: import(".").ContainerProps<Option_19, IsMulti_19, Group_19>) => import("@emotion/react").jsx.JSX.Element;
SingleValue: <Option_20, IsMulti_20 extends boolean, Group_20 extends GroupBase<Option_20>>(props: import(".").SingleValueProps<Option_20, IsMulti_20, Group_20>) => import("@emotion/react").jsx.JSX.Element;
ValueContainer: <Option_21, IsMulti_21 extends boolean, Group_21 extends GroupBase<Option_21>>(props: import(".").ValueContainerProps<Option_21, IsMulti_21, Group_21>) => import("@emotion/react").jsx.JSX.Element;
};
buildCategorizedOptions: () => CategorizedGroupOrOption<Option, Group>[];
getCategorizedOptions: () => CategorizedGroupOrOption<Option, Group>[];
buildFocusableOptions: () => Option[];
getFocusableOptions: () => Option[];
ariaOnChange: (value: OnChangeValue<Option, IsMulti>, actionMeta: ActionMeta<Option>) => void;
hasValue(): boolean;
hasOptions(): boolean;
isClearable(): boolean;
isOptionDisabled(option: Option, selectValue: Options<Option>): boolean;
isOptionSelected(option: Option, selectValue: Options<Option>): boolean;
filterOption(option: FilterOptionOption<Option>, inputValue: string): boolean;
formatOptionLabel(data: Option, context: FormatOptionLabelContext): ReactNode;
formatGroupLabel(data: Group): React.ReactNode;
onMenuMouseDown: MouseEventHandler<HTMLDivElement>;
onMenuMouseMove: MouseEventHandler<HTMLDivElement>;
onControlMouseDown: (event: React.MouseEvent<HTMLDivElement> | React.TouchEvent<HTMLDivElement>) => void;
onDropdownIndicatorMouseDown: (event: React.MouseEvent<HTMLDivElement> | React.TouchEvent<HTMLDivElement>) => void;
onClearIndicatorMouseDown: (event: React.MouseEvent<HTMLDivElement> | React.TouchEvent<HTMLDivElement>) => void;
onScroll: (event: Event) => void;
startListeningComposition(): void;
stopListeningComposition(): void;
onCompositionStart: () => void;
onCompositionEnd: () => void;
startListeningToTouch(): void;
stopListeningToTouch(): void;
onTouchStart: ({ touches }: TouchEvent) => void;
onTouchMove: ({ touches }: TouchEvent) => void;
onTouchEnd: (event: TouchEvent) => void;
onControlTouchEnd: TouchEventHandler<HTMLDivElement>;
onClearIndicatorTouchEnd: TouchEventHandler<HTMLDivElement>;
onDropdownIndicatorTouchEnd: TouchEventHandler<HTMLDivElement>;
handleInputChange: FormEventHandler<HTMLInputElement>;
onInputFocus: FocusEventHandler<HTMLInputElement>;
onInputBlur: FocusEventHandler<HTMLInputElement>;
onOptionHover: (focusedOption: Option) => void;
shouldHideSelectedOptions: () => boolean | IsMulti;
onValueInputFocus: FocusEventHandler;
onKeyDown: KeyboardEventHandler<HTMLDivElement>;
renderInput(): JSX.Element;
renderPlaceholderOrValue(): JSX.Element | JSX.Element[] | null;
renderClearIndicator(): JSX.Element | null;
renderLoadingIndicator(): JSX.Element | null;
renderIndicatorSeparator(): JSX.Element | null;
renderDropdownIndicator(): JSX.Element | null;
renderMenu(): JSX.Element | null;
renderFormField(): JSX.Element | undefined;
renderLiveRegion(): JSX.Element;
render(): JSX.Element;
}
export declare type PublicBaseSelectProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>> = JSX.LibraryManagedAttributes<typeof Select, Props<Option, IsMulti, Group>>;
export {};

View File

@@ -0,0 +1,13 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const util_1 = require("../../compile/util");
const def = {
keyword: ["then", "else"],
schemaType: ["object", "boolean"],
code({ keyword, parentSchema, it }) {
if (parentSchema.if === undefined)
(0, util_1.checkStrictMode)(it, `"${keyword}" without "if" is ignored`);
},
};
exports.default = def;
//# sourceMappingURL=thenElse.js.map

View File

@@ -0,0 +1,2 @@
export { growthbookIntegration } from './integration';
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,3 @@
export * from "../../dist/declarations/src/async/index";
export { default } from "../../dist/declarations/src/async/index";
//# sourceMappingURL=react-select-async.cjs.d.ts.map

View File

@@ -0,0 +1,70 @@
"use strict";
exports.areIntervalsOverlapping = areIntervalsOverlapping;
var _index = require("./toDate.cjs");
/**
* The {@link areIntervalsOverlapping} function options.
*/
/**
* @name areIntervalsOverlapping
* @category Interval Helpers
* @summary Is the given time interval overlapping with another time interval?
*
* @description
* Is the given time interval overlapping with another time interval? Adjacent intervals do not count as overlapping unless `inclusive` is set to `true`.
*
* @param intervalLeft - The first interval to compare.
* @param intervalRight - The second interval to compare.
* @param options - The object with options
*
* @returns Whether the time intervals are overlapping
*
* @example
* // For overlapping time intervals:
* areIntervalsOverlapping(
* { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
* { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) }
* )
* //=> true
*
* @example
* // For non-overlapping time intervals:
* areIntervalsOverlapping(
* { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
* { start: new Date(2014, 0, 21), end: new Date(2014, 0, 22) }
* )
* //=> false
*
* @example
* // For adjacent time intervals:
* areIntervalsOverlapping(
* { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
* { start: new Date(2014, 0, 20), end: new Date(2014, 0, 30) }
* )
* //=> false
*
* @example
* // Using the inclusive option:
* areIntervalsOverlapping(
* { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
* { start: new Date(2014, 0, 20), end: new Date(2014, 0, 24) },
* { inclusive: true }
* )
* //=> true
*/
function areIntervalsOverlapping(intervalLeft, intervalRight, options) {
const [leftStartTime, leftEndTime] = [
+(0, _index.toDate)(intervalLeft.start, options?.in),
+(0, _index.toDate)(intervalLeft.end, options?.in),
].sort((a, b) => a - b);
const [rightStartTime, rightEndTime] = [
+(0, _index.toDate)(intervalRight.start, options?.in),
+(0, _index.toDate)(intervalRight.end, options?.in),
].sort((a, b) => a - b);
if (options?.inclusive)
return leftStartTime <= rightEndTime && rightStartTime <= leftEndTime;
return leftStartTime < rightEndTime && rightStartTime < leftEndTime;
}

View File

@@ -0,0 +1,34 @@
import { isLeapYear } from "./isLeapYear.mjs";
import { toDate } from "./toDate.mjs";
/**
* @name getDaysInYear
* @category Year Helpers
* @summary Get the number of days in a year of the given date.
*
* @description
* Get the number of days in a year of the given date.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The given date
*
* @returns The number of days in a year
*
* @example
* // How many days are in 2012?
* const result = getDaysInYear(new Date(2012, 0, 1))
* //=> 366
*/
export function getDaysInYear(date) {
const _date = toDate(date);
if (String(new Date(_date)) === "Invalid Date") {
return NaN;
}
return isLeapYear(_date) ? 366 : 365;
}
// Fallback for modularized imports:
export default getDaysInYear;

View File

@@ -0,0 +1,44 @@
Prism.languages.kusto = {
'comment': {
pattern: /\/\/.*/,
greedy: true
},
'string': {
pattern: /```[\s\S]*?```|[hH]?(?:"(?:[^\r\n\\"]|\\.)*"|'(?:[^\r\n\\']|\\.)*'|@(?:"[^\r\n"]*"|'[^\r\n']*'))/,
greedy: true
},
'verb': {
pattern: /(\|\s*)[a-z][\w-]*/i,
lookbehind: true,
alias: 'keyword'
},
'command': {
pattern: /\.[a-z][a-z\d-]*\b/,
alias: 'keyword'
},
'class-name': /\b(?:bool|datetime|decimal|dynamic|guid|int|long|real|string|timespan)\b/,
'keyword': /\b(?:access|alias|and|anti|as|asc|auto|between|by|(?:contains|(?:ends|starts)with|has(?:perfix|suffix)?)(?:_cs)?|database|declare|desc|external|from|fullouter|has_all|in|ingestion|inline|inner|innerunique|into|(?:left|right)(?:anti(?:semi)?|inner|outer|semi)?|let|like|local|not|of|on|or|pattern|print|query_parameters|range|restrict|schema|set|step|table|tables|to|view|where|with|matches\s+regex|nulls\s+(?:first|last))(?![\w-])/,
'boolean': /\b(?:false|null|true)\b/,
'function': /\b[a-z_]\w*(?=\s*\()/,
'datetime': [
{
// RFC 822 + RFC 850
pattern: /\b(?:(?:Fri|Friday|Mon|Monday|Sat|Saturday|Sun|Sunday|Thu|Thursday|Tue|Tuesday|Wed|Wednesday)\s*,\s*)?\d{1,2}(?:\s+|-)(?:Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)(?:\s+|-)\d{2}\s+\d{2}:\d{2}(?::\d{2})?(?:\s*(?:\b(?:[A-Z]|(?:[ECMT][DS]|GM|U)T)|[+-]\d{4}))?\b/,
alias: 'number'
},
{
// ISO 8601
pattern: /[+-]?\b(?:\d{4}-\d{2}-\d{2}(?:[ T]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?)?|\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?)Z?/,
alias: 'number'
}
],
'number': /\b(?:0x[0-9A-Fa-f]+|\d+(?:\.\d+)?(?:[Ee][+-]?\d+)?)(?:(?:min|sec|[mnµ]s|[dhms]|microsecond|tick)\b)?|[+-]?\binf\b/,
'operator': /=>|[!=]~|[!=<>]=?|[-+*/%|]|\.\./,
'punctuation': /[()\[\]{},;.:]/
};

View File

@@ -0,0 +1,153 @@
import { execSync } from 'child_process';
import ciInfo from 'ci-info';
import { randomBytes } from 'crypto';
import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';
import { findUp } from '../findUp.js';
import { Conf } from './conf/index.js';
import { oneWayHash } from './oneWayHash.js';
let baseEvent = null;
export const sendEvent = async ({ event, payload })=>{
try {
if (payload.config.telemetry !== false) {
const { packageJSON, packageJSONPath } = await getPackageJSON();
// Only generate the base event once
if (!baseEvent) {
const { projectID, source: projectIDSource } = getProjectID(payload, packageJSON);
baseEvent = {
ciName: ciInfo.isCI ? ciInfo.name : null,
envID: getEnvID(),
isCI: ciInfo.isCI,
nodeEnv: process.env.NODE_ENV || 'development',
nodeVersion: process.version,
payloadVersion: getPayloadVersion(packageJSON),
projectID,
projectIDSource,
...getLocalizationInfo(payload),
dbAdapter: payload.db.name,
emailAdapter: payload.email?.name || null,
uploadAdapters: payload.config.upload.adapters
};
}
if (process.env.PAYLOAD_TELEMETRY_DEBUG) {
payload.logger.info({
event: {
...baseEvent,
...event,
packageJSONPath
},
msg: 'Telemetry Event'
});
return;
}
await fetch('https://telemetry.payloadcms.com/events', {
body: JSON.stringify({
...baseEvent,
...event
}),
headers: {
'Content-Type': 'application/json'
},
method: 'post'
});
}
} catch (_) {
// Eat any errors in sending telemetry event
}
};
/**
* This is a quasi-persistent identifier used to dedupe recurring events. It's
* generated from random data and completely anonymous.
*/ const getEnvID = ()=>{
const conf = new Conf();
const ENV_ID = 'envID';
const val = conf.get(ENV_ID);
if (val) {
return val;
}
const generated = randomBytes(32).toString('hex');
conf.set(ENV_ID, generated);
return generated;
};
const getProjectID = (payload, packageJSON)=>{
const gitID = getGitID(payload);
if (gitID) {
return {
projectID: oneWayHash(gitID, payload.secret),
source: 'git'
};
}
const packageJSONID = getPackageJSONID(payload, packageJSON);
if (packageJSONID) {
return {
projectID: oneWayHash(packageJSONID, payload.secret),
source: 'packageJSON'
};
}
const serverURL = payload.config.serverURL;
if (serverURL) {
return {
projectID: oneWayHash(serverURL, payload.secret),
source: 'serverURL'
};
}
const cwd = process.cwd();
return {
projectID: oneWayHash(cwd, payload.secret),
source: 'cwd'
};
};
const getGitID = (payload)=>{
try {
const originBuffer = execSync('git config --local --get remote.origin.url', {
stdio: 'pipe',
timeout: 1000
});
return oneWayHash(String(originBuffer).trim(), payload.secret);
} catch (_) {
return null;
}
};
const getPackageJSON = async ()=>{
let packageJSONPath = path.resolve(process.cwd(), 'package.json');
if (!fs.existsSync(packageJSONPath)) {
// Old logic
const filename = fileURLToPath(import.meta.url);
const dirname = path.dirname(filename);
packageJSONPath = await findUp({
dir: dirname,
fileNames: [
'package.json'
]
});
}
const jsonContentString = await fs.promises.readFile(packageJSONPath, 'utf-8');
const jsonContent = JSON.parse(jsonContentString);
return {
packageJSON: jsonContent,
packageJSONPath
};
};
const getPackageJSONID = (payload, packageJSON)=>{
return oneWayHash(packageJSON.name, payload.secret);
};
export const getPayloadVersion = (packageJSON)=>{
return packageJSON?.dependencies?.payload ?? '';
};
export const getLocalizationInfo = (payload)=>{
if (!payload.config.localization) {
return {
locales: [],
localizationDefaultLocale: null,
localizationEnabled: false
};
}
return {
locales: payload.config.localization.localeCodes,
localizationDefaultLocale: payload.config.localization.defaultLocale,
localizationEnabled: true
};
};
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,581 @@
import type { CaptureContext } from '../scope';
import type { Breadcrumb, BreadcrumbHint } from './breadcrumb';
import type { ErrorEvent, EventHint, TransactionEvent } from './event';
import type { Integration } from './integration';
import type { Log } from './log';
import type { Metric } from './metric';
import type { TracesSamplerSamplingContext } from './samplingcontext';
import type { SdkMetadata } from './sdkmetadata';
import type { SpanJSON } from './span';
import type { StackLineParser, StackParser } from './stacktrace';
import type { TracePropagationTargets } from './tracing';
import type { BaseTransportOptions, Transport } from './transport';
/**
* Base options for WinterTC-compatible server-side JavaScript runtimes.
* This interface contains common configuration options shared between
* SDKs.
*/
export interface ServerRuntimeOptions {
/**
* List of strings/regex controlling to which outgoing requests
* the SDK will attach tracing headers.
*
* By default the SDK will attach those headers to all outgoing
* requests. If this option is provided, the SDK will match the
* request URL of outgoing requests against the items in this
* array, and only attach tracing headers if a match was found.
*
* @example
* ```js
* Sentry.init({
* tracePropagationTargets: ['api.site.com'],
* });
* ```
*/
tracePropagationTargets?: TracePropagationTargets;
/**
* Sets an optional server name (device name).
*
* This is useful for identifying which server or instance is sending events.
*/
serverName?: string;
/**
* If you use Spotlight by Sentry during development, use
* this option to forward captured Sentry events to Spotlight.
*
* Either set it to true, or provide a specific Spotlight Sidecar URL.
*
* More details: https://spotlightjs.com/
*
* IMPORTANT: Only set this option to `true` while developing, not in production!
*/
spotlight?: boolean | string;
/**
* If set to `false`, the SDK will not automatically detect the `serverName`.
*
* This is useful if you are using the SDK in a CLI app or Electron where the
* hostname might be considered PII.
*
* @default true
*/
includeServerName?: boolean;
/**
* By default, the SDK will try to identify problems with your instrumentation setup and warn you about it.
* If you want to disable these warnings, set this to `true`.
*/
disableInstrumentationWarnings?: boolean;
/**
* Controls how many milliseconds to wait before shutting down. The default is 2 seconds. Setting this too low can cause
* problems for sending events from command line applications. Setting it too
* high can cause the application to block for users with network connectivity
* problems.
*/
shutdownTimeout?: number;
/**
* Configures in which interval client reports will be flushed. Defaults to `60_000` (milliseconds).
*/
clientReportFlushInterval?: number;
/**
* The max. duration in seconds that the SDK will wait for parent spans to be finished before discarding a span.
* The SDK will automatically clean up spans that have no finished parent after this duration.
* This is necessary to prevent memory leaks in case of parent spans that are never finished or otherwise dropped/missing.
* However, if you have very long-running spans in your application, a shorter duration might cause spans to be discarded too early.
* In this case, you can increase this duration to a value that fits your expected data.
*
* Defaults to 300 seconds (5 minutes).
*/
maxSpanWaitDuration?: number;
/**
* Callback that is executed when a fatal global error occurs.
*/
onFatalError?(this: void, error: Error): void;
}
/**
* A filter object for ignoring spans.
* At least one of the properties (`op` or `name`) must be set.
*/
type IgnoreSpanFilter = {
/**
* Spans with a name matching this pattern will be ignored.
*/
name: string | RegExp;
/**
* Spans with an op matching this pattern will be ignored.
*/
op?: string | RegExp;
} | {
/**
* Spans with a name matching this pattern will be ignored.
*/
name?: string | RegExp;
/**
* Spans with an op matching this pattern will be ignored.
*/
op: string | RegExp;
};
export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOptions> {
/**
* Enable debug functionality in the SDK itself. If `debug` is set to `true` the SDK will attempt
* to print out useful debugging information about what the SDK is doing.
*
* @default false
*/
debug?: boolean;
/**
* Specifies whether this SDK should send events to Sentry. Setting this to `enabled: false`
* doesn't prevent all overhead from Sentry instrumentation. To disable Sentry completely,
* depending on environment, call `Sentry.init conditionally.
*
* @default true
*/
enabled?: boolean;
/**
* When enabled, stack traces are automatically attached to all events captured with `Sentry.captureMessage`.
*
* Grouping in Sentry is different for events with stack traces and without. As a result, you will get
* new groups as you enable or disable this flag for certain events.
*
* @default false
*/
attachStacktrace?: boolean;
/**
* Send SDK Client Reports, which are used to emit outcomes about events that the SDK dropped
* or failed to capture.
*
* @default true
*/
sendClientReports?: boolean;
/**
* The DSN tells the SDK where to send the events. If this is not set, the SDK will not send any events to Sentry.
*
* @default undefined
*/
dsn?: string | undefined;
/**
* Sets the release. Release names are strings, but some formats are detected by Sentry and might be
* rendered differently. Learn more about how to send release data so Sentry can tell you about
* regressions between releases and identify the potential source in the
* [releases documentation](https://docs.sentry.io/product/releases/)
*
* @default undefined
*/
release?: string | undefined;
/**
* The current environment of your application (e.g. "production").
*
* Environments are case-sensitive. The environment name can't contain newlines, spaces or forward slashes,
* can't be the string "None", or exceed 64 characters. You can't delete environments, but you can hide them.
*
* @default "production"
*/
environment?: string | undefined;
/**
* Sets the distribution of the application. Distributions are used to disambiguate build or
* deployment variants of the same release of an application.
*
* @default undefined
*/
dist?: string | undefined;
/**
* List of integrations that should be installed after SDK was initialized.
*
* @default []
*/
integrations: Integration[];
/**
* A function that takes transport options and returns the Transport object which is used to send events to Sentry.
* The function is invoked internally when the client is initialized.
*/
transport: (transportOptions: TO) => Transport;
/**
* A stack parser implementation. By default, a stack parser is supplied for all supported platforms.
*/
stackParser: StackParser;
/**
* Options for the default transport that the SDK uses.
*/
transportOptions?: Partial<TO>;
/**
* Sample rate to determine trace sampling.
*
* 0.0 = 0% chance of a given trace being sent (send no traces) 1.0 = 100% chance of a given trace being sent (send
* all traces).
*
* Tracing is enabled if either this or `tracesSampler` is defined. If both are defined, `tracesSampleRate` is
* ignored. Set this and `tracesSampler` to `undefined` to disable tracing.
*
* @default undefined
*/
tracesSampleRate?: number;
/**
* If this is enabled, any spans started will always have their parent be the active root span,
* if there is any active span.
*
* This is necessary because in some environments (e.g. browser),
* we cannot guarantee an accurate active span.
* Because we cannot properly isolate execution environments,
* you may get wrong results when using e.g. nested `startSpan()` calls.
*
* To solve this, in these environments we'll by default enable this option.
*/
parentSpanIsAlwaysRootSpan?: boolean;
/**
* Initial data to populate scope.
*
* @default undefined
*/
initialScope?: CaptureContext;
/**
* The maximum number of breadcrumbs sent with events.
* Sentry has a maximum payload size of 1MB and any events exceeding that payload size will be dropped.
*
* @default 100
*/
maxBreadcrumbs?: number;
/**
* A global sample rate to apply to all error events.
*
* 0.0 = 0% chance of a given event being sent (send no events) 1.0 = 100% chance of a given event being sent (send
* all events)
*
* @default 1.0
*/
sampleRate?: number;
/**
* Maximum number of chars a single value can have before it will be truncated.
*/
maxValueLength?: number;
/**
* Maximum number of levels that normalization algorithm will traverse in objects and arrays.
* Used when normalizing an event before sending, on all of the listed attributes:
* - `breadcrumbs.data`
* - `user`
* - `contexts`
* - `extra`
*
* @default 3
*/
normalizeDepth?: number;
/**
* Maximum number of properties or elements that the normalization algorithm will output in any single array or object included in the normalized event.
* Used when normalizing an event before sending, on all of the listed attributes:
* - `breadcrumbs.data`
* - `user`
* - `contexts`
* - `extra`
*
* @default 1000
*/
normalizeMaxBreadth?: number;
/**
* A pattern for error messages which should not be sent to Sentry.
* By default, all errors will be sent.
*
* Behavior of the `ignoreErrors` option is controlled by the `Sentry.eventFiltersIntegration` integration. If the
* event filters integration is not installed, the `ignoreErrors` option will not have any effect.
*
* @default []
*/
ignoreErrors?: Array<string | RegExp>;
/**
* A pattern for transaction names which should not be sent to Sentry.
* By default, all transactions will be sent.
*
* Behavior of the `ignoreTransactions` option is controlled by the `Sentry.eventFiltersIntegration` integration.
* If the event filters integration is not installed, the `ignoreTransactions` option will not have any effect.
*
* @default []
*/
ignoreTransactions?: Array<string | RegExp>;
/**
* A list of span names or patterns to ignore.
*
* If you specify a pattern {@link IgnoreSpanFilter}, at least one
* of the properties (`op` or `name`) must be set.
*
* @default []
*/
ignoreSpans?: (string | RegExp | IgnoreSpanFilter)[];
/**
* A URL to an envelope tunnel endpoint. An envelope tunnel is an HTTP endpoint
* that accepts Sentry envelopes for forwarding. This can be used to force data
* through a custom server independent of the type of data.
*
* @default undefined
*/
tunnel?: string;
/**
* Controls if potentially sensitive data should be sent to Sentry by default.
* Note that this only applies to data that the SDK is sending by default
* but not data that was explicitly set (e.g. by calling `Sentry.setUser()`).
*
* @default false
*
* NOTE: This option currently controls only a few data points in a selected
* set of SDKs. The goal for this option is to eventually control all sensitive
* data the SDK sets by default. However, this would be a breaking change so
* until the next major update this option only controls data points which were
* added in versions above `7.9.0`.
*/
sendDefaultPii?: boolean;
/**
* Controls whether and how to enhance fetch error messages by appending the request hostname.
* Generic fetch errors like "Failed to fetch" will be enhanced to include the hostname
* (e.g., "Failed to fetch (example.com)").
*
* - `'always'` (default): Modifies the actual error message directly. This may break third-party packages
* that rely on exact message matching (e.g., is-network-error, p-retry).
* - `'report-only'`: Only enhances the message when sending to Sentry. The original error
* message remains unchanged, preserving compatibility with third-party packages.
* - `false`: Disables hostname enhancement completely.
*
* @default 'always'
*/
enhanceFetchErrorMessages?: 'always' | 'report-only' | false;
/**
* Set of metadata about the SDK that can be internally used to enhance envelopes and events,
* and provide additional data about every request.
*
* @internal This option is not part of the public API and is subject to change at any time.
*/
_metadata?: SdkMetadata;
/**
* Options which are in beta, or otherwise not guaranteed to be stable.
*/
_experiments?: {
[key: string]: any;
/**
* If metrics support should be enabled.
*
* @default false
* @experimental
* @deprecated Use the top level`enableMetrics` option instead.
*/
enableMetrics?: boolean;
/**
* An event-processing callback for metrics, guaranteed to be invoked after all other metric
* processors. This allows a metric to be modified or dropped before it's sent.
*
* Note that you must return a valid metric from this callback. If you do not wish to modify the metric, simply return
* it at the end. Returning `null` will cause the metric to be dropped.
*
* @default undefined
* @experimental
*
* @param metric The metric generated by the SDK.
* @returns A new metric that will be sent | null.
* @deprecated Use the top level`beforeSendMetric` option instead.
*/
beforeSendMetric?: (metric: Metric) => Metric | null;
/**
* Determines if logs support should be enabled.
*
* @default false
* @deprecated Use the top level `enableLogs` option instead.
*/
enableLogs?: boolean;
};
/**
* A pattern for error URLs which should exclusively be sent to Sentry.
* This is the opposite of {@link CoreOptions.denyUrls}.
* By default, all errors will be sent.
*
* Behavior of the `allowUrls` option is controlled by the `Sentry.eventFiltersIntegration` integration.
* If the event filters integration is not installed, the `allowUrls` option will not have any effect.
*
* @default []
*/
allowUrls?: Array<string | RegExp>;
/**
* A pattern for error URLs which should not be sent to Sentry.
* To allow certain errors instead, use {@link CoreOptions.allowUrls}.
* By default, all errors will be sent.
*
* Behavior of the `denyUrls` option is controlled by the `Sentry.eventFiltersIntegration` integration.
* If the event filters integration is not installed, the `denyUrls` option will not have any effect.
*
* @default []
*/
denyUrls?: Array<string | RegExp>;
/**
* List of strings and/or Regular Expressions used to determine which outgoing requests will have `sentry-trace` and `baggage`
* headers attached.
*
* **Default:** If this option is not provided, tracing headers will be attached to all outgoing requests.
* If you are using a browser SDK, by default, tracing headers will only be attached to outgoing requests to the same origin.
*
* **Disclaimer:** Carelessly setting this option in browser environments may result into CORS errors!
* Only attach tracing headers to requests to the same origin, or to requests to services you can control CORS headers of.
* Cross-origin requests, meaning requests to a different domain, for example a request to `https://api.example.com/` while you're on `https://example.com/`, take special care.
* If you are attaching headers to cross-origin requests, make sure the backend handling the request returns a `"Access-Control-Allow-Headers: sentry-trace, baggage"` header to ensure your requests aren't blocked.
*
* If you provide a `tracePropagationTargets` array, the entries you provide will be matched against the entire URL of the outgoing request.
* If you are using a browser SDK, the entries will also be matched against the pathname of the outgoing requests.
* This is so you can have matchers for relative requests, for example, `/^\/api/` if you want to trace requests to your `/api` routes on the same domain.
*
* If any of the two match any of the provided values, tracing headers will be attached to the outgoing request.
* Both, the string values, and the RegExes you provide in the array will match if they partially match the URL or pathname.
*
* Examples:
* - `tracePropagationTargets: [/^\/api/]` and request to `https://same-origin.com/api/posts`:
* - Tracing headers will be attached because the request is sent to the same origin and the regex matches the pathname "/api/posts".
* - `tracePropagationTargets: [/^\/api/]` and request to `https://different-origin.com/api/posts`:
* - Tracing headers will not be attached because the pathname will only be compared when the request target lives on the same origin.
* - `tracePropagationTargets: [/^\/api/, 'https://external-api.com']` and request to `https://external-api.com/v1/data`:
* - Tracing headers will be attached because the request URL matches the string `'https://external-api.com'`.
*/
tracePropagationTargets?: TracePropagationTargets;
/**
* If set to `true`, the SDK propagates the W3C `traceparent` header to any outgoing requests,
* in addition to the `sentry-trace` and `baggage` headers. Use the {@link CoreOptions.tracePropagationTargets}
* option to control to which outgoing requests the header will be attached.
*
* **Important:** If you set this option to `true`, make sure that you configured your servers'
* CORS settings to allow the `traceparent` header. Otherwise, requests might get blocked.
*
* @see https://www.w3.org/TR/trace-context/
*
* @default false
*/
propagateTraceparent?: boolean;
/**
* If set to `true`, the SDK will only continue a trace if the `organization ID` of the incoming trace found in the
* `baggage` header matches the `organization ID` of the current Sentry client.
*
* The client's organization ID is extracted from the DSN or can be set with the `orgId` option.
*
* If the organization IDs do not match, the SDK will start a new trace instead of continuing the incoming one.
* This is useful to prevent traces of unknown third-party services from being continued in your application.
*
* @default false
*/
strictTraceContinuation?: boolean;
/**
* The organization ID for your Sentry project.
*
* The SDK will try to extract the organization ID from the DSN. If it cannot be found, or if you need to override it,
* you can provide the ID with this option. The organization ID is used for trace propagation and for features like `strictTraceContinuation`.
*/
orgId?: `${number}` | number;
/**
* If logs support should be enabled.
*
* @default false
*/
enableLogs?: boolean;
/**
* An event-processing callback for logs, guaranteed to be invoked after all other log
* processors. This allows a log to be modified or dropped before it's sent.
*
* Note that you must return a valid log from this callback. If you do not wish to modify the log, simply return
* it at the end. Returning `null` will cause the log to be dropped.
*
* @default undefined
*
* @param log The log generated by the SDK.
* @returns A new log that will be sent | null.
*/
beforeSendLog?: (log: Log) => Log | null;
/**
* If metrics support should be enabled.
*
* @default true
*/
enableMetrics?: boolean;
/**
* An event-processing callback for metrics, guaranteed to be invoked after all other metric
* processors. This allows a metric to be modified or dropped before it's sent.
*
* Note that you must return a valid metric from this callback. If you do not wish to modify the metric, simply return
* it at the end. Returning `null` will cause the metric to be dropped.
*
* @default undefined
*
* @param metric The metric generated by the SDK.
* @returns A new metric that will be sent | null.
*/
beforeSendMetric?: (metric: Metric) => Metric | null;
/**
* Function to compute tracing sample rate dynamically and filter unwanted traces.
*
* Tracing is enabled if either this or `tracesSampleRate` is defined. If both are defined, `tracesSampleRate` is
* ignored. Set this and `tracesSampleRate` to `undefined` to disable tracing.
*
* Will automatically be passed a context object of default and optional custom data.
*
* @returns A sample rate between 0 and 1 (0 drops the trace, 1 guarantees it will be sent). Returning `true` is
* equivalent to returning 1 and returning `false` is equivalent to returning 0.
*/
tracesSampler?: (samplingContext: TracesSamplerSamplingContext) => number | boolean;
/**
* An event-processing callback for error and message events, guaranteed to be invoked after all other event
* processors, which allows an event to be modified or dropped.
*
* Note that you must return a valid event from this callback. If you do not wish to modify the event, simply return
* it at the end. Returning `null` will cause the event to be dropped.
*
* @param event The error or message event generated by the SDK.
* @param hint Event metadata useful for processing.
* @returns A new event that will be sent | null.
*/
beforeSend?: (event: ErrorEvent, hint: EventHint) => PromiseLike<ErrorEvent | null> | ErrorEvent | null;
/**
* This function can be defined to modify a child span before it's sent.
*
* @param span The span generated by the SDK.
*
* @returns The modified span payload that will be sent.
*/
beforeSendSpan?: (span: SpanJSON) => SpanJSON;
/**
* An event-processing callback for transaction events, guaranteed to be invoked after all other event
* processors. This allows an event to be modified or dropped before it's sent.
*
* Note that you must return a valid event from this callback. If you do not wish to modify the event, simply return
* it at the end. Returning `null` will cause the event to be dropped.
*
* @param event The error or message event generated by the SDK.
* @param hint Event metadata useful for processing.
* @returns A new event that will be sent | null.
*/
beforeSendTransaction?: (event: TransactionEvent, hint: EventHint) => PromiseLike<TransactionEvent | null> | TransactionEvent | null;
/**
* A callback invoked when adding a breadcrumb, allowing to optionally modify
* it before adding it to future events.
*
* Note that you must return a valid breadcrumb from this callback. If you do
* not wish to modify the breadcrumb, simply return it at the end.
* Returning null will cause the breadcrumb to be dropped.
*
* @param breadcrumb The breadcrumb as created by the SDK.
* @returns The breadcrumb that will be added | null.
*/
beforeBreadcrumb?: (breadcrumb: Breadcrumb, hint?: BreadcrumbHint) => Breadcrumb | null;
}
/** Base configuration options for every SDK. */
export interface CoreOptions<TO extends BaseTransportOptions = BaseTransportOptions> extends Omit<Partial<ClientOptions<TO>>, 'integrations' | 'transport' | 'stackParser'> {
/**
* If this is set to false, default integrations will not be added, otherwise this will internally be set to the
* recommended default integrations.
*/
defaultIntegrations?: false | Integration[];
/**
* List of integrations that should be installed after SDK was initialized.
* Accepts either a list of integrations or a function that receives
* default integrations and returns a new, updated list.
*/
integrations?: Integration[] | ((integrations: Integration[]) => Integration[]);
/**
* A function that takes transport options and returns the Transport object which is used to send events to Sentry.
* The function is invoked internally during SDK initialization.
* By default, the SDK initializes its default transports.
*/
transport?: (transportOptions: TO) => Transport;
/**
* A stack parser implementation or an array of stack line parsers
* By default, a stack parser is supplied for all supported browsers
*/
stackParser?: StackParser | StackLineParser[];
}
export {};
//# sourceMappingURL=options.d.ts.map

View File

@@ -0,0 +1,32 @@
"use strict";
exports.nextMonday = nextMonday;
var _index = require("./nextDay.cjs");
/**
* The {@link nextMonday} function options.
*/
/**
* @name nextMonday
* @category Weekday Helpers
* @summary When is the next Monday?
*
* @description
* When is the next Monday?
*
* @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, returned from the context function if passed, or inferred from the arguments.
*
* @param date - The date to start counting from
* @param options - An object with options
*
* @returns The next Monday
*
* @example
* // When is the next Monday after Mar, 22, 2020?
* const result = nextMonday(new Date(2020, 2, 22))
* //=> Mon Mar 23 2020 00:00:00
*/
function nextMonday(date, options) {
return (0, _index.nextDay)(date, 1, options);
}

View File

@@ -0,0 +1,12 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import * as modDev from './LexicalCollaborationPlugin.dev.mjs';
import * as modProd from './LexicalCollaborationPlugin.prod.mjs';
const mod = process.env.NODE_ENV !== 'production' ? modDev : modProd;
export const CollaborationPlugin = mod.CollaborationPlugin;

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/elements/FolderView/SimpleTable/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,cAAc,CAAA;AAIrB,KAAK,UAAU,GAAG;IAChB,QAAQ,CAAC,UAAU,CAAC,EAAE,WAAW,GAAG,SAAS,CAAA;IAC7C,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,WAAW,EAAE,KAAK,CAAC,SAAS,EAAE,CAAA;IACvC,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,CAAA;CACtC,CAAA;AACD,eAAO,MAAM,WAAW,sEAKrB,UAAU,sBAgBZ,CAAA;AAED,eAAO,MAAM,SAAS,qCAInB,KAAK,CAAC,cAAc,CAAC,uBAAuB,CAAC,sBAM/C,CAAA;AAED,eAAO,MAAM,SAAS,qCAInB,KAAK,CAAC,cAAc,CAAC,uBAAuB,CAAC,sBAM/C,CAAA;AAED,eAAO,MAAM,QAAQ,qCAIlB,KAAK,CAAC,cAAc,CAAC,mBAAmB,CAAC,sBAM3C,CAAA;AAED,eAAO,MAAM,SAAS,qCAInB,KAAK,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,sBAM9C,CAAA;AAED,eAAO,MAAM,WAAW,qCAIrB,KAAK,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,sBAM9C,CAAA;AAED,eAAO,MAAM,UAAU,qCAIpB;IAAE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,GAAG,KAAK,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,sBAM/E,CAAA"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"deleteOne.d.ts","sourceRoot":"","sources":["../src/deleteOne.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAaxC,eAAO,MAAM,SAAS,EAAE,SAwEvB,CAAA"}

View File

@@ -0,0 +1,18 @@
import { entityKind } from "./entity.js";
export declare class DrizzleError extends Error {
static readonly [entityKind]: string;
constructor({ message, cause }: {
message?: string;
cause?: unknown;
});
}
export declare class DrizzleQueryError extends Error {
query: string;
params: any[];
cause?: Error | undefined;
constructor(query: string, params: any[], cause?: Error | undefined);
}
export declare class TransactionRollbackError extends DrizzleError {
static readonly [entityKind]: string;
constructor();
}

View File

@@ -0,0 +1,98 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const DescriptionFileUtils = require("./DescriptionFileUtils");
/** @typedef {import("./Resolver")} Resolver */
/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */
/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */
module.exports = class DescriptionFilePlugin {
/**
* @param {string | ResolveStepHook} source source
* @param {string[]} filenames filenames
* @param {boolean} pathIsFile pathIsFile
* @param {string | ResolveStepHook} target target
*/
constructor(source, filenames, pathIsFile, target) {
this.source = source;
this.filenames = filenames;
this.pathIsFile = pathIsFile;
this.target = target;
}
/**
* @param {Resolver} resolver the resolver
* @returns {void}
*/
apply(resolver) {
const target = resolver.ensureHook(this.target);
resolver
.getHook(this.source)
.tapAsync(
"DescriptionFilePlugin",
(request, resolveContext, callback) => {
const { path } = request;
if (!path) return callback();
const directory = this.pathIsFile
? DescriptionFileUtils.cdUp(path)
: path;
if (!directory) return callback();
DescriptionFileUtils.loadDescriptionFile(
resolver,
directory,
this.filenames,
request.descriptionFilePath
? {
path: request.descriptionFilePath,
content: request.descriptionFileData,
directory:
/** @type {string} */
(request.descriptionFileRoot),
}
: undefined,
resolveContext,
(err, result) => {
if (err) return callback(err);
if (!result) {
if (resolveContext.log) {
resolveContext.log(
`No description file found in ${directory} or above`,
);
}
return callback();
}
const relativePath = `.${path
.slice(result.directory.length)
.replace(/\\/g, "/")}`;
/** @type {ResolveRequest} */
const obj = {
...request,
descriptionFilePath: result.path,
descriptionFileData: result.content,
descriptionFileRoot: result.directory,
relativePath,
};
resolver.doResolve(
target,
obj,
`using description file: ${result.path} (relative path: ${relativePath})`,
resolveContext,
(err, result) => {
if (err) return callback(err);
// Don't allow other processing
if (result === undefined) return callback(null, null);
callback(null, result);
},
);
},
);
},
);
}
};

View File

@@ -0,0 +1 @@
{"version":3,"file":"defaultAccess.d.ts","sourceRoot":"","sources":["../../src/auth/defaultAccess.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAEvD,eAAO,MAAM,aAAa,sBAAuB;IAAE,GAAG,EAAE,cAAc,CAAA;CAAE,KAAG,OAAwB,CAAA"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.client.js","names":["c","_c","useStepNav","useTranslation","React","AccountClient","$","setStepNav","t","t0","t1","nav","push","label","url","useEffect"],"sources":["../../../src/views/Account/index.client.tsx"],"sourcesContent":["'use client'\nimport { type StepNavItem, useStepNav, useTranslation } from '@payloadcms/ui'\nimport React from 'react'\n\nexport const AccountClient: React.FC = () => {\n const { setStepNav } = useStepNav()\n const { t } = useTranslation()\n\n React.useEffect(() => {\n const nav: StepNavItem[] = []\n\n nav.push({\n label: t('authentication:account'),\n url: '/account',\n })\n\n setStepNav(nav)\n }, [setStepNav, t])\n\n return null\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;AACA,SAA2BC,UAAU,EAAEC,cAAc,QAAQ;AAC7D,OAAOC,KAAA,MAAW;AAElB,OAAO,MAAMC,aAAA,GAA0BA,CAAA;EAAA,MAAAC,CAAA,GAAAL,EAAA;EACrC;IAAAM;EAAA,IAAuBL,UAAA;EACvB;IAAAM;EAAA,IAAcL,cAAA;EAAA,IAAAM,EAAA;EAAA,IAAAC,EAAA;EAAA,IAAAJ,CAAA,QAAAC,UAAA,IAAAD,CAAA,QAAAE,CAAA;IAEEC,EAAA,GAAAA,CAAA;MACd,MAAAE,GAAA;MAEAA,GAAA,CAAAC,IAAA;QAAAC,KAAA,EACSL,CAAA,CAAE;QAAAM,GAAA,EACJ;MAAA,CACP;MAEAP,UAAA,CAAWI,GAAA;IAAA;IACVD,EAAA,IAACH,UAAA,EAAYC,CAAA;IAAEF,CAAA,MAAAC,UAAA;IAAAD,CAAA,MAAAE,CAAA;IAAAF,CAAA,MAAAG,EAAA;IAAAH,CAAA,MAAAI,EAAA;EAAA;IAAAD,EAAA,GAAAH,CAAA;IAAAI,EAAA,GAAAJ,CAAA;EAAA;EATlBF,KAAA,CAAAW,SAAA,CAAgBN,EAShB,EAAGC,EAAe;EAAA;AAAA,CAGpB","ignoreList":[]}

View File

@@ -0,0 +1 @@
{"version":3,"file":"getFinalConfigObject.d.ts","sourceRoot":"","sources":["../../../../src/config/withSentryConfig/getFinalConfigObject.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AA4BrE;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,4BAA4B,EAAE,gBAAgB,EAC9C,iBAAiB,EAAE,kBAAkB,GACpC,gBAAgB,CAkElB"}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/uploads/fetchAPI-stream-file/index.ts"],"sourcesContent":["import fs from 'fs'\n\nexport function iteratorToStream(iterator: AsyncIterator<Uint8Array>) {\n return new ReadableStream({\n async pull(controller) {\n const { done, value } = await iterator.next()\n if (done) {\n controller.close()\n } else {\n controller.enqueue(value)\n }\n },\n })\n}\n\nexport async function* nodeStreamToIterator(stream: fs.ReadStream) {\n for await (const chunk of stream) {\n yield new Uint8Array(chunk)\n }\n}\n\nexport function streamFile({\n filePath,\n options,\n}: {\n filePath: string\n options?: { end?: number; start?: number }\n}): ReadableStream {\n const nodeStream = fs.createReadStream(filePath, options)\n const data: ReadableStream = iteratorToStream(nodeStreamToIterator(nodeStream))\n return data\n}\n"],"names":["fs","iteratorToStream","iterator","ReadableStream","pull","controller","done","value","next","close","enqueue","nodeStreamToIterator","stream","chunk","Uint8Array","streamFile","filePath","options","nodeStream","createReadStream","data"],"mappings":"AAAA,OAAOA,QAAQ,KAAI;AAEnB,OAAO,SAASC,iBAAiBC,QAAmC;IAClE,OAAO,IAAIC,eAAe;QACxB,MAAMC,MAAKC,UAAU;YACnB,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAG,MAAML,SAASM,IAAI;YAC3C,IAAIF,MAAM;gBACRD,WAAWI,KAAK;YAClB,OAAO;gBACLJ,WAAWK,OAAO,CAACH;YACrB;QACF;IACF;AACF;AAEA,OAAO,gBAAgBI,qBAAqBC,MAAqB;IAC/D,WAAW,MAAMC,SAASD,OAAQ;QAChC,MAAM,IAAIE,WAAWD;IACvB;AACF;AAEA,OAAO,SAASE,WAAW,EACzBC,QAAQ,EACRC,OAAO,EAIR;IACC,MAAMC,aAAalB,GAAGmB,gBAAgB,CAACH,UAAUC;IACjD,MAAMG,OAAuBnB,iBAAiBU,qBAAqBO;IACnE,OAAOE;AACT"}

View File

@@ -0,0 +1,21 @@
/**
* @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 Replace = createLucideIcon("Replace", [
["path", { d: "M14 4a2 2 0 0 1 2-2", key: "1w2hp7" }],
["path", { d: "M16 10a2 2 0 0 1-2-2", key: "shjach" }],
["path", { d: "M20 2a2 2 0 0 1 2 2", key: "188mtx" }],
["path", { d: "M22 8a2 2 0 0 1-2 2", key: "ddf4tu" }],
["path", { d: "m3 7 3 3 3-3", key: "x25e72" }],
["path", { d: "M6 10V5a3 3 0 0 1 3-3h1", key: "3y3t5z" }],
["rect", { x: "2", y: "14", width: "8", height: "8", rx: "2", key: "4rksxw" }]
]);
export { Replace as default };
//# sourceMappingURL=replace.js.map

View File

@@ -0,0 +1,22 @@
import type { ColumnBuilderBaseConfig } from "../../column-builder.js";
import type { ColumnBaseConfig } from "../../column.js";
import { entityKind } from "../../entity.js";
import { GelColumn, GelColumnBuilder } from "./common.js";
export type GelBooleanBuilderInitial<TName extends string> = GelBooleanBuilder<{
name: TName;
dataType: 'boolean';
columnType: 'GelBoolean';
data: boolean;
driverParam: boolean;
enumValues: undefined;
}>;
export declare class GelBooleanBuilder<T extends ColumnBuilderBaseConfig<'boolean', 'GelBoolean'>> extends GelColumnBuilder<T> {
static readonly [entityKind]: string;
constructor(name: T['name']);
}
export declare class GelBoolean<T extends ColumnBaseConfig<'boolean', 'GelBoolean'>> extends GelColumn<T> {
static readonly [entityKind]: string;
getSQLType(): string;
}
export declare function boolean(): GelBooleanBuilderInitial<''>;
export declare function boolean<TName extends string>(name: TName): GelBooleanBuilderInitial<TName>;

View File

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

View File

@@ -0,0 +1,168 @@
"use strict";
exports.localize = void 0;
var _index = require("../../_lib/buildLocalizeFn.cjs");
const eraValues = {
narrow: ["f.Kr.", "e.Kr."],
abbreviated: ["f.Kr.", "e.Kr."],
wide: ["före Kristus", "efter Kristus"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
wide: ["1:a kvartalet", "2:a kvartalet", "3:e kvartalet", "4:e kvartalet"],
};
const monthValues = {
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
abbreviated: [
"jan.",
"feb.",
"mars",
"apr.",
"maj",
"juni",
"juli",
"aug.",
"sep.",
"okt.",
"nov.",
"dec.",
],
wide: [
"januari",
"februari",
"mars",
"april",
"maj",
"juni",
"juli",
"augusti",
"september",
"oktober",
"november",
"december",
],
};
const dayValues = {
narrow: ["S", "M", "T", "O", "T", "F", "L"],
short: ["sö", "må", "ti", "on", "to", "fr", "lö"],
abbreviated: ["sön", "mån", "tis", "ons", "tors", "fre", "lör"],
wide: ["söndag", "måndag", "tisdag", "onsdag", "torsdag", "fredag", "lördag"],
};
// https://www.unicode.org/cldr/charts/32/summary/sv.html#1888
const dayPeriodValues = {
narrow: {
am: "fm",
pm: "em",
midnight: "midnatt",
noon: "middag",
morning: "morg.",
afternoon: "efterm.",
evening: "kväll",
night: "natt",
},
abbreviated: {
am: "f.m.",
pm: "e.m.",
midnight: "midnatt",
noon: "middag",
morning: "morgon",
afternoon: "efterm.",
evening: "kväll",
night: "natt",
},
wide: {
am: "förmiddag",
pm: "eftermiddag",
midnight: "midnatt",
noon: "middag",
morning: "morgon",
afternoon: "eftermiddag",
evening: "kväll",
night: "natt",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "fm",
pm: "em",
midnight: "midnatt",
noon: "middag",
morning: "på morg.",
afternoon: "på efterm.",
evening: "på kvällen",
night: "på natten",
},
abbreviated: {
am: "fm",
pm: "em",
midnight: "midnatt",
noon: "middag",
morning: "på morg.",
afternoon: "på efterm.",
evening: "på kvällen",
night: "på natten",
},
wide: {
am: "fm",
pm: "em",
midnight: "midnatt",
noon: "middag",
morning: "på morgonen",
afternoon: "på eftermiddagen",
evening: "på kvällen",
night: "på natten",
},
};
const ordinalNumber = (dirtyNumber, _options) => {
const number = Number(dirtyNumber);
const rem100 = number % 100;
if (rem100 > 20 || rem100 < 10) {
switch (rem100 % 10) {
case 1:
case 2:
return number + ":a";
}
}
return number + ":e";
};
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",
}),
});

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/elements/ColumnSelector/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,yBAAyB,EAAe,MAAM,SAAS,CAAA;AAGrE,OAAO,KAAyB,MAAM,OAAO,CAAA;AAO7C,MAAM,MAAM,KAAK,GAAG;IAClB,QAAQ,CAAC,cAAc,EAAE,yBAAyB,CAAC,MAAM,CAAC,CAAA;CAC3D,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CA4D1C,CAAA"}

View File

@@ -0,0 +1,3 @@
import type { CodeKeywordDefinition } from "../../types";
declare const def: CodeKeywordDefinition;
export default def;

View File

@@ -0,0 +1,25 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true,
});
exports.promiseForObject = promiseForObject;
/**
* This function transforms a JS object `ObjMap<Promise<T>>` into
* a `Promise<ObjMap<T>>`
*
* This is akin to bluebird's `Promise.props`, but implemented only using
* `Promise.all` so it will work with any implementation of ES6 promises.
*/
function promiseForObject(object) {
return Promise.all(Object.values(object)).then((resolvedValues) => {
const resolvedObject = Object.create(null);
for (const [i, key] of Object.keys(object).entries()) {
resolvedObject[key] = resolvedValues[i];
}
return resolvedObject;
});
}

View File

@@ -0,0 +1,71 @@
import { Debugger } from 'node:inspector';
export type Variables = Record<string, unknown>;
export type RateLimitIncrement = () => void;
/**
* The key used to store the local variables on the error object.
*/
export declare const LOCAL_VARIABLES_KEY = "__SENTRY_ERROR_LOCAL_VARIABLES__";
/**
* Creates a rate limiter that will call the disable callback when the rate limit is reached and the enable callback
* when a timeout has occurred.
* @param maxPerSecond Maximum number of calls per second
* @param enable Callback to enable capture
* @param disable Callback to disable capture
* @returns A function to call to increment the rate limiter count
*/
export declare function createRateLimiter(maxPerSecond: number, enable: () => void, disable: (seconds: number) => void): RateLimitIncrement;
export type PausedExceptionEvent = Debugger.PausedEventDataType & {
data: {
description: string;
objectId?: string;
};
};
/** Could this be an anonymous function? */
export declare function isAnonymous(name: string | undefined): boolean;
/** Do the function names appear to match? */
export declare function functionNamesMatch(a: string | undefined, b: string | undefined): boolean;
export interface FrameVariables {
function: string;
vars?: Variables;
}
export interface LocalVariablesIntegrationOptions {
/**
* Capture local variables for both caught and uncaught exceptions
*
* - When false, only uncaught exceptions will have local variables
* - When true, both caught and uncaught exceptions will have local variables.
*
* Defaults to `true`.
*
* Capturing local variables for all exceptions can be expensive since the debugger pauses for every throw to collect
* local variables.
*
* To reduce the likelihood of this feature impacting app performance or throughput, this feature is rate-limited.
* Once the rate limit is reached, local variables will only be captured for uncaught exceptions until a timeout has
* been reached.
*/
captureAllExceptions?: boolean;
/**
* Maximum number of exceptions to capture local variables for per second before rate limiting is triggered.
*/
maxExceptionsPerSecond?: number;
/**
* When true, local variables will be captured for all frames, including those that are not in_app.
*
* Defaults to `false`.
*/
includeOutOfAppFrames?: boolean;
}
export interface LocalVariablesWorkerArgs extends LocalVariablesIntegrationOptions {
/**
* Whether to enable debug logging.
*/
debug: boolean;
/**
* Base path used to calculate module name.
*
* Defaults to `dirname(process.argv[1])` and falls back to `process.cwd()`
*/
basePath?: string;
}
//# sourceMappingURL=common.d.ts.map

View File

@@ -0,0 +1,169 @@
import { ViewDescription } from '@payloadcms/ui';
import { RenderServerComponent } from '@payloadcms/ui/elements/RenderServerComponent';
import { hasDraftsEnabled } from 'payload/shared';
import { getDocumentPermissions } from './getDocumentPermissions.js';
export const renderDocumentSlots = args => {
const {
id,
collectionConfig,
globalConfig,
hasSavePermission,
locale,
permissions,
req
} = args;
const components = {};
const unsavedDraftWithValidations = undefined;
const isPreviewEnabled = collectionConfig?.admin?.preview || globalConfig?.admin?.preview;
const serverProps = {
id,
i18n: req.i18n,
locale,
payload: req.payload,
permissions,
user: req.user
};
const BeforeDocumentControls = collectionConfig?.admin?.components?.edit?.beforeDocumentControls || globalConfig?.admin?.components?.elements?.beforeDocumentControls;
if (BeforeDocumentControls) {
components.BeforeDocumentControls = RenderServerComponent({
Component: BeforeDocumentControls,
importMap: req.payload.importMap,
serverProps: serverProps
});
}
const EditMenuItems = collectionConfig?.admin?.components?.edit?.editMenuItems;
if (EditMenuItems) {
components.EditMenuItems = RenderServerComponent({
Component: EditMenuItems,
importMap: req.payload.importMap,
serverProps: serverProps
});
}
const CustomPreviewButton = collectionConfig?.admin?.components?.edit?.PreviewButton || globalConfig?.admin?.components?.elements?.PreviewButton;
if (isPreviewEnabled && CustomPreviewButton) {
components.PreviewButton = RenderServerComponent({
Component: CustomPreviewButton,
importMap: req.payload.importMap,
serverProps: serverProps
});
}
const LivePreview = collectionConfig?.admin?.components?.views?.edit?.livePreview || globalConfig?.admin?.components?.views?.edit?.livePreview;
if (LivePreview?.Component) {
components.LivePreview = RenderServerComponent({
Component: LivePreview.Component,
importMap: req.payload.importMap,
serverProps
});
}
const descriptionFromConfig = collectionConfig?.admin?.description || globalConfig?.admin?.description;
const staticDescription = typeof descriptionFromConfig === 'function' ? descriptionFromConfig({
t: req.i18n.t
}) : descriptionFromConfig;
const CustomDescription = collectionConfig?.admin?.components?.Description || globalConfig?.admin?.components?.elements?.Description;
const hasDescription = CustomDescription || staticDescription;
if (hasDescription) {
components.Description = RenderServerComponent({
clientProps: {
collectionSlug: collectionConfig?.slug,
description: staticDescription
},
Component: CustomDescription,
Fallback: ViewDescription,
importMap: req.payload.importMap,
serverProps: serverProps
});
}
if (collectionConfig?.versions?.drafts || globalConfig?.versions?.drafts) {
const CustomStatus = collectionConfig?.admin?.components?.edit?.Status || globalConfig?.admin?.components?.elements?.Status;
if (CustomStatus) {
components.Status = RenderServerComponent({
Component: CustomStatus,
importMap: req.payload.importMap,
serverProps
});
}
}
if (hasSavePermission) {
if (hasDraftsEnabled(collectionConfig || globalConfig)) {
const CustomPublishButton = collectionConfig?.admin?.components?.edit?.PublishButton || globalConfig?.admin?.components?.elements?.PublishButton;
if (CustomPublishButton) {
components.PublishButton = RenderServerComponent({
Component: CustomPublishButton,
importMap: req.payload.importMap,
serverProps: serverProps
});
}
const CustomUnpublishButton = collectionConfig?.admin?.components?.edit?.UnpublishButton || globalConfig?.admin?.components?.elements?.UnpublishButton;
if (CustomUnpublishButton) {
components.UnpublishButton = RenderServerComponent({
Component: CustomUnpublishButton,
importMap: req.payload.importMap,
serverProps: serverProps
});
}
const CustomSaveDraftButton = collectionConfig?.admin?.components?.edit?.SaveDraftButton || globalConfig?.admin?.components?.elements?.SaveDraftButton;
const draftsEnabled = hasDraftsEnabled(collectionConfig || globalConfig);
if ((draftsEnabled || unsavedDraftWithValidations) && CustomSaveDraftButton) {
components.SaveDraftButton = RenderServerComponent({
Component: CustomSaveDraftButton,
importMap: req.payload.importMap,
serverProps: serverProps
});
}
} else {
const CustomSaveButton = collectionConfig?.admin?.components?.edit?.SaveButton || globalConfig?.admin?.components?.elements?.SaveButton;
if (CustomSaveButton) {
components.SaveButton = RenderServerComponent({
Component: CustomSaveButton,
importMap: req.payload.importMap,
serverProps: serverProps
});
}
}
}
if (collectionConfig?.upload && collectionConfig?.admin?.components?.edit?.Upload) {
components.Upload = RenderServerComponent({
Component: collectionConfig.admin.components.edit.Upload,
importMap: req.payload.importMap,
serverProps
});
}
if (collectionConfig?.upload && collectionConfig.upload.admin?.components?.controls) {
components.UploadControls = RenderServerComponent({
Component: collectionConfig.upload.admin.components.controls,
importMap: req.payload.importMap,
serverProps
});
}
return components;
};
export const renderDocumentSlotsHandler = async args => {
const {
id,
collectionSlug,
locale,
permissions,
req
} = args;
const collectionConfig = req.payload.collections[collectionSlug]?.config;
if (!collectionConfig) {
throw new Error(req.t('error:incorrectCollection'));
}
const {
hasSavePermission
} = await getDocumentPermissions({
id,
collectionConfig,
data: {},
req
});
return renderDocumentSlots({
id,
collectionConfig,
hasSavePermission,
locale,
permissions,
req
});
};
//# sourceMappingURL=renderDocumentSlots.js.map

View File

@@ -0,0 +1,23 @@
/**
* @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 ShieldAlert = createLucideIcon("ShieldAlert", [
[
"path",
{
d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",
key: "oel41y"
}
],
["path", { d: "M12 8v4", key: "1got3b" }],
["path", { d: "M12 16h.01", key: "1drbdi" }]
]);
export { ShieldAlert as default };
//# sourceMappingURL=shield-alert.js.map

View File

@@ -0,0 +1,11 @@
import type { TypeWithID } from 'payload';
import type { Args } from './types.js';
/**
* If `id` is provided, it will update the row with that ID.
* If `where` is provided, it will update the row that matches the `where`
* If neither `id` nor `where` is provided, it will create a new row.
*
* adapter function replaces the entire row and does not support partial updates.
*/
export declare const upsertRow: <T extends Record<string, unknown> | TypeWithID>({ id, adapter, collectionSlug, data, db, fields, globalSlug, ignoreResult, customID, joinQuery: _joinQuery, operation, path, req, select, tableName, upsertTarget, where, }: Args) => Promise<T>;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,2 @@
const e=()=>()=>({method:`GET`,path:`/server/info`});exports.serverInfo=e;
//# sourceMappingURL=info.cjs.map

View File

@@ -0,0 +1,23 @@
"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.baggageEntryMetadataSymbol = void 0;
/**
* Symbol used to make BaggageEntryMetadata an opaque type
*/
exports.baggageEntryMetadataSymbol = Symbol('BaggageEntryMetadata');
//# sourceMappingURL=symbol.js.map

View File

@@ -0,0 +1,97 @@
/**
* Single-use utility classes to provide functionality to the {@link Glob}
* methods.
*
* @module
*/
import { Minipass } from 'minipass';
import { Path } from 'path-scurry';
import { IgnoreLike } from './ignore.js';
import { Pattern } from './pattern.js';
import { Processor } from './processor.js';
export interface GlobWalkerOpts {
absolute?: boolean;
allowWindowsEscape?: boolean;
cwd?: string | URL;
dot?: boolean;
dotRelative?: boolean;
follow?: boolean;
ignore?: string | string[] | IgnoreLike;
mark?: boolean;
matchBase?: boolean;
maxDepth?: number;
nobrace?: boolean;
nocase?: boolean;
nodir?: boolean;
noext?: boolean;
noglobstar?: boolean;
platform?: NodeJS.Platform;
posix?: boolean;
realpath?: boolean;
root?: string;
stat?: boolean;
signal?: AbortSignal;
windowsPathsNoEscape?: boolean;
withFileTypes?: boolean;
includeChildMatches?: boolean;
}
export type GWOFileTypesTrue = GlobWalkerOpts & {
withFileTypes: true;
};
export type GWOFileTypesFalse = GlobWalkerOpts & {
withFileTypes: false;
};
export type GWOFileTypesUnset = GlobWalkerOpts & {
withFileTypes?: undefined;
};
export type Result<O extends GlobWalkerOpts> = O extends GWOFileTypesTrue ? Path : O extends GWOFileTypesFalse ? string : O extends GWOFileTypesUnset ? string : Path | string;
export type Matches<O extends GlobWalkerOpts> = O extends GWOFileTypesTrue ? Set<Path> : O extends GWOFileTypesFalse ? Set<string> : O extends GWOFileTypesUnset ? Set<string> : Set<Path | string>;
export type MatchStream<O extends GlobWalkerOpts> = Minipass<Result<O>, Result<O>>;
/**
* basic walking utilities that all the glob walker types use
*/
export declare abstract class GlobUtil<O extends GlobWalkerOpts = GlobWalkerOpts> {
#private;
path: Path;
patterns: Pattern[];
opts: O;
seen: Set<Path>;
paused: boolean;
aborted: boolean;
signal?: AbortSignal;
maxDepth: number;
includeChildMatches: boolean;
constructor(patterns: Pattern[], path: Path, opts: O);
pause(): void;
resume(): void;
onResume(fn: () => any): void;
matchCheck(e: Path, ifDir: boolean): Promise<Path | undefined>;
matchCheckTest(e: Path | undefined, ifDir: boolean): Path | undefined;
matchCheckSync(e: Path, ifDir: boolean): Path | undefined;
abstract matchEmit(p: Result<O>): void;
abstract matchEmit(p: string | Path): void;
matchFinish(e: Path, absolute: boolean): void;
match(e: Path, absolute: boolean, ifDir: boolean): Promise<void>;
matchSync(e: Path, absolute: boolean, ifDir: boolean): void;
walkCB(target: Path, patterns: Pattern[], cb: () => any): void;
walkCB2(target: Path, patterns: Pattern[], processor: Processor, cb: () => any): any;
walkCB3(target: Path, entries: Path[], processor: Processor, cb: () => any): void;
walkCBSync(target: Path, patterns: Pattern[], cb: () => any): void;
walkCB2Sync(target: Path, patterns: Pattern[], processor: Processor, cb: () => any): any;
walkCB3Sync(target: Path, entries: Path[], processor: Processor, cb: () => any): void;
}
export declare class GlobWalker<O extends GlobWalkerOpts = GlobWalkerOpts> extends GlobUtil<O> {
matches: Set<Result<O>>;
constructor(patterns: Pattern[], path: Path, opts: O);
matchEmit(e: Result<O>): void;
walk(): Promise<Set<Result<O>>>;
walkSync(): Set<Result<O>>;
}
export declare class GlobStream<O extends GlobWalkerOpts = GlobWalkerOpts> extends GlobUtil<O> {
results: Minipass<Result<O>, Result<O>>;
constructor(patterns: Pattern[], path: Path, opts: O);
matchEmit(e: Result<O>): void;
stream(): MatchStream<O>;
streamSync(): MatchStream<O>;
}
//# sourceMappingURL=walker.d.ts.map

View File

@@ -0,0 +1,14 @@
import type { SanitizedCollectionConfig, TypeWithID } from '../collections/config/types.js';
import type { FindOneArgs } from '../database/types.js';
import type { Payload, PayloadRequest } from '../types/index.js';
type Args = {
config: SanitizedCollectionConfig;
id: number | string;
payload: Payload;
published?: boolean;
query: FindOneArgs;
req?: PayloadRequest;
};
export declare const getLatestCollectionVersion: <T extends TypeWithID = any>({ id, config, payload, published, query, req, }: Args) => Promise<T | undefined>;
export {};
//# sourceMappingURL=getLatestCollectionVersion.d.ts.map

View File

@@ -0,0 +1,24 @@
/**
* @name addYears
* @category Year Helpers
* @summary Add the specified number of years to the given date.
*
* @description
* Add the specified number of years to the given date.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The date to be changed
* @param amount - The amount of years to be added.
*
* @returns The new date with the years added
*
* @example
* // Add 5 years to 1 September 2014:
* const result = addYears(new Date(2014, 8, 1), 5)
* //=> Sun Sep 01 2019 00:00:00
*/
export declare function addYears<DateType extends Date>(
date: DateType | number | string,
amount: number,
): DateType;

View File

@@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("./core");
const validation_1 = require("./validation");
const applicator_1 = require("./applicator");
const dynamic_1 = require("./dynamic");
const next_1 = require("./next");
const unevaluated_1 = require("./unevaluated");
const format_1 = require("./format");
const metadata_1 = require("./metadata");
const draft2020Vocabularies = [
dynamic_1.default,
core_1.default,
validation_1.default,
(0, applicator_1.default)(true),
format_1.default,
metadata_1.metadataVocabulary,
metadata_1.contentVocabulary,
next_1.default,
unevaluated_1.default,
];
exports.default = draft2020Vocabularies;
//# sourceMappingURL=draft2020.js.map

View File

@@ -0,0 +1,107 @@
import { DirectusDeployment, DirectusDeploymentProject, DirectusDeploymentRun } from "../../../schema/deployment.cjs";
import { ApplyQueryFields } from "../../../types/output.cjs";
import { Query } from "../../../types/query.cjs";
import { RestCommand } from "../../types.cjs";
//#region src/rest/commands/read/deployment.d.ts
type ReadDeploymentOutput<Schema, TQuery extends Query<Schema, Item>, Item extends object = DirectusDeployment<Schema>> = ApplyQueryFields<Schema, Item, TQuery['fields']>;
type ReadDeploymentProjectOutput<Schema, TQuery extends Query<Schema, Item>, Item extends object = DirectusDeploymentProject<Schema>> = ApplyQueryFields<Schema, Item, TQuery['fields']>;
type ReadDeploymentRunOutput<Schema, TQuery extends Query<Schema, Item>, Item extends object = DirectusDeploymentRun<Schema>> = ApplyQueryFields<Schema, Item, TQuery['fields']>;
interface DeploymentProjectListOutput {
id: string | null;
external_id: string;
name: string;
deployable: boolean;
framework?: string;
}
interface DeploymentDashboardOutput {
projects: Array<{
id: string;
external_id: string;
name: string;
url?: string;
framework?: string;
deployable: boolean;
latest_deployment?: {
status: 'building' | 'ready' | 'error' | 'canceled';
created_at: string;
finished_at?: string;
};
}>;
}
interface DeploymentRunsOutput {
id: string;
project: string;
external_id: string;
target: string;
status: 'building' | 'ready' | 'error' | 'canceled';
url?: string;
date_created: string;
finished_at?: string;
author?: string;
}
/**
* List all configured deployment providers.
* @param query The query parameters
* @returns An array of deployment objects.
*/
declare const readDeployments: <Schema, const TQuery extends Query<Schema, DirectusDeployment<Schema>>>(query?: TQuery) => RestCommand<ReadDeploymentOutput<Schema, TQuery>[], Schema>;
/**
* Get a deployment provider by type.
* @param provider The provider type (e.g. 'vercel')
* @param query The query parameters
* @returns The deployment object.
* @throws Will throw if provider is empty
*/
declare const readDeployment: <Schema, const TQuery extends Query<Schema, DirectusDeployment<Schema>>>(provider: string, query?: TQuery) => RestCommand<ReadDeploymentOutput<Schema, TQuery>, Schema>;
/**
* Get deployment dashboard for a provider.
* Returns selected projects with latest deployment status and stats.
* @param provider The provider type (e.g. 'vercel')
* @returns Dashboard data with projects and stats.
* @throws Will throw if provider is empty
*/
declare const readDeploymentDashboard: <Schema>(provider: string) => RestCommand<DeploymentDashboardOutput, Schema>;
/**
* List projects for a deployment provider.
* Returns merged DB + provider info (id is null if project not selected).
* @param provider The provider type (e.g. 'vercel')
* @returns An array of project objects with selection status.
* @throws Will throw if provider is empty
*/
declare const readDeploymentProjects: <Schema>(provider: string) => RestCommand<DeploymentProjectListOutput[], Schema>;
/**
* Get a specific project from a deployment provider.
* @param provider The provider type (e.g. 'vercel')
* @param projectId The project ID
* @param query The query parameters
* @returns The project object.
* @throws Will throw if provider or projectId is empty
*/
declare const readDeploymentProject: <Schema, const TQuery extends Query<Schema, DirectusDeploymentProject<Schema>>>(provider: string, projectId: string, query?: TQuery) => RestCommand<ReadDeploymentProjectOutput<Schema, TQuery>, Schema>;
/**
* List deployment runs for a project.
* @param provider The provider type (e.g. 'vercel')
* @param projectId The project ID
* @param query Optional query parameters (search, limit, offset, meta)
* @returns Deployment runs with optional meta for pagination.
* @throws Will throw if provider or projectId is empty
*/
declare const readDeploymentRuns: <Schema>(provider: string, projectId: string, query?: {
search?: string;
limit?: number;
offset?: number;
meta?: string;
}) => RestCommand<DeploymentRunsOutput[], Schema>;
/**
* Get a specific deployment run with logs.
* @param provider The provider type (e.g. 'vercel')
* @param runId The run ID
* @param query The query parameters (supports 'since' for incremental logs)
* @returns The deployment run object with details and logs.
* @throws Will throw if provider or runId is empty
*/
declare const readDeploymentRun: <Schema, const TQuery extends Query<Schema, DirectusDeploymentRun<Schema>>>(provider: string, runId: string, query?: TQuery) => RestCommand<ReadDeploymentRunOutput<Schema, TQuery>, Schema>;
//#endregion
export { DeploymentDashboardOutput, DeploymentProjectListOutput, DeploymentRunsOutput, ReadDeploymentOutput, ReadDeploymentProjectOutput, ReadDeploymentRunOutput, readDeployment, readDeploymentDashboard, readDeploymentProject, readDeploymentProjects, readDeploymentRun, readDeploymentRuns, readDeployments };
//# sourceMappingURL=deployment.d.cts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"permissions.cjs","names":[],"sources":["../../../../src/rest/commands/update/permissions.ts"],"sourcesContent":["import type { DirectusPermission } from '../../../schema/permission.js';\nimport type { ApplyQueryFields, NestedPartial, Query } from '../../../types/index.js';\nimport type { RestCommand } from '../../types.js';\nimport { throwIfEmpty } from '../../utils/index.js';\n\nexport type UpdatePermissionOutput<\n\tSchema,\n\tTQuery extends Query<Schema, Item>,\n\tItem extends object = DirectusPermission<Schema>,\n> = ApplyQueryFields<Schema, Item, TQuery['fields']>;\n\n/**\n * Update multiple existing permissions rules.\n * @param keys\n * @param item\n * @param query\n * @returns Returns the permission object for the updated permissions.\n * @throws Will throw if keys is empty\n */\nexport const updatePermissions =\n\t<Schema, const TQuery extends Query<Schema, DirectusPermission<Schema>>>(\n\t\tkeys: DirectusPermission<Schema>['id'][],\n\t\titem: NestedPartial<DirectusPermission<Schema>>,\n\t\tquery?: TQuery,\n\t): RestCommand<UpdatePermissionOutput<Schema, TQuery>[], Schema> =>\n\t() => {\n\t\tthrowIfEmpty(keys, 'Keys cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/permissions`,\n\t\t\tparams: query ?? {},\n\t\t\tbody: JSON.stringify({ keys, data: item }),\n\t\t\tmethod: 'PATCH',\n\t\t};\n\t};\n\n/**\n * Update multiple permissions rules as batch.\n * @param items\n * @param query\n * @returns Returns the permission object for the updated permissions.\n */\nexport const updatePermissionsBatch =\n\t<Schema, const TQuery extends Query<Schema, DirectusPermission<Schema>>>(\n\t\titems: NestedPartial<DirectusPermission<Schema>>[],\n\t\tquery?: TQuery,\n\t): RestCommand<UpdatePermissionOutput<Schema, TQuery>[], Schema> =>\n\t() => ({\n\t\tpath: `/permissions`,\n\t\tparams: query ?? {},\n\t\tbody: JSON.stringify(items),\n\t\tmethod: 'PATCH',\n\t});\n\n/**\n * Update an existing permissions rule.\n * @param key\n * @param item\n * @param query\n * @returns Returns the permission object for the updated permission.\n * @throws Will throw if key is empty\n */\nexport const updatePermission =\n\t<Schema, const TQuery extends Query<Schema, DirectusPermission<Schema>>>(\n\t\tkey: DirectusPermission<Schema>['id'],\n\t\titem: NestedPartial<DirectusPermission<Schema>>,\n\t\tquery?: TQuery,\n\t): RestCommand<UpdatePermissionOutput<Schema, TQuery>, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(String(key), 'Key cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/permissions/${key}`,\n\t\t\tparams: query ?? {},\n\t\t\tbody: JSON.stringify(item),\n\t\t\tmethod: 'PATCH',\n\t\t};\n\t};\n"],"mappings":"kDAmBa,GAEX,EACA,EACA,SAGA,EAAA,aAAa,EAAM,uBAAuB,CAEnC,CACN,KAAM,eACN,OAAQ,GAAS,EAAE,CACnB,KAAM,KAAK,UAAU,CAAE,OAAM,KAAM,EAAM,CAAC,CAC1C,OAAQ,QACR,EASU,GAEX,EACA,SAEM,CACN,KAAM,eACN,OAAQ,GAAS,EAAE,CACnB,KAAM,KAAK,UAAU,EAAM,CAC3B,OAAQ,QACR,EAUW,GAEX,EACA,EACA,SAGA,EAAA,aAAa,OAAO,EAAI,CAAE,sBAAsB,CAEzC,CACN,KAAM,gBAAgB,IACtB,OAAQ,GAAS,EAAE,CACnB,KAAM,KAAK,UAAU,EAAK,CAC1B,OAAQ,QACR"}

View File

@@ -0,0 +1,24 @@
export function parsePayloadComponent(PayloadComponent) {
if (!PayloadComponent) {
return null;
}
const pathAndMaybeExport = typeof PayloadComponent === 'string' ? PayloadComponent : PayloadComponent.path;
let path;
let exportName;
if (pathAndMaybeExport.includes('#')) {
;
[path, exportName] = pathAndMaybeExport.split('#', 2);
} else {
path = pathAndMaybeExport;
exportName = 'default';
}
if (typeof PayloadComponent === 'object' && PayloadComponent.exportName) {
exportName = PayloadComponent.exportName;
}
return {
exportName,
path
};
}
//# sourceMappingURL=parsePayloadComponent.js.map

View File

@@ -0,0 +1,2 @@
import '@sentry-internal/replay-worker/worker-bundler';
//# sourceMappingURL=worker-bundler.d.ts.map

View File

@@ -0,0 +1,59 @@
"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.DiagComponentLogger = void 0;
const global_utils_1 = require("../internal/global-utils");
/**
* Component Logger which is meant to be used as part of any component which
* will add automatically additional namespace in front of the log message.
* It will then forward all message to global diag logger
* @example
* const cLogger = diag.createComponentLogger({ namespace: '@opentelemetry/instrumentation-http' });
* cLogger.debug('test');
* // @opentelemetry/instrumentation-http test
*/
class DiagComponentLogger {
constructor(props) {
this._namespace = props.namespace || 'DiagComponentLogger';
}
debug(...args) {
return logProxy('debug', this._namespace, args);
}
error(...args) {
return logProxy('error', this._namespace, args);
}
info(...args) {
return logProxy('info', this._namespace, args);
}
warn(...args) {
return logProxy('warn', this._namespace, args);
}
verbose(...args) {
return logProxy('verbose', this._namespace, args);
}
}
exports.DiagComponentLogger = DiagComponentLogger;
function logProxy(funcName, namespace, args) {
const logger = (0, global_utils_1.getGlobal)('diag');
// shortcut if logger not set
if (!logger) {
return;
}
args.unshift(namespace);
return logger[funcName](...args);
}
//# sourceMappingURL=ComponentLogger.js.map

View File

@@ -0,0 +1,11 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
const mod = await (process.env.NODE_ENV !== 'production' ? import('./LexicalHtml.dev.mjs') : import('./LexicalHtml.prod.mjs'));
export const $generateHtmlFromNodes = mod.$generateHtmlFromNodes;
export const $generateNodesFromDOM = mod.$generateNodesFromDOM;

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/singlestore-core/columns/serial.ts"],"sourcesContent":["import type {\n\tColumnBuilderBaseConfig,\n\tColumnBuilderRuntimeConfig,\n\tHasDefault,\n\tIsAutoincrement,\n\tIsPrimaryKey,\n\tMakeColumnConfig,\n\tNotNull,\n} from '~/column-builder.ts';\nimport type { ColumnBaseConfig } from '~/column.ts';\nimport { entityKind } from '~/entity.ts';\nimport type { AnySingleStoreTable } from '~/singlestore-core/table.ts';\nimport { SingleStoreColumnBuilderWithAutoIncrement, SingleStoreColumnWithAutoIncrement } from './common.ts';\n\nexport type SingleStoreSerialBuilderInitial<TName extends string> = IsAutoincrement<\n\tIsPrimaryKey<\n\t\tNotNull<\n\t\t\tHasDefault<\n\t\t\t\tSingleStoreSerialBuilder<{\n\t\t\t\t\tname: TName;\n\t\t\t\t\tdataType: 'number';\n\t\t\t\t\tcolumnType: 'SingleStoreSerial';\n\t\t\t\t\tdata: number;\n\t\t\t\t\tdriverParam: number;\n\t\t\t\t\tenumValues: undefined;\n\t\t\t\t\tgenerated: undefined;\n\t\t\t\t}>\n\t\t\t>\n\t\t>\n\t>\n>;\n\nexport class SingleStoreSerialBuilder<T extends ColumnBuilderBaseConfig<'number', 'SingleStoreSerial'>>\n\textends SingleStoreColumnBuilderWithAutoIncrement<T>\n{\n\tstatic override readonly [entityKind]: string = 'SingleStoreSerialBuilder';\n\n\tconstructor(name: T['name']) {\n\t\tsuper(name, 'number', 'SingleStoreSerial');\n\t\tthis.config.hasDefault = true;\n\t\tthis.config.autoIncrement = true;\n\t}\n\n\t/** @internal */\n\toverride build<TTableName extends string>(\n\t\ttable: AnySingleStoreTable<{ name: TTableName }>,\n\t): SingleStoreSerial<MakeColumnConfig<T, TTableName>> {\n\t\treturn new SingleStoreSerial<MakeColumnConfig<T, TTableName>>(\n\t\t\ttable,\n\t\t\tthis.config as ColumnBuilderRuntimeConfig<any, any>,\n\t\t);\n\t}\n}\n\nexport class SingleStoreSerial<\n\tT extends ColumnBaseConfig<'number', 'SingleStoreSerial'>,\n> extends SingleStoreColumnWithAutoIncrement<T> {\n\tstatic override readonly [entityKind]: string = 'SingleStoreSerial';\n\n\tgetSQLType(): string {\n\t\treturn 'serial';\n\t}\n\n\toverride mapFromDriverValue(value: number | string): number {\n\t\tif (typeof value === 'string') {\n\t\t\treturn Number(value);\n\t\t}\n\t\treturn value;\n\t}\n}\n\nexport function serial(): SingleStoreSerialBuilderInitial<''>;\nexport function serial<TName extends string>(name: TName): SingleStoreSerialBuilderInitial<TName>;\nexport function serial(name?: string) {\n\treturn new SingleStoreSerialBuilder(name ?? '');\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,oBAA2B;AAE3B,oBAA8F;AAoBvF,MAAM,iCACJ,wDACT;AAAA,EACC,QAA0B,wBAAU,IAAY;AAAA,EAEhD,YAAY,MAAiB;AAC5B,UAAM,MAAM,UAAU,mBAAmB;AACzC,SAAK,OAAO,aAAa;AACzB,SAAK,OAAO,gBAAgB;AAAA,EAC7B;AAAA;AAAA,EAGS,MACR,OACqD;AACrD,WAAO,IAAI;AAAA,MACV;AAAA,MACA,KAAK;AAAA,IACN;AAAA,EACD;AACD;AAEO,MAAM,0BAEH,iDAAsC;AAAA,EAC/C,QAA0B,wBAAU,IAAY;AAAA,EAEhD,aAAqB;AACpB,WAAO;AAAA,EACR;AAAA,EAES,mBAAmB,OAAgC;AAC3D,QAAI,OAAO,UAAU,UAAU;AAC9B,aAAO,OAAO,KAAK;AAAA,IACpB;AACA,WAAO;AAAA,EACR;AACD;AAIO,SAAS,OAAO,MAAe;AACrC,SAAO,IAAI,yBAAyB,QAAQ,EAAE;AAC/C;","names":[]}

View File

@@ -0,0 +1 @@
{"version":3,"file":"getCustomViewByRoute.d.ts","sourceRoot":"","sources":["../../../src/views/Root/getCustomViewByRoute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAIvD,eAAO,MAAM,oBAAoB,qDAG9B;IACD,MAAM,EAAE,eAAe,CAAA;IACvB,YAAY,EAAE,MAAM,CAAA;CACrB,KAAG;IACF,IAAI,EAAE,cAAc,CAAA;IACpB,UAAU,EAAE,eAAe,CAAA;IAC3B,OAAO,EAAE,MAAM,CAAA;CAmDhB,CAAA"}

View File

@@ -0,0 +1,21 @@
/**
* @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 TriangleRight = createLucideIcon("TriangleRight", [
[
"path",
{
d: "M22 18a2 2 0 0 1-2 2H3c-1.1 0-1.3-.6-.4-1.3L20.4 4.3c.9-.7 1.6-.4 1.6.7Z",
key: "183wce"
}
]
]);
export { TriangleRight as default };
//# sourceMappingURL=triangle-right.js.map

View File

@@ -0,0 +1,173 @@
import { Readable, Writable } from 'node:stream'
export default CacheHandler
declare namespace CacheHandler {
export type CacheMethods = 'GET' | 'HEAD' | 'OPTIONS' | 'TRACE'
export interface CacheHandlerOptions {
store: CacheStore
cacheByDefault?: number
type?: CacheOptions['type']
}
export interface CacheOptions {
store?: CacheStore
/**
* The methods to cache
* Note we can only cache safe methods. Unsafe methods (i.e. PUT, POST)
* invalidate the cache for a origin.
* @see https://www.rfc-editor.org/rfc/rfc9111.html#name-invalidating-stored-respons
* @see https://www.rfc-editor.org/rfc/rfc9110#section-9.2.1
*/
methods?: CacheMethods[]
/**
* RFC9111 allows for caching responses that we aren't explicitly told to
* cache or to not cache.
* @see https://www.rfc-editor.org/rfc/rfc9111.html#section-3-5
* @default undefined
*/
cacheByDefault?: number
/**
* TODO docs
* @default 'shared'
*/
type?: 'shared' | 'private'
}
export interface CacheControlDirectives {
'max-stale'?: number;
'min-fresh'?: number;
'max-age'?: number;
's-maxage'?: number;
'stale-while-revalidate'?: number;
'stale-if-error'?: number;
public?: true;
private?: true | string[];
'no-store'?: true;
'no-cache'?: true | string[];
'must-revalidate'?: true;
'proxy-revalidate'?: true;
immutable?: true;
'no-transform'?: true;
'must-understand'?: true;
'only-if-cached'?: true;
}
export interface CacheKey {
origin: string
method: string
path: string
headers?: Record<string, string | string[]>
}
export interface CacheValue {
statusCode: number
statusMessage: string
headers: Record<string, string | string[]>
vary?: Record<string, string | string[] | null>
etag?: string
cacheControlDirectives?: CacheControlDirectives
cachedAt: number
staleAt: number
deleteAt: number
}
export interface DeleteByUri {
origin: string
method: string
path: string
}
type GetResult = {
statusCode: number
statusMessage: string
headers: Record<string, string | string[]>
vary?: Record<string, string | string[] | null>
etag?: string
body?: Readable | Iterable<Buffer> | AsyncIterable<Buffer> | Buffer | Iterable<string> | AsyncIterable<string> | string
cacheControlDirectives: CacheControlDirectives,
cachedAt: number
staleAt: number
deleteAt: number
}
/**
* Underlying storage provider for cached responses
*/
export interface CacheStore {
get(key: CacheKey): GetResult | Promise<GetResult | undefined> | undefined
createWriteStream(key: CacheKey, val: CacheValue): Writable | undefined
delete(key: CacheKey): void | Promise<void>
}
export interface MemoryCacheStoreOpts {
/**
* @default Infinity
*/
maxCount?: number
/**
* @default Infinity
*/
maxSize?: number
/**
* @default Infinity
*/
maxEntrySize?: number
errorCallback?: (err: Error) => void
}
export class MemoryCacheStore implements CacheStore {
constructor (opts?: MemoryCacheStoreOpts)
get (key: CacheKey): GetResult | Promise<GetResult | undefined> | undefined
createWriteStream (key: CacheKey, value: CacheValue): Writable | undefined
delete (key: CacheKey): void | Promise<void>
}
export interface SqliteCacheStoreOpts {
/**
* Location of the database
* @default ':memory:'
*/
location?: string
/**
* @default Infinity
*/
maxCount?: number
/**
* @default Infinity
*/
maxEntrySize?: number
}
export class SqliteCacheStore implements CacheStore {
constructor (opts?: SqliteCacheStoreOpts)
/**
* Closes the connection to the database
*/
close (): void
get (key: CacheKey): GetResult | Promise<GetResult | undefined> | undefined
createWriteStream (key: CacheKey, value: CacheValue): Writable | undefined
delete (key: CacheKey): void | Promise<void>
}
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"handleClick.d.ts","sourceRoot":"","sources":["../../../../src/coreHandlers/handleClick.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI/C,OAAO,KAAK,EACV,cAAc,EACd,mBAAmB,EACnB,eAAe,EAGf,eAAe,EAChB,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAsC/D,sBAAsB;AACtB,wBAAgB,WAAW,CAAC,aAAa,EAAE,mBAAmB,EAAE,eAAe,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,GAAG,IAAI,CAEpH;AAED,yFAAyF;AACzF,qBAAa,aAAc,YAAW,mBAAmB;IAEvD,SAAS,CAAC,aAAa,EAAE,MAAM,CAAC;IAChC,SAAS,CAAC,WAAW,EAAE,MAAM,CAAC;IAE9B,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,SAAS,CAA2B;IAE5C,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,eAAe,CAAS;IAEhC,OAAO,CAAC,OAAO,CAAkB;IACjC,OAAO,CAAC,kBAAkB,CAAC,CAAgC;IAC3D,OAAO,CAAC,mBAAmB,CAA4B;gBAGrD,MAAM,EAAE,eAAe,EACvB,eAAe,EAAE,eAAe,EAEhC,mBAAmB,4BAAqB;IAe1C,+DAA+D;IACxD,YAAY,IAAI,IAAI;IAe3B,0BAA0B;IACnB,eAAe,IAAI,IAAI;IAU9B,kBAAkB;IACX,WAAW,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,GAAG,IAAI;IA4BnE,kBAAkB;IACX,gBAAgB,CAAC,SAAS,SAAa,GAAG,IAAI;IAIrD,kBAAkB;IACX,cAAc,CAAC,SAAS,SAAa,GAAG,IAAI;IAInD,kBAAkB;IACX,aAAa,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IAKhD,yCAAyC;IACzC,OAAO,CAAC,iBAAiB;IAMzB,+CAA+C;IAC/C,OAAO,CAAC,UAAU;IAIlB,sCAAsC;IACtC,OAAO,CAAC,YAAY;IAmCpB,qDAAqD;IACrD,OAAO,CAAC,oBAAoB;IAwD5B,wCAAwC;IACxC,OAAO,CAAC,oBAAoB;CAO7B;AAID,8BAA8B;AAC9B,wBAAgB,aAAa,CAAC,IAAI,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAyBhF;AAWD,qEAAqE;AACrE,wBAAgB,oCAAoC,CAAC,aAAa,EAAE,mBAAmB,EAAE,KAAK,EAAE,cAAc,GAAG,IAAI,CAkCpH"}

View File

@@ -0,0 +1,118 @@
import { buildMatchPatternFn } from "../../_lib/buildMatchPatternFn.mjs";
import { buildMatchFn } from "../../_lib/buildMatchFn.mjs";
const matchOrdinalNumberPattern = /^第?\d+(年|四半期|月|週|日|時|分|秒)?/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(B\.?C\.?|A\.?D\.?)/i,
abbreviated: /^(紀元[前後]|西暦)/i,
wide: /^(紀元[前後]|西暦)/i,
};
const parseEraPatterns = {
narrow: [/^B/i, /^A/i],
any: [/^(紀元前)/i, /^(西暦|紀元後)/i],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^Q[1234]/i,
wide: /^第[1234一二三四]四半期/i,
};
const parseQuarterPatterns = {
any: [/(1|一|)/i, /(2|二|)/i, /(3|三|)/i, /(4|四|)/i],
};
const matchMonthPatterns = {
narrow: /^([123456789]|1[012])/,
abbreviated: /^([123456789]|1[012])月/i,
wide: /^([123456789]|1[012])月/i,
};
const parseMonthPatterns = {
any: [
/^1\D/,
/^2/,
/^3/,
/^4/,
/^5/,
/^6/,
/^7/,
/^8/,
/^9/,
/^10/,
/^11/,
/^12/,
],
};
const matchDayPatterns = {
narrow: /^[日月火水木金土]/,
short: /^[日月火水木金土]/,
abbreviated: /^[日月火水木金土]/,
wide: /^[日月火水木金土]曜日/,
};
const parseDayPatterns = {
any: [/^日/, /^月/, /^火/, /^水/, /^木/, /^金/, /^土/],
};
const matchDayPeriodPatterns = {
any: /^(AM|PM|午前|午後|正午|深夜|真夜中|夜|朝)/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^(A|午前)/i,
pm: /^(P|午後)/i,
midnight: /^深夜|真夜中/i,
noon: /^正午/i,
morning: /^朝/i,
afternoon: /^午後/i,
evening: /^夜/i,
night: /^深夜/i,
},
};
export const match = {
ordinalNumber: buildMatchPatternFn({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: function (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: (index) => index + 1,
}),
month: buildMatchFn({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any",
}),
day: buildMatchFn({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: buildMatchFn({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
};

View File

@@ -0,0 +1,47 @@
Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
Based on Underscore.js, copyright Jeremy Ashkenas,
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
This software consists of voluntary contributions made by many
individuals. For exact contribution history, see the revision history
available at https://github.com/lodash/lodash
The following license applies to all parts of this software except as
documented below:
====
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.
====
Copyright and related rights for sample code are waived via CC0. Sample
code is defined as all source code displayed within the prose of the
documentation.
CC0: http://creativecommons.org/publicdomain/zero/1.0/
====
Files located in the node_modules and vendor directories are externally
maintained libraries used by this software which have their own
licenses; we recommend you read them, as their terms may differ from the
terms above.

View File

@@ -0,0 +1,8 @@
module.exports = function () {
// see https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi
var origPrepareStackTrace = Error.prepareStackTrace;
Error.prepareStackTrace = function (_, stack) { return stack; };
var stack = (new Error()).stack;
Error.prepareStackTrace = origPrepareStackTrace;
return stack[2].getFileName();
};

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"names":["_initializerDefineProperty","target","property","descriptor","context","Object","defineProperty","enumerable","configurable","writable","value","initializer","call"],"sources":["../../src/helpers/initializerDefineProperty.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\ninterface DescriptorWithInitializer extends PropertyDescriptor {\n initializer?: () => any;\n}\n\nexport default function _initializerDefineProperty<T>(\n target: T,\n property: PropertyKey,\n descriptor: DescriptorWithInitializer | undefined,\n context: DecoratorContext,\n): void {\n if (!descriptor) return;\n\n Object.defineProperty(target, property, {\n enumerable: descriptor.enumerable,\n configurable: descriptor.configurable,\n writable: descriptor.writable,\n value: descriptor.initializer\n ? descriptor.initializer.call(context)\n : void 0,\n });\n}\n"],"mappings":";;;;;;AAMe,SAASA,0BAA0BA,CAChDC,MAAS,EACTC,QAAqB,EACrBC,UAAiD,EACjDC,OAAyB,EACnB;EACN,IAAI,CAACD,UAAU,EAAE;EAEjBE,MAAM,CAACC,cAAc,CAACL,MAAM,EAAEC,QAAQ,EAAE;IACtCK,UAAU,EAAEJ,UAAU,CAACI,UAAU;IACjCC,YAAY,EAAEL,UAAU,CAACK,YAAY;IACrCC,QAAQ,EAAEN,UAAU,CAACM,QAAQ;IAC7BC,KAAK,EAAEP,UAAU,CAACQ,WAAW,GACzBR,UAAU,CAACQ,WAAW,CAACC,IAAI,CAACR,OAAO,CAAC,GACpC,KAAK;EACX,CAAC,CAAC;AACJ","ignoreList":[]}

View File

@@ -0,0 +1,19 @@
# @babel/helper-compilation-targets
> Helper functions on Babel compilation targets
See our website [@babel/helper-compilation-targets](https://babeljs.io/docs/babel-helper-compilation-targets) for more information.
## Install
Using npm:
```sh
npm install --save @babel/helper-compilation-targets
```
or using yarn:
```sh
yarn add @babel/helper-compilation-targets
```

View File

@@ -0,0 +1,15 @@
import type { Match } from "../../../locale/types.js";
import { Parser } from "../Parser.js";
import type { ParseFlags, ParseResult } from "../types.js";
export declare class DayOfYearParser extends Parser<number> {
priority: number;
subpriority: number;
parse(dateString: string, token: string, match: Match): ParseResult<number>;
validate<DateType extends Date>(date: DateType, value: number): boolean;
set<DateType extends Date>(
date: DateType,
_flags: ParseFlags,
value: number,
): DateType;
incompatibleTokens: string[];
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"types.js","names":[],"sources":["../../../src/views/List/types.ts"],"sourcesContent":["import type { SanitizedCollectionConfig } from 'payload'\n\nexport type DefaultListViewProps = {\n collectionSlug: SanitizedCollectionConfig['slug']\n listSearchableFields: SanitizedCollectionConfig['admin']['listSearchableFields']\n}\n\nexport type ListIndexProps = {\n collection: SanitizedCollectionConfig\n}\n"],"mappings":"AAOA","ignoreList":[]}

View File

@@ -0,0 +1,535 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const t = require("@webassemblyjs/ast");
const { moduleContextFromModuleAST } = require("@webassemblyjs/ast");
const { addWithAST, editWithAST } = require("@webassemblyjs/wasm-edit");
const { decode } = require("@webassemblyjs/wasm-parser");
const { RawSource } = require("webpack-sources");
const Generator = require("../Generator");
const { WEBASSEMBLY_TYPES } = require("../ModuleSourceTypeConstants");
const WebAssemblyExportImportedDependency = require("../dependencies/WebAssemblyExportImportedDependency");
const WebAssemblyUtils = require("./WebAssemblyUtils");
/** @typedef {import("webpack-sources").Source} Source */
/** @typedef {import("../Generator").GenerateContext} GenerateContext */
/** @typedef {import("../Module")} Module */
/** @typedef {import("../Module").SourceType} SourceType */
/** @typedef {import("../Module").SourceTypes} SourceTypes */
/** @typedef {import("../ModuleGraph")} ModuleGraph */
/** @typedef {import("../NormalModule")} NormalModule */
/** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */
/** @typedef {import("./WebAssemblyUtils").UsedWasmDependency} UsedWasmDependency */
/** @typedef {import("@webassemblyjs/ast").Instruction} Instruction */
/** @typedef {import("@webassemblyjs/ast").ModuleImport} ModuleImport */
/** @typedef {import("@webassemblyjs/ast").ModuleExport} ModuleExport */
/** @typedef {import("@webassemblyjs/ast").Global} Global */
/** @typedef {import("@webassemblyjs/ast").AST} AST */
/** @typedef {import("@webassemblyjs/ast").GlobalType} GlobalType */
/**
* @template T
* @typedef {import("@webassemblyjs/ast").NodePath<T>} NodePath
*/
/**
* @typedef {(buf: ArrayBuffer) => ArrayBuffer} ArrayBufferTransform
*/
/**
* @template T
* @param {((prev: ArrayBuffer) => ArrayBuffer)[]} fns transforms
* @returns {(buf: ArrayBuffer) => ArrayBuffer} composed transform
*/
const compose = (...fns) =>
fns.reduce(
(prevFn, nextFn) => (value) => nextFn(prevFn(value)),
(value) => value
);
/**
* Removes the start instruction
* @param {object} state state
* @param {AST} state.ast Module's ast
* @returns {ArrayBufferTransform} transform
*/
const removeStartFunc = (state) => (bin) =>
editWithAST(state.ast, bin, {
Start(path) {
path.remove();
}
});
/**
* Get imported globals
* @param {AST} ast Module's AST
* @returns {t.ModuleImport[]} - nodes
*/
const getImportedGlobals = (ast) => {
/** @type {t.ModuleImport[]} */
const importedGlobals = [];
t.traverse(ast, {
ModuleImport({ node }) {
if (t.isGlobalType(node.descr)) {
importedGlobals.push(node);
}
}
});
return importedGlobals;
};
/**
* Get the count for imported func
* @param {AST} ast Module's AST
* @returns {number} - count
*/
const getCountImportedFunc = (ast) => {
let count = 0;
t.traverse(ast, {
ModuleImport({ node }) {
if (t.isFuncImportDescr(node.descr)) {
count++;
}
}
});
return count;
};
/**
* Get next type index
* @param {AST} ast Module's AST
* @returns {t.Index} - index
*/
const getNextTypeIndex = (ast) => {
const typeSectionMetadata = t.getSectionMetadata(ast, "type");
if (typeSectionMetadata === undefined) {
return t.indexLiteral(0);
}
return t.indexLiteral(typeSectionMetadata.vectorOfSize.value);
};
/**
* Get next func index
* The Func section metadata provide information for implemented funcs
* in order to have the correct index we shift the index by number of external
* functions.
* @param {AST} ast Module's AST
* @param {number} countImportedFunc number of imported funcs
* @returns {t.Index} - index
*/
const getNextFuncIndex = (ast, countImportedFunc) => {
const funcSectionMetadata = t.getSectionMetadata(ast, "func");
if (funcSectionMetadata === undefined) {
return t.indexLiteral(0 + countImportedFunc);
}
const vectorOfSize = funcSectionMetadata.vectorOfSize.value;
return t.indexLiteral(vectorOfSize + countImportedFunc);
};
/**
* Creates an init instruction for a global type
* @param {t.GlobalType} globalType the global type
* @returns {t.Instruction} init expression
*/
const createDefaultInitForGlobal = (globalType) => {
if (globalType.valtype[0] === "i") {
// create NumberLiteral global initializer
return t.objectInstruction("const", globalType.valtype, [
t.numberLiteralFromRaw(66)
]);
} else if (globalType.valtype[0] === "f") {
// create FloatLiteral global initializer
return t.objectInstruction("const", globalType.valtype, [
t.floatLiteral(66, false, false, "66")
]);
}
throw new Error(`unknown type: ${globalType.valtype}`);
};
/**
* Rewrite the import globals:
* - removes the ModuleImport instruction
* - injects at the same offset a mutable global of the same type
*
* Since the imported globals are before the other global declarations, our
* indices will be preserved.
*
* Note that globals will become mutable.
* @param {object} state transformation state
* @param {AST} state.ast Module's ast
* @param {t.Instruction[]} state.additionalInitCode list of addition instructions for the init function
* @returns {ArrayBufferTransform} transform
*/
const rewriteImportedGlobals = (state) => (bin) => {
const additionalInitCode = state.additionalInitCode;
/** @type {t.Global[]} */
const newGlobals = [];
bin = editWithAST(state.ast, bin, {
ModuleImport(path) {
if (t.isGlobalType(path.node.descr)) {
const globalType =
/** @type {GlobalType} */
(path.node.descr);
globalType.mutability = "var";
const init = [
createDefaultInitForGlobal(globalType),
t.instruction("end")
];
newGlobals.push(t.global(globalType, init));
path.remove();
}
},
// in order to preserve non-imported global's order we need to re-inject
// those as well
/**
* @param {NodePath<Global>} path path
*/
Global(path) {
const { node } = path;
const [init] = node.init;
if (init.id === "get_global") {
node.globalType.mutability = "var";
const initialGlobalIdx = init.args[0];
node.init = [
createDefaultInitForGlobal(node.globalType),
t.instruction("end")
];
additionalInitCode.push(
/**
* get_global in global initializer only works for imported globals.
* They have the same indices as the init params, so use the
* same index.
*/
t.instruction("get_local", [initialGlobalIdx]),
t.instruction("set_global", [t.indexLiteral(newGlobals.length)])
);
}
newGlobals.push(node);
path.remove();
}
});
// Add global declaration instructions
return addWithAST(state.ast, bin, newGlobals);
};
/**
* Rewrite the export names
* @param {object} state state
* @param {AST} state.ast Module's ast
* @param {Module} state.module Module
* @param {ModuleGraph} state.moduleGraph module graph
* @param {Set<string>} state.externalExports Module
* @param {RuntimeSpec} state.runtime runtime
* @returns {ArrayBufferTransform} transform
*/
const rewriteExportNames =
({ ast, moduleGraph, module, externalExports, runtime }) =>
(bin) =>
editWithAST(ast, bin, {
/**
* @param {NodePath<ModuleExport>} path path
*/
ModuleExport(path) {
const isExternal = externalExports.has(path.node.name);
if (isExternal) {
path.remove();
return;
}
const usedName = moduleGraph
.getExportsInfo(module)
.getUsedName(path.node.name, runtime);
if (!usedName) {
path.remove();
return;
}
path.node.name = /** @type {string} */ (usedName);
}
});
/** @typedef {Map<string, UsedWasmDependency>} Mapping */
/**
* Mangle import names and modules
* @param {object} state state
* @param {AST} state.ast Module's ast
* @param {Mapping} state.usedDependencyMap mappings to mangle names
* @returns {ArrayBufferTransform} transform
*/
const rewriteImports =
({ ast, usedDependencyMap }) =>
(bin) =>
editWithAST(ast, bin, {
/**
* @param {NodePath<ModuleImport>} path path
*/
ModuleImport(path) {
const result = usedDependencyMap.get(
`${path.node.module}:${path.node.name}`
);
if (result !== undefined) {
path.node.module = result.module;
path.node.name = result.name;
}
}
});
/**
* Add an init function.
*
* The init function fills the globals given input arguments.
* @param {object} state transformation state
* @param {AST} state.ast Module's ast
* @param {t.Identifier} state.initFuncId identifier of the init function
* @param {t.Index} state.startAtFuncOffset index of the start function
* @param {t.ModuleImport[]} state.importedGlobals list of imported globals
* @param {t.Instruction[]} state.additionalInitCode list of addition instructions for the init function
* @param {t.Index} state.nextFuncIndex index of the next function
* @param {t.Index} state.nextTypeIndex index of the next type
* @returns {ArrayBufferTransform} transform
*/
const addInitFunction =
({
ast,
initFuncId,
startAtFuncOffset,
importedGlobals,
additionalInitCode,
nextFuncIndex,
nextTypeIndex
}) =>
(bin) => {
const funcParams = importedGlobals.map((importedGlobal) => {
// used for debugging
const id = t.identifier(
`${importedGlobal.module}.${importedGlobal.name}`
);
return t.funcParam(
/** @type {string} */ (importedGlobal.descr.valtype),
id
);
});
/** @type {Instruction[]} */
const funcBody = [];
for (const [index, _importedGlobal] of importedGlobals.entries()) {
const args = [t.indexLiteral(index)];
const body = [
t.instruction("get_local", args),
t.instruction("set_global", args)
];
funcBody.push(...body);
}
if (typeof startAtFuncOffset === "number") {
funcBody.push(
t.callInstruction(t.numberLiteralFromRaw(startAtFuncOffset))
);
}
for (const instr of additionalInitCode) {
funcBody.push(instr);
}
funcBody.push(t.instruction("end"));
/** @type {string[]} */
const funcResults = [];
// Code section
const funcSignature = t.signature(funcParams, funcResults);
const func = t.func(initFuncId, funcSignature, funcBody);
// Type section
const functype = t.typeInstruction(undefined, funcSignature);
// Func section
const funcindex = t.indexInFuncSection(nextTypeIndex);
// Export section
const moduleExport = t.moduleExport(
initFuncId.value,
t.moduleExportDescr("Func", nextFuncIndex)
);
return addWithAST(ast, bin, [func, moduleExport, funcindex, functype]);
};
/**
* Extract mangle mappings from module
* @param {ModuleGraph} moduleGraph module graph
* @param {Module} module current module
* @param {boolean=} mangle mangle imports
* @returns {Mapping} mappings to mangled names
*/
const getUsedDependencyMap = (moduleGraph, module, mangle) => {
/** @type {Mapping} */
const map = new Map();
for (const usedDep of WebAssemblyUtils.getUsedDependencies(
moduleGraph,
module,
mangle
)) {
const dep = usedDep.dependency;
const request = dep.request;
const exportName = dep.name;
map.set(`${request}:${exportName}`, usedDep);
}
return map;
};
/**
* @typedef {object} WebAssemblyGeneratorOptions
* @property {boolean=} mangleImports mangle imports
*/
class WebAssemblyGenerator extends Generator {
/**
* @param {WebAssemblyGeneratorOptions} options options
*/
constructor(options) {
super();
this.options = options;
}
/**
* @param {NormalModule} module fresh module
* @returns {SourceTypes} available types (do not mutate)
*/
getTypes(module) {
return WEBASSEMBLY_TYPES;
}
/**
* @param {NormalModule} module the module
* @param {SourceType=} type source type
* @returns {number} estimate size of the module
*/
getSize(module, type) {
const originalSource = module.originalSource();
if (!originalSource) {
return 0;
}
return originalSource.size();
}
/**
* @param {NormalModule} module module for which the code should be generated
* @param {GenerateContext} generateContext context for generate
* @returns {Source | null} generated code
*/
generate(module, { moduleGraph, runtime }) {
const bin =
/** @type {Buffer} */
(/** @type {Source} */ (module.originalSource()).source());
const initFuncId = t.identifier("");
// parse it
const ast = decode(bin, {
ignoreDataSection: true,
ignoreCodeSection: true,
ignoreCustomNameSection: true
});
const moduleContext = moduleContextFromModuleAST(ast.body[0]);
const importedGlobals = getImportedGlobals(ast);
const countImportedFunc = getCountImportedFunc(ast);
const startAtFuncOffset = moduleContext.getStart();
const nextFuncIndex = getNextFuncIndex(ast, countImportedFunc);
const nextTypeIndex = getNextTypeIndex(ast);
const usedDependencyMap = getUsedDependencyMap(
moduleGraph,
module,
this.options.mangleImports
);
const externalExports = new Set(
module.dependencies
.filter((d) => d instanceof WebAssemblyExportImportedDependency)
.map((d) => {
const wasmDep = /** @type {WebAssemblyExportImportedDependency} */ (
d
);
return wasmDep.exportName;
})
);
/** @type {t.Instruction[]} */
const additionalInitCode = [];
const transform = compose(
rewriteExportNames({
ast,
moduleGraph,
module,
externalExports,
runtime
}),
removeStartFunc({ ast }),
rewriteImportedGlobals({ ast, additionalInitCode }),
rewriteImports({
ast,
usedDependencyMap
}),
addInitFunction({
ast,
initFuncId,
importedGlobals,
additionalInitCode,
startAtFuncOffset,
nextFuncIndex,
nextTypeIndex
})
);
const newBin = transform(/** @type {ArrayBuffer} */ (bin.buffer));
const newBuf = Buffer.from(newBin);
return new RawSource(newBuf);
}
/**
* @param {Error} error the error
* @param {NormalModule} module module for which the code should be generated
* @param {GenerateContext} generateContext context for generate
* @returns {Source | null} generated code
*/
generateError(error, module, generateContext) {
return new RawSource(error.message);
}
}
module.exports = WebAssemblyGenerator;

View File

@@ -0,0 +1 @@
{"version":3,"file":"book-open.js","sources":["../../../src/icons/book-open.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name BookOpen\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgN3YxNCIgLz4KICA8cGF0aCBkPSJNMyAxOGExIDEgMCAwIDEtMS0xVjRhMSAxIDAgMCAxIDEtMWg1YTQgNCAwIDAgMSA0IDQgNCA0IDAgMCAxIDQtNGg1YTEgMSAwIDAgMSAxIDF2MTNhMSAxIDAgMCAxLTEgMWgtNmEzIDMgMCAwIDAtMyAzIDMgMyAwIDAgMC0zLTN6IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/book-open\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 BookOpen = createLucideIcon('BookOpen', [\n ['path', { d: 'M12 7v14', key: '1akyts' }],\n [\n 'path',\n {\n d: 'M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z',\n key: 'ruj8y',\n },\n ],\n]);\n\nexport default BookOpen;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,iBAAiB,UAAY,CAAA,CAAA,CAAA;AAAA,CAAA,CAC5C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACzC,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,8 @@
import type { Sampled, Session } from '../types';
/**
* Get a session with defaults & applied sampling.
*/
export declare function makeSession(session: Partial<Session> & {
sampled: Sampled;
}): Session;
//# sourceMappingURL=Session.d.ts.map

View File

@@ -0,0 +1,353 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const genAiAttributes = require('../ai/gen-ai-attributes.js');
const constants = require('./constants.js');
/**
* Maps OpenAI method paths to OpenTelemetry semantic convention operation names
* @see https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-spans/#llm-request-spans
*/
function getOperationName(methodPath) {
if (methodPath.includes('chat.completions')) {
return genAiAttributes.OPENAI_OPERATIONS.CHAT;
}
if (methodPath.includes('responses')) {
return genAiAttributes.OPENAI_OPERATIONS.CHAT;
}
if (methodPath.includes('embeddings')) {
return genAiAttributes.OPENAI_OPERATIONS.EMBEDDINGS;
}
if (methodPath.includes('conversations')) {
return genAiAttributes.OPENAI_OPERATIONS.CHAT;
}
return methodPath.split('.').pop() || 'unknown';
}
/**
* Get the span operation for OpenAI methods
* Following Sentry's convention: "gen_ai.{operation_name}"
*/
function getSpanOperation(methodPath) {
return `gen_ai.${getOperationName(methodPath)}`;
}
/**
* Check if a method path should be instrumented
*/
function shouldInstrument(methodPath) {
return constants.INSTRUMENTED_METHODS.includes(methodPath );
}
/**
* Build method path from current traversal
*/
function buildMethodPath(currentPath, prop) {
return currentPath ? `${currentPath}.${prop}` : prop;
}
/**
* Check if response is a Chat Completion object
*/
function isChatCompletionResponse(response) {
return (
response !== null &&
typeof response === 'object' &&
'object' in response &&
(response ).object === 'chat.completion'
);
}
/**
* Check if response is a Responses API object
*/
function isResponsesApiResponse(response) {
return (
response !== null &&
typeof response === 'object' &&
'object' in response &&
(response ).object === 'response'
);
}
/**
* Check if response is an Embeddings API object
*/
function isEmbeddingsResponse(response) {
if (response === null || typeof response !== 'object' || !('object' in response)) {
return false;
}
const responseObject = response ;
return (
responseObject.object === 'list' &&
typeof responseObject.model === 'string' &&
responseObject.model.toLowerCase().includes('embedding')
);
}
/**
* Check if response is a Conversations API object
* @see https://platform.openai.com/docs/api-reference/conversations
*/
function isConversationResponse(response) {
return (
response !== null &&
typeof response === 'object' &&
'object' in response &&
(response ).object === 'conversation'
);
}
/**
* Check if streaming event is from the Responses API
*/
function isResponsesApiStreamEvent(event) {
return (
event !== null &&
typeof event === 'object' &&
'type' in event &&
typeof (event ).type === 'string' &&
((event ).type ).startsWith('response.')
);
}
/**
* Check if streaming event is a chat completion chunk
*/
function isChatCompletionChunk(event) {
return (
event !== null &&
typeof event === 'object' &&
'object' in event &&
(event ).object === 'chat.completion.chunk'
);
}
/**
* Add attributes for Chat Completion responses
*/
function addChatCompletionAttributes(
span,
response,
recordOutputs,
) {
setCommonResponseAttributes(span, response.id, response.model, response.created);
if (response.usage) {
setTokenUsageAttributes(
span,
response.usage.prompt_tokens,
response.usage.completion_tokens,
response.usage.total_tokens,
);
}
if (Array.isArray(response.choices)) {
const finishReasons = response.choices
.map(choice => choice.finish_reason)
.filter((reason) => reason !== null);
if (finishReasons.length > 0) {
span.setAttributes({
[genAiAttributes.GEN_AI_RESPONSE_FINISH_REASONS_ATTRIBUTE]: JSON.stringify(finishReasons),
});
}
// Extract tool calls from all choices (only if recordOutputs is true)
if (recordOutputs) {
const toolCalls = response.choices
.map(choice => choice.message?.tool_calls)
.filter(calls => Array.isArray(calls) && calls.length > 0)
.flat();
if (toolCalls.length > 0) {
span.setAttributes({
[genAiAttributes.GEN_AI_RESPONSE_TOOL_CALLS_ATTRIBUTE]: JSON.stringify(toolCalls),
});
}
}
}
}
/**
* Add attributes for Responses API responses
*/
function addResponsesApiAttributes(span, response, recordOutputs) {
setCommonResponseAttributes(span, response.id, response.model, response.created_at);
if (response.status) {
span.setAttributes({
[genAiAttributes.GEN_AI_RESPONSE_FINISH_REASONS_ATTRIBUTE]: JSON.stringify([response.status]),
});
}
if (response.usage) {
setTokenUsageAttributes(
span,
response.usage.input_tokens,
response.usage.output_tokens,
response.usage.total_tokens,
);
}
// Extract function calls from output (only if recordOutputs is true)
if (recordOutputs) {
const responseWithOutput = response ;
if (Array.isArray(responseWithOutput.output) && responseWithOutput.output.length > 0) {
// Filter for function_call type objects in the output array
const functionCalls = responseWithOutput.output.filter(
(item) =>
typeof item === 'object' && item !== null && (item ).type === 'function_call',
);
if (functionCalls.length > 0) {
span.setAttributes({
[genAiAttributes.GEN_AI_RESPONSE_TOOL_CALLS_ATTRIBUTE]: JSON.stringify(functionCalls),
});
}
}
}
}
/**
* Add attributes for Embeddings API responses
*/
function addEmbeddingsAttributes(span, response) {
span.setAttributes({
[genAiAttributes.OPENAI_RESPONSE_MODEL_ATTRIBUTE]: response.model,
[genAiAttributes.GEN_AI_RESPONSE_MODEL_ATTRIBUTE]: response.model,
});
if (response.usage) {
setTokenUsageAttributes(span, response.usage.prompt_tokens, undefined, response.usage.total_tokens);
}
}
/**
* Add attributes for Conversations API responses
* @see https://platform.openai.com/docs/api-reference/conversations
*/
function addConversationAttributes(span, response) {
const { id, created_at } = response;
span.setAttributes({
[genAiAttributes.OPENAI_RESPONSE_ID_ATTRIBUTE]: id,
[genAiAttributes.GEN_AI_RESPONSE_ID_ATTRIBUTE]: id,
// The conversation id is used to link messages across API calls
[genAiAttributes.GEN_AI_CONVERSATION_ID_ATTRIBUTE]: id,
});
if (created_at) {
span.setAttributes({
[genAiAttributes.OPENAI_RESPONSE_TIMESTAMP_ATTRIBUTE]: new Date(created_at * 1000).toISOString(),
});
}
}
/**
* Set token usage attributes
* @param span - The span to add attributes to
* @param promptTokens - The number of prompt tokens
* @param completionTokens - The number of completion tokens
* @param totalTokens - The number of total tokens
*/
function setTokenUsageAttributes(
span,
promptTokens,
completionTokens,
totalTokens,
) {
if (promptTokens !== undefined) {
span.setAttributes({
[genAiAttributes.OPENAI_USAGE_PROMPT_TOKENS_ATTRIBUTE]: promptTokens,
[genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE]: promptTokens,
});
}
if (completionTokens !== undefined) {
span.setAttributes({
[genAiAttributes.OPENAI_USAGE_COMPLETION_TOKENS_ATTRIBUTE]: completionTokens,
[genAiAttributes.GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE]: completionTokens,
});
}
if (totalTokens !== undefined) {
span.setAttributes({
[genAiAttributes.GEN_AI_USAGE_TOTAL_TOKENS_ATTRIBUTE]: totalTokens,
});
}
}
/**
* Set common response attributes
* @param span - The span to add attributes to
* @param id - The response id
* @param model - The response model
* @param timestamp - The response timestamp
*/
function setCommonResponseAttributes(span, id, model, timestamp) {
span.setAttributes({
[genAiAttributes.OPENAI_RESPONSE_ID_ATTRIBUTE]: id,
[genAiAttributes.GEN_AI_RESPONSE_ID_ATTRIBUTE]: id,
});
span.setAttributes({
[genAiAttributes.OPENAI_RESPONSE_MODEL_ATTRIBUTE]: model,
[genAiAttributes.GEN_AI_RESPONSE_MODEL_ATTRIBUTE]: model,
});
span.setAttributes({
[genAiAttributes.OPENAI_RESPONSE_TIMESTAMP_ATTRIBUTE]: new Date(timestamp * 1000).toISOString(),
});
}
/**
* Extract conversation ID from request parameters
* Supports both Conversations API and previous_response_id chaining
* @see https://platform.openai.com/docs/guides/conversation-state
*/
function extractConversationId(params) {
// Conversations API: conversation parameter (e.g., "conv_...")
if ('conversation' in params && typeof params.conversation === 'string') {
return params.conversation;
}
// Responses chaining: previous_response_id links to parent response
if ('previous_response_id' in params && typeof params.previous_response_id === 'string') {
return params.previous_response_id;
}
return undefined;
}
/**
* Extract request parameters including model settings and conversation context
*/
function extractRequestParameters(params) {
const attributes = {
[genAiAttributes.GEN_AI_REQUEST_MODEL_ATTRIBUTE]: params.model ?? 'unknown',
};
if ('temperature' in params) attributes[genAiAttributes.GEN_AI_REQUEST_TEMPERATURE_ATTRIBUTE] = params.temperature;
if ('top_p' in params) attributes[genAiAttributes.GEN_AI_REQUEST_TOP_P_ATTRIBUTE] = params.top_p;
if ('frequency_penalty' in params) attributes[genAiAttributes.GEN_AI_REQUEST_FREQUENCY_PENALTY_ATTRIBUTE] = params.frequency_penalty;
if ('presence_penalty' in params) attributes[genAiAttributes.GEN_AI_REQUEST_PRESENCE_PENALTY_ATTRIBUTE] = params.presence_penalty;
if ('stream' in params) attributes[genAiAttributes.GEN_AI_REQUEST_STREAM_ATTRIBUTE] = params.stream;
if ('encoding_format' in params) attributes[genAiAttributes.GEN_AI_REQUEST_ENCODING_FORMAT_ATTRIBUTE] = params.encoding_format;
if ('dimensions' in params) attributes[genAiAttributes.GEN_AI_REQUEST_DIMENSIONS_ATTRIBUTE] = params.dimensions;
// Capture conversation ID for linking messages across API calls
const conversationId = extractConversationId(params);
if (conversationId) {
attributes[genAiAttributes.GEN_AI_CONVERSATION_ID_ATTRIBUTE] = conversationId;
}
return attributes;
}
exports.addChatCompletionAttributes = addChatCompletionAttributes;
exports.addConversationAttributes = addConversationAttributes;
exports.addEmbeddingsAttributes = addEmbeddingsAttributes;
exports.addResponsesApiAttributes = addResponsesApiAttributes;
exports.buildMethodPath = buildMethodPath;
exports.extractRequestParameters = extractRequestParameters;
exports.getOperationName = getOperationName;
exports.getSpanOperation = getSpanOperation;
exports.isChatCompletionChunk = isChatCompletionChunk;
exports.isChatCompletionResponse = isChatCompletionResponse;
exports.isConversationResponse = isConversationResponse;
exports.isEmbeddingsResponse = isEmbeddingsResponse;
exports.isResponsesApiResponse = isResponsesApiResponse;
exports.isResponsesApiStreamEvent = isResponsesApiStreamEvent;
exports.setCommonResponseAttributes = setCommonResponseAttributes;
exports.setTokenUsageAttributes = setTokenUsageAttributes;
exports.shouldInstrument = shouldInstrument;
//# sourceMappingURL=utils.js.map

View File

@@ -0,0 +1,5 @@
import type { ZodErrorMap } from "./ZodError.cjs";
import defaultErrorMap from "./locales/en.cjs";
export { defaultErrorMap };
export declare function setErrorMap(map: ZodErrorMap): void;
export declare function getErrorMap(): ZodErrorMap;

View File

@@ -0,0 +1 @@
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../src/exports/internal.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAA;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2DAA2D,CAAA;AAChG,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAA"}

View File

@@ -0,0 +1,293 @@
// License: MIT
// Author: Anton Medvedev <anton@medv.io>
// Source: https://github.com/antonmedv/finder
const acceptedAttrNames = new Set(['role', 'name', 'aria-label', 'rel', 'href']);
/** Check if attribute name and value are word-like. */
export function attr(name, value) {
let nameIsOk = acceptedAttrNames.has(name);
nameIsOk ||= name.startsWith('data-') && wordLike(name);
let valueIsOk = wordLike(value) && value.length < 100;
valueIsOk ||= value.startsWith('#') && wordLike(value.slice(1));
return nameIsOk && valueIsOk;
}
/** Check if id name is word-like. */
export function idName(name) {
return wordLike(name);
}
/** Check if class name is word-like. */
export function className(name) {
return wordLike(name);
}
/** Check if tag name is word-like. */
export function tagName(name) {
return true;
}
/** Finds unique CSS selectors for the given element. */
export function finder(input, options) {
if (input.nodeType !== Node.ELEMENT_NODE) {
throw new Error(`Can't generate CSS selector for non-element node type.`);
}
if (input.tagName.toLowerCase() === 'html') {
return 'html';
}
const defaults = {
root: document.body,
idName: idName,
className: className,
tagName: tagName,
attr: attr,
timeoutMs: 1000,
seedMinLength: 3,
optimizedMinLength: 2,
maxNumberOfPathChecks: Infinity,
};
const startTime = new Date();
const config = { ...defaults, ...options };
const rootDocument = findRootDocument(config.root, defaults);
let foundPath;
let count = 0;
for (const candidate of search(input, config, rootDocument)) {
const elapsedTimeMs = new Date().getTime() - startTime.getTime();
if (elapsedTimeMs > config.timeoutMs ||
count >= config.maxNumberOfPathChecks) {
const fPath = fallback(input, rootDocument);
if (!fPath) {
throw new Error(`Timeout: Can't find a unique selector after ${config.timeoutMs}ms`);
}
return selector(fPath);
}
count++;
if (unique(candidate, rootDocument)) {
foundPath = candidate;
break;
}
}
if (!foundPath) {
throw new Error(`Selector was not found.`);
}
const optimized = [
...optimize(foundPath, input, config, rootDocument, startTime),
];
optimized.sort(byPenalty);
if (optimized.length > 0) {
return selector(optimized[0]);
}
return selector(foundPath);
}
function* search(input, config, rootDocument) {
const stack = [];
let paths = [];
let current = input;
let i = 0;
while (current && current !== rootDocument) {
const level = tie(current, config);
for (const node of level) {
node.level = i;
}
stack.push(level);
current = current.parentElement;
i++;
paths.push(...combinations(stack));
if (i >= config.seedMinLength) {
paths.sort(byPenalty);
for (const candidate of paths) {
yield candidate;
}
paths = [];
}
}
paths.sort(byPenalty);
for (const candidate of paths) {
yield candidate;
}
}
function wordLike(name) {
if (/^[a-z\-]{3,}$/i.test(name)) {
const words = name.split(/-|[A-Z]/);
for (const word of words) {
if (word.length <= 2) {
return false;
}
if (/[^aeiou]{4,}/i.test(word)) {
return false;
}
}
return true;
}
return false;
}
function tie(element, config) {
const level = [];
const elementId = element.getAttribute('id');
if (elementId && config.idName(elementId)) {
level.push({
name: '#' + CSS.escape(elementId),
penalty: 0,
});
}
for (let i = 0; i < element.classList.length; i++) {
const name = element.classList[i];
if (config.className(name)) {
level.push({
name: '.' + CSS.escape(name),
penalty: 1,
});
}
}
for (let i = 0; i < element.attributes.length; i++) {
const attr = element.attributes[i];
if (config.attr(attr.name, attr.value)) {
level.push({
name: `[${CSS.escape(attr.name)}="${CSS.escape(attr.value)}"]`,
penalty: 2,
});
}
}
const tagName = element.tagName.toLowerCase();
if (config.tagName(tagName)) {
level.push({
name: tagName,
penalty: 5,
});
const index = indexOf(element, tagName);
if (index !== undefined) {
level.push({
name: nthOfType(tagName, index),
penalty: 10,
});
}
}
const nth = indexOf(element);
if (nth !== undefined) {
level.push({
name: nthChild(tagName, nth),
penalty: 50,
});
}
return level;
}
function selector(path) {
let node = path[0];
let query = node.name;
for (let i = 1; i < path.length; i++) {
const level = path[i].level || 0;
if (node.level === level - 1) {
query = `${path[i].name} > ${query}`;
}
else {
query = `${path[i].name} ${query}`;
}
node = path[i];
}
return query;
}
function penalty(path) {
return path.map((node) => node.penalty).reduce((acc, i) => acc + i, 0);
}
function byPenalty(a, b) {
return penalty(a) - penalty(b);
}
function indexOf(input, tagName) {
const parent = input.parentNode;
if (!parent) {
return undefined;
}
let child = parent.firstChild;
if (!child) {
return undefined;
}
let i = 0;
while (child) {
if (child.nodeType === Node.ELEMENT_NODE &&
(tagName === undefined ||
child.tagName.toLowerCase() === tagName)) {
i++;
}
if (child === input) {
break;
}
child = child.nextSibling;
}
return i;
}
function fallback(input, rootDocument) {
let i = 0;
let current = input;
const path = [];
while (current && current !== rootDocument) {
const tagName = current.tagName.toLowerCase();
const index = indexOf(current, tagName);
if (index === undefined) {
return;
}
path.push({
name: nthOfType(tagName, index),
penalty: NaN,
level: i,
});
current = current.parentElement;
i++;
}
if (unique(path, rootDocument)) {
return path;
}
}
function nthChild(tagName, index) {
if (tagName === 'html') {
return 'html';
}
return `${tagName}:nth-child(${index})`;
}
function nthOfType(tagName, index) {
if (tagName === 'html') {
return 'html';
}
return `${tagName}:nth-of-type(${index})`;
}
function* combinations(stack, path = []) {
if (stack.length > 0) {
for (let node of stack[0]) {
yield* combinations(stack.slice(1, stack.length), path.concat(node));
}
}
else {
yield path;
}
}
function findRootDocument(rootNode, defaults) {
if (rootNode.nodeType === Node.DOCUMENT_NODE) {
return rootNode;
}
if (rootNode === defaults.root) {
return rootNode.ownerDocument;
}
return rootNode;
}
function unique(path, rootDocument) {
const css = selector(path);
switch (rootDocument.querySelectorAll(css).length) {
case 0:
throw new Error(`Can't select any node with this selector: ${css}`);
case 1:
return true;
default:
return false;
}
}
function* optimize(path, input, config, rootDocument, startTime) {
if (path.length > 2 && path.length > config.optimizedMinLength) {
for (let i = 1; i < path.length - 1; i++) {
const elapsedTimeMs = new Date().getTime() - startTime.getTime();
if (elapsedTimeMs > config.timeoutMs) {
return;
}
const newPath = [...path];
newPath.splice(i, 1);
if (unique(newPath, rootDocument) &&
rootDocument.querySelector(selector(newPath)) === input) {
yield newPath;
yield* optimize(newPath, input, config, rootDocument, startTime);
}
}
}
}

View File

@@ -0,0 +1,6 @@
export var Action = /*#__PURE__*/ function(Action) {
Action["RenderConfig"] = "render-config";
return Action;
}({});
//# sourceMappingURL=types.js.map

View File

@@ -0,0 +1 @@
!function(e){var a=/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,t=/\b\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\b|\b0x[\dA-F]+\b/;e.languages.soy={comment:[/\/\*[\s\S]*?\*\//,{pattern:/(\s)\/\/.*/,lookbehind:!0,greedy:!0}],"command-arg":{pattern:/(\{+\/?\s*(?:alias|call|delcall|delpackage|deltemplate|namespace|template)\s+)\.?[\w.]+/,lookbehind:!0,alias:"string",inside:{punctuation:/\./}},parameter:{pattern:/(\{+\/?\s*@?param\??\s+)\.?[\w.]+/,lookbehind:!0,alias:"variable"},keyword:[{pattern:/(\{+\/?[^\S\r\n]*)(?:\\[nrt]|alias|call|case|css|default|delcall|delpackage|deltemplate|else(?:if)?|fallbackmsg|for(?:each)?|if(?:empty)?|lb|let|literal|msg|namespace|nil|@?param\??|rb|sp|switch|template|xid)/,lookbehind:!0},/\b(?:any|as|attributes|bool|css|float|html|in|int|js|list|map|null|number|string|uri)\b/],delimiter:{pattern:/^\{+\/?|\/?\}+$/,alias:"punctuation"},property:/\w+(?==)/,variable:{pattern:/\$[^\W\d]\w*(?:\??(?:\.\w+|\[[^\]]+\]))*/,inside:{string:{pattern:a,greedy:!0},number:t,punctuation:/[\[\].?]/}},string:{pattern:a,greedy:!0},function:[/\w+(?=\()/,{pattern:/(\|[^\S\r\n]*)\w+/,lookbehind:!0}],boolean:/\b(?:false|true)\b/,number:t,operator:/\?:?|<=?|>=?|==?|!=|[+*/%-]|\b(?:and|not|or)\b/,punctuation:/[{}()\[\]|.,:]/},e.hooks.add("before-tokenize",(function(a){var t=!1;e.languages["markup-templating"].buildPlaceholders(a,"soy",/\{\{.+?\}\}|\{.+?\}|\s\/\/.*|\/\*[\s\S]*?\*\//g,(function(e){return"{/literal}"===e&&(t=!1),!t&&("{literal}"===e&&(t=!0),!0)}))})),e.hooks.add("after-tokenize",(function(a){e.languages["markup-templating"].tokenizePlaceholders(a,"soy")}))}(Prism);

View File

@@ -0,0 +1,7 @@
export declare const differenceInWeeksWithOptions: import("./types.js").FPFn3<
number,
| import("../differenceInWeeks.js").DifferenceInWeeksOptions
| undefined,
string | number | Date,
string | number | Date
>;

View File

@@ -0,0 +1,782 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _buffer = require("./buffer.js");
var _index = require("./node/index.js");
var _nodes = require("./nodes.js");
var _t = require("@babel/types");
var _tokenMap = require("./token-map.js");
var _types2 = require("./generators/types.js");
const {
isExpression,
isFunction,
isStatement,
isClassBody,
isTSInterfaceBody,
isTSEnumMember
} = _t;
const SCIENTIFIC_NOTATION = /e/i;
const ZERO_DECIMAL_INTEGER = /\.0+$/;
const HAS_NEWLINE = /[\n\r\u2028\u2029]/;
const HAS_NEWLINE_OR_BlOCK_COMMENT_END = /[\n\r\u2028\u2029]|\*\//;
function commentIsNewline(c) {
return c.type === "CommentLine" || HAS_NEWLINE.test(c.value);
}
class Printer {
constructor(format, map, tokens = null, originalCode = null) {
this.tokenContext = _index.TokenContext.normal;
this._tokens = null;
this._originalCode = null;
this._currentNode = null;
this._currentTypeId = null;
this._indent = 0;
this._indentRepeat = 0;
this._insideAux = false;
this._noLineTerminator = false;
this._noLineTerminatorAfterNode = null;
this._printAuxAfterOnNextUserNode = false;
this._printedComments = new Set();
this._lastCommentLine = 0;
this._innerCommentsState = 0;
this._flags = 0;
this.tokenMap = null;
this._boundGetRawIdentifier = null;
this._printSemicolonBeforeNextNode = -1;
this._printSemicolonBeforeNextToken = -1;
this.format = format;
this._tokens = tokens;
this._originalCode = originalCode;
this._indentRepeat = format.indent.style.length;
this._inputMap = (map == null ? void 0 : map._inputMap) || null;
this._buf = new _buffer.default(map, format.indent.style[0]);
const {
preserveFormat,
compact,
concise,
retainLines,
retainFunctionParens
} = format;
if (preserveFormat) {
this._flags |= 1;
}
if (compact) {
this._flags |= 2;
}
if (concise) {
this._flags |= 4;
}
if (retainLines) {
this._flags |= 8;
}
if (retainFunctionParens) {
this._flags |= 16;
}
if (format.auxiliaryCommentBefore || format.auxiliaryCommentAfter) {
this._flags |= 32;
}
}
enterDelimited() {
const oldNoLineTerminatorAfterNode = this._noLineTerminatorAfterNode;
if (oldNoLineTerminatorAfterNode !== null) {
this._noLineTerminatorAfterNode = null;
}
return oldNoLineTerminatorAfterNode;
}
generate(ast) {
if (this.format.preserveFormat) {
this.tokenMap = new _tokenMap.TokenMap(ast, this._tokens, this._originalCode);
this._boundGetRawIdentifier = _types2._getRawIdentifier.bind(this);
}
this.print(ast);
this._maybeAddAuxComment();
return this._buf.get();
}
indent(flags = this._flags) {
if (flags & (1 | 2 | 4)) {
return;
}
this._indent += this._indentRepeat;
}
dedent(flags = this._flags) {
if (flags & (1 | 2 | 4)) {
return;
}
this._indent -= this._indentRepeat;
}
semicolon(force = false) {
const flags = this._flags;
if (flags & 32) {
this._maybeAddAuxComment();
}
if (flags & 1) {
const node = this._currentNode;
if (node.start != null && node.end != null) {
if (!this.tokenMap.endMatches(node, ";")) {
this._printSemicolonBeforeNextNode = this._buf.getCurrentLine();
return;
}
const indexes = this.tokenMap.getIndexes(this._currentNode);
this._catchUpTo(this._tokens[indexes[indexes.length - 1]].loc.start);
}
}
if (force) {
this._appendChar(59);
} else {
this._queue(59);
}
this._noLineTerminator = false;
}
rightBrace(node) {
if (this.format.minified) {
this._buf.removeLastSemicolon();
}
this.sourceWithOffset("end", node.loc, -1);
this.tokenChar(125);
}
rightParens(node) {
this.sourceWithOffset("end", node.loc, -1);
this.tokenChar(41);
}
space(force = false) {
if (this._flags & (1 | 2)) {
return;
}
if (force) {
this._space();
} else {
const lastCp = this.getLastChar(true);
if (lastCp !== 0 && lastCp !== 32 && lastCp !== 10) {
this._space();
}
}
}
word(str, noLineTerminatorAfter = false) {
this.tokenContext &= _index.TokenContext.forInOrInitHeadAccumulatePassThroughMask;
this._maybePrintInnerComments(str);
const flags = this._flags;
if (flags & 32) {
this._maybeAddAuxComment();
}
if (flags & 1) this._catchUpToCurrentToken(str);
const lastChar = this.getLastChar();
if (lastChar === -2 || lastChar === -3 || lastChar === 47 && str.charCodeAt(0) === 47) {
this._space();
}
this._append(str, false);
this.setLastChar(-3);
this._noLineTerminator = noLineTerminatorAfter;
}
number(str, number) {
function isNonDecimalLiteral(str) {
if (str.length > 2 && str.charCodeAt(0) === 48) {
const secondChar = str.charCodeAt(1);
return secondChar === 98 || secondChar === 111 || secondChar === 120;
}
return false;
}
this.word(str);
if (Number.isInteger(number) && !isNonDecimalLiteral(str) && !SCIENTIFIC_NOTATION.test(str) && !ZERO_DECIMAL_INTEGER.test(str) && str.charCodeAt(str.length - 1) !== 46) {
this.setLastChar(-2);
}
}
token(str, maybeNewline = false, occurrenceCount = 0, mayNeedSpace = false) {
this.tokenContext &= _index.TokenContext.forInOrInitHeadAccumulatePassThroughMask;
this._maybePrintInnerComments(str, occurrenceCount);
const flags = this._flags;
if (flags & 32) {
this._maybeAddAuxComment();
}
if (flags & 1) {
this._catchUpToCurrentToken(str, occurrenceCount);
}
if (mayNeedSpace) {
const strFirst = str.charCodeAt(0);
if ((strFirst === 45 && str === "--" || strFirst === 61) && this.getLastChar() === 33 || strFirst === 43 && this.getLastChar() === 43 || strFirst === 45 && this.getLastChar() === 45 || strFirst === 46 && this.getLastChar() === -2) {
this._space();
}
}
this._append(str, maybeNewline);
this._noLineTerminator = false;
}
tokenChar(char, occurrenceCount = 0) {
this.tokenContext &= _index.TokenContext.forInOrInitHeadAccumulatePassThroughMask;
this._maybePrintInnerComments(char, occurrenceCount);
const flags = this._flags;
if (flags & 32) {
this._maybeAddAuxComment();
}
if (flags & 1) {
this._catchUpToCurrentToken(char, occurrenceCount);
}
if (char === 43 && this.getLastChar() === 43 || char === 45 && this.getLastChar() === 45 || char === 46 && this.getLastChar() === -2) {
this._space();
}
this._appendChar(char);
this._noLineTerminator = false;
}
newline(i = 1, flags = this._flags) {
if (i <= 0) return;
if (flags & (8 | 2)) {
return;
}
if (flags & 4) {
this.space();
return;
}
if (i > 2) i = 2;
i -= this._buf.getNewlineCount();
for (let j = 0; j < i; j++) {
this._newline();
}
}
endsWith(char) {
return this.getLastChar(true) === char;
}
getLastChar(checkQueue) {
return this._buf.getLastChar(checkQueue);
}
setLastChar(char) {
this._buf._last = char;
}
exactSource(loc, cb) {
if (!loc) {
cb();
return;
}
this._catchUp("start", loc);
this._buf.exactSource(loc, cb);
}
source(prop, loc) {
if (!loc) return;
this._catchUp(prop, loc);
this._buf.source(prop, loc);
}
sourceWithOffset(prop, loc, columnOffset) {
if (!loc || this.format.preserveFormat) return;
this._catchUp(prop, loc);
this._buf.sourceWithOffset(prop, loc, columnOffset);
}
sourceIdentifierName(identifierName, pos) {
if (!this._buf._canMarkIdName) return;
const sourcePosition = this._buf._sourcePosition;
sourcePosition.identifierNamePos = pos;
sourcePosition.identifierName = identifierName;
}
_space() {
this._queue(32);
}
_newline() {
if (this._buf._queuedChar === 32) this._buf._queuedChar = 0;
this._appendChar(10, true);
}
_catchUpToCurrentToken(str, occurrenceCount = 0) {
const token = this.tokenMap.findMatching(this._currentNode, str, occurrenceCount);
if (token) this._catchUpTo(token.loc.start);
if (this._printSemicolonBeforeNextToken !== -1 && this._printSemicolonBeforeNextToken === this._buf.getCurrentLine()) {
this._appendChar(59, true);
}
this._printSemicolonBeforeNextToken = -1;
this._printSemicolonBeforeNextNode = -1;
}
_append(str, maybeNewline) {
this._maybeIndent();
this._buf.append(str, maybeNewline);
}
_appendChar(char, noIndent) {
if (!noIndent) {
this._maybeIndent();
}
this._buf.appendChar(char);
}
_queue(char) {
this._buf.queue(char);
this.setLastChar(-1);
}
_maybeIndent() {
const indent = this._shouldIndent();
if (indent > 0) {
this._buf._appendChar(-1, indent, false);
}
}
_shouldIndent() {
return this.endsWith(10) ? this._indent : 0;
}
catchUp(line) {
if (!this.format.retainLines) return;
const count = line - this._buf.getCurrentLine();
for (let i = 0; i < count; i++) {
this._newline();
}
}
_catchUp(prop, loc) {
const flags = this._flags;
if ((flags & 1) === 0) {
if (flags & 8 && loc != null && loc[prop]) {
this.catchUp(loc[prop].line);
}
return;
}
const pos = loc == null ? void 0 : loc[prop];
if (pos != null) this._catchUpTo(pos);
}
_catchUpTo({
line,
column,
index
}) {
const count = line - this._buf.getCurrentLine();
if (count > 0 && this._noLineTerminator) {
return;
}
for (let i = 0; i < count; i++) {
this._newline();
}
const spacesCount = count > 0 ? column : column - this._buf.getCurrentColumn();
if (spacesCount > 0) {
const spaces = this._originalCode ? this._originalCode.slice(index - spacesCount, index).replace(/[^\t\x0B\f \xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF]/gu, " ") : " ".repeat(spacesCount);
this._append(spaces, false);
this.setLastChar(32);
}
}
printTerminatorless(node) {
this._noLineTerminator = true;
this.print(node);
}
print(node, noLineTerminatorAfter = false, resetTokenContext = false, trailingCommentsLineOffset) {
var _node$leadingComments, _node$leadingComments2;
if (!node) return;
this._innerCommentsState = 0;
const {
type,
loc,
extra
} = node;
const flags = this._flags;
let changedFlags = false;
if (node._compact) {
this._flags |= 4;
changedFlags = true;
}
const nodeInfo = _nodes.generatorInfosMap.get(type);
if (nodeInfo === undefined) {
throw new ReferenceError(`unknown node of type ${JSON.stringify(type)} with constructor ${JSON.stringify(node.constructor.name)}`);
}
const [printMethod, nodeId, needsParens] = nodeInfo;
const parent = this._currentNode;
const parentId = this._currentTypeId;
this._currentNode = node;
this._currentTypeId = nodeId;
if (flags & 1) {
this._printSemicolonBeforeNextToken = this._printSemicolonBeforeNextNode;
}
let oldInAux;
if (flags & 32) {
oldInAux = this._insideAux;
this._insideAux = loc == null;
this._maybeAddAuxComment(this._insideAux && !oldInAux);
}
let oldTokenContext = 0;
if (resetTokenContext) {
oldTokenContext = this.tokenContext;
if (oldTokenContext & _index.TokenContext.forInOrInitHeadAccumulate) {
this.tokenContext = 0;
} else {
oldTokenContext = 0;
}
}
const parenthesized = extra != null && extra.parenthesized;
let shouldPrintParens = parenthesized && flags & 1 || parenthesized && flags & 16 && nodeId === 71 || parent && ((0, _index.parentNeedsParens)(node, parent, parentId) || needsParens != null && needsParens(node, parent, parentId, this.tokenContext, flags & 1 ? this._boundGetRawIdentifier : undefined));
if (!shouldPrintParens && parenthesized && (_node$leadingComments = node.leadingComments) != null && _node$leadingComments.length && node.leadingComments[0].type === "CommentBlock") {
switch (parentId) {
case 65:
case 243:
case 6:
case 143:
break;
case 17:
case 130:
case 112:
if (parent.callee !== node) break;
default:
shouldPrintParens = true;
}
}
let indentParenthesized = false;
if (!shouldPrintParens && this._noLineTerminator && ((_node$leadingComments2 = node.leadingComments) != null && _node$leadingComments2.some(commentIsNewline) || flags & 8 && loc && loc.start.line > this._buf.getCurrentLine())) {
shouldPrintParens = true;
indentParenthesized = true;
}
let oldNoLineTerminatorAfterNode;
if (!shouldPrintParens) {
noLineTerminatorAfter || (noLineTerminatorAfter = !!parent && this._noLineTerminatorAfterNode === parent && (0, _index.isLastChild)(parent, node));
if (noLineTerminatorAfter) {
var _node$trailingComment;
if ((_node$trailingComment = node.trailingComments) != null && _node$trailingComment.some(commentIsNewline)) {
if (isExpression(node)) shouldPrintParens = true;
} else {
oldNoLineTerminatorAfterNode = this._noLineTerminatorAfterNode;
this._noLineTerminatorAfterNode = node;
}
}
}
if (shouldPrintParens) {
this.tokenChar(40);
if (indentParenthesized) this.indent();
this._innerCommentsState = 0;
if (!resetTokenContext) {
oldTokenContext = this.tokenContext;
}
if (oldTokenContext & _index.TokenContext.forInOrInitHeadAccumulate) {
this.tokenContext = 0;
}
oldNoLineTerminatorAfterNode = this._noLineTerminatorAfterNode;
this._noLineTerminatorAfterNode = null;
}
this._printLeadingComments(node, parent);
this.exactSource(nodeId === 139 || nodeId === 66 ? null : loc, printMethod.bind(this, node, parent));
if (shouldPrintParens) {
this._printTrailingComments(node, parent);
if (indentParenthesized) {
this.dedent();
this.newline();
}
this.tokenChar(41);
this._noLineTerminator = noLineTerminatorAfter;
} else if (noLineTerminatorAfter && !this._noLineTerminator) {
this._noLineTerminator = true;
this._printTrailingComments(node, parent);
} else {
this._printTrailingComments(node, parent, trailingCommentsLineOffset);
}
if (oldTokenContext) this.tokenContext = oldTokenContext;
this._currentNode = parent;
this._currentTypeId = parentId;
if (changedFlags) {
this._flags = flags;
}
if (flags & 32) {
this._insideAux = oldInAux;
}
if (oldNoLineTerminatorAfterNode != null) {
this._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode;
}
this._innerCommentsState = 0;
}
_maybeAddAuxComment(enteredPositionlessNode) {
if (enteredPositionlessNode) this._printAuxBeforeComment();
if (!this._insideAux) this._printAuxAfterComment();
}
_printAuxBeforeComment() {
if (this._printAuxAfterOnNextUserNode) return;
this._printAuxAfterOnNextUserNode = true;
const comment = this.format.auxiliaryCommentBefore;
if (comment) {
this._printComment({
type: "CommentBlock",
value: comment
}, 0);
}
}
_printAuxAfterComment() {
if (!this._printAuxAfterOnNextUserNode) return;
this._printAuxAfterOnNextUserNode = false;
const comment = this.format.auxiliaryCommentAfter;
if (comment) {
this._printComment({
type: "CommentBlock",
value: comment
}, 0);
}
}
getPossibleRaw(node) {
const extra = node.extra;
if ((extra == null ? void 0 : extra.raw) != null && extra.rawValue != null && node.value === extra.rawValue) {
return extra.raw;
}
}
printJoin(nodes, statement, indent, separator, printTrailingSeparator, resetTokenContext, trailingCommentsLineOffset) {
if (!(nodes != null && nodes.length)) return;
const flags = this._flags;
if (indent == null && flags & 8) {
var _nodes$0$loc;
const startLine = (_nodes$0$loc = nodes[0].loc) == null ? void 0 : _nodes$0$loc.start.line;
if (startLine != null && startLine !== this._buf.getCurrentLine()) {
indent = true;
}
}
if (indent) this.indent(flags);
const len = nodes.length;
for (let i = 0; i < len; i++) {
const node = nodes[i];
if (!node) continue;
if (statement && i === 0 && this._buf.hasContent()) {
this.newline(1, flags);
}
this.print(node, false, resetTokenContext, trailingCommentsLineOffset || 0);
if (separator != null) {
if (i < len - 1) separator.call(this, i, false);else if (printTrailingSeparator) separator.call(this, i, true);
}
if (statement) {
if (i + 1 === len) {
this.newline(1, flags);
} else {
const lastCommentLine = this._lastCommentLine;
if (lastCommentLine > 0) {
var _nodes$loc;
const offset = (((_nodes$loc = nodes[i + 1].loc) == null ? void 0 : _nodes$loc.start.line) || 0) - lastCommentLine;
if (offset >= 0) {
this.newline(offset || 1, flags);
continue;
}
}
this.newline(1, flags);
}
}
}
if (indent) this.dedent(flags);
}
printAndIndentOnComments(node) {
const indent = node.leadingComments && node.leadingComments.length > 0;
if (indent) this.indent();
this.print(node);
if (indent) this.dedent();
}
printBlock(body) {
if (body.type !== "EmptyStatement") {
this.space();
}
this.print(body);
}
_printTrailingComments(node, parent, lineOffset) {
const {
innerComments,
trailingComments
} = node;
if (innerComments != null && innerComments.length) {
this._printComments(2, innerComments, node, parent, lineOffset);
}
if (trailingComments != null && trailingComments.length) {
this._printComments(2, trailingComments, node, parent, lineOffset);
} else {
this._lastCommentLine = 0;
}
}
_printLeadingComments(node, parent) {
const comments = node.leadingComments;
if (!(comments != null && comments.length)) return;
this._printComments(0, comments, node, parent);
}
_maybePrintInnerComments(nextTokenStr, nextTokenOccurrenceCount) {
var _this$tokenMap;
const state = this._innerCommentsState;
switch (state & 3) {
case 0:
this._innerCommentsState = 1 | 4;
return;
case 1:
this.printInnerComments((state & 4) > 0, (_this$tokenMap = this.tokenMap) == null ? void 0 : _this$tokenMap.findMatching(this._currentNode, nextTokenStr, nextTokenOccurrenceCount));
}
}
printInnerComments(indent = true, nextToken) {
const node = this._currentNode;
const comments = node.innerComments;
if (!(comments != null && comments.length)) {
this._innerCommentsState = 2;
return;
}
const hasSpace = this.endsWith(32);
if (indent) this.indent();
switch (this._printComments(1, comments, node, undefined, undefined, nextToken)) {
case 2:
this._innerCommentsState = 2;
case 1:
if (hasSpace) this.space();
}
if (indent) this.dedent();
}
noIndentInnerCommentsHere() {
this._innerCommentsState &= ~4;
}
printSequence(nodes, indent, resetTokenContext, trailingCommentsLineOffset) {
this.printJoin(nodes, true, indent != null ? indent : false, undefined, undefined, resetTokenContext, trailingCommentsLineOffset);
}
printList(items, printTrailingSeparator, statement, indent, separator, resetTokenContext) {
this.printJoin(items, statement, indent, separator != null ? separator : commaSeparator, printTrailingSeparator, resetTokenContext);
}
shouldPrintTrailingComma(listEnd) {
if (!this.tokenMap) return null;
const listEndIndex = this.tokenMap.findLastIndex(this._currentNode, token => this.tokenMap.matchesOriginal(token, typeof listEnd === "number" ? String.fromCharCode(listEnd) : listEnd));
if (listEndIndex <= 0) return null;
return this.tokenMap.matchesOriginal(this._tokens[listEndIndex - 1], ",");
}
_shouldPrintComment(comment, nextToken) {
if (comment.ignore) return 0;
if (this._printedComments.has(comment)) return 0;
if (this._noLineTerminator && HAS_NEWLINE_OR_BlOCK_COMMENT_END.test(comment.value)) {
return 2;
}
if (nextToken && this.tokenMap) {
const commentTok = this.tokenMap.find(this._currentNode, token => token.value === comment.value);
if (commentTok && commentTok.start > nextToken.start) {
return 2;
}
}
this._printedComments.add(comment);
if (!this.format.shouldPrintComment(comment.value)) {
return 0;
}
return 1;
}
_printComment(comment, skipNewLines) {
const noLineTerminator = this._noLineTerminator;
const isBlockComment = comment.type === "CommentBlock";
const printNewLines = isBlockComment && skipNewLines !== 1 && !noLineTerminator;
if (printNewLines && this._buf.hasContent() && skipNewLines !== 2) {
this.newline(1);
}
switch (this.getLastChar(true)) {
case 47:
this._space();
case 91:
case 123:
case 40:
break;
default:
this.space();
}
let val;
if (isBlockComment) {
val = `/*${comment.value}*/`;
if (this.format.indent.adjustMultilineComment) {
var _comment$loc;
const offset = (_comment$loc = comment.loc) == null ? void 0 : _comment$loc.start.column;
if (offset) {
const newlineRegex = new RegExp("\\n\\s{1," + offset + "}", "g");
val = val.replace(newlineRegex, "\n");
}
if (this._flags & 4) {
val = val.replace(/\n(?!$)/g, `\n`);
} else {
let indentSize = this.format.retainLines ? 0 : this._buf.getCurrentColumn();
if (this._shouldIndent() || this.format.retainLines) {
indentSize += this._indent;
}
val = val.replace(/\n(?!$)/g, `\n${" ".repeat(indentSize)}`);
}
}
} else if (!noLineTerminator) {
val = `//${comment.value}`;
} else {
val = `/*${comment.value}*/`;
}
this.source("start", comment.loc);
this._append(val, isBlockComment);
if (!isBlockComment && !noLineTerminator) {
this._newline();
}
if (printNewLines && skipNewLines !== 3) {
this.newline(1);
}
}
_printComments(type, comments, node, parent, lineOffset = 0, nextToken) {
const nodeLoc = node.loc;
const len = comments.length;
let hasLoc = !!nodeLoc;
const nodeStartLine = hasLoc ? nodeLoc.start.line : 0;
const nodeEndLine = hasLoc ? nodeLoc.end.line : 0;
let lastLine = 0;
let leadingCommentNewline = 0;
const {
_noLineTerminator,
_flags
} = this;
for (let i = 0; i < len; i++) {
const comment = comments[i];
const shouldPrint = this._shouldPrintComment(comment, nextToken);
if (shouldPrint === 2) {
return i === 0 ? 0 : 1;
}
if (hasLoc && comment.loc && shouldPrint === 1) {
const commentStartLine = comment.loc.start.line;
const commentEndLine = comment.loc.end.line;
if (type === 0) {
let offset = 0;
if (i === 0) {
if (this._buf.hasContent() && (comment.type === "CommentLine" || commentStartLine !== commentEndLine)) {
offset = leadingCommentNewline = 1;
}
} else {
offset = commentStartLine - lastLine;
}
lastLine = commentEndLine;
if (offset > 0 && !_noLineTerminator) {
this.newline(offset, _flags);
}
this._printComment(comment, 1);
if (i + 1 === len) {
const count = Math.max(nodeStartLine - lastLine, leadingCommentNewline);
if (count > 0 && !_noLineTerminator) {
this.newline(count, _flags);
}
lastLine = nodeStartLine;
}
} else if (type === 1) {
const offset = commentStartLine - (i === 0 ? nodeStartLine : lastLine);
lastLine = commentEndLine;
if (offset > 0 && !_noLineTerminator) {
this.newline(offset, _flags);
}
this._printComment(comment, 1);
if (i + 1 === len) {
const count = Math.min(1, nodeEndLine - lastLine);
if (count > 0 && !_noLineTerminator) {
this.newline(count, _flags);
}
lastLine = nodeEndLine;
}
} else {
const offset = commentStartLine - (i === 0 ? nodeEndLine - lineOffset : lastLine);
lastLine = commentEndLine;
if (offset > 0 && !_noLineTerminator) {
this.newline(offset, _flags);
}
this._printComment(comment, 1);
}
} else {
hasLoc = false;
if (shouldPrint !== 1) {
continue;
}
if (len === 1) {
const singleLine = comment.loc ? comment.loc.start.line === comment.loc.end.line : !HAS_NEWLINE.test(comment.value);
const shouldSkipNewline = singleLine && !isStatement(node) && !isClassBody(parent) && !isTSInterfaceBody(parent) && !isTSEnumMember(node);
if (type === 0) {
this._printComment(comment, shouldSkipNewline && node.type !== "ObjectExpression" || singleLine && isFunction(parent) && parent.body === node ? 1 : 0);
} else if (shouldSkipNewline && type === 2) {
this._printComment(comment, 1);
} else {
this._printComment(comment, 0);
}
} else if (type === 1 && !(node.type === "ObjectExpression" && node.properties.length > 1) && node.type !== "ClassBody" && node.type !== "TSInterfaceBody") {
this._printComment(comment, i === 0 ? 2 : i === len - 1 ? 3 : 0);
} else {
this._printComment(comment, 0);
}
}
}
if (type === 2 && hasLoc && lastLine) {
this._lastCommentLine = lastLine;
}
return 2;
}
}
var _default = exports.default = Printer;
function commaSeparator(occurrenceCount, last) {
this.tokenChar(44, occurrenceCount);
if (!last) this.space();
}
//# sourceMappingURL=printer.js.map

View File

@@ -0,0 +1,65 @@
const bufLength = 1024 * 16;
// Provide a fallback for older environments.
const td =
typeof TextDecoder !== 'undefined'
? /* #__PURE__ */ new TextDecoder()
: typeof Buffer !== 'undefined'
? {
decode(buf: Uint8Array): string {
const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);
return out.toString();
},
}
: {
decode(buf: Uint8Array): string {
let out = '';
for (let i = 0; i < buf.length; i++) {
out += String.fromCharCode(buf[i]);
}
return out;
},
};
export class StringWriter {
pos = 0;
private out = '';
private buffer = new Uint8Array(bufLength);
write(v: number): void {
const { buffer } = this;
buffer[this.pos++] = v;
if (this.pos === bufLength) {
this.out += td.decode(buffer);
this.pos = 0;
}
}
flush(): string {
const { buffer, out, pos } = this;
return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;
}
}
export class StringReader {
pos = 0;
declare private buffer: string;
constructor(buffer: string) {
this.buffer = buffer;
}
next(): number {
return this.buffer.charCodeAt(this.pos++);
}
peek(): number {
return this.buffer.charCodeAt(this.pos);
}
indexOf(char: string): number {
const { buffer, pos } = this;
const idx = buffer.indexOf(char, pos);
return idx === -1 ? buffer.length : idx;
}
}

View File

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

View File

@@ -0,0 +1,13 @@
function filterViewAnimations(animation) {
var _a;
const { effect } = animation;
if (!effect)
return false;
return (effect.target === document.documentElement &&
((_a = effect.pseudoElement) === null || _a === void 0 ? void 0 : _a.startsWith("::view-transition")));
}
function getViewAnimations() {
return document.getAnimations().filter(filterViewAnimations);
}
export { getViewAnimations };

View File

@@ -0,0 +1 @@
{"version":3,"file":"composable.cjs","names":["defaultConfigValues: GraphqlConfig","fetchOptions: RequestInit","headers: Record<string, string>","request","getRequestUrl"],"sources":["../../src/graphql/composable.ts"],"sourcesContent":["import type { AuthenticationClient } from '../auth/types.js';\nimport type { DirectusClient } from '../types/client.js';\nimport { getRequestUrl } from '../utils/get-request-url.js';\nimport { request } from '../utils/request.js';\nimport type { GraphqlClient, GraphqlConfig } from './types.js';\n\nconst defaultConfigValues: GraphqlConfig = {};\n\n/**\n * Creates a client to communicate with Directus GraphQL.\n *\n * @returns A Directus GraphQL client.\n */\nexport const graphql = (config: Partial<GraphqlConfig> = {}) => {\n\treturn <Schema>(client: DirectusClient<Schema>): GraphqlClient<Schema> => {\n\t\tconst gqlConfig = { ...defaultConfigValues, ...config };\n\t\treturn {\n\t\t\tasync query<Output extends object = Record<string, any>>(\n\t\t\t\tquery: string,\n\t\t\t\tvariables?: Record<string, unknown>,\n\t\t\t\tscope: 'items' | 'system' = 'items',\n\t\t\t): Promise<Output> {\n\t\t\t\tconst fetchOptions: RequestInit = {\n\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\tbody: JSON.stringify({ query, variables }),\n\t\t\t\t};\n\n\t\t\t\tif ('credentials' in gqlConfig) {\n\t\t\t\t\tfetchOptions.credentials = gqlConfig.credentials;\n\t\t\t\t}\n\n\t\t\t\tconst headers: Record<string, string> = {};\n\n\t\t\t\tif ('getToken' in this) {\n\t\t\t\t\tconst token = await (this.getToken as AuthenticationClient<Schema>['getToken'])();\n\n\t\t\t\t\tif (token) {\n\t\t\t\t\t\theaders['Authorization'] = `Bearer ${token}`;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ('Content-Type' in headers === false) {\n\t\t\t\t\theaders['Content-Type'] = 'application/json';\n\t\t\t\t}\n\n\t\t\t\tfetchOptions.headers = headers;\n\t\t\t\tconst requestPath = scope === 'items' ? '/graphql' : '/graphql/system';\n\t\t\t\tconst requestUrl = getRequestUrl(client.url, requestPath);\n\n\t\t\t\treturn await request<Output>(requestUrl.toString(), fetchOptions, client.globals.fetch);\n\t\t\t},\n\t\t};\n\t};\n};\n"],"mappings":"kFAMMA,EAAqC,EAAE,CAOhC,GAAW,EAAiC,EAAE,GAC1C,GAA0D,CACzE,IAAM,EAAY,CAAE,GAAG,EAAqB,GAAG,EAAQ,CACvD,MAAO,CACN,MAAM,MACL,EACA,EACA,EAA4B,QACV,CAClB,IAAMC,EAA4B,CACjC,OAAQ,OACR,KAAM,KAAK,UAAU,CAAE,QAAO,YAAW,CAAC,CAC1C,CAEG,gBAAiB,IACpB,EAAa,YAAc,EAAU,aAGtC,IAAMC,EAAkC,EAAE,CAE1C,GAAI,aAAc,KAAM,CACvB,IAAM,EAAQ,MAAO,KAAK,UAAuD,CAE7E,IACH,EAAQ,cAAmB,UAAU,KAInC,iBAAkB,IACrB,EAAQ,gBAAkB,oBAG3B,EAAa,QAAU,EACvB,IAAM,EAAc,IAAU,QAAU,WAAa,kBAGrD,OAAO,MAAMC,EAAAA,QAFMC,EAAAA,cAAc,EAAO,IAAK,EAAY,CAEjB,UAAU,CAAE,EAAc,EAAO,QAAQ,MAAM,EAExF"}

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"file":"cross.js","sources":["../../../src/icons/cross.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Cross\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTEgMmEyIDIgMCAwIDAtMiAydjVINGEyIDIgMCAwIDAtMiAydjJjMCAxLjEuOSAyIDIgMmg1djVjMCAxLjEuOSAyIDIgMmgyYTIgMiAwIDAgMCAyLTJ2LTVoNWEyIDIgMCAwIDAgMi0ydi0yYTIgMiAwIDAgMC0yLTJoLTVWNGEyIDIgMCAwIDAtMi0yaC0yeiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/cross\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 Cross = createLucideIcon('Cross', [\n [\n 'path',\n {\n d: 'M11 2a2 2 0 0 0-2 2v5H4a2 2 0 0 0-2 2v2c0 1.1.9 2 2 2h5v5c0 1.1.9 2 2 2h2a2 2 0 0 0 2-2v-5h5a2 2 0 0 0 2-2v-2a2 2 0 0 0-2-2h-5V4a2 2 0 0 0-2-2h-2z',\n key: '1t5g7j',\n },\n ],\n]);\n\nexport default Cross;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,iBAAiB,OAAS,CAAA,CAAA,CAAA;AAAA,CACtC,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,26 @@
import type { CollectionSlug, FindOptions, JoinQuery } from '../../index.js';
import type { ApplyDisableErrors, JsonObject, PayloadRequest, PopulateType, SelectType, TransformCollectionWithSelect } from '../../types/index.js';
import type { Collection, SelectFromCollectionSlug } from '../config/types.js';
import { type AfterReadArgs } from '../../fields/hooks/afterRead/index.js';
export type FindByIDArgs = {
collection: Collection;
currentDepth?: number;
/**
* You may pass the document data directly which will skip the `db.findOne` database query.
* This is useful if you want to use this endpoint solely for running hooks and populating data.
*/
data?: Record<string, unknown>;
depth?: number;
disableErrors?: boolean;
draft?: boolean;
id: number | string;
includeLockStatus?: boolean;
joins?: JoinQuery;
overrideAccess?: boolean;
populate?: PopulateType;
req: PayloadRequest;
showHiddenFields?: boolean;
trash?: boolean;
} & Pick<AfterReadArgs<JsonObject>, 'flattenLocales'> & Pick<FindOptions<string, SelectType>, 'select'>;
export declare const findByIDOperation: <TSlug extends CollectionSlug, TDisableErrors extends boolean, TSelect extends SelectFromCollectionSlug<TSlug>>(incomingArgs: FindByIDArgs) => Promise<ApplyDisableErrors<TransformCollectionWithSelect<TSlug, TSelect>, TDisableErrors>>;
//# sourceMappingURL=findByID.d.ts.map

View File

@@ -0,0 +1,10 @@
'use strict'
const { test } = require('node:test')
const isObject = require('./is-object')
test('returns correct answer', t => {
t.assert.strictEqual(isObject({}), true)
t.assert.strictEqual(isObject([]), false)
t.assert.strictEqual(isObject(42), false)
})

View File

@@ -0,0 +1,57 @@
{
"name": "thread-stream",
"version": "3.1.0",
"description": "A streaming way to send data to a Node.js Worker Thread",
"main": "index.js",
"types": "index.d.ts",
"dependencies": {
"real-require": "^0.2.0"
},
"devDependencies": {
"@types/node": "^20.1.0",
"@types/tap": "^15.0.0",
"@yao-pkg/pkg": "^5.11.5",
"desm": "^1.3.0",
"fastbench": "^1.0.1",
"husky": "^9.0.6",
"pino-elasticsearch": "^8.0.0",
"sonic-boom": "^4.0.1",
"standard": "^17.0.0",
"tap": "^16.2.0",
"ts-node": "^10.8.0",
"typescript": "^5.3.2",
"why-is-node-running": "^2.2.2"
},
"scripts": {
"build": "tsc --noEmit",
"test": "standard && npm run build && npm run transpile && tap \"test/**/*.test.*js\" && tap --ts test/*.test.*ts",
"test:ci": "standard && npm run transpile && npm run test:ci:js && npm run test:ci:ts",
"test:ci:js": "tap --no-check-coverage --timeout=120 --coverage-report=lcovonly \"test/**/*.test.*js\"",
"test:ci:ts": "tap --ts --no-check-coverage --coverage-report=lcovonly \"test/**/*.test.*ts\"",
"test:yarn": "npm run transpile && tap \"test/**/*.test.js\" --no-check-coverage",
"transpile": "sh ./test/ts/transpile.sh",
"prepare": "husky install"
},
"standard": {
"ignore": [
"test/ts/**/*",
"test/syntax-error.mjs"
]
},
"repository": {
"type": "git",
"url": "git+https://github.com/mcollina/thread-stream.git"
},
"keywords": [
"worker",
"thread",
"threads",
"stream"
],
"author": "Matteo Collina <hello@matteocollina.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/mcollina/thread-stream/issues"
},
"homepage": "https://github.com/mcollina/thread-stream#readme"
}

View File

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

View File

@@ -0,0 +1,24 @@
import { DsnComponents } from '../types-hoist/dsn';
import { MetricContainerItem, MetricEnvelope } from '../types-hoist/envelope';
import { SerializedMetric } from '../types-hoist/metric';
import { SdkMetadata } from '../types-hoist/sdkmetadata';
/**
* Creates a metric container envelope item for a list of metrics.
*
* @param items - The metrics to include in the envelope.
* @returns The created metric container envelope item.
*/
export declare function createMetricContainerEnvelopeItem(items: Array<SerializedMetric>): MetricContainerItem;
/**
* Creates an envelope for a list of metrics.
*
* Metrics from multiple traces can be included in the same envelope.
*
* @param metrics - The metrics to include in the envelope.
* @param metadata - The metadata to include in the envelope.
* @param tunnel - The tunnel to include in the envelope.
* @param dsn - The DSN to include in the envelope.
* @returns The created envelope.
*/
export declare function createMetricEnvelope(metrics: Array<SerializedMetric>, metadata?: SdkMetadata, tunnel?: string, dsn?: DsnComponents): MetricEnvelope;
//# sourceMappingURL=envelope.d.ts.map

View File

@@ -0,0 +1,5 @@
import type { Span } from '@opentelemetry/api';
import type { SpanOrigin } from '@sentry/core';
/** Adds an origin to an OTEL Span. */
export declare function addOriginToSpan(span: Span, origin: SpanOrigin): void;
//# sourceMappingURL=addOriginToSpan.d.ts.map

View File

@@ -0,0 +1,28 @@
import { formatDistance } from "./cy/_lib/formatDistance.js";
import { formatLong } from "./cy/_lib/formatLong.js";
import { formatRelative } from "./cy/_lib/formatRelative.js";
import { localize } from "./cy/_lib/localize.js";
import { match } from "./cy/_lib/match.js";
/**
* @category Locales
* @summary Welsh locale.
* @language Welsh
* @iso-639-2 cym
* @author Elwyn Malethan [@elmomalmo](https://github.com/elmomalmo)
*/
export const cy = {
code: "cy",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 0 /* Sunday */,
firstWeekContainsDate: 1,
},
};
// Fallback for modularized imports:
export default cy;

View File

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

View File

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

View File

@@ -0,0 +1,10 @@
function _objectWithoutPropertiesLoose(r, e) {
if (null == r) return {};
var t = {};
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
if (-1 !== e.indexOf(n)) continue;
t[n] = r[n];
}
return t;
}
export { _objectWithoutPropertiesLoose as default };

View File

@@ -0,0 +1 @@
{"version":3,"file":"layout-panel-left.js","sources":["../../../src/icons/layout-panel-left.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name LayoutPanelLeft\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIxOCIgeD0iMyIgeT0iMyIgcng9IjEiIC8+CiAgPHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iNyIgeD0iMTQiIHk9IjMiIHJ4PSIxIiAvPgogIDxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjciIHg9IjE0IiB5PSIxNCIgcng9IjEiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/layout-panel-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 LayoutPanelLeft = createLucideIcon('LayoutPanelLeft', [\n ['rect', { width: '7', height: '18', x: '3', y: '3', rx: '1', key: '2obqm' }],\n ['rect', { width: '7', height: '7', x: '14', y: '3', rx: '1', key: '6d4xhi' }],\n ['rect', { width: '7', height: '7', x: '14', y: '14', rx: '1', key: 'nxv5o0' }],\n]);\n\nexport default LayoutPanelLeft;\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,CAAkB,iBAAiB,iBAAmB,CAAA,CAAA,CAAA;AAAA,CAAA,CAC1D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,KAAK,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,SAAS,CAAA,CAAA;AAAA,CAAA,CAC5E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,KAAK,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,GAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC7E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,KAAK,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,GAAG,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAChF,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,33 @@
{
"name": "@webassemblyjs/wasm-edit",
"version": "1.14.1",
"description": "",
"main": "lib/index.js",
"module": "esm/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/xtuc/webassemblyjs.git"
},
"publishConfig": {
"access": "public"
},
"author": "Sven Sauleau",
"license": "MIT",
"dependencies": {
"@webassemblyjs/ast": "1.14.1",
"@webassemblyjs/helper-buffer": "1.14.1",
"@webassemblyjs/helper-wasm-bytecode": "1.13.2",
"@webassemblyjs/helper-wasm-section": "1.14.1",
"@webassemblyjs/wasm-gen": "1.14.1",
"@webassemblyjs/wasm-opt": "1.14.1",
"@webassemblyjs/wasm-parser": "1.14.1",
"@webassemblyjs/wast-printer": "1.14.1"
},
"devDependencies": {
"@webassemblyjs/helper-test-framework": "1.14.1"
},
"gitHead": "25d52b1296e151ac56244a7c3886661e6b4a69ea"
}

View File

@@ -0,0 +1,15 @@
interface ConvertOptions {
cap?: boolean;
curry?: boolean;
fixed?: boolean;
immutable?: boolean;
rearg?: boolean;
}
interface Convert {
(func: object, options?: ConvertOptions): any;
(name: string, func: (...args: any[]) => any, options?: ConvertOptions): any;
}
declare const convert: Convert;
export = convert;

View File

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

View File

@@ -0,0 +1,7 @@
export * from "./delete.js";
export * from "./insert.js";
export * from "./query-builder.js";
export * from "./refresh-materialized-view.js";
export * from "./select.js";
export * from "./select.types.js";
export * from "./update.js";

View File

@@ -0,0 +1,2 @@
const e=require(`./is-system-collection.cjs`),t=(t,n)=>{if(e.isSystemCollection(String(t)))throw Error(n)};exports.throwIfCoreCollection=t;
//# sourceMappingURL=throw-core-collection.cjs.map

View File

@@ -0,0 +1,118 @@
import { buildMatchFn } from "../../_lib/buildMatchFn.js";
import { buildMatchPatternFn } from "../../_lib/buildMatchPatternFn.js";
const matchOrdinalNumberPattern =
/^(\d+)(-?[врмт][аи]|-?т?(ен|на)|-?(ев|ева))?/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^((пр)?н\.?\s?е\.?)/i,
abbreviated: /^((пр)?н\.?\s?е\.?)/i,
wide: /^(преди новата ера|новата ера|нова ера)/i,
};
const parseEraPatterns = {
any: [/^п/i, /^н/i],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^[1234](-?[врт]?o?)? тримес.?/i,
wide: /^[1234](-?[врт]?о?)? тримесечие/i,
};
const parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i],
};
const matchDayPatterns = {
narrow: /^[нпвсч]/i,
short: /^(нд|пн|вт|ср|чт|пт|сб)/i,
abbreviated: /^(нед|пон|вто|сря|чет|пет|съб)/i,
wide: /^(неделя|понеделник|вторник|сряда|четвъртък|петък|събота)/i,
};
const parseDayPatterns = {
narrow: [/^н/i, /^п/i, /^в/i, /^с/i, /^ч/i, /^п/i, /^с/i],
any: [/^н[ед]/i, /^п[он]/i, /^вт/i, /^ср/i, /^ч[ет]/i, /^п[ет]/i, /^с[ъб]/i],
};
const matchMonthPatterns = {
abbreviated: /^(яну|фев|мар|апр|май|юни|юли|авг|сеп|окт|ное|дек)/i,
wide: /^(януари|февруари|март|април|май|юни|юли|август|септември|октомври|ноември|декември)/i,
};
const parseMonthPatterns = {
any: [
/^я/i,
/^ф/i,
/^мар/i,
/^ап/i,
/^май/i,
/^юн/i,
/^юл/i,
/^ав/i,
/^се/i,
/^окт/i,
/^но/i,
/^де/i,
],
};
const matchDayPeriodPatterns = {
any: /^(преди о|след о|в по|на о|през|веч|сут|следо)/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^преди о/i,
pm: /^след о/i,
midnight: /^в пол/i,
noon: /^на об/i,
morning: /^сут/i,
afternoon: /^следо/i,
evening: /^веч/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",
}),
};

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,eAAO,MAAM,eAAe,SACpB,MAAM,GAAG,GAAG,gBACL,MAAM,KAClB,MAsCF,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,eAAO,MAAM,eAAe,SACpB,MAAM,GAAG,GAAG,gBACL,MAAM,QAEiD,CAAA"}

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