docs: 仓库链接指向本镜像仓库
Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s

This commit is contained in:
TanTan committed 2026-11-13 09:25:58 +08:00
1 parent f954252a34
commit e311ca3275
35554 files changed
+6229626 -4

No files matched your search

@@ -0,0 +1,253 @@
import {getCollectionId as $feb5ffebff200149$export$6aeb1680a0ae8741, isNonContiguousSelectionModifier as $feb5ffebff200149$export$d3e3bd3e26688c04} from "./utils.module.js";
import {useRouter as $581M0$useRouter, useId as $581M0$useId, isCtrlKeyPressed as $581M0$isCtrlKeyPressed, mergeProps as $581M0$mergeProps, chain as $581M0$chain, openLink as $581M0$openLink} from "@react-aria/utils";
import {focusSafely as $581M0$focusSafely, usePress as $581M0$usePress, useLongPress as $581M0$useLongPress} from "@react-aria/interactions";
import {moveVirtualFocus as $581M0$moveVirtualFocus} from "@react-aria/focus";
import {useEffect as $581M0$useEffect, useRef as $581M0$useRef} from "react";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you 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 http://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 REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
let { id: id, selectionManager: manager, key: key, ref: ref, shouldSelectOnPressUp: shouldSelectOnPressUp, shouldUseVirtualFocus: shouldUseVirtualFocus, focus: focus, isDisabled: isDisabled, onAction: onAction, allowsDifferentPressOrigin: allowsDifferentPressOrigin, linkBehavior: linkBehavior = 'action' } = options;
let router = (0, $581M0$useRouter)();
id = (0, $581M0$useId)(id);
let onSelect = (e)=>{
if (e.pointerType === 'keyboard' && (0, $feb5ffebff200149$export$d3e3bd3e26688c04)(e)) manager.toggleSelection(key);
else {
if (manager.selectionMode === 'none') return;
if (manager.isLink(key)) {
if (linkBehavior === 'selection' && ref.current) {
let itemProps = manager.getItemProps(key);
router.open(ref.current, e, itemProps.href, itemProps.routerOptions);
// Always set selected keys back to what they were so that select and combobox close.
manager.setSelectedKeys(manager.selectedKeys);
return;
} else if (linkBehavior === 'override' || linkBehavior === 'none') return;
}
if (manager.selectionMode === 'single') {
if (manager.isSelected(key) && !manager.disallowEmptySelection) manager.toggleSelection(key);
else manager.replaceSelection(key);
} else if (e && e.shiftKey) manager.extendSelection(key);
else if (manager.selectionBehavior === 'toggle' || e && ((0, $581M0$isCtrlKeyPressed)(e) || e.pointerType === 'touch' || e.pointerType === 'virtual')) // if touch or virtual (VO) then we just want to toggle, otherwise it's impossible to multi select because they don't have modifier keys
manager.toggleSelection(key);
else manager.replaceSelection(key);
}
};
// Focus the associated DOM node when this item becomes the focusedKey
// TODO: can't make this useLayoutEffect bacause it breaks menus inside dialogs
// However, if this is a useEffect, it runs twice and dispatches two blur events and immediately sets
// aria-activeDescendant in useAutocomplete... I've worked around this for now
(0, $581M0$useEffect)(()=>{
let isFocused = key === manager.focusedKey;
if (isFocused && manager.isFocused) {
if (!shouldUseVirtualFocus) {
if (focus) focus();
else if (document.activeElement !== ref.current && ref.current) (0, $581M0$focusSafely)(ref.current);
} else (0, $581M0$moveVirtualFocus)(ref.current);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [
ref,
key,
manager.focusedKey,
manager.childFocusStrategy,
manager.isFocused,
shouldUseVirtualFocus
]);
isDisabled = isDisabled || manager.isDisabled(key);
// Set tabIndex to 0 if the element is focused, or -1 otherwise so that only the last focused
// item is tabbable. If using virtual focus, don't set a tabIndex at all so that VoiceOver
// on iOS 14 doesn't try to move real DOM focus to the item anyway.
let itemProps = {};
if (!shouldUseVirtualFocus && !isDisabled) itemProps = {
tabIndex: key === manager.focusedKey ? 0 : -1,
onFocus (e) {
if (e.target === ref.current) manager.setFocusedKey(key);
}
};
else if (isDisabled) itemProps.onMouseDown = (e)=>{
// Prevent focus going to the body when clicking on a disabled item.
e.preventDefault();
};
// With checkbox selection, onAction (i.e. navigation) becomes primary, and occurs on a single click of the row.
// Clicking the checkbox enters selection mode, after which clicking anywhere on any row toggles selection for that row.
// With highlight selection, onAction is secondary, and occurs on double click. Single click selects the row.
// With touch, onAction occurs on single tap, and long press enters selection mode.
let isLinkOverride = manager.isLink(key) && linkBehavior === 'override';
let isActionOverride = onAction && options['UNSTABLE_itemBehavior'] === 'action';
let hasLinkAction = manager.isLink(key) && linkBehavior !== 'selection' && linkBehavior !== 'none';
let allowsSelection = !isDisabled && manager.canSelectItem(key) && !isLinkOverride && !isActionOverride;
let allowsActions = (onAction || hasLinkAction) && !isDisabled;
let hasPrimaryAction = allowsActions && (manager.selectionBehavior === 'replace' ? !allowsSelection : !allowsSelection || manager.isEmpty);
let hasSecondaryAction = allowsActions && allowsSelection && manager.selectionBehavior === 'replace';
let hasAction = hasPrimaryAction || hasSecondaryAction;
let modality = (0, $581M0$useRef)(null);
let longPressEnabled = hasAction && allowsSelection;
let longPressEnabledOnPressStart = (0, $581M0$useRef)(false);
let hadPrimaryActionOnPressStart = (0, $581M0$useRef)(false);
let collectionItemProps = manager.getItemProps(key);
let performAction = (e)=>{
if (onAction) {
var _ref_current;
onAction();
(_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.dispatchEvent(new CustomEvent('react-aria-item-action', {
bubbles: true
}));
}
if (hasLinkAction && ref.current) router.open(ref.current, e, collectionItemProps.href, collectionItemProps.routerOptions);
};
// By default, selection occurs on pointer down. This can be strange if selecting an
// item causes the UI to disappear immediately (e.g. menus).
// If shouldSelectOnPressUp is true, we use onPressUp instead of onPressStart.
// onPress requires a pointer down event on the same element as pointer up. For menus,
// we want to be able to have the pointer down on the trigger that opens the menu and
// the pointer up on the menu item rather than requiring a separate press.
// For keyboard events, selection still occurs on key down.
let itemPressProps = {
ref: ref
};
if (shouldSelectOnPressUp) {
itemPressProps.onPressStart = (e)=>{
modality.current = e.pointerType;
longPressEnabledOnPressStart.current = longPressEnabled;
if (e.pointerType === 'keyboard' && (!hasAction || $880e95eb8b93ba9a$var$isSelectionKey())) onSelect(e);
};
// If allowsDifferentPressOrigin and interacting with mouse, make selection happen on pressUp (e.g. open menu on press down, selection on menu item happens on press up.)
// Otherwise, have selection happen onPress (prevents listview row selection when clicking on interactable elements in the row)
if (!allowsDifferentPressOrigin) itemPressProps.onPress = (e)=>{
if (hasPrimaryAction || hasSecondaryAction && e.pointerType !== 'mouse') {
if (e.pointerType === 'keyboard' && !$880e95eb8b93ba9a$var$isActionKey()) return;
performAction(e);
} else if (e.pointerType !== 'keyboard' && allowsSelection) onSelect(e);
};
else {
itemPressProps.onPressUp = hasPrimaryAction ? undefined : (e)=>{
if (e.pointerType === 'mouse' && allowsSelection) onSelect(e);
};
itemPressProps.onPress = hasPrimaryAction ? performAction : (e)=>{
if (e.pointerType !== 'keyboard' && e.pointerType !== 'mouse' && allowsSelection) onSelect(e);
};
}
} else {
itemPressProps.onPressStart = (e)=>{
modality.current = e.pointerType;
longPressEnabledOnPressStart.current = longPressEnabled;
hadPrimaryActionOnPressStart.current = hasPrimaryAction;
// Select on mouse down unless there is a primary action which will occur on mouse up.
// For keyboard, select on key down. If there is an action, the Space key selects on key down,
// and the Enter key performs onAction on key up.
if (allowsSelection && (e.pointerType === 'mouse' && !hasPrimaryAction || e.pointerType === 'keyboard' && (!allowsActions || $880e95eb8b93ba9a$var$isSelectionKey()))) onSelect(e);
};
itemPressProps.onPress = (e)=>{
// Selection occurs on touch up. Primary actions always occur on pointer up.
// Both primary and secondary actions occur on Enter key up. The only exception
// is secondary actions, which occur on double click with a mouse.
if (e.pointerType === 'touch' || e.pointerType === 'pen' || e.pointerType === 'virtual' || e.pointerType === 'keyboard' && hasAction && $880e95eb8b93ba9a$var$isActionKey() || e.pointerType === 'mouse' && hadPrimaryActionOnPressStart.current) {
if (hasAction) performAction(e);
else if (allowsSelection) onSelect(e);
}
};
}
itemProps['data-collection'] = (0, $feb5ffebff200149$export$6aeb1680a0ae8741)(manager.collection);
itemProps['data-key'] = key;
itemPressProps.preventFocusOnPress = shouldUseVirtualFocus;
// When using virtual focus, make sure the focused key gets updated on press.
if (shouldUseVirtualFocus) itemPressProps = (0, $581M0$mergeProps)(itemPressProps, {
onPressStart (e) {
if (e.pointerType !== 'touch') {
manager.setFocused(true);
manager.setFocusedKey(key);
}
},
onPress (e) {
if (e.pointerType === 'touch') {
manager.setFocused(true);
manager.setFocusedKey(key);
}
}
});
if (collectionItemProps) {
for (let key of [
'onPressStart',
'onPressEnd',
'onPressChange',
'onPress',
'onPressUp',
'onClick'
])if (collectionItemProps[key]) itemPressProps[key] = (0, $581M0$chain)(itemPressProps[key], collectionItemProps[key]);
}
let { pressProps: pressProps, isPressed: isPressed } = (0, $581M0$usePress)(itemPressProps);
// Double clicking with a mouse with selectionBehavior = 'replace' performs an action.
let onDoubleClick = hasSecondaryAction ? (e)=>{
if (modality.current === 'mouse') {
e.stopPropagation();
e.preventDefault();
performAction(e);
}
} : undefined;
// Long pressing an item with touch when selectionBehavior = 'replace' switches the selection behavior
// to 'toggle'. This changes the single tap behavior from performing an action (i.e. navigating) to
// selecting, and may toggle the appearance of a UI affordance like checkboxes on each item.
let { longPressProps: longPressProps } = (0, $581M0$useLongPress)({
isDisabled: !longPressEnabled,
onLongPress (e) {
if (e.pointerType === 'touch') {
onSelect(e);
manager.setSelectionBehavior('toggle');
}
}
});
// Prevent native drag and drop on long press if we also select on long press.
// Once the user is in selection mode, they can long press again to drag.
// Use a capturing listener to ensure this runs before useDrag, regardless of
// the order the props get merged.
let onDragStartCapture = (e)=>{
if (modality.current === 'touch' && longPressEnabledOnPressStart.current) e.preventDefault();
};
// Prevent default on link clicks so that we control exactly
// when they open (to match selection behavior).
let onClick = linkBehavior !== 'none' && manager.isLink(key) ? (e)=>{
if (!(0, $581M0$openLink).isOpening) e.preventDefault();
} : undefined;
return {
itemProps: (0, $581M0$mergeProps)(itemProps, allowsSelection || hasPrimaryAction || shouldUseVirtualFocus && !isDisabled ? pressProps : {}, longPressEnabled ? longPressProps : {}, {
onDoubleClick: onDoubleClick,
onDragStartCapture: onDragStartCapture,
onClick: onClick,
id: id
}, // Prevent DOM focus from moving on mouse down when using virtual focus
shouldUseVirtualFocus ? {
onMouseDown: (e)=>e.preventDefault()
} : undefined),
isPressed: isPressed,
isSelected: manager.isSelected(key),
isFocused: manager.isFocused && manager.focusedKey === key,
isDisabled: isDisabled,
allowsSelection: allowsSelection,
hasAction: hasAction
};
}
function $880e95eb8b93ba9a$var$isActionKey() {
let event = window.event;
return (event === null || event === void 0 ? void 0 : event.key) === 'Enter';
}
function $880e95eb8b93ba9a$var$isSelectionKey() {
let event = window.event;
return (event === null || event === void 0 ? void 0 : event.key) === ' ' || (event === null || event === void 0 ? void 0 : event.code) === 'Space';
}
export {$880e95eb8b93ba9a$export$ecf600387e221c37 as useSelectableItem};
//# sourceMappingURL=useSelectableItem.module.js.map
@@ -0,0 +1 @@
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_tl_ph=a(e.dayjs)}(this,(function(e){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=a(e),t={name:"tl-ph",weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),weekStart:1,weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"}};return n.default.locale(t,null,!0),t}));
@@ -0,0 +1,46 @@
'use strict'
const fs = require('fs')
const rm = require('rimraf')
const path = require('path')
const log = require('npmlog')
const semver = require('semver')
function remove (gyp, argv, callback) {
var devDir = gyp.devDir
log.verbose('remove', 'using node-gyp dir:', devDir)
// get the user-specified version to remove
var version = argv[0] || gyp.opts.target
log.verbose('remove', 'removing target version:', version)
if (!version) {
return callback(new Error('You must specify a version number to remove. Ex: "' + process.version + '"'))
}
var versionSemver = semver.parse(version)
if (versionSemver) {
// flatten the version Array into a String
version = versionSemver.version
}
var versionPath = path.resolve(gyp.devDir, version)
log.verbose('remove', 'removing development files for version:', version)
// first check if its even installed
fs.stat(versionPath, function (err) {
if (err) {
if (err.code === 'ENOENT') {
callback(null, 'version was already uninstalled: ' + version)
} else {
callback(err)
}
return
}
// Go ahead and delete the dir
rm(versionPath, callback)
})
}
module.exports = exports = remove
module.exports.usage = 'Removes the node development files for the specified version'
@@ -0,0 +1 @@
module.exports={A:{A:{"16":"wC","132":"E F","388":"K D A B"},B:{"1":"0 1 2 3 4 5 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 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I"},C:{"1":"0 1 2 3 4 5 6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB 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 UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC 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 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC yC zC","2":"xC TC 0C 1C"},D:{"1":"0 1 2 3 4 5 6 7 8 9 AB BB CB DB EB FB bB cB 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 UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC 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 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC","2":"J ZB K D E F A B C L M G","16":"N O P aB"},E:{"1":"K D E F A B C L M G 4C 5C 6C aC NC OC 7C 8C 9C bC cC PC AD QC dC eC fC gC hC BD RC iC jC kC lC mC CD SC nC oC pC qC rC sC tC DD ED","2":"J ZB 2C ZC 3C"},F:{"1":"0 1 2 3 4 5 6 7 8 9 B C G N O P aB AB BB CB DB EB FB bB cB 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 Q H R WC 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 GD HD ID NC uC JD OC","16":"F FD"},G:{"1":"E MD ND OD PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD bC cC PC eD QC dC eC fC gC hC fD RC iC jC kC lC mC gD SC nC oC pC qC rC sC tC","2":"ZC KD vC LD"},H:{"388":"hD"},I:{"1":"I mD nD","2":"TC J iD jD kD lD vC"},J:{"1":"A","2":"D"},K:{"1":"A B C H NC uC OC"},L:{"1":"I"},M:{"1":"MC"},N:{"1":"A","260":"B"},O:{"1":"PC"},P:{"1":"6 7 8 9 J AB BB CB DB EB FB oD pD qD rD sD aC tD uD vD wD xD QC RC SC yD"},Q:{"1":"zD"},R:{"1":"0D"},S:{"1":"1D 2D"}},B:1,C:"disabled attribute of the fieldset element",D:true};
@@ -0,0 +1,47 @@
import type { TSchema } from '../schema/index';
import type { Ensure, Evaluate, Assert } from '../helpers/index';
import { type TArray } from '../array/index';
import { type TAsyncIterator } from '../async-iterator/index';
import { type TConstructor } from '../constructor/index';
import { type TEnum, type TEnumRecord } from '../enum/index';
import { type TFunction } from '../function/index';
import { type TIndexPropertyKeys } from '../indexed/index';
import { type TIntersect } from '../intersect/index';
import { type TIterator } from '../iterator/index';
import { type TLiteral, type TLiteralValue } from '../literal/index';
import { type TObject, type TProperties, type ObjectOptions } from '../object/index';
import { type TOptional } from '../optional/index';
import { type TPromise } from '../promise/index';
import { type TReadonly } from '../readonly/index';
import { type TTuple } from '../tuple/index';
import { type TUnion } from '../union/index';
import { type TSetIncludes } from '../sets/index';
import { type TMappedResult } from './mapped-result';
import type { TMappedKey } from './mapped-key';
type TFromMappedResult<K extends PropertyKey, P extends TProperties> = (K extends keyof P ? FromSchemaType<K, P[K]> : TMappedResult<P>);
type TMappedKeyToKnownMappedResultProperties<K extends PropertyKey> = {
[_ in K]: TLiteral<Assert<K, TLiteralValue>>;
};
type TMappedKeyToUnknownMappedResultProperties<P extends PropertyKey[], Acc extends TProperties = {}> = (P extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TMappedKeyToUnknownMappedResultProperties<R, Acc & {
[_ in L]: TLiteral<Assert<L, TLiteralValue>>;
}> : Acc);
type TMappedKeyToMappedResultProperties<K extends PropertyKey, P extends PropertyKey[]> = (TSetIncludes<P, K> extends true ? TMappedKeyToKnownMappedResultProperties<K> : TMappedKeyToUnknownMappedResultProperties<P>);
type TFromMappedKey<K extends PropertyKey, P extends PropertyKey[], R extends TProperties = TMappedKeyToMappedResultProperties<K, P>> = (TFromMappedResult<K, R>);
type TFromRest<K extends PropertyKey, T extends TSchema[], Acc extends TSchema[] = []> = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TFromRest<K, R, [...Acc, FromSchemaType<K, L>]> : Acc);
type FromProperties<K extends PropertyKey, T extends TProperties, R extends TProperties = Evaluate<{
[K2 in keyof T]: FromSchemaType<K, T[K2]>;
}>> = R;
declare function FromProperties<K extends PropertyKey, T extends TProperties>(K: K, T: T): FromProperties<K, T>;
type FromSchemaType<K extends PropertyKey, T extends TSchema> = (T extends TReadonly<infer S extends TSchema> ? TReadonly<FromSchemaType<K, S>> : T extends TOptional<infer S extends TSchema> ? TOptional<FromSchemaType<K, S>> : T extends TMappedResult<infer P extends TProperties> ? TFromMappedResult<K, P> : T extends TMappedKey<infer P extends PropertyKey[]> ? TFromMappedKey<K, P> : T extends TConstructor<infer S extends TSchema[], infer R extends TSchema> ? TConstructor<TFromRest<K, S>, FromSchemaType<K, R>> : T extends TFunction<infer S extends TSchema[], infer R extends TSchema> ? TFunction<TFromRest<K, S>, FromSchemaType<K, R>> : T extends TAsyncIterator<infer S extends TSchema> ? TAsyncIterator<FromSchemaType<K, S>> : T extends TIterator<infer S extends TSchema> ? TIterator<FromSchemaType<K, S>> : T extends TIntersect<infer S extends TSchema[]> ? TIntersect<TFromRest<K, S>> : T extends TEnum<infer S extends TEnumRecord> ? TEnum<S> : T extends TUnion<infer S extends TSchema[]> ? TUnion<TFromRest<K, S>> : T extends TTuple<infer S extends TSchema[]> ? TTuple<TFromRest<K, S>> : T extends TObject<infer S extends TProperties> ? TObject<FromProperties<K, S>> : T extends TArray<infer S extends TSchema> ? TArray<FromSchemaType<K, S>> : T extends TPromise<infer S extends TSchema> ? TPromise<FromSchemaType<K, S>> : T);
declare function FromSchemaType<K extends PropertyKey, T extends TSchema>(K: K, T: T): FromSchemaType<K, T>;
export type TMappedFunctionReturnType<K extends PropertyKey[], T extends TSchema, Acc extends TProperties = {}> = (K extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TMappedFunctionReturnType<R, T, Acc & {
[_ in L]: FromSchemaType<L, T>;
}> : Acc);
export declare function MappedFunctionReturnType<K extends PropertyKey[], T extends TSchema>(K: [...K], T: T): TMappedFunctionReturnType<K, T>;
export type TMappedFunction<K extends PropertyKey[], I = TMappedKey<K>> = (T: I) => TSchema;
export type TMapped<K extends PropertyKey[], F extends TMappedFunction<K>, R extends TProperties = Evaluate<TMappedFunctionReturnType<K, ReturnType<F>>>> = Ensure<TObject<R>>;
/** `[Json]` Creates a Mapped object type */
export declare function Mapped<K extends TSchema, I extends PropertyKey[] = TIndexPropertyKeys<K>, F extends TMappedFunction<I> = TMappedFunction<I>, R extends TMapped<I, F> = TMapped<I, F>>(key: K, map: F, options?: ObjectOptions): R;
/** `[Json]` Creates a Mapped object type */
export declare function Mapped<K extends PropertyKey[], F extends TMappedFunction<K> = TMappedFunction<K>, R extends TMapped<K, F> = TMapped<K, F>>(key: [...K], map: F, options?: ObjectOptions): R;
export {};
@@ -0,0 +1,33 @@
import { Certificate } from '@peculiar/asn1-x509';
import type { Uint8Array_ } from '../types/index.js';
export type CertificateInfo = {
issuer: Issuer;
subject: Subject;
version: number;
basicConstraintsCA: boolean;
notBefore: Date;
notAfter: Date;
parsedCertificate: Certificate;
};
type Issuer = {
C?: string;
O?: string;
OU?: string;
CN?: string;
combined: string;
};
type Subject = {
C?: string;
O?: string;
OU?: string;
CN?: string;
combined: string;
};
/**
* Extract PEM certificate info
*
* @param pemCertificate Result from call to `convertASN1toPEM(x5c[0])`
*/
export declare function getCertificateInfo(leafCertBuffer: Uint8Array_): CertificateInfo;
export {};
//# sourceMappingURL=getCertificateInfo.d.ts.map
@@ -0,0 +1,30 @@
import { OneBotRequestToolkit } from '../../action/OneBotAction';
import { Static } from '@sinclair/typebox';
import { NetworkAdapterConfig } from '../../config/config';
import { StreamPacket } from './StreamBasic';
import { BaseDownloadStream, DownloadResult } from './BaseDownloadStream';
export declare const DownloadFileImageStreamPayloadSchema: import("@sinclair/typebox").TObject<{
file: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
file_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
chunk_size: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
}>;
export type DownloadFileImageStreamPayload = Static<typeof DownloadFileImageStreamPayloadSchema>;
export declare class DownloadFileImageStream extends BaseDownloadStream<DownloadFileImageStreamPayload, DownloadResult> {
actionName: "download_file_image_stream";
actionSummary: string;
actionTags: string[];
payloadExample: {
file: string;
};
returnExample: {
file: string;
};
payloadSchema: import("@sinclair/typebox").TObject<{
file: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
file_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
chunk_size: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
}>;
returnSchema: import("@sinclair/typebox").TAny;
useStream: boolean;
_handle(payload: DownloadFileImageStreamPayload, _adaptername: string, _config: NetworkAdapterConfig, req: OneBotRequestToolkit): Promise<StreamPacket<DownloadResult>>;
}
@@ -0,0 +1,23 @@
var nativeCreate = require('./_nativeCreate');
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/**
* Sets the hash `key` to `value`.
*
* @private
* @name set
* @memberOf Hash
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the hash instance.
*/
function hashSet(key, value) {
var data = this.__data__;
this.size += this.has(key) ? 0 : 1;
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
return this;
}
module.exports = hashSet;
@@ -0,0 +1,247 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const tsutils = __importStar(require("ts-api-utils"));
const util_1 = require("../util");
exports.default = (0, util_1.createRule)({
name: 'prefer-find',
meta: {
type: 'suggestion',
docs: {
description: 'Enforce the use of Array.prototype.find() over Array.prototype.filter() followed by [0] when looking for a single result',
recommended: 'stylistic',
requiresTypeChecking: true,
},
hasSuggestions: true,
messages: {
preferFind: 'Prefer .find(...) instead of .filter(...)[0].',
preferFindSuggestion: 'Use .find(...) instead of .filter(...)[0].',
},
schema: [],
},
defaultOptions: [],
create(context) {
const globalScope = context.sourceCode.getScope(context.sourceCode.ast);
const services = (0, util_1.getParserServices)(context);
const checker = services.program.getTypeChecker();
function parseArrayFilterExpressions(expression) {
const node = (0, util_1.skipChainExpression)(expression);
if (node.type === utils_1.AST_NODE_TYPES.SequenceExpression) {
// Only the last expression in (a, b, [1, 2, 3].filter(condition))[0] matters
const lastExpression = (0, util_1.nullThrows)(node.expressions.at(-1), 'Expected to have more than zero expressions in a sequence expression');
return parseArrayFilterExpressions(lastExpression);
}
// This is the only reason we're returning a list rather than a single value.
if (node.type === utils_1.AST_NODE_TYPES.ConditionalExpression) {
// Both branches of the ternary _must_ return results.
const consequentResult = parseArrayFilterExpressions(node.consequent);
if (consequentResult.length === 0) {
return [];
}
const alternateResult = parseArrayFilterExpressions(node.alternate);
if (alternateResult.length === 0) {
return [];
}
// Accumulate the results from both sides and pass up the chain.
return [...consequentResult, ...alternateResult];
}
// Check if it looks like <<stuff>>(...), but not <<stuff>>?.(...)
if (node.type === utils_1.AST_NODE_TYPES.CallExpression && !node.optional) {
const callee = node.callee;
// Check if it looks like <<stuff>>.filter(...) or <<stuff>>['filter'](...),
// or the optional chaining variants.
if (callee.type === utils_1.AST_NODE_TYPES.MemberExpression) {
const isBracketSyntaxForFilter = callee.computed;
if ((0, util_1.isStaticMemberAccessOfValue)(callee, context, 'filter')) {
const filterNode = callee.property;
const filteredObjectType = (0, util_1.getConstrainedTypeAtLocation)(services, callee.object);
// As long as the object is a (possibly nullable) array,
// this is an Array.prototype.filter expression.
if (isArrayish(filteredObjectType)) {
return [
{
filterNode,
isBracketSyntaxForFilter,
},
];
}
}
}
}
// not a filter expression.
return [];
}
/**
* Tells whether the type is a possibly nullable array/tuple or union thereof.
*/
function isArrayish(type) {
let isAtLeastOneArrayishComponent = false;
for (const unionPart of tsutils.unionConstituents(type)) {
if (tsutils.isIntrinsicNullType(unionPart) ||
tsutils.isIntrinsicUndefinedType(unionPart)) {
continue;
}
// apparently checker.isArrayType(T[] & S[]) => false.
// so we need to check the intersection parts individually.
const isArrayOrIntersectionThereof = tsutils
.intersectionConstituents(unionPart)
.every(intersectionPart => checker.isArrayType(intersectionPart) ||
checker.isTupleType(intersectionPart));
if (!isArrayOrIntersectionThereof) {
// There is a non-array, non-nullish type component,
// so it's not an array.
return false;
}
isAtLeastOneArrayishComponent = true;
}
return isAtLeastOneArrayishComponent;
}
function getObjectIfArrayAtZeroExpression(node) {
// .at() should take exactly one argument.
if (node.arguments.length !== 1) {
return undefined;
}
const callee = node.callee;
if (callee.type === utils_1.AST_NODE_TYPES.MemberExpression &&
!callee.optional &&
(0, util_1.isStaticMemberAccessOfValue)(callee, context, 'at')) {
const atArgument = (0, util_1.getStaticValue)(node.arguments[0], globalScope);
if (atArgument != null && isTreatedAsZeroByArrayAt(atArgument.value)) {
return callee.object;
}
}
return undefined;
}
/**
* Implements the algorithm for array indexing by `.at()` method.
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at#parameters
*/
function isTreatedAsZeroByArrayAt(value) {
// This would cause the number constructor coercion to throw. Other static
// values are safe.
if (typeof value === 'symbol') {
return false;
}
const asNumber = Number(value);
if (isNaN(asNumber)) {
return true;
}
return Math.trunc(asNumber) === 0;
}
function isMemberAccessOfZero(node) {
const property = (0, util_1.getStaticValue)(node.property, globalScope);
// Check if it looks like <<stuff>>[0] or <<stuff>>['0'], but not <<stuff>>?.[0]
return (!node.optional &&
property != null &&
isTreatedAsZeroByMemberAccess(property.value));
}
/**
* Implements the algorithm for array indexing by member operator.
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array#array_indices
*/
function isTreatedAsZeroByMemberAccess(value) {
return String(value) === '0';
}
function generateFixToRemoveArrayElementAccess(fixer, arrayNode, wholeExpressionBeingFlagged) {
const tokenToStartDeletingFrom = (0, util_1.nullThrows)(
// The next `.` or `[` is what we're looking for.
// think of (...).at(0) or (...)[0] or even (...)["at"](0).
context.sourceCode.getTokenAfter(arrayNode, token => token.value === '.' || token.value === '['), 'Expected to find a member access token!');
return fixer.removeRange([
tokenToStartDeletingFrom.range[0],
wholeExpressionBeingFlagged.range[1],
]);
}
function generateFixToReplaceFilterWithFind(fixer, filterExpression) {
return fixer.replaceText(filterExpression.filterNode, filterExpression.isBracketSyntaxForFilter ? '"find"' : 'find');
}
return {
// This query will be used to find things like `filteredResults.at(0)`.
CallExpression(node) {
const object = getObjectIfArrayAtZeroExpression(node);
if (object) {
const filterExpressions = parseArrayFilterExpressions(object);
if (filterExpressions.length !== 0) {
context.report({
node,
messageId: 'preferFind',
suggest: [
{
messageId: 'preferFindSuggestion',
fix: (fixer) => {
return [
...filterExpressions.map(filterExpression => generateFixToReplaceFilterWithFind(fixer, filterExpression)),
// Get rid of the .at(0) or ['at'](0).
generateFixToRemoveArrayElementAccess(fixer, object, node),
];
},
},
],
});
}
}
},
// This query will be used to find things like `filteredResults[0]`.
//
// Note: we're always looking for array member access to be "computed",
// i.e. `filteredResults[0]`, since `filteredResults.0` isn't a thing.
'MemberExpression[computed=true]'(node) {
if (isMemberAccessOfZero(node)) {
const object = node.object;
const filterExpressions = parseArrayFilterExpressions(object);
if (filterExpressions.length !== 0) {
context.report({
node,
messageId: 'preferFind',
suggest: [
{
messageId: 'preferFindSuggestion',
fix: (fixer) => {
return [
...filterExpressions.map(filterExpression => generateFixToReplaceFilterWithFind(fixer, filterExpression)),
// Get rid of the [0].
generateFixToRemoveArrayElementAccess(fixer, object, node),
];
},
},
],
});
}
}
},
};
},
});
@@ -0,0 +1,23 @@
import {
useSpinner
} from "./chunk-4JPQHBFV.mjs";
// src/spinner.tsx
import { forwardRef } from "@heroui/system-rsc";
import { jsx, jsxs } from "react/jsx-runtime";
var Spinner = forwardRef((props, ref) => {
const { slots, classNames, label, getSpinnerProps } = useSpinner({ ...props });
return /* @__PURE__ */ jsxs("div", { ref, ...getSpinnerProps(), children: [
/* @__PURE__ */ jsxs("div", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: [
/* @__PURE__ */ jsx("i", { className: slots.circle1({ class: classNames == null ? void 0 : classNames.circle1 }) }),
/* @__PURE__ */ jsx("i", { className: slots.circle2({ class: classNames == null ? void 0 : classNames.circle2 }) })
] }),
label && /* @__PURE__ */ jsx("span", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label })
] });
});
Spinner.displayName = "HeroUI.Spinner";
var spinner_default = Spinner;
export {
spinner_default
};
@@ -0,0 +1,85 @@
/**
* @author Toru Nagashima
* See LICENSE file in root directory for full license.
*/
"use strict"
const path = require("path")
const resolve = require("resolve")
/**
* Resolve the given id to file paths.
* @param {boolean} isModule The flag which indicates this id is a module.
* @param {string} id The id to resolve.
* @param {object} options The options of node-resolve module.
* It requires `options.basedir`.
* @returns {string|null} The resolved path.
*/
function getFilePath(isModule, id, options) {
try {
return resolve.sync(id, options)
} catch (_err) {
if (isModule) {
return null
}
return path.resolve(options.basedir, id)
}
}
/**
* Gets the module name of a given path.
*
* e.g. `eslint/lib/ast-utils` -> `eslint`
*
* @param {string} nameOrPath - A path to get.
* @returns {string} The module name of the path.
*/
function getModuleName(nameOrPath) {
let end = nameOrPath.indexOf("/")
if (end !== -1 && nameOrPath[0] === "@") {
end = nameOrPath.indexOf("/", 1 + end)
}
return end === -1 ? nameOrPath : nameOrPath.slice(0, end)
}
/**
* Information of an import target.
*/
module.exports = class ImportTarget {
/**
* Initialize this instance.
* @param {ASTNode} node - The node of a `require()` or a module declaraiton.
* @param {string} name - The name of an import target.
* @param {object} options - The options of `node-resolve` module.
*/
constructor(node, name, options) {
const isModule = !/^(?:[./\\]|\w+:)/u.test(name)
/**
* The node of a `require()` or a module declaraiton.
* @type {ASTNode}
*/
this.node = node
/**
* The name of this import target.
* @type {string}
*/
this.name = name
/**
* The full path of this import target.
* If the target is a module and it does not exist then this is `null`.
* @type {string|null}
*/
this.filePath = getFilePath(isModule, name, options)
/**
* The module name of this import target.
* If the target is a relative path then this is `null`.
* @type {string|null}
*/
this.moduleName = isModule ? getModuleName(name) : null
}
}
@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2015-present Dan Abramov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,10 @@
export function isStaticRequire(node) {
return (node &&
node.callee &&
node.callee.type === 'Identifier' &&
node.callee.name === 'require' &&
node.arguments.length === 1 &&
node.arguments[0].type === 'Literal' &&
typeof node.arguments[0].value === 'string');
}
//# sourceMappingURL=static-require.js.map
@@ -0,0 +1,30 @@
import { GetPacketStatusDepends } from '../../action/packet/GetPacketStatus';
import { Static } from '@sinclair/typebox';
declare const PayloadSchema: import("@sinclair/typebox").TObject<{
group_id: import("@sinclair/typebox").TString;
user_id: import("@sinclair/typebox").TString;
special_title: import("@sinclair/typebox").TString;
}>;
type PayloadType = Static<typeof PayloadSchema>;
declare const ReturnSchema: import("@sinclair/typebox").TVoid;
type ReturnType = Static<typeof ReturnSchema>;
export declare class SetSpecialTitle extends GetPacketStatusDepends<PayloadType, ReturnType> {
actionName: "set_group_special_title";
payloadSchema: import("@sinclair/typebox").TObject<{
group_id: import("@sinclair/typebox").TString;
user_id: import("@sinclair/typebox").TString;
special_title: import("@sinclair/typebox").TString;
}>;
returnSchema: import("@sinclair/typebox").TVoid;
actionSummary: string;
actionDescription: string;
actionTags: string[];
payloadExample: {
group_id: string;
user_id: string;
special_title: string;
};
returnExample: null;
_handle(payload: PayloadType): Promise<void>;
}
export {};
@@ -0,0 +1,20 @@
import { COSEALG } from '../../cose.js';
/**
* Convert a COSE alg ID into a corresponding string value that WebCrypto APIs expect
*/
export function mapCoseAlgToWebCryptoAlg(alg) {
if ([COSEALG.RS1].indexOf(alg) >= 0) {
return 'SHA-1';
}
else if ([COSEALG.ES256, COSEALG.PS256, COSEALG.RS256].indexOf(alg) >= 0) {
return 'SHA-256';
}
else if ([COSEALG.ES384, COSEALG.PS384, COSEALG.RS384].indexOf(alg) >= 0) {
return 'SHA-384';
}
else if ([COSEALG.ES512, COSEALG.PS512, COSEALG.RS512, COSEALG.EdDSA].indexOf(alg) >=
0) {
return 'SHA-512';
}
throw new Error(`Could not map COSE alg value of ${alg} to a WebCrypto alg`);
}
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2017 winstonjs
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) Feross Aboukhadijeh
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
@@ -0,0 +1,148 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
/**
* A postinstall script runs after `@swc/core` is installed.
*
* It checks if corresponding optional dependencies for native binary is installed and can be loaded properly.
* If it fails, it'll internally try to install `@swc/wasm` as fallback.
*/
const fs_1 = require("fs");
const assert = __importStar(require("assert"));
const path = __importStar(require("path"));
const child_process = __importStar(require("child_process"));
const fs = __importStar(require("fs"));
function removeRecursive(dir) {
for (const entry of fs.readdirSync(dir)) {
const entryPath = path.join(dir, entry);
let stats;
try {
stats = fs.lstatSync(entryPath);
}
catch (_a) {
continue; // Guard against https://github.com/nodejs/node/issues/4760
}
if (stats.isDirectory())
removeRecursive(entryPath);
else
fs.unlinkSync(entryPath);
}
fs.rmdirSync(dir);
}
/**
* Trying to validate @swc/core's native binary installation, then installs if it is not supported.
*/
const validateBinary = () => __awaiter(void 0, void 0, void 0, function* () {
var _a;
try {
const { name } = require(path.resolve(process.env.INIT_CWD, "package.json"));
if (name === "@swc/core" || name === "@swc/workspace") {
return;
}
}
catch (_) {
return;
}
// TODO: We do not take care of the case if user try to install with `--no-optional`.
// For now, it is considered as deliberate decision.
let binding;
try {
binding = require("./binding.js");
// Check if binding binary actually works.
// For the latest version, checks target triple. If it's old version doesn't have target triple, use parseSync instead.
const triple = binding.getTargetTriple
? binding.getTargetTriple()
: binding.parseSync("console.log()", Buffer.from(JSON.stringify({ syntax: "ecmascript" })));
assert.ok(triple, "Failed to read target triple from native binary.");
}
catch (error) {
// if error is unsupported architecture, ignore to display.
if (!((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes("Unsupported architecture"))) {
console.warn(error);
}
console.warn(`@swc/core was not able to resolve native bindings installation. It'll try to use @swc/wasm as fallback instead.`);
}
if (!!binding) {
return;
}
// User choose to override the binary installation. Skip remanining validation.
if (!!process.env["SWC_BINARY_PATH"]) {
console.warn(`@swc/core could not resolve native bindings installation, but found manual override config SWC_BINARY_PATH specified. Skipping remaning validation.`);
return;
}
// Check if top-level package.json installs @swc/wasm separately already
let wasmBinding;
try {
wasmBinding = require.resolve(`@swc/wasm`);
}
catch (_) { }
if (!!wasmBinding && (0, fs_1.existsSync)(wasmBinding)) {
return;
}
const env = Object.assign(Object.assign({}, process.env), { npm_config_global: undefined });
const { version } = require(path.join(path.dirname(require.resolve("@swc/core")), "package.json"));
// We want to place @swc/wasm next to the @swc/core as if normal installation was done,
// but can't directly set cwd to INIT_CWD as npm seems to acquire lock to the working dir.
// Instead, create a temporary inner and move it out.
const coreDir = path.dirname(require.resolve("@swc/core"));
const installDir = path.join(coreDir, "npm-install");
try {
fs.mkdirSync(installDir);
fs.writeFileSync(path.join(installDir, "package.json"), "{}");
// Instead of carrying over own dependencies to download & resolve package which increases installation sizes of `@swc/core`,
// assume & relies on system's npm installation.
child_process.execSync(`npm install --no-save --loglevel=error --prefer-offline --no-audit --progress=false @swc/wasm@${version}`, { cwd: installDir, stdio: "pipe", env });
const installedBinPath = path.join(installDir, "node_modules", `@swc/wasm`);
// INIT_CWD is injected via npm. If it doesn't exists, can't proceed.
fs.renameSync(installedBinPath, path.resolve(process.env.INIT_CWD, "node_modules", `@swc/wasm`));
}
catch (error) {
console.error(error);
console.error(`Failed to install fallback @swc/wasm@${version}. @swc/core will not properly.
Please install @swc/wasm manually, or retry whole installation.
If there are unexpected errors, please report at https://github.com/swc-project/swc/issues`);
}
finally {
try {
removeRecursive(installDir);
}
catch (_) {
// Gracefully ignore any failures. This'll make few leftover files but it shouldn't block installation.
}
}
});
validateBinary().catch((error) => {
// for now just throw the error as-is.
throw error;
});
@@ -0,0 +1,353 @@
'use strict'
const DEFAULT_RAW = {
after: '\n',
beforeClose: '\n',
beforeComment: '\n',
beforeDecl: '\n',
beforeOpen: ' ',
beforeRule: '\n',
colon: ': ',
commentLeft: ' ',
commentRight: ' ',
emptyBody: '',
indent: ' ',
semicolon: false
}
function capitalize(str) {
return str[0].toUpperCase() + str.slice(1)
}
class Stringifier {
constructor(builder) {
this.builder = builder
}
atrule(node, semicolon) {
let name = '@' + node.name
let params = node.params ? this.rawValue(node, 'params') : ''
if (typeof node.raws.afterName !== 'undefined') {
name += node.raws.afterName
} else if (params) {
name += ' '
}
if (node.nodes) {
this.block(node, name + params)
} else {
let end = (node.raws.between || '') + (semicolon ? ';' : '')
this.builder(name + params + end, node)
}
}
beforeAfter(node, detect) {
let value
if (node.type === 'decl') {
value = this.raw(node, null, 'beforeDecl')
} else if (node.type === 'comment') {
value = this.raw(node, null, 'beforeComment')
} else if (detect === 'before') {
value = this.raw(node, null, 'beforeRule')
} else {
value = this.raw(node, null, 'beforeClose')
}
let buf = node.parent
let depth = 0
while (buf && buf.type !== 'root') {
depth += 1
buf = buf.parent
}
if (value.includes('\n')) {
let indent = this.raw(node, null, 'indent')
if (indent.length) {
for (let step = 0; step < depth; step++) value += indent
}
}
return value
}
block(node, start) {
let between = this.raw(node, 'between', 'beforeOpen')
this.builder(start + between + '{', node, 'start')
let after
if (node.nodes && node.nodes.length) {
this.body(node)
after = this.raw(node, 'after')
} else {
after = this.raw(node, 'after', 'emptyBody')
}
if (after) this.builder(after)
this.builder('}', node, 'end')
}
body(node) {
let last = node.nodes.length - 1
while (last > 0) {
if (node.nodes[last].type !== 'comment') break
last -= 1
}
let semicolon = this.raw(node, 'semicolon')
for (let i = 0; i < node.nodes.length; i++) {
let child = node.nodes[i]
let before = this.raw(child, 'before')
if (before) this.builder(before)
this.stringify(child, last !== i || semicolon)
}
}
comment(node) {
let left = this.raw(node, 'left', 'commentLeft')
let right = this.raw(node, 'right', 'commentRight')
this.builder('/*' + left + node.text + right + '*/', node)
}
decl(node, semicolon) {
let between = this.raw(node, 'between', 'colon')
let string = node.prop + between + this.rawValue(node, 'value')
if (node.important) {
string += node.raws.important || ' !important'
}
if (semicolon) string += ';'
this.builder(string, node)
}
document(node) {
this.body(node)
}
raw(node, own, detect) {
let value
if (!detect) detect = own
// Already had
if (own) {
value = node.raws[own]
if (typeof value !== 'undefined') return value
}
let parent = node.parent
if (detect === 'before') {
// Hack for first rule in CSS
if (!parent || (parent.type === 'root' && parent.first === node)) {
return ''
}
// `root` nodes in `document` should use only their own raws
if (parent && parent.type === 'document') {
return ''
}
}
// Floating child without parent
if (!parent) return DEFAULT_RAW[detect]
// Detect style by other nodes
let root = node.root()
if (!root.rawCache) root.rawCache = {}
if (typeof root.rawCache[detect] !== 'undefined') {
return root.rawCache[detect]
}
if (detect === 'before' || detect === 'after') {
return this.beforeAfter(node, detect)
} else {
let method = 'raw' + capitalize(detect)
if (this[method]) {
value = this[method](root, node)
} else {
root.walk(i => {
value = i.raws[own]
if (typeof value !== 'undefined') return false
})
}
}
if (typeof value === 'undefined') value = DEFAULT_RAW[detect]
root.rawCache[detect] = value
return value
}
rawBeforeClose(root) {
let value
root.walk(i => {
if (i.nodes && i.nodes.length > 0) {
if (typeof i.raws.after !== 'undefined') {
value = i.raws.after
if (value.includes('\n')) {
value = value.replace(/[^\n]+$/, '')
}
return false
}
}
})
if (value) value = value.replace(/\S/g, '')
return value
}
rawBeforeComment(root, node) {
let value
root.walkComments(i => {
if (typeof i.raws.before !== 'undefined') {
value = i.raws.before
if (value.includes('\n')) {
value = value.replace(/[^\n]+$/, '')
}
return false
}
})
if (typeof value === 'undefined') {
value = this.raw(node, null, 'beforeDecl')
} else if (value) {
value = value.replace(/\S/g, '')
}
return value
}
rawBeforeDecl(root, node) {
let value
root.walkDecls(i => {
if (typeof i.raws.before !== 'undefined') {
value = i.raws.before
if (value.includes('\n')) {
value = value.replace(/[^\n]+$/, '')
}
return false
}
})
if (typeof value === 'undefined') {
value = this.raw(node, null, 'beforeRule')
} else if (value) {
value = value.replace(/\S/g, '')
}
return value
}
rawBeforeOpen(root) {
let value
root.walk(i => {
if (i.type !== 'decl') {
value = i.raws.between
if (typeof value !== 'undefined') return false
}
})
return value
}
rawBeforeRule(root) {
let value
root.walk(i => {
if (i.nodes && (i.parent !== root || root.first !== i)) {
if (typeof i.raws.before !== 'undefined') {
value = i.raws.before
if (value.includes('\n')) {
value = value.replace(/[^\n]+$/, '')
}
return false
}
}
})
if (value) value = value.replace(/\S/g, '')
return value
}
rawColon(root) {
let value
root.walkDecls(i => {
if (typeof i.raws.between !== 'undefined') {
value = i.raws.between.replace(/[^\s:]/g, '')
return false
}
})
return value
}
rawEmptyBody(root) {
let value
root.walk(i => {
if (i.nodes && i.nodes.length === 0) {
value = i.raws.after
if (typeof value !== 'undefined') return false
}
})
return value
}
rawIndent(root) {
if (root.raws.indent) return root.raws.indent
let value
root.walk(i => {
let p = i.parent
if (p && p !== root && p.parent && p.parent === root) {
if (typeof i.raws.before !== 'undefined') {
let parts = i.raws.before.split('\n')
value = parts[parts.length - 1]
value = value.replace(/\S/g, '')
return false
}
}
})
return value
}
rawSemicolon(root) {
let value
root.walk(i => {
if (i.nodes && i.nodes.length && i.last.type === 'decl') {
value = i.raws.semicolon
if (typeof value !== 'undefined') return false
}
})
return value
}
rawValue(node, prop) {
let value = node[prop]
let raw = node.raws[prop]
if (raw && raw.value === value) {
return raw.raw
}
return value
}
root(node) {
this.body(node)
if (node.raws.after) this.builder(node.raws.after)
}
rule(node) {
this.block(node, this.rawValue(node, 'selector'))
if (node.raws.ownSemicolon) {
this.builder(node.raws.ownSemicolon, node, 'end')
}
}
stringify(node, semicolon) {
/* c8 ignore start */
if (!this[node.type]) {
throw new Error(
'Unknown AST node type ' +
node.type +
'. ' +
'Maybe you need to change PostCSS stringifier.'
)
}
/* c8 ignore stop */
this[node.type](node, semicolon)
}
}
module.exports = Stringifier
Stringifier.default = Stringifier
@@ -0,0 +1 @@
{"name":"lines-and-columns","version":"1.2.4","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532105784,"integrity":"sha512-m0aRS+mLrpg627RTRcS8Q1H7i/Ad0180SxqocFykZDIH4RS7ni2vODTxAt2cOC9YeYLsrcMp4TONveg/aJ4Egw==","mode":420,"size":1080},"build/index.js":{"checkedAt":1794532105784,"integrity":"sha512-cd+WO3KSInVKYtSH2e8a24MCnB4QKGtIW45G0DTICGoo6M/UIpOsS4OvF/xTeqVNgVljjO7eBrTGxLeEiVx5uQ==","mode":420,"size":2025},"package.json":{"checkedAt":1794532105784,"integrity":"sha512-OHotGjw9pIT0937BGqlWUBTsyNfL/+MXv6TqYgzodqzOWzzhZEa3kz1Fjo4sAdoefyo6TE9dgbP+B9JiwF4gmw==","mode":420,"size":1372},"README.md":{"checkedAt":1794532105784,"integrity":"sha512-9+KB1z93CQ4zdVa1F7R69eHfH+r3cvjjLfpEAsYHGeuiUgV17+8q6QjHnSj7onA9C70BbFmunR2fcldTBB2PBA==","mode":420,"size":533},"build/index.d.ts":{"checkedAt":1794532105785,"integrity":"sha512-tzrftKMrRyF21MEwoGR7eLwu/fs3MeiRLgOcDIXeTbvjPhZk6tK/5+VFhLWcxycJoZ7pBhWG/n7c9w8B0NlFOA==","mode":420,"size":376}}}
@@ -0,0 +1,73 @@
describe('fn.name', function () {
'use strict';
var assume = require('assume')
, name = require('./');
it('is exported as a function', function () {
assume(name).is.a('function');
});
it('can extract the name from a function declaration', function () {
function foobar() {}
assume(name(foobar)).equals('foobar');
});
it('can extract the name from a function expression', function () {
var a = function bar() {};
assume(name(a)).equals('bar');
});
it('can be overriden using displayName', function () {
var a = function bar() {};
a.displayName = 'bro';
assume(name(a)).equals('bro');
});
it('works with constructed instances', function () {
function Bar(){}
var foo = new Bar();
assume(name(foo)).equals('Bar');
});
it('works with anonymous', function () {
assume(name(function () {})).equals('anonymous');
});
it('returns the className if we were not given a function', function () {
assume(name('string')).equals('String');
});
//
// Test if the env supports async functions, if so add a test to ensure
// that we will work with async functions.
//
var asyncfn = true;
try { new Function('return async function hello() {}')(); }
catch (e) { asyncfn = false; }
if (asyncfn) it('detects the name of async functions', function () {
var fn = new Function('return async function hello() {}')();
assume(name(fn)).equals('hello');
});
//
// Test that this env supports generators, if so add a test to ensure that
// we will work with generators.
//
var generators = true;
try { new Function('return function* generator() {}')(); }
catch (e) { generator = false; }
if (generators) it('detecs the name of a generator', function () {
var fn = new Function('return function* hello() {}')();
assume(name(fn)).equals('hello');
});
});
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"F A B","2":"K D E wC"},B:{"1":"0 1 2 3 4 5 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 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I"},C:{"1":"0 1 2 3 4 5 6 7 8 9 F A B C L M G N O P aB AB BB CB DB EB FB bB cB 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 UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC 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 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC yC zC","2":"xC TC J ZB K D E 0C 1C"},D:{"1":"0 1 2 3 4 5 tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC 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 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC","2":"6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB"},E:{"1":"B C L M G NC OC 7C 8C 9C bC cC PC AD QC dC eC fC gC hC BD RC iC jC kC lC mC CD SC nC oC pC qC rC sC tC DD ED","2":"J ZB K D E F A 2C ZC 3C 4C 5C 6C aC"},F:{"1":"0 1 2 3 4 5 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 Q H R WC 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":"6 7 8 9 F B C G N O P aB AB BB CB DB EB FB bB cB dB eB fB FD GD HD ID NC uC JD OC"},G:{"1":"SD TD UD VD WD XD YD ZD aD bD cD dD bC cC PC eD QC dC eC fC gC hC fD RC iC jC kC lC mC gD SC nC oC pC qC rC sC tC","2":"E ZC KD vC LD MD ND OD PD QD RD"},H:{"2":"hD"},I:{"1":"I","2":"TC J iD jD kD lD vC mD nD"},J:{"2":"D A"},K:{"1":"H","2":"A B C NC uC OC"},L:{"1":"I"},M:{"1":"MC"},N:{"1":"A B"},O:{"1":"PC"},P:{"1":"6 7 8 9 AB BB CB DB EB FB oD pD qD rD sD aC tD uD vD wD xD QC RC SC yD","2":"J"},Q:{"1":"zD"},R:{"1":"0D"},S:{"1":"1D 2D"}},B:2,C:"CSS font-stretch",D:true};
@@ -0,0 +1,63 @@
import { isSVGElement } from '../utils/is-svg-element.mjs';
import { resolveElements } from '../utils/resolve-elements.mjs';
const resizeHandlers = new WeakMap();
let observer;
const getSize = (borderBoxAxis, svgAxis, htmlAxis) => (target, borderBoxSize) => {
if (borderBoxSize && borderBoxSize[0]) {
return borderBoxSize[0][(borderBoxAxis + "Size")];
}
else if (isSVGElement(target) && "getBBox" in target) {
return target.getBBox()[svgAxis];
}
else {
return target[htmlAxis];
}
};
const getWidth = /*@__PURE__*/ getSize("inline", "width", "offsetWidth");
const getHeight = /*@__PURE__*/ getSize("block", "height", "offsetHeight");
function notifyTarget({ target, borderBoxSize }) {
resizeHandlers.get(target)?.forEach((handler) => {
handler(target, {
get width() {
return getWidth(target, borderBoxSize);
},
get height() {
return getHeight(target, borderBoxSize);
},
});
});
}
function notifyAll(entries) {
entries.forEach(notifyTarget);
}
function createResizeObserver() {
if (typeof ResizeObserver === "undefined")
return;
observer = new ResizeObserver(notifyAll);
}
function resizeElement(target, handler) {
if (!observer)
createResizeObserver();
const elements = resolveElements(target);
elements.forEach((element) => {
let elementHandlers = resizeHandlers.get(element);
if (!elementHandlers) {
elementHandlers = new Set();
resizeHandlers.set(element, elementHandlers);
}
elementHandlers.add(handler);
observer?.observe(element);
});
return () => {
elements.forEach((element) => {
const elementHandlers = resizeHandlers.get(element);
elementHandlers?.delete(handler);
if (!elementHandlers?.size) {
observer?.unobserve(element);
}
});
};
}
export { resizeElement };
@@ -0,0 +1,419 @@
import type { IMessageType } from "./message-type-contract";
import type { JsonValue } from "./json-typings";
/**
* Describes a protobuf enum for runtime reflection.
*
* The tuple consists of:
*
*
* [0] the protobuf type name
*
* The type name follows the same rules as message type names.
* See `MessageInfo` for details.
*
*
* [1] the enum object generated by Typescript
*
* We generate standard Typescript enums for protobuf enums. They are compiled
* to lookup objects that map from numerical value to name strings and vice
* versa and can also contain alias names.
*
* See https://www.typescriptlang.org/docs/handbook/enums.html#reverse-mappings
*
* We use this lookup feature to when encoding / decoding JSON format. The
* enum is guaranteed to have a value for 0. We generate an entry for 0 if
* none was declared in .proto because we would need to support custom default
* values if we didn't.
*
*
* [2] the prefix shared by all original enum values (optional)
*
* If all values of a protobuf enum share a prefix, it is dropped in the
* generated enum. For example, the protobuf enum `enum My { MY_FOO, MY_BAR }`
* becomes the typescript enum `enum My { FOO, BAR }`.
*
* Because the JSON format requires the original value name, we store the
* dropped prefix here, so that the JSON format implementation can restore
* the original value names.
*/
export declare type EnumInfo = readonly [
/**
* The protobuf type name of the enum
*/
string,
/**
* The enum object generated by Typescript
*/
{
[key: number]: string;
[k: string]: number | string;
},
/**
* The prefix shared by all original enum values
*/
string?];
/**
* Describes a protobuf message for runtime reflection.
*/
export interface MessageInfo {
/**
* The protobuf type name of the message, including package and
* parent types if present.
*
* If the .proto file included a `package` statement, the type name
* starts with '.'.
*
* Examples:
* 'MyNamespaceLessMessage'
* '.my_package.MyMessage'
* '.my_package.ParentMessage.ChildMessage'
*/
readonly typeName: string;
/**
* Simple information for each message field, in the order
* of declaration in the source .proto.
*/
readonly fields: readonly FieldInfo[];
/**
* Contains custom message options from the .proto source in JSON format.
*/
readonly options: {
[extensionName: string]: JsonValue;
};
}
/**
* Version of `MessageInfo` that allows the following properties
* to be omitted:
* - "fields": omitting means the message has no fields
* - "options": omitting means the message has no options
*/
export declare type PartialMessageInfo = PartialPartial<MessageInfo, "fields" | "options">;
declare type PartialPartial<T, K extends keyof T> = Partial<Pick<T, K>> & Omit<T, K>;
/**
* Describes a field of a protobuf message for runtime
* reflection. We distinguish between the following
* kinds of fields:
*
* "scalar": string, bool, float, int32, etc.
* See https://developers.google.com/protocol-buffers/docs/proto3#scalar
*
* "enum": field was declared with an enum type.
*
* "message": field was declared with a message type.
*
* "map": field was declared with map<K,V>.
*
*
* Every field, regardless of it's kind, always has the following properties:
*
* "no": The field number of the .proto field.
* "name": The original name of the .proto field.
* "localName": The name of the field as used in generated code.
* "jsonName": The name for JSON serialization / deserialization.
* "options": Custom field options from the .proto source in JSON format.
*
*
* Other properties:
*
* - Fields of kind "scalar", "enum" and "message" can have a "repeat" type.
* - Fields of kind "scalar" and "enum" can have a "repeat" type.
* - Fields of kind "scalar", "enum" and "message" can be member of a "oneof".
*
* A field can be only have one of the above properties set.
*
* Options for "scalar" fields:
*
* - 64 bit integral types can provide "L" - the JavaScript representation
* type.
*
*/
export declare type FieldInfo = fiRules<fiScalar> | fiRules<fiEnum> | fiRules<fiMessage> | fiRules<fiMap>;
/**
* Version of `FieldInfo` that allows the following properties
* to be omitted:
* - "localName", "jsonName": can be omitted if equal to lowerCamelCase(name)
* - "opt": can be omitted if false
* - "repeat", can be omitted if RepeatType.NO
*
* Use `normalizeFieldInfo()` to fill the omitted fields with
* their standard values.
*/
export declare type PartialFieldInfo = fiPartialRules<fiScalar> | fiPartialRules<fiEnum> | fiPartialRules<fiMessage> | fiPartialRules<fiMap>;
interface fiShared {
/**
* The field number of the .proto field.
*/
no: number;
/**
* The original name of the .proto field.
*/
name: string;
/**
* The name of the field as used in generated code.
*/
localName: string;
/**
* The name for JSON serialization / deserialization.
*/
jsonName: string;
/**
* The name of the `oneof` group, if this field belongs to one.
*/
oneof: string | undefined;
/**
* Contains custom field options from the .proto source in JSON format.
*/
options?: {
[extensionName: string]: JsonValue;
};
}
interface fiScalar extends fiShared {
kind: 'scalar';
/**
* Scalar type of the field.
*/
T: ScalarType;
/**
* Representation of 64 bit integral types (int64, uint64, sint64,
* fixed64, sfixed64).
*
* If this option is set for other scalar types, it is ignored.
* Omitting this option is equivalent to `STRING`.
*/
L?: LongType;
/**
* Is the field repeated?
*/
repeat: RepeatType;
/**
* Is the field optional?
*/
opt: boolean;
}
interface fiMessage extends fiShared {
kind: 'message';
/**
* Message handler for the field.
*/
T: () => IMessageType<any>;
/**
* Is the field repeated?
*/
repeat: RepeatType;
}
interface fiEnum extends fiShared {
kind: 'enum';
/**
* Enum type information for the field.
*/
T: () => EnumInfo;
/**
* Is the field repeated?
*/
repeat: RepeatType;
/**
* Is the field optional?
*/
opt: boolean;
}
interface fiMap extends fiShared {
kind: 'map';
/**
* Map key type.
*
* The key_type can be any integral or string type
* (so, any scalar type except for floating point
* types and bytes)
*/
K: Exclude<ScalarType, ScalarType.FLOAT | ScalarType.DOUBLE | ScalarType.BYTES>;
/**
* Map value type. Can be a `ScalarType`, enum type information,
* or type handler for a message.
*/
V: {
kind: 'scalar';
T: ScalarType;
L?: LongType;
} | {
kind: 'enum';
T: () => EnumInfo;
} | {
kind: 'message';
T: () => IMessageType<any>;
};
}
declare type fiRules<T> = Omit<T, 'oneof' | 'repeat' | 'opt'> & ({
repeat: RepeatType.NO;
opt: false;
oneof: undefined;
} | {
repeat: RepeatType.NO;
opt: true;
oneof: undefined;
} | {
repeat: RepeatType.PACKED | RepeatType.UNPACKED;
opt: false;
oneof: undefined;
} | {
repeat: RepeatType.NO;
opt: false;
oneof: string;
});
declare type fiPartialRules<T> = Omit<T, 'jsonName' | 'localName' | 'oneof' | 'repeat' | 'opt'> & ({
localName?: string;
jsonName?: string;
repeat?: RepeatType.NO;
opt?: false;
oneof?: undefined;
} | {
localName?: string;
jsonName?: string;
repeat?: RepeatType.NO;
opt: true;
oneof?: undefined;
} | {
localName?: string;
jsonName?: string;
repeat: RepeatType.PACKED | RepeatType.UNPACKED;
opt?: false;
oneof?: undefined;
} | {
localName?: string;
jsonName?: string;
repeat?: RepeatType.NO;
opt?: false;
oneof: string;
});
/**
* Scalar value types. This is a subset of field types declared by protobuf
* enum google.protobuf.FieldDescriptorProto.Type The types GROUP and MESSAGE
* are omitted, but the numerical values are identical.
*/
export declare enum ScalarType {
DOUBLE = 1,
FLOAT = 2,
INT64 = 3,
UINT64 = 4,
INT32 = 5,
FIXED64 = 6,
FIXED32 = 7,
BOOL = 8,
STRING = 9,
BYTES = 12,
UINT32 = 13,
SFIXED32 = 15,
SFIXED64 = 16,
SINT32 = 17,
SINT64 = 18
}
/**
* JavaScript representation of 64 bit integral types. Equivalent to the
* field option "jstype".
*
* By default, protobuf-ts represents 64 bit types as `bigint`.
*
* You can change the default behaviour by enabling the plugin parameter
* `long_type_string`, which will represent 64 bit types as `string`.
*
* Alternatively, you can change the behaviour for individual fields
* with the field option "jstype":
*
* ```protobuf
* uint64 my_field = 1 [jstype = JS_STRING];
* uint64 other_field = 2 [jstype = JS_NUMBER];
* ```
*/
export declare enum LongType {
/**
* Use JavaScript `bigint`.
*
* Field option `[jstype = JS_NORMAL]`.
*/
BIGINT = 0,
/**
* Use JavaScript `string`.
*
* Field option `[jstype = JS_STRING]`.
*/
STRING = 1,
/**
* Use JavaScript `number`.
*
* Large values will loose precision.
*
* Field option `[jstype = JS_NUMBER]`.
*/
NUMBER = 2
}
/**
* Protobuf 2.1.0 introduced packed repeated fields.
* Setting the field option `[packed = true]` enables packing.
*
* In proto3, all repeated fields are packed by default.
* Setting the field option `[packed = false]` disables packing.
*
* Packed repeated fields are encoded with a single tag,
* then a length-delimiter, then the element values.
*
* Unpacked repeated fields are encoded with a tag and
* value for each element.
*
* `bytes` and `string` cannot be packed.
*/
export declare enum RepeatType {
/**
* The field is not repeated.
*/
NO = 0,
/**
* The field is repeated and should be packed.
* Invalid for `bytes` and `string`, they cannot be packed.
*/
PACKED = 1,
/**
* The field is repeated but should not be packed.
* The only valid repeat type for repeated `bytes` and `string`.
*/
UNPACKED = 2
}
/**
* Turns PartialFieldInfo into FieldInfo.
*/
export declare function normalizeFieldInfo(field: PartialFieldInfo): FieldInfo;
/**
* Read custom field options from a generated message type.
*
* @deprecated use readFieldOption()
*/
export declare function readFieldOptions<T extends object>(messageType: MessageInfo, fieldName: string | number, extensionName: string, extensionType: IMessageType<T>): T | undefined;
/**
* Read a custom field option.
*
* ```proto
* message MyMessage {
* int32 my_field = 1 [(acme.field_opt) = true];
* }
* ```
*
* ```typescript
* let val = readFieldOption(MyMessage, 'myField', 'acme.field_opt')
* ```
*/
export declare function readFieldOption<T extends object>(messageType: MessageInfo, fieldName: string | number, extensionName: string): JsonValue | undefined;
export declare function readFieldOption<T extends object>(messageType: MessageInfo, fieldName: string | number, extensionName: string, extensionType: IMessageType<T>): T | undefined;
/**
* Read a custom message option.
*
* ```proto
* message MyMessage {
* option acme.message_opt = true;
* }
* ```
*
* ```typescript
* let val = readMessageOption(MyMessage, 'acme.message_opt')
* ```
*/
export declare function readMessageOption<T extends object>(messageType: MessageInfo, extensionName: string): JsonValue | undefined;
export declare function readMessageOption<T extends object>(messageType: MessageInfo, extensionName: string, extensionType: IMessageType<T>): T | undefined;
export {};
@@ -0,0 +1 @@
module.exports={C:{"52":0.00568,"110":0.00568,"113":0.00568,"115":0.10784,"121":0.00568,"133":0.01135,"136":0.00568,"140":0.01135,"141":0.01703,"142":0.01703,"143":0.63004,"144":0.5449,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 111 112 114 116 117 118 119 120 122 123 124 125 126 127 128 129 130 131 132 134 135 137 138 139 145 146 147 3.5 3.6"},D:{"49":0.00568,"56":0.00568,"58":0.00568,"77":0.00568,"79":0.00568,"86":0.00568,"89":0.00568,"98":0.00568,"99":0.00568,"103":0.15325,"107":0.00568,"108":0.01135,"109":0.46543,"111":0.01135,"112":1.42468,"113":0.00568,"114":0.00568,"115":0.01135,"116":0.05676,"117":0.00568,"118":0.12487,"119":0.03406,"120":0.09649,"122":0.22136,"123":0.8514,"124":0.35759,"125":1.56658,"126":0.10217,"127":0.18731,"128":0.10217,"129":0.01135,"130":0.00568,"131":0.08514,"132":0.03973,"133":0.03406,"134":0.05108,"135":0.01703,"136":0.02838,"137":0.23839,"138":0.35191,"139":1.52117,"140":9.04754,"141":22.1591,"142":0.27812,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 50 51 52 53 54 55 57 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 78 80 81 83 84 85 87 88 90 91 92 93 94 95 96 97 100 101 102 104 105 106 110 121 143 144 145"},F:{"28":0.00568,"79":0.00568,"89":0.00568,"91":0.01703,"92":0.00568,"95":0.00568,"111":0.00568,"120":0.05676,"121":0.10217,"122":1.41332,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 80 81 82 83 84 85 86 87 88 90 93 94 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 112 113 114 115 116 117 118 119 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"109":0.01135,"112":0.01703,"114":0.00568,"117":0.03973,"120":0.01703,"122":0.00568,"129":0.01135,"131":0.00568,"133":0.00568,"134":0.00568,"135":0.01135,"136":0.00568,"137":0.01135,"138":0.02838,"139":0.03406,"140":1.30548,"141":5.45464,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 113 115 116 118 119 121 123 124 125 126 127 128 130 132 142"},E:{"14":0.00568,_:"0 4 5 6 7 8 9 10 11 12 13 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 15.1 15.4 16.0 26.2","13.1":0.00568,"14.1":0.01135,"15.2-15.3":0.00568,"15.5":0.00568,"15.6":0.1192,"16.1":0.0227,"16.2":0.00568,"16.3":0.01703,"16.4":0.14758,"16.5":0.0227,"16.6":0.11352,"17.0":0.07379,"17.1":0.08514,"17.2":0.0227,"17.3":0.13055,"17.4":0.02838,"17.5":0.05676,"17.6":0.1646,"18.0":0.01135,"18.1":0.0227,"18.2":0.03973,"18.3":0.06811,"18.4":0.03406,"18.5-18.6":0.20434,"26.0":0.94789,"26.1":0.01135},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00154,"5.0-5.1":0,"6.0-6.1":0.00617,"7.0-7.1":0.00463,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.01388,"10.0-10.2":0.00154,"10.3":0.02621,"11.0-11.2":0.38857,"11.3-11.4":0.00925,"12.0-12.1":0.00308,"12.2-12.5":0.07555,"13.0-13.1":0,"13.2":0.00771,"13.3":0.00308,"13.4-13.7":0.01234,"14.0-14.4":0.02621,"14.5-14.8":0.02775,"15.0-15.1":0.02621,"15.2-15.3":0.02005,"15.4":0.02313,"15.5":0.02621,"15.6-15.8":0.34231,"16.0":0.04626,"16.1":0.08635,"16.2":0.04472,"16.3":0.08018,"16.4":0.02005,"16.5":0.03546,"16.6-16.7":0.45796,"17.0":0.03238,"17.1":0.04934,"17.2":0.03546,"17.3":0.05243,"17.4":0.09252,"17.5":0.15882,"17.6-17.7":0.4009,"18.0":0.09097,"18.1":0.18812,"18.2":0.10177,"18.3":0.32689,"18.4":0.16807,"18.5-18.6":8.57009,"26.0":1.05931,"26.1":0.03855},P:{"4":0.02085,"21":0.02085,"22":0.01043,"23":0.01043,"24":0.01043,"25":0.01043,"26":0.02085,"27":0.03128,"28":2.1476,"29":0.1668,_:"20 5.0-5.4 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0","7.2-7.4":0.01043},I:{"0":0.09499,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00002,"4.4":0,"4.4.3-4.4.4":0.00005},K:{"0":0.15566,_:"10 11 12 11.1 11.5 12.1"},A:{_:"6 7 8 9 10 11 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.2162},Q:{_:"14.9"},O:{"0":0.06918},H:{"0":0},L:{"0":27.11133}};
@@ -0,0 +1,16 @@
/**
* @file ttf数组转base64编码
* @author mengke01(kekee000@gmail.com)
*/
import bytes2base64 from './util/bytes2base64';
/**
* ttf数组转base64编码
*
* @param {Array} arrayBuffer ArrayBuffer对象
* @return {string} base64编码
*/
export default function ttf2base64(arrayBuffer) {
return 'data:font/ttf;charset=utf-8;base64,' + bytes2base64(arrayBuffer);
}
@@ -0,0 +1,15 @@
import { CloneType } from '../clone/type.mjs';
import { CreateType } from '../create/type.mjs';
import { IsUndefined } from '../guard/value.mjs';
import { Kind, Hint } from '../symbols/index.mjs';
// Auto Tracked For Recursive Types without ID's
let Ordinal = 0;
/** `[Json]` Creates a Recursive type */
export function Recursive(callback, options = {}) {
if (IsUndefined(options.$id))
options.$id = `T${Ordinal++}`;
const thisType = CloneType(callback({ [Kind]: 'This', $ref: `${options.$id}` }));
thisType.$id = options.$id;
// prettier-ignore
return CreateType({ [Hint]: 'Recursive', ...thisType }, options);
}
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B wC"},B:{"1":"0 1 2 3 4 5 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 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I","2":"C","260":"L M G N O P"},C:{"1":"0 1 2 3 4 5 vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC 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 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC yC zC","2":"6 7 8 9 xC TC J ZB K D E F A B C L M G N O P aB AB BB CB DB EB 0C 1C","516":"FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB"},D:{"1":"0 1 2 3 4 5 yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC 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 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC","2":"J","16":"ZB K D E F A B C L M","260":"xB","772":"6 7 8 9 G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB"},E:{"1":"B C L M G aC NC OC 7C 8C 9C bC cC PC AD QC dC eC fC gC hC BD RC iC jC kC lC mC CD SC nC oC pC qC rC sC tC DD ED","2":"J 2C ZC","16":"ZB","772":"K D E F A 3C 4C 5C 6C"},F:{"1":"0 1 2 3 4 5 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 Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","16":"F FD","260":"B C kB GD HD ID NC uC JD OC","772":"6 7 8 9 G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB"},G:{"1":"SD TD UD VD WD XD YD ZD aD bD cD dD bC cC PC eD QC dC eC fC gC hC fD RC iC jC kC lC mC gD SC nC oC pC qC rC sC tC","2":"ZC KD vC","772":"E LD MD ND OD PD QD RD"},H:{"132":"hD"},I:{"1":"I","2":"TC iD jD kD","260":"J lD vC mD nD"},J:{"2":"D","260":"A"},K:{"1":"H","260":"A B C NC uC OC"},L:{"1":"I"},M:{"1":"MC"},N:{"2":"A B"},O:{"1":"PC"},P:{"1":"6 7 8 9 AB BB CB DB EB FB oD pD qD rD sD aC tD uD vD wD xD QC RC SC yD","260":"J"},Q:{"1":"zD"},R:{"1":"0D"},S:{"1":"2D","516":"1D"}},B:5,C:":in-range and :out-of-range CSS pseudo-classes",D:true};
@@ -0,0 +1,221 @@
export default `tlf2a 2 3 6 -1 15 0 0 0
===============================================================================
This is smbraille.tlf", or “Small Braille”, by Sam Hocevar <sam@hocevar.net>.
It was created on September 30th, 2006.
This font is free software. It comes without any warranty, to the extent
permitted by applicable law. You can redistribute it and/or modify it under
the terms of the Do What The Fuck You Want To Public License, Version 2,
as published by Sam Hocevar. See http://sam.zoy.org/wtfpl/COPYING for more
details.
Missing characters: # $ % & * + , : ; < > ?
This font is part of TOIlet’s official distribution. More information
on the TOIlet website at http://caca.zoy.org/wiki/toilet
===============================================================================
@
@@
⡇!
⠅!!
⠃⠃"
""
@
#@@
@
$@@
@
%@@
@
&@@
⠃'
''
⡔⠁(
⠣⡀((
⠈⢢)
⢀⠜))
@
*@@
@
+@@
@
,@@
-
⠉⠉--
.
⠶..
⡜/
⠎ //
⣎⣵0
⠫⠜00
⢺ 1
⠼⠄11
⠊⡱2
⠮⠤22
⢉⡹3
⠤⠜33
⢇⣸4
⠸44
⣏⡉5
⠤⠜55
⣎⡁8
⠣⠜88
⠉⡹7
⠸ 77
⢎⡱8
⠣⠜88
⢎⣱9
⠠⠜99
@
:@@
@
;@@
@
<@@
⣀⣀=
⠒⠒==
@
>@@
@
?@@
⣎⣱@
⠫⠥@@
⣎⣱A
⠇⠸AA
⣏⡱B
⠧⠜BB
⡎⠑C
⠣⠔CC
⡏⢱D
⠧⠜DD
⣏⡉E
⠧⠤EE
⣏⡉F
⠇ FF
⡎⠑G
⠣⠝GG
⣇⣸H
⠇⠸HH
⡇I
⠇II
⠈⢹J
⠣⠜JJ
⣇⠜K
⠇⠱KK
⡇ L
⠧⠤LL
⡷⢾M
⠇⠸MM
⡷⣸N
⠇⠹NN
⡎⢱O
⠣⠜OO
⣏⡱P
⠇ PP
⡎⢱Q
⠣⠪QQ
⣏⡱R
⠇⠱RR
⢎⡑S
⠢⠜SS
⢹⠁T
⠸ TT
⡇⢸U
⠣⠜UU
⡇⢸V
⠸⠃VV
⡇⢸W
⠟⠻WW
⢇⡸X
⠇⠸XX
⢇⢸Y
⠇YY
⢉⠝Z
⠮⠤ZZ
⡏[
⣇[[
⢣ \\
⠱\\\\
⢹]
⣸]]
⠊⠂^
^^
_
⠤⠤__
⠑\`
\`\`
⢀⣀a
⠣⠼aa
⣇⡀b
⠧⠜bb
⢀⣀c
⠣⠤cc
⢀⣸d
⠣⠼dd
⢀⡀e
⠣⠭ee
⣰⡁f
⢸ ff
⢀⡀g
⣑⡺gg
⣇⡀h
⠇⠸hh
⠄i
⠇ii
⠠j
⡸jj
⡇⡠k
⠏⠢kk
⡇l
⠣ll
⣀⣀ m
⠇⠇⠇mm
⣀⡀n
⠇⠸nn
⢀⡀o
⠣⠜oo
⣀⡀p
⡧⠜pp
⢀⣀q
⠣⢼qq
⡀⣀r
⠏ rr
⢀⣀s
⠭⠕ss
⣰⡀t
⠘⠤tt
⡀⢀u
⠣⠼uu
⡀⢀v
⠱⠃vv
⡀ ⢀w
⠱⠱⠃ww
⡀⢀x
⠜⠣xx
⡀⢀y
⣑⡺yy
⣀⣀z
⠴⠥zz
⡰⠁{
⠘⠄{{
⡇|
⠇||
⠈⢆}
⠠⠃}}
⡠⡠~
~~
⣕⣪Ä
⠇⠸ÄÄ
⡕⢪Ö
⠣⠜ÖÖ
⡅⢨Ü
⠣⠜ÜÜ
⢂⣐ä
⠣⠼ää
⢂⡐ö
⠣⠜öö
⡂⢐ü
⠣⠼üü
⡔⡢ß
⡇⠜ßß
`
@@ -0,0 +1,76 @@
{
"name": "for-each",
"version": "0.3.5",
"description": "A better forEach",
"keywords": [],
"author": "Raynos <raynos2@gmail.com>",
"repository": {
"type": "git",
"url": "https://github.com/Raynos/for-each.git"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
},
"main": "index",
"homepage": "https://github.com/Raynos/for-each",
"contributors": [
{
"name": "Jake Verbaten"
},
{
"name": "Jordan Harband",
"url": "https://github.com/ljharb"
}
],
"bugs": {
"url": "https://github.com/Raynos/for-each/issues",
"email": "raynos2@gmail.com"
},
"license": "MIT",
"scripts": {
"prepack": "npmignore --auto --commentLines=autogenerated",
"pretest": "npm run lint",
"test": "npm run tests-only",
"tests-only": "nyc tape 'test/*.js'",
"posttest": "npx npm@\">= 10.2\" audit --production",
"lint": "eslint --ext=js,mjs .",
"postlint": "tsc && attw -P",
"version": "auto-changelog && git add CHANGELOG.md",
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
},
"dependencies": {
"is-callable": "^1.2.7"
},
"devDependencies": {
"@arethetypeswrong/cli": "^0.17.3",
"@ljharb/eslint-config": "^21.1.1",
"@ljharb/tsconfig": "^0.2.3",
"@types/is-callable": "^1.1.2",
"@types/tape": "^5.8.1",
"auto-changelog": "^2.5.0",
"eslint": "=8.8.0",
"npmignore": "^0.3.1",
"nyc": "^10.3.2",
"tape": "^5.9.0",
"typescript": "next"
},
"testling": {
"files": "test/test.js"
},
"engines": {
"node": ">= 0.4"
},
"auto-changelog": {
"output": "CHANGELOG.md",
"template": "keepachangelog",
"unreleased": false,
"commitLimit": false,
"backfillLimit": false,
"hideCredit": true
},
"publishConfig": {
"ignore": [
".github/workflows"
]
}
}
@@ -0,0 +1,44 @@
{
"name": "cookie",
"description": "HTTP server cookie parsing and serialization",
"version": "0.7.2",
"author": "Roman Shtylman <shtylman@gmail.com>",
"contributors": [
"Douglas Christopher Wilson <doug@somethingdoug.com>"
],
"license": "MIT",
"keywords": [
"cookie",
"cookies"
],
"repository": "jshttp/cookie",
"devDependencies": {
"beautify-benchmark": "0.2.4",
"benchmark": "2.1.4",
"eslint": "8.53.0",
"eslint-plugin-markdown": "3.0.1",
"mocha": "10.2.0",
"nyc": "15.1.0",
"safe-buffer": "5.2.1",
"top-sites": "1.1.194"
},
"files": [
"HISTORY.md",
"LICENSE",
"README.md",
"SECURITY.md",
"index.js"
],
"main": "index.js",
"engines": {
"node": ">= 0.6"
},
"scripts": {
"bench": "node benchmark/index.js",
"lint": "eslint .",
"test": "mocha --reporter spec --bail --check-leaks test/",
"test-ci": "nyc --reporter=lcov --reporter=text npm test",
"test-cov": "nyc --reporter=html --reporter=text npm test",
"update-bench": "node scripts/update-benchmark.js"
}
}
@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (C) 2015 Jordan Harband
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
@@ -0,0 +1,22 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
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 http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/// <reference no-default-lib="true"/>
declare type ClassDecorator = <TFunction extends Function>(target: TFunction) => TFunction | void;
declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void;
declare type MethodDecorator = <T>(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T> | void;
declare type ParameterDecorator = (target: Object, propertyKey: string | symbol | undefined, parameterIndex: number) => void;
@@ -0,0 +1,116 @@
import { statSync } from "node:fs";
import { parse, relative, join } from "node:path";
import { isObject } from "is-what-type";
import { glob } from "tinyglobby";
import { logFactory, banner, sleep, displayTime, toAbsolutePath } from "vp-runtime-helper";
import { readFile } from "node:fs/promises";
import { inspect } from "node:util";
import { copy, outputFile } from "fs-extra";
const name = "vite-plugin-cp";
const PLUGIN_NAME = name;
const logger = logFactory.getLogger(PLUGIN_NAME);
function stringify(value) {
return inspect(value, { breakLength: Infinity });
}
function changeName(name2, rename) {
if (typeof rename === "function") {
return rename(name2) || name2;
}
return rename || name2;
}
function makeCopy(transform) {
return typeof transform === "function" ? function(from, to) {
return readFile(from).then((buf) => transform(buf, from)).then((data) => {
return outputFile(to, data);
});
} : copy;
}
async function doCopy(config, cwd, globOptions, copyOptions) {
const { src, rename, flatten, transform } = config;
let { dest } = config;
if (!src || !dest) {
throw new Error(`${stringify(config)} target must have "src" and "dest" properties.`);
}
dest = toAbsolutePath(dest, cwd);
const cpFile = makeCopy(transform);
const run = async (source) => {
const absSource = toAbsolutePath(source, cwd);
let isNotFlatten = false;
try {
isNotFlatten = statSync(absSource).isDirectory() && !flatten;
} catch (e) {
}
const matchedPaths = await glob(absSource, globOptions);
if (!matchedPaths.length) {
logger.warn(`Could not find files with "${source}".`);
return null;
}
await Promise.all(matchedPaths.map((matchedPath) => {
let targetFileName;
let destDir = dest;
if (isNotFlatten) {
const tmp = parse(relative(absSource, matchedPath));
targetFileName = tmp.base;
destDir = join(destDir, tmp.dir);
} else {
targetFileName = parse(matchedPath).base;
}
const destPath = join(destDir, changeName(targetFileName, rename));
return cpFile(matchedPath, destPath, copyOptions).then(() => {
logger.trace(`Copied "${matchedPath}" to "${destPath}".`);
}, (e) => {
logger.warn(`Could not copy "${matchedPath}" to "${destPath}".`, e);
});
}));
};
if (typeof src === "string") {
await run(src);
} else if (Array.isArray(src)) {
await Promise.all(src.map(run));
}
}
function pluginCp(opts) {
const { hook = "closeBundle", enforce, targets, cwd = process.cwd(), globOptions, copyOptions, logLevel, delay, enableBanner } = opts || {};
if (!Array.isArray(targets) || !targets.length) {
logger.warn("No targets specified.");
return;
}
if (enableBanner) {
banner(PLUGIN_NAME);
}
if (logLevel) {
logger.level = logLevel;
}
const plugin = {
name: PLUGIN_NAME
};
if (enforce) {
plugin.enforce = enforce;
}
let called = false;
plugin[hook] = async function() {
if (called) {
return;
}
if (delay !== void 0) {
await sleep(delay);
}
called = true;
const startTime = Date.now();
await Promise.all(targets.map((target) => {
if (!isObject(target)) {
throw new TypeError(`${stringify(target)} target must be an object`);
}
return doCopy(target, cwd, Object.assign({}, globOptions, target.globOptions, {
absolute: true,
expandDirectories: true,
onlyFiles: true
}), Object.assign({}, copyOptions, target.copyOptions));
}));
logger.info(`Done in ${displayTime(Date.now() - startTime)}`);
};
return plugin;
}
export {
pluginCp as default
};
@@ -0,0 +1,16 @@
"use client";
import { jsx } from 'react/jsx-runtime';
import { invariant } from 'motion-utils';
import * as React from 'react';
import { useConstant } from '../utils/use-constant.mjs';
import { LayoutGroup } from './LayoutGroup/index.mjs';
let id = 0;
const AnimateSharedLayout = ({ children }) => {
React.useEffect(() => {
invariant(false, "AnimateSharedLayout is deprecated: https://www.framer.com/docs/guide-upgrade/##shared-layout-animations");
}, []);
return (jsx(LayoutGroup, { id: useConstant(() => `asl-${id++}`), children: children }));
};
export { AnimateSharedLayout };
@@ -0,0 +1,6 @@
import type { TSchema } from '../schema/index.mjs';
import { type TNever } from '../never/index.mjs';
import { TIntersect, IntersectOptions } from './intersect-type.mjs';
export type Intersect<Types extends TSchema[]> = (Types extends [TSchema] ? Types[0] : Types extends [] ? TNever : TIntersect<Types>);
/** `[Json]` Creates an evaluated Intersect type */
export declare function Intersect<Types extends TSchema[]>(types: [...Types], options?: IntersectOptions): Intersect<Types>;
@@ -0,0 +1,38 @@
// Copyright 2015 Google Inc. All Rights Reserved.
//
// 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
//
// http://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.
//
// Helper functions for woff2 variable length types: 255UInt16 and UIntBase128
#ifndef WOFF2_VARIABLE_LENGTH_H_
#define WOFF2_VARIABLE_LENGTH_H_
#include <inttypes.h>
#include <vector>
#include "./buffer.h"
namespace woff2 {
size_t Size255UShort(uint16_t value);
bool Read255UShort(Buffer* buf, unsigned int* value);
void Write255UShort(std::vector<uint8_t>* out, int value);
void Store255UShort(int val, size_t* offset, uint8_t* dst);
size_t Base128Size(size_t n);
bool ReadBase128(Buffer* buf, uint32_t* value);
void StoreBase128(size_t len, size_t* offset, uint8_t* dst);
} // namespace woff2
#endif // WOFF2_VARIABLE_LENGTH_H_
@@ -0,0 +1,3 @@
export type MessageIds = 'unsafeCall' | 'unsafeCallThis' | 'unsafeNew' | 'unsafeTemplateTag';
declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<MessageIds, [], import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
export default _default;
@@ -0,0 +1,188 @@
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/**
* react-router v7.9.5
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/
var _chunkEAE7427Ajs = require('./chunk-EAE7427A.js');
// lib/dom/ssr/hydration.tsx
function getHydrationData({
state,
routes,
getRouteInfo,
location,
basename,
isSpaMode
}) {
let hydrationData = {
...state,
loaderData: { ...state.loaderData }
};
let initialMatches = _chunkEAE7427Ajs.matchRoutes.call(void 0, routes, location, basename);
if (initialMatches) {
for (let match of initialMatches) {
let routeId = match.route.id;
let routeInfo = getRouteInfo(routeId);
if (_chunkEAE7427Ajs.shouldHydrateRouteLoader.call(void 0,
routeId,
routeInfo.clientLoader,
routeInfo.hasLoader,
isSpaMode
) && (routeInfo.hasHydrateFallback || !routeInfo.hasLoader)) {
delete hydrationData.loaderData[routeId];
} else if (!routeInfo.hasLoader) {
hydrationData.loaderData[routeId] = null;
}
}
}
return hydrationData;
}
// lib/rsc/errorBoundaries.tsx
var _react = require('react'); var _react2 = _interopRequireDefault(_react);
var RSCRouterGlobalErrorBoundary = class extends _react2.default.Component {
constructor(props) {
super(props);
this.state = { error: null, location: props.location };
}
static getDerivedStateFromError(error) {
return { error };
}
static getDerivedStateFromProps(props, state) {
if (state.location !== props.location) {
return { error: null, location: props.location };
}
return { error: state.error, location: state.location };
}
render() {
if (this.state.error) {
return /* @__PURE__ */ _react2.default.createElement(
RSCDefaultRootErrorBoundaryImpl,
{
error: this.state.error,
renderAppShell: true
}
);
} else {
return this.props.children;
}
}
};
function ErrorWrapper({
renderAppShell,
title,
children
}) {
if (!renderAppShell) {
return children;
}
return /* @__PURE__ */ _react2.default.createElement("html", { lang: "en" }, /* @__PURE__ */ _react2.default.createElement("head", null, /* @__PURE__ */ _react2.default.createElement("meta", { charSet: "utf-8" }), /* @__PURE__ */ _react2.default.createElement(
"meta",
{
name: "viewport",
content: "width=device-width,initial-scale=1,viewport-fit=cover"
}
), /* @__PURE__ */ _react2.default.createElement("title", null, title)), /* @__PURE__ */ _react2.default.createElement("body", null, /* @__PURE__ */ _react2.default.createElement("main", { style: { fontFamily: "system-ui, sans-serif", padding: "2rem" } }, children)));
}
function RSCDefaultRootErrorBoundaryImpl({
error,
renderAppShell
}) {
console.error(error);
let heyDeveloper = /* @__PURE__ */ _react2.default.createElement(
"script",
{
dangerouslySetInnerHTML: {
__html: `
console.log(
"\u{1F4BF} Hey developer \u{1F44B}. You can provide a way better UX than this when your app throws errors. Check out https://reactrouter.com/how-to/error-boundary for more information."
);
`
}
}
);
if (_chunkEAE7427Ajs.isRouteErrorResponse.call(void 0, error)) {
return /* @__PURE__ */ _react2.default.createElement(
ErrorWrapper,
{
renderAppShell,
title: "Unhandled Thrown Response!"
},
/* @__PURE__ */ _react2.default.createElement("h1", { style: { fontSize: "24px" } }, error.status, " ", error.statusText),
_chunkEAE7427Ajs.ENABLE_DEV_WARNINGS ? heyDeveloper : null
);
}
let errorInstance;
if (error instanceof Error) {
errorInstance = error;
} else {
let errorString = error == null ? "Unknown Error" : typeof error === "object" && "toString" in error ? error.toString() : JSON.stringify(error);
errorInstance = new Error(errorString);
}
return /* @__PURE__ */ _react2.default.createElement(ErrorWrapper, { renderAppShell, title: "Application Error!" }, /* @__PURE__ */ _react2.default.createElement("h1", { style: { fontSize: "24px" } }, "Application Error"), /* @__PURE__ */ _react2.default.createElement(
"pre",
{
style: {
padding: "2rem",
background: "hsla(10, 50%, 50%, 0.1)",
color: "red",
overflow: "auto"
}
},
errorInstance.stack
), heyDeveloper);
}
function RSCDefaultRootErrorBoundary({
hasRootLayout
}) {
let error = _chunkEAE7427Ajs.useRouteError.call(void 0, );
if (hasRootLayout === void 0) {
throw new Error("Missing 'hasRootLayout' prop");
}
return /* @__PURE__ */ _react2.default.createElement(
RSCDefaultRootErrorBoundaryImpl,
{
renderAppShell: !hasRootLayout,
error
}
);
}
// lib/rsc/route-modules.ts
function createRSCRouteModules(payload) {
const routeModules = {};
for (const match of payload.matches) {
populateRSCRouteModules(routeModules, match);
}
return routeModules;
}
function populateRSCRouteModules(routeModules, matches) {
matches = Array.isArray(matches) ? matches : [matches];
for (const match of matches) {
routeModules[match.id] = {
links: match.links,
meta: match.meta,
default: noopComponent
};
}
}
var noopComponent = () => null;
exports.getHydrationData = getHydrationData; exports.RSCRouterGlobalErrorBoundary = RSCRouterGlobalErrorBoundary; exports.RSCDefaultRootErrorBoundary = RSCDefaultRootErrorBoundary; exports.createRSCRouteModules = createRSCRouteModules; exports.populateRSCRouteModules = populateRSCRouteModules;
@@ -0,0 +1,7 @@
"use strict";
const constants = require("./constants-DR3SPJ7u.js");
const addMilliseconds = require("./addMilliseconds.js");
function addMinutes(date, minutes) {
return addMilliseconds(date, minutes * constants.MS_IN_MINUTE);
}
module.exports = addMinutes;
@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getRandomValues = getRandomValues;
const getWebCrypto_js_1 = require("./getWebCrypto.js");
/**
* Fill up the provided bytes array with random bytes equal to its length.
*
* @returns the same bytes array passed into the method
*/
async function getRandomValues(array) {
const WebCrypto = await (0, getWebCrypto_js_1.getWebCrypto)();
WebCrypto.getRandomValues(array);
return array;
}
@@ -0,0 +1,30 @@
import * as core from "../core/index.cjs";
import { $ZodError } from "../core/index.cjs";
/** @deprecated Use `z.core.$ZodIssue` from `@zod/core` instead, especially if you are building a library on top of Zod. */
export type ZodIssue = core.$ZodIssue;
/** An Error-like class used to store Zod validation issues. */
export interface ZodError<T = unknown> extends $ZodError<T> {
/** @deprecated Use the `z.treeifyError(err)` function instead. */
format(): core.$ZodFormattedError<T>;
format<U>(mapper: (issue: core.$ZodIssue) => U): core.$ZodFormattedError<T, U>;
/** @deprecated Use the `z.treeifyError(err)` function instead. */
flatten(): core.$ZodFlattenedError<T>;
flatten<U>(mapper: (issue: core.$ZodIssue) => U): core.$ZodFlattenedError<T, U>;
/** @deprecated Push directly to `.issues` instead. */
addIssue(issue: core.$ZodIssue): void;
/** @deprecated Push directly to `.issues` instead. */
addIssues(issues: core.$ZodIssue[]): void;
/** @deprecated Check `err.issues.length === 0` instead. */
isEmpty: boolean;
}
export declare const ZodError: core.$constructor<ZodError>;
export declare const ZodRealError: core.$constructor<ZodError>;
export type {
/** @deprecated Use `z.core.$ZodFlattenedError` instead. */
$ZodFlattenedError as ZodFlattenedError,
/** @deprecated Use `z.core.$ZodFormattedError` instead. */
$ZodFormattedError as ZodFormattedError,
/** @deprecated Use `z.core.$ZodErrorMap` instead. */
$ZodErrorMap as ZodErrorMap, } from "../core/index.cjs";
/** @deprecated Use `z.core.$ZodRawIssue` instead. */
export type IssueData = core.$ZodRawIssue;
@@ -0,0 +1,82 @@
{
"name": "string.prototype.trimstart",
"version": "1.0.8",
"author": "Jordan Harband <ljharb@gmail.com>",
"contributors": [
"Jordan Harband <ljharb@gmail.com>",
"Khaled Al-Ansari <khaledelansari@gmail.com>"
],
"funding": {
"url": "https://github.com/sponsors/ljharb"
},
"description": "ES2019 spec-compliant String.prototype.trimStart shim.",
"license": "MIT",
"main": "index.js",
"scripts": {
"prepack": "npmignore --auto --commentLines=autogenerated",
"prepublishOnly": "safe-publish-latest",
"prepublish": "not-in-publish || npm run prepublishOnly",
"lint": "eslint --ext=js,mjs .",
"postlint": "es-shim-api --bound",
"pretest": "npm run lint",
"test": "npm run tests-only",
"posttest": "aud --production",
"tests-only": "nyc tape 'test/**/*.js'",
"version": "auto-changelog && git add CHANGELOG.md",
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
},
"repository": {
"type": "git",
"url": "git://github.com/es-shims/String.prototype.trimStart.git"
},
"keywords": [
"es6",
"es7",
"es8",
"javascript",
"prototype",
"polyfill",
"utility",
"trim",
"trimLeft",
"trimRight",
"trimStart",
"trimEnd",
"tc39"
],
"devDependencies": {
"@es-shims/api": "^2.4.2",
"@ljharb/eslint-config": "^21.1.0",
"aud": "^2.0.4",
"auto-changelog": "^2.4.0",
"eslint": "=8.8.0",
"functions-have-names": "^1.2.3",
"has-strict-mode": "^1.0.1",
"in-publish": "^2.0.1",
"npmignore": "^0.3.1",
"nyc": "^10.3.2",
"safe-publish-latest": "^2.0.0",
"tape": "^5.7.5"
},
"auto-changelog": {
"output": "CHANGELOG.md",
"template": "keepachangelog",
"unreleased": false,
"commitLimit": false,
"backfillLimit": false,
"hideCredit": true
},
"dependencies": {
"call-bind": "^1.0.7",
"define-properties": "^1.2.1",
"es-object-atoms": "^1.0.0"
},
"publishConfig": {
"ignore": [
".github/workflows"
]
},
"engines": {
"node": ">= 0.4"
}
}
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2023 ui.dev
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,47 @@
{
"name": "simple-concat",
"description": "Super-minimalist version of `concat-stream`. Less than 15 lines!",
"version": "1.0.1",
"author": {
"name": "Feross Aboukhadijeh",
"email": "feross@feross.org",
"url": "https://feross.org"
},
"bugs": {
"url": "https://github.com/feross/simple-concat/issues"
},
"dependencies": {},
"devDependencies": {
"standard": "*",
"tape": "^5.0.1"
},
"homepage": "https://github.com/feross/simple-concat",
"keywords": [
"concat",
"concat-stream",
"concat stream"
],
"license": "MIT",
"main": "index.js",
"repository": {
"type": "git",
"url": "git://github.com/feross/simple-concat.git"
},
"scripts": {
"test": "standard && tape test/*.js"
},
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
]
}
@@ -0,0 +1,409 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PathError = exports.TokenData = void 0;
exports.parse = parse;
exports.compile = compile;
exports.match = match;
exports.pathToRegexp = pathToRegexp;
exports.stringify = stringify;
const DEFAULT_DELIMITER = "/";
const NOOP_VALUE = (value) => value;
const ID_START = /^[$_\p{ID_Start}]$/u;
const ID_CONTINUE = /^[$\u200c\u200d\p{ID_Continue}]$/u;
const SIMPLE_TOKENS = {
// Groups.
"{": "{",
"}": "}",
// Reserved.
"(": "(",
")": ")",
"[": "[",
"]": "]",
"+": "+",
"?": "?",
"!": "!",
};
/**
* Escape text for stringify to path.
*/
function escapeText(str) {
return str.replace(/[{}()\[\]+?!:*\\]/g, "\\$&");
}
/**
* Escape a regular expression string.
*/
function escape(str) {
return str.replace(/[.+*?^${}()[\]|/\\]/g, "\\$&");
}
/**
* Tokenized path instance.
*/
class TokenData {
constructor(tokens, originalPath) {
this.tokens = tokens;
this.originalPath = originalPath;
}
}
exports.TokenData = TokenData;
/**
* ParseError is thrown when there is an error processing the path.
*/
class PathError extends TypeError {
constructor(message, originalPath) {
let text = message;
if (originalPath)
text += `: ${originalPath}`;
text += `; visit https://git.new/pathToRegexpError for info`;
super(text);
this.originalPath = originalPath;
}
}
exports.PathError = PathError;
/**
* Parse a string for the raw tokens.
*/
function parse(str, options = {}) {
const { encodePath = NOOP_VALUE } = options;
const chars = [...str];
const tokens = [];
let index = 0;
let pos = 0;
function name() {
let value = "";
if (ID_START.test(chars[index])) {
do {
value += chars[index++];
} while (ID_CONTINUE.test(chars[index]));
}
else if (chars[index] === '"') {
let quoteStart = index;
while (index++ < chars.length) {
if (chars[index] === '"') {
index++;
quoteStart = 0;
break;
}
// Increment over escape characters.
if (chars[index] === "\\")
index++;
value += chars[index];
}
if (quoteStart) {
throw new PathError(`Unterminated quote at index ${quoteStart}`, str);
}
}
if (!value) {
throw new PathError(`Missing parameter name at index ${index}`, str);
}
return value;
}
while (index < chars.length) {
const value = chars[index];
const type = SIMPLE_TOKENS[value];
if (type) {
tokens.push({ type, index: index++, value });
}
else if (value === "\\") {
tokens.push({ type: "escape", index: index++, value: chars[index++] });
}
else if (value === ":") {
tokens.push({ type: "param", index: index++, value: name() });
}
else if (value === "*") {
tokens.push({ type: "wildcard", index: index++, value: name() });
}
else {
tokens.push({ type: "char", index: index++, value });
}
}
tokens.push({ type: "end", index, value: "" });
function consumeUntil(endType) {
const output = [];
while (true) {
const token = tokens[pos++];
if (token.type === endType)
break;
if (token.type === "char" || token.type === "escape") {
let path = token.value;
let cur = tokens[pos];
while (cur.type === "char" || cur.type === "escape") {
path += cur.value;
cur = tokens[++pos];
}
output.push({
type: "text",
value: encodePath(path),
});
continue;
}
if (token.type === "param" || token.type === "wildcard") {
output.push({
type: token.type,
name: token.value,
});
continue;
}
if (token.type === "{") {
output.push({
type: "group",
tokens: consumeUntil("}"),
});
continue;
}
throw new PathError(`Unexpected ${token.type} at index ${token.index}, expected ${endType}`, str);
}
return output;
}
return new TokenData(consumeUntil("end"), str);
}
/**
* Compile a string to a template function for the path.
*/
function compile(path, options = {}) {
const { encode = encodeURIComponent, delimiter = DEFAULT_DELIMITER } = options;
const data = typeof path === "object" ? path : parse(path, options);
const fn = tokensToFunction(data.tokens, delimiter, encode);
return function path(params = {}) {
const [path, ...missing] = fn(params);
if (missing.length) {
throw new TypeError(`Missing parameters: ${missing.join(", ")}`);
}
return path;
};
}
function tokensToFunction(tokens, delimiter, encode) {
const encoders = tokens.map((token) => tokenToFunction(token, delimiter, encode));
return (data) => {
const result = [""];
for (const encoder of encoders) {
const [value, ...extras] = encoder(data);
result[0] += value;
result.push(...extras);
}
return result;
};
}
/**
* Convert a single token into a path building function.
*/
function tokenToFunction(token, delimiter, encode) {
if (token.type === "text")
return () => [token.value];
if (token.type === "group") {
const fn = tokensToFunction(token.tokens, delimiter, encode);
return (data) => {
const [value, ...missing] = fn(data);
if (!missing.length)
return [value];
return [""];
};
}
const encodeValue = encode || NOOP_VALUE;
if (token.type === "wildcard" && encode !== false) {
return (data) => {
const value = data[token.name];
if (value == null)
return ["", token.name];
if (!Array.isArray(value) || value.length === 0) {
throw new TypeError(`Expected "${token.name}" to be a non-empty array`);
}
return [
value
.map((value, index) => {
if (typeof value !== "string") {
throw new TypeError(`Expected "${token.name}/${index}" to be a string`);
}
return encodeValue(value);
})
.join(delimiter),
];
};
}
return (data) => {
const value = data[token.name];
if (value == null)
return ["", token.name];
if (typeof value !== "string") {
throw new TypeError(`Expected "${token.name}" to be a string`);
}
return [encodeValue(value)];
};
}
/**
* Transform a path into a match function.
*/
function match(path, options = {}) {
const { decode = decodeURIComponent, delimiter = DEFAULT_DELIMITER } = options;
const { regexp, keys } = pathToRegexp(path, options);
const decoders = keys.map((key) => {
if (decode === false)
return NOOP_VALUE;
if (key.type === "param")
return decode;
return (value) => value.split(delimiter).map(decode);
});
return function match(input) {
const m = regexp.exec(input);
if (!m)
return false;
const path = m[0];
const params = Object.create(null);
for (let i = 1; i < m.length; i++) {
if (m[i] === undefined)
continue;
const key = keys[i - 1];
const decoder = decoders[i - 1];
params[key.name] = decoder(m[i]);
}
return { path, params };
};
}
function pathToRegexp(path, options = {}) {
const { delimiter = DEFAULT_DELIMITER, end = true, sensitive = false, trailing = true, } = options;
const keys = [];
const flags = sensitive ? "" : "i";
const sources = [];
for (const input of pathsToArray(path, [])) {
const data = typeof input === "object" ? input : parse(input, options);
for (const tokens of flatten(data.tokens, 0, [])) {
sources.push(toRegExpSource(tokens, delimiter, keys, data.originalPath));
}
}
let pattern = `^(?:${sources.join("|")})`;
if (trailing)
pattern += `(?:${escape(delimiter)}$)?`;
pattern += end ? "$" : `(?=${escape(delimiter)}|$)`;
const regexp = new RegExp(pattern, flags);
return { regexp, keys };
}
/**
* Convert a path or array of paths into a flat array.
*/
function pathsToArray(paths, init) {
if (Array.isArray(paths)) {
for (const p of paths)
pathsToArray(p, init);
}
else {
init.push(paths);
}
return init;
}
/**
* Generate a flat list of sequence tokens from the given tokens.
*/
function* flatten(tokens, index, init) {
if (index === tokens.length) {
return yield init;
}
const token = tokens[index];
if (token.type === "group") {
for (const seq of flatten(token.tokens, 0, init.slice())) {
yield* flatten(tokens, index + 1, seq);
}
}
else {
init.push(token);
}
yield* flatten(tokens, index + 1, init);
}
/**
* Transform a flat sequence of tokens into a regular expression.
*/
function toRegExpSource(tokens, delimiter, keys, originalPath) {
let result = "";
let backtrack = "";
let isSafeSegmentParam = true;
for (const token of tokens) {
if (token.type === "text") {
result += escape(token.value);
backtrack += token.value;
isSafeSegmentParam || (isSafeSegmentParam = token.value.includes(delimiter));
continue;
}
if (token.type === "param" || token.type === "wildcard") {
if (!isSafeSegmentParam && !backtrack) {
throw new PathError(`Missing text before "${token.name}" ${token.type}`, originalPath);
}
if (token.type === "param") {
result += `(${negate(delimiter, isSafeSegmentParam ? "" : backtrack)}+)`;
}
else {
result += `([\\s\\S]+)`;
}
keys.push(token);
backtrack = "";
isSafeSegmentParam = false;
continue;
}
}
return result;
}
/**
* Block backtracking on previous text and ignore delimiter string.
*/
function negate(delimiter, backtrack) {
if (backtrack.length < 2) {
if (delimiter.length < 2)
return `[^${escape(delimiter + backtrack)}]`;
return `(?:(?!${escape(delimiter)})[^${escape(backtrack)}])`;
}
if (delimiter.length < 2) {
return `(?:(?!${escape(backtrack)})[^${escape(delimiter)}])`;
}
return `(?:(?!${escape(backtrack)}|${escape(delimiter)})[\\s\\S])`;
}
/**
* Stringify an array of tokens into a path string.
*/
function stringifyTokens(tokens) {
let value = "";
let i = 0;
function name(value) {
const isSafe = isNameSafe(value) && isNextNameSafe(tokens[i]);
return isSafe ? value : JSON.stringify(value);
}
while (i < tokens.length) {
const token = tokens[i++];
if (token.type === "text") {
value += escapeText(token.value);
continue;
}
if (token.type === "group") {
value += `{${stringifyTokens(token.tokens)}}`;
continue;
}
if (token.type === "param") {
value += `:${name(token.name)}`;
continue;
}
if (token.type === "wildcard") {
value += `*${name(token.name)}`;
continue;
}
throw new TypeError(`Unknown token type: ${token.type}`);
}
return value;
}
/**
* Stringify token data into a path string.
*/
function stringify(data) {
return stringifyTokens(data.tokens);
}
/**
* Validate the parameter name contains valid ID characters.
*/
function isNameSafe(name) {
const [first, ...rest] = name;
return ID_START.test(first) && rest.every((char) => ID_CONTINUE.test(char));
}
/**
* Validate the next token does not interfere with the current param name.
*/
function isNextNameSafe(token) {
if (token && token.type === "text")
return !ID_CONTINUE.test(token.value[0]);
return true;
}
//# sourceMappingURL=index.js.map
@@ -0,0 +1,5 @@
<svg viewbox="0 0 18 18">
<rect class="ql-stroke-miter" height="12" width="12" x="3" y="3"></rect>
<line class="ql-stroke-miter" x1="9" x2="9" y1="3" y2="15"></line>
<line class="ql-stroke-miter" x1="15" x2="3" y1="9" y2="9"></line>
</svg>

After

Width:  |  Height:  |  Size: 246 B

@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=isResolvedValueMetadataInjectOptions.spec.d.ts.map
@@ -0,0 +1,2 @@
export declare function isPromise<T>(object: unknown): object is Promise<T>;
//# sourceMappingURL=isPromise.d.ts.map
@@ -0,0 +1,5 @@
export { TRANSITION_DEFAULTS, TRANSITION_EASINGS, TRANSITION_VARIANTS, TransitionConfig, TransitionEndConfig, TransitionProperties, Variants } from './transition-utils.mjs';
export { ResizablePanel, ResizablePanelProps } from './resizable-panel.mjs';
import 'framer-motion';
import 'react';
import '@heroui/system';
@@ -0,0 +1,47 @@
{
"name": "tslib",
"author": "Microsoft Corp.",
"homepage": "https://www.typescriptlang.org/",
"version": "2.8.1",
"license": "0BSD",
"description": "Runtime library for TypeScript helper functions",
"keywords": [
"TypeScript",
"Microsoft",
"compiler",
"language",
"javascript",
"tslib",
"runtime"
],
"bugs": {
"url": "https://github.com/Microsoft/TypeScript/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/Microsoft/tslib.git"
},
"main": "tslib.js",
"module": "tslib.es6.js",
"jsnext:main": "tslib.es6.js",
"typings": "tslib.d.ts",
"sideEffects": false,
"exports": {
".": {
"module": {
"types": "./modules/index.d.ts",
"default": "./tslib.es6.mjs"
},
"import": {
"node": "./modules/index.js",
"default": {
"types": "./modules/index.d.ts",
"default": "./tslib.es6.mjs"
}
},
"default": "./tslib.js"
},
"./*": "./*",
"./": "./"
}
}
@@ -0,0 +1 @@
export { _ as default } from "../esm/_check_private_redeclaration.js";
@@ -0,0 +1,22 @@
var getMapData = require('./_getMapData');
/**
* Sets the map `key` to `value`.
*
* @private
* @name set
* @memberOf MapCache
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the map cache instance.
*/
function mapCacheSet(key, value) {
var data = getMapData(this, key),
size = data.size;
data.set(key, value);
this.size += data.size == size ? 0 : 1;
return this;
}
module.exports = mapCacheSet;
@@ -0,0 +1,10 @@
"use client";
// src/base/listbox-section-base.tsx
import { BaseSection } from "@heroui/aria-utils";
var ListboxSectionBase = BaseSection;
var listbox_section_base_default = ListboxSectionBase;
export {
listbox_section_base_default
};
@@ -0,0 +1,3 @@
declare const _exports: import('eslint').Rule.RuleModule;
export = _exports;
//# sourceMappingURL=prefer-stateless-function.d.ts.map
@@ -0,0 +1,76 @@
{
"name": "dunder-proto",
"version": "1.0.1",
"description": "If available, the `Object.prototype.__proto__` accessor and mutator, call-bound",
"main": false,
"exports": {
"./get": "./get.js",
"./set": "./set.js",
"./package.json": "./package.json"
},
"sideEffects": false,
"scripts": {
"prepack": "npmignore --auto --commentLines=autogenerated",
"prepublish": "not-in-publish || npm run prepublishOnly",
"prepublishOnly": "safe-publish-latest",
"prelint": "evalmd README.md",
"lint": "eslint --ext=.js,.mjs .",
"postlint": "tsc -p . && attw -P",
"pretest": "npm run lint",
"tests-only": "nyc tape 'test/**/*.js'",
"test": "npm run tests-only",
"posttest": "npx npm@'>= 10.2' audit --production",
"version": "auto-changelog && git add CHANGELOG.md",
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
},
"repository": {
"type": "git",
"url": "git+https://github.com/es-shims/dunder-proto.git"
},
"author": "Jordan Harband <ljharb@gmail.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/es-shims/dunder-proto/issues"
},
"homepage": "https://github.com/es-shims/dunder-proto#readme",
"dependencies": {
"call-bind-apply-helpers": "^1.0.1",
"es-errors": "^1.3.0",
"gopd": "^1.2.0"
},
"devDependencies": {
"@arethetypeswrong/cli": "^0.17.1",
"@ljharb/eslint-config": "^21.1.1",
"@ljharb/tsconfig": "^0.2.2",
"@types/tape": "^5.7.0",
"auto-changelog": "^2.5.0",
"encoding": "^0.1.13",
"eslint": "=8.8.0",
"evalmd": "^0.0.19",
"in-publish": "^2.0.1",
"npmignore": "^0.3.1",
"nyc": "^10.3.2",
"safe-publish-latest": "^2.0.0",
"tape": "^5.9.0",
"typescript": "next"
},
"auto-changelog": {
"output": "CHANGELOG.md",
"template": "keepachangelog",
"unreleased": false,
"commitLimit": false,
"backfillLimit": false,
"hideCredit": true
},
"testling": {
"files": "test/index.js"
},
"publishConfig": {
"ignore": [
".github/workflows"
]
},
"engines": {
"node": ">= 0.4"
}
}
@@ -0,0 +1,36 @@
{
"name": "@lezer/css",
"version": "1.3.0",
"description": "lezer-based CSS grammar",
"main": "dist/index.cjs",
"type": "module",
"exports": {
"import": "./dist/index.js",
"require": "./dist/index.cjs"
},
"module": "dist/index.js",
"types": "dist/index.d.ts",
"author": "Marijn Haverbeke <marijn@haverbeke.berlin>",
"license": "MIT",
"devDependencies": {
"@lezer/generator": "^1.8.0",
"mocha": "^10.2.0",
"rollup": "^2.52.2",
"@rollup/plugin-node-resolve": "^9.0.0"
},
"dependencies": {
"@lezer/common": "^1.2.0",
"@lezer/lr": "^1.3.0",
"@lezer/highlight": "^1.0.0"
},
"repository": {
"type" : "git",
"url" : "https://github.com/lezer-parser/css.git"
},
"scripts": {
"build": "lezer-generator src/css.grammar -o src/parser && rollup -c",
"build-debug": "lezer-generator src/css.grammar --names -o src/parser && rollup -c",
"prepare": "npm run build",
"test": "mocha test/test-*.js"
}
}
@@ -0,0 +1,11 @@
import * as _heroui_system from '@heroui/system';
import { UsePaginationItemProps } from './use-pagination-item.mjs';
import 'react';
import '@react-types/shared';
import '@heroui/use-pagination';
interface PaginationItemProps extends UsePaginationItemProps {
}
declare const PaginationItem: _heroui_system.InternalForwardRefRenderFunction<"li", PaginationItemProps, never>;
export { type PaginationItemProps, PaginationItem as default };
@@ -0,0 +1,63 @@
import { RuleTester } from 'eslint';
import parserOptionsMapper from '../../__util__/parserOptionsMapper';
import parsers from '../../__util__/helpers/parsers';
import rule from '../../../src/rules/prefer-tag-over-role';
const ruleTester = new RuleTester();
const expectedError = (role, tag) => ({
message: `Use ${tag} instead of the "${role}" role to ensure accessibility across all devices.`,
type: 'JSXOpeningElement',
});
ruleTester.run('prefer-tag-over-role', rule, {
valid: parsers.all([].concat(
{ code: '<div />;' },
{ code: '<div role="unknown" />;' },
{ code: '<div role="also unknown" />;' },
{ code: '<other />' },
{ code: '<img role="img" />' },
{ code: '<input role="checkbox" />' },
)).map(parserOptionsMapper),
invalid: parsers.all([].concat(
{
code: '<div role="checkbox" />',
errors: [expectedError('checkbox', '<input type="checkbox">')],
},
{
code: '<div role="button checkbox" />',
errors: [expectedError('checkbox', '<input type="checkbox">')],
},
{
code: '<div role="heading" />',
errors: [
expectedError('heading', '<h1>, <h2>, <h3>, <h4>, <h5>, or <h6>'),
],
},
{
code: '<div role="link" />',
errors: [
expectedError(
'link',
'<a href=...>, or <area href=...>',
),
],
},
{
code: '<div role="rowgroup" />',
errors: [expectedError('rowgroup', '<tbody>, <tfoot>, or <thead>')],
},
{
code: '<span role="checkbox" />',
errors: [expectedError('checkbox', '<input type="checkbox">')],
},
{
code: '<other role="checkbox" />',
errors: [expectedError('checkbox', '<input type="checkbox">')],
},
{
code: '<div role="banner" />',
errors: [expectedError('banner', '<header>')],
},
)).map(parserOptionsMapper),
});
@@ -0,0 +1,18 @@
'use strict';
var hasOwn = require('hasown');
// https://262.ecma-international.org/13.0/#sec-match-records
module.exports = function isMatchRecord(record) {
return (
!!record
&& typeof record === 'object'
&& hasOwn(record, '[[StartIndex]]')
&& hasOwn(record, '[[EndIndex]]')
&& record['[[StartIndex]]'] >= 0
&& record['[[EndIndex]]'] >= record['[[StartIndex]]']
&& String(parseInt(record['[[StartIndex]]'], 10)) === String(record['[[StartIndex]]'])
&& String(parseInt(record['[[EndIndex]]'], 10)) === String(record['[[EndIndex]]'])
);
};
@@ -0,0 +1,125 @@
<!-- NOTE: README.md is generated from src/README.md -->
# @codemirror/lang-javascript [![NPM version](https://img.shields.io/npm/v/@codemirror/lang-javascript.svg)](https://www.npmjs.org/package/@codemirror/lang-javascript)
[ [**WEBSITE**](https://codemirror.net/) | [**ISSUES**](https://github.com/codemirror/dev/issues) | [**FORUM**](https://discuss.codemirror.net/c/next/) | [**CHANGELOG**](https://github.com/codemirror/lang-javascript/blob/main/CHANGELOG.md) ]
This package implements JavaScript language support for the
[CodeMirror](https://codemirror.net/) code editor.
The [project page](https://codemirror.net/) has more information, a
number of [examples](https://codemirror.net/examples/) and the
[documentation](https://codemirror.net/docs/).
This code is released under an
[MIT license](https://github.com/codemirror/lang-javascript/tree/main/LICENSE).
We aim to be an inclusive, welcoming community. To make that explicit,
we have a [code of
conduct](http://contributor-covenant.org/version/1/1/0/) that applies
to communication around the project.
## Usage
```javascript
import {EditorView, basicSetup} from "codemirror"
import {javascript} from "@codemirror/lang-javascript"
const view = new EditorView({
parent: document.body,
doc: `console.log("Hello world")`,
extensions: [basicSetup, javascript()]
})
```
## API Reference
<dl>
<dt id="user-content-javascript">
<code><strong><a href="#user-content-javascript">javascript</a></strong>(<a id="user-content-javascript^config" href="#user-content-javascript^config">config</a>&#8288;?: {jsx&#8288;?: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>, typescript&#8288;?: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>} = {}) → <a href="https://codemirror.net/docs/ref#language.LanguageSupport">LanguageSupport</a></code></dt>
<dd><p>JavaScript support. Includes <a href="#user-content-snippets">snippet</a>
and local variable completion.</p>
</dd>
<dt id="user-content-javascriptlanguage">
<code><strong><a href="#user-content-javascriptlanguage">javascriptLanguage</a></strong>: <a href="https://codemirror.net/docs/ref#language.LRLanguage">LRLanguage</a></code></dt>
<dd><p>A language provider based on the <a href="https://github.com/lezer-parser/javascript">Lezer JavaScript
parser</a>, extended with
highlighting and indentation information.</p>
</dd>
<dt id="user-content-typescriptlanguage">
<code><strong><a href="#user-content-typescriptlanguage">typescriptLanguage</a></strong>: <a href="https://codemirror.net/docs/ref#language.LRLanguage">LRLanguage</a></code></dt>
<dd><p>A language provider for TypeScript.</p>
</dd>
<dt id="user-content-jsxlanguage">
<code><strong><a href="#user-content-jsxlanguage">jsxLanguage</a></strong>: <a href="https://codemirror.net/docs/ref#language.LRLanguage">LRLanguage</a></code></dt>
<dd><p>Language provider for JSX.</p>
</dd>
<dt id="user-content-tsxlanguage">
<code><strong><a href="#user-content-tsxlanguage">tsxLanguage</a></strong>: <a href="https://codemirror.net/docs/ref#language.LRLanguage">LRLanguage</a></code></dt>
<dd><p>Language provider for JSX + TypeScript.</p>
</dd>
<dt id="user-content-autoclosetags">
<code><strong><a href="#user-content-autoclosetags">autoCloseTags</a></strong>: <a href="https://codemirror.net/docs/ref#state.Extension">Extension</a></code></dt>
<dd><p>Extension that will automatically insert JSX close tags when a <code>&gt;</code> or
<code>/</code> is typed.</p>
</dd>
<dt id="user-content-snippets">
<code><strong><a href="#user-content-snippets">snippets</a></strong>: readonly <a href="https://codemirror.net/docs/ref#autocomplete.Completion">Completion</a>[]</code></dt>
<dd><p>A collection of JavaScript-related
<a href="https://codemirror.net/docs/ref/#autocomplete.snippet">snippets</a>.</p>
</dd>
<dt id="user-content-typescriptsnippets">
<code><strong><a href="#user-content-typescriptsnippets">typescriptSnippets</a></strong>: <a href="https://codemirror.net/docs/ref#autocomplete.Completion">Completion</a>[]</code></dt>
<dd><p>A collection of snippet completions for TypeScript. Includes the
JavaScript <a href="#user-content-snippets">snippets</a>.</p>
</dd>
<dt id="user-content-localcompletionsource">
<code><strong><a href="#user-content-localcompletionsource">localCompletionSource</a></strong>(<a id="user-content-localcompletionsource^context" href="#user-content-localcompletionsource^context">context</a>: <a href="https://codemirror.net/docs/ref#autocomplete.CompletionContext">CompletionContext</a>) → <a href="https://codemirror.net/docs/ref#autocomplete.CompletionResult">CompletionResult</a> | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null">null</a></code></dt>
<dd><p>Completion source that looks up locally defined names in
JavaScript code.</p>
</dd>
<dt id="user-content-completionpath">
<code><strong><a href="#user-content-completionpath">completionPath</a></strong>(<a id="user-content-completionpath^context" href="#user-content-completionpath^context">context</a>: <a href="https://codemirror.net/docs/ref#autocomplete.CompletionContext">CompletionContext</a>) → {path: readonly <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>[], name: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>} | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null">null</a></code></dt>
<dd><p>Helper function for defining JavaScript completion sources. It
returns the completable name and object path for a completion
context, or null if no name/property completion should happen at
that position. For example, when completing after <code>a.b.c</code> it will
return <code>{path: [&quot;a&quot;, &quot;b&quot;], name: &quot;c&quot;}</code>. When completing after <code>x</code>
it will return <code>{path: [], name: &quot;x&quot;}</code>. When not in a property or
name, it will return null if <code>context.explicit</code> is false, and
<code>{path: [], name: &quot;&quot;}</code> otherwise.</p>
</dd>
<dt id="user-content-scopecompletionsource">
<code><strong><a href="#user-content-scopecompletionsource">scopeCompletionSource</a></strong>(<a id="user-content-scopecompletionsource^scope" href="#user-content-scopecompletionsource^scope">scope</a>: any) → <a href="https://codemirror.net/docs/ref#autocomplete.CompletionSource">CompletionSource</a></code></dt>
<dd><p>Defines a <a href="https://codemirror.net/docs/ref/#autocomplete.CompletionSource">completion source</a> that
completes from the given scope object (for example <code>globalThis</code>).
Will enter properties of the object when completing properties on
a directly-named path.</p>
</dd>
<dt id="user-content-eslint">
<code><strong><a href="#user-content-eslint">esLint</a></strong>(<a id="user-content-eslint^eslint" href="#user-content-eslint^eslint">eslint</a>: any, <a id="user-content-eslint^config" href="#user-content-eslint^config">config</a>&#8288;?: any) → fn(<a id="user-content-eslint^returns^view" href="#user-content-eslint^returns^view">view</a>: <a href="https://codemirror.net/docs/ref#view.EditorView">EditorView</a>) → <a href="https://codemirror.net/docs/ref#lint.Diagnostic">Diagnostic</a>[]</code></dt>
<dd><p>Connects an <a href="https://eslint.org/">ESLint</a> linter to CodeMirror's
<a href="https://codemirror.net/docs/ref/#lint">lint</a> integration. <code>eslint</code> should be an instance of the
<a href="https://eslint.org/docs/developer-guide/nodejs-api#linter"><code>Linter</code></a>
class, and <code>config</code> an optional ESLint configuration. The return
value of this function can be passed to <a href="https://codemirror.net/docs/ref/#lint.linter"><code>linter</code></a>
to create a JavaScript linting extension.</p>
<p>Note that ESLint targets node, and is tricky to run in the
browser. The
<a href="https://github.com/UziTech/eslint-linter-browserify">eslint-linter-browserify</a>
package may help with that (see
<a href="https://github.com/UziTech/eslint-linter-browserify/blob/master/example/script.js">example</a>).</p>
</dd>
</dl>
@@ -0,0 +1,7 @@
import { _ as _check_private_redeclaration } from "./_check_private_redeclaration.js";
function _class_private_field_init(obj, privateMap, value) {
_check_private_redeclaration(obj, privateMap);
privateMap.set(obj, value);
}
export { _class_private_field_init as _ };
@@ -0,0 +1,53 @@
"use strict";
var _overload_yield = require("./_overload_yield.cjs");
function _async_generator_delegate(inner) {
var iter = {}, waiting = false;
function pump(key, value) {
waiting = true;
value = new Promise(function(resolve) {
resolve(inner[key](value));
});
return { done: false, value: new _overload_yield._(value, /* kind: delegate */ 1) };
}
iter[(typeof Symbol !== "undefined" && Symbol.iterator) || "@@iterator"] = function() {
return this;
};
iter.next = function(value) {
if (waiting) {
waiting = false;
return value;
}
return pump("next", value);
};
if (typeof inner.throw === "function") {
iter.throw = function(value) {
if (waiting) {
waiting = false;
throw value;
}
return pump("throw", value);
};
}
if (typeof inner.return === "function") {
iter.return = function(value) {
if (waiting) {
waiting = false;
return value;
}
return pump("return", value);
};
}
return iter;
}
exports._ = _async_generator_delegate;
@@ -0,0 +1,51 @@
'use strict';
var test = require('tape');
var stopIterationIterator = require('../');
test('stopIterationIterator', function (t) {
t.equal(typeof stopIterationIterator, 'function', 'stopIterationIterator is a function');
t.test('no StopIteration support', { skip: typeof StopIteration === 'object' }, function (st) {
st['throws'](
// @ts-expect-error
function () { stopIterationIterator(); },
SyntaxError,
'throws a SyntaxError when StopIteration is not supported'
);
st.end();
});
t.test('StopIteration support', { skip: typeof StopIteration !== 'object' }, function (st) {
// eslint-disable-next-line no-extra-parens
var s = /** @type {Set<number> & { iterator(): SetIterator<number>}} */ (new Set([1, 2]));
var i = s.iterator();
st.equal(i.next(), 1, 'first item is 1');
st.equal(i.next(), 2, 'second item is 2');
try {
i.next();
st.fail();
} catch (e) {
st.equal(e, StopIteration, 'StopIteration thrown');
}
// eslint-disable-next-line no-extra-parens
var m = /** @type {Map<number, string> & { iterator(): MapIterator<[string, number]>}} */ (new Map([[1, 'a'], [2, 'b']]));
var mi = m.iterator();
st.deepEqual(mi.next(), [1, 'a'], 'first item is 1 and a');
st.deepEqual(mi.next(), [2, 'b'], 'second item is 2 and b');
try {
mi.next();
st.fail();
} catch (e) {
st.equal(e, StopIteration, 'StopIteration thrown');
}
st.end();
});
t.end();
});
@@ -0,0 +1,67 @@
# eslint-plugin-unused-imports
Find and remove unused es6 module imports. It works by splitting up the `no-unused-vars` rule depending on it being an import statement in the AST and providing an autofix rule to remove the nodes if they are imports. This plugin composes the rule `no-unused-vars` of either the typescript or js plugin so be aware that the other plugins needs to be installed and reporting correctly for this to do so.
## _Versions_
- Version 4.1.x is for eslint 9 with @typescript-eslint/eslint-plugin 5 - 8
- Version 4.0.x is for eslint 9 with @typescript-eslint/eslint-plugin 8
- Version 3.x.x is for eslint 8 with @typescript-eslint/eslint-plugin 6 - 7
- Version 2.x.x is for eslint 8 with @typescript-eslint/eslint-plugin 5
- Version 1.x.x is for eslint 6 and 7.
## Typescript
If running typescript with [@typescript-eslint](https://github.com/typescript-eslint/typescript-eslint) make sure to use both `@typescript-eslint/eslint-plugin` and `@typescript-eslint/parser`.
## React
If writing react code you need to install `eslint-plugin-react` and enable the two rules `react/jsx-uses-react` and `react/jsx-uses-vars`. Otherwise all imports for components will be reported unused.
## Installation
You'll first need to install [ESLint](http://eslint.org) (and [@typescript-eslint](https://github.com/typescript-eslint/typescript-eslint) if using typescript):
```bash
npm i eslint --save-dev
```
Next, install `eslint-plugin-unused-imports`:
```bash
npm install eslint-plugin-unused-imports --save-dev
```
**Note:** If you installed ESLint globally (using the `-g` flag) then you must also install `eslint-plugin-unused-imports` globally.
## Usage
Add `unused-imports` to the plugins section of your `eslint.config.js` configuration file.
```js
import unusedImports from "eslint-plugin-unused-imports";
export default [{
plugins: {
"unused-imports": unusedImports,
},
rules: {
"no-unused-vars": "off", // or "@typescript-eslint/no-unused-vars": "off",
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": [
"warn",
{
"vars": "all",
"varsIgnorePattern": "^_",
"args": "after-used",
"argsIgnorePattern": "^_",
},
]
}
}];
```
## Supported Rules
- `no-unused-imports`
- `no-unused-vars`
@@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.string = exports.stream = exports.pattern = exports.path = exports.fs = exports.errno = exports.array = void 0;
const array = require("./array");
exports.array = array;
const errno = require("./errno");
exports.errno = errno;
const fs = require("./fs");
exports.fs = fs;
const path = require("./path");
exports.path = path;
const pattern = require("./pattern");
exports.pattern = pattern;
const stream = require("./stream");
exports.stream = stream;
const string = require("./string");
exports.string = string;
@@ -0,0 +1,32 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/demi/react19/getInertValue.ts
var getInertValue_exports = {};
__export(getInertValue_exports, {
getInertValue: () => getInertValue
});
module.exports = __toCommonJS(getInertValue_exports);
var getInertValue = (v) => {
return v;
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
getInertValue
});
@@ -0,0 +1,17 @@
import {useToggle as $d2c8e2b0480f3f34$export$cbe85ee05b554577} from "./useToggle.module.js";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you 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 http://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 REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
export {$d2c8e2b0480f3f34$export$cbe85ee05b554577 as useToggle};
//# sourceMappingURL=module.js.map
@@ -0,0 +1 @@
{"version":3,"file":"buildGetPlanOptionsFromPlanParams.spec.d.ts","sourceRoot":"","sources":["../../../../src/planning/calculations/buildGetPlanOptionsFromPlanParams.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
{"name":"on-headers","version":"1.1.0","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532101646,"integrity":"sha512-mhUQwl1LYmjtNJEHhXlmruZl7L2vtEc0GRXQyWX3NdWXJb0lO/Nhz2XpndFm2+nZ8QWeRVx4tAbPR4PS26RTYg==","mode":420,"size":1089},"index.js":{"checkedAt":1794532103334,"integrity":"sha512-Gdk5drMnCDZj9RghszvOLyFmBb6QJ7fcwYRv6sU54XXxe4YsvCWSe/0wDLZMj2UJowdiXK/6Ohwtx1q5Ko4xCQ==","mode":420,"size":3727},"package.json":{"checkedAt":1794532103334,"integrity":"sha512-5K+iJym/HqWPiSll8VAZm+LcCo4jz5mRSmQ1MKv2MdhW1DU0ssGnzVofONWDGcsNVXMeyg18nx/laMCRSG11hg==","mode":420,"size":1285},"HISTORY.md":{"checkedAt":1794532103334,"integrity":"sha512-nJxE2DkVCSFpR/4OZCqmGRKhkN1wmL6iZp4IBG1xNFlachwlr0zKNQDoN375YtxW0/28gFz+/n6xQNzNHZLZ2w==","mode":420,"size":602},"README.md":{"checkedAt":1794532103335,"integrity":"sha512-K/s3S0RdwGuontJPnKpeDUrGYKBcXQJi5rSZBCHDPpBM+VDVyOc+U58njJsgxQMeWlFuCFViEr3YTWJUcuK/QQ==","mode":420,"size":2147}}}
@@ -0,0 +1,22 @@
import * as core from "../core/index.js";
import * as schemas from "./schemas.js";
export interface ZodMiniISODateTime extends schemas.ZodMiniStringFormat<"datetime"> {
_zod: core.$ZodISODateTimeInternals;
}
export declare const ZodMiniISODateTime: core.$constructor<ZodMiniISODateTime>;
export declare function datetime(params?: string | core.$ZodISODateTimeParams): ZodMiniISODateTime;
export interface ZodMiniISODate extends schemas.ZodMiniStringFormat<"date"> {
_zod: core.$ZodISODateInternals;
}
export declare const ZodMiniISODate: core.$constructor<ZodMiniISODate>;
export declare function date(params?: string | core.$ZodISODateParams): ZodMiniISODate;
export interface ZodMiniISOTime extends schemas.ZodMiniStringFormat<"time"> {
_zod: core.$ZodISOTimeInternals;
}
export declare const ZodMiniISOTime: core.$constructor<ZodMiniISOTime>;
export declare function time(params?: string | core.$ZodISOTimeParams): ZodMiniISOTime;
export interface ZodMiniISODuration extends schemas.ZodMiniStringFormat<"duration"> {
_zod: core.$ZodISODurationInternals;
}
export declare const ZodMiniISODuration: core.$constructor<ZodMiniISODuration>;
export declare function duration(params?: string | core.$ZodISODurationParams): ZodMiniISODuration;
@@ -0,0 +1,3 @@
import CryptoJS = require("./index");
export = CryptoJS.Blowfish;
@@ -0,0 +1,89 @@
// @ts-check
/**
* We must remap all the old bits to new bits for each set variant
* Only arbitrary variants are considered as those are the only
* ones that need to be re-sorted at this time
*
* An iterated process that removes and sets individual bits simultaneously
* will not work because we may have a new bit that is also a later old bit
* This means that we would be removing a previously set bit which we don't
* want to do
*
* For example (assume `bN` = `1<<N`)
* Given the "total" mapping `[[b1, b3], [b2, b4], [b3, b1], [b4, b2]]`
* The mapping is "total" because:
* 1. Every input and output is accounted for
* 2. All combinations are unique
* 3. No one input maps to multiple outputs and vice versa
* And, given an offset with all bits set:
* V = b1 | b2 | b3 | b4
*
* Let's explore the issue with removing and setting bits simultaneously:
* V & ~b1 | b3 = b2 | b3 | b4
* V & ~b2 | b4 = b3 | b4
* V & ~b3 | b1 = b1 | b4
* V & ~b4 | b2 = b1 | b2
*
* As you can see, we end up with the wrong result.
* This is because we're removing a bit that was previously set.
* And, thus the final result is missing b3 and b4.
*
* Now, let's explore the issue with removing the bits first:
* V & ~b1 = b2 | b3 | b4
* V & ~b2 = b3 | b4
* V & ~b3 = b4
* V & ~b4 = 0
*
* And then setting the bits:
* V | b3 = b3
* V | b4 = b3 | b4
* V | b1 = b1 | b3 | b4
* V | b2 = b1 | b2 | b3 | b4
*
* We get the correct result because we're not removing any bits that were
* previously set thus properly remapping the bits to the new order
*
* To collect this into a single operation that can be done simultaneously
* we must first create a mask for the old bits that are set and a mask for
* the new bits that are set. Then we can remove the old bits and set the new
* bits simultaneously in a "single" operation like so:
* OldMask = b1 | b2 | b3 | b4
* NewMask = b3 | b4 | b1 | b2
*
* So this:
* V & ~oldMask | newMask
*
* Expands to this:
* V & ~b1 & ~b2 & ~b3 & ~b4 | b3 | b4 | b1 | b2
*
* Which becomes this:
* b1 | b2 | b3 | b4
*
* Which is the correct result!
*
* @param {bigint} num
* @param {[bigint, bigint][]} mapping
*/ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "remapBitfield", {
enumerable: true,
get: function() {
return remapBitfield;
}
});
function remapBitfield(num, mapping) {
// Create masks for the old and new bits that are set
let oldMask = 0n;
let newMask = 0n;
for (let [oldBit, newBit] of mapping){
if (num & oldBit) {
oldMask = oldMask | oldBit;
newMask = newMask | newBit;
}
}
// Remove all old bits
// Set all new bits
return num & ~oldMask | newMask;
}
@@ -0,0 +1 @@
{"mappings":";AAAA,4BAAiB;IAAG,kBAAkB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,oBAAiB,CAAC;IAC7E,qBAAqB,CAAC,yDAAmD,CAAC;IAC1E,UAAU,CAAC,UAAU,CAAC;IACtB,eAAe,CAAC,4BAA4B,CAAC;IAC7C,iBAAiB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE;YAAC,MAAM,CAAC,uBAAuB,CAAC;YAAE,KAAK,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,iBAAiB,CAAC;YAAE,OAAO,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,mBAAmB,CAAC;QAAA,GAAG,CAAC,CAAC;IAC7O,gBAAgB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,aAAa,CAAC;AACvD","sources":["packages/@react-aria/grid/intl/pt-PT.json"],"sourcesContent":["{\n \"deselectedItem\": \"{item} não selecionado.\",\n \"longPressToSelect\": \"Prima continuamente para entrar no modo de seleção.\",\n \"select\": \"Selecionar\",\n \"selectedAll\": \"Todos os itens selecionados.\",\n \"selectedCount\": \"{count, plural, =0 {Nenhum item selecionado} one {# item selecionado} other {# itens selecionados}}.\",\n \"selectedItem\": \"{item} selecionado.\"\n}\n"],"names":[],"version":3,"file":"pt-PT.module.js.map"}
@@ -0,0 +1,10 @@
"use client";
import {
avatar_default
} from "./chunk-SXMLSBOY.mjs";
import "./chunk-25E6VDTZ.mjs";
import "./chunk-LTC67JRI.mjs";
import "./chunk-JUJ53SJZ.mjs";
export {
avatar_default as default
};
@@ -0,0 +1,378 @@
// Copyright (c) 2011-2012 Ryan Prichard
//
// 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.
#include <string.h>
#include <algorithm>
#include "EventLoop.h"
#include "NamedPipe.h"
#include "../shared/DebugClient.h"
#include "../shared/StringUtil.h"
#include "../shared/WindowsSecurity.h"
#include "../shared/WinptyAssert.h"
// Returns true if anything happens (data received, data sent, pipe error).
bool NamedPipe::serviceIo(std::vector<HANDLE> *waitHandles)
{
bool justConnected = false;
const auto kError = ServiceResult::Error;
const auto kProgress = ServiceResult::Progress;
const auto kNoProgress = ServiceResult::NoProgress;
if (m_handle == NULL) {
return false;
}
if (m_connectEvent.get() != nullptr) {
// We're still connecting this server pipe. Check whether the pipe is
// now connected. If it isn't, add the pipe to the list of handles to
// wait on.
DWORD actual = 0;
BOOL success =
GetOverlappedResult(m_handle, &m_connectOver, &actual, FALSE);
if (!success && GetLastError() == ERROR_PIPE_CONNECTED) {
// I'm not sure this can happen, but it's easy to handle if it
// does.
success = TRUE;
}
if (!success) {
ASSERT(GetLastError() == ERROR_IO_INCOMPLETE &&
"Pended ConnectNamedPipe call failed");
waitHandles->push_back(m_connectEvent.get());
} else {
TRACE("Server pipe [%s] connected",
utf8FromWide(m_name).c_str());
m_connectEvent.dispose();
startPipeWorkers();
justConnected = true;
}
}
const auto readProgress = m_inputWorker ? m_inputWorker->service() : kNoProgress;
const auto writeProgress = m_outputWorker ? m_outputWorker->service() : kNoProgress;
if (readProgress == kError || writeProgress == kError) {
closePipe();
return true;
}
if (m_inputWorker && m_inputWorker->getWaitEvent() != nullptr) {
waitHandles->push_back(m_inputWorker->getWaitEvent());
}
if (m_outputWorker && m_outputWorker->getWaitEvent() != nullptr) {
waitHandles->push_back(m_outputWorker->getWaitEvent());
}
return justConnected
|| readProgress == kProgress
|| writeProgress == kProgress;
}
// manual reset, initially unset
static OwnedHandle createEvent() {
HANDLE ret = CreateEventW(nullptr, TRUE, FALSE, nullptr);
ASSERT(ret != nullptr && "CreateEventW failed");
return OwnedHandle(ret);
}
NamedPipe::IoWorker::IoWorker(NamedPipe &namedPipe) :
m_namedPipe(namedPipe),
m_event(createEvent())
{
}
NamedPipe::ServiceResult NamedPipe::IoWorker::service()
{
ServiceResult progress = ServiceResult::NoProgress;
if (m_pending) {
DWORD actual = 0;
BOOL ret = GetOverlappedResult(m_namedPipe.m_handle, &m_over, &actual, FALSE);
if (!ret) {
if (GetLastError() == ERROR_IO_INCOMPLETE) {
// There is a pending I/O.
return progress;
} else {
// Pipe error.
return ServiceResult::Error;
}
}
ResetEvent(m_event.get());
m_pending = false;
completeIo(actual);
m_currentIoSize = 0;
progress = ServiceResult::Progress;
}
DWORD nextSize = 0;
bool isRead = false;
while (shouldIssueIo(&nextSize, &isRead)) {
m_currentIoSize = nextSize;
DWORD actual = 0;
memset(&m_over, 0, sizeof(m_over));
m_over.hEvent = m_event.get();
BOOL ret = isRead
? ReadFile(m_namedPipe.m_handle, m_buffer, nextSize, &actual, &m_over)
: WriteFile(m_namedPipe.m_handle, m_buffer, nextSize, &actual, &m_over);
if (!ret) {
if (GetLastError() == ERROR_IO_PENDING) {
// There is a pending I/O.
m_pending = true;
return progress;
} else {
// Pipe error.
return ServiceResult::Error;
}
}
ResetEvent(m_event.get());
completeIo(actual);
m_currentIoSize = 0;
progress = ServiceResult::Progress;
}
return progress;
}
// This function is called after CancelIo has returned. We need to block until
// the I/O operations have completed, which should happen very quickly.
// https://blogs.msdn.microsoft.com/oldnewthing/20110202-00/?p=11613
void NamedPipe::IoWorker::waitForCanceledIo()
{
if (m_pending) {
DWORD actual = 0;
GetOverlappedResult(m_namedPipe.m_handle, &m_over, &actual, TRUE);
m_pending = false;
}
}
HANDLE NamedPipe::IoWorker::getWaitEvent()
{
return m_pending ? m_event.get() : NULL;
}
void NamedPipe::InputWorker::completeIo(DWORD size)
{
m_namedPipe.m_inQueue.append(m_buffer, size);
}
bool NamedPipe::InputWorker::shouldIssueIo(DWORD *size, bool *isRead)
{
*isRead = true;
ASSERT(!m_namedPipe.isConnecting());
if (m_namedPipe.isClosed()) {
return false;
} else if (m_namedPipe.m_inQueue.size() < m_namedPipe.readBufferSize()) {
*size = kIoSize;
return true;
} else {
return false;
}
}
void NamedPipe::OutputWorker::completeIo(DWORD size)
{
ASSERT(size == m_currentIoSize);
}
bool NamedPipe::OutputWorker::shouldIssueIo(DWORD *size, bool *isRead)
{
*isRead = false;
if (!m_namedPipe.m_outQueue.empty()) {
auto &out = m_namedPipe.m_outQueue;
const DWORD writeSize = std::min<size_t>(out.size(), kIoSize);
std::copy(&out[0], &out[writeSize], m_buffer);
out.erase(0, writeSize);
*size = writeSize;
return true;
} else {
return false;
}
}
DWORD NamedPipe::OutputWorker::getPendingIoSize()
{
return m_pending ? m_currentIoSize : 0;
}
void NamedPipe::openServerPipe(LPCWSTR pipeName, OpenMode::t openMode,
int outBufferSize, int inBufferSize) {
ASSERT(isClosed());
ASSERT((openMode & OpenMode::Duplex) != 0);
const DWORD winOpenMode =
((openMode & OpenMode::Reading) ? PIPE_ACCESS_INBOUND : 0)
| ((openMode & OpenMode::Writing) ? PIPE_ACCESS_OUTBOUND : 0)
| FILE_FLAG_FIRST_PIPE_INSTANCE
| FILE_FLAG_OVERLAPPED;
const auto sd = createPipeSecurityDescriptorOwnerFullControl();
ASSERT(sd && "error creating data pipe SECURITY_DESCRIPTOR");
SECURITY_ATTRIBUTES sa = {};
sa.nLength = sizeof(sa);
sa.lpSecurityDescriptor = sd.get();
HANDLE handle = CreateNamedPipeW(
pipeName,
/*dwOpenMode=*/winOpenMode,
/*dwPipeMode=*/rejectRemoteClientsPipeFlag(),
/*nMaxInstances=*/1,
/*nOutBufferSize=*/outBufferSize,
/*nInBufferSize=*/inBufferSize,
/*nDefaultTimeOut=*/30000,
&sa);
TRACE("opened server pipe [%s], handle == %p",
utf8FromWide(pipeName).c_str(), handle);
ASSERT(handle != INVALID_HANDLE_VALUE && "Could not open server pipe");
m_name = pipeName;
m_handle = handle;
m_openMode = openMode;
// Start an asynchronous connection attempt.
m_connectEvent = createEvent();
memset(&m_connectOver, 0, sizeof(m_connectOver));
m_connectOver.hEvent = m_connectEvent.get();
BOOL success = ConnectNamedPipe(m_handle, &m_connectOver);
const auto err = GetLastError();
if (!success && err == ERROR_PIPE_CONNECTED) {
success = TRUE;
}
if (success) {
TRACE("Server pipe [%s] connected", utf8FromWide(pipeName).c_str());
m_connectEvent.dispose();
startPipeWorkers();
} else if (err != ERROR_IO_PENDING) {
ASSERT(false && "ConnectNamedPipe call failed");
}
}
void NamedPipe::connectToServer(LPCWSTR pipeName, OpenMode::t openMode)
{
ASSERT(isClosed());
ASSERT((openMode & OpenMode::Duplex) != 0);
HANDLE handle = CreateFileW(
pipeName,
GENERIC_READ | GENERIC_WRITE,
0,
NULL,
OPEN_EXISTING,
SECURITY_SQOS_PRESENT | SECURITY_IDENTIFICATION | FILE_FLAG_OVERLAPPED,
NULL);
TRACE("connected to [%s], handle == %p",
utf8FromWide(pipeName).c_str(), handle);
ASSERT(handle != INVALID_HANDLE_VALUE && "Could not connect to pipe");
m_name = pipeName;
m_handle = handle;
m_openMode = openMode;
startPipeWorkers();
}
void NamedPipe::startPipeWorkers()
{
if (m_openMode & OpenMode::Reading) {
m_inputWorker.reset(new InputWorker(*this));
}
if (m_openMode & OpenMode::Writing) {
m_outputWorker.reset(new OutputWorker(*this));
}
}
size_t NamedPipe::bytesToSend()
{
ASSERT(m_openMode & OpenMode::Writing);
auto ret = m_outQueue.size();
if (m_outputWorker != NULL) {
ret += m_outputWorker->getPendingIoSize();
}
return ret;
}
void NamedPipe::write(const void *data, size_t size)
{
ASSERT(m_openMode & OpenMode::Writing);
m_outQueue.append(reinterpret_cast<const char*>(data), size);
}
void NamedPipe::write(const char *text)
{
write(text, strlen(text));
}
size_t NamedPipe::readBufferSize()
{
ASSERT(m_openMode & OpenMode::Reading);
return m_readBufferSize;
}
void NamedPipe::setReadBufferSize(size_t size)
{
ASSERT(m_openMode & OpenMode::Reading);
m_readBufferSize = size;
}
size_t NamedPipe::bytesAvailable()
{
ASSERT(m_openMode & OpenMode::Reading);
return m_inQueue.size();
}
size_t NamedPipe::peek(void *data, size_t size)
{
ASSERT(m_openMode & OpenMode::Reading);
const auto out = reinterpret_cast<char*>(data);
const size_t ret = std::min(size, m_inQueue.size());
std::copy(&m_inQueue[0], &m_inQueue[ret], out);
return ret;
}
size_t NamedPipe::read(void *data, size_t size)
{
size_t ret = peek(data, size);
m_inQueue.erase(0, ret);
return ret;
}
std::string NamedPipe::readToString(size_t size)
{
ASSERT(m_openMode & OpenMode::Reading);
size_t retSize = std::min(size, m_inQueue.size());
std::string ret = m_inQueue.substr(0, retSize);
m_inQueue.erase(0, retSize);
return ret;
}
std::string NamedPipe::readAllToString()
{
ASSERT(m_openMode & OpenMode::Reading);
std::string ret = m_inQueue;
m_inQueue.clear();
return ret;
}
void NamedPipe::closePipe()
{
if (m_handle == NULL) {
return;
}
CancelIo(m_handle);
if (m_connectEvent.get() != nullptr) {
DWORD actual = 0;
GetOverlappedResult(m_handle, &m_connectOver, &actual, TRUE);
m_connectEvent.dispose();
}
if (m_inputWorker) {
m_inputWorker->waitForCanceledIo();
m_inputWorker.reset();
}
if (m_outputWorker) {
m_outputWorker->waitForCanceledIo();
m_outputWorker.reset();
}
CloseHandle(m_handle);
m_handle = NULL;
}
@@ -0,0 +1,50 @@
# get Makefile directory name: http://stackoverflow.com/a/5982798/376773
THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd)
# BIN directory
BIN := $(THIS_DIR)/node_modules/.bin
# Path
PATH := node_modules/.bin:$(PATH)
SHELL := /bin/bash
# applications
NODE ?= $(shell which node)
YARN ?= $(shell which yarn)
PKG ?= $(if $(YARN),$(YARN),$(NODE) $(shell which npm))
BROWSERIFY ?= $(NODE) $(BIN)/browserify
.FORCE:
install: node_modules
node_modules: package.json
@NODE_ENV= $(PKG) install
@touch node_modules
lint: .FORCE
eslint browser.js debug.js index.js node.js
test-node: .FORCE
istanbul cover node_modules/mocha/bin/_mocha -- test/**.js
test-browser: .FORCE
mkdir -p dist
@$(BROWSERIFY) \
--standalone debug \
. > dist/debug.js
karma start --single-run
rimraf dist
test: .FORCE
concurrently \
"make test-node" \
"make test-browser"
coveralls:
cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
.PHONY: all install clean distclean
@@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = toPrimitive;
function toPrimitive(input, hint) {
if (typeof input !== "object" || !input) return input;
var prim = input[Symbol.toPrimitive];
if (prim !== undefined) {
var res = prim.call(input, hint || "default");
if (typeof res !== "object") return res;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (hint === "string" ? String : Number)(input);
}
//# sourceMappingURL=toPrimitive.js.map
@@ -0,0 +1,10 @@
import { corePlugins } from '../src/corePlugins'
import fs from 'fs'
import path from 'path'
let corePluginList = Object.keys(corePlugins)
fs.writeFileSync(
path.join(process.cwd(), 'src', 'corePluginList.js'),
`export default ${JSON.stringify(corePluginList)}`
)
@@ -0,0 +1,22 @@
(The MIT License)
Copyright (c) 2014-2022 Douglas Christopher Wilson <doug@somethingdoug.com>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,222 @@
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you 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 http://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 REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
// Portions of the code in this file are based on code from react.
// Original licensing for the following can be found in the
// NOTICE file in the root directory of this source tree.
// See https://github.com/facebook/react/tree/cc7c1aece46a6b69b41958d731e0fd27c94bfc6c/packages/react-interactions
import {DOMAttributes, HoverEvents} from '@react-types/shared';
import {getOwnerDocument, nodeContains, useGlobalListeners} from '@react-aria/utils';
import {useEffect, useMemo, useRef, useState} from 'react';
export interface HoverProps extends HoverEvents {
/** Whether the hover events should be disabled. */
isDisabled?: boolean
}
export interface HoverResult {
/** Props to spread on the target element. */
hoverProps: DOMAttributes,
isHovered: boolean
}
// iOS fires onPointerEnter twice: once with pointerType="touch" and again with pointerType="mouse".
// We want to ignore these emulated events so they do not trigger hover behavior.
// See https://bugs.webkit.org/show_bug.cgi?id=214609.
let globalIgnoreEmulatedMouseEvents = false;
let hoverCount = 0;
function setGlobalIgnoreEmulatedMouseEvents() {
globalIgnoreEmulatedMouseEvents = true;
// Clear globalIgnoreEmulatedMouseEvents after a short timeout. iOS fires onPointerEnter
// with pointerType="mouse" immediately after onPointerUp and before onFocus. On other
// devices that don't have this quirk, we don't want to ignore a mouse hover sometime in
// the distant future because a user previously touched the element.
setTimeout(() => {
globalIgnoreEmulatedMouseEvents = false;
}, 50);
}
function handleGlobalPointerEvent(e: PointerEvent) {
if (e.pointerType === 'touch') {
setGlobalIgnoreEmulatedMouseEvents();
}
}
function setupGlobalTouchEvents() {
if (typeof document === 'undefined') {
return;
}
if (hoverCount === 0) {
if (typeof PointerEvent !== 'undefined') {
document.addEventListener('pointerup', handleGlobalPointerEvent);
} else if (process.env.NODE_ENV === 'test') {
document.addEventListener('touchend', setGlobalIgnoreEmulatedMouseEvents);
}
}
hoverCount++;
return () => {
hoverCount--;
if (hoverCount > 0) {
return;
}
if (typeof PointerEvent !== 'undefined') {
document.removeEventListener('pointerup', handleGlobalPointerEvent);
} else if (process.env.NODE_ENV === 'test') {
document.removeEventListener('touchend', setGlobalIgnoreEmulatedMouseEvents);
}
};
}
/**
* Handles pointer hover interactions for an element. Normalizes behavior
* across browsers and platforms, and ignores emulated mouse events on touch devices.
*/
export function useHover(props: HoverProps): HoverResult {
let {
onHoverStart,
onHoverChange,
onHoverEnd,
isDisabled
} = props;
let [isHovered, setHovered] = useState(false);
let state = useRef({
isHovered: false,
ignoreEmulatedMouseEvents: false,
pointerType: '',
target: null
}).current;
useEffect(setupGlobalTouchEvents, []);
let {addGlobalListener, removeAllGlobalListeners} = useGlobalListeners();
let {hoverProps, triggerHoverEnd} = useMemo(() => {
let triggerHoverStart = (event, pointerType) => {
state.pointerType = pointerType;
if (isDisabled || pointerType === 'touch' || state.isHovered || !event.currentTarget.contains(event.target)) {
return;
}
state.isHovered = true;
let target = event.currentTarget;
state.target = target;
// When an element that is hovered over is removed, no pointerleave event is fired by the browser,
// even though the originally hovered target may have shrunk in size so it is no longer hovered.
// However, a pointerover event will be fired on the new target the mouse is over.
// In Chrome this happens immediately. In Safari and Firefox, it happens upon moving the mouse one pixel.
addGlobalListener(getOwnerDocument(event.target), 'pointerover', e => {
if (state.isHovered && state.target && !nodeContains(state.target, e.target as Element)) {
triggerHoverEnd(e, e.pointerType);
}
}, {capture: true});
if (onHoverStart) {
onHoverStart({
type: 'hoverstart',
target,
pointerType
});
}
if (onHoverChange) {
onHoverChange(true);
}
setHovered(true);
};
let triggerHoverEnd = (event, pointerType) => {
let target = state.target;
state.pointerType = '';
state.target = null;
if (pointerType === 'touch' || !state.isHovered || !target) {
return;
}
state.isHovered = false;
removeAllGlobalListeners();
if (onHoverEnd) {
onHoverEnd({
type: 'hoverend',
target,
pointerType
});
}
if (onHoverChange) {
onHoverChange(false);
}
setHovered(false);
};
let hoverProps: DOMAttributes = {};
if (typeof PointerEvent !== 'undefined') {
hoverProps.onPointerEnter = (e) => {
if (globalIgnoreEmulatedMouseEvents && e.pointerType === 'mouse') {
return;
}
triggerHoverStart(e, e.pointerType);
};
hoverProps.onPointerLeave = (e) => {
if (!isDisabled && e.currentTarget.contains(e.target as Element)) {
triggerHoverEnd(e, e.pointerType);
}
};
} else if (process.env.NODE_ENV === 'test') {
hoverProps.onTouchStart = () => {
state.ignoreEmulatedMouseEvents = true;
};
hoverProps.onMouseEnter = (e) => {
if (!state.ignoreEmulatedMouseEvents && !globalIgnoreEmulatedMouseEvents) {
triggerHoverStart(e, 'mouse');
}
state.ignoreEmulatedMouseEvents = false;
};
hoverProps.onMouseLeave = (e) => {
if (!isDisabled && e.currentTarget.contains(e.target as Element)) {
triggerHoverEnd(e, 'mouse');
}
};
}
return {hoverProps, triggerHoverEnd};
}, [onHoverStart, onHoverChange, onHoverEnd, isDisabled, state, addGlobalListener, removeAllGlobalListeners]);
useEffect(() => {
// Call the triggerHoverEnd as soon as isDisabled changes to true
// Safe to call triggerHoverEnd, it will early return if we aren't currently hovering
if (isDisabled) {
triggerHoverEnd({currentTarget: state.target}, state.pointerType);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [isDisabled]);
return {
hoverProps,
isHovered
};
}
@@ -0,0 +1,37 @@
import { FriendRequest, FriendV2 } from '../types';
import { InstanceContext, NapCatCore } from '../index';
import { LimitedHashTable } from '../../napcat-common/src/message-unique';
export declare class NTQQFriendApi {
context: InstanceContext;
core: NapCatCore;
constructor(context: InstanceContext, core: NapCatCore);
setBuddyRemark(uid: string, remark: string): Promise<void>;
getBuddyV2SimpleInfoMap(): Promise<Map<string, import("../types").SimpleInfo>>;
getBuddy(): Promise<FriendV2[]>;
getBuddyIdMap(): Promise<LimitedHashTable<string, string>>;
delBuddy(uid: string, tempBlock?: boolean, tempBothDel?: boolean): Promise<unknown>;
getBuddyV2ExWithCate(): Promise<{
categoryId: number;
categorySortId: number;
categoryName: string;
categoryMbCount: number;
onlineCount: number;
buddyList: import("../types").SimpleInfo[];
}[]>;
isBuddy(uid: string): Promise<boolean>;
clearBuddyReqUnreadCnt(): Promise<import("../index").GeneralCallResult>;
getBuddyReq(): Promise<import("../types").FriendRequestNotify>;
handleFriendRequest(notify: FriendRequest, accept: boolean): Promise<void>;
handleDoubtFriendRequest(friendUid: string, str1?: string, str2?: string): Promise<void>;
getDoubtFriendRequest(count: number): Promise<{
flag: string;
uin: string;
nick: string;
source: string;
reason: string;
msg: string;
group_code: string;
time: string;
type: string;
}[]>;
}
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('functionsIn', require('../functionsIn'), require('./_falseOptions'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1,108 @@
'use strict';
var utils = require('../utils.js');
require('eslint-visitor-keys');
require('espree');
require('estraverse');
var _baseRule = utils.createRule({
name: "no-extra-semi",
package: "js",
meta: {
type: "layout",
docs: {
description: "Disallow unnecessary semicolons"
},
fixable: "code",
schema: [],
messages: {
unexpected: "Unnecessary semicolon."
}
},
create(context) {
const sourceCode = context.sourceCode;
function isFixable(nodeOrToken) {
const nextToken = sourceCode.getTokenAfter(nodeOrToken);
if (!nextToken || nextToken.type !== "String")
return true;
const stringNode = sourceCode.getNodeByRangeIndex(nextToken.range[0]);
return !utils.isTopLevelExpressionStatement(stringNode.parent);
}
function report(nodeOrToken) {
context.report({
node: nodeOrToken,
messageId: "unexpected",
fix: isFixable(nodeOrToken) ? (fixer) => new utils.FixTracker(fixer, context.sourceCode).retainSurroundingTokens(nodeOrToken).remove(nodeOrToken) : null
});
}
function checkForPartOfClassBody(firstToken) {
for (let token = firstToken; token.type === "Punctuator" && !utils.isClosingBraceToken(token); token = sourceCode.getTokenAfter(token)) {
if (utils.isSemicolonToken(token))
report(token);
}
}
return {
/**
* Reports this empty statement, except if the parent node is a loop.
* @param node A EmptyStatement node to be reported.
*/
EmptyStatement(node) {
const parent = node.parent;
const allowedParentTypes = [
"ForStatement",
"ForInStatement",
"ForOfStatement",
"WhileStatement",
"DoWhileStatement",
"IfStatement",
"LabeledStatement",
"WithStatement"
];
if (!allowedParentTypes.includes(parent.type))
report(node);
},
/**
* Checks tokens from the head of this class body to the first MethodDefinition or the end of this class body.
* @param node A ClassBody node to check.
*/
ClassBody(node) {
checkForPartOfClassBody(sourceCode.getFirstToken(node, 1));
},
/**
* Checks tokens from this MethodDefinition to the next MethodDefinition or the end of this class body.
* @param node A MethodDefinition node of the start point.
*/
"MethodDefinition, PropertyDefinition, StaticBlock": function(node) {
checkForPartOfClassBody(sourceCode.getTokenAfter(node));
}
};
}
});
const baseRule = /* @__PURE__ */ utils.castRuleModule(_baseRule);
var noExtraSemi = utils.createRule({
name: "no-extra-semi",
package: "ts",
meta: {
type: "layout",
docs: {
description: "Disallow unnecessary semicolons"
},
fixable: "code",
hasSuggestions: baseRule.meta.hasSuggestions,
schema: baseRule.meta.schema,
messages: baseRule.meta.messages
},
defaultOptions: [],
create(context) {
const rules = baseRule.create(context);
return {
...rules,
"TSAbstractMethodDefinition, TSAbstractPropertyDefinition": function(node) {
rules["MethodDefinition, PropertyDefinition, StaticBlock"]?.(node);
}
};
}
});
module.exports = noExtraSemi;
@@ -0,0 +1,18 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./any"), exports);
@@ -0,0 +1,9 @@
import { TraceMap } from './trace-mapping.cts';
import type { SectionedSourceMapInput, Ro } from './types.cts';
type FlattenMap = {
new (map: Ro<SectionedSourceMapInput>, mapUrl?: string | null): TraceMap;
(map: Ro<SectionedSourceMapInput>, mapUrl?: string | null): TraceMap;
};
export declare const FlattenMap: FlattenMap;
export {};
//# sourceMappingURL=flatten-map.d.ts.map
@@ -0,0 +1 @@
{"name":"stream-shift","version":"1.0.3","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532123144,"integrity":"sha512-BXo3lvPVbhYP6tnak9LFlEzrz22vZw6CDexP++oggKNsUej1H1tt/Y9o8CdgHbK0+LachBAe7/K5Bxdo2ob7cA==","mode":420,"size":1079},"index.js":{"checkedAt":1794532123145,"integrity":"sha512-3DhFAjn7BBtetDiLA6r0wjdUwJTJwBfIx74bXC4c3KztFJ3StogQOBvC7aCDq6ZY8E7XvGaW6UtMs1ZYPqsNIg==","mode":420,"size":607},"test.js":{"checkedAt":1794532123145,"integrity":"sha512-6n180MiDRVbisHsmy7YNvGos2caOihvL34JthBgGf1XVlOnctRYhIZPYxxtKKREl68rETIvd9rzNtUR10rfTUw==","mode":420,"size":1166},"package.json":{"checkedAt":1794532123145,"integrity":"sha512-qSSxf7dUtALnA9k+/cJbkc/LFwdbktwi2JZ0NyX9iBxRKE7qekH7HQwdw2J04ckluU9LWjLjoZlmG9U81JkI4w==","mode":420,"size":635},"README.md":{"checkedAt":1794532123145,"integrity":"sha512-uFPDftkkwqE2QVJCt30aHEW0g50vz3S+z2+IrY+Ufzoo9zA+wcKXVv34axB9L90aqFsvHzLGl3Y1UcGPpqKNaQ==","mode":420,"size":480},".github/workflows/test.yml":{"checkedAt":1794532123145,"integrity":"sha512-XApKO8/4c2oTDl9oHPdNR6wOpiVhfA5a2fK3sYD0SWdge50EHZwzhzT5uwFWNNlEST1Rn2Pt4G6bAzeIKox7yA==","mode":420,"size":498}}}
@@ -0,0 +1,256 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const ts = __importStar(require("typescript"));
const util_1 = require("../util");
const getWrappedCode_1 = require("../util/getWrappedCode");
exports.default = (0, util_1.createRule)({
name: 'consistent-type-assertions',
meta: {
type: 'suggestion',
docs: {
description: 'Enforce consistent usage of type assertions',
recommended: 'stylistic',
},
fixable: 'code',
hasSuggestions: true,
messages: {
'angle-bracket': "Use '<{{cast}}>' instead of 'as {{cast}}'.",
as: "Use 'as {{cast}}' instead of '<{{cast}}>'.",
never: 'Do not use any type assertions.',
replaceArrayTypeAssertionWithAnnotation: 'Use const x: {{cast}} = [ ... ] instead.',
replaceArrayTypeAssertionWithSatisfies: 'Use const x = [ ... ] satisfies {{cast}} instead.',
replaceObjectTypeAssertionWithAnnotation: 'Use const x: {{cast}} = { ... } instead.',
replaceObjectTypeAssertionWithSatisfies: 'Use const x = { ... } satisfies {{cast}} instead.',
unexpectedArrayTypeAssertion: 'Always prefer const x: T[] = [ ... ].',
unexpectedObjectTypeAssertion: 'Always prefer const x: T = { ... }.',
},
schema: [
{
oneOf: [
{
type: 'object',
additionalProperties: false,
properties: {
assertionStyle: {
type: 'string',
description: 'The expected assertion style to enforce.',
enum: ['never'],
},
},
required: ['assertionStyle'],
},
{
type: 'object',
additionalProperties: false,
properties: {
arrayLiteralTypeAssertions: {
type: 'string',
description: 'Whether to always prefer type declarations for array literals used as variable initializers, rather than type assertions.',
enum: ['allow', 'allow-as-parameter', 'never'],
},
assertionStyle: {
type: 'string',
description: 'The expected assertion style to enforce.',
enum: ['as', 'angle-bracket'],
},
objectLiteralTypeAssertions: {
type: 'string',
description: 'Whether to always prefer type declarations for object literals used as variable initializers, rather than type assertions.',
enum: ['allow', 'allow-as-parameter', 'never'],
},
},
},
],
},
],
},
defaultOptions: [
{
arrayLiteralTypeAssertions: 'allow',
assertionStyle: 'as',
objectLiteralTypeAssertions: 'allow',
},
],
create(context, [options]) {
function isConst(node) {
if (node.type !== utils_1.AST_NODE_TYPES.TSTypeReference) {
return false;
}
return (node.typeName.type === utils_1.AST_NODE_TYPES.Identifier &&
node.typeName.name === 'const');
}
function reportIncorrectAssertionType(node) {
const messageId = options.assertionStyle;
// If this node is `as const`, then don't report an error.
if (isConst(node.typeAnnotation) && messageId === 'never') {
return;
}
context.report({
node,
messageId,
data: messageId !== 'never'
? { cast: context.sourceCode.getText(node.typeAnnotation) }
: {},
fix: messageId === 'as'
? (fixer) => {
// lazily access parserServices to avoid crashing on non TS files (#9860)
const tsNode = (0, util_1.getParserServices)(context, true).esTreeNodeToTSNodeMap.get(node);
const expressionCode = context.sourceCode.getText(node.expression);
const typeAnnotationCode = context.sourceCode.getText(node.typeAnnotation);
const asPrecedence = (0, util_1.getOperatorPrecedence)(ts.SyntaxKind.AsExpression, ts.SyntaxKind.Unknown);
const parentPrecedence = (0, util_1.getOperatorPrecedence)(tsNode.parent.kind, ts.isBinaryExpression(tsNode.parent)
? tsNode.parent.operatorToken.kind
: ts.SyntaxKind.Unknown, ts.isNewExpression(tsNode.parent)
? tsNode.parent.arguments != null &&
tsNode.parent.arguments.length > 0
: undefined);
const expressionPrecedence = (0, util_1.getOperatorPrecedenceForNode)(node.expression);
const expressionCodeWrapped = (0, getWrappedCode_1.getWrappedCode)(expressionCode, expressionPrecedence, asPrecedence);
const text = `${expressionCodeWrapped} as ${typeAnnotationCode}`;
return fixer.replaceText(node, (0, util_1.isParenthesized)(node, context.sourceCode)
? text
: (0, getWrappedCode_1.getWrappedCode)(text, asPrecedence, parentPrecedence));
}
: undefined,
});
}
function checkType(node) {
switch (node.type) {
case utils_1.AST_NODE_TYPES.TSAnyKeyword:
case utils_1.AST_NODE_TYPES.TSUnknownKeyword:
return false;
case utils_1.AST_NODE_TYPES.TSTypeReference:
return (
// Ignore `as const` and `<const>`
!isConst(node) ||
// Allow qualified names which have dots between identifiers, `Foo.Bar`
node.typeName.type === utils_1.AST_NODE_TYPES.TSQualifiedName);
default:
return true;
}
}
function getSuggestions(node, annotationMessageId, satisfiesMessageId) {
const suggestions = [];
if (node.parent.type === utils_1.AST_NODE_TYPES.VariableDeclarator &&
!node.parent.id.typeAnnotation) {
const { parent } = node;
suggestions.push({
messageId: annotationMessageId,
data: { cast: context.sourceCode.getText(node.typeAnnotation) },
fix: fixer => [
fixer.insertTextAfter(parent.id, `: ${context.sourceCode.getText(node.typeAnnotation)}`),
fixer.replaceText(node, (0, util_1.getTextWithParentheses)(context.sourceCode, node.expression)),
],
});
}
suggestions.push({
messageId: satisfiesMessageId,
data: { cast: context.sourceCode.getText(node.typeAnnotation) },
fix: fixer => [
fixer.replaceText(node, (0, util_1.getTextWithParentheses)(context.sourceCode, node.expression)),
fixer.insertTextAfter(node, ` satisfies ${context.sourceCode.getText(node.typeAnnotation)}`),
],
});
return suggestions;
}
function isAsParameter(node) {
return (node.parent.type === utils_1.AST_NODE_TYPES.NewExpression ||
node.parent.type === utils_1.AST_NODE_TYPES.CallExpression ||
node.parent.type === utils_1.AST_NODE_TYPES.ThrowStatement ||
node.parent.type === utils_1.AST_NODE_TYPES.AssignmentPattern ||
node.parent.type === utils_1.AST_NODE_TYPES.JSXExpressionContainer ||
(node.parent.type === utils_1.AST_NODE_TYPES.TemplateLiteral &&
node.parent.parent.type === utils_1.AST_NODE_TYPES.TaggedTemplateExpression));
}
function checkExpressionForObjectAssertion(node) {
if (options.assertionStyle === 'never' ||
options.objectLiteralTypeAssertions === 'allow' ||
node.expression.type !== utils_1.AST_NODE_TYPES.ObjectExpression) {
return;
}
if (options.objectLiteralTypeAssertions === 'allow-as-parameter' &&
isAsParameter(node)) {
return;
}
if (checkType(node.typeAnnotation)) {
const suggest = getSuggestions(node, 'replaceObjectTypeAssertionWithAnnotation', 'replaceObjectTypeAssertionWithSatisfies');
context.report({
node,
messageId: 'unexpectedObjectTypeAssertion',
suggest,
});
}
}
function checkExpressionForArrayAssertion(node) {
if (options.assertionStyle === 'never' ||
options.arrayLiteralTypeAssertions === 'allow' ||
node.expression.type !== utils_1.AST_NODE_TYPES.ArrayExpression) {
return;
}
if (options.arrayLiteralTypeAssertions === 'allow-as-parameter' &&
isAsParameter(node)) {
return;
}
if (checkType(node.typeAnnotation)) {
const suggest = getSuggestions(node, 'replaceArrayTypeAssertionWithAnnotation', 'replaceArrayTypeAssertionWithSatisfies');
context.report({
node,
messageId: 'unexpectedArrayTypeAssertion',
suggest,
});
}
}
return {
TSAsExpression(node) {
if (options.assertionStyle !== 'as') {
reportIncorrectAssertionType(node);
return;
}
checkExpressionForObjectAssertion(node);
checkExpressionForArrayAssertion(node);
},
TSTypeAssertion(node) {
if (options.assertionStyle !== 'angle-bracket') {
reportIncorrectAssertionType(node);
return;
}
checkExpressionForObjectAssertion(node);
checkExpressionForArrayAssertion(node);
},
};
},
});
@@ -0,0 +1,62 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/code.tsx
var code_exports = {};
__export(code_exports, {
default: () => code_default
});
module.exports = __toCommonJS(code_exports);
var import_system_rsc2 = require("@heroui/system-rsc");
// src/use-code.ts
var import_theme = require("@heroui/theme");
var import_system_rsc = require("@heroui/system-rsc");
var import_react = require("react");
var import_shared_utils = require("@heroui/shared-utils");
function useCode(originalProps) {
const [props, variantProps] = (0, import_system_rsc.mapPropsVariants)(originalProps, import_theme.code.variantKeys);
const { as, children, className, ...otherProps } = props;
const Component = as || "code";
const classNames = (0, import_react.useMemo)(
() => (0, import_theme.code)({
...variantProps,
className
}),
[(0, import_shared_utils.objectToDeps)(variantProps), className]
);
const getCodeProps = () => {
return {
className: classNames,
...otherProps
};
};
return { Component, children, getCodeProps };
}
// src/code.tsx
var import_jsx_runtime = require("react/jsx-runtime");
var Code = (0, import_system_rsc2.forwardRef)((props, ref) => {
const { Component, children, getCodeProps } = useCode({ ...props });
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, { ref, ...getCodeProps(), children });
});
Code.displayName = "HeroUI.Code";
var code_default = Code;
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {});
@@ -0,0 +1,4 @@
import type { InternalFieldErrors, InternalFieldName, ValidateResult } from '../types';
declare const _default: (name: InternalFieldName, validateAllFieldCriteria: boolean, errors: InternalFieldErrors, type: string, message: ValidateResult) => {};
export default _default;
//# sourceMappingURL=appendErrors.d.ts.map
@@ -0,0 +1 @@
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports,require("goober")):"function"==typeof define&&define.amd?define(["exports","goober"],o):o((e||self).gooberGlobal={},e.goober)}(this,function(e,o){let n=o.css.bind({g:1});e.createGlobalStyles=function(){const e=o.styled.call({g:1},"div").apply(null,arguments);return function(o){return e(o),null}},e.glob=n});
@@ -0,0 +1 @@
{"version":3,"file":"buildArrayMetadataWithArray.spec.d.ts","sourceRoot":"","sources":["../../../../src/reflectMetadata/utils/buildArrayMetadataWithArray.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('repeat', require('../repeat'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1,36 @@
import baseGetTag from './_baseGetTag.js';
import isObjectLike from './isObjectLike.js';
import isPlainObject from './isPlainObject.js';
/** `Object#toString` result references. */
var domExcTag = '[object DOMException]',
errorTag = '[object Error]';
/**
* Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
* `SyntaxError`, `TypeError`, or `URIError` object.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an error object, else `false`.
* @example
*
* _.isError(new Error);
* // => true
*
* _.isError(Error);
* // => false
*/
function isError(value) {
if (!isObjectLike(value)) {
return false;
}
var tag = baseGetTag(value);
return tag == errorTag || tag == domExcTag ||
(typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
}
export default isError;
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAiGA,sBA0CC;AA4GD,8BA6GC;AApWD;;;;;;;;;;;;;GAaG;AACH,MAAM,gBAAgB,GAAG,uCAAuC,CAAC;AAEjE;;;;;;;;;;;GAWG;AACH,MAAM,iBAAiB,GAAG,iCAAiC,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,iBAAiB,GACrB,qFAAqF,CAAC;AAExF;;;;;;GAMG;AACH,MAAM,eAAe,GAAG,iCAAiC,CAAC;AAE1D,MAAM,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC;AAE7C,MAAM,UAAU,GAAG,eAAe,CAAC,CAAC,GAAG,EAAE;IACvC,MAAM,CAAC,GAAG,cAAa,CAAC,CAAC;IACzB,CAAC,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAClC,OAAO,CAAC,CAAC;AACX,CAAC,CAAC,EAAgC,CAAC;AAoBnC;;;;;GAKG;AACH,SAAgB,KAAK,CACnB,GAAW,EACX,OAAsB;IAEtB,MAAM,GAAG,GAAuC,IAAI,UAAU,EAAE,CAAC;IACjE,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC;IACvB,iGAAiG;IACjG,IAAI,GAAG,GAAG,CAAC;QAAE,OAAO,GAAG,CAAC;IAExB,MAAM,GAAG,GAAG,OAAO,EAAE,MAAM,IAAI,MAAM,CAAC;IACtC,IAAI,KAAK,GAAG,CAAC,CAAC;IAEd,GAAG,CAAC;QACF,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACtC,IAAI,KAAK,KAAK,CAAC,CAAC;YAAE,MAAM,CAAC,wBAAwB;QAEjD,MAAM,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACzC,MAAM,MAAM,GAAG,QAAQ,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC;QAEhD,IAAI,KAAK,GAAG,MAAM,EAAE,CAAC;YACnB,+BAA+B;YAC/B,KAAK,GAAG,GAAG,CAAC,WAAW,CAAC,GAAG,EAAE,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;YAC5C,SAAS;QACX,CAAC;QAED,MAAM,WAAW,GAAG,UAAU,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QAClD,MAAM,SAAS,GAAG,QAAQ,CAAC,GAAG,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC;QACpD,MAAM,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;QAE9C,mBAAmB;QACnB,IAAI,GAAG,CAAC,GAAG,CAAC,KAAK,SAAS,EAAE,CAAC;YAC3B,IAAI,WAAW,GAAG,UAAU,CAAC,GAAG,EAAE,KAAK,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC;YACrD,IAAI,SAAS,GAAG,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;YAEnD,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC;YACrD,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACnB,CAAC;QAED,KAAK,GAAG,MAAM,GAAG,CAAC,CAAC;IACrB,CAAC,QAAQ,KAAK,GAAG,GAAG,EAAE;IAEtB,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,UAAU,CAAC,GAAW,EAAE,KAAa,EAAE,GAAW;IACzD,GAAG,CAAC;QACF,MAAM,IAAI,GAAG,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACnC,IAAI,IAAI,KAAK,IAAI,CAAC,OAAO,IAAI,IAAI,KAAK,IAAI,CAAC,QAAQ;YAAE,OAAO,KAAK,CAAC;IACpE,CAAC,QAAQ,EAAE,KAAK,GAAG,GAAG,EAAE;IACxB,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,QAAQ,CAAC,GAAW,EAAE,KAAa,EAAE,GAAW;IACvD,OAAO,KAAK,GAAG,GAAG,EAAE,CAAC;QACnB,MAAM,IAAI,GAAG,GAAG,CAAC,UAAU,CAAC,EAAE,KAAK,CAAC,CAAC;QACrC,IAAI,IAAI,KAAK,IAAI,CAAC,OAAO,IAAI,IAAI,KAAK,IAAI,CAAC,QAAQ;YAAE,OAAO,KAAK,GAAG,CAAC,CAAC;IACxE,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAmFD;;;;;;;;GAQG;AACH,SAAgB,SAAS,CACvB,IAAY,EACZ,GAAW,EACX,OAA0B;IAE1B,MAAM,GAAG,GAAG,OAAO,EAAE,MAAM,IAAI,kBAAkB,CAAC;IAElD,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACjC,MAAM,IAAI,SAAS,CAAC,6BAA6B,IAAI,EAAE,CAAC,CAAC;IAC3D,CAAC;IAED,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;IAEvB,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACnC,MAAM,IAAI,SAAS,CAAC,4BAA4B,GAAG,EAAE,CAAC,CAAC;IACzD,CAAC;IAED,IAAI,GAAG,GAAG,IAAI,GAAG,GAAG,GAAG,KAAK,CAAC;IAC7B,IAAI,CAAC,OAAO;QAAE,OAAO,GAAG,CAAC;IAEzB,IAAI,OAAO,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QACjC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;YACtC,MAAM,IAAI,SAAS,CAAC,6BAA6B,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;QACrE,CAAC;QAED,GAAG,IAAI,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC;IACvC,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QACnB,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;YAC5C,MAAM,IAAI,SAAS,CAAC,6BAA6B,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;QACrE,CAAC;QAED,GAAG,IAAI,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC;IACtC,CAAC;IAED,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QACjB,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YACxC,MAAM,IAAI,SAAS,CAAC,2BAA2B,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;QACjE,CAAC;QAED,GAAG,IAAI,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAClC,CAAC;IAED,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;QACpB,IACE,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;YACxB,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,EAC3C,CAAC;YACD,MAAM,IAAI,SAAS,CAAC,8BAA8B,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;QACvE,CAAC;QAED,GAAG,IAAI,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;IACtD,CAAC;IAED,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;QACrB,GAAG,IAAI,YAAY,CAAC;IACtB,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QACnB,GAAG,IAAI,UAAU,CAAC;IACpB,CAAC;IAED,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;QACxB,GAAG,IAAI,eAAe,CAAC;IACzB,CAAC;IAED,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;QACrB,MAAM,QAAQ,GACZ,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ;YAClC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE;YAChC,CAAC,CAAC,SAAS,CAAC;QAChB,QAAQ,QAAQ,EAAE,CAAC;YACjB,KAAK,KAAK;gBACR,GAAG,IAAI,gBAAgB,CAAC;gBACxB,MAAM;YACR,KAAK,QAAQ;gBACX,GAAG,IAAI,mBAAmB,CAAC;gBAC3B,MAAM;YACR,KAAK,MAAM;gBACT,GAAG,IAAI,iBAAiB,CAAC;gBACzB,MAAM;YACR;gBACE,MAAM,IAAI,SAAS,CAAC,+BAA+B,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC3E,CAAC;IACH,CAAC;IAED,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;QACrB,MAAM,QAAQ,GACZ,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ;YAClC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE;YAChC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;QACvB,QAAQ,QAAQ,EAAE,CAAC;YACjB,KAAK,IAAI,CAAC;YACV,KAAK,QAAQ;gBACX,GAAG,IAAI,mBAAmB,CAAC;gBAC3B,MAAM;YACR,KAAK,KAAK;gBACR,GAAG,IAAI,gBAAgB,CAAC;gBACxB,MAAM;YACR,KAAK,Line truncated
@@ -0,0 +1 @@
!function(e,s){"object"==typeof exports&&"undefined"!=typeof module?module.exports=s(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],s):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_es_us=s(e.dayjs)}(this,(function(e){"use strict";function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=s(e),d={name:"es-us",weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(e){return e+"º"},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"MM/DD/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"}};return o.default.locale(d,null,!0),d}));
@@ -0,0 +1,44 @@
export { AvatarGroupSlots, AvatarGroupVariantProps, AvatarSlots, AvatarVariantProps, avatar, avatarGroup } from './avatar.js';
export { CardReturnType, CardSlots, CardVariantProps, card } from './card.js';
export { LinkVariantProps, link, linkAnchorClasses } from './link.js';
export { UserSlots, user } from './user.js';
export { ButtonGroupVariantProps, ButtonVariantProps, button, buttonGroup } from './button.js';
export { drip } from './drip.js';
export { SpinnerSlots, SpinnerVariantProps, spinner } from './spinner.js';
export { CodeVariantProps, code } from './code.js';
export { PopoverSlots, PopoverVariantProps, popover } from './popover.js';
export { SnippetSlots, SnippetVariantProps, snippet } from './snippet.js';
export { ChipSlots, ChipVariantProps, chip } from './chip.js';
export { BadgeSlots, BadgeVariantProps, badge } from './badge.js';
export { CheckboxGroupSlots, CheckboxSlots, CheckboxVariantProps, checkbox, checkboxGroup } from './checkbox.js';
export { RadioGroupSlots, RadioSlots, RadioVariantProps, radio, radioGroup } from './radio.js';
export { PaginationSlots, PaginationVariantProps, pagination } from './pagination.js';
export { ToggleSlots, ToggleVariantProps, toggle } from './toggle.js';
export { AccordionGroupVariantProps, AccordionItemSlots, AccordionItemVariantProps, accordion, accordionItem } from './accordion.js';
export { CircularProgressSlots, CircularProgressVariantProps, ProgressSlots, ProgressVariantProps, circularProgress, progress } from './progress.js';
export { InputOtpReturnType, InputOtpSlots, InputOtpVariantProps, inputOtp } from './input-otp.js';
export { InputSlots, InputVariantProps, input } from './input.js';
export { DropdownItemSlots, DropdownItemVariantProps, DropdownSectionSlots, DropdownSectionVariantProps, dropdown, dropdownItem, dropdownMenu, dropdownSection } from './dropdown.js';
export { ImageSlots, ImageVariantProps, image } from './image.js';
export { ModalSlots, ModalVariantProps, modal } from './modal.js';
export { NavbarSlots, NavbarVariantProps, navbar } from './navbar.js';
export { TableReturnType, TableSlots, TableVariantProps, table } from './table.js';
export { SpacerVariantProps, spacer } from './spacer.js';
export { DividerVariantProps, divider } from './divider.js';
export { KbdSlots, KbdVariantProps, kbd } from './kbd.js';
export { TabsReturnType, TabsSlots, TabsVariantProps, tabs } from './tabs.js';
export { SkeletonSlots, SkeletonVariantProps, skeleton } from './skeleton.js';
export { SelectSlots, SelectVariantProps, select } from './select.js';
export { MenuItemSlots as ListboxItemSlots, MenuItemVariantProps as ListboxItemVariantProps, MenuSectionSlots as ListboxSectionSlots, MenuSectionVariantProps as ListboxSectionVariantProps, MenuSlots as ListboxSlots, MenuVariantProps as ListboxVariantProps, MenuItemSlots, MenuItemVariantProps, MenuSectionSlots, MenuSectionVariantProps, MenuSlots, MenuVariantProps, menu as listbox, menuItem as listboxItem, menuSection as listboxSection, menu, menuItem, menuSection } from './menu.js';
export { ScrollShadowVariantProps, scrollShadow } from './scroll-shadow.js';
export { SliderSlots, SliderVariantProps, slider } from './slider.js';
export { BreadcrumbItemSlots, BreadcrumbItemVariantProps, BreadcrumbsSlots, BreadcrumbsVariantProps, breadcrumbItem, breadcrumbs } from './breadcrumbs.js';
export { AutocompleteSlots, AutocompleteVariantProps, autocomplete } from './autocomplete.js';
export { CalendarReturnType, CalendarSlots, CalendarVariantProps, calendar } from './calendar.js';
export { DateInputReturnType, DateInputSlots, DateInputVariantProps, dateInput } from './date-input.js';
export { DatePickerReturnType, DatePickerSlots, DatePickerVariantProps, DateRangePickerReturnType, DateRangePickerSlots, DateRangePickerVariantProps, datePicker, dateRangePicker } from './date-picker.js';
export { AlertSlots, AlertVariantProps, alert } from './alert.js';
export { DrawerVariants, drawer } from './drawer.js';
export { FormVariantProps, form } from './form.js';
import 'tailwind-variants';
import 'tailwind-variants/dist/config';
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more