diff --git a/.components.d.ts b/.components.d.ts index fba3cc0..70826e3 100644 --- a/.components.d.ts +++ b/.components.d.ts @@ -13,6 +13,7 @@ declare module 'vue' { AnalysisLineChart: typeof import('./src/components/analysis/AnalysisLineChart.vue')['default'] AnalysisStatCard: typeof import('./src/components/analysis/AnalysisStatCard.vue')['default'] AppHeader: typeof import('./src/components/layout/AppHeader.vue')['default'] + ContentCard: typeof import('./src/components/cards/ContentCard.vue')['default'] ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider'] ElDialog: typeof import('element-plus/es')['ElDialog'] ElDrawer: typeof import('element-plus/es')['ElDrawer'] diff --git a/.pnpm-store/v11/files/01/413f896728cc54dc0981cdaac7c120966226b10d0479528499cbcaef2f97dd68e01bcf8db9296540a21b9540955994d2c9b5e2406a87071a59a7c84de9185f b/.pnpm-store/v11/files/01/413f896728cc54dc0981cdaac7c120966226b10d0479528499cbcaef2f97dd68e01bcf8db9296540a21b9540955994d2c9b5e2406a87071a59a7c84de9185f new file mode 100644 index 0000000..60e4d65 --- /dev/null +++ b/.pnpm-store/v11/files/01/413f896728cc54dc0981cdaac7c120966226b10d0479528499cbcaef2f97dd68e01bcf8db9296540a21b9540955994d2c9b5e2406a87071a59a7c84de9185f @@ -0,0 +1,74 @@ +/* +Copyright Node.js contributors. All rights reserved. + +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. +*/ + +// Node does not include the headers for these functions when compiling for WASM, so add them here. +#ifdef __wasm32__ +extern "C" { +NAPI_EXTERN napi_status NAPI_CDECL +napi_create_threadsafe_function(napi_env env, + napi_value func, + napi_value async_resource, + napi_value async_resource_name, + size_t max_queue_size, + size_t initial_thread_count, + void* thread_finalize_data, + napi_finalize thread_finalize_cb, + void* context, + napi_threadsafe_function_call_js call_js_cb, + napi_threadsafe_function* result); + +NAPI_EXTERN napi_status NAPI_CDECL napi_get_threadsafe_function_context( + napi_threadsafe_function func, void** result); + +NAPI_EXTERN napi_status NAPI_CDECL +napi_call_threadsafe_function(napi_threadsafe_function func, + void* data, + napi_threadsafe_function_call_mode is_blocking); + +NAPI_EXTERN napi_status NAPI_CDECL +napi_acquire_threadsafe_function(napi_threadsafe_function func); + +NAPI_EXTERN napi_status NAPI_CDECL napi_release_threadsafe_function( + napi_threadsafe_function func, napi_threadsafe_function_release_mode mode); + +NAPI_EXTERN napi_status NAPI_CDECL +napi_unref_threadsafe_function(napi_env env, napi_threadsafe_function func); + +NAPI_EXTERN napi_status NAPI_CDECL +napi_ref_threadsafe_function(napi_env env, napi_threadsafe_function func); + +NAPI_EXTERN napi_status NAPI_CDECL +napi_create_async_work(napi_env env, + napi_value async_resource, + napi_value async_resource_name, + napi_async_execute_callback execute, + napi_async_complete_callback complete, + void* data, + napi_async_work* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_delete_async_work(napi_env env, + napi_async_work work); +NAPI_EXTERN napi_status NAPI_CDECL napi_queue_async_work(napi_env env, + napi_async_work work); +NAPI_EXTERN napi_status NAPI_CDECL napi_cancel_async_work(napi_env env, + napi_async_work work); +} +#endif diff --git a/.pnpm-store/v11/files/0b/705d60dabef7384c98efbdb276492f6c80401180290db6bac2852b6c89d937169ad684babb3c28e52de7eccfbc3a31b2fa73e8b739c7230cfb17aca63df671 b/.pnpm-store/v11/files/0b/705d60dabef7384c98efbdb276492f6c80401180290db6bac2852b6c89d937169ad684babb3c28e52de7eccfbc3a31b2fa73e8b739c7230cfb17aca63df671 new file mode 100644 index 0000000..57ded66 --- /dev/null +++ b/.pnpm-store/v11/files/0b/705d60dabef7384c98efbdb276492f6c80401180290db6bac2852b6c89d937169ad684babb3c28e52de7eccfbc3a31b2fa73e8b739c7230cfb17aca63df671 @@ -0,0 +1,20 @@ +#ifndef FS_EVENTS_H +#define FS_EVENTS_H + +#include +#include "../Backend.hh" + +class FSEventsBackend : public Backend { +public: + void start() override; + ~FSEventsBackend(); + void writeSnapshot(WatcherRef watcher, std::string *snapshotPath) override; + void getEventsSince(WatcherRef watcher, std::string *snapshotPath) override; + void subscribe(WatcherRef watcher) override; + void unsubscribe(WatcherRef watcher) override; +private: + void startStream(WatcherRef watcher, FSEventStreamEventId id); + CFRunLoopRef mRunLoop; +}; + +#endif diff --git a/.pnpm-store/v11/files/0b/bbdbe225da8695549c72667058ab8e204c24e73f67911e0a53a7550669358b78d9979f4f3e2dfd7f481f1a7aca5ea2f6f373dff1a1c8bb84cc7ed372976f62 b/.pnpm-store/v11/files/0b/bbdbe225da8695549c72667058ab8e204c24e73f67911e0a53a7550669358b78d9979f4f3e2dfd7f481f1a7aca5ea2f6f373dff1a1c8bb84cc7ed372976f62 new file mode 100644 index 0000000..b7eddd8 --- /dev/null +++ b/.pnpm-store/v11/files/0b/bbdbe225da8695549c72667058ab8e204c24e73f67911e0a53a7550669358b78d9979f4f3e2dfd7f481f1a7aca5ea2f6f373dff1a1c8bb84cc7ed372976f62 @@ -0,0 +1,164 @@ +#include "DirTree.hh" +#include + +// "Meyer's singleton", construction is ordered by use, likewise (reverse) for destruction. +// https://stackoverflow.com/a/17713799 +// https://laristra.github.io/flecsi/src/developer-guide/patterns/meyers_singleton.html +static std::mutex& mDirCacheMutex() { + static std::mutex mutex; + return mutex; +} + +static std::unordered_map>& dirTreeCache() { + static std::unordered_map> cache; + return cache; +} + +struct DirTreeDeleter { + void operator()(DirTree *tree) { + std::lock_guard lock(mDirCacheMutex()); + std::unordered_map> &cache = dirTreeCache(); + cache.erase(tree->root); + delete tree; + + // Free up memory. + if (cache.size() == 0) { + cache.rehash(0); + } + } +}; + +std::shared_ptr DirTree::getCached(std::string root) { + std::lock_guard lock(mDirCacheMutex()); + std::unordered_map> &cache = dirTreeCache(); + + auto found = cache.find(root); + std::shared_ptr tree; + + // Use cached tree, or create an empty one. + if (found != cache.end()) { + tree = found->second.lock(); + } else { + tree = std::shared_ptr(new DirTree(root), DirTreeDeleter()); + cache.emplace(root, tree); + } + + return tree; +} + +DirTree::DirTree(std::string root, FILE *f) : root(root), isComplete(true) { + size_t size; + if (fscanf(f, "%zu", &size)) { + for (size_t i = 0; i < size; i++) { + DirEntry entry(f); + entries.emplace(entry.path, entry); + } + } +} + +// Internal find method that has no lock +DirEntry *DirTree::_find(std::string path) { + auto found = entries.find(path); + if (found == entries.end()) { + return NULL; + } + + return &found->second; +} + +DirEntry *DirTree::add(std::string path, uint64_t mtime, bool isDir) { + std::lock_guard lock(mDirCacheMutex()); + + DirEntry entry(path, mtime, isDir); + auto it = entries.emplace(entry.path, entry); + return &it.first->second; +} + +DirEntry *DirTree::find(std::string path) { + std::lock_guard lock(mDirCacheMutex()); + return _find(path); +} + +DirEntry *DirTree::update(std::string path, uint64_t mtime) { + std::lock_guard lock(mDirCacheMutex()); + + DirEntry *found = _find(path); + if (found) { + found->mtime = mtime; + } + + return found; +} + +void DirTree::remove(std::string path) { + std::lock_guard lock(mDirCacheMutex()); + + DirEntry *found = _find(path); + + // Remove all sub-entries if this is a directory + if (found && found->isDir) { + std::string pathStart = path + DIR_SEP; + for (auto it = entries.begin(); it != entries.end();) { + if (it->first.rfind(pathStart, 0) == 0) { + it = entries.erase(it); + } else { + it++; + } + } + } + + entries.erase(path); +} + +void DirTree::write(FILE *f) { + std::lock_guard lock(mDirCacheMutex()); + + fprintf(f, "%zu\n", entries.size()); + for (auto it = entries.begin(); it != entries.end(); it++) { + it->second.write(f); + } +} + +void DirTree::getChanges(DirTree *snapshot, EventList &events) { + std::lock_guard lock(mDirCacheMutex()); + std::lock_guard snapshotLock(snapshot->mMutex); + + for (auto it = entries.begin(); it != entries.end(); it++) { + auto found = snapshot->entries.find(it->first); + if (found == snapshot->entries.end()) { + events.create(it->second.path); + } else if (found->second.mtime != it->second.mtime && !found->second.isDir && !it->second.isDir) { + events.update(it->second.path); + } + } + + for (auto it = snapshot->entries.begin(); it != snapshot->entries.end(); it++) { + size_t count = entries.count(it->first); + if (count == 0) { + events.remove(it->second.path); + } + } +} + +DirEntry::DirEntry(std::string p, uint64_t t, bool d) { + path = p; + mtime = t; + isDir = d; + state = NULL; +} + +DirEntry::DirEntry(FILE *f) { + size_t size; + if (fscanf(f, "%zu", &size)) { + path.resize(size); + if (fread(&path[0], sizeof(char), size, f)) { + int d = 0; + fscanf(f, "%" PRIu64 " %d\n", &mtime, &d); + isDir = d == 1; + } + } +} + +void DirEntry::write(FILE *f) const { + fprintf(f, "%zu%s%" PRIu64 " %d\n", path.size(), path.c_str(), mtime, isDir); +} diff --git a/.pnpm-store/v11/files/0d/6bcf34ab0514e1da3e66faca9d5232ad502a28de5cdf43e503991d89554afb6b11da4405933b3e32deca6af6b176a0101eb430a778a8165ec0addfce274053 b/.pnpm-store/v11/files/0d/6bcf34ab0514e1da3e66faca9d5232ad502a28de5cdf43e503991d89554afb6b11da4405933b3e32deca6af6b176a0101eb430a778a8165ec0addfce274053 new file mode 100644 index 0000000..d5c6ac9 --- /dev/null +++ b/.pnpm-store/v11/files/0d/6bcf34ab0514e1da3e66faca9d5232ad502a28de5cdf43e503991d89554afb6b11da4405933b3e32deca6af6b176a0101eb430a778a8165ec0addfce274053 @@ -0,0 +1,705 @@ +export type Platform = 'browser' | 'node' | 'neutral' +export type Format = 'iife' | 'cjs' | 'esm' +export type Loader = 'base64' | 'binary' | 'copy' | 'css' | 'dataurl' | 'default' | 'empty' | 'file' | 'js' | 'json' | 'jsx' | 'local-css' | 'text' | 'ts' | 'tsx' +export type LogLevel = 'verbose' | 'debug' | 'info' | 'warning' | 'error' | 'silent' +export type Charset = 'ascii' | 'utf8' +export type Drop = 'console' | 'debugger' + +interface CommonOptions { + /** Documentation: https://esbuild.github.io/api/#sourcemap */ + sourcemap?: boolean | 'linked' | 'inline' | 'external' | 'both' + /** Documentation: https://esbuild.github.io/api/#legal-comments */ + legalComments?: 'none' | 'inline' | 'eof' | 'linked' | 'external' + /** Documentation: https://esbuild.github.io/api/#source-root */ + sourceRoot?: string + /** Documentation: https://esbuild.github.io/api/#sources-content */ + sourcesContent?: boolean + + /** Documentation: https://esbuild.github.io/api/#format */ + format?: Format + /** Documentation: https://esbuild.github.io/api/#global-name */ + globalName?: string + /** Documentation: https://esbuild.github.io/api/#target */ + target?: string | string[] + /** Documentation: https://esbuild.github.io/api/#supported */ + supported?: Record + /** Documentation: https://esbuild.github.io/api/#platform */ + platform?: Platform + + /** Documentation: https://esbuild.github.io/api/#mangle-props */ + mangleProps?: RegExp + /** Documentation: https://esbuild.github.io/api/#mangle-props */ + reserveProps?: RegExp + /** Documentation: https://esbuild.github.io/api/#mangle-props */ + mangleQuoted?: boolean + /** Documentation: https://esbuild.github.io/api/#mangle-props */ + mangleCache?: Record + /** Documentation: https://esbuild.github.io/api/#drop */ + drop?: Drop[] + /** Documentation: https://esbuild.github.io/api/#drop-labels */ + dropLabels?: string[] + /** Documentation: https://esbuild.github.io/api/#minify */ + minify?: boolean + /** Documentation: https://esbuild.github.io/api/#minify */ + minifyWhitespace?: boolean + /** Documentation: https://esbuild.github.io/api/#minify */ + minifyIdentifiers?: boolean + /** Documentation: https://esbuild.github.io/api/#minify */ + minifySyntax?: boolean + /** Documentation: https://esbuild.github.io/api/#line-limit */ + lineLimit?: number + /** Documentation: https://esbuild.github.io/api/#charset */ + charset?: Charset + /** Documentation: https://esbuild.github.io/api/#tree-shaking */ + treeShaking?: boolean + /** Documentation: https://esbuild.github.io/api/#ignore-annotations */ + ignoreAnnotations?: boolean + + /** Documentation: https://esbuild.github.io/api/#jsx */ + jsx?: 'transform' | 'preserve' | 'automatic' + /** Documentation: https://esbuild.github.io/api/#jsx-factory */ + jsxFactory?: string + /** Documentation: https://esbuild.github.io/api/#jsx-fragment */ + jsxFragment?: string + /** Documentation: https://esbuild.github.io/api/#jsx-import-source */ + jsxImportSource?: string + /** Documentation: https://esbuild.github.io/api/#jsx-development */ + jsxDev?: boolean + /** Documentation: https://esbuild.github.io/api/#jsx-side-effects */ + jsxSideEffects?: boolean + + /** Documentation: https://esbuild.github.io/api/#define */ + define?: { [key: string]: string } + /** Documentation: https://esbuild.github.io/api/#pure */ + pure?: string[] + /** Documentation: https://esbuild.github.io/api/#keep-names */ + keepNames?: boolean + + /** Documentation: https://esbuild.github.io/api/#color */ + color?: boolean + /** Documentation: https://esbuild.github.io/api/#log-level */ + logLevel?: LogLevel + /** Documentation: https://esbuild.github.io/api/#log-limit */ + logLimit?: number + /** Documentation: https://esbuild.github.io/api/#log-override */ + logOverride?: Record + + /** Documentation: https://esbuild.github.io/api/#tsconfig-raw */ + tsconfigRaw?: string | TsconfigRaw +} + +export interface TsconfigRaw { + compilerOptions?: { + alwaysStrict?: boolean + baseUrl?: string + experimentalDecorators?: boolean + importsNotUsedAsValues?: 'remove' | 'preserve' | 'error' + jsx?: 'preserve' | 'react-native' | 'react' | 'react-jsx' | 'react-jsxdev' + jsxFactory?: string + jsxFragmentFactory?: string + jsxImportSource?: string + paths?: Record + preserveValueImports?: boolean + strict?: boolean + target?: string + useDefineForClassFields?: boolean + verbatimModuleSyntax?: boolean + } +} + +export interface BuildOptions extends CommonOptions { + /** Documentation: https://esbuild.github.io/api/#bundle */ + bundle?: boolean + /** Documentation: https://esbuild.github.io/api/#splitting */ + splitting?: boolean + /** Documentation: https://esbuild.github.io/api/#preserve-symlinks */ + preserveSymlinks?: boolean + /** Documentation: https://esbuild.github.io/api/#outfile */ + outfile?: string + /** Documentation: https://esbuild.github.io/api/#metafile */ + metafile?: boolean + /** Documentation: https://esbuild.github.io/api/#outdir */ + outdir?: string + /** Documentation: https://esbuild.github.io/api/#outbase */ + outbase?: string + /** Documentation: https://esbuild.github.io/api/#external */ + external?: string[] + /** Documentation: https://esbuild.github.io/api/#packages */ + packages?: 'external' + /** Documentation: https://esbuild.github.io/api/#alias */ + alias?: Record + /** Documentation: https://esbuild.github.io/api/#loader */ + loader?: { [ext: string]: Loader } + /** Documentation: https://esbuild.github.io/api/#resolve-extensions */ + resolveExtensions?: string[] + /** Documentation: https://esbuild.github.io/api/#main-fields */ + mainFields?: string[] + /** Documentation: https://esbuild.github.io/api/#conditions */ + conditions?: string[] + /** Documentation: https://esbuild.github.io/api/#write */ + write?: boolean + /** Documentation: https://esbuild.github.io/api/#allow-overwrite */ + allowOverwrite?: boolean + /** Documentation: https://esbuild.github.io/api/#tsconfig */ + tsconfig?: string + /** Documentation: https://esbuild.github.io/api/#out-extension */ + outExtension?: { [ext: string]: string } + /** Documentation: https://esbuild.github.io/api/#public-path */ + publicPath?: string + /** Documentation: https://esbuild.github.io/api/#entry-names */ + entryNames?: string + /** Documentation: https://esbuild.github.io/api/#chunk-names */ + chunkNames?: string + /** Documentation: https://esbuild.github.io/api/#asset-names */ + assetNames?: string + /** Documentation: https://esbuild.github.io/api/#inject */ + inject?: string[] + /** Documentation: https://esbuild.github.io/api/#banner */ + banner?: { [type: string]: string } + /** Documentation: https://esbuild.github.io/api/#footer */ + footer?: { [type: string]: string } + /** Documentation: https://esbuild.github.io/api/#entry-points */ + entryPoints?: string[] | Record | { in: string, out: string }[] + /** Documentation: https://esbuild.github.io/api/#stdin */ + stdin?: StdinOptions + /** Documentation: https://esbuild.github.io/plugins/ */ + plugins?: Plugin[] + /** Documentation: https://esbuild.github.io/api/#working-directory */ + absWorkingDir?: string + /** Documentation: https://esbuild.github.io/api/#node-paths */ + nodePaths?: string[]; // The "NODE_PATH" variable from Node.js +} + +export interface StdinOptions { + contents: string | Uint8Array + resolveDir?: string + sourcefile?: string + loader?: Loader +} + +export interface Message { + id: string + pluginName: string + text: string + location: Location | null + notes: Note[] + + /** + * Optional user-specified data that is passed through unmodified. You can + * use this to stash the original error, for example. + */ + detail: any +} + +export interface Note { + text: string + location: Location | null +} + +export interface Location { + file: string + namespace: string + /** 1-based */ + line: number + /** 0-based, in bytes */ + column: number + /** in bytes */ + length: number + lineText: string + suggestion: string +} + +export interface OutputFile { + path: string + contents: Uint8Array + hash: string + /** "contents" as text (changes automatically with "contents") */ + readonly text: string +} + +export interface BuildResult { + errors: Message[] + warnings: Message[] + /** Only when "write: false" */ + outputFiles: OutputFile[] | (ProvidedOptions['write'] extends false ? never : undefined) + /** Only when "metafile: true" */ + metafile: Metafile | (ProvidedOptions['metafile'] extends true ? never : undefined) + /** Only when "mangleCache" is present */ + mangleCache: Record | (ProvidedOptions['mangleCache'] extends Object ? never : undefined) +} + +export interface BuildFailure extends Error { + errors: Message[] + warnings: Message[] +} + +/** Documentation: https://esbuild.github.io/api/#serve-arguments */ +export interface ServeOptions { + port?: number + host?: string + servedir?: string + keyfile?: string + certfile?: string + fallback?: string + onRequest?: (args: ServeOnRequestArgs) => void +} + +export interface ServeOnRequestArgs { + remoteAddress: string + method: string + path: string + status: number + /** The time to generate the response, not to send it */ + timeInMS: number +} + +/** Documentation: https://esbuild.github.io/api/#serve-return-values */ +export interface ServeResult { + port: number + host: string +} + +export interface TransformOptions extends CommonOptions { + /** Documentation: https://esbuild.github.io/api/#sourcefile */ + sourcefile?: string + /** Documentation: https://esbuild.github.io/api/#loader */ + loader?: Loader + /** Documentation: https://esbuild.github.io/api/#banner */ + banner?: string + /** Documentation: https://esbuild.github.io/api/#footer */ + footer?: string +} + +export interface TransformResult { + code: string + map: string + warnings: Message[] + /** Only when "mangleCache" is present */ + mangleCache: Record | (ProvidedOptions['mangleCache'] extends Object ? never : undefined) + /** Only when "legalComments" is "external" */ + legalComments: string | (ProvidedOptions['legalComments'] extends 'external' ? never : undefined) +} + +export interface TransformFailure extends Error { + errors: Message[] + warnings: Message[] +} + +export interface Plugin { + name: string + setup: (build: PluginBuild) => (void | Promise) +} + +export interface PluginBuild { + /** Documentation: https://esbuild.github.io/plugins/#build-options */ + initialOptions: BuildOptions + + /** Documentation: https://esbuild.github.io/plugins/#resolve */ + resolve(path: string, options?: ResolveOptions): Promise + + /** Documentation: https://esbuild.github.io/plugins/#on-start */ + onStart(callback: () => + (OnStartResult | null | void | Promise)): void + + /** Documentation: https://esbuild.github.io/plugins/#on-end */ + onEnd(callback: (result: BuildResult) => + (OnEndResult | null | void | Promise)): void + + /** Documentation: https://esbuild.github.io/plugins/#on-resolve */ + onResolve(options: OnResolveOptions, callback: (args: OnResolveArgs) => + (OnResolveResult | null | undefined | Promise)): void + + /** Documentation: https://esbuild.github.io/plugins/#on-load */ + onLoad(options: OnLoadOptions, callback: (args: OnLoadArgs) => + (OnLoadResult | null | undefined | Promise)): void + + /** Documentation: https://esbuild.github.io/plugins/#on-dispose */ + onDispose(callback: () => void): void + + // This is a full copy of the esbuild library in case you need it + esbuild: { + context: typeof context, + build: typeof build, + buildSync: typeof buildSync, + transform: typeof transform, + transformSync: typeof transformSync, + formatMessages: typeof formatMessages, + formatMessagesSync: typeof formatMessagesSync, + analyzeMetafile: typeof analyzeMetafile, + analyzeMetafileSync: typeof analyzeMetafileSync, + initialize: typeof initialize, + version: typeof version, + } +} + +/** Documentation: https://esbuild.github.io/plugins/#resolve-options */ +export interface ResolveOptions { + pluginName?: string + importer?: string + namespace?: string + resolveDir?: string + kind?: ImportKind + pluginData?: any + with?: Record +} + +/** Documentation: https://esbuild.github.io/plugins/#resolve-results */ +export interface ResolveResult { + errors: Message[] + warnings: Message[] + + path: string + external: boolean + sideEffects: boolean + namespace: string + suffix: string + pluginData: any +} + +export interface OnStartResult { + errors?: PartialMessage[] + warnings?: PartialMessage[] +} + +export interface OnEndResult { + errors?: PartialMessage[] + warnings?: PartialMessage[] +} + +/** Documentation: https://esbuild.github.io/plugins/#on-resolve-options */ +export interface OnResolveOptions { + filter: RegExp + namespace?: string +} + +/** Documentation: https://esbuild.github.io/plugins/#on-resolve-arguments */ +export interface OnResolveArgs { + path: string + importer: string + namespace: string + resolveDir: string + kind: ImportKind + pluginData: any + with: Record +} + +export type ImportKind = + | 'entry-point' + + // JS + | 'import-statement' + | 'require-call' + | 'dynamic-import' + | 'require-resolve' + + // CSS + | 'import-rule' + | 'composes-from' + | 'url-token' + +/** Documentation: https://esbuild.github.io/plugins/#on-resolve-results */ +export interface OnResolveResult { + pluginName?: string + + errors?: PartialMessage[] + warnings?: PartialMessage[] + + path?: string + external?: boolean + sideEffects?: boolean + namespace?: string + suffix?: string + pluginData?: any + + watchFiles?: string[] + watchDirs?: string[] +} + +/** Documentation: https://esbuild.github.io/plugins/#on-load-options */ +export interface OnLoadOptions { + filter: RegExp + namespace?: string +} + +/** Documentation: https://esbuild.github.io/plugins/#on-load-arguments */ +export interface OnLoadArgs { + path: string + namespace: string + suffix: string + pluginData: any + with: Record +} + +/** Documentation: https://esbuild.github.io/plugins/#on-load-results */ +export interface OnLoadResult { + pluginName?: string + + errors?: PartialMessage[] + warnings?: PartialMessage[] + + contents?: string | Uint8Array + resolveDir?: string + loader?: Loader + pluginData?: any + + watchFiles?: string[] + watchDirs?: string[] +} + +export interface PartialMessage { + id?: string + pluginName?: string + text?: string + location?: Partial | null + notes?: PartialNote[] + detail?: any +} + +export interface PartialNote { + text?: string + location?: Partial | null +} + +/** Documentation: https://esbuild.github.io/api/#metafile */ +export interface Metafile { + inputs: { + [path: string]: { + bytes: number + imports: { + path: string + kind: ImportKind + external?: boolean + original?: string + with?: Record + }[] + format?: 'cjs' | 'esm' + with?: Record + } + } + outputs: { + [path: string]: { + bytes: number + inputs: { + [path: string]: { + bytesInOutput: number + } + } + imports: { + path: string + kind: ImportKind | 'file-loader' + external?: boolean + }[] + exports: string[] + entryPoint?: string + cssBundle?: string + } + } +} + +export interface FormatMessagesOptions { + kind: 'error' | 'warning' + color?: boolean + terminalWidth?: number +} + +export interface AnalyzeMetafileOptions { + color?: boolean + verbose?: boolean +} + +export interface WatchOptions { +} + +export interface BuildContext { + /** Documentation: https://esbuild.github.io/api/#rebuild */ + rebuild(): Promise> + + /** Documentation: https://esbuild.github.io/api/#watch */ + watch(options?: WatchOptions): Promise + + /** Documentation: https://esbuild.github.io/api/#serve */ + serve(options?: ServeOptions): Promise + + cancel(): Promise + dispose(): Promise +} + +// This is a TypeScript type-level function which replaces any keys in "In" +// that aren't in "Out" with "never". We use this to reject properties with +// typos in object literals. See: https://stackoverflow.com/questions/49580725 +type SameShape = In & { [Key in Exclude]: never } + +/** + * This function invokes the "esbuild" command-line tool for you. It returns a + * promise that either resolves with a "BuildResult" object or rejects with a + * "BuildFailure" object. + * + * - Works in node: yes + * - Works in browser: yes + * + * Documentation: https://esbuild.github.io/api/#build + */ +export declare function build(options: SameShape): Promise> + +/** + * This is the advanced long-running form of "build" that supports additional + * features such as watch mode and a local development server. + * + * - Works in node: yes + * - Works in browser: no + * + * Documentation: https://esbuild.github.io/api/#build + */ +export declare function context(options: SameShape): Promise> + +/** + * This function transforms a single JavaScript file. It can be used to minify + * JavaScript, convert TypeScript/JSX to JavaScript, or convert newer JavaScript + * to older JavaScript. It returns a promise that is either resolved with a + * "TransformResult" object or rejected with a "TransformFailure" object. + * + * - Works in node: yes + * - Works in browser: yes + * + * Documentation: https://esbuild.github.io/api/#transform + */ +export declare function transform(input: string | Uint8Array, options?: SameShape): Promise> + +/** + * Converts log messages to formatted message strings suitable for printing in + * the terminal. This allows you to reuse the built-in behavior of esbuild's + * log message formatter. This is a batch-oriented API for efficiency. + * + * - Works in node: yes + * - Works in browser: yes + */ +export declare function formatMessages(messages: PartialMessage[], options: FormatMessagesOptions): Promise + +/** + * Pretty-prints an analysis of the metafile JSON to a string. This is just for + * convenience to be able to match esbuild's pretty-printing exactly. If you want + * to customize it, you can just inspect the data in the metafile yourself. + * + * - Works in node: yes + * - Works in browser: yes + * + * Documentation: https://esbuild.github.io/api/#analyze + */ +export declare function analyzeMetafile(metafile: Metafile | string, options?: AnalyzeMetafileOptions): Promise + +/** + * A synchronous version of "build". + * + * - Works in node: yes + * - Works in browser: no + * + * Documentation: https://esbuild.github.io/api/#build + */ +export declare function buildSync(options: SameShape): BuildResult + +/** + * A synchronous version of "transform". + * + * - Works in node: yes + * - Works in browser: no + * + * Documentation: https://esbuild.github.io/api/#transform + */ +export declare function transformSync(input: string | Uint8Array, options?: SameShape): TransformResult + +/** + * A synchronous version of "formatMessages". + * + * - Works in node: yes + * - Works in browser: no + */ +export declare function formatMessagesSync(messages: PartialMessage[], options: FormatMessagesOptions): string[] + +/** + * A synchronous version of "analyzeMetafile". + * + * - Works in node: yes + * - Works in browser: no + * + * Documentation: https://esbuild.github.io/api/#analyze + */ +export declare function analyzeMetafileSync(metafile: Metafile | string, options?: AnalyzeMetafileOptions): string + +/** + * This configures the browser-based version of esbuild. It is necessary to + * call this first and wait for the returned promise to be resolved before + * making other API calls when using esbuild in the browser. + * + * - Works in node: yes + * - Works in browser: yes ("options" is required) + * + * Documentation: https://esbuild.github.io/api/#browser + */ +export declare function initialize(options: InitializeOptions): Promise + +export interface InitializeOptions { + /** + * The URL of the "esbuild.wasm" file. This must be provided when running + * esbuild in the browser. + */ + wasmURL?: string | URL + + /** + * The result of calling "new WebAssembly.Module(buffer)" where "buffer" + * is a typed array or ArrayBuffer containing the binary code of the + * "esbuild.wasm" file. + * + * You can use this as an alternative to "wasmURL" for environments where it's + * not possible to download the WebAssembly module. + */ + wasmModule?: WebAssembly.Module + + /** + * By default esbuild runs the WebAssembly-based browser API in a web worker + * to avoid blocking the UI thread. This can be disabled by setting "worker" + * to false. + */ + worker?: boolean +} + +export let version: string + +// Call this function to terminate esbuild's child process. The child process +// is not terminated and re-created after each API call because it's more +// efficient to keep it around when there are multiple API calls. +// +// In node this happens automatically before the parent node process exits. So +// you only need to call this if you know you will not make any more esbuild +// API calls and you want to clean up resources. +// +// Unlike node, Deno lacks the necessary APIs to clean up child processes +// automatically. You must manually call stop() in Deno when you're done +// using esbuild or Deno will continue running forever. +// +// Another reason you might want to call this is if you are using esbuild from +// within a Deno test. Deno fails tests that create a child process without +// killing it before the test ends, so you have to call this function (and +// await the returned promise) in every Deno test that uses esbuild. +export declare function stop(): Promise + +// Note: These declarations exist to avoid type errors when you omit "dom" from +// "lib" in your "tsconfig.json" file. TypeScript confusingly declares the +// global "WebAssembly" type in "lib.dom.d.ts" even though it has nothing to do +// with the browser DOM and is present in many non-browser JavaScript runtimes +// (e.g. node and deno). Declaring it here allows esbuild's API to be used in +// these scenarios. +// +// There's an open issue about getting this problem corrected (although these +// declarations will need to remain even if this is fixed for backward +// compatibility with older TypeScript versions): +// +// https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/826 +// +declare global { + namespace WebAssembly { + interface Module { + } + } + interface URL { + } +} diff --git a/.pnpm-store/v11/files/10/237382cbfb8efcd3e7ad7112a42dd9bbf992df070a69777fbd10442017d7ef0a44909abb1dc5b25aff28fbee6c1ef6b24422bae1c3075f1d0ffa3a4f931213 b/.pnpm-store/v11/files/10/237382cbfb8efcd3e7ad7112a42dd9bbf992df070a69777fbd10442017d7ef0a44909abb1dc5b25aff28fbee6c1ef6b24422bae1c3075f1d0ffa3a4f931213 new file mode 100644 index 0000000..3c12d52 --- /dev/null +++ b/.pnpm-store/v11/files/10/237382cbfb8efcd3e7ad7112a42dd9bbf992df070a69777fbd10442017d7ef0a44909abb1dc5b25aff28fbee6c1ef6b24422bae1c3075f1d0ffa3a4f931213 @@ -0,0 +1,109 @@ +{ + "targets": [ + { + "target_name": "watcher", + "defines": [ "NAPI_DISABLE_CPP_EXCEPTIONS" ], + "sources": [ "src/binding.cc", "src/Watcher.cc", "src/Backend.cc", "src/DirTree.cc", "src/Glob.cc", "src/Debounce.cc" ], + "include_dirs" : [" !ignoreList.includes(i)) + + const esmPath = path.join(dir, 'index.mjs') + let content = fs.readFileSync(esmPath, 'utf-8') + + content = content.replace( + /\/\*\*VCA-EXPORTS\*\*\/[\s\S]+\/\*\*VCA-EXPORTS\*\*\//m, +`/**VCA-EXPORTS**/ +export { ${exports.join(', ')} } from '@vue/composition-api/dist/vue-composition-api.mjs' +/**VCA-EXPORTS**/` + ) + + fs.writeFileSync(esmPath, content, 'utf-8') + +} + +function switchVersion(version, vue) { + copy('index.cjs', version, vue) + copy('index.mjs', version, vue) + copy('index.d.ts', version, vue) + + if (version === 2) + updateVue2API() +} + + +module.exports.loadModule = loadModule +module.exports.switchVersion = switchVersion diff --git a/.pnpm-store/v11/files/1a/5619fa3f71e808a491734280abdb3aa5f790a044112e508a7a4f0835b136aef0ef0ff8afac0588af612b4dfef298c908eefc980554b6b0f6196861eb89cb6c-exec b/.pnpm-store/v11/files/1a/5619fa3f71e808a491734280abdb3aa5f790a044112e508a7a4f0835b136aef0ef0ff8afac0588af612b4dfef298c908eefc980554b6b0f6196861eb89cb6c-exec new file mode 100755 index 0000000..e81b7da Binary files /dev/null and b/.pnpm-store/v11/files/1a/5619fa3f71e808a491734280abdb3aa5f790a044112e508a7a4f0835b136aef0ef0ff8afac0588af612b4dfef298c908eefc980554b6b0f6196861eb89cb6c-exec differ diff --git a/.pnpm-store/v11/files/1c/35d831742879db7ad73c47a7fef86124dae5951690c56272353b82813cee1dfa61ac4c830802323360598b5b40b95c6b1d4c75fce6f0bd4d77e486b09706ea b/.pnpm-store/v11/files/1c/35d831742879db7ad73c47a7fef86124dae5951690c56272353b82813cee1dfa61ac4c830802323360598b5b40b95c6b1d4c75fce6f0bd4d77e486b09706ea new file mode 100644 index 0000000..3c104ca --- /dev/null +++ b/.pnpm-store/v11/files/1c/35d831742879db7ad73c47a7fef86124dae5951690c56272353b82813cee1dfa61ac4c830802323360598b5b40b95c6b1d4c75fce6f0bd4d77e486b09706ea @@ -0,0 +1,18 @@ +const { switchVersion } = require('./utils') + +const version = process.argv[2] +const vueEntry = process.argv[3] || 'vue' + +if (version === '2.7') { + switchVersion(2.7, vueEntry) + console.log(`[vue-demi] Switched for Vue 2.7 (entry: "${vueEntry}")`) +} else if (version === '2') { + switchVersion(2, vueEntry) + console.log(`[vue-demi] Switched for Vue 2 (entry: "${vueEntry}")`) +} else if (version === '3') { + switchVersion(3, vueEntry) + console.log(`[vue-demi] Switched for Vue 3 (entry: "${vueEntry}")`) +} else { + console.warn(`[vue-demi] expecting version "2" or "2.7" or "3" but got "${version}"`) + process.exit(1) +} diff --git a/.pnpm-store/v11/files/1d/37e286e659fb64e6ebe7840285e9ebbff3e8598724492296b60e4e17c6b6a207b114be1b8ab34fddeef0a268a99214d7abce046b4d4f7175a840bf608b12bb b/.pnpm-store/v11/files/1d/37e286e659fb64e6ebe7840285e9ebbff3e8598724492296b60e4e17c6b6a207b114be1b8ab34fddeef0a268a99214d7abce046b4d4f7175a840bf608b12bb new file mode 100644 index 0000000..9514109 --- /dev/null +++ b/.pnpm-store/v11/files/1d/37e286e659fb64e6ebe7840285e9ebbff3e8598724492296b60e4e17c6b6a207b114be1b8ab34fddeef0a268a99214d7abce046b4d4f7175a840bf608b12bb @@ -0,0 +1,132 @@ +#include +#include "WasmBackend.hh" + +#define CONVERT_TIME(ts) ((uint64_t)ts.tv_sec * 1000000000 + ts.tv_nsec) + +void WasmBackend::start() { + notifyStarted(); +} + +void WasmBackend::subscribe(WatcherRef watcher) { + // Build a full directory tree recursively, and watch each directory. + std::shared_ptr tree = getTree(watcher); + + for (auto it = tree->entries.begin(); it != tree->entries.end(); it++) { + if (it->second.isDir) { + watchDir(watcher, it->second.path, tree); + } + } +} + +void WasmBackend::watchDir(WatcherRef watcher, std::string path, std::shared_ptr tree) { + int wd = wasm_backend_add_watch(path.c_str(), (void *)this); + std::shared_ptr sub = std::make_shared(); + sub->tree = tree; + sub->path = path; + sub->watcher = watcher; + mSubscriptions.emplace(wd, sub); +} + +extern "C" void wasm_backend_event_handler(void *backend, int wd, int type, char *filename) { + WasmBackend *b = (WasmBackend *)(backend); + b->handleEvent(wd, type, filename); +} + +void WasmBackend::handleEvent(int wd, int type, char *filename) { + // Find the subscriptions for this watch descriptor + auto range = mSubscriptions.equal_range(wd); + std::unordered_set> set; + for (auto it = range.first; it != range.second; it++) { + set.insert(it->second); + } + + for (auto it = set.begin(); it != set.end(); it++) { + if (handleSubscription(type, filename, *it)) { + (*it)->watcher->notify(); + } + } +} + +bool WasmBackend::handleSubscription(int type, char *filename, std::shared_ptr sub) { + // Build full path and check if its in our ignore list. + WatcherRef watcher = sub->watcher; + std::string path = std::string(sub->path); + + if (filename[0] != '\0') { + path += "/" + std::string(filename); + } + + if (watcher->isIgnored(path)) { + return false; + } + + if (type == 1) { + struct stat st; + stat(path.c_str(), &st); + sub->tree->update(path, CONVERT_TIME(st.st_mtim)); + watcher->mEvents.update(path); + } else if (type == 2) { + // Determine if this is a create or delete depending on if the file exists or not. + struct stat st; + if (lstat(path.c_str(), &st)) { + // If the entry being deleted/moved is a directory, remove it from the list of subscriptions + DirEntry *entry = sub->tree->find(path); + if (!entry) { + return false; + } + + if (entry->isDir) { + std::string pathStart = path + DIR_SEP; + for (auto it = mSubscriptions.begin(); it != mSubscriptions.end();) { + if (it->second->path == path || it->second->path.rfind(pathStart, 0) == 0) { + wasm_backend_remove_watch(it->first); + it = mSubscriptions.erase(it); + } else { + ++it; + } + } + + // Remove all sub-entries + for (auto it = sub->tree->entries.begin(); it != sub->tree->entries.end();) { + if (it->first.rfind(pathStart, 0) == 0) { + watcher->mEvents.remove(it->first); + it = sub->tree->entries.erase(it); + } else { + it++; + } + } + } + + watcher->mEvents.remove(path); + sub->tree->remove(path); + } else if (sub->tree->find(path)) { + sub->tree->update(path, CONVERT_TIME(st.st_mtim)); + watcher->mEvents.update(path); + } else { + watcher->mEvents.create(path); + + // If this is a create, check if it's a directory and start watching if it is. + DirEntry *entry = sub->tree->add(path, CONVERT_TIME(st.st_mtim), S_ISDIR(st.st_mode)); + if (entry->isDir) { + watchDir(watcher, path, sub->tree); + } + } + } + + return true; +} + +void WasmBackend::unsubscribe(WatcherRef watcher) { + // Find any subscriptions pointing to this watcher, and remove them. + for (auto it = mSubscriptions.begin(); it != mSubscriptions.end();) { + if (it->second->watcher.get() == watcher.get()) { + if (mSubscriptions.count(it->first) == 1) { + wasm_backend_remove_watch(it->first); + } + + it = mSubscriptions.erase(it); + } else { + it++; + } + } +} diff --git a/.pnpm-store/v11/files/1f/75ebcc85b6b795dd6630ff8424435daca020bb38a171fe95758ba81805b7ca46401e94938fbf7bc5b386d52964d7ae5bd2c8cb0e51aa14c04c332aad31302f b/.pnpm-store/v11/files/1f/75ebcc85b6b795dd6630ff8424435daca020bb38a171fe95758ba81805b7ca46401e94938fbf7bc5b386d52964d7ae5bd2c8cb0e51aa14c04c332aad31302f new file mode 100644 index 0000000..995149d --- /dev/null +++ b/.pnpm-store/v11/files/1f/75ebcc85b6b795dd6630ff8424435daca020bb38a171fe95758ba81805b7ca46401e94938fbf7bc5b386d52964d7ae5bd2c8cb0e51aa14c04c332aad31302f @@ -0,0 +1,88 @@ +{ + "name": "@parcel/watcher", + "version": "2.5.6", + "main": "index.js", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/parcel-bundler/watcher.git" + }, + "description": "A native C++ Node module for querying and subscribing to filesystem events. Used by Parcel 2.", + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "files": [ + "index.js", + "index.js.flow", + "index.d.ts", + "wrapper.js", + "package.json", + "README.md", + "LICENSE", + "src", + "scripts/build-from-source.js", + "binding.gyp" + ], + "scripts": { + "prebuild": "prebuildify --napi --strip --tag-libc", + "format": "prettier --write \"./**/*.{js,json,md}\"", + "build": "node-gyp rebuild", + "install": "node scripts/build-from-source.js", + "test": "mocha" + }, + "engines": { + "node": ">= 10.0.0" + }, + "husky": { + "hooks": { + "pre-commit": "lint-staged" + } + }, + "lint-staged": { + "*.{js,json,md}": [ + "prettier --write", + "git add" + ] + }, + "dependencies": { + "detect-libc": "^2.0.3", + "is-glob": "^4.0.3", + "node-addon-api": "^7.0.0", + "picomatch": "^4.0.3" + }, + "devDependencies": { + "esbuild": "^0.19.8", + "fs-extra": "^10.0.0", + "husky": "^7.0.2", + "lint-staged": "^11.1.2", + "mocha": "^9.1.1", + "napi-wasm": "^1.1.0", + "prebuildify": "^6.0.1", + "prettier": "^2.3.2" + }, + "binary": { + "napi_versions": [ + 3 + ] + }, + "optionalDependencies": { + "@parcel/watcher-darwin-x64": "2.5.6", + "@parcel/watcher-darwin-arm64": "2.5.6", + "@parcel/watcher-win32-x64": "2.5.6", + "@parcel/watcher-win32-arm64": "2.5.6", + "@parcel/watcher-win32-ia32": "2.5.6", + "@parcel/watcher-linux-x64-glibc": "2.5.6", + "@parcel/watcher-linux-x64-musl": "2.5.6", + "@parcel/watcher-linux-arm64-glibc": "2.5.6", + "@parcel/watcher-linux-arm64-musl": "2.5.6", + "@parcel/watcher-linux-arm-glibc": "2.5.6", + "@parcel/watcher-linux-arm-musl": "2.5.6", + "@parcel/watcher-android-arm64": "2.5.6", + "@parcel/watcher-freebsd-x64": "2.5.6" + } +} diff --git a/.pnpm-store/v11/files/21/8edc038685e33a5a78cf1e60877f2e635048ef82a2f14bd619ca76bbab2956990b5291ad5e4fb399614c5fe5bd4b0795f288ce1e3a821c2511fced6c016080 b/.pnpm-store/v11/files/21/8edc038685e33a5a78cf1e60877f2e635048ef82a2f14bd619ca76bbab2956990b5291ad5e4fb399614c5fe5bd4b0795f288ce1e3a821c2511fced6c016080 new file mode 100644 index 0000000..2991c32 --- /dev/null +++ b/.pnpm-store/v11/files/21/8edc038685e33a5a78cf1e60877f2e635048ef82a2f14bd619ca76bbab2956990b5291ad5e4fb399614c5fe5bd4b0795f288ce1e3a821c2511fced6c016080 @@ -0,0 +1,306 @@ +#include +#include +#include +#include +#include +#include +#include +#include "KqueueBackend.hh" + +#if __APPLE__ +#define st_mtim st_mtimespec +#endif + +#if !defined(O_EVTONLY) +#define O_EVTONLY O_RDONLY +#endif + +#define CONVERT_TIME(ts) ((uint64_t)ts.tv_sec * 1000000000 + ts.tv_nsec) + +void KqueueBackend::start() { + if ((mKqueue = kqueue()) < 0) { + throw std::runtime_error(std::string("Unable to open kqueue: ") + strerror(errno)); + } + + // Create a pipe that we will write to when we want to end the thread. + int err = pipe(mPipe); + if (err == -1) { + throw std::runtime_error(std::string("Unable to open pipe: ") + strerror(errno)); + } + + // Subscribe kqueue to this pipe. + struct kevent ev; + EV_SET( + &ev, + mPipe[0], + EVFILT_READ, + EV_ADD | EV_CLEAR, + 0, + 0, + 0 + ); + + if (kevent(mKqueue, &ev, 1, NULL, 0, 0)) { + close(mPipe[0]); + close(mPipe[1]); + throw std::runtime_error(std::string("Unable to watch pipe: ") + strerror(errno)); + } + + notifyStarted(); + + struct kevent events[128]; + + while (true) { + int event_count = kevent(mKqueue, NULL, 0, events, 128, 0); + if (event_count < 0 || events[0].flags == EV_ERROR) { + throw std::runtime_error(std::string("kevent error: ") + strerror(errno)); + } + + // Track all of the watchers that are touched so we can notify them at the end of the events. + std::unordered_set watchers; + + for (int i = 0; i < event_count; i++) { + int flags = events[i].fflags; + int fd = events[i].ident; + if (fd == mPipe[0]) { + // pipe was written to. break out of the loop. + goto done; + } + + auto it = mFdToEntry.find(fd); + if (it == mFdToEntry.end()) { + // If fd wasn't in our map, we may have already stopped watching it. Ignore the event. + continue; + } + + DirEntry *entry = it->second; + + if (flags & NOTE_WRITE && entry && entry->isDir) { + // If a write occurred on a directory, we have to diff the contents of that + // directory to determine what file was added/deleted. + compareDir(fd, entry->path, watchers); + } else { + std::vector subs = findSubscriptions(entry->path); + for (auto it = subs.begin(); it != subs.end(); it++) { + KqueueSubscription *sub = *it; + watchers.insert(sub->watcher); + if (flags & (NOTE_DELETE | NOTE_RENAME | NOTE_REVOKE)) { + sub->watcher->mEvents.remove(sub->path); + sub->tree->remove(sub->path); + mFdToEntry.erase((int)(size_t)entry->state); + mSubscriptions.erase(sub->path); + } else if (flags & (NOTE_WRITE | NOTE_ATTRIB | NOTE_EXTEND)) { + struct stat st; + lstat(sub->path.c_str(), &st); + if (entry->mtime != CONVERT_TIME(st.st_mtim)) { + entry->mtime = CONVERT_TIME(st.st_mtim); + sub->watcher->mEvents.update(sub->path); + } + } + } + } + } + + for (auto it = watchers.begin(); it != watchers.end(); it++) { + (*it)->notify(); + } + } + +done: + close(mPipe[0]); + close(mPipe[1]); + mEndedSignal.notify(); +} + +KqueueBackend::~KqueueBackend() { + write(mPipe[1], "X", 1); + mEndedSignal.wait(); +} + +void KqueueBackend::subscribe(WatcherRef watcher) { + // Build a full directory tree recursively, and watch each directory. + std::shared_ptr tree = getTree(watcher); + + for (auto it = tree->entries.begin(); it != tree->entries.end(); it++) { + bool success = watchDir(watcher, it->second.path, tree); + if (!success) { + throw WatcherError(std::string("error watching " + watcher->mDir + ": " + strerror(errno)), watcher); + } + } +} + +bool KqueueBackend::watchDir(WatcherRef watcher, std::string path, std::shared_ptr tree) { + if (watcher->isIgnored(path)) { + return false; + } + + DirEntry *entry = tree->find(path); + if (!entry) { + return false; + } + + KqueueSubscription sub = { + .watcher = watcher, + .path = path, + .tree = tree + }; + + if (!entry->state) { + int fd = open(path.c_str(), O_EVTONLY); + if (fd <= 0) { + return false; + } + + struct kevent event; + EV_SET( + &event, + fd, + EVFILT_VNODE, + EV_ADD | EV_CLEAR | EV_ENABLE, + NOTE_DELETE | NOTE_WRITE | NOTE_EXTEND | NOTE_ATTRIB | NOTE_RENAME | NOTE_REVOKE, + 0, + 0 + ); + + if (kevent(mKqueue, &event, 1, NULL, 0, 0)) { + close(fd); + return false; + } + + entry->state = (void *)(size_t)fd; + mFdToEntry.emplace(fd, entry); + } + + sub.fd = (int)(size_t)entry->state; + mSubscriptions.emplace(path, sub); + return true; +} + +std::vector KqueueBackend::findSubscriptions(std::string &path) { + // Find the subscriptions affected by this path. + // Copy pointers to them into a vector so that modifying mSubscriptions doesn't invalidate the iterator. + auto range = mSubscriptions.equal_range(path); + std::vector subs; + for (auto it = range.first; it != range.second; it++) { + subs.push_back(&it->second); + } + + return subs; +} + +bool KqueueBackend::compareDir(int fd, std::string &path, std::unordered_set &watchers) { + // macOS doesn't support fdclosedir, so we have to duplicate the file descriptor + // to ensure the closedir doesn't also stop watching. + #if __APPLE__ + fd = dup(fd); + #endif + + DIR *dir = fdopendir(fd); + if (dir == NULL) { + return false; + } + + // fdopendir doesn't rewind to the beginning. + rewinddir(dir); + + std::vector subs = findSubscriptions(path); + std::string dirStart = path + DIR_SEP; + + std::unordered_set> trees; + for (auto it = subs.begin(); it != subs.end(); it++) { + trees.emplace((*it)->tree); + } + + std::unordered_set entries; + struct dirent *entry; + while ((entry = readdir(dir))) { + if (strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0) { + continue; + } + + std::string fullpath = dirStart + entry->d_name; + entries.emplace(fullpath); + + for (auto it = trees.begin(); it != trees.end(); it++) { + std::shared_ptr tree = *it; + if (!tree->find(fullpath)) { + struct stat st; + fstatat(fd, entry->d_name, &st, AT_SYMLINK_NOFOLLOW); + tree->add(fullpath, CONVERT_TIME(st.st_mtim), S_ISDIR(st.st_mode)); + + // Notify all watchers with the same tree. + for (auto i = subs.begin(); i != subs.end(); i++) { + KqueueSubscription *sub = *i; + if (sub->tree == tree) { + if (sub->watcher->isIgnored(fullpath)) { + continue; + } + + sub->watcher->mEvents.create(fullpath); + watchers.emplace(sub->watcher); + + bool success = watchDir(sub->watcher, fullpath, sub->tree); + if (!success) { + sub->tree->remove(fullpath); + return false; + } + } + } + } + } + } + + for (auto it = trees.begin(); it != trees.end(); it++) { + std::shared_ptr tree = *it; + for (auto entry = tree->entries.begin(); entry != tree->entries.end();) { + + if ( + entry->first.rfind(dirStart, 0) == 0 && + entry->first.find(DIR_SEP, dirStart.length()) == std::string::npos && + entries.count(entry->first) == 0 + ) { + // Notify all watchers with the same tree. + for (auto i = subs.begin(); i != subs.end(); i++) { + if ((*i)->tree == tree) { + KqueueSubscription *sub = *i; + if (!sub->watcher->isIgnored(entry->first)) { + sub->watcher->mEvents.remove(entry->first); + watchers.emplace(sub->watcher); + } + } + } + + mFdToEntry.erase((int)(size_t)entry->second.state); + mSubscriptions.erase(entry->first); + entry = tree->entries.erase(entry); + } else { + entry++; + } + } + } + + #if __APPLE__ + closedir(dir); + #else + fdclosedir(dir); + #endif + + return true; +} + +void KqueueBackend::unsubscribe(WatcherRef watcher) { + // Find any subscriptions pointing to this watcher, and remove them. + for (auto it = mSubscriptions.begin(); it != mSubscriptions.end();) { + if (it->second.watcher.get() == watcher.get()) { + if (mSubscriptions.count(it->first) == 1) { + // Closing the file descriptor automatically unwatches it in the kqueue. + close(it->second.fd); + mFdToEntry.erase(it->second.fd); + } + + it = mSubscriptions.erase(it); + } else { + it++; + } + } +} diff --git a/.pnpm-store/v11/files/2e/9153c302ba4cd7415d8b145ba7a03aa58a663f9470aec9f521024c852e68c043319ec40333f875df1a3808b244222cd15559d9c42ca525fc47932c7d5ff9f1 b/.pnpm-store/v11/files/2e/9153c302ba4cd7415d8b145ba7a03aa58a663f9470aec9f521024c852e68c043319ec40333f875df1a3808b244222cd15559d9c42ca525fc47932c7d5ff9f1 new file mode 100644 index 0000000..60490c6 --- /dev/null +++ b/.pnpm-store/v11/files/2e/9153c302ba4cd7415d8b145ba7a03aa58a663f9470aec9f521024c852e68c043319ec40333f875df1a3808b244222cd15559d9c42ca525fc47932c7d5ff9f1 @@ -0,0 +1,77 @@ +#include + +// weird error on linux +#ifdef __THROW +#undef __THROW +#endif +#define __THROW + +#ifdef _LIBC +# include +#else +# include +#endif +#include +#include +#include + +#include "../DirTree.hh" +#include "../shared/BruteForceBackend.hh" + +#define CONVERT_TIME(ts) ((uint64_t)ts.tv_sec * 1000000000 + ts.tv_nsec) +#if __APPLE__ +#define st_mtim st_mtimespec +#endif +#define ISDOT(a) (a[0] == '.' && (!a[1] || (a[1] == '.' && !a[2]))) + +void iterateDir(WatcherRef watcher, const std::shared_ptr tree, const char *relative, int parent_fd, const std::string &dirname) { + int open_flags = (O_RDONLY | O_CLOEXEC | O_DIRECTORY | O_NOCTTY | O_NONBLOCK | O_NOFOLLOW); + int new_fd = openat(parent_fd, relative, open_flags); + if (new_fd == -1) { + if (errno == EACCES) { + return; // ignore insufficient permissions + } + + throw WatcherError(strerror(errno), watcher); + } + + struct stat rootAttributes; + fstatat(new_fd, ".", &rootAttributes, AT_SYMLINK_NOFOLLOW); + tree->add(dirname, CONVERT_TIME(rootAttributes.st_mtim), true); + + if (DIR *dir = fdopendir(new_fd)) { + while (struct dirent *ent = (errno = 0, readdir(dir))) { + if (ISDOT(ent->d_name)) continue; + + std::string fullPath = dirname + "/" + ent->d_name; + + if (!watcher->isIgnored(fullPath)) { + struct stat attrib; + fstatat(new_fd, ent->d_name, &attrib, AT_SYMLINK_NOFOLLOW); + bool isDir = ent->d_type == DT_DIR; + + if (isDir) { + iterateDir(watcher, tree, ent->d_name, new_fd, fullPath); + } else { + tree->add(fullPath, CONVERT_TIME(attrib.st_mtim), isDir); + } + } + } + + closedir(dir); + } else { + close(new_fd); + } + + if (errno) { + throw WatcherError(strerror(errno), watcher); + } +} + +void BruteForceBackend::readTree(WatcherRef watcher, std::shared_ptr tree) { + int fd = open(watcher->mDir.c_str(), O_RDONLY); + if (fd) { + iterateDir(watcher, tree, ".", fd, watcher->mDir); + close(fd); + } +} diff --git a/.pnpm-store/v11/files/34/c08aaeaca83bd1d548e3535cedfe59136cbf3e0b937414b564f039d6b54457f4763488495967d995204c04b5f13e6264d034104a03e04bd02a569509db407f b/.pnpm-store/v11/files/34/c08aaeaca83bd1d548e3535cedfe59136cbf3e0b937414b564f039d6b54457f4763488495967d995204c04b5f13e6264d034104a03e04bd02a569509db407f new file mode 100644 index 0000000..2c18122 --- /dev/null +++ b/.pnpm-store/v11/files/34/c08aaeaca83bd1d548e3535cedfe59136cbf3e0b937414b564f039d6b54457f4763488495967d995204c04b5f13e6264d034104a03e04bd02a569509db407f @@ -0,0 +1,49 @@ +import Vue from 'vue' +import VueCompositionAPI, { getCurrentInstance } from '@vue/composition-api/dist/vue-composition-api.mjs' + +function install(_vue) { + _vue = _vue || Vue + if (_vue && !_vue['__composition_api_installed__']) + _vue.use(VueCompositionAPI) +} + +install(Vue) + +var isVue2 = true +var isVue3 = false +var Vue2 = Vue +var version = Vue.version + +/**VCA-EXPORTS**/ +export * from '@vue/composition-api/dist/vue-composition-api.mjs' +/**VCA-EXPORTS**/ + +export { + Vue, + Vue2, + isVue2, + isVue3, + version, + install, +} + + +// Vue 3 components mock +function createMockComponent(name) { + return { + setup() { + throw new Error('[vue-demi] ' + name + ' is not supported in Vue 2. It\'s provided to avoid compiler errors.') + } + } +} +export var Fragment = /*#__PURE__*/ createMockComponent('Fragment') +export var Transition = /*#__PURE__*/ createMockComponent('Transition') +export var TransitionGroup = /*#__PURE__*/ createMockComponent('TransitionGroup') +export var Teleport = /*#__PURE__*/ createMockComponent('Teleport') +export var Suspense = /*#__PURE__*/ createMockComponent('Suspense') +export var KeepAlive = /*#__PURE__*/ createMockComponent('KeepAlive') + +// Not implemented https://github.com/vuejs/core/pull/8111, falls back to getCurrentInstance() +export function hasInjectionContext() { + return !!getCurrentInstance() +} diff --git a/.pnpm-store/v11/files/37/0fd9fe1e376f876c99f249910faa3e1a57ac46d96307989534d9d1614630a72942d84eba2a49484385d68082bac337f06e45fcaa14e77080aab783d40a6743 b/.pnpm-store/v11/files/37/0fd9fe1e376f876c99f249910faa3e1a57ac46d96307989534d9d1614630a72942d84eba2a49484385d68082bac337f06e45fcaa14e77080aab783d40a6743 new file mode 100644 index 0000000..fe253fb --- /dev/null +++ b/.pnpm-store/v11/files/37/0fd9fe1e376f876c99f249910faa3e1a57ac46d96307989534d9d1614630a72942d84eba2a49484385d68082bac337f06e45fcaa14e77080aab783d40a6743 @@ -0,0 +1,46 @@ +{ + "name": "esbuild", + "version": "0.21.5", + "description": "An extremely fast JavaScript and CSS bundler and minifier.", + "repository": { + "type": "git", + "url": "git+https://github.com/evanw/esbuild.git" + }, + "scripts": { + "postinstall": "node install.js" + }, + "main": "lib/main.js", + "types": "lib/main.d.ts", + "engines": { + "node": ">=12" + }, + "bin": { + "esbuild": "bin/esbuild" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + }, + "license": "MIT" +} diff --git a/.pnpm-store/v11/files/39/a53097bb58c35936edf10f3bd386bcec5a2978f9371f28357c4e4ffda95153cb661fecb9475158a63a4a1331e333719303ee1b1a3937b9522123d54dc321d4 b/.pnpm-store/v11/files/39/a53097bb58c35936edf10f3bd386bcec5a2978f9371f28357c4e4ffda95153cb661fecb9475158a63a4a1331e333719303ee1b1a3937b9522123d54dc321d4 new file mode 100644 index 0000000..a17fdef --- /dev/null +++ b/.pnpm-store/v11/files/39/a53097bb58c35936edf10f3bd386bcec5a2978f9371f28357c4e4ffda95153cb661fecb9475158a63a4a1331e333719303ee1b1a3937b9522123d54dc321d4 @@ -0,0 +1,49 @@ +#ifndef DEBOUNCE_H +#define DEBOUNCE_H + +#include +#include +#include +#include "Signal.hh" + +#define MIN_WAIT_TIME 50 +#define MAX_WAIT_TIME 500 + +#ifdef __wasm32__ +extern "C" { + int set_timeout(int ms, void *ctx); + void clear_timeout(int timeout); + void on_timeout(void *ctx); +}; +#endif + +class Debounce { +public: + static std::shared_ptr getShared(); + + Debounce(); + ~Debounce(); + + void add(void *key, std::function cb); + void remove(void *key); + void trigger(); + void notify(); + +private: + bool mRunning; + std::mutex mMutex; + #ifdef __wasm32__ + int mTimeout; + #else + Signal mWaitSignal; + std::thread mThread; + #endif + std::unordered_map> mCallbacks; + std::chrono::time_point mLastTime; + + void loop(); + void notifyIfReady(); + void wait(); +}; + +#endif diff --git a/.pnpm-store/v11/files/3c/46e885f5bd5b3b897bbc8df613c7287c2a457e6bd7aa4d9459d0b45672010524bf51e66fc6ab868e0a4ebf119c00e71a13eeaa4b79985c632be5dc1f4f4e97 b/.pnpm-store/v11/files/3c/46e885f5bd5b3b897bbc8df613c7287c2a457e6bd7aa4d9459d0b45672010524bf51e66fc6ab868e0a4ebf119c00e71a13eeaa4b79985c632be5dc1f4f4e97 new file mode 100644 index 0000000..a4a1722 --- /dev/null +++ b/.pnpm-store/v11/files/3c/46e885f5bd5b3b897bbc8df613c7287c2a457e6bd7aa4d9459d0b45672010524bf51e66fc6ab868e0a4ebf119c00e71a13eeaa4b79985c632be5dc1f4f4e97 @@ -0,0 +1,22 @@ +#include "Glob.hh" + +#ifdef __wasm32__ +extern "C" bool wasm_regex_match(const char *s, const char *regex); +#endif + +Glob::Glob(std::string raw) { + mRaw = raw; + mHash = std::hash()(raw); + #ifndef __wasm32__ + mRegex = std::regex(raw); + #endif +} + +bool Glob::isIgnored(std::string relative_path) const { + // Use native JS regex engine for wasm to reduce binary size. + #ifdef __wasm32__ + return wasm_regex_match(relative_path.c_str(), mRaw.c_str()); + #else + return std::regex_match(relative_path, mRegex); + #endif +} diff --git a/.pnpm-store/v11/files/44/52c3fce24db23d33f8fc8e1ebec993955f878ecbd2866ed1ecdf6a9140fc995631735af155e201751a1a1dc7cd847f851050f2d8ca6ca21b9c43f245ae857d b/.pnpm-store/v11/files/44/52c3fce24db23d33f8fc8e1ebec993955f878ecbd2866ed1ecdf6a9140fc995631735af155e201751a1a1dc7cd847f851050f2d8ca6ca21b9c43f245ae857d new file mode 100644 index 0000000..28e74f0 --- /dev/null +++ b/.pnpm-store/v11/files/44/52c3fce24db23d33f8fc8e1ebec993955f878ecbd2866ed1ecdf6a9140fc995631735af155e201751a1a1dc7cd847f851050f2d8ca6ca21b9c43f245ae857d @@ -0,0 +1,136 @@ +# @parcel/watcher + +A native C++ Node module for querying and subscribing to filesystem events. Used by [Parcel 2](https://github.com/parcel-bundler/parcel). + +## Features + +- **Watch** - subscribe to realtime recursive directory change notifications when files or directories are created, updated, or deleted. +- **Query** - performantly query for historical change events in a directory, even when your program is not running. +- **Native** - implemented in C++ for performance and low-level integration with the operating system. +- **Cross platform** - includes backends for macOS, Linux, Windows, FreeBSD, and Watchman. +- **Performant** - events are throttled in C++ so the JavaScript thread is not overwhelmed during large filesystem changes (e.g. `git checkout` or `npm install`). +- **Scalable** - tens of thousands of files can be watched or queried at once with good performance. + +## Example + +```javascript +const watcher = require('@parcel/watcher'); +const path = require('path'); + +// Subscribe to events +let subscription = await watcher.subscribe(process.cwd(), (err, events) => { + console.log(events); +}); + +// later on... +await subscription.unsubscribe(); + +// Get events since some saved snapshot in the past +let snapshotPath = path.join(process.cwd(), 'snapshot.txt'); +let events = await watcher.getEventsSince(process.cwd(), snapshotPath); + +// Save a snapshot for later +await watcher.writeSnapshot(process.cwd(), snapshotPath); +``` + +## Watching + +`@parcel/watcher` supports subscribing to realtime notifications of changes in a directory. It works recursively, so changes in sub-directories will also be emitted. + +Events are throttled and coalesced for performance during large changes like `git checkout` or `npm install`, and a single notification will be emitted with all of the events at the end. + +Only one notification will be emitted per file. For example, if a file was both created and updated since the last event, you'll get only a `create` event. If a file is both created and deleted, you will not be notifed of that file. Renames cause two events: a `delete` for the old name, and a `create` for the new name. + +```javascript +let subscription = await watcher.subscribe(process.cwd(), (err, events) => { + console.log(events); +}); +``` + +Events have two properties: + +- `type` - the event type: `create`, `update`, or `delete`. +- `path` - the absolute path to the file or directory. + +To unsubscribe from change notifications, call the `unsubscribe` method on the returned subscription object. + +```javascript +await subscription.unsubscribe(); +``` + +`@parcel/watcher` has the following watcher backends, listed in priority order: + +- [FSEvents](https://developer.apple.com/documentation/coreservices/file_system_events) on macOS +- [Watchman](https://facebook.github.io/watchman/) if installed +- [inotify](http://man7.org/linux/man-pages/man7/inotify.7.html) on Linux +- [ReadDirectoryChangesW](https://msdn.microsoft.com/en-us/library/windows/desktop/aa365465%28v%3Dvs.85%29.aspx) on Windows +- [kqueue](https://man.freebsd.org/cgi/man.cgi?kqueue) on FreeBSD, or as an alternative to FSEvents on macOS + +You can specify the exact backend you wish to use by passing the `backend` option. If that backend is not available on the current platform, the default backend will be used instead. See below for the list of backend names that can be passed to the options. + +## Querying + +`@parcel/watcher` also supports querying for historical changes made in a directory, even when your program is not running. This makes it easy to invalidate a cache and re-build only the files that have changed, for example. It can be **significantly** faster than traversing the entire filesystem to determine what files changed, depending on the platform. + +In order to query for historical changes, you first need a previous snapshot to compare to. This can be saved to a file with the `writeSnapshot` function, e.g. just before your program exits. + +```javascript +await watcher.writeSnapshot(dirPath, snapshotPath); +``` + +When your program starts up, you can query for changes that have occurred since that snapshot using the `getEventsSince` function. + +```javascript +let events = await watcher.getEventsSince(dirPath, snapshotPath); +``` + +The events returned are exactly the same as the events that would be passed to the `subscribe` callback (see above). + +`@parcel/watcher` has the following watcher backends, listed in priority order: + +- [FSEvents](https://developer.apple.com/documentation/coreservices/file_system_events) on macOS +- [Watchman](https://facebook.github.io/watchman/) if installed +- [fts](http://man7.org/linux/man-pages/man3/fts.3.html) (brute force) on Linux and FreeBSD +- [FindFirstFile](https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-findfirstfilea) (brute force) on Windows + +The FSEvents (macOS) and Watchman backends are significantly more performant than the brute force backends used by default on Linux and Windows, for example returning results in miliseconds instead of seconds for large directory trees. This is because a background daemon monitoring filesystem changes on those platforms allows us to query cached data rather than traversing the filesystem manually (brute force). + +macOS has good performance with FSEvents by default. For the best performance on other platforms, install [Watchman](https://facebook.github.io/watchman/) and it will be used by `@parcel/watcher` automatically. + +You can specify the exact backend you wish to use by passing the `backend` option. If that backend is not available on the current platform, the default backend will be used instead. See below for the list of backend names that can be passed to the options. + +## Options + +All of the APIs in `@parcel/watcher` support the following options, which are passed as an object as the last function argument. + +- `ignore` - an array of paths or glob patterns to ignore. uses [`is-glob`](https://github.com/micromatch/is-glob) to distinguish paths from globs. glob patterns are parsed with [`picomatch`](https://github.com/micromatch/picomatch) (see [features](https://github.com/micromatch/picomatch#globbing-features)). + - paths can be relative or absolute and can either be files or directories. No events will be emitted about these files or directories or their children. + - glob patterns match on relative paths from the root that is watched. No events will be emitted for matching paths. +- `backend` - the name of an explicitly chosen backend to use. Allowed options are `"fs-events"`, `"watchman"`, `"inotify"`, `"kqueue"`, `"windows"`, or `"brute-force"` (only for querying). If the specified backend is not available on the current platform, the default backend will be used instead. + +## WASM + +The `@parcel/watcher-wasm` package can be used in place of `@parcel/watcher` on unsupported platforms. It relies on the Node `fs` module, so in non-Node environments such as browsers, an `fs` polyfill will be needed. + +**Note**: the WASM implementation is significantly less efficient than the native implementations because it must crawl the file system to watch each directory individually. Use the native `@parcel/watcher` package wherever possible. + +```js +import {subscribe} from '@parcel/watcher-wasm'; + +// Use the module as documented above. +subscribe(/* ... */); +``` + +## Who is using this? + +- [Parcel 2](https://parceljs.org/) +- [VSCode](https://code.visualstudio.com/updates/v1_62#_file-watching-changes) +- [Tailwind CSS Intellisense](https://github.com/tailwindlabs/tailwindcss-intellisense) +- [Gatsby Cloud](https://twitter.com/chatsidhartha/status/1435647412828196867) +- [Nx](https://nx.dev) +- [Nuxt](https://nuxt.com) +- [Meteor](https://github.com/meteor/meteor) + +## License + +MIT diff --git a/.pnpm-store/v11/files/48/2a5ab95e655d0280c3837316202de7d149a7b752c1691d9d16d429f2474a40fd2ba4a1266475c5295f03aa8b2da637c6d4f009f2ba48920aa8829dd05f23dd b/.pnpm-store/v11/files/48/2a5ab95e655d0280c3837316202de7d149a7b752c1691d9d16d429f2474a40fd2ba4a1266475c5295f03aa8b2da637c6d4f009f2ba48920aa8829dd05f23dd new file mode 100644 index 0000000..3c6a9cd --- /dev/null +++ b/.pnpm-store/v11/files/48/2a5ab95e655d0280c3837316202de7d149a7b752c1691d9d16d429f2474a40fd2ba4a1266475c5295f03aa8b2da637c6d4f009f2ba48920aa8829dd05f23dd @@ -0,0 +1,35 @@ +#ifndef KQUEUE_H +#define KQUEUE_H + +#include +#include +#include "../shared/BruteForceBackend.hh" +#include "../DirTree.hh" +#include "../Signal.hh" + +struct KqueueSubscription { + WatcherRef watcher; + std::string path; + std::shared_ptr tree; + int fd; +}; + +class KqueueBackend : public BruteForceBackend { +public: + void start() override; + ~KqueueBackend(); + void subscribe(WatcherRef watcher) override; + void unsubscribe(WatcherRef watcher) override; +private: + int mKqueue; + int mPipe[2]; + std::unordered_multimap mSubscriptions; + std::unordered_map mFdToEntry; + Signal mEndedSignal; + + bool watchDir(WatcherRef watcher, std::string path, std::shared_ptr tree); + bool compareDir(int fd, std::string &dir, std::unordered_set &watchers); + std::vector findSubscriptions(std::string &path); +}; + +#endif diff --git a/.pnpm-store/v11/files/48/4ece380e757de9d77c55868a0376c5f00498a1ad48c9a4308bca17582bcb97d9d118c14c9f4200ce6bac0a4a1c78eec2bc9db5afed77cb79a7371238fa40af b/.pnpm-store/v11/files/48/4ece380e757de9d77c55868a0376c5f00498a1ad48c9a4308bca17582bcb97d9d118c14c9f4200ce6bac0a4a1c78eec2bc9db5afed77cb79a7371238fa40af new file mode 100644 index 0000000..f941590 --- /dev/null +++ b/.pnpm-store/v11/files/48/4ece380e757de9d77c55868a0376c5f00498a1ad48c9a4308bca17582bcb97d9d118c14c9f4200ce6bac0a4a1c78eec2bc9db5afed77cb79a7371238fa40af @@ -0,0 +1,229 @@ +

+ +
+npm +

+ +

+Vue Demi (half in French) is a developing utility
allows you to write Universal Vue Libraries for Vue 2 & 3
+See more details in this blog post +

+ +
+ +
+ +## Strategies + +- `<=2.6`: exports from `vue` + `@vue/composition-api` with plugin auto installing. +- `2.7`: exports from `vue` (Composition API is built-in in Vue 2.7). +- `>=3.0`: exports from `vue`, with polyfill of Vue 2's `set` and `del` API. + +## Usage + +Install this as your plugin's dependency: + +```bash +npm i vue-demi +# or +yarn add vue-demi +# or +pnpm i vue-demi +``` + +Add `vue` and `@vue/composition-api` to your plugin's peer dependencies to specify what versions you support. + +```jsonc +{ + "dependencies": { + "vue-demi": "latest" + }, + "peerDependencies": { + "@vue/composition-api": "^1.0.0-rc.1", + "vue": "^2.0.0 || >=3.0.0" + }, + "peerDependenciesMeta": { + "@vue/composition-api": { + "optional": true + } + }, + "devDependencies": { + "vue": "^3.0.0" // or "^2.6.0" base on your preferred working environment + }, +} +``` + +Import everything related to Vue from it, it will redirect to `vue@2` + `@vue/composition-api` or `vue@3` based on users' environments. + +```ts +import { ref, reactive, defineComponent } from 'vue-demi' +``` + +Publish your plugin and all is done! + +> When using with [Vite](https://vitejs.dev), you will need to opt-out the pre-bundling to get `vue-demi` work properly by +> ```js +> // vite.config.js +> export default defineConfig({ +> optimizeDeps: { +> exclude: ['vue-demi'] +> } +> }) +> ``` + +### Extra APIs + +`Vue Demi` provides extra APIs to help distinguish users' environments and to do some version-specific logic. + +### `isVue2` `isVue3` + +```ts +import { isVue2, isVue3 } from 'vue-demi' + +if (isVue2) { + // Vue 2 only +} else { + // Vue 3 only +} +``` + +### `Vue2` + +To avoid bringing in all the tree-shakable modules, we provide a `Vue2` export to support access to Vue 2's global API. (See [#41](https://github.com/vueuse/vue-demi/issues/41).) + +```ts +import { Vue2 } from 'vue-demi' + +if (Vue2) { + Vue2.config.ignoredElements.push('x-foo') +} +``` + +### `install()` + +Composition API in Vue 2 is provided as a plugin and needs to be installed on the Vue instance before using. Normally, `vue-demi` will try to install it automatically. For some usages where you might need to ensure the plugin gets installed correctly, the `install()` API is exposed to as a safe version of `Vue.use(CompositionAPI)`. `install()` in the Vue 3 environment will be an empty function (no-op). + +```ts +import { install } from 'vue-demi' + +install() +``` + +## CLI + +### Manually Switch Versions + +To explicitly switch the redirecting version, you can use these commands in your project's root. + +```bash +npx vue-demi-switch 2 +# or +npx vue-demi-switch 3 +``` + +### Package Aliasing + +If you would like to import `vue` under an alias, you can use the following command + +```bash +npx vue-demi-switch 2 vue2 +# or +npx vue-demi-switch 3 vue3 +``` + +Then `vue-demi` will redirect APIs from the alias name you specified, for example: + +```ts +import * as Vue from 'vue3' + +var isVue2 = false +var isVue3 = true +var Vue2 = undefined + +export * from 'vue3' +export { + Vue, + Vue2, + isVue2, + isVue3, +} +``` + +### Auto Fix + +If the `postinstall` hook doesn't get triggered or you have updated the Vue version, try to run the following command to resolve the redirecting. + +```bash +npx vue-demi-fix +``` + +### Isomorphic Testings + +You can support testing for both versions by adding npm alias in your dev dependencies. For example: + +```json +{ + "scripts": { + "test:2": "vue-demi-switch 2 vue2 && jest", + "test:3": "vue-demi-switch 3 && jest", + }, + "devDependencies": { + "vue": "^3.0.0", + "vue2": "npm:vue@2" + }, +} +``` + +or + +```json +{ + "scripts": { + "test:2": "vue-demi-switch 2 && jest", + "test:3": "vue-demi-switch 3 vue3 && jest", + }, + "devDependencies": { + "vue": "^2.6.0", + "vue3": "npm:vue@3" + }, +} +``` + +## Examples + +See [examples](./examples). + +## Who is using this? + +- [VueUse](https://github.com/vueuse/vueuse) - Collection of Composition API utils +- [@vue/apollo-composable](https://github.com/vuejs/vue-apollo/tree/v4/packages/vue-apollo-composable) - Apollo GraphQL functions for Vue Composition API +- [vuelidate](https://github.com/vuelidate/vuelidate) - Simple, lightweight model-based validation +- [vue-composition-test-utils](https://github.com/ariesjia/vue-composition-test-utils) - Simple vue composition api unit test utilities +- [vue-use-stripe](https://github.com/frandiox/vue-use-stripe) - Stripe Elements wrapper for Vue.js +- [@opd/g2plot-vue](https://github.com/open-data-plan/g2plot-vue) - G2plot for vue +- [vue-echarts](https://github.com/ecomfe/vue-echarts) - Vue.js component for Apache ECharts. +- [fluent-vue](https://github.com/Demivan/fluent-vue) - Vue.js integration for [Fluent.js](https://github.com/projectfluent/fluent.js) - JavaScript implementation of [Project Fluent](https://projectfluent.org) +- [vue-datatable-url-sync](https://github.com/socotecio/vue-datatable-url-sync) - Synchronize datatable options and filters with the url to keep user preference even after refresh or navigation +- [vue-insta-stories](https://github.com/UnevenSoftware/vue-insta-stories) - Instagram stories in your vue projects. +- [vue-tiny-validate](https://github.com/FrontLabsOfficial/vue-tiny-validate) - Tiny Vue Validate Composition +- [v-perfect-signature](https://github.com/wobsoriano/v-perfect-signature) - Pressure-sensitive signature drawing for Vue 2 and 3 +- [vue-winbox](https://github.com/wobsoriano/vue-winbox) - A wrapper component for WinBox.js that adds the ability to mount Vue components. +- [vue-word-highlighter](https://github.com/kawamataryo/vue-word-highlighter) - The word highlighter library for Vue 2 and Vue 3 +- [vue-chart-3](https://github.com/victorgarciaesgi/vue-chart-3) - Vue.js component for Chart.js +- [json-editor-vue](https://github.com/cloydlau/json-editor-vue) - JSON editor & viewer for Vue 2 and 3. +- [kidar-echarts](https://github.com/kidarjs/kidar-echarts) - A simpler echarts component for Vue 2 and 3. +- [vue3-sketch-ruler](https://github.com/kakajun/vue3-sketch-ruler) - The zoom operation used for page presentation for Vue 2 and 3( Replace render function with template ) +- [vue-rough-notation](https://github.com/Leecason/vue-rough-notation) - RoughNotation wrapper component for Vue 2 and 3. +- [vue-request](https://github.com/AttoJS/vue-request) - Vue composition API for data fetching, supports SWR, polling, error retry, cache request, pagination, etc. +- [vue3-lazyload](https://github.com/murongg/vue3-lazyload) - A vue3.x image lazyload plugin. +- [vue-codemirror6](https://github.com/logue/vue-codemirror6) - CodeMirror6 component for Vue2 and 3. +- [@tanstack/vue-query](https://github.com/TanStack/query) - TanStack Query for Vue. +> open a PR to add your library ;) + +## Underhood + +See [the blog post](https://antfu.me/posts/make-libraries-working-with-vue-2-and-3/#-introducing-vue-demi). + +## License + +MIT License © 2020 [Anthony Fu](https://github.com/antfu) diff --git a/.pnpm-store/v11/files/4e/e8f9ff2912dea80ab92b3176d259015396021b09e18e521eecb445ae9506963577b162fe97200d4de970ae9656b94b59acd348018aab71ebf457ab4d0386bf b/.pnpm-store/v11/files/4e/e8f9ff2912dea80ab92b3176d259015396021b09e18e521eecb445ae9506963577b162fe97200d4de970ae9656b94b59acd348018aab71ebf457ab4d0386bf new file mode 100644 index 0000000..9424c3b --- /dev/null +++ b/.pnpm-store/v11/files/4e/e8f9ff2912dea80ab92b3176d259015396021b09e18e521eecb445ae9506963577b162fe97200d4de970ae9656b94b59acd348018aab71ebf457ab4d0386bf @@ -0,0 +1,47 @@ +{ + "name": "vue-demi", + "version": "0.14.10", + "engines": { + "node": ">=12" + }, + "repository": "https://github.com/antfu/vue-demi.git", + "funding": "https://github.com/sponsors/antfu", + "license": "MIT", + "author": "Anthony Fu ", + "main": "lib/index.cjs", + "jsdelivr": "lib/index.iife.js", + "unpkg": "lib/index.iife.js", + "module": "lib/index.mjs", + "types": "lib/index.d.ts", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "require": "./lib/index.cjs", + "import": "./lib/index.mjs", + "browser": "./lib/index.mjs" + }, + "./*": "./*" + }, + "bin": { + "vue-demi-fix": "bin/vue-demi-fix.js", + "vue-demi-switch": "bin/vue-demi-switch.js" + }, + "files": [ + "lib", + "bin", + "scripts" + ], + "scripts": { + "postinstall": "node -e \"try{require('./scripts/postinstall.js')}catch(e){}\"", + "release": "npx bumpp --tag --commit --push && npm publish" + }, + "peerDependencies": { + "@vue/composition-api": "^1.0.0-rc.1", + "vue": "^3.0.0-0 || ^2.6.0" + }, + "peerDependenciesMeta": { + "@vue/composition-api": { + "optional": true + } + } +} diff --git a/.pnpm-store/v11/files/4f/42460fa0a143e2d7276b30fcb8a61872173ee58eec6012e25aac8b966c6277fdd0663c8a3191a46940080b087b51fe1e63dbef953a00be5911565dff33787e b/.pnpm-store/v11/files/4f/42460fa0a143e2d7276b30fcb8a61872173ee58eec6012e25aac8b966c6277fdd0663c8a3191a46940080b087b51fe1e63dbef953a00be5911565dff33787e new file mode 100644 index 0000000..7fb9bc9 --- /dev/null +++ b/.pnpm-store/v11/files/4f/42460fa0a143e2d7276b30fcb8a61872173ee58eec6012e25aac8b966c6277fdd0663c8a3191a46940080b087b51fe1e63dbef953a00be5911565dff33787e @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017-present Devon Govett + +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. diff --git a/.pnpm-store/v11/files/4f/4332661b2139dce0ea14f9c4a399d447deeef193a1a9672d9f1fc26b11673a0b1168e239668578fede14aec620b5b5c2c4e017717d4530c549460e80030187 b/.pnpm-store/v11/files/4f/4332661b2139dce0ea14f9c4a399d447deeef193a1a9672d9f1fc26b11673a0b1168e239668578fede14aec620b5b5c2c4e017717d4530c549460e80030187 new file mode 100644 index 0000000..eabce1e --- /dev/null +++ b/.pnpm-store/v11/files/4f/4332661b2139dce0ea14f9c4a399d447deeef193a1a9672d9f1fc26b11673a0b1168e239668578fede14aec620b5b5c2c4e017717d4530c549460e80030187 @@ -0,0 +1,282 @@ +#include +#include +#include "../DirTree.hh" +#include "../shared/BruteForceBackend.hh" +#include "./WindowsBackend.hh" +#include "./win_utils.hh" + +#define DEFAULT_BUF_SIZE 1024 * 1024 +#define NETWORK_BUF_SIZE 64 * 1024 +#define CONVERT_TIME(ft) ULARGE_INTEGER{ft.dwLowDateTime, ft.dwHighDateTime}.QuadPart + +void BruteForceBackend::readTree(WatcherRef watcher, std::shared_ptr tree) { + std::stack directories; + + directories.push(watcher->mDir); + + while (!directories.empty()) { + HANDLE hFind = INVALID_HANDLE_VALUE; + + std::string path = directories.top(); + std::string spec = path + "\\*"; + directories.pop(); + + WIN32_FIND_DATA ffd; + hFind = FindFirstFile(spec.c_str(), &ffd); + + if (hFind == INVALID_HANDLE_VALUE) { + if (path == watcher->mDir) { + FindClose(hFind); + throw WatcherError("Error opening directory", watcher); + } + + tree->remove(path); + continue; + } + + do { + if (strcmp(ffd.cFileName, ".") != 0 && strcmp(ffd.cFileName, "..") != 0) { + std::string fullPath = path + "\\" + ffd.cFileName; + if (watcher->isIgnored(fullPath)) { + continue; + } + + tree->add(fullPath, CONVERT_TIME(ffd.ftLastWriteTime), ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY); + if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { + directories.push(fullPath); + } + } + } while (FindNextFile(hFind, &ffd) != 0); + + FindClose(hFind); + } +} + +void WindowsBackend::start() { + mRunning = true; + notifyStarted(); + + while (mRunning) { + SleepEx(INFINITE, true); + } +} + +WindowsBackend::~WindowsBackend() { + // Mark as stopped, and queue a noop function in the thread to break the loop + mRunning = false; + QueueUserAPC([](__in ULONG_PTR) {}, mThread.native_handle(), (ULONG_PTR)this); +} + +class Subscription: public WatcherState { +public: + Subscription(WindowsBackend *backend, WatcherRef watcher, std::shared_ptr tree) { + mRunning = true; + mBackend = backend; + mWatcher = watcher; + mTree = tree; + ZeroMemory(&mOverlapped, sizeof(OVERLAPPED)); + mOverlapped.hEvent = this; + mReadBuffer.resize(DEFAULT_BUF_SIZE); + mWriteBuffer.resize(DEFAULT_BUF_SIZE); + + mDirectoryHandle = CreateFileW( + utf8ToUtf16(watcher->mDir).data(), + FILE_LIST_DIRECTORY, + FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + NULL, + OPEN_EXISTING, + FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OVERLAPPED, + NULL + ); + + if (mDirectoryHandle == INVALID_HANDLE_VALUE) { + throw WatcherError("Invalid handle", mWatcher); + } + + // Ensure that the path is a directory + BY_HANDLE_FILE_INFORMATION info; + bool success = GetFileInformationByHandle( + mDirectoryHandle, + &info + ); + + if (!success) { + throw WatcherError("Could not get file information", mWatcher); + } + + if (!(info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { + throw WatcherError("Not a directory", mWatcher); + } + } + + virtual ~Subscription() { + stop(); + } + + void run() { + try { + poll(); + } catch (WatcherError &err) { + mBackend->handleWatcherError(err); + } + } + + void stop() { + if (mRunning) { + mRunning = false; + CancelIo(mDirectoryHandle); + CloseHandle(mDirectoryHandle); + } + } + + void poll() { + if (!mRunning) { + return; + } + + // Asynchronously wait for changes. + int success = ReadDirectoryChangesW( + mDirectoryHandle, + mWriteBuffer.data(), + static_cast(mWriteBuffer.size()), + TRUE, // recursive + FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_DIR_NAME | FILE_NOTIFY_CHANGE_ATTRIBUTES + | FILE_NOTIFY_CHANGE_SIZE | FILE_NOTIFY_CHANGE_LAST_WRITE, + NULL, + &mOverlapped, + [](DWORD errorCode, DWORD numBytes, LPOVERLAPPED overlapped) { + auto subscription = reinterpret_cast(overlapped->hEvent); + try { + subscription->processEvents(errorCode); + } catch (WatcherError &err) { + subscription->mBackend->handleWatcherError(err); + } + } + ); + + if (!success) { + throw WatcherError("Failed to read changes", mWatcher); + } + } + + void processEvents(DWORD errorCode) { + if (!mRunning) { + return; + } + + switch (errorCode) { + case ERROR_OPERATION_ABORTED: + return; + case ERROR_INVALID_PARAMETER: + // resize buffers to network size (64kb), and try again + mReadBuffer.resize(NETWORK_BUF_SIZE); + mWriteBuffer.resize(NETWORK_BUF_SIZE); + poll(); + return; + case ERROR_NOTIFY_ENUM_DIR: + throw WatcherError("Buffer overflow. Some events may have been lost.", mWatcher); + case ERROR_ACCESS_DENIED: { + // This can happen if the watched directory is deleted. Check if that is the case, + // and if so emit a delete event. Otherwise, fall through to default error case. + DWORD attrs = GetFileAttributesW(utf8ToUtf16(mWatcher->mDir).data()); + bool isDir = attrs != INVALID_FILE_ATTRIBUTES && (attrs & FILE_ATTRIBUTE_DIRECTORY); + if (!isDir) { + mWatcher->mEvents.remove(mWatcher->mDir); + mTree->remove(mWatcher->mDir); + mWatcher->notify(); + stop(); + return; + } + } + default: + if (errorCode != ERROR_SUCCESS) { + throw WatcherError("Unknown error", mWatcher); + } + } + + // Swap read and write buffers, and poll again + std::swap(mWriteBuffer, mReadBuffer); + poll(); + + // Read change events + BYTE *base = mReadBuffer.data(); + while (true) { + PFILE_NOTIFY_INFORMATION info = (PFILE_NOTIFY_INFORMATION)base; + processEvent(info); + + if (info->NextEntryOffset == 0) { + break; + } + + base += info->NextEntryOffset; + } + + mWatcher->notify(); + } + + void processEvent(PFILE_NOTIFY_INFORMATION info) { + std::string path = mWatcher->mDir + "\\" + utf16ToUtf8(info->FileName, info->FileNameLength / sizeof(WCHAR)); + if (mWatcher->isIgnored(path)) { + return; + } + + switch (info->Action) { + case FILE_ACTION_ADDED: + case FILE_ACTION_RENAMED_NEW_NAME: { + WIN32_FILE_ATTRIBUTE_DATA data; + if (GetFileAttributesExW(utf8ToUtf16(path).data(), GetFileExInfoStandard, &data)) { + mWatcher->mEvents.create(path); + mTree->add(path, CONVERT_TIME(data.ftLastWriteTime), data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY); + } + break; + } + case FILE_ACTION_MODIFIED: { + WIN32_FILE_ATTRIBUTE_DATA data; + if (GetFileAttributesExW(utf8ToUtf16(path).data(), GetFileExInfoStandard, &data)) { + mTree->update(path, CONVERT_TIME(data.ftLastWriteTime)); + if (!(data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { + mWatcher->mEvents.update(path); + } + } + break; + } + case FILE_ACTION_REMOVED: + case FILE_ACTION_RENAMED_OLD_NAME: + mWatcher->mEvents.remove(path); + mTree->remove(path); + break; + } + } + +private: + WindowsBackend *mBackend; + std::shared_ptr mWatcher; + std::shared_ptr mTree; + bool mRunning; + HANDLE mDirectoryHandle; + std::vector mReadBuffer; + std::vector mWriteBuffer; + OVERLAPPED mOverlapped; +}; + +// This function is called by Backend::watch which takes a lock on mMutex +void WindowsBackend::subscribe(WatcherRef watcher) { + // Create a subscription for this watcher + auto sub = std::make_shared(this, watcher, getTree(watcher, false)); + watcher->state = sub; + + // Queue polling for this subscription in the correct thread. + bool success = QueueUserAPC([](__in ULONG_PTR ptr) { + Subscription *sub = (Subscription *)ptr; + sub->run(); + }, mThread.native_handle(), (ULONG_PTR)sub.get()); + + if (!success) { + throw std::runtime_error("Unable to queue APC"); + } +} + +// This function is called by Backend::unwatch which takes a lock on mMutex +void WindowsBackend::unsubscribe(WatcherRef watcher) { + watcher->state = nullptr; +} diff --git a/.pnpm-store/v11/files/50/4025a5d7807950de72a404d1113afde5eb29f826fc52d1406f8bba4e91a7425c0b8a64faed15296ed382da25cc6d0e27303577b76ccf69ad6cf57a40993a4b b/.pnpm-store/v11/files/50/4025a5d7807950de72a404d1113afde5eb29f826fc52d1406f8bba4e91a7425c0b8a64faed15296ed382da25cc6d0e27303577b76ccf69ad6cf57a40993a4b new file mode 100644 index 0000000..a442f16 --- /dev/null +++ b/.pnpm-store/v11/files/50/4025a5d7807950de72a404d1113afde5eb29f826fc52d1406f8bba4e91a7425c0b8a64faed15296ed382da25cc6d0e27303577b76ccf69ad6cf57a40993a4b @@ -0,0 +1,342 @@ +#include +#include +#include +#include +#include "../DirTree.hh" +#include "../Event.hh" +#include "./BSER.hh" +#include "./WatchmanBackend.hh" + +#ifdef _WIN32 +#include "../windows/win_utils.hh" +#define S_ISDIR(mode) ((mode & _S_IFDIR) == _S_IFDIR) +#define popen _popen +#define pclose _pclose +#else +#include +#define normalizePath(dir) dir +#endif + +template +BSER readBSER(T &&do_read) { + std::stringstream oss; + char buffer[256]; + size_t r; + int64_t len = -1; + do { + // Start by reading a minimal amount of data in order to decode the length. + // After that, attempt to read the remaining length, up to the buffer size. + r = do_read(buffer, len == -1 ? 20 : (len < 256 ? len : 256)); + oss << std::string(buffer, r); + + if (len == -1) { + uint64_t l = BSER::decodeLength(oss); + len = l + oss.tellg(); + } + + len -= r; + } while (len > 0); + + return BSER(oss); +} + +std::string getSockPath() { + auto var = getenv("WATCHMAN_SOCK"); + if (var && *var) { + return std::string(var); + } + +#ifdef _WIN32 + FILE *fp = popen("watchman --output-encoding=bser get-sockname", "r"); +#else + FILE *fp = popen("watchman --output-encoding=bser get-sockname 2>/dev/null", "r"); +#endif + if (fp == NULL || errno == ECHILD) { + throw std::runtime_error("Failed to execute watchman"); + } + + BSER b = readBSER([fp] (char *buf, size_t len) { + return fread(buf, sizeof(char), len, fp); + }); + + pclose(fp); + + auto objValue = b.objectValue(); + auto foundSockname = objValue.find("sockname"); + if (foundSockname == objValue.end()) { + throw std::runtime_error("sockname not found"); + } + return foundSockname->second.stringValue(); +} + +std::unique_ptr watchmanConnect() { + std::string path = getSockPath(); + return std::unique_ptr(new IPC(path)); +} + +BSER watchmanRead(IPC *ipc) { + return readBSER([ipc] (char *buf, size_t len) { + return ipc->read(buf, len); + }); +} + +BSER::Object WatchmanBackend::watchmanRequest(BSER b) { + std::string cmd = b.encode(); + mIPC->write(cmd); + mRequestSignal.notify(); + + mResponseSignal.wait(); + mResponseSignal.reset(); + + if (!mError.empty()) { + std::runtime_error err = std::runtime_error(mError); + mError = std::string(); + throw err; + } + + return mResponse; +} + +void WatchmanBackend::watchmanWatch(std::string dir) { + std::vector cmd; + cmd.push_back("watch"); + cmd.push_back(normalizePath(dir)); + watchmanRequest(cmd); +} + +bool WatchmanBackend::checkAvailable() { + try { + watchmanConnect(); + return true; + } catch (std::exception&) { + return false; + } +} + +void handleFiles(WatcherRef watcher, BSER::Object obj) { + auto found = obj.find("files"); + if (found == obj.end()) { + throw WatcherError("Error reading changes from watchman", watcher); + } + + auto files = found->second.arrayValue(); + for (auto it = files.begin(); it != files.end(); it++) { + auto file = it->objectValue(); + auto name = file.find("name")->second.stringValue(); + #ifdef _WIN32 + std::replace(name.begin(), name.end(), '/', '\\'); + #endif + auto mode = file.find("mode")->second.intValue(); + auto isNew = file.find("new")->second.boolValue(); + auto exists = file.find("exists")->second.boolValue(); + auto path = watcher->mDir + DIR_SEP + name; + if (watcher->isIgnored(path)) { + continue; + } + + if (isNew && exists) { + watcher->mEvents.create(path); + } else if (exists && !S_ISDIR(mode)) { + watcher->mEvents.update(path); + } else if (!isNew && !exists) { + watcher->mEvents.remove(path); + } + } +} + +void WatchmanBackend::handleSubscription(BSER::Object obj) { + std::unique_lock lock(mMutex); + auto subscription = obj.find("subscription")->second.stringValue(); + auto it = mSubscriptions.find(subscription); + if (it == mSubscriptions.end()) { + return; + } + + auto watcher = it->second; + try { + handleFiles(watcher, obj); + watcher->notify(); + } catch (WatcherError &err) { + handleWatcherError(err); + } +} + +void WatchmanBackend::start() { + mIPC = watchmanConnect(); + notifyStarted(); + + while (true) { + // If there are no subscriptions we are reading, wait for a request. + if (mSubscriptions.size() == 0) { + mRequestSignal.wait(); + mRequestSignal.reset(); + } + + // Break out of loop if we are stopped. + if (mStopped) { + break; + } + + // Attempt to read from the socket. + // If there is an error and we are stopped, break. + BSER b; + try { + b = watchmanRead(&*mIPC); + } catch (std::exception &err) { + if (mStopped) { + break; + } else if (mResponseSignal.isWaiting()) { + mError = err.what(); + mResponseSignal.notify(); + } else { + // Throwing causes the backend to be destroyed, but we never reach the code below to notify the signal + mEndedSignal.notify(); + throw; + } + } + + auto obj = b.objectValue(); + auto error = obj.find("error"); + if (error != obj.end()) { + mError = error->second.stringValue(); + mResponseSignal.notify(); + continue; + } + + // If this message is for a subscription, handle it, otherwise notify the request. + auto subscription = obj.find("subscription"); + if (subscription != obj.end()) { + handleSubscription(obj); + } else { + mResponse = obj; + mResponseSignal.notify(); + } + } + + mEndedSignal.notify(); +} + +WatchmanBackend::~WatchmanBackend() { + // Mark the watcher as stopped, close the socket, and trigger the lock. + // This will cause the read loop to be broken and the thread to exit. + mStopped = true; + mIPC.reset(); + mRequestSignal.notify(); + + // If not ended yet, wait. + mEndedSignal.wait(); +} + +std::string WatchmanBackend::clock(WatcherRef watcher) { + BSER::Array cmd; + cmd.push_back("clock"); + cmd.push_back(normalizePath(watcher->mDir)); + + BSER::Object obj = watchmanRequest(cmd); + auto found = obj.find("clock"); + if (found == obj.end()) { + throw WatcherError("Error reading clock from watchman", watcher); + } + + return found->second.stringValue(); +} + +void WatchmanBackend::writeSnapshot(WatcherRef watcher, std::string *snapshotPath) { + std::unique_lock lock(mMutex); + watchmanWatch(watcher->mDir); + + std::ofstream ofs(*snapshotPath); + ofs << clock(watcher); +} + +void WatchmanBackend::getEventsSince(WatcherRef watcher, std::string *snapshotPath) { + std::unique_lock lock(mMutex); + std::ifstream ifs(*snapshotPath); + if (ifs.fail()) { + return; + } + + watchmanWatch(watcher->mDir); + + std::string clock; + ifs >> clock; + + BSER::Array cmd; + cmd.push_back("since"); + cmd.push_back(normalizePath(watcher->mDir)); + cmd.push_back(clock); + + BSER::Object obj = watchmanRequest(cmd); + handleFiles(watcher, obj); +} + +std::string getId(WatcherRef watcher) { + std::ostringstream id; + id << "parcel-"; + id << static_cast(watcher.get()); + return id.str(); +} + +// This function is called by Backend::watch which takes a lock on mMutex +void WatchmanBackend::subscribe(WatcherRef watcher) { + watchmanWatch(watcher->mDir); + + std::string id = getId(watcher); + BSER::Array cmd; + cmd.push_back("subscribe"); + cmd.push_back(normalizePath(watcher->mDir)); + cmd.push_back(id); + + BSER::Array fields; + fields.push_back("name"); + fields.push_back("mode"); + fields.push_back("exists"); + fields.push_back("new"); + + BSER::Object opts; + opts.emplace("fields", fields); + opts.emplace("since", clock(watcher)); + + if (watcher->mIgnorePaths.size() > 0) { + BSER::Array ignore; + BSER::Array anyOf; + anyOf.push_back("anyof"); + + for (auto it = watcher->mIgnorePaths.begin(); it != watcher->mIgnorePaths.end(); it++) { + std::string pathStart = watcher->mDir + DIR_SEP; + if (it->rfind(pathStart, 0) == 0) { + auto relative = it->substr(pathStart.size()); + BSER::Array dirname; + dirname.push_back("dirname"); + dirname.push_back(relative); + anyOf.push_back(dirname); + } + } + + ignore.push_back("not"); + ignore.push_back(anyOf); + + opts.emplace("expression", ignore); + } + + cmd.push_back(opts); + watchmanRequest(cmd); + + mSubscriptions.emplace(id, watcher); + mRequestSignal.notify(); +} + +// This function is called by Backend::unwatch which takes a lock on mMutex +void WatchmanBackend::unsubscribe(WatcherRef watcher) { + std::string id = getId(watcher); + auto erased = mSubscriptions.erase(id); + + if (erased) { + BSER::Array cmd; + cmd.push_back("unsubscribe"); + cmd.push_back(normalizePath(watcher->mDir)); + cmd.push_back(id); + + watchmanRequest(cmd); + } +} diff --git a/.pnpm-store/v11/files/56/41d2ea1b0de1bd21c0f87377c4da00cf5d385347df5ac80d846e331e53fb4c161042fd5ba7beec1d5d1dc111d0ab3371cb872e863d0bfe27e933ca5dd1f4b3 b/.pnpm-store/v11/files/56/41d2ea1b0de1bd21c0f87377c4da00cf5d385347df5ac80d846e331e53fb4c161042fd5ba7beec1d5d1dc111d0ab3371cb872e863d0bfe27e933ca5dd1f4b3 new file mode 100644 index 0000000..8fa3b68 --- /dev/null +++ b/.pnpm-store/v11/files/56/41d2ea1b0de1bd21c0f87377c4da00cf5d385347df5ac80d846e331e53fb4c161042fd5ba7beec1d5d1dc111d0ab3371cb872e863d0bfe27e933ca5dd1f4b3 @@ -0,0 +1,60 @@ +var VueModule = require('vue') + +// get the real Vue https://github.com/vueuse/vue-demi/issues/192 +var Vue = VueModule.default || VueModule + +exports.Vue = Vue +exports.Vue2 = Vue +exports.isVue2 = true +exports.isVue3 = false +exports.install = function () {} +exports.warn = Vue.util.warn + +// createApp polyfill +exports.createApp = function (rootComponent, rootProps) { + var vm + var provide = {} + var app = { + config: Vue.config, + use: Vue.use.bind(Vue), + mixin: Vue.mixin.bind(Vue), + component: Vue.component.bind(Vue), + provide: function (key, value) { + provide[key] = value + return this + }, + directive: function (name, dir) { + if (dir) { + Vue.directive(name, dir) + return app + } else { + return Vue.directive(name) + } + }, + mount: function (el, hydrating) { + if (!vm) { + vm = new Vue(Object.assign({ propsData: rootProps }, rootComponent, { provide: Object.assign(provide, rootComponent.provide) })) + vm.$mount(el, hydrating) + return vm + } else { + return vm + } + }, + unmount: function () { + if (vm) { + vm.$destroy() + vm = undefined + } + }, + } + return app +} + +Object.keys(VueModule).forEach(function (key) { + exports[key] = VueModule[key] +}) + +// Not implemented https://github.com/vuejs/core/pull/8111, falls back to getCurrentInstance() +exports.hasInjectionContext = function() { + return !!VueModule.getCurrentInstance() +} \ No newline at end of file diff --git a/.pnpm-store/v11/files/57/b832e54bf445c52195f380262b829ec57de56b5b606a073d391bcc8ae8a6dcdd2c6f75b646e5d893fa4fbbd0d90725279e879a17d55086563cd540a14cd767 b/.pnpm-store/v11/files/57/b832e54bf445c52195f380262b829ec57de56b5b606a073d391bcc8ae8a6dcdd2c6f75b646e5d893fa4fbbd0d90725279e879a17d55086563cd540a14cd767 new file mode 100644 index 0000000..d75da93 --- /dev/null +++ b/.pnpm-store/v11/files/57/b832e54bf445c52195f380262b829ec57de56b5b606a073d391bcc8ae8a6dcdd2c6f75b646e5d893fa4fbbd0d90725279e879a17d55086563cd540a14cd767 @@ -0,0 +1,48 @@ +// @flow +declare type FilePath = string; +declare type GlobPattern = string; + +export type BackendType = + | 'fs-events' + | 'watchman' + | 'inotify' + | 'windows' + | 'brute-force'; +export type EventType = 'create' | 'update' | 'delete'; +export interface Options { + ignore?: Array, + backend?: BackendType +} +export type SubscribeCallback = ( + err: ?Error, + events: Array +) => mixed; +export interface AsyncSubscription { + unsubscribe(): Promise +} +export interface Event { + path: FilePath, + type: EventType +} +declare module.exports: { + getEventsSince( + dir: FilePath, + snapshot: FilePath, + opts?: Options + ): Promise>, + subscribe( + dir: FilePath, + fn: SubscribeCallback, + opts?: Options + ): Promise, + unsubscribe( + dir: FilePath, + fn: SubscribeCallback, + opts?: Options + ): Promise, + writeSnapshot( + dir: FilePath, + snapshot: FilePath, + opts?: Options + ): Promise +} \ No newline at end of file diff --git a/.pnpm-store/v11/files/5b/b99acc9a0f74b3c4ca7153d725f924b3331a83c497c5330ff99522ecd857afbaa6999cde97f4d123749673ba0c40a71d1139bf6bd528750c31a106c00046dc b/.pnpm-store/v11/files/5b/b99acc9a0f74b3c4ca7153d725f924b3331a83c497c5330ff99522ecd857afbaa6999cde97f4d123749673ba0c40a71d1139bf6bd528750c31a106c00046dc new file mode 100644 index 0000000..8197f90 --- /dev/null +++ b/.pnpm-store/v11/files/5b/b99acc9a0f74b3c4ca7153d725f924b3331a83c497c5330ff99522ecd857afbaa6999cde97f4d123749673ba0c40a71d1139bf6bd528750c31a106c00046dc @@ -0,0 +1,29 @@ +var Vue = require('vue') + +Object.keys(Vue).forEach(function(key) { + exports[key] = Vue[key] +}) + +exports.set = function(target, key, val) { + if (Array.isArray(target)) { + target.length = Math.max(target.length, key) + target.splice(key, 1, val) + return val + } + target[key] = val + return val +} + +exports.del = function(target, key) { + if (Array.isArray(target)) { + target.splice(key, 1) + return + } + delete target[key] +} + +exports.Vue = Vue +exports.Vue2 = undefined +exports.isVue2 = false +exports.isVue3 = true +exports.install = function(){} diff --git a/.pnpm-store/v11/files/5d/48a346c29f1453173615bfb225d8d4422a36fe4ec3a64cd4c09ac8deee6b9c71da15672fb2ea680d114eeae50c3130e67cf44f366def4750d1846c2ad39256 b/.pnpm-store/v11/files/5d/48a346c29f1453173615bfb225d8d4422a36fe4ec3a64cd4c09ac8deee6b9c71da15672fb2ea680d114eeae50c3130e67cf44f366def4750d1846c2ad39256 new file mode 100644 index 0000000..8d09712 --- /dev/null +++ b/.pnpm-store/v11/files/5d/48a346c29f1453173615bfb225d8d4422a36fe4ec3a64cd4c09ac8deee6b9c71da15672fb2ea680d114eeae50c3130e67cf44f366def4750d1846c2ad39256 @@ -0,0 +1,109 @@ +#ifndef EVENT_H +#define EVENT_H + +#include +#include +#include "wasm/include.h" +#include +#include +#include +#include + +using namespace Napi; + +struct Event { + std::string path; + bool isCreated; + bool isDeleted; + Event(std::string path) : path(path), isCreated(false), isDeleted(false) {} + + Value toJS(const Env& env) { + EscapableHandleScope scope(env); + Object res = Object::New(env); + std::string type = isCreated ? "create" : isDeleted ? "delete" : "update"; + res.Set(String::New(env, "path"), String::New(env, path.c_str())); + res.Set(String::New(env, "type"), String::New(env, type.c_str())); + return scope.Escape(res); + } +}; + +class EventList { +public: + void create(std::string path) { + std::lock_guard l(mMutex); + Event *event = internalUpdate(path); + if (event->isDeleted) { + // Assume update event when rapidly removed and created + // https://github.com/parcel-bundler/watcher/issues/72 + event->isDeleted = false; + } else { + event->isCreated = true; + } + } + + Event *update(std::string path) { + std::lock_guard l(mMutex); + return internalUpdate(path); + } + + void remove(std::string path) { + std::lock_guard l(mMutex); + Event *event = internalUpdate(path); + event->isDeleted = true; + } + + size_t size() { + std::lock_guard l(mMutex); + return mEvents.size(); + } + + std::vector getEvents() { + std::lock_guard l(mMutex); + std::vector eventsCloneVector; + for(auto it = mEvents.begin(); it != mEvents.end(); ++it) { + if (!(it->second.isCreated && it->second.isDeleted)) { + eventsCloneVector.push_back(it->second); + } + } + return eventsCloneVector; + } + + void clear() { + std::lock_guard l(mMutex); + mEvents.clear(); + mError.reset(); + } + + void error(std::string err) { + std::lock_guard l(mMutex); + if (!mError.has_value()) { + mError.emplace(err); + } + } + + bool hasError() { + std::lock_guard l(mMutex); + return mError.has_value(); + } + + std::string getError() { + std::lock_guard l(mMutex); + return mError.value_or(""); + } + +private: + mutable std::mutex mMutex; + std::map mEvents; + std::optional mError; + Event *internalUpdate(std::string path) { + auto found = mEvents.find(path); + if (found == mEvents.end()) { + auto it = mEvents.emplace(path, Event(path)); + return &it.first->second; + } + + return &found->second; + } +}; + +#endif diff --git a/.pnpm-store/v11/files/5f/3147d494577e5db6b5442145b5b9e0d6ce4fb3a9741a797348bfa7d9abeea2ab7c1c06f0e872449eb11b6be8605dc106aaf9434eec03f2226b105950f19633 b/.pnpm-store/v11/files/5f/3147d494577e5db6b5442145b5b9e0d6ce4fb3a9741a797348bfa7d9abeea2ab7c1c06f0e872449eb11b6be8605dc106aaf9434eec03f2226b105950f19633 new file mode 100644 index 0000000..328f469 --- /dev/null +++ b/.pnpm-store/v11/files/5f/3147d494577e5db6b5442145b5b9e0d6ce4fb3a9741a797348bfa7d9abeea2ab7c1c06f0e872449eb11b6be8605dc106aaf9434eec03f2226b105950f19633 @@ -0,0 +1,50 @@ +#ifndef DIR_TREE_H +#define DIR_TREE_H + +#include +#include +#include +#include "Event.hh" + +#ifdef _WIN32 +#define DIR_SEP "\\" +#else +#define DIR_SEP "/" +#endif + +struct DirEntry { + std::string path; + uint64_t mtime; + bool isDir; + mutable void *state; + + DirEntry(std::string p, uint64_t t, bool d); + DirEntry(FILE *f); + void write(FILE *f) const; + bool operator==(const DirEntry &other) const { + return path == other.path; + } +}; + +class DirTree { +public: + static std::shared_ptr getCached(std::string root); + DirTree(std::string root) : root(root), isComplete(false) {} + DirTree(std::string root, FILE *f); + DirEntry *add(std::string path, uint64_t mtime, bool isDir); + DirEntry *find(std::string path); + DirEntry *update(std::string path, uint64_t mtime); + void remove(std::string path); + void write(FILE *f); + void getChanges(DirTree *snapshot, EventList &events); + + std::mutex mMutex; + std::string root; + bool isComplete; + std::unordered_map entries; + +private: + DirEntry *_find(std::string path); +}; + +#endif diff --git a/.pnpm-store/v11/files/65/05ee63a04448ddd36ed221bd829b24f0eb006c815a503373b6e1216e439946897af88a28d73b08993e2329b96453e441de9368238168f7be6e5f1033e17b39 b/.pnpm-store/v11/files/65/05ee63a04448ddd36ed221bd829b24f0eb006c815a503373b6e1216e439946897af88a28d73b08993e2329b96453e441de9368238168f7be6e5f1033e17b39 new file mode 100644 index 0000000..f89e9f5 --- /dev/null +++ b/.pnpm-store/v11/files/65/05ee63a04448ddd36ed221bd829b24f0eb006c815a503373b6e1216e439946897af88a28d73b08993e2329b96453e441de9368238168f7be6e5f1033e17b39 @@ -0,0 +1,73 @@ +#ifndef WATCHER_H +#define WATCHER_H + +#include +#include +#include +#include +#include "Glob.hh" +#include "Event.hh" +#include "Debounce.hh" +#include "DirTree.hh" +#include "Signal.hh" + +using namespace Napi; + +struct Watcher; +using WatcherRef = std::shared_ptr; + +struct Callback { + Napi::ThreadSafeFunction tsfn; + Napi::FunctionReference ref; + std::thread::id threadId; +}; + +class WatcherState { +public: + virtual ~WatcherState() = default; +}; + +struct Watcher { + std::string mDir; + std::unordered_set mIgnorePaths; + std::unordered_set mIgnoreGlobs; + EventList mEvents; + std::shared_ptr state; + + Watcher(std::string dir, std::unordered_set ignorePaths, std::unordered_set ignoreGlobs); + ~Watcher(); + + bool operator==(const Watcher &other) const { + return mDir == other.mDir && mIgnorePaths == other.mIgnorePaths && mIgnoreGlobs == other.mIgnoreGlobs; + } + + void wait(); + void notify(); + void notifyError(std::exception &err); + bool watch(Function callback); + bool unwatch(Function callback); + void unref(); + bool isIgnored(std::string path); + void destroy(); + + static WatcherRef getShared(std::string dir, std::unordered_set ignorePaths, std::unordered_set ignoreGlobs); + +private: + std::mutex mMutex; + std::condition_variable mCond; + std::vector mCallbacks; + std::shared_ptr mDebounce; + + std::vector::iterator findCallback(Function callback); + void clearCallbacks(); + void triggerCallbacks(); +}; + +class WatcherError : public std::runtime_error { +public: + WatcherRef mWatcher; + WatcherError(std::string msg, WatcherRef watcher) : std::runtime_error(msg), mWatcher(watcher) {} + WatcherError(const char *msg, WatcherRef watcher) : std::runtime_error(msg), mWatcher(watcher) {} +}; + +#endif diff --git a/.pnpm-store/v11/files/68/c320d1d3c4677e1c190e94bf68d9fed201db145ca400dc98c058131ca7c716859c886ef434a9b7c21cb011a457b3159b7c9b00d7d39c90166e3cdece29067c b/.pnpm-store/v11/files/68/c320d1d3c4677e1c190e94bf68d9fed201db145ca400dc98c058131ca7c716859c886ef434a9b7c21cb011a457b3159b7c9b00d7d39c90166e3cdece29067c new file mode 100644 index 0000000..f34cd1f --- /dev/null +++ b/.pnpm-store/v11/files/68/c320d1d3c4677e1c190e94bf68d9fed201db145ca400dc98c058131ca7c716859c886ef434a9b7c21cb011a457b3159b7c9b00d7d39c90166e3cdece29067c @@ -0,0 +1,34 @@ +#ifndef INOTIFY_H +#define INOTIFY_H + +#include +#include +#include "../shared/BruteForceBackend.hh" +#include "../DirTree.hh" +#include "../Signal.hh" + +struct InotifySubscription { + std::shared_ptr tree; + std::string path; + WatcherRef watcher; +}; + +class InotifyBackend : public BruteForceBackend { +public: + void start() override; + ~InotifyBackend(); + void subscribe(WatcherRef watcher) override; + void unsubscribe(WatcherRef watcher) override; +private: + int mPipe[2]; + int mInotify; + std::unordered_multimap> mSubscriptions; + Signal mEndedSignal; + + bool watchDir(WatcherRef watcher, std::string path, std::shared_ptr tree); + void handleEvents(); + void handleEvent(struct inotify_event *event, std::unordered_set &watchers); + bool handleSubscription(struct inotify_event *event, std::shared_ptr sub); +}; + +#endif diff --git a/.pnpm-store/v11/files/6b/09167c96a84f51a1a19a5177f3fb5307591b41459bfbb1031779ae9091a3b1e2f0638a83f9006749a99fbecd7e586d56b36c71b4c94f6294b40a4399bf9485 b/.pnpm-store/v11/files/6b/09167c96a84f51a1a19a5177f3fb5307591b41459bfbb1031779ae9091a3b1e2f0638a83f9006749a99fbecd7e586d56b36c71b4c94f6294b40a4399bf9485 new file mode 100644 index 0000000..555613c --- /dev/null +++ b/.pnpm-store/v11/files/6b/09167c96a84f51a1a19a5177f3fb5307591b41459bfbb1031779ae9091a3b1e2f0638a83f9006749a99fbecd7e586d56b36c71b4c94f6294b40a4399bf9485 @@ -0,0 +1,2239 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// lib/npm/node.ts +var node_exports = {}; +__export(node_exports, { + analyzeMetafile: () => analyzeMetafile, + analyzeMetafileSync: () => analyzeMetafileSync, + build: () => build, + buildSync: () => buildSync, + context: () => context, + default: () => node_default, + formatMessages: () => formatMessages, + formatMessagesSync: () => formatMessagesSync, + initialize: () => initialize, + stop: () => stop, + transform: () => transform, + transformSync: () => transformSync, + version: () => version +}); +module.exports = __toCommonJS(node_exports); + +// lib/shared/stdio_protocol.ts +function encodePacket(packet) { + let visit = (value) => { + if (value === null) { + bb.write8(0); + } else if (typeof value === "boolean") { + bb.write8(1); + bb.write8(+value); + } else if (typeof value === "number") { + bb.write8(2); + bb.write32(value | 0); + } else if (typeof value === "string") { + bb.write8(3); + bb.write(encodeUTF8(value)); + } else if (value instanceof Uint8Array) { + bb.write8(4); + bb.write(value); + } else if (value instanceof Array) { + bb.write8(5); + bb.write32(value.length); + for (let item of value) { + visit(item); + } + } else { + let keys = Object.keys(value); + bb.write8(6); + bb.write32(keys.length); + for (let key of keys) { + bb.write(encodeUTF8(key)); + visit(value[key]); + } + } + }; + let bb = new ByteBuffer(); + bb.write32(0); + bb.write32(packet.id << 1 | +!packet.isRequest); + visit(packet.value); + writeUInt32LE(bb.buf, bb.len - 4, 0); + return bb.buf.subarray(0, bb.len); +} +function decodePacket(bytes) { + let visit = () => { + switch (bb.read8()) { + case 0: + return null; + case 1: + return !!bb.read8(); + case 2: + return bb.read32(); + case 3: + return decodeUTF8(bb.read()); + case 4: + return bb.read(); + case 5: { + let count = bb.read32(); + let value2 = []; + for (let i = 0; i < count; i++) { + value2.push(visit()); + } + return value2; + } + case 6: { + let count = bb.read32(); + let value2 = {}; + for (let i = 0; i < count; i++) { + value2[decodeUTF8(bb.read())] = visit(); + } + return value2; + } + default: + throw new Error("Invalid packet"); + } + }; + let bb = new ByteBuffer(bytes); + let id = bb.read32(); + let isRequest = (id & 1) === 0; + id >>>= 1; + let value = visit(); + if (bb.ptr !== bytes.length) { + throw new Error("Invalid packet"); + } + return { id, isRequest, value }; +} +var ByteBuffer = class { + constructor(buf = new Uint8Array(1024)) { + this.buf = buf; + this.len = 0; + this.ptr = 0; + } + _write(delta) { + if (this.len + delta > this.buf.length) { + let clone = new Uint8Array((this.len + delta) * 2); + clone.set(this.buf); + this.buf = clone; + } + this.len += delta; + return this.len - delta; + } + write8(value) { + let offset = this._write(1); + this.buf[offset] = value; + } + write32(value) { + let offset = this._write(4); + writeUInt32LE(this.buf, value, offset); + } + write(bytes) { + let offset = this._write(4 + bytes.length); + writeUInt32LE(this.buf, bytes.length, offset); + this.buf.set(bytes, offset + 4); + } + _read(delta) { + if (this.ptr + delta > this.buf.length) { + throw new Error("Invalid packet"); + } + this.ptr += delta; + return this.ptr - delta; + } + read8() { + return this.buf[this._read(1)]; + } + read32() { + return readUInt32LE(this.buf, this._read(4)); + } + read() { + let length = this.read32(); + let bytes = new Uint8Array(length); + let ptr = this._read(bytes.length); + bytes.set(this.buf.subarray(ptr, ptr + length)); + return bytes; + } +}; +var encodeUTF8; +var decodeUTF8; +var encodeInvariant; +if (typeof TextEncoder !== "undefined" && typeof TextDecoder !== "undefined") { + let encoder = new TextEncoder(); + let decoder = new TextDecoder(); + encodeUTF8 = (text) => encoder.encode(text); + decodeUTF8 = (bytes) => decoder.decode(bytes); + encodeInvariant = 'new TextEncoder().encode("")'; +} else if (typeof Buffer !== "undefined") { + encodeUTF8 = (text) => Buffer.from(text); + decodeUTF8 = (bytes) => { + let { buffer, byteOffset, byteLength } = bytes; + return Buffer.from(buffer, byteOffset, byteLength).toString(); + }; + encodeInvariant = 'Buffer.from("")'; +} else { + throw new Error("No UTF-8 codec found"); +} +if (!(encodeUTF8("") instanceof Uint8Array)) + throw new Error(`Invariant violation: "${encodeInvariant} instanceof Uint8Array" is incorrectly false + +This indicates that your JavaScript environment is broken. You cannot use +esbuild in this environment because esbuild relies on this invariant. This +is not a problem with esbuild. You need to fix your environment instead. +`); +function readUInt32LE(buffer, offset) { + return buffer[offset++] | buffer[offset++] << 8 | buffer[offset++] << 16 | buffer[offset++] << 24; +} +function writeUInt32LE(buffer, value, offset) { + buffer[offset++] = value; + buffer[offset++] = value >> 8; + buffer[offset++] = value >> 16; + buffer[offset++] = value >> 24; +} + +// lib/shared/common.ts +var quote = JSON.stringify; +var buildLogLevelDefault = "warning"; +var transformLogLevelDefault = "silent"; +function validateTarget(target) { + validateStringValue(target, "target"); + if (target.indexOf(",") >= 0) throw new Error(`Invalid target: ${target}`); + return target; +} +var canBeAnything = () => null; +var mustBeBoolean = (value) => typeof value === "boolean" ? null : "a boolean"; +var mustBeString = (value) => typeof value === "string" ? null : "a string"; +var mustBeRegExp = (value) => value instanceof RegExp ? null : "a RegExp object"; +var mustBeInteger = (value) => typeof value === "number" && value === (value | 0) ? null : "an integer"; +var mustBeFunction = (value) => typeof value === "function" ? null : "a function"; +var mustBeArray = (value) => Array.isArray(value) ? null : "an array"; +var mustBeObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value) ? null : "an object"; +var mustBeEntryPoints = (value) => typeof value === "object" && value !== null ? null : "an array or an object"; +var mustBeWebAssemblyModule = (value) => value instanceof WebAssembly.Module ? null : "a WebAssembly.Module"; +var mustBeObjectOrNull = (value) => typeof value === "object" && !Array.isArray(value) ? null : "an object or null"; +var mustBeStringOrBoolean = (value) => typeof value === "string" || typeof value === "boolean" ? null : "a string or a boolean"; +var mustBeStringOrObject = (value) => typeof value === "string" || typeof value === "object" && value !== null && !Array.isArray(value) ? null : "a string or an object"; +var mustBeStringOrArray = (value) => typeof value === "string" || Array.isArray(value) ? null : "a string or an array"; +var mustBeStringOrUint8Array = (value) => typeof value === "string" || value instanceof Uint8Array ? null : "a string or a Uint8Array"; +var mustBeStringOrURL = (value) => typeof value === "string" || value instanceof URL ? null : "a string or a URL"; +function getFlag(object, keys, key, mustBeFn) { + let value = object[key]; + keys[key + ""] = true; + if (value === void 0) return void 0; + let mustBe = mustBeFn(value); + if (mustBe !== null) throw new Error(`${quote(key)} must be ${mustBe}`); + return value; +} +function checkForInvalidFlags(object, keys, where) { + for (let key in object) { + if (!(key in keys)) { + throw new Error(`Invalid option ${where}: ${quote(key)}`); + } + } +} +function validateInitializeOptions(options) { + let keys = /* @__PURE__ */ Object.create(null); + let wasmURL = getFlag(options, keys, "wasmURL", mustBeStringOrURL); + let wasmModule = getFlag(options, keys, "wasmModule", mustBeWebAssemblyModule); + let worker = getFlag(options, keys, "worker", mustBeBoolean); + checkForInvalidFlags(options, keys, "in initialize() call"); + return { + wasmURL, + wasmModule, + worker + }; +} +function validateMangleCache(mangleCache) { + let validated; + if (mangleCache !== void 0) { + validated = /* @__PURE__ */ Object.create(null); + for (let key in mangleCache) { + let value = mangleCache[key]; + if (typeof value === "string" || value === false) { + validated[key] = value; + } else { + throw new Error(`Expected ${quote(key)} in mangle cache to map to either a string or false`); + } + } + } + return validated; +} +function pushLogFlags(flags, options, keys, isTTY2, logLevelDefault) { + let color = getFlag(options, keys, "color", mustBeBoolean); + let logLevel = getFlag(options, keys, "logLevel", mustBeString); + let logLimit = getFlag(options, keys, "logLimit", mustBeInteger); + if (color !== void 0) flags.push(`--color=${color}`); + else if (isTTY2) flags.push(`--color=true`); + flags.push(`--log-level=${logLevel || logLevelDefault}`); + flags.push(`--log-limit=${logLimit || 0}`); +} +function validateStringValue(value, what, key) { + if (typeof value !== "string") { + throw new Error(`Expected value for ${what}${key !== void 0 ? " " + quote(key) : ""} to be a string, got ${typeof value} instead`); + } + return value; +} +function pushCommonFlags(flags, options, keys) { + let legalComments = getFlag(options, keys, "legalComments", mustBeString); + let sourceRoot = getFlag(options, keys, "sourceRoot", mustBeString); + let sourcesContent = getFlag(options, keys, "sourcesContent", mustBeBoolean); + let target = getFlag(options, keys, "target", mustBeStringOrArray); + let format = getFlag(options, keys, "format", mustBeString); + let globalName = getFlag(options, keys, "globalName", mustBeString); + let mangleProps = getFlag(options, keys, "mangleProps", mustBeRegExp); + let reserveProps = getFlag(options, keys, "reserveProps", mustBeRegExp); + let mangleQuoted = getFlag(options, keys, "mangleQuoted", mustBeBoolean); + let minify = getFlag(options, keys, "minify", mustBeBoolean); + let minifySyntax = getFlag(options, keys, "minifySyntax", mustBeBoolean); + let minifyWhitespace = getFlag(options, keys, "minifyWhitespace", mustBeBoolean); + let minifyIdentifiers = getFlag(options, keys, "minifyIdentifiers", mustBeBoolean); + let lineLimit = getFlag(options, keys, "lineLimit", mustBeInteger); + let drop = getFlag(options, keys, "drop", mustBeArray); + let dropLabels = getFlag(options, keys, "dropLabels", mustBeArray); + let charset = getFlag(options, keys, "charset", mustBeString); + let treeShaking = getFlag(options, keys, "treeShaking", mustBeBoolean); + let ignoreAnnotations = getFlag(options, keys, "ignoreAnnotations", mustBeBoolean); + let jsx = getFlag(options, keys, "jsx", mustBeString); + let jsxFactory = getFlag(options, keys, "jsxFactory", mustBeString); + let jsxFragment = getFlag(options, keys, "jsxFragment", mustBeString); + let jsxImportSource = getFlag(options, keys, "jsxImportSource", mustBeString); + let jsxDev = getFlag(options, keys, "jsxDev", mustBeBoolean); + let jsxSideEffects = getFlag(options, keys, "jsxSideEffects", mustBeBoolean); + let define = getFlag(options, keys, "define", mustBeObject); + let logOverride = getFlag(options, keys, "logOverride", mustBeObject); + let supported = getFlag(options, keys, "supported", mustBeObject); + let pure = getFlag(options, keys, "pure", mustBeArray); + let keepNames = getFlag(options, keys, "keepNames", mustBeBoolean); + let platform = getFlag(options, keys, "platform", mustBeString); + let tsconfigRaw = getFlag(options, keys, "tsconfigRaw", mustBeStringOrObject); + if (legalComments) flags.push(`--legal-comments=${legalComments}`); + if (sourceRoot !== void 0) flags.push(`--source-root=${sourceRoot}`); + if (sourcesContent !== void 0) flags.push(`--sources-content=${sourcesContent}`); + if (target) { + if (Array.isArray(target)) flags.push(`--target=${Array.from(target).map(validateTarget).join(",")}`); + else flags.push(`--target=${validateTarget(target)}`); + } + if (format) flags.push(`--format=${format}`); + if (globalName) flags.push(`--global-name=${globalName}`); + if (platform) flags.push(`--platform=${platform}`); + if (tsconfigRaw) flags.push(`--tsconfig-raw=${typeof tsconfigRaw === "string" ? tsconfigRaw : JSON.stringify(tsconfigRaw)}`); + if (minify) flags.push("--minify"); + if (minifySyntax) flags.push("--minify-syntax"); + if (minifyWhitespace) flags.push("--minify-whitespace"); + if (minifyIdentifiers) flags.push("--minify-identifiers"); + if (lineLimit) flags.push(`--line-limit=${lineLimit}`); + if (charset) flags.push(`--charset=${charset}`); + if (treeShaking !== void 0) flags.push(`--tree-shaking=${treeShaking}`); + if (ignoreAnnotations) flags.push(`--ignore-annotations`); + if (drop) for (let what of drop) flags.push(`--drop:${validateStringValue(what, "drop")}`); + if (dropLabels) flags.push(`--drop-labels=${Array.from(dropLabels).map((what) => validateStringValue(what, "dropLabels")).join(",")}`); + if (mangleProps) flags.push(`--mangle-props=${mangleProps.source}`); + if (reserveProps) flags.push(`--reserve-props=${reserveProps.source}`); + if (mangleQuoted !== void 0) flags.push(`--mangle-quoted=${mangleQuoted}`); + if (jsx) flags.push(`--jsx=${jsx}`); + if (jsxFactory) flags.push(`--jsx-factory=${jsxFactory}`); + if (jsxFragment) flags.push(`--jsx-fragment=${jsxFragment}`); + if (jsxImportSource) flags.push(`--jsx-import-source=${jsxImportSource}`); + if (jsxDev) flags.push(`--jsx-dev`); + if (jsxSideEffects) flags.push(`--jsx-side-effects`); + if (define) { + for (let key in define) { + if (key.indexOf("=") >= 0) throw new Error(`Invalid define: ${key}`); + flags.push(`--define:${key}=${validateStringValue(define[key], "define", key)}`); + } + } + if (logOverride) { + for (let key in logOverride) { + if (key.indexOf("=") >= 0) throw new Error(`Invalid log override: ${key}`); + flags.push(`--log-override:${key}=${validateStringValue(logOverride[key], "log override", key)}`); + } + } + if (supported) { + for (let key in supported) { + if (key.indexOf("=") >= 0) throw new Error(`Invalid supported: ${key}`); + const value = supported[key]; + if (typeof value !== "boolean") throw new Error(`Expected value for supported ${quote(key)} to be a boolean, got ${typeof value} instead`); + flags.push(`--supported:${key}=${value}`); + } + } + if (pure) for (let fn of pure) flags.push(`--pure:${validateStringValue(fn, "pure")}`); + if (keepNames) flags.push(`--keep-names`); +} +function flagsForBuildOptions(callName, options, isTTY2, logLevelDefault, writeDefault) { + var _a2; + let flags = []; + let entries = []; + let keys = /* @__PURE__ */ Object.create(null); + let stdinContents = null; + let stdinResolveDir = null; + pushLogFlags(flags, options, keys, isTTY2, logLevelDefault); + pushCommonFlags(flags, options, keys); + let sourcemap = getFlag(options, keys, "sourcemap", mustBeStringOrBoolean); + let bundle = getFlag(options, keys, "bundle", mustBeBoolean); + let splitting = getFlag(options, keys, "splitting", mustBeBoolean); + let preserveSymlinks = getFlag(options, keys, "preserveSymlinks", mustBeBoolean); + let metafile = getFlag(options, keys, "metafile", mustBeBoolean); + let outfile = getFlag(options, keys, "outfile", mustBeString); + let outdir = getFlag(options, keys, "outdir", mustBeString); + let outbase = getFlag(options, keys, "outbase", mustBeString); + let tsconfig = getFlag(options, keys, "tsconfig", mustBeString); + let resolveExtensions = getFlag(options, keys, "resolveExtensions", mustBeArray); + let nodePathsInput = getFlag(options, keys, "nodePaths", mustBeArray); + let mainFields = getFlag(options, keys, "mainFields", mustBeArray); + let conditions = getFlag(options, keys, "conditions", mustBeArray); + let external = getFlag(options, keys, "external", mustBeArray); + let packages = getFlag(options, keys, "packages", mustBeString); + let alias = getFlag(options, keys, "alias", mustBeObject); + let loader = getFlag(options, keys, "loader", mustBeObject); + let outExtension = getFlag(options, keys, "outExtension", mustBeObject); + let publicPath = getFlag(options, keys, "publicPath", mustBeString); + let entryNames = getFlag(options, keys, "entryNames", mustBeString); + let chunkNames = getFlag(options, keys, "chunkNames", mustBeString); + let assetNames = getFlag(options, keys, "assetNames", mustBeString); + let inject = getFlag(options, keys, "inject", mustBeArray); + let banner = getFlag(options, keys, "banner", mustBeObject); + let footer = getFlag(options, keys, "footer", mustBeObject); + let entryPoints = getFlag(options, keys, "entryPoints", mustBeEntryPoints); + let absWorkingDir = getFlag(options, keys, "absWorkingDir", mustBeString); + let stdin = getFlag(options, keys, "stdin", mustBeObject); + let write = (_a2 = getFlag(options, keys, "write", mustBeBoolean)) != null ? _a2 : writeDefault; + let allowOverwrite = getFlag(options, keys, "allowOverwrite", mustBeBoolean); + let mangleCache = getFlag(options, keys, "mangleCache", mustBeObject); + keys.plugins = true; + checkForInvalidFlags(options, keys, `in ${callName}() call`); + if (sourcemap) flags.push(`--sourcemap${sourcemap === true ? "" : `=${sourcemap}`}`); + if (bundle) flags.push("--bundle"); + if (allowOverwrite) flags.push("--allow-overwrite"); + if (splitting) flags.push("--splitting"); + if (preserveSymlinks) flags.push("--preserve-symlinks"); + if (metafile) flags.push(`--metafile`); + if (outfile) flags.push(`--outfile=${outfile}`); + if (outdir) flags.push(`--outdir=${outdir}`); + if (outbase) flags.push(`--outbase=${outbase}`); + if (tsconfig) flags.push(`--tsconfig=${tsconfig}`); + if (packages) flags.push(`--packages=${packages}`); + if (resolveExtensions) { + let values = []; + for (let value of resolveExtensions) { + validateStringValue(value, "resolve extension"); + if (value.indexOf(",") >= 0) throw new Error(`Invalid resolve extension: ${value}`); + values.push(value); + } + flags.push(`--resolve-extensions=${values.join(",")}`); + } + if (publicPath) flags.push(`--public-path=${publicPath}`); + if (entryNames) flags.push(`--entry-names=${entryNames}`); + if (chunkNames) flags.push(`--chunk-names=${chunkNames}`); + if (assetNames) flags.push(`--asset-names=${assetNames}`); + if (mainFields) { + let values = []; + for (let value of mainFields) { + validateStringValue(value, "main field"); + if (value.indexOf(",") >= 0) throw new Error(`Invalid main field: ${value}`); + values.push(value); + } + flags.push(`--main-fields=${values.join(",")}`); + } + if (conditions) { + let values = []; + for (let value of conditions) { + validateStringValue(value, "condition"); + if (value.indexOf(",") >= 0) throw new Error(`Invalid condition: ${value}`); + values.push(value); + } + flags.push(`--conditions=${values.join(",")}`); + } + if (external) for (let name of external) flags.push(`--external:${validateStringValue(name, "external")}`); + if (alias) { + for (let old in alias) { + if (old.indexOf("=") >= 0) throw new Error(`Invalid package name in alias: ${old}`); + flags.push(`--alias:${old}=${validateStringValue(alias[old], "alias", old)}`); + } + } + if (banner) { + for (let type in banner) { + if (type.indexOf("=") >= 0) throw new Error(`Invalid banner file type: ${type}`); + flags.push(`--banner:${type}=${validateStringValue(banner[type], "banner", type)}`); + } + } + if (footer) { + for (let type in footer) { + if (type.indexOf("=") >= 0) throw new Error(`Invalid footer file type: ${type}`); + flags.push(`--footer:${type}=${validateStringValue(footer[type], "footer", type)}`); + } + } + if (inject) for (let path3 of inject) flags.push(`--inject:${validateStringValue(path3, "inject")}`); + if (loader) { + for (let ext in loader) { + if (ext.indexOf("=") >= 0) throw new Error(`Invalid loader extension: ${ext}`); + flags.push(`--loader:${ext}=${validateStringValue(loader[ext], "loader", ext)}`); + } + } + if (outExtension) { + for (let ext in outExtension) { + if (ext.indexOf("=") >= 0) throw new Error(`Invalid out extension: ${ext}`); + flags.push(`--out-extension:${ext}=${validateStringValue(outExtension[ext], "out extension", ext)}`); + } + } + if (entryPoints) { + if (Array.isArray(entryPoints)) { + for (let i = 0, n = entryPoints.length; i < n; i++) { + let entryPoint = entryPoints[i]; + if (typeof entryPoint === "object" && entryPoint !== null) { + let entryPointKeys = /* @__PURE__ */ Object.create(null); + let input = getFlag(entryPoint, entryPointKeys, "in", mustBeString); + let output = getFlag(entryPoint, entryPointKeys, "out", mustBeString); + checkForInvalidFlags(entryPoint, entryPointKeys, "in entry point at index " + i); + if (input === void 0) throw new Error('Missing property "in" for entry point at index ' + i); + if (output === void 0) throw new Error('Missing property "out" for entry point at index ' + i); + entries.push([output, input]); + } else { + entries.push(["", validateStringValue(entryPoint, "entry point at index " + i)]); + } + } + } else { + for (let key in entryPoints) { + entries.push([key, validateStringValue(entryPoints[key], "entry point", key)]); + } + } + } + if (stdin) { + let stdinKeys = /* @__PURE__ */ Object.create(null); + let contents = getFlag(stdin, stdinKeys, "contents", mustBeStringOrUint8Array); + let resolveDir = getFlag(stdin, stdinKeys, "resolveDir", mustBeString); + let sourcefile = getFlag(stdin, stdinKeys, "sourcefile", mustBeString); + let loader2 = getFlag(stdin, stdinKeys, "loader", mustBeString); + checkForInvalidFlags(stdin, stdinKeys, 'in "stdin" object'); + if (sourcefile) flags.push(`--sourcefile=${sourcefile}`); + if (loader2) flags.push(`--loader=${loader2}`); + if (resolveDir) stdinResolveDir = resolveDir; + if (typeof contents === "string") stdinContents = encodeUTF8(contents); + else if (contents instanceof Uint8Array) stdinContents = contents; + } + let nodePaths = []; + if (nodePathsInput) { + for (let value of nodePathsInput) { + value += ""; + nodePaths.push(value); + } + } + return { + entries, + flags, + write, + stdinContents, + stdinResolveDir, + absWorkingDir, + nodePaths, + mangleCache: validateMangleCache(mangleCache) + }; +} +function flagsForTransformOptions(callName, options, isTTY2, logLevelDefault) { + let flags = []; + let keys = /* @__PURE__ */ Object.create(null); + pushLogFlags(flags, options, keys, isTTY2, logLevelDefault); + pushCommonFlags(flags, options, keys); + let sourcemap = getFlag(options, keys, "sourcemap", mustBeStringOrBoolean); + let sourcefile = getFlag(options, keys, "sourcefile", mustBeString); + let loader = getFlag(options, keys, "loader", mustBeString); + let banner = getFlag(options, keys, "banner", mustBeString); + let footer = getFlag(options, keys, "footer", mustBeString); + let mangleCache = getFlag(options, keys, "mangleCache", mustBeObject); + checkForInvalidFlags(options, keys, `in ${callName}() call`); + if (sourcemap) flags.push(`--sourcemap=${sourcemap === true ? "external" : sourcemap}`); + if (sourcefile) flags.push(`--sourcefile=${sourcefile}`); + if (loader) flags.push(`--loader=${loader}`); + if (banner) flags.push(`--banner=${banner}`); + if (footer) flags.push(`--footer=${footer}`); + return { + flags, + mangleCache: validateMangleCache(mangleCache) + }; +} +function createChannel(streamIn) { + const requestCallbacksByKey = {}; + const closeData = { didClose: false, reason: "" }; + let responseCallbacks = {}; + let nextRequestID = 0; + let nextBuildKey = 0; + let stdout = new Uint8Array(16 * 1024); + let stdoutUsed = 0; + let readFromStdout = (chunk) => { + let limit = stdoutUsed + chunk.length; + if (limit > stdout.length) { + let swap = new Uint8Array(limit * 2); + swap.set(stdout); + stdout = swap; + } + stdout.set(chunk, stdoutUsed); + stdoutUsed += chunk.length; + let offset = 0; + while (offset + 4 <= stdoutUsed) { + let length = readUInt32LE(stdout, offset); + if (offset + 4 + length > stdoutUsed) { + break; + } + offset += 4; + handleIncomingPacket(stdout.subarray(offset, offset + length)); + offset += length; + } + if (offset > 0) { + stdout.copyWithin(0, offset, stdoutUsed); + stdoutUsed -= offset; + } + }; + let afterClose = (error) => { + closeData.didClose = true; + if (error) closeData.reason = ": " + (error.message || error); + const text = "The service was stopped" + closeData.reason; + for (let id in responseCallbacks) { + responseCallbacks[id](text, null); + } + responseCallbacks = {}; + }; + let sendRequest = (refs, value, callback) => { + if (closeData.didClose) return callback("The service is no longer running" + closeData.reason, null); + let id = nextRequestID++; + responseCallbacks[id] = (error, response) => { + try { + callback(error, response); + } finally { + if (refs) refs.unref(); + } + }; + if (refs) refs.ref(); + streamIn.writeToStdin(encodePacket({ id, isRequest: true, value })); + }; + let sendResponse = (id, value) => { + if (closeData.didClose) throw new Error("The service is no longer running" + closeData.reason); + streamIn.writeToStdin(encodePacket({ id, isRequest: false, value })); + }; + let handleRequest = async (id, request) => { + try { + if (request.command === "ping") { + sendResponse(id, {}); + return; + } + if (typeof request.key === "number") { + const requestCallbacks = requestCallbacksByKey[request.key]; + if (!requestCallbacks) { + return; + } + const callback = requestCallbacks[request.command]; + if (callback) { + await callback(id, request); + return; + } + } + throw new Error(`Invalid command: ` + request.command); + } catch (e) { + const errors = [extractErrorMessageV8(e, streamIn, null, void 0, "")]; + try { + sendResponse(id, { errors }); + } catch { + } + } + }; + let isFirstPacket = true; + let handleIncomingPacket = (bytes) => { + if (isFirstPacket) { + isFirstPacket = false; + let binaryVersion = String.fromCharCode(...bytes); + if (binaryVersion !== "0.21.5") { + throw new Error(`Cannot start service: Host version "${"0.21.5"}" does not match binary version ${quote(binaryVersion)}`); + } + return; + } + let packet = decodePacket(bytes); + if (packet.isRequest) { + handleRequest(packet.id, packet.value); + } else { + let callback = responseCallbacks[packet.id]; + delete responseCallbacks[packet.id]; + if (packet.value.error) callback(packet.value.error, {}); + else callback(null, packet.value); + } + }; + let buildOrContext = ({ callName, refs, options, isTTY: isTTY2, defaultWD: defaultWD2, callback }) => { + let refCount = 0; + const buildKey = nextBuildKey++; + const requestCallbacks = {}; + const buildRefs = { + ref() { + if (++refCount === 1) { + if (refs) refs.ref(); + } + }, + unref() { + if (--refCount === 0) { + delete requestCallbacksByKey[buildKey]; + if (refs) refs.unref(); + } + } + }; + requestCallbacksByKey[buildKey] = requestCallbacks; + buildRefs.ref(); + buildOrContextImpl( + callName, + buildKey, + sendRequest, + sendResponse, + buildRefs, + streamIn, + requestCallbacks, + options, + isTTY2, + defaultWD2, + (err, res) => { + try { + callback(err, res); + } finally { + buildRefs.unref(); + } + } + ); + }; + let transform2 = ({ callName, refs, input, options, isTTY: isTTY2, fs: fs3, callback }) => { + const details = createObjectStash(); + let start = (inputPath) => { + try { + if (typeof input !== "string" && !(input instanceof Uint8Array)) + throw new Error('The input to "transform" must be a string or a Uint8Array'); + let { + flags, + mangleCache + } = flagsForTransformOptions(callName, options, isTTY2, transformLogLevelDefault); + let request = { + command: "transform", + flags, + inputFS: inputPath !== null, + input: inputPath !== null ? encodeUTF8(inputPath) : typeof input === "string" ? encodeUTF8(input) : input + }; + if (mangleCache) request.mangleCache = mangleCache; + sendRequest(refs, request, (error, response) => { + if (error) return callback(new Error(error), null); + let errors = replaceDetailsInMessages(response.errors, details); + let warnings = replaceDetailsInMessages(response.warnings, details); + let outstanding = 1; + let next = () => { + if (--outstanding === 0) { + let result = { + warnings, + code: response.code, + map: response.map, + mangleCache: void 0, + legalComments: void 0 + }; + if ("legalComments" in response) result.legalComments = response == null ? void 0 : response.legalComments; + if (response.mangleCache) result.mangleCache = response == null ? void 0 : response.mangleCache; + callback(null, result); + } + }; + if (errors.length > 0) return callback(failureErrorWithLog("Transform failed", errors, warnings), null); + if (response.codeFS) { + outstanding++; + fs3.readFile(response.code, (err, contents) => { + if (err !== null) { + callback(err, null); + } else { + response.code = contents; + next(); + } + }); + } + if (response.mapFS) { + outstanding++; + fs3.readFile(response.map, (err, contents) => { + if (err !== null) { + callback(err, null); + } else { + response.map = contents; + next(); + } + }); + } + next(); + }); + } catch (e) { + let flags = []; + try { + pushLogFlags(flags, options, {}, isTTY2, transformLogLevelDefault); + } catch { + } + const error = extractErrorMessageV8(e, streamIn, details, void 0, ""); + sendRequest(refs, { command: "error", flags, error }, () => { + error.detail = details.load(error.detail); + callback(failureErrorWithLog("Transform failed", [error], []), null); + }); + } + }; + if ((typeof input === "string" || input instanceof Uint8Array) && input.length > 1024 * 1024) { + let next = start; + start = () => fs3.writeFile(input, next); + } + start(null); + }; + let formatMessages2 = ({ callName, refs, messages, options, callback }) => { + if (!options) throw new Error(`Missing second argument in ${callName}() call`); + let keys = {}; + let kind = getFlag(options, keys, "kind", mustBeString); + let color = getFlag(options, keys, "color", mustBeBoolean); + let terminalWidth = getFlag(options, keys, "terminalWidth", mustBeInteger); + checkForInvalidFlags(options, keys, `in ${callName}() call`); + if (kind === void 0) throw new Error(`Missing "kind" in ${callName}() call`); + if (kind !== "error" && kind !== "warning") throw new Error(`Expected "kind" to be "error" or "warning" in ${callName}() call`); + let request = { + command: "format-msgs", + messages: sanitizeMessages(messages, "messages", null, "", terminalWidth), + isWarning: kind === "warning" + }; + if (color !== void 0) request.color = color; + if (terminalWidth !== void 0) request.terminalWidth = terminalWidth; + sendRequest(refs, request, (error, response) => { + if (error) return callback(new Error(error), null); + callback(null, response.messages); + }); + }; + let analyzeMetafile2 = ({ callName, refs, metafile, options, callback }) => { + if (options === void 0) options = {}; + let keys = {}; + let color = getFlag(options, keys, "color", mustBeBoolean); + let verbose = getFlag(options, keys, "verbose", mustBeBoolean); + checkForInvalidFlags(options, keys, `in ${callName}() call`); + let request = { + command: "analyze-metafile", + metafile + }; + if (color !== void 0) request.color = color; + if (verbose !== void 0) request.verbose = verbose; + sendRequest(refs, request, (error, response) => { + if (error) return callback(new Error(error), null); + callback(null, response.result); + }); + }; + return { + readFromStdout, + afterClose, + service: { + buildOrContext, + transform: transform2, + formatMessages: formatMessages2, + analyzeMetafile: analyzeMetafile2 + } + }; +} +function buildOrContextImpl(callName, buildKey, sendRequest, sendResponse, refs, streamIn, requestCallbacks, options, isTTY2, defaultWD2, callback) { + const details = createObjectStash(); + const isContext = callName === "context"; + const handleError = (e, pluginName) => { + const flags = []; + try { + pushLogFlags(flags, options, {}, isTTY2, buildLogLevelDefault); + } catch { + } + const message = extractErrorMessageV8(e, streamIn, details, void 0, pluginName); + sendRequest(refs, { command: "error", flags, error: message }, () => { + message.detail = details.load(message.detail); + callback(failureErrorWithLog(isContext ? "Context failed" : "Build failed", [message], []), null); + }); + }; + let plugins; + if (typeof options === "object") { + const value = options.plugins; + if (value !== void 0) { + if (!Array.isArray(value)) return handleError(new Error(`"plugins" must be an array`), ""); + plugins = value; + } + } + if (plugins && plugins.length > 0) { + if (streamIn.isSync) return handleError(new Error("Cannot use plugins in synchronous API calls"), ""); + handlePlugins( + buildKey, + sendRequest, + sendResponse, + refs, + streamIn, + requestCallbacks, + options, + plugins, + details + ).then( + (result) => { + if (!result.ok) return handleError(result.error, result.pluginName); + try { + buildOrContextContinue(result.requestPlugins, result.runOnEndCallbacks, result.scheduleOnDisposeCallbacks); + } catch (e) { + handleError(e, ""); + } + }, + (e) => handleError(e, "") + ); + return; + } + try { + buildOrContextContinue(null, (result, done) => done([], []), () => { + }); + } catch (e) { + handleError(e, ""); + } + function buildOrContextContinue(requestPlugins, runOnEndCallbacks, scheduleOnDisposeCallbacks) { + const writeDefault = streamIn.hasFS; + const { + entries, + flags, + write, + stdinContents, + stdinResolveDir, + absWorkingDir, + nodePaths, + mangleCache + } = flagsForBuildOptions(callName, options, isTTY2, buildLogLevelDefault, writeDefault); + if (write && !streamIn.hasFS) throw new Error(`The "write" option is unavailable in this environment`); + const request = { + command: "build", + key: buildKey, + entries, + flags, + write, + stdinContents, + stdinResolveDir, + absWorkingDir: absWorkingDir || defaultWD2, + nodePaths, + context: isContext + }; + if (requestPlugins) request.plugins = requestPlugins; + if (mangleCache) request.mangleCache = mangleCache; + const buildResponseToResult = (response, callback2) => { + const result = { + errors: replaceDetailsInMessages(response.errors, details), + warnings: replaceDetailsInMessages(response.warnings, details), + outputFiles: void 0, + metafile: void 0, + mangleCache: void 0 + }; + const originalErrors = result.errors.slice(); + const originalWarnings = result.warnings.slice(); + if (response.outputFiles) result.outputFiles = response.outputFiles.map(convertOutputFiles); + if (response.metafile) result.metafile = JSON.parse(response.metafile); + if (response.mangleCache) result.mangleCache = response.mangleCache; + if (response.writeToStdout !== void 0) console.log(decodeUTF8(response.writeToStdout).replace(/\n$/, "")); + runOnEndCallbacks(result, (onEndErrors, onEndWarnings) => { + if (originalErrors.length > 0 || onEndErrors.length > 0) { + const error = failureErrorWithLog("Build failed", originalErrors.concat(onEndErrors), originalWarnings.concat(onEndWarnings)); + return callback2(error, null, onEndErrors, onEndWarnings); + } + callback2(null, result, onEndErrors, onEndWarnings); + }); + }; + let latestResultPromise; + let provideLatestResult; + if (isContext) + requestCallbacks["on-end"] = (id, request2) => new Promise((resolve) => { + buildResponseToResult(request2, (err, result, onEndErrors, onEndWarnings) => { + const response = { + errors: onEndErrors, + warnings: onEndWarnings + }; + if (provideLatestResult) provideLatestResult(err, result); + latestResultPromise = void 0; + provideLatestResult = void 0; + sendResponse(id, response); + resolve(); + }); + }); + sendRequest(refs, request, (error, response) => { + if (error) return callback(new Error(error), null); + if (!isContext) { + return buildResponseToResult(response, (err, res) => { + scheduleOnDisposeCallbacks(); + return callback(err, res); + }); + } + if (response.errors.length > 0) { + return callback(failureErrorWithLog("Context failed", response.errors, response.warnings), null); + } + let didDispose = false; + const result = { + rebuild: () => { + if (!latestResultPromise) latestResultPromise = new Promise((resolve, reject) => { + let settlePromise; + provideLatestResult = (err, result2) => { + if (!settlePromise) settlePromise = () => err ? reject(err) : resolve(result2); + }; + const triggerAnotherBuild = () => { + const request2 = { + command: "rebuild", + key: buildKey + }; + sendRequest(refs, request2, (error2, response2) => { + if (error2) { + reject(new Error(error2)); + } else if (settlePromise) { + settlePromise(); + } else { + triggerAnotherBuild(); + } + }); + }; + triggerAnotherBuild(); + }); + return latestResultPromise; + }, + watch: (options2 = {}) => new Promise((resolve, reject) => { + if (!streamIn.hasFS) throw new Error(`Cannot use the "watch" API in this environment`); + const keys = {}; + checkForInvalidFlags(options2, keys, `in watch() call`); + const request2 = { + command: "watch", + key: buildKey + }; + sendRequest(refs, request2, (error2) => { + if (error2) reject(new Error(error2)); + else resolve(void 0); + }); + }), + serve: (options2 = {}) => new Promise((resolve, reject) => { + if (!streamIn.hasFS) throw new Error(`Cannot use the "serve" API in this environment`); + const keys = {}; + const port = getFlag(options2, keys, "port", mustBeInteger); + const host = getFlag(options2, keys, "host", mustBeString); + const servedir = getFlag(options2, keys, "servedir", mustBeString); + const keyfile = getFlag(options2, keys, "keyfile", mustBeString); + const certfile = getFlag(options2, keys, "certfile", mustBeString); + const fallback = getFlag(options2, keys, "fallback", mustBeString); + const onRequest = getFlag(options2, keys, "onRequest", mustBeFunction); + checkForInvalidFlags(options2, keys, `in serve() call`); + const request2 = { + command: "serve", + key: buildKey, + onRequest: !!onRequest + }; + if (port !== void 0) request2.port = port; + if (host !== void 0) request2.host = host; + if (servedir !== void 0) request2.servedir = servedir; + if (keyfile !== void 0) request2.keyfile = keyfile; + if (certfile !== void 0) request2.certfile = certfile; + if (fallback !== void 0) request2.fallback = fallback; + sendRequest(refs, request2, (error2, response2) => { + if (error2) return reject(new Error(error2)); + if (onRequest) { + requestCallbacks["serve-request"] = (id, request3) => { + onRequest(request3.args); + sendResponse(id, {}); + }; + } + resolve(response2); + }); + }), + cancel: () => new Promise((resolve) => { + if (didDispose) return resolve(); + const request2 = { + command: "cancel", + key: buildKey + }; + sendRequest(refs, request2, () => { + resolve(); + }); + }), + dispose: () => new Promise((resolve) => { + if (didDispose) return resolve(); + didDispose = true; + const request2 = { + command: "dispose", + key: buildKey + }; + sendRequest(refs, request2, () => { + resolve(); + scheduleOnDisposeCallbacks(); + refs.unref(); + }); + }) + }; + refs.ref(); + callback(null, result); + }); + } +} +var handlePlugins = async (buildKey, sendRequest, sendResponse, refs, streamIn, requestCallbacks, initialOptions, plugins, details) => { + let onStartCallbacks = []; + let onEndCallbacks = []; + let onResolveCallbacks = {}; + let onLoadCallbacks = {}; + let onDisposeCallbacks = []; + let nextCallbackID = 0; + let i = 0; + let requestPlugins = []; + let isSetupDone = false; + plugins = [...plugins]; + for (let item of plugins) { + let keys = {}; + if (typeof item !== "object") throw new Error(`Plugin at index ${i} must be an object`); + const name = getFlag(item, keys, "name", mustBeString); + if (typeof name !== "string" || name === "") throw new Error(`Plugin at index ${i} is missing a name`); + try { + let setup = getFlag(item, keys, "setup", mustBeFunction); + if (typeof setup !== "function") throw new Error(`Plugin is missing a setup function`); + checkForInvalidFlags(item, keys, `on plugin ${quote(name)}`); + let plugin = { + name, + onStart: false, + onEnd: false, + onResolve: [], + onLoad: [] + }; + i++; + let resolve = (path3, options = {}) => { + if (!isSetupDone) throw new Error('Cannot call "resolve" before plugin setup has completed'); + if (typeof path3 !== "string") throw new Error(`The path to resolve must be a string`); + let keys2 = /* @__PURE__ */ Object.create(null); + let pluginName = getFlag(options, keys2, "pluginName", mustBeString); + let importer = getFlag(options, keys2, "importer", mustBeString); + let namespace = getFlag(options, keys2, "namespace", mustBeString); + let resolveDir = getFlag(options, keys2, "resolveDir", mustBeString); + let kind = getFlag(options, keys2, "kind", mustBeString); + let pluginData = getFlag(options, keys2, "pluginData", canBeAnything); + let importAttributes = getFlag(options, keys2, "with", mustBeObject); + checkForInvalidFlags(options, keys2, "in resolve() call"); + return new Promise((resolve2, reject) => { + const request = { + command: "resolve", + path: path3, + key: buildKey, + pluginName: name + }; + if (pluginName != null) request.pluginName = pluginName; + if (importer != null) request.importer = importer; + if (namespace != null) request.namespace = namespace; + if (resolveDir != null) request.resolveDir = resolveDir; + if (kind != null) request.kind = kind; + else throw new Error(`Must specify "kind" when calling "resolve"`); + if (pluginData != null) request.pluginData = details.store(pluginData); + if (importAttributes != null) request.with = sanitizeStringMap(importAttributes, "with"); + sendRequest(refs, request, (error, response) => { + if (error !== null) reject(new Error(error)); + else resolve2({ + errors: replaceDetailsInMessages(response.errors, details), + warnings: replaceDetailsInMessages(response.warnings, details), + path: response.path, + external: response.external, + sideEffects: response.sideEffects, + namespace: response.namespace, + suffix: response.suffix, + pluginData: details.load(response.pluginData) + }); + }); + }); + }; + let promise = setup({ + initialOptions, + resolve, + onStart(callback) { + let registeredText = `This error came from the "onStart" callback registered here:`; + let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onStart"); + onStartCallbacks.push({ name, callback, note: registeredNote }); + plugin.onStart = true; + }, + onEnd(callback) { + let registeredText = `This error came from the "onEnd" callback registered here:`; + let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onEnd"); + onEndCallbacks.push({ name, callback, note: registeredNote }); + plugin.onEnd = true; + }, + onResolve(options, callback) { + let registeredText = `This error came from the "onResolve" callback registered here:`; + let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onResolve"); + let keys2 = {}; + let filter = getFlag(options, keys2, "filter", mustBeRegExp); + let namespace = getFlag(options, keys2, "namespace", mustBeString); + checkForInvalidFlags(options, keys2, `in onResolve() call for plugin ${quote(name)}`); + if (filter == null) throw new Error(`onResolve() call is missing a filter`); + let id = nextCallbackID++; + onResolveCallbacks[id] = { name, callback, note: registeredNote }; + plugin.onResolve.push({ id, filter: filter.source, namespace: namespace || "" }); + }, + onLoad(options, callback) { + let registeredText = `This error came from the "onLoad" callback registered here:`; + let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onLoad"); + let keys2 = {}; + let filter = getFlag(options, keys2, "filter", mustBeRegExp); + let namespace = getFlag(options, keys2, "namespace", mustBeString); + checkForInvalidFlags(options, keys2, `in onLoad() call for plugin ${quote(name)}`); + if (filter == null) throw new Error(`onLoad() call is missing a filter`); + let id = nextCallbackID++; + onLoadCallbacks[id] = { name, callback, note: registeredNote }; + plugin.onLoad.push({ id, filter: filter.source, namespace: namespace || "" }); + }, + onDispose(callback) { + onDisposeCallbacks.push(callback); + }, + esbuild: streamIn.esbuild + }); + if (promise) await promise; + requestPlugins.push(plugin); + } catch (e) { + return { ok: false, error: e, pluginName: name }; + } + } + requestCallbacks["on-start"] = async (id, request) => { + let response = { errors: [], warnings: [] }; + await Promise.all(onStartCallbacks.map(async ({ name, callback, note }) => { + try { + let result = await callback(); + if (result != null) { + if (typeof result !== "object") throw new Error(`Expected onStart() callback in plugin ${quote(name)} to return an object`); + let keys = {}; + let errors = getFlag(result, keys, "errors", mustBeArray); + let warnings = getFlag(result, keys, "warnings", mustBeArray); + checkForInvalidFlags(result, keys, `from onStart() callback in plugin ${quote(name)}`); + if (errors != null) response.errors.push(...sanitizeMessages(errors, "errors", details, name, void 0)); + if (warnings != null) response.warnings.push(...sanitizeMessages(warnings, "warnings", details, name, void 0)); + } + } catch (e) { + response.errors.push(extractErrorMessageV8(e, streamIn, details, note && note(), name)); + } + })); + sendResponse(id, response); + }; + requestCallbacks["on-resolve"] = async (id, request) => { + let response = {}, name = "", callback, note; + for (let id2 of request.ids) { + try { + ({ name, callback, note } = onResolveCallbacks[id2]); + let result = await callback({ + path: request.path, + importer: request.importer, + namespace: request.namespace, + resolveDir: request.resolveDir, + kind: request.kind, + pluginData: details.load(request.pluginData), + with: request.with + }); + if (result != null) { + if (typeof result !== "object") throw new Error(`Expected onResolve() callback in plugin ${quote(name)} to return an object`); + let keys = {}; + let pluginName = getFlag(result, keys, "pluginName", mustBeString); + let path3 = getFlag(result, keys, "path", mustBeString); + let namespace = getFlag(result, keys, "namespace", mustBeString); + let suffix = getFlag(result, keys, "suffix", mustBeString); + let external = getFlag(result, keys, "external", mustBeBoolean); + let sideEffects = getFlag(result, keys, "sideEffects", mustBeBoolean); + let pluginData = getFlag(result, keys, "pluginData", canBeAnything); + let errors = getFlag(result, keys, "errors", mustBeArray); + let warnings = getFlag(result, keys, "warnings", mustBeArray); + let watchFiles = getFlag(result, keys, "watchFiles", mustBeArray); + let watchDirs = getFlag(result, keys, "watchDirs", mustBeArray); + checkForInvalidFlags(result, keys, `from onResolve() callback in plugin ${quote(name)}`); + response.id = id2; + if (pluginName != null) response.pluginName = pluginName; + if (path3 != null) response.path = path3; + if (namespace != null) response.namespace = namespace; + if (suffix != null) response.suffix = suffix; + if (external != null) response.external = external; + if (sideEffects != null) response.sideEffects = sideEffects; + if (pluginData != null) response.pluginData = details.store(pluginData); + if (errors != null) response.errors = sanitizeMessages(errors, "errors", details, name, void 0); + if (warnings != null) response.warnings = sanitizeMessages(warnings, "warnings", details, name, void 0); + if (watchFiles != null) response.watchFiles = sanitizeStringArray(watchFiles, "watchFiles"); + if (watchDirs != null) response.watchDirs = sanitizeStringArray(watchDirs, "watchDirs"); + break; + } + } catch (e) { + response = { id: id2, errors: [extractErrorMessageV8(e, streamIn, details, note && note(), name)] }; + break; + } + } + sendResponse(id, response); + }; + requestCallbacks["on-load"] = async (id, request) => { + let response = {}, name = "", callback, note; + for (let id2 of request.ids) { + try { + ({ name, callback, note } = onLoadCallbacks[id2]); + let result = await callback({ + path: request.path, + namespace: request.namespace, + suffix: request.suffix, + pluginData: details.load(request.pluginData), + with: request.with + }); + if (result != null) { + if (typeof result !== "object") throw new Error(`Expected onLoad() callback in plugin ${quote(name)} to return an object`); + let keys = {}; + let pluginName = getFlag(result, keys, "pluginName", mustBeString); + let contents = getFlag(result, keys, "contents", mustBeStringOrUint8Array); + let resolveDir = getFlag(result, keys, "resolveDir", mustBeString); + let pluginData = getFlag(result, keys, "pluginData", canBeAnything); + let loader = getFlag(result, keys, "loader", mustBeString); + let errors = getFlag(result, keys, "errors", mustBeArray); + let warnings = getFlag(result, keys, "warnings", mustBeArray); + let watchFiles = getFlag(result, keys, "watchFiles", mustBeArray); + let watchDirs = getFlag(result, keys, "watchDirs", mustBeArray); + checkForInvalidFlags(result, keys, `from onLoad() callback in plugin ${quote(name)}`); + response.id = id2; + if (pluginName != null) response.pluginName = pluginName; + if (contents instanceof Uint8Array) response.contents = contents; + else if (contents != null) response.contents = encodeUTF8(contents); + if (resolveDir != null) response.resolveDir = resolveDir; + if (pluginData != null) response.pluginData = details.store(pluginData); + if (loader != null) response.loader = loader; + if (errors != null) response.errors = sanitizeMessages(errors, "errors", details, name, void 0); + if (warnings != null) response.warnings = sanitizeMessages(warnings, "warnings", details, name, void 0); + if (watchFiles != null) response.watchFiles = sanitizeStringArray(watchFiles, "watchFiles"); + if (watchDirs != null) response.watchDirs = sanitizeStringArray(watchDirs, "watchDirs"); + break; + } + } catch (e) { + response = { id: id2, errors: [extractErrorMessageV8(e, streamIn, details, note && note(), name)] }; + break; + } + } + sendResponse(id, response); + }; + let runOnEndCallbacks = (result, done) => done([], []); + if (onEndCallbacks.length > 0) { + runOnEndCallbacks = (result, done) => { + (async () => { + const onEndErrors = []; + const onEndWarnings = []; + for (const { name, callback, note } of onEndCallbacks) { + let newErrors; + let newWarnings; + try { + const value = await callback(result); + if (value != null) { + if (typeof value !== "object") throw new Error(`Expected onEnd() callback in plugin ${quote(name)} to return an object`); + let keys = {}; + let errors = getFlag(value, keys, "errors", mustBeArray); + let warnings = getFlag(value, keys, "warnings", mustBeArray); + checkForInvalidFlags(value, keys, `from onEnd() callback in plugin ${quote(name)}`); + if (errors != null) newErrors = sanitizeMessages(errors, "errors", details, name, void 0); + if (warnings != null) newWarnings = sanitizeMessages(warnings, "warnings", details, name, void 0); + } + } catch (e) { + newErrors = [extractErrorMessageV8(e, streamIn, details, note && note(), name)]; + } + if (newErrors) { + onEndErrors.push(...newErrors); + try { + result.errors.push(...newErrors); + } catch { + } + } + if (newWarnings) { + onEndWarnings.push(...newWarnings); + try { + result.warnings.push(...newWarnings); + } catch { + } + } + } + done(onEndErrors, onEndWarnings); + })(); + }; + } + let scheduleOnDisposeCallbacks = () => { + for (const cb of onDisposeCallbacks) { + setTimeout(() => cb(), 0); + } + }; + isSetupDone = true; + return { + ok: true, + requestPlugins, + runOnEndCallbacks, + scheduleOnDisposeCallbacks + }; +}; +function createObjectStash() { + const map = /* @__PURE__ */ new Map(); + let nextID = 0; + return { + load(id) { + return map.get(id); + }, + store(value) { + if (value === void 0) return -1; + const id = nextID++; + map.set(id, value); + return id; + } + }; +} +function extractCallerV8(e, streamIn, ident) { + let note; + let tried = false; + return () => { + if (tried) return note; + tried = true; + try { + let lines = (e.stack + "").split("\n"); + lines.splice(1, 1); + let location = parseStackLinesV8(streamIn, lines, ident); + if (location) { + note = { text: e.message, location }; + return note; + } + } catch { + } + }; +} +function extractErrorMessageV8(e, streamIn, stash, note, pluginName) { + let text = "Internal error"; + let location = null; + try { + text = (e && e.message || e) + ""; + } catch { + } + try { + location = parseStackLinesV8(streamIn, (e.stack + "").split("\n"), ""); + } catch { + } + return { id: "", pluginName, text, location, notes: note ? [note] : [], detail: stash ? stash.store(e) : -1 }; +} +function parseStackLinesV8(streamIn, lines, ident) { + let at = " at "; + if (streamIn.readFileSync && !lines[0].startsWith(at) && lines[1].startsWith(at)) { + for (let i = 1; i < lines.length; i++) { + let line = lines[i]; + if (!line.startsWith(at)) continue; + line = line.slice(at.length); + while (true) { + let match = /^(?:new |async )?\S+ \((.*)\)$/.exec(line); + if (match) { + line = match[1]; + continue; + } + match = /^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(line); + if (match) { + line = match[1]; + continue; + } + match = /^(\S+):(\d+):(\d+)$/.exec(line); + if (match) { + let contents; + try { + contents = streamIn.readFileSync(match[1], "utf8"); + } catch { + break; + } + let lineText = contents.split(/\r\n|\r|\n|\u2028|\u2029/)[+match[2] - 1] || ""; + let column = +match[3] - 1; + let length = lineText.slice(column, column + ident.length) === ident ? ident.length : 0; + return { + file: match[1], + namespace: "file", + line: +match[2], + column: encodeUTF8(lineText.slice(0, column)).length, + length: encodeUTF8(lineText.slice(column, column + length)).length, + lineText: lineText + "\n" + lines.slice(1).join("\n"), + suggestion: "" + }; + } + break; + } + } + } + return null; +} +function failureErrorWithLog(text, errors, warnings) { + let limit = 5; + text += errors.length < 1 ? "" : ` with ${errors.length} error${errors.length < 2 ? "" : "s"}:` + errors.slice(0, limit + 1).map((e, i) => { + if (i === limit) return "\n..."; + if (!e.location) return ` +error: ${e.text}`; + let { file, line, column } = e.location; + let pluginText = e.pluginName ? `[plugin: ${e.pluginName}] ` : ""; + return ` +${file}:${line}:${column}: ERROR: ${pluginText}${e.text}`; + }).join(""); + let error = new Error(text); + for (const [key, value] of [["errors", errors], ["warnings", warnings]]) { + Object.defineProperty(error, key, { + configurable: true, + enumerable: true, + get: () => value, + set: (value2) => Object.defineProperty(error, key, { + configurable: true, + enumerable: true, + value: value2 + }) + }); + } + return error; +} +function replaceDetailsInMessages(messages, stash) { + for (const message of messages) { + message.detail = stash.load(message.detail); + } + return messages; +} +function sanitizeLocation(location, where, terminalWidth) { + if (location == null) return null; + let keys = {}; + let file = getFlag(location, keys, "file", mustBeString); + let namespace = getFlag(location, keys, "namespace", mustBeString); + let line = getFlag(location, keys, "line", mustBeInteger); + let column = getFlag(location, keys, "column", mustBeInteger); + let length = getFlag(location, keys, "length", mustBeInteger); + let lineText = getFlag(location, keys, "lineText", mustBeString); + let suggestion = getFlag(location, keys, "suggestion", mustBeString); + checkForInvalidFlags(location, keys, where); + if (lineText) { + const relevantASCII = lineText.slice( + 0, + (column && column > 0 ? column : 0) + (length && length > 0 ? length : 0) + (terminalWidth && terminalWidth > 0 ? terminalWidth : 80) + ); + if (!/[\x7F-\uFFFF]/.test(relevantASCII) && !/\n/.test(lineText)) { + lineText = relevantASCII; + } + } + return { + file: file || "", + namespace: namespace || "", + line: line || 0, + column: column || 0, + length: length || 0, + lineText: lineText || "", + suggestion: suggestion || "" + }; +} +function sanitizeMessages(messages, property, stash, fallbackPluginName, terminalWidth) { + let messagesClone = []; + let index = 0; + for (const message of messages) { + let keys = {}; + let id = getFlag(message, keys, "id", mustBeString); + let pluginName = getFlag(message, keys, "pluginName", mustBeString); + let text = getFlag(message, keys, "text", mustBeString); + let location = getFlag(message, keys, "location", mustBeObjectOrNull); + let notes = getFlag(message, keys, "notes", mustBeArray); + let detail = getFlag(message, keys, "detail", canBeAnything); + let where = `in element ${index} of "${property}"`; + checkForInvalidFlags(message, keys, where); + let notesClone = []; + if (notes) { + for (const note of notes) { + let noteKeys = {}; + let noteText = getFlag(note, noteKeys, "text", mustBeString); + let noteLocation = getFlag(note, noteKeys, "location", mustBeObjectOrNull); + checkForInvalidFlags(note, noteKeys, where); + notesClone.push({ + text: noteText || "", + location: sanitizeLocation(noteLocation, where, terminalWidth) + }); + } + } + messagesClone.push({ + id: id || "", + pluginName: pluginName || fallbackPluginName, + text: text || "", + location: sanitizeLocation(location, where, terminalWidth), + notes: notesClone, + detail: stash ? stash.store(detail) : -1 + }); + index++; + } + return messagesClone; +} +function sanitizeStringArray(values, property) { + const result = []; + for (const value of values) { + if (typeof value !== "string") throw new Error(`${quote(property)} must be an array of strings`); + result.push(value); + } + return result; +} +function sanitizeStringMap(map, property) { + const result = /* @__PURE__ */ Object.create(null); + for (const key in map) { + const value = map[key]; + if (typeof value !== "string") throw new Error(`key ${quote(key)} in object ${quote(property)} must be a string`); + result[key] = value; + } + return result; +} +function convertOutputFiles({ path: path3, contents, hash }) { + let text = null; + return { + path: path3, + contents, + hash, + get text() { + const binary = this.contents; + if (text === null || binary !== contents) { + contents = binary; + text = decodeUTF8(binary); + } + return text; + } + }; +} + +// lib/npm/node-platform.ts +var fs = require("fs"); +var os = require("os"); +var path = require("path"); +var ESBUILD_BINARY_PATH = process.env.ESBUILD_BINARY_PATH || ESBUILD_BINARY_PATH; +var isValidBinaryPath = (x) => !!x && x !== "/usr/bin/esbuild"; +var packageDarwin_arm64 = "@esbuild/darwin-arm64"; +var packageDarwin_x64 = "@esbuild/darwin-x64"; +var knownWindowsPackages = { + "win32 arm64 LE": "@esbuild/win32-arm64", + "win32 ia32 LE": "@esbuild/win32-ia32", + "win32 x64 LE": "@esbuild/win32-x64" +}; +var knownUnixlikePackages = { + "aix ppc64 BE": "@esbuild/aix-ppc64", + "android arm64 LE": "@esbuild/android-arm64", + "darwin arm64 LE": "@esbuild/darwin-arm64", + "darwin x64 LE": "@esbuild/darwin-x64", + "freebsd arm64 LE": "@esbuild/freebsd-arm64", + "freebsd x64 LE": "@esbuild/freebsd-x64", + "linux arm LE": "@esbuild/linux-arm", + "linux arm64 LE": "@esbuild/linux-arm64", + "linux ia32 LE": "@esbuild/linux-ia32", + "linux mips64el LE": "@esbuild/linux-mips64el", + "linux ppc64 LE": "@esbuild/linux-ppc64", + "linux riscv64 LE": "@esbuild/linux-riscv64", + "linux s390x BE": "@esbuild/linux-s390x", + "linux x64 LE": "@esbuild/linux-x64", + "linux loong64 LE": "@esbuild/linux-loong64", + "netbsd x64 LE": "@esbuild/netbsd-x64", + "openbsd x64 LE": "@esbuild/openbsd-x64", + "sunos x64 LE": "@esbuild/sunos-x64" +}; +var knownWebAssemblyFallbackPackages = { + "android arm LE": "@esbuild/android-arm", + "android x64 LE": "@esbuild/android-x64" +}; +function pkgAndSubpathForCurrentPlatform() { + let pkg; + let subpath; + let isWASM = false; + let platformKey = `${process.platform} ${os.arch()} ${os.endianness()}`; + if (platformKey in knownWindowsPackages) { + pkg = knownWindowsPackages[platformKey]; + subpath = "esbuild.exe"; + } else if (platformKey in knownUnixlikePackages) { + pkg = knownUnixlikePackages[platformKey]; + subpath = "bin/esbuild"; + } else if (platformKey in knownWebAssemblyFallbackPackages) { + pkg = knownWebAssemblyFallbackPackages[platformKey]; + subpath = "bin/esbuild"; + isWASM = true; + } else { + throw new Error(`Unsupported platform: ${platformKey}`); + } + return { pkg, subpath, isWASM }; +} +function pkgForSomeOtherPlatform() { + const libMainJS = require.resolve("esbuild"); + const nodeModulesDirectory = path.dirname(path.dirname(path.dirname(libMainJS))); + if (path.basename(nodeModulesDirectory) === "node_modules") { + for (const unixKey in knownUnixlikePackages) { + try { + const pkg = knownUnixlikePackages[unixKey]; + if (fs.existsSync(path.join(nodeModulesDirectory, pkg))) return pkg; + } catch { + } + } + for (const windowsKey in knownWindowsPackages) { + try { + const pkg = knownWindowsPackages[windowsKey]; + if (fs.existsSync(path.join(nodeModulesDirectory, pkg))) return pkg; + } catch { + } + } + } + return null; +} +function downloadedBinPath(pkg, subpath) { + const esbuildLibDir = path.dirname(require.resolve("esbuild")); + return path.join(esbuildLibDir, `downloaded-${pkg.replace("/", "-")}-${path.basename(subpath)}`); +} +function generateBinPath() { + if (isValidBinaryPath(ESBUILD_BINARY_PATH)) { + if (!fs.existsSync(ESBUILD_BINARY_PATH)) { + console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${ESBUILD_BINARY_PATH}`); + } else { + return { binPath: ESBUILD_BINARY_PATH, isWASM: false }; + } + } + const { pkg, subpath, isWASM } = pkgAndSubpathForCurrentPlatform(); + let binPath; + try { + binPath = require.resolve(`${pkg}/${subpath}`); + } catch (e) { + binPath = downloadedBinPath(pkg, subpath); + if (!fs.existsSync(binPath)) { + try { + require.resolve(pkg); + } catch { + const otherPkg = pkgForSomeOtherPlatform(); + if (otherPkg) { + let suggestions = ` +Specifically the "${otherPkg}" package is present but this platform +needs the "${pkg}" package instead. People often get into this +situation by installing esbuild on Windows or macOS and copying "node_modules" +into a Docker image that runs Linux, or by copying "node_modules" between +Windows and WSL environments. + +If you are installing with npm, you can try not copying the "node_modules" +directory when you copy the files over, and running "npm ci" or "npm install" +on the destination platform after the copy. Or you could consider using yarn +instead of npm which has built-in support for installing a package on multiple +platforms simultaneously. + +If you are installing with yarn, you can try listing both this platform and the +other platform in your ".yarnrc.yml" file using the "supportedArchitectures" +feature: https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures +Keep in mind that this means multiple copies of esbuild will be present. +`; + if (pkg === packageDarwin_x64 && otherPkg === packageDarwin_arm64 || pkg === packageDarwin_arm64 && otherPkg === packageDarwin_x64) { + suggestions = ` +Specifically the "${otherPkg}" package is present but this platform +needs the "${pkg}" package instead. People often get into this +situation by installing esbuild with npm running inside of Rosetta 2 and then +trying to use it with node running outside of Rosetta 2, or vice versa (Rosetta +2 is Apple's on-the-fly x86_64-to-arm64 translation service). + +If you are installing with npm, you can try ensuring that both npm and node are +not running under Rosetta 2 and then reinstalling esbuild. This likely involves +changing how you installed npm and/or node. For example, installing node with +the universal installer here should work: https://nodejs.org/en/download/. Or +you could consider using yarn instead of npm which has built-in support for +installing a package on multiple platforms simultaneously. + +If you are installing with yarn, you can try listing both "arm64" and "x64" +in your ".yarnrc.yml" file using the "supportedArchitectures" feature: +https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures +Keep in mind that this means multiple copies of esbuild will be present. +`; + } + throw new Error(` +You installed esbuild for another platform than the one you're currently using. +This won't work because esbuild is written with native code and needs to +install a platform-specific binary executable. +${suggestions} +Another alternative is to use the "esbuild-wasm" package instead, which works +the same way on all platforms. But it comes with a heavy performance cost and +can sometimes be 10x slower than the "esbuild" package, so you may also not +want to do that. +`); + } + throw new Error(`The package "${pkg}" could not be found, and is needed by esbuild. + +If you are installing esbuild with npm, make sure that you don't specify the +"--no-optional" or "--omit=optional" flags. The "optionalDependencies" feature +of "package.json" is used by esbuild to install the correct binary executable +for your current platform.`); + } + throw e; + } + } + if (/\.zip\//.test(binPath)) { + let pnpapi; + try { + pnpapi = require("pnpapi"); + } catch (e) { + } + if (pnpapi) { + const root = pnpapi.getPackageInformation(pnpapi.topLevel).packageLocation; + const binTargetPath = path.join( + root, + "node_modules", + ".cache", + "esbuild", + `pnpapi-${pkg.replace("/", "-")}-${"0.21.5"}-${path.basename(subpath)}` + ); + if (!fs.existsSync(binTargetPath)) { + fs.mkdirSync(path.dirname(binTargetPath), { recursive: true }); + fs.copyFileSync(binPath, binTargetPath); + fs.chmodSync(binTargetPath, 493); + } + return { binPath: binTargetPath, isWASM }; + } + } + return { binPath, isWASM }; +} + +// lib/npm/node.ts +var child_process = require("child_process"); +var crypto = require("crypto"); +var path2 = require("path"); +var fs2 = require("fs"); +var os2 = require("os"); +var tty = require("tty"); +var worker_threads; +if (process.env.ESBUILD_WORKER_THREADS !== "0") { + try { + worker_threads = require("worker_threads"); + } catch { + } + let [major, minor] = process.versions.node.split("."); + if ( + // { + if ((!ESBUILD_BINARY_PATH || false) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) { + throw new Error( + `The esbuild JavaScript API cannot be bundled. Please mark the "esbuild" package as external so it's not included in the bundle. + +More information: The file containing the code for esbuild's JavaScript API (${__filename}) does not appear to be inside the esbuild package on the file system, which usually means that the esbuild package was bundled into another file. This is problematic because the API needs to run a binary executable inside the esbuild package which is located using a relative path from the API code to the executable. If the esbuild package is bundled, the relative path will be incorrect and the executable won't be found.` + ); + } + if (false) { + return ["node", [path2.join(__dirname, "..", "bin", "esbuild")]]; + } else { + const { binPath, isWASM } = generateBinPath(); + if (isWASM) { + return ["node", [binPath]]; + } else { + return [binPath, []]; + } + } +}; +var isTTY = () => tty.isatty(2); +var fsSync = { + readFile(tempFile, callback) { + try { + let contents = fs2.readFileSync(tempFile, "utf8"); + try { + fs2.unlinkSync(tempFile); + } catch { + } + callback(null, contents); + } catch (err) { + callback(err, null); + } + }, + writeFile(contents, callback) { + try { + let tempFile = randomFileName(); + fs2.writeFileSync(tempFile, contents); + callback(tempFile); + } catch { + callback(null); + } + } +}; +var fsAsync = { + readFile(tempFile, callback) { + try { + fs2.readFile(tempFile, "utf8", (err, contents) => { + try { + fs2.unlink(tempFile, () => callback(err, contents)); + } catch { + callback(err, contents); + } + }); + } catch (err) { + callback(err, null); + } + }, + writeFile(contents, callback) { + try { + let tempFile = randomFileName(); + fs2.writeFile(tempFile, contents, (err) => err !== null ? callback(null) : callback(tempFile)); + } catch { + callback(null); + } + } +}; +var version = "0.21.5"; +var build = (options) => ensureServiceIsRunning().build(options); +var context = (buildOptions) => ensureServiceIsRunning().context(buildOptions); +var transform = (input, options) => ensureServiceIsRunning().transform(input, options); +var formatMessages = (messages, options) => ensureServiceIsRunning().formatMessages(messages, options); +var analyzeMetafile = (messages, options) => ensureServiceIsRunning().analyzeMetafile(messages, options); +var buildSync = (options) => { + if (worker_threads && !isInternalWorkerThread) { + if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); + return workerThreadService.buildSync(options); + } + let result; + runServiceSync((service) => service.buildOrContext({ + callName: "buildSync", + refs: null, + options, + isTTY: isTTY(), + defaultWD, + callback: (err, res) => { + if (err) throw err; + result = res; + } + })); + return result; +}; +var transformSync = (input, options) => { + if (worker_threads && !isInternalWorkerThread) { + if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); + return workerThreadService.transformSync(input, options); + } + let result; + runServiceSync((service) => service.transform({ + callName: "transformSync", + refs: null, + input, + options: options || {}, + isTTY: isTTY(), + fs: fsSync, + callback: (err, res) => { + if (err) throw err; + result = res; + } + })); + return result; +}; +var formatMessagesSync = (messages, options) => { + if (worker_threads && !isInternalWorkerThread) { + if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); + return workerThreadService.formatMessagesSync(messages, options); + } + let result; + runServiceSync((service) => service.formatMessages({ + callName: "formatMessagesSync", + refs: null, + messages, + options, + callback: (err, res) => { + if (err) throw err; + result = res; + } + })); + return result; +}; +var analyzeMetafileSync = (metafile, options) => { + if (worker_threads && !isInternalWorkerThread) { + if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); + return workerThreadService.analyzeMetafileSync(metafile, options); + } + let result; + runServiceSync((service) => service.analyzeMetafile({ + callName: "analyzeMetafileSync", + refs: null, + metafile: typeof metafile === "string" ? metafile : JSON.stringify(metafile), + options, + callback: (err, res) => { + if (err) throw err; + result = res; + } + })); + return result; +}; +var stop = () => { + if (stopService) stopService(); + if (workerThreadService) workerThreadService.stop(); + return Promise.resolve(); +}; +var initializeWasCalled = false; +var initialize = (options) => { + options = validateInitializeOptions(options || {}); + if (options.wasmURL) throw new Error(`The "wasmURL" option only works in the browser`); + if (options.wasmModule) throw new Error(`The "wasmModule" option only works in the browser`); + if (options.worker) throw new Error(`The "worker" option only works in the browser`); + if (initializeWasCalled) throw new Error('Cannot call "initialize" more than once'); + ensureServiceIsRunning(); + initializeWasCalled = true; + return Promise.resolve(); +}; +var defaultWD = process.cwd(); +var longLivedService; +var stopService; +var ensureServiceIsRunning = () => { + if (longLivedService) return longLivedService; + let [command, args] = esbuildCommandAndArgs(); + let child = child_process.spawn(command, args.concat(`--service=${"0.21.5"}`, "--ping"), { + windowsHide: true, + stdio: ["pipe", "pipe", "inherit"], + cwd: defaultWD + }); + let { readFromStdout, afterClose, service } = createChannel({ + writeToStdin(bytes) { + child.stdin.write(bytes, (err) => { + if (err) afterClose(err); + }); + }, + readFileSync: fs2.readFileSync, + isSync: false, + hasFS: true, + esbuild: node_exports + }); + child.stdin.on("error", afterClose); + child.on("error", afterClose); + const stdin = child.stdin; + const stdout = child.stdout; + stdout.on("data", readFromStdout); + stdout.on("end", afterClose); + stopService = () => { + stdin.destroy(); + stdout.destroy(); + child.kill(); + initializeWasCalled = false; + longLivedService = void 0; + stopService = void 0; + }; + let refCount = 0; + child.unref(); + if (stdin.unref) { + stdin.unref(); + } + if (stdout.unref) { + stdout.unref(); + } + const refs = { + ref() { + if (++refCount === 1) child.ref(); + }, + unref() { + if (--refCount === 0) child.unref(); + } + }; + longLivedService = { + build: (options) => new Promise((resolve, reject) => { + service.buildOrContext({ + callName: "build", + refs, + options, + isTTY: isTTY(), + defaultWD, + callback: (err, res) => err ? reject(err) : resolve(res) + }); + }), + context: (options) => new Promise((resolve, reject) => service.buildOrContext({ + callName: "context", + refs, + options, + isTTY: isTTY(), + defaultWD, + callback: (err, res) => err ? reject(err) : resolve(res) + })), + transform: (input, options) => new Promise((resolve, reject) => service.transform({ + callName: "transform", + refs, + input, + options: options || {}, + isTTY: isTTY(), + fs: fsAsync, + callback: (err, res) => err ? reject(err) : resolve(res) + })), + formatMessages: (messages, options) => new Promise((resolve, reject) => service.formatMessages({ + callName: "formatMessages", + refs, + messages, + options, + callback: (err, res) => err ? reject(err) : resolve(res) + })), + analyzeMetafile: (metafile, options) => new Promise((resolve, reject) => service.analyzeMetafile({ + callName: "analyzeMetafile", + refs, + metafile: typeof metafile === "string" ? metafile : JSON.stringify(metafile), + options, + callback: (err, res) => err ? reject(err) : resolve(res) + })) + }; + return longLivedService; +}; +var runServiceSync = (callback) => { + let [command, args] = esbuildCommandAndArgs(); + let stdin = new Uint8Array(); + let { readFromStdout, afterClose, service } = createChannel({ + writeToStdin(bytes) { + if (stdin.length !== 0) throw new Error("Must run at most one command"); + stdin = bytes; + }, + isSync: true, + hasFS: true, + esbuild: node_exports + }); + callback(service); + let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.21.5"}`), { + cwd: defaultWD, + windowsHide: true, + input: stdin, + // We don't know how large the output could be. If it's too large, the + // command will fail with ENOBUFS. Reserve 16mb for now since that feels + // like it should be enough. Also allow overriding this with an environment + // variable. + maxBuffer: +process.env.ESBUILD_MAX_BUFFER || 16 * 1024 * 1024 + }); + readFromStdout(stdout); + afterClose(null); +}; +var randomFileName = () => { + return path2.join(os2.tmpdir(), `esbuild-${crypto.randomBytes(32).toString("hex")}`); +}; +var workerThreadService = null; +var startWorkerThreadService = (worker_threads2) => { + let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel(); + let worker = new worker_threads2.Worker(__filename, { + workerData: { workerPort, defaultWD, esbuildVersion: "0.21.5" }, + transferList: [workerPort], + // From node's documentation: https://nodejs.org/api/worker_threads.html + // + // Take care when launching worker threads from preload scripts (scripts loaded + // and run using the `-r` command line flag). Unless the `execArgv` option is + // explicitly set, new Worker threads automatically inherit the command line flags + // from the running process and will preload the same preload scripts as the main + // thread. If the preload script unconditionally launches a worker thread, every + // thread spawned will spawn another until the application crashes. + // + execArgv: [] + }); + let nextID = 0; + let fakeBuildError = (text) => { + let error = new Error(`Build failed with 1 error: +error: ${text}`); + let errors = [{ id: "", pluginName: "", text, location: null, notes: [], detail: void 0 }]; + error.errors = errors; + error.warnings = []; + return error; + }; + let validateBuildSyncOptions = (options) => { + if (!options) return; + let plugins = options.plugins; + if (plugins && plugins.length > 0) throw fakeBuildError(`Cannot use plugins in synchronous API calls`); + }; + let applyProperties = (object, properties) => { + for (let key in properties) { + object[key] = properties[key]; + } + }; + let runCallSync = (command, args) => { + let id = nextID++; + let sharedBuffer = new SharedArrayBuffer(8); + let sharedBufferView = new Int32Array(sharedBuffer); + let msg = { sharedBuffer, id, command, args }; + worker.postMessage(msg); + let status = Atomics.wait(sharedBufferView, 0, 0); + if (status !== "ok" && status !== "not-equal") throw new Error("Internal error: Atomics.wait() failed: " + status); + let { message: { id: id2, resolve, reject, properties } } = worker_threads2.receiveMessageOnPort(mainPort); + if (id !== id2) throw new Error(`Internal error: Expected id ${id} but got id ${id2}`); + if (reject) { + applyProperties(reject, properties); + throw reject; + } + return resolve; + }; + worker.unref(); + return { + buildSync(options) { + validateBuildSyncOptions(options); + return runCallSync("build", [options]); + }, + transformSync(input, options) { + return runCallSync("transform", [input, options]); + }, + formatMessagesSync(messages, options) { + return runCallSync("formatMessages", [messages, options]); + }, + analyzeMetafileSync(metafile, options) { + return runCallSync("analyzeMetafile", [metafile, options]); + }, + stop() { + worker.terminate(); + workerThreadService = null; + } + }; +}; +var startSyncServiceWorker = () => { + let workerPort = worker_threads.workerData.workerPort; + let parentPort = worker_threads.parentPort; + let extractProperties = (object) => { + let properties = {}; + if (object && typeof object === "object") { + for (let key in object) { + properties[key] = object[key]; + } + } + return properties; + }; + try { + let service = ensureServiceIsRunning(); + defaultWD = worker_threads.workerData.defaultWD; + parentPort.on("message", (msg) => { + (async () => { + let { sharedBuffer, id, command, args } = msg; + let sharedBufferView = new Int32Array(sharedBuffer); + try { + switch (command) { + case "build": + workerPort.postMessage({ id, resolve: await service.build(args[0]) }); + break; + case "transform": + workerPort.postMessage({ id, resolve: await service.transform(args[0], args[1]) }); + break; + case "formatMessages": + workerPort.postMessage({ id, resolve: await service.formatMessages(args[0], args[1]) }); + break; + case "analyzeMetafile": + workerPort.postMessage({ id, resolve: await service.analyzeMetafile(args[0], args[1]) }); + break; + default: + throw new Error(`Invalid command: ${command}`); + } + } catch (reject) { + workerPort.postMessage({ id, reject, properties: extractProperties(reject) }); + } + Atomics.add(sharedBufferView, 0, 1); + Atomics.notify(sharedBufferView, 0, Infinity); + })(); + }); + } catch (reject) { + parentPort.on("message", (msg) => { + let { sharedBuffer, id } = msg; + let sharedBufferView = new Int32Array(sharedBuffer); + workerPort.postMessage({ id, reject, properties: extractProperties(reject) }); + Atomics.add(sharedBufferView, 0, 1); + Atomics.notify(sharedBufferView, 0, Infinity); + }); + } +}; +if (isInternalWorkerThread) { + startSyncServiceWorker(); +} +var node_default = node_exports; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + analyzeMetafile, + analyzeMetafileSync, + build, + buildSync, + context, + formatMessages, + formatMessagesSync, + initialize, + stop, + transform, + transformSync, + version +}); diff --git a/.pnpm-store/v11/files/6c/37f2f813202630d36666997025c36a22bdf70169405444222a9a459d89f830ff9217e0630d9aeefb00492e691264d8675666c48b90096051bfb5caf2c8d241 b/.pnpm-store/v11/files/6c/37f2f813202630d36666997025c36a22bdf70169405444222a9a459d89f830ff9217e0630d9aeefb00492e691264d8675666c48b90096051bfb5caf2c8d241 new file mode 100644 index 0000000..62a1e59 --- /dev/null +++ b/.pnpm-store/v11/files/6c/37f2f813202630d36666997025c36a22bdf70169405444222a9a459d89f830ff9217e0630d9aeefb00492e691264d8675666c48b90096051bfb5caf2c8d241 @@ -0,0 +1,44 @@ +#include "./win_utils.hh" + +std::wstring utf8ToUtf16(std::string input) { + unsigned int len = MultiByteToWideChar(CP_UTF8, 0, input.c_str(), -1, NULL, 0); + WCHAR *output = new WCHAR[len]; + MultiByteToWideChar(CP_UTF8, 0, input.c_str(), -1, output, len); + std::wstring res(output); + delete[] output; + return res; +} + +std::string utf16ToUtf8(const WCHAR *input, DWORD length) { + unsigned int len = WideCharToMultiByte(CP_UTF8, 0, input, length, NULL, 0, NULL, NULL); + char *output = new char[len + 1]; + WideCharToMultiByte(CP_UTF8, 0, input, length, output, len, NULL, NULL); + output[len] = '\0'; + std::string res(output); + delete[] output; + return res; +} + +std::string normalizePath(std::string path) { + // Prevent truncation to MAX_PATH characters by adding the \\?\ prefix + std::wstring p = utf8ToUtf16("\\\\?\\" + path); + + // Get the required length for the output + DWORD len = GetLongPathNameW(p.data(), NULL, 0); + if (!len) { + return path; + } + + // Allocate output array and get long path + WCHAR *output = new WCHAR[len]; + len = GetLongPathNameW(p.data(), output, len); + if (!len) { + delete[] output; + return path; + } + + // Convert back to utf8 + std::string res = utf16ToUtf8(output + 4, len - 4); + delete[] output; + return res; +} diff --git a/.pnpm-store/v11/files/70/0c2e7edc594f2486f064a6e25ec61206a91d614cd897a4f54f93d0552ae1093bd52f130ffcbcdf07d8000feafbe35f500915d0bb5acf31fccc990cf5cee953 b/.pnpm-store/v11/files/70/0c2e7edc594f2486f064a6e25ec61206a91d614cd897a4f54f93d0552ae1093bd52f130ffcbcdf07d8000feafbe35f500915d0bb5acf31fccc990cf5cee953 new file mode 100644 index 0000000..0e9b84f --- /dev/null +++ b/.pnpm-store/v11/files/70/0c2e7edc594f2486f064a6e25ec61206a91d614cd897a4f54f93d0552ae1093bd52f130ffcbcdf07d8000feafbe35f500915d0bb5acf31fccc990cf5cee953 @@ -0,0 +1,41 @@ +#include +#include "../DirTree.hh" +#include "../Event.hh" +#include "./BruteForceBackend.hh" + +std::shared_ptr BruteForceBackend::getTree(WatcherRef watcher, bool shouldRead) { + auto tree = DirTree::getCached(watcher->mDir); + + // If the tree is not complete, read it if needed. + if (!tree->isComplete && shouldRead) { + readTree(watcher, tree); + tree->isComplete = true; + } + + return tree; +} + +void BruteForceBackend::writeSnapshot(WatcherRef watcher, std::string *snapshotPath) { + std::unique_lock lock(mMutex); + auto tree = getTree(watcher); + FILE *f = fopen(snapshotPath->c_str(), "w"); + if (!f) { + throw std::runtime_error(std::string("Unable to open snapshot file: ") + strerror(errno)); + } + + tree->write(f); + fclose(f); +} + +void BruteForceBackend::getEventsSince(WatcherRef watcher, std::string *snapshotPath) { + std::unique_lock lock(mMutex); + FILE *f = fopen(snapshotPath->c_str(), "r"); + if (!f) { + throw std::runtime_error(std::string("Unable to open snapshot file: ") + strerror(errno)); + } + + DirTree snapshot{watcher->mDir, f}; + auto now = getTree(watcher); + now->getChanges(&snapshot, watcher->mEvents); + fclose(f); +} diff --git a/.pnpm-store/v11/files/71/02a832a8d6ec3f1d6d0e67dfff9ae2d6b1d69df993ac55d9f9d3c8779e5779d60072ce138a59c85d60d445e56618a25c22ce5bc475542ebc13eabe324d42b2 b/.pnpm-store/v11/files/71/02a832a8d6ec3f1d6d0e67dfff9ae2d6b1d69df993ac55d9f9d3c8779e5779d60072ce138a59c85d60d445e56618a25c22ce5bc475542ebc13eabe324d42b2 new file mode 100644 index 0000000..4ca3bb6 --- /dev/null +++ b/.pnpm-store/v11/files/71/02a832a8d6ec3f1d6d0e67dfff9ae2d6b1d69df993ac55d9f9d3c8779e5779d60072ce138a59c85d60d445e56618a25c22ce5bc475542ebc13eabe324d42b2 @@ -0,0 +1,101 @@ +#ifndef PROMISE_RUNNER_H +#define PROMISE_RUNNER_H + +#include +#include "wasm/include.h" +#include + +using namespace Napi; + +class PromiseRunner { +public: + const Env env; + Promise::Deferred deferred; + + PromiseRunner(Env env) : env(env), deferred(Promise::Deferred::New(env)) { + napi_status status = napi_create_async_work(env, nullptr, env.Undefined(), + onExecute, onWorkComplete, this, &work); + if (status != napi_ok) { + work = nullptr; + const napi_extended_error_info *error_info = 0; + napi_get_last_error_info(env, &error_info); + if (error_info->error_message) { + Error::New(env, error_info->error_message).ThrowAsJavaScriptException(); + } else { + Error::New(env).ThrowAsJavaScriptException(); + } + } + } + + virtual ~PromiseRunner() {} + + Value queue() { + if (work) { + napi_status status = napi_queue_async_work(env, work); + if (status != napi_ok) { + onError(Error::New(env)); + } + } + + return deferred.Promise(); + } + +private: + napi_async_work work; + std::string error; + + static void onExecute(napi_env env, void *this_pointer) { + PromiseRunner* self = (PromiseRunner*) this_pointer; + try { + self->execute(); + } catch (std::exception &err) { + self->error = err.what(); + } + } + + static void onWorkComplete(napi_env env, napi_status status, void *this_pointer) { + PromiseRunner* self = (PromiseRunner*) this_pointer; + if (status != napi_cancelled) { + HandleScope scope(self->env); + if (status == napi_ok) { + status = napi_delete_async_work(self->env, self->work); + if (status == napi_ok) { + if (self->error.size() == 0) { + self->onOK(); + } else { + self->onError(Error::New(self->env, self->error)); + } + delete self; + return; + } + } + } + + // fallthrough for error handling + const napi_extended_error_info *error_info = 0; + napi_get_last_error_info(env, &error_info); + if (error_info->error_message){ + self->onError(Error::New(env, error_info->error_message)); + } else { + self->onError(Error::New(env)); + } + delete self; + } + + virtual void execute() {} + virtual Value getResult() { + return env.Null(); + } + + void onOK() { + HandleScope scope(env); + Value result = getResult(); + deferred.Resolve(result); + } + + void onError(const Error &e) { + deferred.Reject(e.Value()); + } +}; + +#endif diff --git a/.pnpm-store/v11/files/74/20f22f71a29a5395c7f28cb61c0c090baf087529f9eeeada3f7ee5751a8fd6da98caeed09f284c5ca9861592a48010bf091d3d04be5d65e9b14ea7e6ad0118 b/.pnpm-store/v11/files/74/20f22f71a29a5395c7f28cb61c0c090baf087529f9eeeada3f7ee5751a8fd6da98caeed09f284c5ca9861592a48010bf091d3d04be5d65e9b14ea7e6ad0118 new file mode 100644 index 0000000..09a53d5 --- /dev/null +++ b/.pnpm-store/v11/files/74/20f22f71a29a5395c7f28cb61c0c090baf087529f9eeeada3f7ee5751a8fd6da98caeed09f284c5ca9861592a48010bf091d3d04be5d65e9b14ea7e6ad0118 @@ -0,0 +1,186 @@ +#ifdef FS_EVENTS +#include "macos/FSEventsBackend.hh" +#endif +#ifdef WATCHMAN +#include "watchman/WatchmanBackend.hh" +#endif +#ifdef WINDOWS +#include "windows/WindowsBackend.hh" +#endif +#ifdef INOTIFY +#include "linux/InotifyBackend.hh" +#endif +#ifdef KQUEUE +#include "kqueue/KqueueBackend.hh" +#endif +#ifdef __wasm32__ +#include "wasm/WasmBackend.hh" +#endif +#include "shared/BruteForceBackend.hh" + +#include "Backend.hh" +#include + +static std::unordered_map>& getSharedBackends() { + static std::unordered_map>* sharedBackends = + new std::unordered_map>(); + return *sharedBackends; +} + +std::shared_ptr getBackend(std::string backend) { + // Use FSEvents on macOS by default. + // Use watchman by default if available on other platforms. + // Fall back to brute force. + #ifdef FS_EVENTS + if (backend == "fs-events" || backend == "default") { + return std::make_shared(); + } + #endif + #ifdef WATCHMAN + if ((backend == "watchman" || backend == "default") && WatchmanBackend::checkAvailable()) { + return std::make_shared(); + } + #endif + #ifdef WINDOWS + if (backend == "windows" || backend == "default") { + return std::make_shared(); + } + #endif + #ifdef INOTIFY + if (backend == "inotify" || backend == "default") { + return std::make_shared(); + } + #endif + #ifdef KQUEUE + if (backend == "kqueue" || backend == "default") { + return std::make_shared(); + } + #endif + #ifdef __wasm32__ + if (backend == "wasm" || backend == "default") { + return std::make_shared(); + } + #endif + if (backend == "brute-force" || backend == "default") { + return std::make_shared(); + } + + return nullptr; +} + +std::shared_ptr Backend::getShared(std::string backend) { + auto found = getSharedBackends().find(backend); + if (found != getSharedBackends().end()) { + return found->second; + } + + auto result = getBackend(backend); + if (!result) { + return getShared("default"); + } + + result->run(); + getSharedBackends().emplace(backend, result); + return result; +} + +void removeShared(Backend *backend) { + for (auto it = getSharedBackends().begin(); it != getSharedBackends().end(); it++) { + if (it->second.get() == backend) { + getSharedBackends().erase(it); + break; + } + } + + // Free up memory. + if (getSharedBackends().size() == 0) { + getSharedBackends().rehash(0); + } +} + +void Backend::run() { + #ifndef __wasm32__ + mThread = std::thread([this] () { + try { + start(); + } catch (std::exception &err) { + handleError(err); + } + }); + + if (mThread.joinable()) { + mStartedSignal.wait(); + } + #else + try { + start(); + } catch (std::exception &err) { + handleError(err); + } + #endif +} + +void Backend::notifyStarted() { + mStartedSignal.notify(); +} + +void Backend::start() { + notifyStarted(); +} + +Backend::~Backend() { + #ifndef __wasm32__ + // Wait for thread to stop + if (mThread.joinable()) { + // If the backend is being destroyed from the thread itself, detach, otherwise join. + if (mThread.get_id() == std::this_thread::get_id()) { + mThread.detach(); + } else { + mThread.join(); + } + } + #endif +} + +void Backend::watch(WatcherRef watcher) { + std::unique_lock lock(mMutex); + auto res = mSubscriptions.find(watcher); + if (res == mSubscriptions.end()) { + try { + this->subscribe(watcher); + mSubscriptions.insert(watcher); + } catch (std::exception&) { + unref(); + throw; + } + } +} + +void Backend::unwatch(WatcherRef watcher) { + std::unique_lock lock(mMutex); + size_t deleted = mSubscriptions.erase(watcher); + if (deleted > 0) { + this->unsubscribe(watcher); + unref(); + } +} + +void Backend::unref() { + if (mSubscriptions.size() == 0) { + removeShared(this); + } +} + +void Backend::handleWatcherError(WatcherError &err) { + unwatch(err.mWatcher); + err.mWatcher->notifyError(err); +} + +void Backend::handleError(std::exception &err) { + std::unique_lock lock(mMutex); + for (auto it = mSubscriptions.begin(); it != mSubscriptions.end(); it++) { + (*it)->notifyError(err); + } + + removeShared(this); +} diff --git a/.pnpm-store/v11/files/74/ac43d70fe7bc5286ddb8dfde218ef3ae9c815a3eb7e93023b49e95e2f0a0260a347c50c617a602384153294b8230ad5a280b1941beddb7b3321303f2a1ad40 b/.pnpm-store/v11/files/74/ac43d70fe7bc5286ddb8dfde218ef3ae9c815a3eb7e93023b49e95e2f0a0260a347c50c617a602384153294b8230ad5a280b1941beddb7b3321303f2a1ad40 new file mode 100644 index 0000000..cfda962 --- /dev/null +++ b/.pnpm-store/v11/files/74/ac43d70fe7bc5286ddb8dfde218ef3ae9c815a3eb7e93023b49e95e2f0a0260a347c50c617a602384153294b8230ad5a280b1941beddb7b3321303f2a1ad40 @@ -0,0 +1,338 @@ +#include +#include +#include +#include +#include +#include "../Event.hh" +#include "../Backend.hh" +#include "./FSEventsBackend.hh" +#include "../Watcher.hh" + +#define CONVERT_TIME(ts) ((uint64_t)ts.tv_sec * 1000000000 + ts.tv_nsec) +#define IGNORED_FLAGS (kFSEventStreamEventFlagItemIsHardlink | kFSEventStreamEventFlagItemIsLastHardlink | kFSEventStreamEventFlagItemIsSymlink | kFSEventStreamEventFlagItemIsDir | kFSEventStreamEventFlagItemIsFile) + +void stopStream(FSEventStreamRef stream, CFRunLoopRef runLoop) { + FSEventStreamStop(stream); + FSEventStreamUnscheduleFromRunLoop(stream, runLoop, kCFRunLoopDefaultMode); + FSEventStreamInvalidate(stream); + FSEventStreamRelease(stream); +} + +// macOS has a case insensitive file system by default. In order to detect +// file renames that only affect case, we need to get the canonical path +// and compare it with the input path to determine if a file was created or deleted. +bool pathExists(char *path) { + int fd = open(path, O_RDONLY | O_SYMLINK); + if (fd == -1) { + return false; + } + + char buf[PATH_MAX]; + if (fcntl(fd, F_GETPATH, buf) == -1) { + close(fd); + return false; + } + + bool res = strncmp(path, buf, PATH_MAX) == 0; + close(fd); + return res; +} + +class State: public WatcherState { +public: + FSEventStreamRef stream; + std::shared_ptr tree; + uint64_t since; +}; + +void FSEventsCallback( + ConstFSEventStreamRef streamRef, + void *clientCallBackInfo, + size_t numEvents, + void *eventPaths, + const FSEventStreamEventFlags eventFlags[], + const FSEventStreamEventId eventIds[] +) { + char **paths = (char **)eventPaths; + std::shared_ptr& watcher = *static_cast *>(clientCallBackInfo); + + EventList& list = watcher->mEvents; + if (watcher->state == nullptr) { + return; + } + + auto stateGuard = watcher->state; + auto* state = static_cast(stateGuard.get()); + uint64_t since = state->since; + bool deletedRoot = false; + + for (size_t i = 0; i < numEvents; ++i) { + bool isCreated = (eventFlags[i] & kFSEventStreamEventFlagItemCreated) == kFSEventStreamEventFlagItemCreated; + bool isRemoved = (eventFlags[i] & kFSEventStreamEventFlagItemRemoved) == kFSEventStreamEventFlagItemRemoved; + bool isModified = (eventFlags[i] & kFSEventStreamEventFlagItemModified) == kFSEventStreamEventFlagItemModified || + (eventFlags[i] & kFSEventStreamEventFlagItemInodeMetaMod) == kFSEventStreamEventFlagItemInodeMetaMod || + (eventFlags[i] & kFSEventStreamEventFlagItemFinderInfoMod) == kFSEventStreamEventFlagItemFinderInfoMod || + (eventFlags[i] & kFSEventStreamEventFlagItemChangeOwner) == kFSEventStreamEventFlagItemChangeOwner || + (eventFlags[i] & kFSEventStreamEventFlagItemXattrMod) == kFSEventStreamEventFlagItemXattrMod; + bool isRenamed = (eventFlags[i] & kFSEventStreamEventFlagItemRenamed) == kFSEventStreamEventFlagItemRenamed; + bool isDone = (eventFlags[i] & kFSEventStreamEventFlagHistoryDone) == kFSEventStreamEventFlagHistoryDone; + bool isDir = (eventFlags[i] & kFSEventStreamEventFlagItemIsDir) == kFSEventStreamEventFlagItemIsDir; + + + if (eventFlags[i] & kFSEventStreamEventFlagMustScanSubDirs) { + if (eventFlags[i] & kFSEventStreamEventFlagUserDropped) { + list.error("Events were dropped by the FSEvents client. File system must be re-scanned."); + } else if (eventFlags[i] & kFSEventStreamEventFlagKernelDropped) { + list.error("Events were dropped by the kernel. File system must be re-scanned."); + } else { + list.error("Too many events. File system must be re-scanned."); + } + } + + if (isDone) { + watcher->notify(); + break; + } + + auto ignoredFlags = IGNORED_FLAGS; + if (__builtin_available(macOS 10.13, *)) { + ignoredFlags |= kFSEventStreamEventFlagItemCloned; + } + + // If we don't care about any of the flags that are set, ignore this event. + if ((eventFlags[i] & ~ignoredFlags) == 0) { + continue; + } + + // FSEvents exclusion paths only apply to files, not directories. + if (watcher->isIgnored(paths[i])) { + continue; + } + + // Handle unambiguous events first + if (isCreated && !(isRemoved || isModified || isRenamed)) { + state->tree->add(paths[i], 0, isDir); + list.create(paths[i]); + } else if (isRemoved && !(isCreated || isModified || isRenamed)) { + state->tree->remove(paths[i]); + list.remove(paths[i]); + if (paths[i] == watcher->mDir) { + deletedRoot = true; + } + } else if (isModified && !(isCreated || isRemoved || isRenamed)) { + struct stat file; + if (stat(paths[i], &file)) { + continue; + } + + // Ignore if mtime is the same as the last event. + // This prevents duplicate events from being emitted. + // If tv_nsec is zero, the file system probably only has second-level + // granularity so allow the even through in that case. + uint64_t mtime = CONVERT_TIME(file.st_mtimespec); + DirEntry *entry = state->tree->find(paths[i]); + if (entry && mtime == entry->mtime && file.st_mtimespec.tv_nsec != 0) { + continue; + } + + if (entry) { + // Update mtime. + entry->mtime = mtime; + } else { + // Add to tree if this path has not been discovered yet. + state->tree->add(paths[i], mtime, S_ISDIR(file.st_mode)); + } + + list.update(paths[i]); + } else { + // If multiple flags were set, then we need to call `stat` to determine if the file really exists. + // This helps disambiguate creates, updates, and deletes. + struct stat file; + if (stat(paths[i], &file) || !pathExists(paths[i])) { + // File does not exist, so we have to assume it was removed. This is not exact since the + // flags set by fsevents get coalesced together (e.g. created & deleted), so there is no way to + // know whether the create and delete both happened since our snapshot (in which case + // we'd rather ignore this event completely). This will result in some extra delete events + // being emitted for files we don't know about, but that is the best we can do. + state->tree->remove(paths[i]); + list.remove(paths[i]); + if (paths[i] == watcher->mDir) { + deletedRoot = true; + } + continue; + } + + // If the file was modified, and existed before, then this is an update, otherwise a create. + uint64_t ctime = CONVERT_TIME(file.st_birthtimespec); + uint64_t mtime = CONVERT_TIME(file.st_mtimespec); + DirEntry *entry = !since ? state->tree->find(paths[i]) : NULL; + if (entry && entry->mtime == mtime && file.st_mtimespec.tv_nsec != 0) { + continue; + } + + // Some mounted file systems report a creation time of 0/unix epoch which we special case. + if (isModified && (entry || (ctime <= since && ctime != 0))) { + state->tree->update(paths[i], mtime); + list.update(paths[i]); + } else { + state->tree->add(paths[i], mtime, S_ISDIR(file.st_mode)); + list.create(paths[i]); + } + } + } + + if (!since) { + watcher->notify(); + } + + // Stop watching if the root directory was deleted. + if (deletedRoot) { + stopStream((FSEventStreamRef)streamRef, CFRunLoopGetCurrent()); + watcher->state = nullptr; + } +} + +void checkWatcher(WatcherRef watcher) { + struct stat file; + if (stat(watcher->mDir.c_str(), &file)) { + throw WatcherError(strerror(errno), watcher); + } + + if (!S_ISDIR(file.st_mode)) { + throw WatcherError(strerror(ENOTDIR), watcher); + } +} + +void FSEventsBackend::startStream(WatcherRef watcher, FSEventStreamEventId id) { + checkWatcher(watcher); + + CFAbsoluteTime latency = 0.001; + CFStringRef fileWatchPath = CFStringCreateWithCString( + NULL, + watcher->mDir.c_str(), + kCFStringEncodingUTF8 + ); + + CFArrayRef pathsToWatch = CFArrayCreate( + NULL, + (const void **)&fileWatchPath, + 1, + NULL + ); + + // Make a watcher reference we can pass into the callback. This ensures bumped ref-count. + std::shared_ptr* callbackWatcher = new std::shared_ptr (watcher); + FSEventStreamContext callbackInfo {0, static_cast (callbackWatcher), nullptr, nullptr, nullptr}; + FSEventStreamRef stream = FSEventStreamCreate( + NULL, + &FSEventsCallback, + &callbackInfo, + pathsToWatch, + id, + latency, + kFSEventStreamCreateFlagFileEvents + ); + + CFMutableArrayRef exclusions = CFArrayCreateMutable(NULL, watcher->mIgnorePaths.size(), NULL); + for (auto it = watcher->mIgnorePaths.begin(); it != watcher->mIgnorePaths.end(); it++) { + CFStringRef path = CFStringCreateWithCString( + NULL, + it->c_str(), + kCFStringEncodingUTF8 + ); + + CFArrayAppendValue(exclusions, (const void *)path); + } + + FSEventStreamSetExclusionPaths(stream, exclusions); + + FSEventStreamScheduleWithRunLoop(stream, mRunLoop, kCFRunLoopDefaultMode); + bool started = FSEventStreamStart(stream); + + CFRelease(pathsToWatch); + CFRelease(fileWatchPath); + + if (!started) { + FSEventStreamRelease(stream); + throw WatcherError("Error starting FSEvents stream", watcher); + } + + auto stateGuard = watcher->state; + State* s = static_cast(stateGuard.get()); + s->tree = std::make_shared(watcher->mDir); + s->stream = stream; +} + +void FSEventsBackend::start() { + mRunLoop = CFRunLoopGetCurrent(); + CFRetain(mRunLoop); + + // Unlock once run loop has started. + CFRunLoopPerformBlock(mRunLoop, kCFRunLoopDefaultMode, ^ { + notifyStarted(); + }); + + CFRunLoopWakeUp(mRunLoop); + CFRunLoopRun(); +} + +FSEventsBackend::~FSEventsBackend() { + std::unique_lock lock(mMutex); + CFRunLoopStop(mRunLoop); + CFRelease(mRunLoop); +} + +void FSEventsBackend::writeSnapshot(WatcherRef watcher, std::string *snapshotPath) { + std::unique_lock lock(mMutex); + checkWatcher(watcher); + + FSEventStreamEventId id = FSEventsGetCurrentEventId(); + std::ofstream ofs(*snapshotPath); + ofs << id; + ofs << "\n"; + + struct timespec now; + clock_gettime(CLOCK_REALTIME, &now); + ofs << CONVERT_TIME(now); +} + +void FSEventsBackend::getEventsSince(WatcherRef watcher, std::string *snapshotPath) { + std::unique_lock lock(mMutex); + std::ifstream ifs(*snapshotPath); + if (ifs.fail()) { + return; + } + + FSEventStreamEventId id; + uint64_t since; + ifs >> id; + ifs >> since; + + auto s = std::make_shared(); + s->since = since; + watcher->state = s; + + startStream(watcher, id); + watcher->wait(); + stopStream(s->stream, mRunLoop); + + watcher->state = nullptr; +} + +// This function is called by Backend::watch which takes a lock on mMutex +void FSEventsBackend::subscribe(WatcherRef watcher) { + auto s = std::make_shared(); + s->since = 0; + watcher->state = s; + startStream(watcher, kFSEventStreamEventIdSinceNow); +} + +// This function is called by Backend::unwatch which takes a lock on mMutex +void FSEventsBackend::unsubscribe(WatcherRef watcher) { + auto stateGuard = watcher->state; + State* s = static_cast(stateGuard.get()); + if (s != nullptr) { + stopStream(s->stream, mRunLoop); + watcher->state = nullptr; + } +} diff --git a/.pnpm-store/v11/files/75/887f9f0cf9922bd0d19e042764039e10ef1fe19f847959531b9b074ac162a63f0a5582d41ca13f1faacae9e9470102f6949cc7be6aaeb307bbb7457d54c7da b/.pnpm-store/v11/files/75/887f9f0cf9922bd0d19e042764039e10ef1fe19f847959531b9b074ac162a63f0a5582d41ca13f1faacae9e9470102f6949cc7be6aaeb307bbb7457d54c7da new file mode 100644 index 0000000..82390dd --- /dev/null +++ b/.pnpm-store/v11/files/75/887f9f0cf9922bd0d19e042764039e10ef1fe19f847959531b9b074ac162a63f0a5582d41ca13f1faacae9e9470102f6949cc7be6aaeb307bbb7457d54c7da @@ -0,0 +1,302 @@ +#include +#include "./BSER.hh" + +BSERType decodeType(std::istream &iss) { + int8_t type; + iss.read(reinterpret_cast(&type), sizeof(type)); + return (BSERType) type; +} + +void expectType(std::istream &iss, BSERType expected) { + BSERType got = decodeType(iss); + if (got != expected) { + throw std::runtime_error("Unexpected BSER type"); + } +} + +void encodeType(std::ostream &oss, BSERType type) { + int8_t t = (int8_t)type; + oss.write(reinterpret_cast(&t), sizeof(t)); +} + +template +class Value : public BSERValue { +public: + T value; + Value(T val) { + value = val; + } + + Value() {} +}; + +class BSERInteger : public Value { +public: + BSERInteger(int64_t value) : Value(value) {} + BSERInteger(std::istream &iss) { + int8_t int8; + int16_t int16; + int32_t int32; + int64_t int64; + + BSERType type = decodeType(iss); + + switch (type) { + case BSER_INT8: + iss.read(reinterpret_cast(&int8), sizeof(int8)); + value = int8; + break; + case BSER_INT16: + iss.read(reinterpret_cast(&int16), sizeof(int16)); + value = int16; + break; + case BSER_INT32: + iss.read(reinterpret_cast(&int32), sizeof(int32)); + value = int32; + break; + case BSER_INT64: + iss.read(reinterpret_cast(&int64), sizeof(int64)); + value = int64; + break; + default: + throw std::runtime_error("Invalid BSER int type"); + } + } + + int64_t intValue() override { + return value; + } + + void encode(std::ostream &oss) override { + if (value <= INT8_MAX) { + encodeType(oss, BSER_INT8); + int8_t v = (int8_t)value; + oss.write(reinterpret_cast(&v), sizeof(v)); + } else if (value <= INT16_MAX) { + encodeType(oss, BSER_INT16); + int16_t v = (int16_t)value; + oss.write(reinterpret_cast(&v), sizeof(v)); + } else if (value <= INT32_MAX) { + encodeType(oss, BSER_INT32); + int32_t v = (int32_t)value; + oss.write(reinterpret_cast(&v), sizeof(v)); + } else { + encodeType(oss, BSER_INT64); + oss.write(reinterpret_cast(&value), sizeof(value)); + } + } +}; + +class BSERArray : public Value { +public: + BSERArray() : Value() {} + BSERArray(BSER::Array value) : Value(value) {} + BSERArray(std::istream &iss) { + expectType(iss, BSER_ARRAY); + int64_t len = BSERInteger(iss).intValue(); + for (int64_t i = 0; i < len; i++) { + value.push_back(BSER(iss)); + } + } + + BSER::Array arrayValue() override { + return value; + } + + void encode(std::ostream &oss) override { + encodeType(oss, BSER_ARRAY); + BSERInteger(value.size()).encode(oss); + for (auto it = value.begin(); it != value.end(); it++) { + it->encode(oss); + } + } +}; + +class BSERString : public Value { +public: + BSERString(std::string value) : Value(value) {} + BSERString(std::istream &iss) { + expectType(iss, BSER_STRING); + int64_t len = BSERInteger(iss).intValue(); + value.resize(len); + iss.read(&value[0], len); + } + + std::string stringValue() override { + return value; + } + + void encode(std::ostream &oss) override { + encodeType(oss, BSER_STRING); + BSERInteger(value.size()).encode(oss); + oss << value; + } +}; + +class BSERObject : public Value { +public: + BSERObject() : Value() {} + BSERObject(BSER::Object value) : Value(value) {} + BSERObject(std::istream &iss) { + expectType(iss, BSER_OBJECT); + int64_t len = BSERInteger(iss).intValue(); + for (int64_t i = 0; i < len; i++) { + auto key = BSERString(iss).stringValue(); + auto val = BSER(iss); + value.emplace(key, val); + } + } + + BSER::Object objectValue() override { + return value; + } + + void encode(std::ostream &oss) override { + encodeType(oss, BSER_OBJECT); + BSERInteger(value.size()).encode(oss); + for (auto it = value.begin(); it != value.end(); it++) { + BSERString(it->first).encode(oss); + it->second.encode(oss); + } + } +}; + +class BSERDouble : public Value { +public: + BSERDouble(double value) : Value(value) {} + BSERDouble(std::istream &iss) { + expectType(iss, BSER_REAL); + iss.read(reinterpret_cast(&value), sizeof(value)); + } + + double doubleValue() override { + return value; + } + + void encode(std::ostream &oss) override { + encodeType(oss, BSER_REAL); + oss.write(reinterpret_cast(&value), sizeof(value)); + } +}; + +class BSERBoolean : public Value { +public: + BSERBoolean(bool value) : Value(value) {} + bool boolValue() override { return value; } + void encode(std::ostream &oss) override { + int8_t t = value == true ? static_cast(BSER_BOOL_TRUE) : static_cast(BSER_BOOL_FALSE); + oss.write(reinterpret_cast(&t), sizeof(t)); + } +}; + +class BSERNull : public Value { +public: + BSERNull() : Value(false) {} + void encode(std::ostream &oss) override { + encodeType(oss, BSER_NULL); + } +}; + +std::shared_ptr decodeTemplate(std::istream &iss) { + expectType(iss, BSER_TEMPLATE); + auto keys = BSERArray(iss).arrayValue(); + auto len = BSERInteger(iss).intValue(); + std::shared_ptr arr = std::make_shared(); + for (int64_t i = 0; i < len; i++) { + BSER::Object obj; + for (auto it = keys.begin(); it != keys.end(); it++) { + if (iss.peek() == 0x0c) { + iss.ignore(1); + continue; + } + + auto val = BSER(iss); + obj.emplace(it->stringValue(), val); + } + arr->value.push_back(obj); + } + return arr; +} + +BSER::BSER(std::istream &iss) { + BSERType type = decodeType(iss); + iss.unget(); + + switch (type) { + case BSER_ARRAY: + m_ptr = std::make_shared(iss); + break; + case BSER_OBJECT: + m_ptr = std::make_shared(iss); + break; + case BSER_STRING: + m_ptr = std::make_shared(iss); + break; + case BSER_INT8: + case BSER_INT16: + case BSER_INT32: + case BSER_INT64: + m_ptr = std::make_shared(iss); + break; + case BSER_REAL: + m_ptr = std::make_shared(iss); + break; + case BSER_BOOL_TRUE: + iss.ignore(1); + m_ptr = std::make_shared(true); + break; + case BSER_BOOL_FALSE: + iss.ignore(1); + m_ptr = std::make_shared(false); + break; + case BSER_NULL: + iss.ignore(1); + m_ptr = std::make_shared(); + break; + case BSER_TEMPLATE: + m_ptr = decodeTemplate(iss); + break; + default: + throw std::runtime_error("unknown BSER type"); + } +} + +BSER::BSER() : m_ptr(std::make_shared()) {} +BSER::BSER(BSER::Array value) : m_ptr(std::make_shared(value)) {} +BSER::BSER(BSER::Object value) : m_ptr(std::make_shared(value)) {} +BSER::BSER(const char *value) : m_ptr(std::make_shared(value)) {} +BSER::BSER(std::string value) : m_ptr(std::make_shared(value)) {} +BSER::BSER(int64_t value) : m_ptr(std::make_shared(value)) {} +BSER::BSER(double value) : m_ptr(std::make_shared(value)) {} +BSER::BSER(bool value) : m_ptr(std::make_shared(value)) {} + +BSER::Array BSER::arrayValue() { return m_ptr->arrayValue(); } +BSER::Object BSER::objectValue() { return m_ptr->objectValue(); } +std::string BSER::stringValue() { return m_ptr->stringValue(); } +int64_t BSER::intValue() { return m_ptr->intValue(); } +double BSER::doubleValue() { return m_ptr->doubleValue(); } +bool BSER::boolValue() { return m_ptr->boolValue(); } +void BSER::encode(std::ostream &oss) { + m_ptr->encode(oss); +} + +int64_t BSER::decodeLength(std::istream &iss) { + char pdu[2]; + if (!iss.read(pdu, 2) || pdu[0] != 0 || pdu[1] != 1) { + throw std::runtime_error("Invalid BSER"); + } + + return BSERInteger(iss).intValue(); +} + +std::string BSER::encode() { + std::ostringstream oss(std::ios_base::binary); + encode(oss); + + std::ostringstream res(std::ios_base::binary); + res.write("\x00\x01", 2); + + BSERInteger(oss.str().size()).encode(res); + res << oss.str(); + return res.str(); +} diff --git a/.pnpm-store/v11/files/77/c9c52835cb3a3adfbd7db2b0e30c1fbd2599de89ceb2423140ed4ab96a44436bef072120003da3584c5fa8b5c46fb5017ebe3767db1aa00a925c278f1f30c4 b/.pnpm-store/v11/files/77/c9c52835cb3a3adfbd7db2b0e30c1fbd2599de89ceb2423140ed4ab96a44436bef072120003da3584c5fa8b5c46fb5017ebe3767db1aa00a925c278f1f30c4 new file mode 100644 index 0000000..93863d1 --- /dev/null +++ b/.pnpm-store/v11/files/77/c9c52835cb3a3adfbd7db2b0e30c1fbd2599de89ceb2423140ed4ab96a44436bef072120003da3584c5fa8b5c46fb5017ebe3767db1aa00a925c278f1f30c4 @@ -0,0 +1,3 @@ +# esbuild + +This is a JavaScript bundler and minifier. See https://github.com/evanw/esbuild and the [JavaScript API documentation](https://esbuild.github.io/api/) for details. diff --git a/.pnpm-store/v11/files/80/6a2934d5c0a1fc54f3edba4b37eda29baeda26a6214c1a77923f048e40a835c2ac8b3b59bb0ed609434eca460200a011387b2f6bc280e26bf7afdc6cc7ae4d b/.pnpm-store/v11/files/80/6a2934d5c0a1fc54f3edba4b37eda29baeda26a6214c1a77923f048e40a835c2ac8b3b59bb0ed609434eca460200a011387b2f6bc280e26bf7afdc6cc7ae4d new file mode 100644 index 0000000..d50c3e4 --- /dev/null +++ b/.pnpm-store/v11/files/80/6a2934d5c0a1fc54f3edba4b37eda29baeda26a6214c1a77923f048e40a835c2ac8b3b59bb0ed609434eca460200a011387b2f6bc280e26bf7afdc6cc7ae4d @@ -0,0 +1,50 @@ +#include + +// weird error on linux +#ifdef __THROW +#undef __THROW +#endif +#define __THROW + +#include +#include +#include "../DirTree.hh" +#include "../shared/BruteForceBackend.hh" + +#define CONVERT_TIME(ts) ((uint64_t)ts.tv_sec * 1000000000 + ts.tv_nsec) +#if __APPLE__ +#define st_mtim st_mtimespec +#endif + +void BruteForceBackend::readTree(WatcherRef watcher, std::shared_ptr tree) { + char *paths[2] {(char *)watcher->mDir.c_str(), NULL}; + FTS *fts = fts_open(paths, FTS_NOCHDIR | FTS_PHYSICAL, NULL); + if (!fts) { + throw WatcherError(strerror(errno), watcher); + } + + FTSENT *node; + bool isRoot = true; + + while ((node = fts_read(fts)) != NULL) { + if (node->fts_errno) { + fts_close(fts); + throw WatcherError(strerror(node->fts_errno), watcher); + } + + if (isRoot && !(node->fts_info & FTS_D)) { + fts_close(fts); + throw WatcherError(strerror(ENOTDIR), watcher); + } + + if (watcher->isIgnored(std::string(node->fts_path))) { + fts_set(fts, node, FTS_SKIP); + continue; + } + + tree->add(node->fts_path, CONVERT_TIME(node->fts_statp->st_mtim), (node->fts_info & FTS_D) == FTS_D); + isRoot = false; + } + + fts_close(fts); +} diff --git a/.pnpm-store/v11/files/90/2e9f1e344474fd6ad5c201340900c83268eac7bf6fecaac63d3246b170459809bd9702fc93c26615028267434e3c7b6cef907a690ccab8537ef23711fc59b9 b/.pnpm-store/v11/files/90/2e9f1e344474fd6ad5c201340900c83268eac7bf6fecaac63d3246b170459809bd9702fc93c26615028267434e3c7b6cef907a690ccab8537ef23711fc59b9 new file mode 100644 index 0000000..94aa62f --- /dev/null +++ b/.pnpm-store/v11/files/90/2e9f1e344474fd6ad5c201340900c83268eac7bf6fecaac63d3246b170459809bd9702fc93c26615028267434e3c7b6cef907a690ccab8537ef23711fc59b9 @@ -0,0 +1,175 @@ +#ifndef IPC_H +#define IPC_H + +#include +#include + +#ifdef _WIN32 +#include +#include +#else +#include +#include +#include +#endif + +class IPC { +public: + IPC(std::string path) { + mStopped = false; + #ifdef _WIN32 + while (true) { + mPipe = CreateFile( + path.data(), // pipe name + GENERIC_READ | GENERIC_WRITE, // read and write access + 0, // no sharing + NULL, // default security attributes + OPEN_EXISTING, // opens existing pipe + FILE_FLAG_OVERLAPPED, // attributes + NULL // no template file + ); + + if (mPipe != INVALID_HANDLE_VALUE) { + break; + } + + if (GetLastError() != ERROR_PIPE_BUSY) { + throw std::runtime_error("Could not open pipe"); + } + + // Wait for pipe to become available if it is busy + if (!WaitNamedPipe(path.data(), 30000)) { + throw std::runtime_error("Error waiting for pipe"); + } + } + + mReader = CreateEvent(NULL, true, false, NULL); + mWriter = CreateEvent(NULL, true, false, NULL); + #else + struct sockaddr_un addr; + memset(&addr, 0, sizeof(addr)); + addr.sun_family = AF_UNIX; + strncpy(addr.sun_path, path.c_str(), sizeof(addr.sun_path) - 1); + + mSock = socket(AF_UNIX, SOCK_STREAM, 0); + if (connect(mSock, (struct sockaddr *) &addr, sizeof(struct sockaddr_un))) { + throw std::runtime_error("Error connecting to socket"); + } + #endif + } + + ~IPC() { + mStopped = true; + #ifdef _WIN32 + CancelIo(mPipe); + CloseHandle(mPipe); + CloseHandle(mReader); + CloseHandle(mWriter); + #else + shutdown(mSock, SHUT_RDWR); + #endif + } + + void write(std::string buf) { + #ifdef _WIN32 + OVERLAPPED overlapped; + overlapped.hEvent = mWriter; + bool success = WriteFile( + mPipe, // pipe handle + buf.data(), // message + static_cast(buf.size()), // message length + NULL, // bytes written + &overlapped // overlapped + ); + + if (mStopped) { + return; + } + + if (!success) { + if (GetLastError() != ERROR_IO_PENDING) { + throw std::runtime_error("Write error"); + } + } + + DWORD written; + success = GetOverlappedResult(mPipe, &overlapped, &written, true); + if (!success) { + throw std::runtime_error("GetOverlappedResult failed"); + } + + if (written != buf.size()) { + throw std::runtime_error("Wrong number of bytes written"); + } + #else + int r = 0; + for (unsigned int i = 0; i != buf.size(); i += r) { + r = ::write(mSock, &buf[i], buf.size() - i); + if (r == -1) { + if (errno == EAGAIN) { + r = 0; + } else if (mStopped) { + return; + } else { + throw std::runtime_error("Write error"); + } + } + } + #endif + } + + int read(char *buf, size_t len) { + #ifdef _WIN32 + OVERLAPPED overlapped; + overlapped.hEvent = mReader; + bool success = ReadFile( + mPipe, // pipe handle + buf, // buffer to receive reply + static_cast(len), // size of buffer + NULL, // number of bytes read + &overlapped // overlapped + ); + + if (!success && !mStopped) { + if (GetLastError() != ERROR_IO_PENDING) { + throw std::runtime_error("Read error"); + } + } + + DWORD read = 0; + success = GetOverlappedResult(mPipe, &overlapped, &read, true); + if (!success && !mStopped) { + throw std::runtime_error("GetOverlappedResult failed"); + } + + return read; + #else + int r = ::read(mSock, buf, len); + if (r == 0 && !mStopped) { + throw std::runtime_error("Socket ended unexpectedly"); + } + + if (r < 0) { + if (mStopped) { + return 0; + } + + throw std::runtime_error(strerror(errno)); + } + + return r; + #endif + } + +private: + bool mStopped; + #ifdef _WIN32 + HANDLE mPipe; + HANDLE mReader; + HANDLE mWriter; + #else + int mSock; + #endif +}; + +#endif diff --git a/.pnpm-store/v11/files/90/ec594f1c7956cad1ae2fbdca591fff38babde434a4f25fec0a2b1c8f9fe04981204ce221aa1372072c471ea5f437cde06f889c53c6b66f51300b1555890f3d b/.pnpm-store/v11/files/90/ec594f1c7956cad1ae2fbdca591fff38babde434a4f25fec0a2b1c8f9fe04981204ce221aa1372072c471ea5f437cde06f889c53c6b66f51300b1555890f3d new file mode 100644 index 0000000..be3a96d --- /dev/null +++ b/.pnpm-store/v11/files/90/ec594f1c7956cad1ae2fbdca591fff38babde434a4f25fec0a2b1c8f9fe04981204ce221aa1372072c471ea5f437cde06f889c53c6b66f51300b1555890f3d @@ -0,0 +1,34 @@ +import * as Vue from 'vue' + +var isVue2 = false +var isVue3 = true +var Vue2 = undefined + +function install() {} + +export function set(target, key, val) { + if (Array.isArray(target)) { + target.length = Math.max(target.length, key) + target.splice(key, 1, val) + return val + } + target[key] = val + return val +} + +export function del(target, key) { + if (Array.isArray(target)) { + target.splice(key, 1) + return + } + delete target[key] +} + +export * from 'vue' +export { + Vue, + Vue2, + isVue2, + isVue3, + install, +} diff --git a/.pnpm-store/v11/files/91/076dd22f8182e84769c6510fa4546202991ca5ccbc43511ebb86b158bcd193033364e1afdb175197956dd4c508138d3d3c7d4ef808c4c53af26ce456f09c72 b/.pnpm-store/v11/files/91/076dd22f8182e84769c6510fa4546202991ca5ccbc43511ebb86b158bcd193033364e1afdb175197956dd4c508138d3d3c7d4ef808c4c53af26ce456f09c72 new file mode 100644 index 0000000..057b61b --- /dev/null +++ b/.pnpm-store/v11/files/91/076dd22f8182e84769c6510fa4546202991ca5ccbc43511ebb86b158bcd193033364e1afdb175197956dd4c508138d3d3c7d4ef808c4c53af26ce456f09c72 @@ -0,0 +1,268 @@ +#include +#include +#include "wasm/include.h" +#include +#include "Glob.hh" +#include "Event.hh" +#include "Backend.hh" +#include "Watcher.hh" +#include "PromiseRunner.hh" + +using namespace Napi; + +std::unordered_set getIgnorePaths(Env env, Value opts) { + std::unordered_set result; + + if (opts.IsObject()) { + Value v = opts.As().Get(String::New(env, "ignorePaths")); + if (v.IsArray()) { + Array items = v.As(); + for (size_t i = 0; i < items.Length(); i++) { + Value item = items.Get(Number::New(env, static_cast(i))); + if (item.IsString()) { + result.insert(std::string(item.As().Utf8Value().c_str())); + } + } + } + } + + return result; +} + +std::unordered_set getIgnoreGlobs(Env env, Value opts) { + std::unordered_set result; + + if (opts.IsObject()) { + Value v = opts.As().Get(String::New(env, "ignoreGlobs")); + if (v.IsArray()) { + Array items = v.As(); + for (size_t i = 0; i < items.Length(); i++) { + Value item = items.Get(Number::New(env, static_cast(i))); + if (item.IsString()) { + auto key = item.As().Utf8Value(); + try { + result.emplace(key); + } catch (const std::regex_error& e) { + Error::New(env, e.what()).ThrowAsJavaScriptException(); + } + } + } + } + } + + return result; +} + +std::shared_ptr getBackend(Env env, Value opts) { + Value b = opts.As().Get(String::New(env, "backend")); + std::string backendName; + if (b.IsString()) { + backendName = std::string(b.As().Utf8Value().c_str()); + } + + return Backend::getShared(backendName); +} + +class WriteSnapshotRunner : public PromiseRunner { +public: + WriteSnapshotRunner(Env env, Value dir, Value snap, Value opts) + : PromiseRunner(env), + snapshotPath(std::string(snap.As().Utf8Value().c_str())) { + watcher = Watcher::getShared( + std::string(dir.As().Utf8Value().c_str()), + getIgnorePaths(env, opts), + getIgnoreGlobs(env, opts) + ); + + backend = getBackend(env, opts); + } + + ~WriteSnapshotRunner() { + watcher->unref(); + backend->unref(); + } +private: + std::shared_ptr backend; + WatcherRef watcher; + std::string snapshotPath; + + void execute() override { + backend->writeSnapshot(watcher, &snapshotPath); + } +}; + +class GetEventsSinceRunner : public PromiseRunner { +public: + GetEventsSinceRunner(Env env, Value dir, Value snap, Value opts) + : PromiseRunner(env), + snapshotPath(std::string(snap.As().Utf8Value().c_str())) { + watcher = std::make_shared( + std::string(dir.As().Utf8Value().c_str()), + getIgnorePaths(env, opts), + getIgnoreGlobs(env, opts) + ); + + backend = getBackend(env, opts); + } + + ~GetEventsSinceRunner() { + watcher->unref(); + backend->unref(); + } +private: + std::shared_ptr backend; + WatcherRef watcher; + std::string snapshotPath; + + void execute() override { + backend->getEventsSince(watcher, &snapshotPath); + if (watcher->mEvents.hasError()) { + throw std::runtime_error(watcher->mEvents.getError()); + } + } + + Value getResult() override { + std::vector events = watcher->mEvents.getEvents(); + Array eventsArray = Array::New(env, events.size()); + uint32_t i = 0; + for (auto it = events.begin(); it != events.end(); it++) { + eventsArray.Set(i++, it->toJS(env)); + } + return eventsArray; + } +}; + +template +Value queueSnapshotWork(const CallbackInfo& info) { + Env env = info.Env(); + if (info.Length() < 1 || !info[0].IsString()) { + TypeError::New(env, "Expected a string").ThrowAsJavaScriptException(); + return env.Null(); + } + + if (info.Length() < 2 || !info[1].IsString()) { + TypeError::New(env, "Expected a string").ThrowAsJavaScriptException(); + return env.Null(); + } + + if (info.Length() >= 3 && !info[2].IsObject()) { + TypeError::New(env, "Expected an object").ThrowAsJavaScriptException(); + return env.Null(); + } + + Runner *runner = new Runner(info.Env(), info[0], info[1], info[2]); + return runner->queue(); +} + +Value writeSnapshot(const CallbackInfo& info) { + return queueSnapshotWork(info); +} + +Value getEventsSince(const CallbackInfo& info) { + return queueSnapshotWork(info); +} + +class SubscribeRunner : public PromiseRunner { +public: + SubscribeRunner(Env env, Value dir, Value fn, Value opts) : PromiseRunner(env) { + watcher = Watcher::getShared( + std::string(dir.As().Utf8Value().c_str()), + getIgnorePaths(env, opts), + getIgnoreGlobs(env, opts) + ); + + backend = getBackend(env, opts); + watcher->watch(fn.As()); + } + +private: + WatcherRef watcher; + std::shared_ptr backend; + FunctionReference callback; + + void execute() override { + try { + backend->watch(watcher); + } catch (std::exception&) { + watcher->destroy(); + throw; + } + } +}; + +class UnsubscribeRunner : public PromiseRunner { +public: + UnsubscribeRunner(Env env, Value dir, Value fn, Value opts) : PromiseRunner(env) { + watcher = Watcher::getShared( + std::string(dir.As().Utf8Value().c_str()), + getIgnorePaths(env, opts), + getIgnoreGlobs(env, opts) + ); + + backend = getBackend(env, opts); + shouldUnwatch = watcher->unwatch(fn.As()); + } + +private: + WatcherRef watcher; + std::shared_ptr backend; + bool shouldUnwatch; + + void execute() override { + if (shouldUnwatch) { + backend->unwatch(watcher); + } + } +}; + +template +Value queueSubscriptionWork(const CallbackInfo& info) { + Env env = info.Env(); + if (info.Length() < 1 || !info[0].IsString()) { + TypeError::New(env, "Expected a string").ThrowAsJavaScriptException(); + return env.Null(); + } + + if (info.Length() < 2 || !info[1].IsFunction()) { + TypeError::New(env, "Expected a function").ThrowAsJavaScriptException(); + return env.Null(); + } + + if (info.Length() >= 3 && !info[2].IsObject()) { + TypeError::New(env, "Expected an object").ThrowAsJavaScriptException(); + return env.Null(); + } + + Runner *runner = new Runner(info.Env(), info[0], info[1], info[2]); + return runner->queue(); +} + +Value subscribe(const CallbackInfo& info) { + return queueSubscriptionWork(info); +} + +Value unsubscribe(const CallbackInfo& info) { + return queueSubscriptionWork(info); +} + +Object Init(Env env, Object exports) { + exports.Set( + String::New(env, "writeSnapshot"), + Function::New(env, writeSnapshot) + ); + exports.Set( + String::New(env, "getEventsSince"), + Function::New(env, getEventsSince) + ); + exports.Set( + String::New(env, "subscribe"), + Function::New(env, subscribe) + ); + exports.Set( + String::New(env, "unsubscribe"), + Function::New(env, unsubscribe) + ); + return exports; +} + +NODE_API_MODULE(watcher, Init) diff --git a/.pnpm-store/v11/files/96/dd5e9cca5cca7357c120650b2961a7032c63af99ae60065e3fede4feadb8a607ce798e7c2c9d882f949b25b5e61b2edd26d5728949545283d744b8cf00c306 b/.pnpm-store/v11/files/96/dd5e9cca5cca7357c120650b2961a7032c63af99ae60065e3fede4feadb8a607ce798e7c2c9d882f949b25b5e61b2edd26d5728949545283d744b8cf00c306 new file mode 100644 index 0000000..7baf14e --- /dev/null +++ b/.pnpm-store/v11/files/96/dd5e9cca5cca7357c120650b2961a7032c63af99ae60065e3fede4feadb8a607ce798e7c2c9d882f949b25b5e61b2edd26d5728949545283d744b8cf00c306 @@ -0,0 +1,19 @@ +const { switchVersion, loadModule } = require('./utils') + +const Vue = loadModule('vue') + +if (!Vue || typeof Vue.version !== 'string') { + console.warn('[vue-demi] Vue is not found. Please run "npm install vue" to install.') +} +else if (Vue.version.startsWith('2.7.')) { + switchVersion(2.7) +} +else if (Vue.version.startsWith('2.')) { + switchVersion(2) +} +else if (Vue.version.startsWith('3.')) { + switchVersion(3) +} +else { + console.warn(`[vue-demi] Vue version v${Vue.version} is not supported.`) +} diff --git a/.pnpm-store/v11/files/9a/1a1d6433de4e2457e0690888cd3517efeb81c23735340c627c999ec5accca41fba84ea501729698c2b96425a471f99c57cade32b5963a167477a9746411a1c b/.pnpm-store/v11/files/9a/1a1d6433de4e2457e0690888cd3517efeb81c23735340c627c999ec5accca41fba84ea501729698c2b96425a471f99c57cade32b5963a167477a9746411a1c new file mode 100644 index 0000000..fd017b7 --- /dev/null +++ b/.pnpm-store/v11/files/9a/1a1d6433de4e2457e0690888cd3517efeb81c23735340c627c999ec5accca41fba84ea501729698c2b96425a471f99c57cade32b5963a167477a9746411a1c @@ -0,0 +1,126 @@ +var _VueDemiGlobal = typeof globalThis !== 'undefined' + ? globalThis + : typeof global !== 'undefined' + ? global + : typeof self !== 'undefined' + ? self + : this +var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) { + if (VueDemi.install) { + return VueDemi + } + if (!Vue) { + console.error('[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`.') + return VueDemi + } + + // Vue 2.7 + if (Vue.version.slice(0, 4) === '2.7.') { + for (var key in Vue) { + VueDemi[key] = Vue[key] + } + VueDemi.isVue2 = true + VueDemi.isVue3 = false + VueDemi.install = function () {} + VueDemi.Vue = Vue + VueDemi.Vue2 = Vue + VueDemi.version = Vue.version + VueDemi.warn = Vue.util.warn + VueDemi.hasInjectionContext = function() { + return !!VueDemi.getCurrentInstance() + } + function createApp(rootComponent, rootProps) { + var vm + var provide = {} + var app = { + config: Vue.config, + use: Vue.use.bind(Vue), + mixin: Vue.mixin.bind(Vue), + component: Vue.component.bind(Vue), + provide: function (key, value) { + provide[key] = value + return this + }, + directive: function (name, dir) { + if (dir) { + Vue.directive(name, dir) + return app + } else { + return Vue.directive(name) + } + }, + mount: function (el, hydrating) { + if (!vm) { + vm = new Vue(Object.assign({ propsData: rootProps }, rootComponent, { provide: Object.assign(provide, rootComponent.provide) })) + vm.$mount(el, hydrating) + return vm + } else { + return vm + } + }, + unmount: function () { + if (vm) { + vm.$destroy() + vm = undefined + } + }, + } + return app + } + VueDemi.createApp = createApp + } + // Vue 2.6.x + else if (Vue.version.slice(0, 2) === '2.') { + if (VueCompositionAPI) { + for (var key in VueCompositionAPI) { + VueDemi[key] = VueCompositionAPI[key] + } + VueDemi.isVue2 = true + VueDemi.isVue3 = false + VueDemi.install = function () {} + VueDemi.Vue = Vue + VueDemi.Vue2 = Vue + VueDemi.version = Vue.version + VueDemi.hasInjectionContext = function() { + return !!VueDemi.getCurrentInstance() + } + } else { + console.error('[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.') + } + } + // Vue 3 + else if (Vue.version.slice(0, 2) === '3.') { + for (var key in Vue) { + VueDemi[key] = Vue[key] + } + VueDemi.isVue2 = false + VueDemi.isVue3 = true + VueDemi.install = function () {} + VueDemi.Vue = Vue + VueDemi.Vue2 = undefined + VueDemi.version = Vue.version + VueDemi.set = function (target, key, val) { + if (Array.isArray(target)) { + target.length = Math.max(target.length, key) + target.splice(key, 1, val) + return val + } + target[key] = val + return val + } + VueDemi.del = function (target, key) { + if (Array.isArray(target)) { + target.splice(key, 1) + return + } + delete target[key] + } + } else { + console.error('[vue-demi] Vue version ' + Vue.version + ' is unsupported.') + } + return VueDemi +})( + (_VueDemiGlobal.VueDemi = _VueDemiGlobal.VueDemi || (typeof VueDemi !== 'undefined' ? VueDemi : {})), + _VueDemiGlobal.Vue || (typeof Vue !== 'undefined' ? Vue : undefined), + _VueDemiGlobal.VueCompositionAPI || (typeof VueCompositionAPI !== 'undefined' ? VueCompositionAPI : undefined) +); diff --git a/.pnpm-store/v11/files/9a/79aff463cb76d1c985e551512a543a7d9ca99b3bdc6407808455a1b6012f7ad4337c9da690f9d1e7104fe4e17ae91ac0acc2e473e500fa33899991ec25136d b/.pnpm-store/v11/files/9a/79aff463cb76d1c985e551512a543a7d9ca99b3bdc6407808455a1b6012f7ad4337c9da690f9d1e7104fe4e17ae91ac0acc2e473e500fa33899991ec25136d new file mode 100644 index 0000000..e577319 --- /dev/null +++ b/.pnpm-store/v11/files/9a/79aff463cb76d1c985e551512a543a7d9ca99b3bdc6407808455a1b6012f7ad4337c9da690f9d1e7104fe4e17ae91ac0acc2e473e500fa33899991ec25136d @@ -0,0 +1,46 @@ +#ifndef SIGNAL_H +#define SIGNAL_H + +#include +#include + +class Signal { +public: + Signal() : mFlag(false), mWaiting(false) {} + void wait() { + std::unique_lock lock(mMutex); + while (!mFlag) { + mWaiting = true; + mCond.wait(lock); + } + } + + std::cv_status waitFor(std::chrono::milliseconds ms) { + std::unique_lock lock(mMutex); + return mCond.wait_for(lock, ms); + } + + void notify() { + std::unique_lock lock(mMutex); + mFlag = true; + mCond.notify_all(); + } + + void reset() { + std::unique_lock lock(mMutex); + mFlag = false; + mWaiting = false; + } + + bool isWaiting() { + return mWaiting; + } + +private: + bool mFlag; + bool mWaiting; + std::mutex mMutex; + std::condition_variable mCond; +}; + +#endif diff --git a/.pnpm-store/v11/files/a1/0f65af71851afe779d8925e00d5680176c60b76a00182580b4f5e6ed8a1f71b21819134f401ad5aa44ca290269693c28e1117bd4874fc7fb8557b301f900c7 b/.pnpm-store/v11/files/a1/0f65af71851afe779d8925e00d5680176c60b76a00182580b4f5e6ed8a1f71b21819134f401ad5aa44ca290269693c28e1117bd4874fc7fb8557b301f900c7 new file mode 100644 index 0000000..2027e8d --- /dev/null +++ b/.pnpm-store/v11/files/a1/0f65af71851afe779d8925e00d5680176c60b76a00182580b4f5e6ed8a1f71b21819134f401ad5aa44ca290269693c28e1117bd4874fc7fb8557b301f900c7 @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Evan Wallace + +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. diff --git a/.pnpm-store/v11/files/ab/1cceae9f12687c2f98ba9ec6ea682eddc527e3c90b45d8d947eebb49a80998ca4c8634d48e73d3f9acfc7e02c4f9c8a0492cc8bb5bcb237aa4ada76bc1c0be b/.pnpm-store/v11/files/ab/1cceae9f12687c2f98ba9ec6ea682eddc527e3c90b45d8d947eebb49a80998ca4c8634d48e73d3f9acfc7e02c4f9c8a0492cc8bb5bcb237aa4ada76bc1c0be new file mode 100644 index 0000000..de7a73d --- /dev/null +++ b/.pnpm-store/v11/files/ab/1cceae9f12687c2f98ba9ec6ea682eddc527e3c90b45d8d947eebb49a80998ca4c8634d48e73d3f9acfc7e02c4f9c8a0492cc8bb5bcb237aa4ada76bc1c0be @@ -0,0 +1,25 @@ +#ifndef BRUTE_FORCE_H +#define BRUTE_FORCE_H + +#include "../Backend.hh" +#include "../DirTree.hh" +#include "../Watcher.hh" + +class BruteForceBackend : public Backend { +public: + void writeSnapshot(WatcherRef watcher, std::string *snapshotPath) override; + void getEventsSince(WatcherRef watcher, std::string *snapshotPath) override; + void subscribe(WatcherRef watcher) override { + throw "Brute force backend doesn't support subscriptions."; + } + + void unsubscribe(WatcherRef watcher) override { + throw "Brute force backend doesn't support subscriptions."; + } + + std::shared_ptr getTree(WatcherRef watcher, bool shouldRead = true); +private: + void readTree(WatcherRef watcher, std::shared_ptr tree); +}; + +#endif diff --git a/.pnpm-store/v11/files/ab/788d8a85058f667493f28cf7ee87cac56c760c512c96cc105c2fcc8765bc02d284d8c3261b953b4821d649a24abb6ca8ad73b61bfbb3fc9873987b2fddf212 b/.pnpm-store/v11/files/ab/788d8a85058f667493f28cf7ee87cac56c760c512c96cc105c2fcc8765bc02d284d8c3261b953b4821d649a24abb6ca8ad73b61bfbb3fc9873987b2fddf212 new file mode 100644 index 0000000..897b4c5 --- /dev/null +++ b/.pnpm-store/v11/files/ab/788d8a85058f667493f28cf7ee87cac56c760c512c96cc105c2fcc8765bc02d284d8c3261b953b4821d649a24abb6ca8ad73b61bfbb3fc9873987b2fddf212 @@ -0,0 +1,22 @@ +import * as Vue from 'vue' +declare const isVue2: boolean +declare const isVue3: boolean +declare const Vue2: any +declare const install: (vue?: any) => void +/** + * @deprecated To avoid bringing in all the tree-shakable modules, this API has been deprecated. Use `Vue2` or named exports instead. + * Refer to https://github.com/vueuse/vue-demi/issues/41 + */ +declare const V: typeof Vue + +export function set(target: any, key: any, val: T): T +export function del(target: any, key: any): void + +export * from 'vue' +export { + V as Vue, + Vue2, + isVue2, + isVue3, + install, +} diff --git a/.pnpm-store/v11/files/b7/38a43e6d370399e4b634f6785d629ed9e9aba84b30d7db3362b4fb352a5ba71fd735f66f027efc464ae09126d81fb504eed29dd0cf06b2f4bf1168787f8cde b/.pnpm-store/v11/files/b7/38a43e6d370399e4b634f6785d629ed9e9aba84b30d7db3362b4fb352a5ba71fd735f66f027efc464ae09126d81fb504eed29dd0cf06b2f4bf1168787f8cde new file mode 100644 index 0000000..949f498 --- /dev/null +++ b/.pnpm-store/v11/files/b7/38a43e6d370399e4b634f6785d629ed9e9aba84b30d7db3362b4fb352a5ba71fd735f66f027efc464ae09126d81fb504eed29dd0cf06b2f4bf1168787f8cde @@ -0,0 +1,236 @@ +#include +#include +#include +#include +#include +#include "InotifyBackend.hh" + +#define INOTIFY_MASK \ + IN_ATTRIB | IN_CREATE | IN_DELETE | \ + IN_DELETE_SELF | IN_MODIFY | IN_MOVE_SELF | IN_MOVED_FROM | \ + IN_MOVED_TO | IN_DONT_FOLLOW | IN_ONLYDIR | IN_EXCL_UNLINK +#define BUFFER_SIZE 8192 +#define CONVERT_TIME(ts) ((uint64_t)ts.tv_sec * 1000000000 + ts.tv_nsec) + +void InotifyBackend::start() { + // Create a pipe that we will write to when we want to end the thread. + int err = pipe2(mPipe, O_CLOEXEC | O_NONBLOCK); + if (err == -1) { + throw std::runtime_error(std::string("Unable to open pipe: ") + strerror(errno)); + } + + // Init inotify file descriptor. + mInotify = inotify_init1(IN_NONBLOCK | IN_CLOEXEC); + if (mInotify == -1) { + throw std::runtime_error(std::string("Unable to initialize inotify: ") + strerror(errno)); + } + + pollfd pollfds[2]; + pollfds[0].fd = mPipe[0]; + pollfds[0].events = POLLIN; + pollfds[0].revents = 0; + pollfds[1].fd = mInotify; + pollfds[1].events = POLLIN; + pollfds[1].revents = 0; + + notifyStarted(); + + // Loop until we get an event from the pipe. + while (true) { + int result = poll(pollfds, 2, 500); + if (result < 0) { + throw std::runtime_error(std::string("Unable to poll: ") + strerror(errno)); + } + + if (pollfds[0].revents) { + break; + } + + if (pollfds[1].revents) { + handleEvents(); + } + } + + close(mPipe[0]); + close(mPipe[1]); + close(mInotify); + + mEndedSignal.notify(); +} + +InotifyBackend::~InotifyBackend() { + write(mPipe[1], "X", 1); + mEndedSignal.wait(); +} + +// This function is called by Backend::watch which takes a lock on mMutex +void InotifyBackend::subscribe(WatcherRef watcher) { + // Build a full directory tree recursively, and watch each directory. + std::shared_ptr tree = getTree(watcher); + + for (auto it = tree->entries.begin(); it != tree->entries.end(); it++) { + if (it->second.isDir) { + bool success = watchDir(watcher, it->second.path, tree); + if (!success) { + throw WatcherError(std::string("inotify_add_watch on '") + it->second.path + std::string("' failed: ") + strerror(errno), watcher); + } + } + } +} + +bool InotifyBackend::watchDir(WatcherRef watcher, std::string path, std::shared_ptr tree) { + int wd = inotify_add_watch(mInotify, path.c_str(), INOTIFY_MASK); + if (wd == -1) { + return false; + } + + std::shared_ptr sub = std::make_shared(); + sub->tree = tree; + sub->path = path; + sub->watcher = watcher; + mSubscriptions.emplace(wd, sub); + + return true; +} + +void InotifyBackend::handleEvents() { + char buf[BUFFER_SIZE] __attribute__ ((aligned(__alignof__(struct inotify_event))));; + struct inotify_event *event; + + // Track all of the watchers that are touched so we can notify them at the end of the events. + std::unordered_set watchers; + + while (true) { + int n = read(mInotify, &buf, BUFFER_SIZE); + if (n < 0) { + if (errno == EAGAIN || errno == EWOULDBLOCK) { + break; + } + + throw std::runtime_error(std::string("Error reading from inotify: ") + strerror(errno)); + } + + if (n == 0) { + break; + } + + for (char *ptr = buf; ptr < buf + n; ptr += sizeof(*event) + event->len) { + event = (struct inotify_event *)ptr; + + if ((event->mask & IN_Q_OVERFLOW) == IN_Q_OVERFLOW) { + // overflow + continue; + } + + handleEvent(event, watchers); + } + } + + for (auto it = watchers.begin(); it != watchers.end(); it++) { + (*it)->notify(); + } +} + +void InotifyBackend::handleEvent(struct inotify_event *event, std::unordered_set &watchers) { + std::unique_lock lock(mMutex); + + // Find the subscriptions for this watch descriptor + auto range = mSubscriptions.equal_range(event->wd); + std::unordered_set> set; + for (auto it = range.first; it != range.second; it++) { + set.insert(it->second); + } + + for (auto it = set.begin(); it != set.end(); it++) { + if (handleSubscription(event, *it)) { + watchers.insert((*it)->watcher); + } + } +} + +bool InotifyBackend::handleSubscription(struct inotify_event *event, std::shared_ptr sub) { + // Build full path and check if its in our ignore list. + std::shared_ptr watcher = sub->watcher; + std::string path = std::string(sub->path); + bool isDir = event->mask & IN_ISDIR; + + if (event->len > 0) { + path += "/" + std::string(event->name); + } + + if (watcher->isIgnored(path)) { + return false; + } + + // If this is a create, check if it's a directory and start watching if it is. + // In any case, keep the directory tree up to date. + if (event->mask & (IN_CREATE | IN_MOVED_TO)) { + watcher->mEvents.create(path); + + struct stat st; + // Use lstat to avoid resolving symbolic links that we cannot watch anyway + // https://github.com/parcel-bundler/watcher/issues/76 + if (lstat(path.c_str(), &st) != 0) { + return false; + } + DirEntry *entry = sub->tree->add(path, CONVERT_TIME(st.st_mtim), S_ISDIR(st.st_mode)); + + if (entry->isDir) { + bool success = watchDir(watcher, path, sub->tree); + if (!success) { + sub->tree->remove(path); + return false; + } + } + } else if (event->mask & (IN_MODIFY | IN_ATTRIB)) { + watcher->mEvents.update(path); + + struct stat st; + if (stat(path.c_str(), &st) != 0) { + return false; + } + sub->tree->update(path, CONVERT_TIME(st.st_mtim)); + } else if (event->mask & (IN_DELETE | IN_DELETE_SELF | IN_MOVED_FROM | IN_MOVE_SELF)) { + bool isSelfEvent = (event->mask & (IN_DELETE_SELF | IN_MOVE_SELF)); + // Ignore delete/move self events unless this is the recursive watch root + if (isSelfEvent && path != watcher->mDir) { + return false; + } + + // If the entry being deleted/moved is a directory, remove it from the list of subscriptions + // XXX: self events don't have the IN_ISDIR mask + if (isSelfEvent || isDir) { + for (auto it = mSubscriptions.begin(); it != mSubscriptions.end();) { + if (it->second->path == path) { + it = mSubscriptions.erase(it); + } else { + ++it; + } + } + } + + watcher->mEvents.remove(path); + sub->tree->remove(path); + } + + return true; +} + +// This function is called by Backend::unwatch which takes a lock on mMutex +void InotifyBackend::unsubscribe(WatcherRef watcher) { + // Find any subscriptions pointing to this watcher, and remove them. + for (auto it = mSubscriptions.begin(); it != mSubscriptions.end();) { + if (it->second->watcher.get() == watcher.get()) { + if (mSubscriptions.count(it->first) == 1) { + int err = inotify_rm_watch(mInotify, it->first); + if (err == -1) { + throw WatcherError(std::string("Unable to remove watcher: ") + strerror(errno), watcher); + } + } + + it = mSubscriptions.erase(it); + } else { + it++; + } + } +} diff --git a/.pnpm-store/v11/files/b7/79dd7922c4335742be2288a0738c530a7bd73b044a4ec2a3f0d782834e45e757c302c8f19cdce47daeaeb92f295fc03802ba92080716be3508755d7c290d89 b/.pnpm-store/v11/files/b7/79dd7922c4335742be2288a0738c530a7bd73b044a4ec2a3f0d782834e45e757c302c8f19cdce47daeaeb92f295fc03802ba92080716be3508755d7c290d89 new file mode 100644 index 0000000..be07e78 --- /dev/null +++ b/.pnpm-store/v11/files/b7/79dd7922c4335742be2288a0738c530a7bd73b044a4ec2a3f0d782834e45e757c302c8f19cdce47daeaeb92f295fc03802ba92080716be3508755d7c290d89 @@ -0,0 +1,113 @@ +#include "Debounce.hh" + +#ifdef __wasm32__ +extern "C" void on_timeout(void *ctx) { + Debounce *debounce = (Debounce *)ctx; + debounce->notify(); +} +#endif + +std::shared_ptr Debounce::getShared() { + static std::weak_ptr sharedInstance; + std::shared_ptr shared = sharedInstance.lock(); + if (!shared) { + shared = std::make_shared(); + sharedInstance = shared; + } + + return shared; +} + +Debounce::Debounce() { + mRunning = true; + #ifndef __wasm32__ + mThread = std::thread([this] () { + loop(); + }); + #endif +} + +Debounce::~Debounce() { + mRunning = false; + #ifndef __wasm32__ + mWaitSignal.notify(); + mThread.join(); + #endif +} + +void Debounce::add(void *key, std::function cb) { + std::unique_lock lock(mMutex); + mCallbacks.emplace(key, cb); +} + +void Debounce::remove(void *key) { + std::unique_lock lock(mMutex); + mCallbacks.erase(key); +} + +void Debounce::trigger() { + std::unique_lock lock(mMutex); + #ifdef __wasm32__ + notifyIfReady(); + #else + mWaitSignal.notify(); + #endif +} + +#ifndef __wasm32__ +void Debounce::loop() { + while (mRunning) { + mWaitSignal.wait(); + if (!mRunning) { + break; + } + + notifyIfReady(); + } +} +#endif + +void Debounce::notifyIfReady() { + if (!mRunning) { + return; + } + + // If we haven't seen an event in more than the maximum wait time, notify callbacks immediately + // to ensure that we don't wait forever. Otherwise, wait for the minimum wait time and batch + // subsequent fast changes. This also means the first file change in a batch is notified immediately, + // separately from the rest of the batch. This seems like an acceptable tradeoff if the common case + // is that only a single file was updated at a time. + auto time = std::chrono::steady_clock::now(); + if ((time - mLastTime) > std::chrono::milliseconds(MAX_WAIT_TIME)) { + mLastTime = time; + notify(); + } else { + wait(); + } +} + +void Debounce::wait() { + #ifdef __wasm32__ + clear_timeout(mTimeout); + mTimeout = set_timeout(MIN_WAIT_TIME, this); + #else + auto status = mWaitSignal.waitFor(std::chrono::milliseconds(MIN_WAIT_TIME)); + if (mRunning && (status == std::cv_status::timeout)) { + notify(); + } + #endif +} + +void Debounce::notify() { + std::unique_lock lock(mMutex); + + mLastTime = std::chrono::steady_clock::now(); + for (auto it = mCallbacks.begin(); it != mCallbacks.end(); it++) { + auto cb = it->second; + cb(); + } + + #ifndef __wasm32__ + mWaitSignal.reset(); + #endif +} diff --git a/.pnpm-store/v11/files/bd/95b557d670dc4b090bdc6c0a78e899fd3708a1a1fe54dab9932323cc8315c5d0c27805452ab9e844211f90066a87daa80e20f41a412154b8eb56551760aa43 b/.pnpm-store/v11/files/bd/95b557d670dc4b090bdc6c0a78e899fd3708a1a1fe54dab9932323cc8315c5d0c27805452ab9e844211f90066a87daa80e20f41a412154b8eb56551760aa43 new file mode 100644 index 0000000..e575059 --- /dev/null +++ b/.pnpm-store/v11/files/bd/95b557d670dc4b090bdc6c0a78e899fd3708a1a1fe54dab9932323cc8315c5d0c27805452ab9e844211f90066a87daa80e20f41a412154b8eb56551760aa43 @@ -0,0 +1,80 @@ +import Vue from 'vue' +import { getCurrentInstance } from 'vue' + +var isVue2 = true +var isVue3 = false +var Vue2 = Vue +var warn = Vue.util.warn + +function install() {} + +// createApp polyfill +export function createApp(rootComponent, rootProps) { + var vm + var provide = {} + var app = { + config: Vue.config, + use: Vue.use.bind(Vue), + mixin: Vue.mixin.bind(Vue), + component: Vue.component.bind(Vue), + provide: function (key, value) { + provide[key] = value + return this + }, + directive: function (name, dir) { + if (dir) { + Vue.directive(name, dir) + return app + } else { + return Vue.directive(name) + } + }, + mount: function (el, hydrating) { + if (!vm) { + vm = new Vue(Object.assign({ propsData: rootProps }, rootComponent, { provide: Object.assign(provide, rootComponent.provide) })) + vm.$mount(el, hydrating) + return vm + } else { + return vm + } + }, + unmount: function () { + if (vm) { + vm.$destroy() + vm = undefined + } + }, + } + return app +} + +export { + Vue, + Vue2, + isVue2, + isVue3, + install, + warn +} + +// Vue 3 components mock +function createMockComponent(name) { + return { + setup() { + throw new Error('[vue-demi] ' + name + ' is not supported in Vue 2. It\'s provided to avoid compiler errors.') + } + } +} +export var Fragment = /*#__PURE__*/ createMockComponent('Fragment') +export var Transition = /*#__PURE__*/ createMockComponent('Transition') +export var TransitionGroup = /*#__PURE__*/ createMockComponent('TransitionGroup') +export var Teleport = /*#__PURE__*/ createMockComponent('Teleport') +export var Suspense = /*#__PURE__*/ createMockComponent('Suspense') +export var KeepAlive = /*#__PURE__*/ createMockComponent('KeepAlive') + +export * from 'vue' + +// Not implemented https://github.com/vuejs/core/pull/8111, falls back to getCurrentInstance() +export function hasInjectionContext() { + return !!getCurrentInstance() +} diff --git a/.pnpm-store/v11/files/be/40a9eecea7acec5d8d54f4c9cdf2e536605198243fc289941f0611033a28d87978dbe1fed40b21e7ceb4c88a1561d251047e5ca5e28d66fbd6954905b35cff b/.pnpm-store/v11/files/be/40a9eecea7acec5d8d54f4c9cdf2e536605198243fc289941f0611033a28d87978dbe1fed40b21e7ceb4c88a1561d251047e5ca5e28d66fbd6954905b35cff new file mode 100644 index 0000000..827c7b2 --- /dev/null +++ b/.pnpm-store/v11/files/be/40a9eecea7acec5d8d54f4c9cdf2e536605198243fc289941f0611033a28d87978dbe1fed40b21e7ceb4c88a1561d251047e5ca5e28d66fbd6954905b35cff @@ -0,0 +1,38 @@ +import Vue from 'vue' +import type { PluginFunction, PluginObject, VueConstructor, Directive, InjectionKey, Component } from 'vue' + +declare const isVue2: boolean +declare const isVue3: boolean +declare const Vue2: typeof Vue | undefined +declare const version: string +declare const install: (vue?: typeof Vue) => void +export declare function warn(msg: string, vm?: Component | null): void +/** + * @deprecated To avoid bringing in all the tree-shakable modules, this API has been deprecated. Use `Vue2` or named exports instead. + * Refer to https://github.com/vueuse/vue-demi/issues/41 + */ +declare const V: typeof Vue + +// accept no generic because Vue 3 doesn't accept any +// https://github.com/vuejs/vue-next/pull/2758/ +export declare type Plugin = PluginObject | PluginFunction +export type { VNode } from 'vue' +export * from 'vue' +export { V as Vue, Vue2, isVue2, isVue3, version, install } + +// #region createApp polyfill +export interface App { + config: VueConstructor['config'] + use: VueConstructor['use'] + mixin: VueConstructor['mixin'] + component: VueConstructor['component'] + directive(name: string): Directive | undefined + directive(name: string, directive: Directive): this + provide(key: InjectionKey | string, value: T): this + mount: Vue['$mount'] + unmount: Vue['$destroy'] +} +export declare function createApp(rootComponent: any, rootProps?: any): App +// #endregion + +export declare function hasInjectionContext(): boolean diff --git a/.pnpm-store/v11/files/c6/607be417fc197c743c58e0f4cdb7b673ecc390586c73bbdbd0f14e2861940b4f6ccbfd42e014150f9b57082e852c4b5c66b3d0f13e15feed7cde5a22a262c2 b/.pnpm-store/v11/files/c6/607be417fc197c743c58e0f4cdb7b673ecc390586c73bbdbd0f14e2861940b4f6ccbfd42e014150f9b57082e852c4b5c66b3d0f13e15feed7cde5a22a262c2 new file mode 100644 index 0000000..9178d1b --- /dev/null +++ b/.pnpm-store/v11/files/c6/607be417fc197c743c58e0f4cdb7b673ecc390586c73bbdbd0f14e2861940b4f6ccbfd42e014150f9b57082e852c4b5c66b3d0f13e15feed7cde5a22a262c2 @@ -0,0 +1,11 @@ +#ifndef WIN_UTILS_H +#define WIN_UTILS_H + +#include +#include + +std::wstring utf8ToUtf16(std::string input); +std::string utf16ToUtf8(const WCHAR *input, DWORD length); +std::string normalizePath(std::string path); + +#endif diff --git a/.pnpm-store/v11/files/c8/9a55c0f7b24cf104a844dff78fdc62962b150b8f3a2e2175454682f2dde6e33a4268f41169b36c142a1267e99ba474b4cbb72b2aa04a50dee548064b2ab033 b/.pnpm-store/v11/files/c8/9a55c0f7b24cf104a844dff78fdc62962b150b8f3a2e2175454682f2dde6e33a4268f41169b36c142a1267e99ba474b4cbb72b2aa04a50dee548064b2ab033 new file mode 100644 index 0000000..31aba4f --- /dev/null +++ b/.pnpm-store/v11/files/c8/9a55c0f7b24cf104a844dff78fdc62962b150b8f3a2e2175454682f2dde6e33a4268f41169b36c142a1267e99ba474b4cbb72b2aa04a50dee548064b2ab033 @@ -0,0 +1,42 @@ +const {createWrapper} = require('./wrapper'); + +let name = `@parcel/watcher-${process.platform}-${process.arch}`; +if (process.platform === 'linux') { + const { MUSL, familySync } = require('detect-libc'); + const family = familySync(); + if (family === MUSL) { + name += '-musl'; + } else { + name += '-glibc'; + } +} + +let binding; +try { + binding = require(name); +} catch (err) { + handleError(err); + try { + binding = require('./build/Release/watcher.node'); + } catch (err) { + handleError(err); + try { + binding = require('./build/Debug/watcher.node'); + } catch (err) { + handleError(err); + throw new Error(`No prebuild or local build of @parcel/watcher found. Tried ${name}. Please ensure it is installed (don't use --no-optional when installing with npm). Otherwise it is possible we don't support your platform yet. If this is the case, please report an issue to https://github.com/parcel-bundler/watcher.`); + } + } +} + +function handleError(err) { + if (err?.code !== 'MODULE_NOT_FOUND') { + throw err; + } +} + +const wrapper = createWrapper(binding); +exports.writeSnapshot = wrapper.writeSnapshot; +exports.getEventsSince = wrapper.getEventsSince; +exports.subscribe = wrapper.subscribe; +exports.unsubscribe = wrapper.unsubscribe; diff --git a/.pnpm-store/v11/files/cc/7a449f2bdd11da4ad1051cee3f6f7fa3379e76eb21525c864ac70b8ac08e483180558fbc43fb7c4baea34e22d37fffb5658943e40d7be1a1f208bcce09e427 b/.pnpm-store/v11/files/cc/7a449f2bdd11da4ad1051cee3f6f7fa3379e76eb21525c864ac70b8ac08e483180558fbc43fb7c4baea34e22d37fffb5658943e40d7be1a1f208bcce09e427 new file mode 100644 index 0000000..9facac8 --- /dev/null +++ b/.pnpm-store/v11/files/cc/7a449f2bdd11da4ad1051cee3f6f7fa3379e76eb21525c864ac70b8ac08e483180558fbc43fb7c4baea34e22d37fffb5658943e40d7be1a1f208bcce09e427 @@ -0,0 +1,34 @@ +#ifndef WASM_H +#define WASM_H + +#include +#include "../shared/BruteForceBackend.hh" +#include "../DirTree.hh" + +extern "C" { + int wasm_backend_add_watch(const char *filename, void *backend); + void wasm_backend_remove_watch(int wd); + void wasm_backend_event_handler(void *backend, int wd, int type, char *filename); +}; + +struct WasmSubscription { + std::shared_ptr tree; + std::string path; + WatcherRef watcher; +}; + +class WasmBackend : public BruteForceBackend { +public: + void start() override; + void subscribe(WatcherRef watcher) override; + void unsubscribe(WatcherRef watcher) override; + void handleEvent(int wd, int type, char *filename); +private: + int mWasm; + std::unordered_multimap> mSubscriptions; + + void watchDir(WatcherRef watcher, std::string path, std::shared_ptr tree); + bool handleSubscription(int type, char *filename, std::shared_ptr sub); +}; + +#endif diff --git a/.pnpm-store/v11/files/ce/fdd315adfed57e2e7d217dd0bf6904524592a5c92764b5d9fb5c9ac6996b0309822d07e419b89557584d48d0aa5afe14d714538d78c8c38fd82fed8170174b b/.pnpm-store/v11/files/ce/fdd315adfed57e2e7d217dd0bf6904524592a5c92764b5d9fb5c9ac6996b0309822d07e419b89557584d48d0aa5afe14d714538d78c8c38fd82fed8170174b new file mode 100644 index 0000000..a58ff37 --- /dev/null +++ b/.pnpm-store/v11/files/ce/fdd315adfed57e2e7d217dd0bf6904524592a5c92764b5d9fb5c9ac6996b0309822d07e419b89557584d48d0aa5afe14d714538d78c8c38fd82fed8170174b @@ -0,0 +1,241 @@ +#include "Watcher.hh" +#include + +using namespace Napi; + +struct WatcherHash { + std::size_t operator() (WatcherRef const &k) const { + return std::hash()(k->mDir); + } +}; + +struct WatcherCompare { + size_t operator() (WatcherRef const &a, WatcherRef const &b) const { + return *a == *b; + } +}; + +static std::unordered_set& getSharedWatchers() { + static std::unordered_set* sharedWatchers = + new std::unordered_set(); + return *sharedWatchers; +} + +WatcherRef Watcher::getShared(std::string dir, std::unordered_set ignorePaths, std::unordered_set ignoreGlobs) { + WatcherRef watcher = std::make_shared(dir, ignorePaths, ignoreGlobs); + auto found = getSharedWatchers().find(watcher); + if (found != getSharedWatchers().end()) { + return *found; + } + + getSharedWatchers().insert(watcher); + return watcher; +} + +void removeShared(Watcher *watcher) { + for (auto it = getSharedWatchers().begin(); it != getSharedWatchers().end(); it++) { + if (it->get() == watcher) { + getSharedWatchers().erase(it); + break; + } + } + + // Free up memory. + if (getSharedWatchers().size() == 0) { + getSharedWatchers().rehash(0); + } +} + +Watcher::Watcher(std::string dir, std::unordered_set ignorePaths, std::unordered_set ignoreGlobs) + : mDir(dir), + mIgnorePaths(ignorePaths), + mIgnoreGlobs(ignoreGlobs) { + mDebounce = Debounce::getShared(); + mDebounce->add(this, [this] () { + triggerCallbacks(); + }); + } + +Watcher::~Watcher() { + mDebounce->remove(this); +} + +void Watcher::wait() { + std::unique_lock lk(mMutex); + mCond.wait(lk); +} + +void Watcher::notify() { + std::unique_lock lk(mMutex); + mCond.notify_all(); + + if (mCallbacks.size() > 0 && mEvents.size() > 0) { + // We must release our lock before calling into the debouncer + // to avoid a deadlock: the debouncer thread itself will require + // our lock from its thread when calling into `triggerCallbacks` + // while holding its own debouncer lock. + lk.unlock(); + mDebounce->trigger(); + } +} + +struct CallbackData { + std::string error; + std::vector events; + CallbackData(std::string error, std::vector events) : error(error), events(events) {} +}; + +Value callbackEventsToJS(const Env &env, std::vector &events) { + EscapableHandleScope scope(env); + Array arr = Array::New(env, events.size()); + uint32_t currentEventIndex = 0; + for (auto eventIterator = events.begin(); eventIterator != events.end(); eventIterator++) { + arr.Set(currentEventIndex++, eventIterator->toJS(env)); + } + return scope.Escape(arr); +} + +void callJSFunction(Napi::Env env, Function jsCallback, CallbackData *data) { + HandleScope scope(env); + auto err = data->error.size() > 0 ? Error::New(env, data->error).Value() : env.Null(); + auto events = callbackEventsToJS(env, data->events); + jsCallback.Call({err, events}); + delete data; + + // Throw errors from the callback as fatal exceptions + // If we don't handle these node segfaults... + if (env.IsExceptionPending()) { + Napi::Error err = env.GetAndClearPendingException(); + napi_fatal_exception(env, err.Value()); + } +} + +void Watcher::notifyError(std::exception &err) { + std::unique_lock lk(mMutex); + for (auto it = mCallbacks.begin(); it != mCallbacks.end(); it++) { + CallbackData *data = new CallbackData(err.what(), {}); + it->tsfn.BlockingCall(data, callJSFunction); + } + + clearCallbacks(); +} + +// This function is called from the debounce thread. +void Watcher::triggerCallbacks() { + std::unique_lock lk(mMutex); + if (mCallbacks.size() > 0 && (mEvents.size() > 0 || mEvents.hasError())) { + auto error = mEvents.getError(); + auto events = mEvents.getEvents(); + mEvents.clear(); + + for (auto it = mCallbacks.begin(); it != mCallbacks.end(); it++) { + it->tsfn.BlockingCall(new CallbackData(error, events), callJSFunction); + } + } +} + +// This should be called from the JavaScript thread. +bool Watcher::watch(Function callback) { + std::unique_lock lk(mMutex); + + auto it = findCallback(callback); + if (it != mCallbacks.end()) { + return false; + } + + auto tsfn = ThreadSafeFunction::New( + callback.Env(), + callback, + "Watcher callback", + 0, // Unlimited queue + 1 // Initial thread count + ); + + mCallbacks.push_back(Callback { + tsfn, + Napi::Persistent(callback), + std::this_thread::get_id() + }); + + return true; +} + +// This should be called from the JavaScript thread. +std::vector::iterator Watcher::findCallback(Function callback) { + for (auto it = mCallbacks.begin(); it != mCallbacks.end(); it++) { + // Only consider callbacks created by the same thread, or V8 will panic. + if (it->threadId == std::this_thread::get_id() && it->ref.Value() == callback) { + return it; + } + } + + return mCallbacks.end(); +} + +// This should be called from the JavaScript thread. +bool Watcher::unwatch(Function callback) { + std::unique_lock lk(mMutex); + + bool removed = false; + auto it = findCallback(callback); + if (it != mCallbacks.end()) { + it->tsfn.Release(); + it->ref.Unref(); + mCallbacks.erase(it); + removed = true; + } + + if (removed && mCallbacks.size() == 0) { + unref(); + return true; + } + + return false; +} + +void Watcher::unref() { + if (mCallbacks.size() == 0) { + removeShared(this); + } +} + +void Watcher::destroy() { + std::unique_lock lk(mMutex); + clearCallbacks(); +} + +// Private because it doesn't lock. +void Watcher::clearCallbacks() { + for (auto it = mCallbacks.begin(); it != mCallbacks.end(); it++) { + it->tsfn.Release(); + it->ref.Unref(); + } + + mCallbacks.clear(); + unref(); +} + +bool Watcher::isIgnored(std::string path) { + for (auto it = mIgnorePaths.begin(); it != mIgnorePaths.end(); it++) { + auto dir = *it + DIR_SEP; + if (*it == path || path.compare(0, dir.size(), dir) == 0) { + return true; + } + } + + auto basePath = mDir + DIR_SEP; + + if (path.rfind(basePath, 0) != 0) { + return false; + } + + auto relativePath = path.substr(basePath.size()); + + for (auto it = mIgnoreGlobs.begin(); it != mIgnoreGlobs.end(); it++) { + if (it->isIgnored(relativePath)) { + return true; + } + } + + return false; +} diff --git a/.pnpm-store/v11/files/e6/4f57392a5bc1fcc43c6794f8c089ea758949a4d2fe30fef420de49bb84635275bd21ea8e89f1ff48f9e18fde20bea1d9be14520577745e7ae15f2709c83995 b/.pnpm-store/v11/files/e6/4f57392a5bc1fcc43c6794f8c089ea758949a4d2fe30fef420de49bb84635275bd21ea8e89f1ff48f9e18fde20bea1d9be14520577745e7ae15f2709c83995 new file mode 100644 index 0000000..d679782 --- /dev/null +++ b/.pnpm-store/v11/files/e6/4f57392a5bc1fcc43c6794f8c089ea758949a4d2fe30fef420de49bb84635275bd21ea8e89f1ff48f9e18fde20bea1d9be14520577745e7ae15f2709c83995 @@ -0,0 +1,18 @@ +#ifndef WINDOWS_H +#define WINDOWS_H + +#include +#include +#include "../shared/BruteForceBackend.hh" + +class WindowsBackend : public BruteForceBackend { +public: + void start() override; + ~WindowsBackend(); + void subscribe(WatcherRef watcher) override; + void unsubscribe(WatcherRef watcher) override; +private: + bool mRunning; +}; + +#endif diff --git a/.pnpm-store/v11/files/e6/85af7fd33df911d59827d1ac59f041706c829a12fde2f231eeb453b2c43d00caeea434ffc8da23d9b54123ffbdd74520be3e0d7315cd0942d34c604dfc0673 b/.pnpm-store/v11/files/e6/85af7fd33df911d59827d1ac59f041706c829a12fde2f231eeb453b2c43d00caeea434ffc8da23d9b54123ffbdd74520be3e0d7315cd0942d34c604dfc0673 new file mode 100644 index 0000000..4602008 --- /dev/null +++ b/.pnpm-store/v11/files/e6/85af7fd33df911d59827d1ac59f041706c829a12fde2f231eeb453b2c43d00caeea434ffc8da23d9b54123ffbdd74520be3e0d7315cd0942d34c604dfc0673 @@ -0,0 +1,13 @@ +#!/usr/bin/env node + +const {spawn} = require('child_process'); + +if (process.env.npm_config_build_from_source === 'true') { + build(); +} + +function build() { + spawn('node-gyp', ['rebuild'], { stdio: 'inherit', shell: true }).on('exit', function (code) { + process.exit(code); + }); +} diff --git a/.pnpm-store/v11/files/e6/bc8335457dffbcf937aa796319f9bc7afee9701cbae5e860297cf96f0a68fb3f9f71e832e9cb474aee643dfcbc44458f7291eff48675c73bb61b9662dc9498-exec b/.pnpm-store/v11/files/e6/bc8335457dffbcf937aa796319f9bc7afee9701cbae5e860297cf96f0a68fb3f9f71e832e9cb474aee643dfcbc44458f7291eff48675c73bb61b9662dc9498-exec new file mode 100755 index 0000000..360eada --- /dev/null +++ b/.pnpm-store/v11/files/e6/bc8335457dffbcf937aa796319f9bc7afee9701cbae5e860297cf96f0a68fb3f9f71e832e9cb474aee643dfcbc44458f7291eff48675c73bb61b9662dc9498-exec @@ -0,0 +1,3 @@ +#!/usr/bin/env node +'use strict' +require('../scripts/switch-cli') diff --git a/.pnpm-store/v11/files/e7/8381aa5cda34dbd3602aaa6d7a1a627a33a3cc5c83ee63bccd3f040ff721040ca9e60e7eb0894ceef24f155ea3d71f6efb45a25d03fd2982519eafb48372f3 b/.pnpm-store/v11/files/e7/8381aa5cda34dbd3602aaa6d7a1a627a33a3cc5c83ee63bccd3f040ff721040ca9e60e7eb0894ceef24f155ea3d71f6efb45a25d03fd2982519eafb48372f3 new file mode 100644 index 0000000..894ffaf --- /dev/null +++ b/.pnpm-store/v11/files/e7/8381aa5cda34dbd3602aaa6d7a1a627a33a3cc5c83ee63bccd3f040ff721040ca9e60e7eb0894ceef24f155ea3d71f6efb45a25d03fd2982519eafb48372f3 @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020-present, Anthony Fu + +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. diff --git a/.pnpm-store/v11/files/e7/df1fcfcea44b0ac85fb841f60b4be6693b21fa3ff5f3d4eeab4fa7298cf83be19965d4da982a8a216334a8661d5409d59b5c26d837474341ceca8ffed85b7b b/.pnpm-store/v11/files/e7/df1fcfcea44b0ac85fb841f60b4be6693b21fa3ff5f3d4eeab4fa7298cf83be19965d4da982a8a216334a8661d5409d59b5c26d837474341ceca8ffed85b7b new file mode 100644 index 0000000..b5fc375 --- /dev/null +++ b/.pnpm-store/v11/files/e7/df1fcfcea44b0ac85fb841f60b4be6693b21fa3ff5f3d4eeab4fa7298cf83be19965d4da982a8a216334a8661d5409d59b5c26d837474341ceca8ffed85b7b @@ -0,0 +1,34 @@ +#ifndef GLOB_H +#define GLOB_H + +#include +#include + +struct Glob { + std::size_t mHash; + std::string mRaw; + #ifndef __wasm32__ + std::regex mRegex; + #endif + + Glob(std::string raw); + + bool operator==(const Glob &other) const { + return mHash == other.mHash && mRaw == other.mRaw; + } + + bool isIgnored(std::string relative_path) const; +}; + +namespace std +{ + template <> + struct hash + { + size_t operator()(const Glob& g) const { + return g.mHash; + } + }; +} + +#endif diff --git a/.pnpm-store/v11/files/e8/af1fb907555d5cc14a189b7ae1fcec02d0f974736891828a2e7b77177789af3f24c91c5407ba55a24ddfb01e73a6d8b76b8ffdf2448da0868291fe4c4607de-exec b/.pnpm-store/v11/files/e8/af1fb907555d5cc14a189b7ae1fcec02d0f974736891828a2e7b77177789af3f24c91c5407ba55a24ddfb01e73a6d8b76b8ffdf2448da0868291fe4c4607de-exec new file mode 100755 index 0000000..684a621 --- /dev/null +++ b/.pnpm-store/v11/files/e8/af1fb907555d5cc14a189b7ae1fcec02d0f974736891828a2e7b77177789af3f24c91c5407ba55a24ddfb01e73a6d8b76b8ffdf2448da0868291fe4c4607de-exec @@ -0,0 +1,3 @@ +#!/usr/bin/env node +'use strict' +require('../scripts/postinstall') diff --git a/.pnpm-store/v11/files/e8/ff576b2e07252446ab1ca73148b9cfb3c9b7e79ab4761069330b5e49f8f3105895ab661aa3f0c0409f4576f333abe79d853d2814115886eb97a0d5959f9c5a b/.pnpm-store/v11/files/e8/ff576b2e07252446ab1ca73148b9cfb3c9b7e79ab4761069330b5e49f8f3105895ab661aa3f0c0409f4576f333abe79d853d2814115886eb97a0d5959f9c5a new file mode 100644 index 0000000..d673bd1 --- /dev/null +++ b/.pnpm-store/v11/files/e8/ff576b2e07252446ab1ca73148b9cfb3c9b7e79ab4761069330b5e49f8f3105895ab661aa3f0c0409f4576f333abe79d853d2814115886eb97a0d5959f9c5a @@ -0,0 +1,37 @@ +#ifndef BACKEND_H +#define BACKEND_H + +#include "Event.hh" +#include "Watcher.hh" +#include "Signal.hh" +#include + +class Backend { +public: + virtual ~Backend(); + void run(); + void notifyStarted(); + + virtual void start(); + virtual void writeSnapshot(WatcherRef watcher, std::string *snapshotPath) = 0; + virtual void getEventsSince(WatcherRef watcher, std::string *snapshotPath) = 0; + virtual void subscribe(WatcherRef watcher) = 0; + virtual void unsubscribe(WatcherRef watcher) = 0; + + static std::shared_ptr getShared(std::string backend); + + void watch(WatcherRef watcher); + void unwatch(WatcherRef watcher); + void unref(); + void handleWatcherError(WatcherError &err); + + std::mutex mMutex; + std::thread mThread; +private: + std::unordered_set mSubscriptions; + Signal mStartedSignal; + + void handleError(std::exception &err); +}; + +#endif diff --git a/.pnpm-store/v11/files/ed/678c0993ef6a45a65af3170bd50dc28e2187a00281cc35756ebeb8ff70b09319ad0294d8bb23a8eb582e4722d354d2c2c9c89dc45f26ed3ebaecea5ec069e0 b/.pnpm-store/v11/files/ed/678c0993ef6a45a65af3170bd50dc28e2187a00281cc35756ebeb8ff70b09319ad0294d8bb23a8eb582e4722d354d2c2c9c89dc45f26ed3ebaecea5ec069e0 new file mode 100644 index 0000000..3b47518 --- /dev/null +++ b/.pnpm-store/v11/files/ed/678c0993ef6a45a65af3170bd50dc28e2187a00281cc35756ebeb8ff70b09319ad0294d8bb23a8eb582e4722d354d2c2c9c89dc45f26ed3ebaecea5ec069e0 @@ -0,0 +1,74 @@ +const path = require('path'); +const picomatch = require('picomatch'); +const isGlob = require('is-glob'); + +function normalizeOptions(dir, opts = {}) { + const { ignore, ...rest } = opts; + + if (Array.isArray(ignore)) { + opts = { ...rest }; + + for (const value of ignore) { + if (isGlob(value)) { + if (!opts.ignoreGlobs) { + opts.ignoreGlobs = []; + } + + const regex = picomatch.makeRe(value, { + // We set `dot: true` to workaround an issue with the + // regular expression on Linux where the resulting + // negative lookahead `(?!(\\/|^)` was never matching + // in some cases. See also https://bit.ly/3UZlQDm + dot: true, + windows: process.platform === 'win32', + }); + opts.ignoreGlobs.push(regex.source); + } else { + if (!opts.ignorePaths) { + opts.ignorePaths = []; + } + + opts.ignorePaths.push(path.resolve(dir, value)); + } + } + } + + return opts; +} + +exports.createWrapper = (binding) => { + return { + writeSnapshot(dir, snapshot, opts) { + return binding.writeSnapshot( + path.resolve(dir), + path.resolve(snapshot), + normalizeOptions(dir, opts), + ); + }, + getEventsSince(dir, snapshot, opts) { + return binding.getEventsSince( + path.resolve(dir), + path.resolve(snapshot), + normalizeOptions(dir, opts), + ); + }, + async subscribe(dir, fn, opts) { + dir = path.resolve(dir); + opts = normalizeOptions(dir, opts); + await binding.subscribe(dir, fn, opts); + + return { + unsubscribe() { + return binding.unsubscribe(dir, fn, opts); + }, + }; + }, + unsubscribe(dir, fn, opts) { + return binding.unsubscribe( + path.resolve(dir), + fn, + normalizeOptions(dir, opts), + ); + } + }; +}; diff --git a/.pnpm-store/v11/files/ed/6d045e7ae5e9e544ab671a0ed60e4b85c99400b590e4b4af958d88c751f45b5c6d25b1c53c330ea3cd35117ff920ba60f375f3f0a3ea0f170320efd7399ce7 b/.pnpm-store/v11/files/ed/6d045e7ae5e9e544ab671a0ed60e4b85c99400b590e4b4af958d88c751f45b5c6d25b1c53c330ea3cd35117ff920ba60f375f3f0a3ea0f170320efd7399ce7 new file mode 100644 index 0000000..d97764e --- /dev/null +++ b/.pnpm-store/v11/files/ed/6d045e7ae5e9e544ab671a0ed60e4b85c99400b590e4b4af958d88c751f45b5c6d25b1c53c330ea3cd35117ff920ba60f375f3f0a3ea0f170320efd7399ce7 @@ -0,0 +1,285 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); + +// lib/npm/node-platform.ts +var fs = require("fs"); +var os = require("os"); +var path = require("path"); +var ESBUILD_BINARY_PATH = process.env.ESBUILD_BINARY_PATH || ESBUILD_BINARY_PATH; +var isValidBinaryPath = (x) => !!x && x !== "/usr/bin/esbuild"; +var knownWindowsPackages = { + "win32 arm64 LE": "@esbuild/win32-arm64", + "win32 ia32 LE": "@esbuild/win32-ia32", + "win32 x64 LE": "@esbuild/win32-x64" +}; +var knownUnixlikePackages = { + "aix ppc64 BE": "@esbuild/aix-ppc64", + "android arm64 LE": "@esbuild/android-arm64", + "darwin arm64 LE": "@esbuild/darwin-arm64", + "darwin x64 LE": "@esbuild/darwin-x64", + "freebsd arm64 LE": "@esbuild/freebsd-arm64", + "freebsd x64 LE": "@esbuild/freebsd-x64", + "linux arm LE": "@esbuild/linux-arm", + "linux arm64 LE": "@esbuild/linux-arm64", + "linux ia32 LE": "@esbuild/linux-ia32", + "linux mips64el LE": "@esbuild/linux-mips64el", + "linux ppc64 LE": "@esbuild/linux-ppc64", + "linux riscv64 LE": "@esbuild/linux-riscv64", + "linux s390x BE": "@esbuild/linux-s390x", + "linux x64 LE": "@esbuild/linux-x64", + "linux loong64 LE": "@esbuild/linux-loong64", + "netbsd x64 LE": "@esbuild/netbsd-x64", + "openbsd x64 LE": "@esbuild/openbsd-x64", + "sunos x64 LE": "@esbuild/sunos-x64" +}; +var knownWebAssemblyFallbackPackages = { + "android arm LE": "@esbuild/android-arm", + "android x64 LE": "@esbuild/android-x64" +}; +function pkgAndSubpathForCurrentPlatform() { + let pkg; + let subpath; + let isWASM = false; + let platformKey = `${process.platform} ${os.arch()} ${os.endianness()}`; + if (platformKey in knownWindowsPackages) { + pkg = knownWindowsPackages[platformKey]; + subpath = "esbuild.exe"; + } else if (platformKey in knownUnixlikePackages) { + pkg = knownUnixlikePackages[platformKey]; + subpath = "bin/esbuild"; + } else if (platformKey in knownWebAssemblyFallbackPackages) { + pkg = knownWebAssemblyFallbackPackages[platformKey]; + subpath = "bin/esbuild"; + isWASM = true; + } else { + throw new Error(`Unsupported platform: ${platformKey}`); + } + return { pkg, subpath, isWASM }; +} +function downloadedBinPath(pkg, subpath) { + const esbuildLibDir = path.dirname(require.resolve("esbuild")); + return path.join(esbuildLibDir, `downloaded-${pkg.replace("/", "-")}-${path.basename(subpath)}`); +} + +// lib/npm/node-install.ts +var fs2 = require("fs"); +var os2 = require("os"); +var path2 = require("path"); +var zlib = require("zlib"); +var https = require("https"); +var child_process = require("child_process"); +var versionFromPackageJSON = require(path2.join(__dirname, "package.json")).version; +var toPath = path2.join(__dirname, "bin", "esbuild"); +var isToPathJS = true; +function validateBinaryVersion(...command) { + command.push("--version"); + let stdout; + try { + stdout = child_process.execFileSync(command.shift(), command, { + // Without this, this install script strangely crashes with the error + // "EACCES: permission denied, write" but only on Ubuntu Linux when node is + // installed from the Snap Store. This is not a problem when you download + // the official version of node. The problem appears to be that stderr + // (i.e. file descriptor 2) isn't writable? + // + // More info: + // - https://snapcraft.io/ (what the Snap Store is) + // - https://nodejs.org/dist/ (download the official version of node) + // - https://github.com/evanw/esbuild/issues/1711#issuecomment-1027554035 + // + stdio: "pipe" + }).toString().trim(); + } catch (err) { + if (os2.platform() === "darwin" && /_SecTrustEvaluateWithError/.test(err + "")) { + let os3 = "this version of macOS"; + try { + os3 = "macOS " + child_process.execFileSync("sw_vers", ["-productVersion"]).toString().trim(); + } catch { + } + throw new Error(`The "esbuild" package cannot be installed because ${os3} is too outdated. + +The Go compiler (which esbuild relies on) no longer supports ${os3}, +which means the "esbuild" binary executable can't be run. You can either: + + * Update your version of macOS to one that the Go compiler supports + * Use the "esbuild-wasm" package instead of the "esbuild" package + * Build esbuild yourself using an older version of the Go compiler +`); + } + throw err; + } + if (stdout !== versionFromPackageJSON) { + throw new Error(`Expected ${JSON.stringify(versionFromPackageJSON)} but got ${JSON.stringify(stdout)}`); + } +} +function isYarn() { + const { npm_config_user_agent } = process.env; + if (npm_config_user_agent) { + return /\byarn\//.test(npm_config_user_agent); + } + return false; +} +function fetch(url) { + return new Promise((resolve, reject) => { + https.get(url, (res) => { + if ((res.statusCode === 301 || res.statusCode === 302) && res.headers.location) + return fetch(res.headers.location).then(resolve, reject); + if (res.statusCode !== 200) + return reject(new Error(`Server responded with ${res.statusCode}`)); + let chunks = []; + res.on("data", (chunk) => chunks.push(chunk)); + res.on("end", () => resolve(Buffer.concat(chunks))); + }).on("error", reject); + }); +} +function extractFileFromTarGzip(buffer, subpath) { + try { + buffer = zlib.unzipSync(buffer); + } catch (err) { + throw new Error(`Invalid gzip data in archive: ${err && err.message || err}`); + } + let str = (i, n) => String.fromCharCode(...buffer.subarray(i, i + n)).replace(/\0.*$/, ""); + let offset = 0; + subpath = `package/${subpath}`; + while (offset < buffer.length) { + let name = str(offset, 100); + let size = parseInt(str(offset + 124, 12), 8); + offset += 512; + if (!isNaN(size)) { + if (name === subpath) return buffer.subarray(offset, offset + size); + offset += size + 511 & ~511; + } + } + throw new Error(`Could not find ${JSON.stringify(subpath)} in archive`); +} +function installUsingNPM(pkg, subpath, binPath) { + const env = { ...process.env, npm_config_global: void 0 }; + const esbuildLibDir = path2.dirname(require.resolve("esbuild")); + const installDir = path2.join(esbuildLibDir, "npm-install"); + fs2.mkdirSync(installDir); + try { + fs2.writeFileSync(path2.join(installDir, "package.json"), "{}"); + child_process.execSync( + `npm install --loglevel=error --prefer-offline --no-audit --progress=false ${pkg}@${versionFromPackageJSON}`, + { cwd: installDir, stdio: "pipe", env } + ); + const installedBinPath = path2.join(installDir, "node_modules", pkg, subpath); + fs2.renameSync(installedBinPath, binPath); + } finally { + try { + removeRecursive(installDir); + } catch { + } + } +} +function removeRecursive(dir) { + for (const entry of fs2.readdirSync(dir)) { + const entryPath = path2.join(dir, entry); + let stats; + try { + stats = fs2.lstatSync(entryPath); + } catch { + continue; + } + if (stats.isDirectory()) removeRecursive(entryPath); + else fs2.unlinkSync(entryPath); + } + fs2.rmdirSync(dir); +} +function applyManualBinaryPathOverride(overridePath) { + const pathString = JSON.stringify(overridePath); + fs2.writeFileSync(toPath, `#!/usr/bin/env node +require('child_process').execFileSync(${pathString}, process.argv.slice(2), { stdio: 'inherit' }); +`); + const libMain = path2.join(__dirname, "lib", "main.js"); + const code = fs2.readFileSync(libMain, "utf8"); + fs2.writeFileSync(libMain, `var ESBUILD_BINARY_PATH = ${pathString}; +${code}`); +} +function maybeOptimizePackage(binPath) { + if (os2.platform() !== "win32" && !isYarn()) { + const tempPath = path2.join(__dirname, "bin-esbuild"); + try { + fs2.linkSync(binPath, tempPath); + fs2.renameSync(tempPath, toPath); + isToPathJS = false; + fs2.unlinkSync(tempPath); + } catch { + } + } +} +async function downloadDirectlyFromNPM(pkg, subpath, binPath) { + const url = `https://registry.npmjs.org/${pkg}/-/${pkg.replace("@esbuild/", "")}-${versionFromPackageJSON}.tgz`; + console.error(`[esbuild] Trying to download ${JSON.stringify(url)}`); + try { + fs2.writeFileSync(binPath, extractFileFromTarGzip(await fetch(url), subpath)); + fs2.chmodSync(binPath, 493); + } catch (e) { + console.error(`[esbuild] Failed to download ${JSON.stringify(url)}: ${e && e.message || e}`); + throw e; + } +} +async function checkAndPreparePackage() { + if (isValidBinaryPath(ESBUILD_BINARY_PATH)) { + if (!fs2.existsSync(ESBUILD_BINARY_PATH)) { + console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${ESBUILD_BINARY_PATH}`); + } else { + applyManualBinaryPathOverride(ESBUILD_BINARY_PATH); + return; + } + } + const { pkg, subpath } = pkgAndSubpathForCurrentPlatform(); + let binPath; + try { + binPath = require.resolve(`${pkg}/${subpath}`); + } catch (e) { + console.error(`[esbuild] Failed to find package "${pkg}" on the file system + +This can happen if you use the "--no-optional" flag. The "optionalDependencies" +package.json feature is used by esbuild to install the correct binary executable +for your current platform. This install script will now attempt to work around +this. If that fails, you need to remove the "--no-optional" flag to use esbuild. +`); + binPath = downloadedBinPath(pkg, subpath); + try { + console.error(`[esbuild] Trying to install package "${pkg}" using npm`); + installUsingNPM(pkg, subpath, binPath); + } catch (e2) { + console.error(`[esbuild] Failed to install package "${pkg}" using npm: ${e2 && e2.message || e2}`); + try { + await downloadDirectlyFromNPM(pkg, subpath, binPath); + } catch (e3) { + throw new Error(`Failed to install package "${pkg}"`); + } + } + } + maybeOptimizePackage(binPath); +} +checkAndPreparePackage().then(() => { + if (isToPathJS) { + validateBinaryVersion(process.execPath, toPath); + } else { + validateBinaryVersion(toPath); + } +}); diff --git a/.pnpm-store/v11/files/ee/e1da713440119577901daaf956a858b70008ebd1d0d93b88e802a8d7498201272770810750aae4fa54de4e05e43a71d8eccd64b318a57786d273e6a26de747 b/.pnpm-store/v11/files/ee/e1da713440119577901daaf956a858b70008ebd1d0d93b88e802a8d7498201272770810750aae4fa54de4e05e43a71d8eccd64b318a57786d273e6a26de747 new file mode 100644 index 0000000..699cded --- /dev/null +++ b/.pnpm-store/v11/files/ee/e1da713440119577901daaf956a858b70008ebd1d0d93b88e802a8d7498201272770810750aae4fa54de4e05e43a71d8eccd64b318a57786d273e6a26de747 @@ -0,0 +1,35 @@ +#ifndef WATCHMAN_H +#define WATCHMAN_H + +#include "../Backend.hh" +#include "./BSER.hh" +#include "../Signal.hh" +#include "./IPC.hh" + +class WatchmanBackend : public Backend { +public: + static bool checkAvailable(); + void start() override; + WatchmanBackend() : mStopped(false) {}; + ~WatchmanBackend(); + void writeSnapshot(WatcherRef watcher, std::string *snapshotPath) override; + void getEventsSince(WatcherRef watcher, std::string *snapshotPath) override; + void subscribe(WatcherRef watcher) override; + void unsubscribe(WatcherRef watcher) override; +private: + std::unique_ptr mIPC; + Signal mRequestSignal; + Signal mResponseSignal; + BSER::Object mResponse; + std::string mError; + std::unordered_map mSubscriptions; + bool mStopped; + Signal mEndedSignal; + + std::string clock(WatcherRef watcher); + void watchmanWatch(std::string dir); + BSER::Object watchmanRequest(BSER cmd); + void handleSubscription(BSER::Object obj); +}; + +#endif diff --git a/.pnpm-store/v11/files/f1/41a56953321f3a9bc0eb87642ad794ce33a2d5d1894eb35b048f0961fc23f42ad18bcfe63b6ff7e3c33c8c4c319b3c7a310e81fba5d3358c2059c3bae89ab3 b/.pnpm-store/v11/files/f1/41a56953321f3a9bc0eb87642ad794ce33a2d5d1894eb35b048f0961fc23f42ad18bcfe63b6ff7e3c33c8c4c319b3c7a310e81fba5d3358c2059c3bae89ab3 new file mode 100644 index 0000000..bbdcbc5 --- /dev/null +++ b/.pnpm-store/v11/files/f1/41a56953321f3a9bc0eb87642ad794ce33a2d5d1894eb35b048f0961fc23f42ad18bcfe63b6ff7e3c33c8c4c319b3c7a310e81fba5d3358c2059c3bae89ab3 @@ -0,0 +1,33 @@ +import Vue from 'vue' +import type { PluginFunction, PluginObject } from 'vue' +declare const isVue2: boolean +declare const isVue3: boolean +declare const Vue2: typeof Vue | undefined +declare const version: string +declare const install: (vue?: typeof Vue) => void +/** + * @deprecated To avoid bringing in all the tree-shakable modules, this API has been deprecated. Use `Vue2` or named exports instead. + * Refer to https://github.com/vueuse/vue-demi/issues/41 + */ +declare const V: typeof Vue + +/** + * DebuggerEvent is a Vue 3 development only feature. This type cannot exist in Vue 2. + */ +export declare type DebuggerEvent = never + +// accept no generic because Vue 3 doesn't accept any +// https://github.com/vuejs/vue-next/pull/2758/ +export declare type Plugin = PluginObject | PluginFunction +export type { VNode } from 'vue' +export * from '@vue/composition-api' +export { + V as Vue, + Vue2, + isVue2, + isVue3, + version, + install, +} + +export declare function hasInjectionContext(): boolean diff --git a/.pnpm-store/v11/files/f5/6db50f03b1dcc2a6d89da19c7e781a986328d8e830066a5cba21417e76c2e39ae72b18f87da7cb8a74b1094c88e2079dff260a1f40c1feecbd300258352988 b/.pnpm-store/v11/files/f5/6db50f03b1dcc2a6d89da19c7e781a986328d8e830066a5cba21417e76c2e39ae72b18f87da7cb8a74b1094c88e2079dff260a1f40c1feecbd300258352988 new file mode 100644 index 0000000..c3d298e --- /dev/null +++ b/.pnpm-store/v11/files/f5/6db50f03b1dcc2a6d89da19c7e781a986328d8e830066a5cba21417e76c2e39ae72b18f87da7cb8a74b1094c88e2079dff260a1f40c1feecbd300258352988 @@ -0,0 +1,34 @@ +var Vue = require('vue') +var VueCompositionAPI = require('@vue/composition-api') + +function install(_vue) { + var vueLib = _vue || Vue + if (vueLib && 'default' in vueLib) { + vueLib = vueLib.default + } + + if (vueLib && !vueLib['__composition_api_installed__']) { + if (VueCompositionAPI && 'default' in VueCompositionAPI) + vueLib.use(VueCompositionAPI.default) + else if (VueCompositionAPI) + vueLib.use(VueCompositionAPI) + } +} + +install(Vue) + +Object.keys(VueCompositionAPI).forEach(function(key) { + exports[key] = VueCompositionAPI[key] +}) + +exports.Vue = Vue +exports.Vue2 = Vue +exports.isVue2 = true +exports.isVue3 = false +exports.install = install +exports.version = Vue.version + +// Not implemented https://github.com/vuejs/core/pull/8111, falls back to getCurrentInstance() +exports.hasInjectionContext = function () { + return !!VueCompositionAPI.getCurrentInstance() +} diff --git a/.pnpm-store/v11/files/f7/425515e47876aac16bad4e23985181ffe17cd43025f06be5d6a92395dc46232ee586aa7a1f3fb451bb7b45d0984baba95382817be84a22e420f4c1cead7422 b/.pnpm-store/v11/files/f7/425515e47876aac16bad4e23985181ffe17cd43025f06be5d6a92395dc46232ee586aa7a1f3fb451bb7b45d0984baba95382817be84a22e420f4c1cead7422 new file mode 100644 index 0000000..07ce9b5 --- /dev/null +++ b/.pnpm-store/v11/files/f7/425515e47876aac16bad4e23985181ffe17cd43025f06be5d6a92395dc46232ee586aa7a1f3fb451bb7b45d0984baba95382817be84a22e420f4c1cead7422 @@ -0,0 +1,49 @@ +declare type FilePath = string; +declare type GlobPattern = string; + +declare namespace ParcelWatcher { + export type BackendType = + | 'fs-events' + | 'watchman' + | 'inotify' + | 'windows' + | 'brute-force'; + export type EventType = 'create' | 'update' | 'delete'; + export interface Options { + ignore?: (FilePath|GlobPattern)[]; + backend?: BackendType; + } + export type SubscribeCallback = ( + err: Error | null, + events: Event[] + ) => unknown; + export interface AsyncSubscription { + unsubscribe(): Promise; + } + export interface Event { + path: FilePath; + type: EventType; + } + export function getEventsSince( + dir: FilePath, + snapshot: FilePath, + opts?: Options + ): Promise; + export function subscribe( + dir: FilePath, + fn: SubscribeCallback, + opts?: Options + ): Promise; + export function unsubscribe( + dir: FilePath, + fn: SubscribeCallback, + opts?: Options + ): Promise; + export function writeSnapshot( + dir: FilePath, + snapshot: FilePath, + opts?: Options + ): Promise; +} + +export = ParcelWatcher; \ No newline at end of file diff --git a/.pnpm-store/v11/files/fa/96fa29092e603af1551c35d5a6ac431195319e07eb6c9b8394756ca6913b5427e0e0e21887a56665002ace7f3e81e97a577b81a9dda6067aab57f0fdc3c6f7 b/.pnpm-store/v11/files/fa/96fa29092e603af1551c35d5a6ac431195319e07eb6c9b8394756ca6913b5427e0e0e21887a56665002ace7f3e81e97a577b81a9dda6067aab57f0fdc3c6f7 new file mode 100644 index 0000000..6bd2025 --- /dev/null +++ b/.pnpm-store/v11/files/fa/96fa29092e603af1551c35d5a6ac431195319e07eb6c9b8394756ca6913b5427e0e0e21887a56665002ace7f3e81e97a577b81a9dda6067aab57f0fdc3c6f7 @@ -0,0 +1,69 @@ +#ifndef BSER_H +#define BSER_H + +#include +#include +#include +#include +#include + +enum BSERType { + BSER_ARRAY = 0x00, + BSER_OBJECT = 0x01, + BSER_STRING = 0x02, + BSER_INT8 = 0x03, + BSER_INT16 = 0x04, + BSER_INT32 = 0x05, + BSER_INT64 = 0x06, + BSER_REAL = 0x07, + BSER_BOOL_TRUE = 0x08, + BSER_BOOL_FALSE = 0x09, + BSER_NULL = 0x0a, + BSER_TEMPLATE = 0x0b +}; + +class BSERValue; + +class BSER { +public: + typedef std::vector Array; + typedef std::unordered_map Object; + + BSER(); + BSER(BSER::Array value); + BSER(BSER::Object value); + BSER(std::string value); + BSER(const char *value); + BSER(int64_t value); + BSER(double value); + BSER(bool value); + BSER(std::istream &iss); + + BSER::Array arrayValue(); + BSER::Object objectValue(); + std::string stringValue(); + int64_t intValue(); + double doubleValue(); + bool boolValue(); + void encode(std::ostream &oss); + + static int64_t decodeLength(std::istream &iss); + std::string encode(); +private: + std::shared_ptr m_ptr; +}; + +class BSERValue { +protected: + friend class BSER; + virtual BSER::Array arrayValue() { return BSER::Array(); } + virtual BSER::Object objectValue() { return BSER::Object(); } + virtual std::string stringValue() { return std::string(); } + virtual int64_t intValue() { return 0; } + virtual double doubleValue() { return 0; } + virtual bool boolValue() { return false; } + virtual void encode(std::ostream &oss) {} + virtual ~BSERValue() {} +}; + +#endif diff --git a/.pnpm-store/v11/index.db b/.pnpm-store/v11/index.db new file mode 100644 index 0000000..8fdf9e7 Binary files /dev/null and b/.pnpm-store/v11/index.db differ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..b21c917 --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,2535 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + dependencies: + axios: + specifier: ^1.7.2 + version: 1.16.0 + element-plus: + specifier: ^2.7.8 + version: 2.13.7(typescript@5.9.3)(vue@3.5.34(typescript@5.9.3)) + pinia: + specifier: ^2.2.0 + version: 2.3.1(typescript@5.9.3)(vue@3.5.34(typescript@5.9.3)) + qs: + specifier: ^6.12.3 + version: 6.15.1 + vant: + specifier: ^4.9.4 + version: 4.9.24(vue@3.5.34(typescript@5.9.3)) + vue: + specifier: ^3.4.31 + version: 3.5.34(typescript@5.9.3) + vue-router: + specifier: ^4.4.0 + version: 4.6.4(vue@3.5.34(typescript@5.9.3)) + devDependencies: + '@types/node': + specifier: ^22.0.0 + version: 22.19.17 + '@types/qs': + specifier: ^6.9.15 + version: 6.15.1 + '@vitejs/plugin-vue': + specifier: ^5.0.5 + version: 5.2.4(vite@5.4.21(@types/node@22.19.17)(sass@1.99.0))(vue@3.5.34(typescript@5.9.3)) + '@vitejs/plugin-vue-jsx': + specifier: ^4.0.1 + version: 4.2.0(vite@5.4.21(@types/node@22.19.17)(sass@1.99.0))(vue@3.5.34(typescript@5.9.3)) + '@vue/tsconfig': + specifier: ^0.5.1 + version: 0.5.1 + postcss: + specifier: ^8.4.40 + version: 8.5.14 + sass: + specifier: ^1.77.6 + version: 1.99.0 + typescript: + specifier: ^5.2.2 + version: 5.9.3 + unplugin-auto-import: + specifier: ^0.18.2 + version: 0.18.6(@vueuse/core@12.0.0(typescript@5.9.3))(rollup@4.60.3) + unplugin-vue-components: + specifier: ^0.27.3 + version: 0.27.5(@babel/parser@7.29.3)(rollup@4.60.3)(vue@3.5.34(typescript@5.9.3)) + vite: + specifier: ^5.3.4 + version: 5.4.21(@types/node@22.19.17)(sass@1.99.0) + vue-tsc: + specifier: ^2.0.24 + version: 2.2.12(typescript@5.9.3) + +packages: + + '@antfu/utils@0.7.10': + resolution: {integrity: sha512-+562v9k4aI80m1+VuMHehNJWLOFjBnXn3tdOitzD0il5b7smkSBal4+a3oKiQTbrwMmN/TBUMDvbdoWDehgOww==} + + '@babel/code-frame@7.29.0': + resolution: {integrity: sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw==} + engines: {node: '>=6.9.0'} + + '@babel/compat-data@7.29.3': + resolution: {integrity: sha512-LIVqM46zQWZhj17qA8wb4nW/ixr2y1Nw+r1etiAWgRM6U1IqP+LNhL1yg440jYZR72jCWcWbLWzIosH+uP1fqg==} + engines: {node: '>=6.9.0'} + + '@babel/core@7.29.0': + resolution: {integrity: sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==} + engines: {node: '>=6.9.0'} + + '@babel/generator@7.29.1': + resolution: {integrity: sha512-qsaF+9Qcm2Qv8SRIMMscAvG4O3lJ0F1GuMo5HR/Bp02LopNgnZBC/EkbevHFeGs4ls/oPz9v+Bsmzbkbe+0dUw==} + engines: {node: '>=6.9.0'} + + '@babel/helper-annotate-as-pure@7.27.3': + resolution: {integrity: sha512-fXSwMQqitTGeHLBC08Eq5yXz2m37E4pJX1qAU1+2cNedz/ifv/bVXft90VeSav5nFO61EcNgwr0aJxbyPaWBPg==} + engines: {node: '>=6.9.0'} + + '@babel/helper-compilation-targets@7.28.6': + resolution: {integrity: sha512-JYtls3hqi15fcx5GaSNL7SCTJ2MNmjrkHXg4FSpOA/grxK8KwyZ5bubHsCq8FXCkua6xhuaaBit+3b7+VZRfcA==} + engines: {node: '>=6.9.0'} + + '@babel/helper-create-class-features-plugin@7.29.3': + resolution: {integrity: sha512-RpLYy2sb51oNLjuu1iD3bwBqCBWUzjO0ocp+iaCP/lJtb2CPLcnC2Fftw+4sAzaMELGeWTgExSKADbdo0GFVzA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + + '@babel/helper-globals@7.28.0': + resolution: {integrity: sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==} + engines: {node: '>=6.9.0'} + + '@babel/helper-member-expression-to-functions@7.28.5': + resolution: {integrity: sha512-cwM7SBRZcPCLgl8a7cY0soT1SptSzAlMH39vwiRpOQkJlh53r5hdHwLSCZpQdVLT39sZt+CRpNwYG4Y2v77atg==} + engines: {node: '>=6.9.0'} + + '@babel/helper-module-imports@7.28.6': + resolution: {integrity: sha512-l5XkZK7r7wa9LucGw9LwZyyCUscb4x37JWTPz7swwFE/0FMQAGpiWUZn8u9DzkSBWEcK25jmvubfpw2dnAMdbw==} + engines: {node: '>=6.9.0'} + + '@babel/helper-module-transforms@7.28.6': + resolution: {integrity: sha512-67oXFAYr2cDLDVGLXTEABjdBJZ6drElUSI7WKp70NrpyISso3plG9SAGEF6y7zbha/wOzUByWWTJvEDVNIUGcA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + + '@babel/helper-optimise-call-expression@7.27.1': + resolution: {integrity: sha512-URMGH08NzYFhubNSGJrpUEphGKQwMQYBySzat5cAByY1/YgIRkULnIy3tAMeszlL/so2HbeilYloUmSpd7GdVw==} + engines: {node: '>=6.9.0'} + + '@babel/helper-plugin-utils@7.28.6': + resolution: {integrity: sha512-S9gzZ/bz83GRysI7gAD4wPT/AI3uCnY+9xn+Mx/KPs2JwHJIz1W8PZkg2cqyt3RNOBM8ejcXhV6y8Og7ly/Dug==} + engines: {node: '>=6.9.0'} + + '@babel/helper-replace-supers@7.28.6': + resolution: {integrity: sha512-mq8e+laIk94/yFec3DxSjCRD2Z0TAjhVbEJY3UQrlwVo15Lmt7C2wAUbK4bjnTs4APkwsYLTahXRraQXhb1WCg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + + '@babel/helper-skip-transparent-expression-wrappers@7.27.1': + resolution: {integrity: sha512-Tub4ZKEXqbPjXgWLl2+3JpQAYBJ8+ikpQ2Ocj/q/r0LwE3UhENh7EUabyHjz2kCEsrRY83ew2DQdHluuiDQFzg==} + engines: {node: '>=6.9.0'} + + '@babel/helper-string-parser@7.27.1': + resolution: {integrity: sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==} + engines: {node: '>=6.9.0'} + + '@babel/helper-validator-identifier@7.28.5': + resolution: {integrity: sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==} + engines: {node: '>=6.9.0'} + + '@babel/helper-validator-option@7.27.1': + resolution: {integrity: sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==} + engines: {node: '>=6.9.0'} + + '@babel/helpers@7.29.2': + resolution: {integrity: sha512-HoGuUs4sCZNezVEKdVcwqmZN8GoHirLUcLaYVNBK2J0DadGtdcqgr3BCbvH8+XUo4NGjNl3VOtSjEKNzqfFgKw==} + engines: {node: '>=6.9.0'} + + '@babel/parser@7.29.3': + resolution: {integrity: sha512-b3ctpQwp+PROvU/cttc4OYl4MzfJUWy6FZg+PMXfzmt/+39iHVF0sDfqay8TQM3JA2EUOyKcFZt75jWriQijsA==} + engines: {node: '>=6.0.0'} + hasBin: true + + '@babel/plugin-syntax-jsx@7.28.6': + resolution: {integrity: sha512-wgEmr06G6sIpqr8YDwA2dSRTE3bJ+V0IfpzfSY3Lfgd7YWOaAdlykvJi13ZKBt8cZHfgH1IXN+CL656W3uUa4w==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-typescript@7.28.6': + resolution: {integrity: sha512-+nDNmQye7nlnuuHDboPbGm00Vqg3oO8niRRL27/4LYHUsHYh0zJ1xWOz0uRwNFmM1Avzk8wZbc6rdiYhomzv/A==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-typescript@7.28.6': + resolution: {integrity: sha512-0YWL2RFxOqEm9Efk5PvreamxPME8OyY0wM5wh5lHjF+VtVhdneCWGzZeSqzOfiobVqQaNCd2z0tQvnI9DaPWPw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/template@7.28.6': + resolution: {integrity: sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ==} + engines: {node: '>=6.9.0'} + + '@babel/traverse@7.29.0': + resolution: {integrity: sha512-4HPiQr0X7+waHfyXPZpWPfWL/J7dcN1mx9gL6WdQVMbPnF3+ZhSMs8tCxN7oHddJE9fhNE7+lxdnlyemKfJRuA==} + engines: {node: '>=6.9.0'} + + '@babel/types@7.29.0': + resolution: {integrity: sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==} + engines: {node: '>=6.9.0'} + + '@ctrl/tinycolor@4.2.0': + resolution: {integrity: sha512-kzyuwOAQnXJNLS9PSyrk0CWk35nWJW/zl/6KvnTBMFK65gm7U1/Z5BqjxeapjZCIhQcM/DsrEmcbRwDyXyXK4A==} + engines: {node: '>=14'} + + '@element-plus/icons-vue@2.3.2': + resolution: {integrity: sha512-OzIuTaIfC8QXEPmJvB4Y4kw34rSXdCJzxcD1kFStBvr8bK6X1zQAYDo0CNMjojnfTqRQCJ0I7prlErcoRiET2A==} + peerDependencies: + vue: ^3.2.0 + + '@esbuild/aix-ppc64@0.21.5': + resolution: {integrity: sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [aix] + + '@esbuild/android-arm64@0.21.5': + resolution: {integrity: sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==} + engines: {node: '>=12'} + cpu: [arm64] + os: [android] + + '@esbuild/android-arm@0.21.5': + resolution: {integrity: sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==} + engines: {node: '>=12'} + cpu: [arm] + os: [android] + + '@esbuild/android-x64@0.21.5': + resolution: {integrity: sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==} + engines: {node: '>=12'} + cpu: [x64] + os: [android] + + '@esbuild/darwin-arm64@0.21.5': + resolution: {integrity: sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + + '@esbuild/darwin-x64@0.21.5': + resolution: {integrity: sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + + '@esbuild/freebsd-arm64@0.21.5': + resolution: {integrity: sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==} + engines: {node: '>=12'} + cpu: [arm64] + os: [freebsd] + + '@esbuild/freebsd-x64@0.21.5': + resolution: {integrity: sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [freebsd] + + '@esbuild/linux-arm64@0.21.5': + resolution: {integrity: sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + + '@esbuild/linux-arm@0.21.5': + resolution: {integrity: sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + + '@esbuild/linux-ia32@0.21.5': + resolution: {integrity: sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==} + engines: {node: '>=12'} + cpu: [ia32] + os: [linux] + + '@esbuild/linux-loong64@0.21.5': + resolution: {integrity: sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==} + engines: {node: '>=12'} + cpu: [loong64] + os: [linux] + + '@esbuild/linux-mips64el@0.21.5': + resolution: {integrity: sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==} + engines: {node: '>=12'} + cpu: [mips64el] + os: [linux] + + '@esbuild/linux-ppc64@0.21.5': + resolution: {integrity: sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [linux] + + '@esbuild/linux-riscv64@0.21.5': + resolution: {integrity: sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==} + engines: {node: '>=12'} + cpu: [riscv64] + os: [linux] + + '@esbuild/linux-s390x@0.21.5': + resolution: {integrity: sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==} + engines: {node: '>=12'} + cpu: [s390x] + os: [linux] + + '@esbuild/linux-x64@0.21.5': + resolution: {integrity: sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + + '@esbuild/netbsd-x64@0.21.5': + resolution: {integrity: sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==} + engines: {node: '>=12'} + cpu: [x64] + os: [netbsd] + + '@esbuild/openbsd-x64@0.21.5': + resolution: {integrity: sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==} + engines: {node: '>=12'} + cpu: [x64] + os: [openbsd] + + '@esbuild/sunos-x64@0.21.5': + resolution: {integrity: sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==} + engines: {node: '>=12'} + cpu: [x64] + os: [sunos] + + '@esbuild/win32-arm64@0.21.5': + resolution: {integrity: sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + + '@esbuild/win32-ia32@0.21.5': + resolution: {integrity: sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==} + engines: {node: '>=12'} + cpu: [ia32] + os: [win32] + + '@esbuild/win32-x64@0.21.5': + resolution: {integrity: sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + + '@floating-ui/core@1.7.5': + resolution: {integrity: sha512-1Ih4WTWyw0+lKyFMcBHGbb5U5FtuHJuujoyyr5zTaWS5EYMeT6Jb2AuDeftsCsEuchO+mM2ij5+q9crhydzLhQ==} + + '@floating-ui/dom@1.7.6': + resolution: {integrity: sha512-9gZSAI5XM36880PPMm//9dfiEngYoC6Am2izES1FF406YFsjvyBMmeJ2g4SAju3xWwtuynNRFL2s9hgxpLI5SQ==} + + '@floating-ui/utils@0.2.11': + resolution: {integrity: sha512-RiB/yIh78pcIxl6lLMG0CgBXAZ2Y0eVHqMPYugu+9U0AeT6YBeiJpf7lbdJNIugFP5SIjwNRgo4DhR1Qxi26Gg==} + + '@jridgewell/gen-mapping@0.3.13': + resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==} + + '@jridgewell/remapping@2.3.5': + resolution: {integrity: sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==} + + '@jridgewell/resolve-uri@3.1.2': + resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} + engines: {node: '>=6.0.0'} + + '@jridgewell/sourcemap-codec@1.5.5': + resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==} + + '@jridgewell/trace-mapping@0.3.31': + resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==} + + '@nodelib/fs.scandir@2.1.5': + resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} + engines: {node: '>= 8'} + + '@nodelib/fs.stat@2.0.5': + resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} + engines: {node: '>= 8'} + + '@nodelib/fs.walk@1.2.8': + resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} + engines: {node: '>= 8'} + + '@parcel/watcher-android-arm64@2.5.6': + resolution: {integrity: sha512-YQxSS34tPF/6ZG7r/Ih9xy+kP/WwediEUsqmtf0cuCV5TPPKw/PQHRhueUo6JdeFJaqV3pyjm0GdYjZotbRt/A==} + engines: {node: '>= 10.0.0'} + cpu: [arm64] + os: [android] + + '@parcel/watcher-darwin-arm64@2.5.6': + resolution: {integrity: sha512-Z2ZdrnwyXvvvdtRHLmM4knydIdU9adO3D4n/0cVipF3rRiwP+3/sfzpAwA/qKFL6i1ModaabkU7IbpeMBgiVEA==} + engines: {node: '>= 10.0.0'} + cpu: [arm64] + os: [darwin] + + '@parcel/watcher-darwin-x64@2.5.6': + resolution: {integrity: sha512-HgvOf3W9dhithcwOWX9uDZyn1lW9R+7tPZ4sug+NGrGIo4Rk1hAXLEbcH1TQSqxts0NYXXlOWqVpvS1SFS4fRg==} + engines: {node: '>= 10.0.0'} + cpu: [x64] + os: [darwin] + + '@parcel/watcher-freebsd-x64@2.5.6': + resolution: {integrity: sha512-vJVi8yd/qzJxEKHkeemh7w3YAn6RJCtYlE4HPMoVnCpIXEzSrxErBW5SJBgKLbXU3WdIpkjBTeUNtyBVn8TRng==} + engines: {node: '>= 10.0.0'} + cpu: [x64] + os: [freebsd] + + '@parcel/watcher-linux-arm-glibc@2.5.6': + resolution: {integrity: sha512-9JiYfB6h6BgV50CCfasfLf/uvOcJskMSwcdH1PHH9rvS1IrNy8zad6IUVPVUfmXr+u+Km9IxcfMLzgdOudz9EQ==} + engines: {node: '>= 10.0.0'} + cpu: [arm] + os: [linux] + libc: [glibc] + + '@parcel/watcher-linux-arm-musl@2.5.6': + resolution: {integrity: sha512-Ve3gUCG57nuUUSyjBq/MAM0CzArtuIOxsBdQ+ftz6ho8n7s1i9E1Nmk/xmP323r2YL0SONs1EuwqBp2u1k5fxg==} + engines: {node: '>= 10.0.0'} + cpu: [arm] + os: [linux] + libc: [musl] + + '@parcel/watcher-linux-arm64-glibc@2.5.6': + resolution: {integrity: sha512-f2g/DT3NhGPdBmMWYoxixqYr3v/UXcmLOYy16Bx0TM20Tchduwr4EaCbmxh1321TABqPGDpS8D/ggOTaljijOA==} + engines: {node: '>= 10.0.0'} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@parcel/watcher-linux-arm64-musl@2.5.6': + resolution: {integrity: sha512-qb6naMDGlbCwdhLj6hgoVKJl2odL34z2sqkC7Z6kzir8b5W65WYDpLB6R06KabvZdgoHI/zxke4b3zR0wAbDTA==} + engines: {node: '>= 10.0.0'} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@parcel/watcher-linux-x64-glibc@2.5.6': + resolution: {integrity: sha512-kbT5wvNQlx7NaGjzPFu8nVIW1rWqV780O7ZtkjuWaPUgpv2NMFpjYERVi0UYj1msZNyCzGlaCWEtzc+exjMGbQ==} + engines: {node: '>= 10.0.0'} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@parcel/watcher-linux-x64-musl@2.5.6': + resolution: {integrity: sha512-1JRFeC+h7RdXwldHzTsmdtYR/Ku8SylLgTU/reMuqdVD7CtLwf0VR1FqeprZ0eHQkO0vqsbvFLXUmYm/uNKJBg==} + engines: {node: '>= 10.0.0'} + cpu: [x64] + os: [linux] + libc: [musl] + + '@parcel/watcher-win32-arm64@2.5.6': + resolution: {integrity: sha512-3ukyebjc6eGlw9yRt678DxVF7rjXatWiHvTXqphZLvo7aC5NdEgFufVwjFfY51ijYEWpXbqF5jtrK275z52D4Q==} + engines: {node: '>= 10.0.0'} + cpu: [arm64] + os: [win32] + + '@parcel/watcher-win32-ia32@2.5.6': + resolution: {integrity: sha512-k35yLp1ZMwwee3Ez/pxBi5cf4AoBKYXj00CZ80jUz5h8prpiaQsiRPKQMxoLstNuqe2vR4RNPEAEcjEFzhEz/g==} + engines: {node: '>= 10.0.0'} + cpu: [ia32] + os: [win32] + + '@parcel/watcher-win32-x64@2.5.6': + resolution: {integrity: sha512-hbQlYcCq5dlAX9Qx+kFb0FHue6vbjlf0FrNzSKdYK2APUf7tGfGxQCk2ihEREmbR6ZMc0MVAD5RIX/41gpUzTw==} + engines: {node: '>= 10.0.0'} + cpu: [x64] + os: [win32] + + '@parcel/watcher@2.5.6': + resolution: {integrity: sha512-tmmZ3lQxAe/k/+rNnXQRawJ4NjxO2hqiOLTHvWchtGZULp4RyFeh6aU4XdOYBFe2KE1oShQTv4AblOs2iOrNnQ==} + engines: {node: '>= 10.0.0'} + + '@rolldown/pluginutils@1.0.0-rc.18': + resolution: {integrity: sha512-CUY5Mnhe64xQBGZEEXQ5WyZwsc1JU3vAZLIxtrsBt3LO6UOb+C8GunVKqe9sT8NeWb4lqSaoJtp2xo6GxT1MNw==} + + '@rollup/pluginutils@5.3.0': + resolution: {integrity: sha512-5EdhGZtnu3V88ces7s53hhfK5KSASnJZv8Lulpc04cWO3REESroJXg73DFsOmgbU2BhwV0E20bu2IDZb3VKW4Q==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + + '@rollup/rollup-android-arm-eabi@4.60.3': + resolution: {integrity: sha512-x35CNW/ANXG3hE/EZpRU8MXX1JDN86hBb2wMGAtltkz7pc6cxgjpy1OMMfDosOQ+2hWqIkag/fGok1Yady9nGw==} + cpu: [arm] + os: [android] + + '@rollup/rollup-android-arm64@4.60.3': + resolution: {integrity: sha512-xw3xtkDApIOGayehp2+Rz4zimfkaX65r4t47iy+ymQB2G4iJCBBfj0ogVg5jpvjpn8UWn/+q9tprxleYeNp3Hw==} + cpu: [arm64] + os: [android] + + '@rollup/rollup-darwin-arm64@4.60.3': + resolution: {integrity: sha512-vo6Y5Qfpx7/5EaamIwi0WqW2+zfiusVihKatLvtN1VFVy3D13uERk/6gZLU1UiHRL6fDXqj/ELIeVRGnvcTE1g==} + cpu: [arm64] + os: [darwin] + + '@rollup/rollup-darwin-x64@4.60.3': + resolution: {integrity: sha512-D+0QGcZhBzTN82weOnsSlY7V7+RMmPuF1CkbxyMAGE8+ZHeUjyb76ZiWmBlCu//AQQONvxcqRbwZTajZKqjuOw==} + cpu: [x64] + os: [darwin] + + '@rollup/rollup-freebsd-arm64@4.60.3': + resolution: {integrity: sha512-6HnvHCT7fDyj6R0Ph7A6x8dQS/S38MClRWeDLqc0MdfWkxjiu1HSDYrdPhqSILzjTIC/pnXbbJbo+ft+gy/9hQ==} + cpu: [arm64] + os: [freebsd] + + '@rollup/rollup-freebsd-x64@4.60.3': + resolution: {integrity: sha512-KHLgC3WKlUYW3ShFKnnosZDOJ0xjg9zp7au3sIm2bs/tGBeC2ipmvRh/N7JKi0t9Ue20C0dpEshi8WUubg+cnA==} + cpu: [x64] + os: [freebsd] + + '@rollup/rollup-linux-arm-gnueabihf@4.60.3': + resolution: {integrity: sha512-DV6fJoxEYWJOvaZIsok7KrYl0tPvga5OZ2yvKHNNYyk/2roMLqQAbGhr78EQ5YhHpnhLKJD3S1WFusAkmUuV5g==} + cpu: [arm] + os: [linux] + libc: [glibc] + + '@rollup/rollup-linux-arm-musleabihf@4.60.3': + resolution: {integrity: sha512-mQKoJAzvuOs6F+TZybQO4GOTSMUu7v0WdxEk24krQ/uUxXoPTtHjuaUuPmFhtBcM4K0ons8nrE3JyhTuCFtT/w==} + cpu: [arm] + os: [linux] + libc: [musl] + + '@rollup/rollup-linux-arm64-gnu@4.60.3': + resolution: {integrity: sha512-Whjj2qoiJ6+OOJMGptTYazaJvjOJm+iKHpXQM1P3LzGjt7Ff++Tp7nH4N8J/BUA7R9IHfDyx4DJIflifwnbmIA==} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@rollup/rollup-linux-arm64-musl@4.60.3': + resolution: {integrity: sha512-4YTNHKqGng5+yiZt3mg77nmyuCfmNfX4fPmyUapBcIk+BdwSwmCWGXOUxhXbBEkFHtoN5boLj/5NON+u5QC9tg==} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@rollup/rollup-linux-loong64-gnu@4.60.3': + resolution: {integrity: sha512-SU3kNlhkpI4UqlUc2VXPGK9o886ZsSeGfMAX2ba2b8DKmMXq4AL7KUrkSWVbb7koVqx41Yczx6dx5PNargIrEA==} + cpu: [loong64] + os: [linux] + libc: [glibc] + + '@rollup/rollup-linux-loong64-musl@4.60.3': + resolution: {integrity: sha512-6lDLl5h4TXpB1mTf2rQWnAk/LcXrx9vBfu/DT5TIPhvMhRWaZ5MxkIc8u4lJAmBo6klTe1ywXIUHFjylW505sg==} + cpu: [loong64] + os: [linux] + libc: [musl] + + '@rollup/rollup-linux-ppc64-gnu@4.60.3': + resolution: {integrity: sha512-BMo8bOw8evlup/8G+cj5xWtPyp93xPdyoSN16Zy90Q2QZ0ZYRhCt6ZJSwbrRzG9HApFabjwj2p25TUPDWrhzqQ==} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@rollup/rollup-linux-ppc64-musl@4.60.3': + resolution: {integrity: sha512-E0L8X1dZN1/Rph+5VPF6Xj2G7JJvMACVXtamTJIDrVI44Y3K+G8gQaMEAavbqCGTa16InptiVrX6eM6pmJ+7qA==} + cpu: [ppc64] + os: [linux] + libc: [musl] + + '@rollup/rollup-linux-riscv64-gnu@4.60.3': + resolution: {integrity: sha512-oZJ/WHaVfHUiRAtmTAeo3DcevNsVvH8mbvodjZy7D5QKvCefO371SiKRpxoDcCxB3PTRTLayWBkvmDQKTcX/sw==} + cpu: [riscv64] + os: [linux] + libc: [glibc] + + '@rollup/rollup-linux-riscv64-musl@4.60.3': + resolution: {integrity: sha512-Dhbyh7j9FybM3YaTgaHmVALwA8AkUwTPccyCQ79TG9AJUsMQqgN1DDEZNr4+QUfwiWvLDumW5vdwzoeUF+TNxQ==} + cpu: [riscv64] + os: [linux] + libc: [musl] + + '@rollup/rollup-linux-s390x-gnu@4.60.3': + resolution: {integrity: sha512-cJd1X5XhHHlltkaypz1UcWLA8AcoIi1aWhsvaWDskD1oz2eKCypnqvTQ8ykMNI0RSmm7NkTdSqSSD7zM0xa6Ig==} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@rollup/rollup-linux-x64-gnu@4.60.3': + resolution: {integrity: sha512-DAZDBHQfG2oQuhY7mc6I3/qB4LU2fQCjRvxbDwd/Jdvb9fypP4IJ4qmtu6lNjes6B531AI8cg1aKC2di97bUxA==} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@rollup/rollup-linux-x64-musl@4.60.3': + resolution: {integrity: sha512-cRxsE8c13mZOh3vP+wLDxpQBRrOHDIGOWyDL93Sy0Ga8y515fBcC2pjUfFwUe5T7tqvTvWbCpg1URM/AXdWIXA==} + cpu: [x64] + os: [linux] + libc: [musl] + + '@rollup/rollup-openbsd-x64@4.60.3': + resolution: {integrity: sha512-QaWcIgRxqEdQdhJqW4DJctsH6HCmo5vHxY0krHSX4jMtOqfzC+dqDGuHM87bu4H8JBeibWx7jFz+h6/4C8wA5Q==} + cpu: [x64] + os: [openbsd] + + '@rollup/rollup-openharmony-arm64@4.60.3': + resolution: {integrity: sha512-AaXwSvUi3QIPtroAUw1t5yHGIyqKEXwH54WUocFolZhpGDruJcs8c+xPNDRn4XiQsS7MEwnYsHW2l0MBLDMkWg==} + cpu: [arm64] + os: [openharmony] + + '@rollup/rollup-win32-arm64-msvc@4.60.3': + resolution: {integrity: sha512-65LAKM/bAWDqKNEelHlcHvm2V+Vfb8C6INFxQXRHCvaVN1rJfwr4NvdP4FyzUaLqWfaCGaadf6UbTm8xJeYfEg==} + cpu: [arm64] + os: [win32] + + '@rollup/rollup-win32-ia32-msvc@4.60.3': + resolution: {integrity: sha512-EEM2gyhBF5MFnI6vMKdX1LAosE627RGBzIoGMdLloPZkXrUN0Ckqgr2Qi8+J3zip/8NVVro3/FjB+tjhZUgUHA==} + cpu: [ia32] + os: [win32] + + '@rollup/rollup-win32-x64-gnu@4.60.3': + resolution: {integrity: sha512-E5Eb5H/DpxaoXH++Qkv28RcUJboMopmdDUALBczvHMf7hNIxaDZqwY5lK12UK1BHacSmvupoEWGu+n993Z0y1A==} + cpu: [x64] + os: [win32] + + '@rollup/rollup-win32-x64-msvc@4.60.3': + resolution: {integrity: sha512-hPt/bgL5cE+Qp+/TPHBqptcAgPzgj46mPcg/16zNUmbQk0j+mOEQV/+Lqu8QRtDV3Ek95Q6FeFITpuhl6OTsAA==} + cpu: [x64] + os: [win32] + + '@sxzz/popperjs-es@2.11.8': + resolution: {integrity: sha512-wOwESXvvED3S8xBmcPWHs2dUuzrE4XiZeFu7e1hROIJkm02a49N120pmOXxY33sBb6hArItm5W5tcg1cBtV+HQ==} + + '@types/estree@1.0.8': + resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==} + + '@types/estree@1.0.9': + resolution: {integrity: sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==} + + '@types/lodash-es@4.17.12': + resolution: {integrity: sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==} + + '@types/lodash@4.17.24': + resolution: {integrity: sha512-gIW7lQLZbue7lRSWEFql49QJJWThrTFFeIMJdp3eH4tKoxm1OvEPg02rm4wCCSHS0cL3/Fizimb35b7k8atwsQ==} + + '@types/node@22.19.17': + resolution: {integrity: sha512-wGdMcf+vPYM6jikpS/qhg6WiqSV/OhG+jeeHT/KlVqxYfD40iYJf9/AE1uQxVWFvU7MipKRkRv8NSHiCGgPr8Q==} + + '@types/qs@6.15.1': + resolution: {integrity: sha512-GZHUBZR9hckSUhrxmp1nG6NwdpM9fCunJwyThLW1X3AyHgd9IlHb6VANpQQqDr2o/qQp6McZ3y/IA2rVzKzSbw==} + + '@types/web-bluetooth@0.0.20': + resolution: {integrity: sha512-g9gZnnXVq7gM7v3tJCWV/qw7w+KeOlSHAhgF9RytFyifW6AF61hdT2ucrYhPq9hLs5JIryeupHV3qGk95dH9ow==} + + '@vant/popperjs@1.3.0': + resolution: {integrity: sha512-hB+czUG+aHtjhaEmCJDuXOep0YTZjdlRR+4MSmIFnkCQIxJaXLQdSsR90XWvAI2yvKUI7TCGqR8pQg2RtvkMHw==} + + '@vant/use@1.6.0': + resolution: {integrity: sha512-PHHxeAASgiOpSmMjceweIrv2AxDZIkWXyaczksMoWvKV2YAYEhoizRuk/xFnKF+emUIi46TsQ+rvlm/t2BBCfA==} + peerDependencies: + vue: ^3.0.0 + + '@vitejs/plugin-vue-jsx@4.2.0': + resolution: {integrity: sha512-DSTrmrdLp+0LDNF77fqrKfx7X0ErRbOcUAgJL/HbSesqQwoUvUQ4uYQqaex+rovqgGcoPqVk+AwUh3v9CuiYIw==} + engines: {node: ^18.0.0 || >=20.0.0} + peerDependencies: + vite: ^5.0.0 || ^6.0.0 + vue: ^3.0.0 + + '@vitejs/plugin-vue@5.2.4': + resolution: {integrity: sha512-7Yx/SXSOcQq5HiiV3orevHUFn+pmMB4cgbEkDYgnkUWb0WfeQ/wa2yFv6D5ICiCQOVpjA7vYDXrC7AGO8yjDHA==} + engines: {node: ^18.0.0 || >=20.0.0} + peerDependencies: + vite: ^5.0.0 || ^6.0.0 + vue: ^3.2.25 + + '@volar/language-core@2.4.15': + resolution: {integrity: sha512-3VHw+QZU0ZG9IuQmzT68IyN4hZNd9GchGPhbD9+pa8CVv7rnoOZwo7T8weIbrRmihqy3ATpdfXFnqRrfPVK6CA==} + + '@volar/source-map@2.4.15': + resolution: {integrity: sha512-CPbMWlUN6hVZJYGcU/GSoHu4EnCHiLaXI9n8c9la6RaI9W5JHX+NqG+GSQcB0JdC2FIBLdZJwGsfKyBB71VlTg==} + + '@volar/typescript@2.4.15': + resolution: {integrity: sha512-2aZ8i0cqPGjXb4BhkMsPYDkkuc2ZQ6yOpqwAuNwUoncELqoy5fRgOQtLR9gB0g902iS0NAkvpIzs27geVyVdPg==} + + '@vue/babel-helper-vue-transform-on@1.5.0': + resolution: {integrity: sha512-0dAYkerNhhHutHZ34JtTl2czVQHUNWv6xEbkdF5W+Yrv5pCWsqjeORdOgbtW2I9gWlt+wBmVn+ttqN9ZxR5tzA==} + + '@vue/babel-plugin-jsx@1.5.0': + resolution: {integrity: sha512-mneBhw1oOqCd2247O0Yw/mRwC9jIGACAJUlawkmMBiNmL4dGA2eMzuNZVNqOUfYTa6vqmND4CtOPzmEEEqLKFw==} + peerDependencies: + '@babel/core': ^7.0.0-0 + peerDependenciesMeta: + '@babel/core': + optional: true + + '@vue/babel-plugin-resolve-type@1.5.0': + resolution: {integrity: sha512-Wm/60o+53JwJODm4Knz47dxJnLDJ9FnKnGZJbUUf8nQRAtt6P+undLUAVU3Ha33LxOJe6IPoifRQ6F/0RrU31w==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@vue/compiler-core@3.5.34': + resolution: {integrity: sha512-s9cLyK5mLcvZ4Agva5QgRsQyLKvts9WbU9DB6NqiZkkGEdwmcEiylj5Jbwkp680drF/NNCV8OlAJSe+yMLxaJw==} + + '@vue/compiler-dom@3.5.34': + resolution: {integrity: sha512-EbF/T++k0e2MMZlJsBhzK8Sgwt0HcIPOhzn1CTB/lv6sQcyk+OWf8YeiLxZp3ro7MbbLcAfAJ6sEvjFWuNgUCw==} + + '@vue/compiler-sfc@3.5.34': + resolution: {integrity: sha512-D/ihr6uZeIt6r+pVZf46RWT1fAsLFMbUP7k8G1VkiiWexriED9GrX3echHd4Abbt17zjlfiFJ8z7a3BxZOPNjg==} + + '@vue/compiler-ssr@3.5.34': + resolution: {integrity: sha512-cDtTHKibkThKGHH1SP+WdccquNRYQDFH6rRjQCqT9G2ltFAfoR5pUftpab/z+aM5mW9HLLVQW7hfKKQe/1GBeQ==} + + '@vue/compiler-vue2@2.7.16': + resolution: {integrity: sha512-qYC3Psj9S/mfu9uVi5WvNZIzq+xnXMhOwbTFKKDD7b1lhpnn71jXSFdTQ+WsIEk0ONCd7VV2IMm7ONl6tbQ86A==} + + '@vue/devtools-api@6.6.4': + resolution: {integrity: sha512-sGhTPMuXqZ1rVOk32RylztWkfXTRhuS7vgAKv0zjqk8gbsHkJ7xfFf+jbySxt7tWObEJwyKaHMikV/WGDiQm8g==} + + '@vue/language-core@2.2.12': + resolution: {integrity: sha512-IsGljWbKGU1MZpBPN+BvPAdr55YPkj2nB/TBNGNC32Vy2qLG25DYu/NBN2vNtZqdRbTRjaoYrahLrToim2NanA==} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + '@vue/reactivity@3.5.34': + resolution: {integrity: sha512-y9XDjCEuBp+98k+UL5dbYkh57AHU4o6cxZedOPXw3bmrZZYLQsVHguGurq7hVrPCSrQtrnz1f9dssyFr+dMXfQ==} + + '@vue/runtime-core@3.5.34': + resolution: {integrity: sha512-mKeBYvu8tcMSLhypAHBmriUFfWXKTCF/23Z4jiCoYK3UtWepkliViNLuR90V9XOyD62mUxs9p1jsrpK3CCGIzw==} + + '@vue/runtime-dom@3.5.34': + resolution: {integrity: sha512-e8kZzERmCwUnBRVsgSQlAfrfU2rGoy0FFKPBXSlfEjc/O3KfA7QP0t1/2ZylrbchjmIKB4dPTd07A6WPr0eOrg==} + + '@vue/server-renderer@3.5.34': + resolution: {integrity: sha512-nHxmJoTrKsmrkbILRhkC9gY1G3moZbJTqCzDd7DOOzG5KH9oeJ0Unqrff5f9v0pW//jES05ZkJcNtfE8JjOIew==} + peerDependencies: + vue: 3.5.34 + + '@vue/shared@3.5.34': + resolution: {integrity: sha512-24uqU4OIiX29ryC3MeWid/Xf2fa2EFRUVLb77nRhk+UrTVrh/XiGtFAFmJBAtBRbjwNdsPRP+jj/OL27Eg1NDA==} + + '@vue/tsconfig@0.5.1': + resolution: {integrity: sha512-VcZK7MvpjuTPx2w6blwnwZAu5/LgBUtejFOi3pPGQFXQN5Ela03FUtd2Qtg4yWGGissVL0dr6Ro1LfOFh+PCuQ==} + + '@vueuse/core@12.0.0': + resolution: {integrity: sha512-C12RukhXiJCbx4MGhjmd/gH52TjJsc3G0E0kQj/kb19H3Nt6n1CA4DRWuTdWWcaFRdlTe0npWDS942mvacvNBw==} + + '@vueuse/metadata@12.0.0': + resolution: {integrity: sha512-Yzimd1D3sjxTDOlF05HekU5aSGdKjxhuhRFHA7gDWLn57PRbBIh+SF5NmjhJ0WRgF3my7T8LBucyxdFJjIfRJQ==} + + '@vueuse/shared@12.0.0': + resolution: {integrity: sha512-3i6qtcq2PIio5i/vVYidkkcgvmTjCqrf26u+Fd4LhnbBmIT6FN8y6q/GJERp8lfcB9zVEfjdV0Br0443qZuJpw==} + + acorn@8.16.0: + resolution: {integrity: sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==} + engines: {node: '>=0.4.0'} + hasBin: true + + alien-signals@1.0.13: + resolution: {integrity: sha512-OGj9yyTnJEttvzhTUWuscOvtqxq5vrhF7vL9oS0xJ2mK0ItPYP1/y+vCFebfxoEyAz0++1AIwJ5CMr+Fk3nDmg==} + + anymatch@3.1.3: + resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} + engines: {node: '>= 8'} + + async-validator@4.2.5: + resolution: {integrity: sha512-7HhHjtERjqlNbZtqNqy2rckN/SpOOlmDliet+lP7k+eKZEjPk3DgyeU9lIXLdeLz0uBbbVp+9Qdow9wJWgwwfg==} + + asynckit@0.4.0: + resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} + + axios@1.16.0: + resolution: {integrity: sha512-6hp5CwvTPlN2A31g5dxnwAX0orzM7pmCRDLnZSX772mv8WDqICwFjowHuPs04Mc8deIld1+ejhtaMn5vp6b+1w==} + + balanced-match@1.0.2: + resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + + baseline-browser-mapping@2.10.27: + resolution: {integrity: sha512-zEs/ufmZoUd7WftKpKyXaT6RFxpQ5Qm9xytKRHvJfxFV9DFJkZph9RvJ1LcOUi0Z1ZVijMte65JbILeV+8QQEA==} + engines: {node: '>=6.0.0'} + hasBin: true + + binary-extensions@2.3.0: + resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==} + engines: {node: '>=8'} + + brace-expansion@2.1.0: + resolution: {integrity: sha512-TN1kCZAgdgweJhWWpgKYrQaMNHcDULHkWwQIspdtjV4Y5aurRdZpjAqn6yX3FPqTA9ngHCc4hJxMAMgGfve85w==} + + braces@3.0.3: + resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} + engines: {node: '>=8'} + + browserslist@4.28.2: + resolution: {integrity: sha512-48xSriZYYg+8qXna9kwqjIVzuQxi+KYWp2+5nCYnYKPTr0LvD89Jqk2Or5ogxz0NUMfIjhh2lIUX/LyX9B4oIg==} + engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} + hasBin: true + + call-bind-apply-helpers@1.0.2: + resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==} + engines: {node: '>= 0.4'} + + call-bound@1.0.4: + resolution: {integrity: sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==} + engines: {node: '>= 0.4'} + + caniuse-lite@1.0.30001792: + resolution: {integrity: sha512-hVLMUZFgR4JJ6ACt1uEESvQN1/dBVqPAKY0hgrV70eN3391K6juAfTjKZLKvOMsx8PxA7gsY1/tLMMTcfFLLpw==} + + chokidar@3.6.0: + resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} + engines: {node: '>= 8.10.0'} + + chokidar@4.0.3: + resolution: {integrity: sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==} + engines: {node: '>= 14.16.0'} + + combined-stream@1.0.8: + resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} + engines: {node: '>= 0.8'} + + confbox@0.1.8: + resolution: {integrity: sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==} + + confbox@0.2.4: + resolution: {integrity: sha512-ysOGlgTFbN2/Y6Cg3Iye8YKulHw+R2fNXHrgSmXISQdMnomY6eNDprVdW9R5xBguEqI954+S6709UyiO7B+6OQ==} + + convert-source-map@2.0.0: + resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} + + csstype@3.2.3: + resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==} + + dayjs@1.11.20: + resolution: {integrity: sha512-YbwwqR/uYpeoP4pu043q+LTDLFBLApUP6VxRihdfNTqu4ubqMlGDLd6ErXhEgsyvY0K6nCs7nggYumAN+9uEuQ==} + + de-indent@1.0.2: + resolution: {integrity: sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg==} + + debug@4.4.3: + resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + + delayed-stream@1.0.0: + resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} + engines: {node: '>=0.4.0'} + + detect-libc@2.1.2: + resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} + engines: {node: '>=8'} + + dunder-proto@1.0.1: + resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} + engines: {node: '>= 0.4'} + + electron-to-chromium@1.5.352: + resolution: {integrity: sha512-9wHk8x6dyuimoe18EdiDPWKExNdxYqo4fn4FwOVVper6RxT3cmpBwBkWWfSOCYJjQdIco/nPhJhNLmn4Ufg1Yg==} + + element-plus@2.13.7: + resolution: {integrity: sha512-XdHATFZOyzVFL1DaHQ90IOJQSg9UnSAV+bhDW+YB5UoZ0Hxs50mwqjqfwXkuwpSag+VXXizVcErBR6Movo5daw==} + peerDependencies: + vue: ^3.3.0 + + entities@7.0.1: + resolution: {integrity: sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA==} + engines: {node: '>=0.12'} + + es-define-property@1.0.1: + resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==} + engines: {node: '>= 0.4'} + + es-errors@1.3.0: + resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} + engines: {node: '>= 0.4'} + + es-object-atoms@1.1.1: + resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==} + engines: {node: '>= 0.4'} + + es-set-tostringtag@2.1.0: + resolution: {integrity: sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==} + engines: {node: '>= 0.4'} + + esbuild@0.21.5: + resolution: {integrity: sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==} + engines: {node: '>=12'} + hasBin: true + + escalade@3.2.0: + resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} + engines: {node: '>=6'} + + escape-string-regexp@5.0.0: + resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} + engines: {node: '>=12'} + + estree-walker@2.0.2: + resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} + + estree-walker@3.0.3: + resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} + + exsolve@1.0.8: + resolution: {integrity: sha512-LmDxfWXwcTArk8fUEnOfSZpHOJ6zOMUJKOtFLFqJLoKJetuQG874Uc7/Kki7zFLzYybmZhp1M7+98pfMqeX8yA==} + + fast-glob@3.3.3: + resolution: {integrity: sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==} + engines: {node: '>=8.6.0'} + + fastq@1.20.1: + resolution: {integrity: sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw==} + + fill-range@7.1.1: + resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} + engines: {node: '>=8'} + + follow-redirects@1.16.0: + resolution: {integrity: sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw==} + engines: {node: '>=4.0'} + peerDependencies: + debug: '*' + peerDependenciesMeta: + debug: + optional: true + + form-data@4.0.5: + resolution: {integrity: sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==} + engines: {node: '>= 6'} + + fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + + function-bind@1.1.2: + resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + + gensync@1.0.0-beta.2: + resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} + engines: {node: '>=6.9.0'} + + get-intrinsic@1.3.0: + resolution: {integrity: sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==} + engines: {node: '>= 0.4'} + + get-proto@1.0.1: + resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==} + engines: {node: '>= 0.4'} + + glob-parent@5.1.2: + resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} + engines: {node: '>= 6'} + + gopd@1.2.0: + resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} + engines: {node: '>= 0.4'} + + has-symbols@1.1.0: + resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==} + engines: {node: '>= 0.4'} + + has-tostringtag@1.0.2: + resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} + engines: {node: '>= 0.4'} + + hasown@2.0.3: + resolution: {integrity: sha512-ej4AhfhfL2Q2zpMmLo7U1Uv9+PyhIZpgQLGT1F9miIGmiCJIoCgSmczFdrc97mWT4kVY72KA+WnnhJ5pghSvSg==} + engines: {node: '>= 0.4'} + + he@1.2.0: + resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} + hasBin: true + + immutable@5.1.5: + resolution: {integrity: sha512-t7xcm2siw+hlUM68I+UEOK+z84RzmN59as9DZ7P1l0994DKUWV7UXBMQZVxaoMSRQ+PBZbHCOoBt7a2wxOMt+A==} + + is-binary-path@2.1.0: + resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} + engines: {node: '>=8'} + + is-extglob@2.1.1: + resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} + engines: {node: '>=0.10.0'} + + is-glob@4.0.3: + resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} + engines: {node: '>=0.10.0'} + + is-number@7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + + js-tokens@4.0.0: + resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + + js-tokens@9.0.1: + resolution: {integrity: sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==} + + jsesc@3.1.0: + resolution: {integrity: sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==} + engines: {node: '>=6'} + hasBin: true + + json5@2.2.3: + resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} + engines: {node: '>=6'} + hasBin: true + + local-pkg@0.5.1: + resolution: {integrity: sha512-9rrA30MRRP3gBD3HTGnC6cDFpaE1kVDWxWgqWJUN0RvDNAo+Nz/9GxB+nHOH0ifbVFy0hSA1V6vFDvnx54lTEQ==} + engines: {node: '>=14'} + + local-pkg@1.1.2: + resolution: {integrity: sha512-arhlxbFRmoQHl33a0Zkle/YWlmNwoyt6QNZEIJcqNbdrsix5Lvc4HyyI3EnwxTYlZYc32EbYrQ8SzEZ7dqgg9A==} + engines: {node: '>=14'} + + lodash-es@4.18.1: + resolution: {integrity: sha512-J8xewKD/Gk22OZbhpOVSwcs60zhd95ESDwezOFuA3/099925PdHJ7OFHNTGtajL3AlZkykD32HykiMo+BIBI8A==} + + lodash-unified@1.0.3: + resolution: {integrity: sha512-WK9qSozxXOD7ZJQlpSqOT+om2ZfcT4yO+03FuzAHD0wF6S0l0090LRPDx3vhTTLZ8cFKpBn+IOcVXK6qOcIlfQ==} + peerDependencies: + '@types/lodash-es': '*' + lodash: '*' + lodash-es: '*' + + lodash@4.18.1: + resolution: {integrity: sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==} + + lru-cache@5.1.1: + resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} + + magic-string@0.30.21: + resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} + + math-intrinsics@1.1.0: + resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} + engines: {node: '>= 0.4'} + + memoize-one@6.0.0: + resolution: {integrity: sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw==} + + merge2@1.4.1: + resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} + engines: {node: '>= 8'} + + micromatch@4.0.8: + resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} + engines: {node: '>=8.6'} + + mime-db@1.52.0: + resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} + engines: {node: '>= 0.6'} + + mime-types@2.1.35: + resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} + engines: {node: '>= 0.6'} + + minimatch@9.0.9: + resolution: {integrity: sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==} + engines: {node: '>=16 || 14 >=14.17'} + + mlly@1.8.2: + resolution: {integrity: sha512-d+ObxMQFmbt10sretNDytwt85VrbkhhUA/JBGm1MPaWJ65Cl4wOgLaB1NYvJSZ0Ef03MMEU/0xpPMXUIQ29UfA==} + + ms@2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + + muggle-string@0.4.1: + resolution: {integrity: sha512-VNTrAak/KhO2i8dqqnqnAHOa3cYBwXEZe9h+D5h/1ZqFSTEFHdM65lR7RoIqq3tBBYavsOXV84NoHXZ0AkPyqQ==} + + nanoid@3.3.12: + resolution: {integrity: sha512-ZB9RH/39qpq5Vu6Y+NmUaFhQR6pp+M2Xt76XBnEwDaGcVAqhlvxrl3B2bKS5D3NH3QR76v3aSrKaF/Kiy7lEtQ==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + + node-addon-api@7.1.1: + resolution: {integrity: sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==} + + node-releases@2.0.38: + resolution: {integrity: sha512-3qT/88Y3FbH/Kx4szpQQ4HzUbVrHPKTLVpVocKiLfoYvw9XSGOX2FmD2d6DrXbVYyAQTF2HeF6My8jmzx7/CRw==} + + normalize-path@3.0.0: + resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} + engines: {node: '>=0.10.0'} + + normalize-wheel-es@1.2.0: + resolution: {integrity: sha512-Wj7+EJQ8mSuXr2iWfnujrimU35R2W4FAErEyTmJoJ7ucwTn2hOUSsRehMb5RSYkxXGTM7Y9QpvPmp++w5ftoJw==} + + object-inspect@1.13.4: + resolution: {integrity: sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==} + engines: {node: '>= 0.4'} + + path-browserify@1.0.1: + resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==} + + pathe@2.0.3: + resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} + + picocolors@1.1.1: + resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} + + picomatch@2.3.2: + resolution: {integrity: sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==} + engines: {node: '>=8.6'} + + picomatch@4.0.4: + resolution: {integrity: sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==} + engines: {node: '>=12'} + + pinia@2.3.1: + resolution: {integrity: sha512-khUlZSwt9xXCaTbbxFYBKDc/bWAGWJjOgvxETwkTN7KRm66EeT1ZdZj6i2ceh9sP2Pzqsbc704r2yngBrxBVug==} + peerDependencies: + typescript: '>=4.4.4' + vue: ^2.7.0 || ^3.5.11 + peerDependenciesMeta: + typescript: + optional: true + + pkg-types@1.3.1: + resolution: {integrity: sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==} + + pkg-types@2.3.1: + resolution: {integrity: sha512-y+ichcgc2LrADuhLNAx8DFjVfgz91pRxfZdI3UDhxHvcVEZsenLO+7XaU5vOp0u/7V/wZ+plyuQxtrDlZJ+yeg==} + + postcss@8.5.14: + resolution: {integrity: sha512-SoSL4+OSEtR99LHFZQiJLkT59C5B1amGO1NzTwj7TT1qCUgUO6hxOvzkOYxD+vMrXBM3XJIKzokoERdqQq/Zmg==} + engines: {node: ^10 || ^12 || >=14} + + proxy-from-env@2.1.0: + resolution: {integrity: sha512-cJ+oHTW1VAEa8cJslgmUZrc+sjRKgAKl3Zyse6+PV38hZe/V6Z14TbCuXcan9F9ghlz4QrFr2c92TNF82UkYHA==} + engines: {node: '>=10'} + + qs@6.15.1: + resolution: {integrity: sha512-6YHEFRL9mfgcAvql/XhwTvf5jKcOiiupt2FiJxHkiX1z4j7WL8J/jRHYLluORvc1XxB5rV20KoeK00gVJamspg==} + engines: {node: '>=0.6'} + + quansync@0.2.11: + resolution: {integrity: sha512-AifT7QEbW9Nri4tAwR5M/uzpBuqfZf+zwaEM/QkzEjj7NBuFD2rBuy0K3dE+8wltbezDV7JMA0WfnCPYRSYbXA==} + + queue-microtask@1.2.3: + resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + + readdirp@3.6.0: + resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} + engines: {node: '>=8.10.0'} + + readdirp@4.1.2: + resolution: {integrity: sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==} + engines: {node: '>= 14.18.0'} + + reusify@1.1.0: + resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==} + engines: {iojs: '>=1.0.0', node: '>=0.10.0'} + + rollup@4.60.3: + resolution: {integrity: sha512-pAQK9HalE84QSm4Po3EmWIZPd3FnjkShVkiMlz1iligWYkWQ7wHYd1PF/T7QZ5TVSD6uSTon5gBVMSM4JfBV+A==} + engines: {node: '>=18.0.0', npm: '>=8.0.0'} + hasBin: true + + run-parallel@1.2.0: + resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + + sass@1.99.0: + resolution: {integrity: sha512-kgW13M54DUB7IsIRM5LvJkNlpH+WhMpooUcaWGFARkF1Tc82v9mIWkCbCYf+MBvpIUBSeSOTilpZjEPr2VYE6Q==} + engines: {node: '>=14.0.0'} + hasBin: true + + scule@1.3.0: + resolution: {integrity: sha512-6FtHJEvt+pVMIB9IBY+IcCJ6Z5f1iQnytgyfKMhDKgmzYG+TeH/wx1y3l27rshSbLiSanrR9ffZDrEsmjlQF2g==} + + semver@6.3.1: + resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} + hasBin: true + + side-channel-list@1.0.1: + resolution: {integrity: sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==} + engines: {node: '>= 0.4'} + + side-channel-map@1.0.1: + resolution: {integrity: sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==} + engines: {node: '>= 0.4'} + + side-channel-weakmap@1.0.2: + resolution: {integrity: sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==} + engines: {node: '>= 0.4'} + + side-channel@1.1.0: + resolution: {integrity: sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==} + engines: {node: '>= 0.4'} + + source-map-js@1.2.1: + resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} + engines: {node: '>=0.10.0'} + + strip-literal@2.1.1: + resolution: {integrity: sha512-631UJ6O00eNGfMiWG78ck80dfBab8X6IVFB51jZK5Icd7XAs60Z5y7QdSd/wGIklnWvRbUNloVzhOKKmutxQ6Q==} + + to-regex-range@5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + + typescript@5.9.3: + resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} + engines: {node: '>=14.17'} + hasBin: true + + ufo@1.6.4: + resolution: {integrity: sha512-JFNbkD1Svwe0KvGi8GOeLcP4kAWQ609twvCdcHxq1oSL8svv39ZuSvajcD8B+5D0eL4+s1Is2D/O6KN3qcTeRA==} + + undici-types@6.21.0: + resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==} + + unimport@3.14.6: + resolution: {integrity: sha512-CYvbDaTT04Rh8bmD8jz3WPmHYZRG/NnvYVzwD6V1YAlvvKROlAeNDUBhkBGzNav2RKaeuXvlWYaa1V4Lfi/O0g==} + + unplugin-auto-import@0.18.6: + resolution: {integrity: sha512-LMFzX5DtkTj/3wZuyG5bgKBoJ7WSgzqSGJ8ppDRdlvPh45mx6t6w3OcbExQi53n3xF5MYkNGPNR/HYOL95KL2A==} + engines: {node: '>=14'} + peerDependencies: + '@nuxt/kit': ^3.2.2 + '@vueuse/core': '*' + peerDependenciesMeta: + '@nuxt/kit': + optional: true + '@vueuse/core': + optional: true + + unplugin-vue-components@0.27.5: + resolution: {integrity: sha512-m9j4goBeNwXyNN8oZHHxvIIYiG8FQ9UfmKWeNllpDvhU7btKNNELGPt+o3mckQKuPwrE7e0PvCsx+IWuDSD9Vg==} + engines: {node: '>=14'} + peerDependencies: + '@babel/parser': ^7.15.8 + '@nuxt/kit': ^3.2.2 + vue: 2 || 3 + peerDependenciesMeta: + '@babel/parser': + optional: true + '@nuxt/kit': + optional: true + + unplugin@1.16.1: + resolution: {integrity: sha512-4/u/j4FrCKdi17jaxuJA0jClGxB1AvU2hw/IuayPc4ay1XGaJs/rbb4v5WKwAjNifjmXK9PIFyuPiaK8azyR9w==} + engines: {node: '>=14.0.0'} + + update-browserslist-db@1.2.3: + resolution: {integrity: sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==} + hasBin: true + peerDependencies: + browserslist: '>= 4.21.0' + + vant@4.9.24: + resolution: {integrity: sha512-tP1A7Vjzv1/B1ljb95Jhv9Q9w6acaaZDJvy6wcKrwGgY0gQZlg+FXLZH/AIKZBE3xvYGDUsv/M7AuGcr/Pqd6A==} + peerDependencies: + vue: ^3.0.0 + + vite@5.4.21: + resolution: {integrity: sha512-o5a9xKjbtuhY6Bi5S3+HvbRERmouabWbyUcpXXUA1u+GNUKoROi9byOJ8M0nHbHYHkYICiMlqxkg1KkYmm25Sw==} + engines: {node: ^18.0.0 || >=20.0.0} + hasBin: true + peerDependencies: + '@types/node': ^18.0.0 || >=20.0.0 + less: '*' + lightningcss: ^1.21.0 + sass: '*' + sass-embedded: '*' + stylus: '*' + sugarss: '*' + terser: ^5.4.0 + peerDependenciesMeta: + '@types/node': + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + sass-embedded: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + + vscode-uri@3.1.0: + resolution: {integrity: sha512-/BpdSx+yCQGnCvecbyXdxHDkuk55/G3xwnC0GqY4gmQ3j+A+g8kzzgB4Nk/SINjqn6+waqw3EgbVF2QKExkRxQ==} + + vue-component-type-helpers@3.2.8: + resolution: {integrity: sha512-9689efAXhN/EV86plgkL/XFiJSXhGtWPG6JDboZ+QnjlUWUUQrQ0ILKQtw4iQsuwIwu5k6Aw+JnehDe7161e7A==} + + vue-demi@0.14.10: + resolution: {integrity: sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg==} + engines: {node: '>=12'} + hasBin: true + peerDependencies: + '@vue/composition-api': ^1.0.0-rc.1 + vue: ^3.0.0-0 || ^2.6.0 + peerDependenciesMeta: + '@vue/composition-api': + optional: true + + vue-router@4.6.4: + resolution: {integrity: sha512-Hz9q5sa33Yhduglwz6g9skT8OBPii+4bFn88w6J+J4MfEo4KRRpmiNG/hHHkdbRFlLBOqxN8y8gf2Fb0MTUgVg==} + peerDependencies: + vue: ^3.5.0 + + vue-tsc@2.2.12: + resolution: {integrity: sha512-P7OP77b2h/Pmk+lZdJ0YWs+5tJ6J2+uOQPo7tlBnY44QqQSPYvS0qVT4wqDJgwrZaLe47etJLLQRFia71GYITw==} + hasBin: true + peerDependencies: + typescript: '>=5.0.0' + + vue@3.5.34: + resolution: {integrity: sha512-WdLBG9gm02OgJIG9axd5Hpx0TFLdzVgfG2evFFu8Rur5O/IoGc5cMjnjh3tPL6GnRGsYvUhBSKVPYVcxRKpMCA==} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + webpack-virtual-modules@0.6.2: + resolution: {integrity: sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ==} + + yallist@3.1.1: + resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} + +snapshots: + + '@antfu/utils@0.7.10': {} + + '@babel/code-frame@7.29.0': + dependencies: + '@babel/helper-validator-identifier': 7.28.5 + js-tokens: 4.0.0 + picocolors: 1.1.1 + + '@babel/compat-data@7.29.3': {} + + '@babel/core@7.29.0': + dependencies: + '@babel/code-frame': 7.29.0 + '@babel/generator': 7.29.1 + '@babel/helper-compilation-targets': 7.28.6 + '@babel/helper-module-transforms': 7.28.6(@babel/core@7.29.0) + '@babel/helpers': 7.29.2 + '@babel/parser': 7.29.3 + '@babel/template': 7.28.6 + '@babel/traverse': 7.29.0 + '@babel/types': 7.29.0 + '@jridgewell/remapping': 2.3.5 + convert-source-map: 2.0.0 + debug: 4.4.3 + gensync: 1.0.0-beta.2 + json5: 2.2.3 + semver: 6.3.1 + transitivePeerDependencies: + - supports-color + + '@babel/generator@7.29.1': + dependencies: + '@babel/parser': 7.29.3 + '@babel/types': 7.29.0 + '@jridgewell/gen-mapping': 0.3.13 + '@jridgewell/trace-mapping': 0.3.31 + jsesc: 3.1.0 + + '@babel/helper-annotate-as-pure@7.27.3': + dependencies: + '@babel/types': 7.29.0 + + '@babel/helper-compilation-targets@7.28.6': + dependencies: + '@babel/compat-data': 7.29.3 + '@babel/helper-validator-option': 7.27.1 + browserslist: 4.28.2 + lru-cache: 5.1.1 + semver: 6.3.1 + + '@babel/helper-create-class-features-plugin@7.29.3(@babel/core@7.29.0)': + dependencies: + '@babel/core': 7.29.0 + '@babel/helper-annotate-as-pure': 7.27.3 + '@babel/helper-member-expression-to-functions': 7.28.5 + '@babel/helper-optimise-call-expression': 7.27.1 + '@babel/helper-replace-supers': 7.28.6(@babel/core@7.29.0) + '@babel/helper-skip-transparent-expression-wrappers': 7.27.1 + '@babel/traverse': 7.29.0 + semver: 6.3.1 + transitivePeerDependencies: + - supports-color + + '@babel/helper-globals@7.28.0': {} + + '@babel/helper-member-expression-to-functions@7.28.5': + dependencies: + '@babel/traverse': 7.29.0 + '@babel/types': 7.29.0 + transitivePeerDependencies: + - supports-color + + '@babel/helper-module-imports@7.28.6': + dependencies: + '@babel/traverse': 7.29.0 + '@babel/types': 7.29.0 + transitivePeerDependencies: + - supports-color + + '@babel/helper-module-transforms@7.28.6(@babel/core@7.29.0)': + dependencies: + '@babel/core': 7.29.0 + '@babel/helper-module-imports': 7.28.6 + '@babel/helper-validator-identifier': 7.28.5 + '@babel/traverse': 7.29.0 + transitivePeerDependencies: + - supports-color + + '@babel/helper-optimise-call-expression@7.27.1': + dependencies: + '@babel/types': 7.29.0 + + '@babel/helper-plugin-utils@7.28.6': {} + + '@babel/helper-replace-supers@7.28.6(@babel/core@7.29.0)': + dependencies: + '@babel/core': 7.29.0 + '@babel/helper-member-expression-to-functions': 7.28.5 + '@babel/helper-optimise-call-expression': 7.27.1 + '@babel/traverse': 7.29.0 + transitivePeerDependencies: + - supports-color + + '@babel/helper-skip-transparent-expression-wrappers@7.27.1': + dependencies: + '@babel/traverse': 7.29.0 + '@babel/types': 7.29.0 + transitivePeerDependencies: + - supports-color + + '@babel/helper-string-parser@7.27.1': {} + + '@babel/helper-validator-identifier@7.28.5': {} + + '@babel/helper-validator-option@7.27.1': {} + + '@babel/helpers@7.29.2': + dependencies: + '@babel/template': 7.28.6 + '@babel/types': 7.29.0 + + '@babel/parser@7.29.3': + dependencies: + '@babel/types': 7.29.0 + + '@babel/plugin-syntax-jsx@7.28.6(@babel/core@7.29.0)': + dependencies: + '@babel/core': 7.29.0 + '@babel/helper-plugin-utils': 7.28.6 + + '@babel/plugin-syntax-typescript@7.28.6(@babel/core@7.29.0)': + dependencies: + '@babel/core': 7.29.0 + '@babel/helper-plugin-utils': 7.28.6 + + '@babel/plugin-transform-typescript@7.28.6(@babel/core@7.29.0)': + dependencies: + '@babel/core': 7.29.0 + '@babel/helper-annotate-as-pure': 7.27.3 + '@babel/helper-create-class-features-plugin': 7.29.3(@babel/core@7.29.0) + '@babel/helper-plugin-utils': 7.28.6 + '@babel/helper-skip-transparent-expression-wrappers': 7.27.1 + '@babel/plugin-syntax-typescript': 7.28.6(@babel/core@7.29.0) + transitivePeerDependencies: + - supports-color + + '@babel/template@7.28.6': + dependencies: + '@babel/code-frame': 7.29.0 + '@babel/parser': 7.29.3 + '@babel/types': 7.29.0 + + '@babel/traverse@7.29.0': + dependencies: + '@babel/code-frame': 7.29.0 + '@babel/generator': 7.29.1 + '@babel/helper-globals': 7.28.0 + '@babel/parser': 7.29.3 + '@babel/template': 7.28.6 + '@babel/types': 7.29.0 + debug: 4.4.3 + transitivePeerDependencies: + - supports-color + + '@babel/types@7.29.0': + dependencies: + '@babel/helper-string-parser': 7.27.1 + '@babel/helper-validator-identifier': 7.28.5 + + '@ctrl/tinycolor@4.2.0': {} + + '@element-plus/icons-vue@2.3.2(vue@3.5.34(typescript@5.9.3))': + dependencies: + vue: 3.5.34(typescript@5.9.3) + + '@esbuild/aix-ppc64@0.21.5': + optional: true + + '@esbuild/android-arm64@0.21.5': + optional: true + + '@esbuild/android-arm@0.21.5': + optional: true + + '@esbuild/android-x64@0.21.5': + optional: true + + '@esbuild/darwin-arm64@0.21.5': + optional: true + + '@esbuild/darwin-x64@0.21.5': + optional: true + + '@esbuild/freebsd-arm64@0.21.5': + optional: true + + '@esbuild/freebsd-x64@0.21.5': + optional: true + + '@esbuild/linux-arm64@0.21.5': + optional: true + + '@esbuild/linux-arm@0.21.5': + optional: true + + '@esbuild/linux-ia32@0.21.5': + optional: true + + '@esbuild/linux-loong64@0.21.5': + optional: true + + '@esbuild/linux-mips64el@0.21.5': + optional: true + + '@esbuild/linux-ppc64@0.21.5': + optional: true + + '@esbuild/linux-riscv64@0.21.5': + optional: true + + '@esbuild/linux-s390x@0.21.5': + optional: true + + '@esbuild/linux-x64@0.21.5': + optional: true + + '@esbuild/netbsd-x64@0.21.5': + optional: true + + '@esbuild/openbsd-x64@0.21.5': + optional: true + + '@esbuild/sunos-x64@0.21.5': + optional: true + + '@esbuild/win32-arm64@0.21.5': + optional: true + + '@esbuild/win32-ia32@0.21.5': + optional: true + + '@esbuild/win32-x64@0.21.5': + optional: true + + '@floating-ui/core@1.7.5': + dependencies: + '@floating-ui/utils': 0.2.11 + + '@floating-ui/dom@1.7.6': + dependencies: + '@floating-ui/core': 1.7.5 + '@floating-ui/utils': 0.2.11 + + '@floating-ui/utils@0.2.11': {} + + '@jridgewell/gen-mapping@0.3.13': + dependencies: + '@jridgewell/sourcemap-codec': 1.5.5 + '@jridgewell/trace-mapping': 0.3.31 + + '@jridgewell/remapping@2.3.5': + dependencies: + '@jridgewell/gen-mapping': 0.3.13 + '@jridgewell/trace-mapping': 0.3.31 + + '@jridgewell/resolve-uri@3.1.2': {} + + '@jridgewell/sourcemap-codec@1.5.5': {} + + '@jridgewell/trace-mapping@0.3.31': + dependencies: + '@jridgewell/resolve-uri': 3.1.2 + '@jridgewell/sourcemap-codec': 1.5.5 + + '@nodelib/fs.scandir@2.1.5': + dependencies: + '@nodelib/fs.stat': 2.0.5 + run-parallel: 1.2.0 + + '@nodelib/fs.stat@2.0.5': {} + + '@nodelib/fs.walk@1.2.8': + dependencies: + '@nodelib/fs.scandir': 2.1.5 + fastq: 1.20.1 + + '@parcel/watcher-android-arm64@2.5.6': + optional: true + + '@parcel/watcher-darwin-arm64@2.5.6': + optional: true + + '@parcel/watcher-darwin-x64@2.5.6': + optional: true + + '@parcel/watcher-freebsd-x64@2.5.6': + optional: true + + '@parcel/watcher-linux-arm-glibc@2.5.6': + optional: true + + '@parcel/watcher-linux-arm-musl@2.5.6': + optional: true + + '@parcel/watcher-linux-arm64-glibc@2.5.6': + optional: true + + '@parcel/watcher-linux-arm64-musl@2.5.6': + optional: true + + '@parcel/watcher-linux-x64-glibc@2.5.6': + optional: true + + '@parcel/watcher-linux-x64-musl@2.5.6': + optional: true + + '@parcel/watcher-win32-arm64@2.5.6': + optional: true + + '@parcel/watcher-win32-ia32@2.5.6': + optional: true + + '@parcel/watcher-win32-x64@2.5.6': + optional: true + + '@parcel/watcher@2.5.6': + dependencies: + detect-libc: 2.1.2 + is-glob: 4.0.3 + node-addon-api: 7.1.1 + picomatch: 4.0.4 + optionalDependencies: + '@parcel/watcher-android-arm64': 2.5.6 + '@parcel/watcher-darwin-arm64': 2.5.6 + '@parcel/watcher-darwin-x64': 2.5.6 + '@parcel/watcher-freebsd-x64': 2.5.6 + '@parcel/watcher-linux-arm-glibc': 2.5.6 + '@parcel/watcher-linux-arm-musl': 2.5.6 + '@parcel/watcher-linux-arm64-glibc': 2.5.6 + '@parcel/watcher-linux-arm64-musl': 2.5.6 + '@parcel/watcher-linux-x64-glibc': 2.5.6 + '@parcel/watcher-linux-x64-musl': 2.5.6 + '@parcel/watcher-win32-arm64': 2.5.6 + '@parcel/watcher-win32-ia32': 2.5.6 + '@parcel/watcher-win32-x64': 2.5.6 + optional: true + + '@rolldown/pluginutils@1.0.0-rc.18': {} + + '@rollup/pluginutils@5.3.0(rollup@4.60.3)': + dependencies: + '@types/estree': 1.0.9 + estree-walker: 2.0.2 + picomatch: 4.0.4 + optionalDependencies: + rollup: 4.60.3 + + '@rollup/rollup-android-arm-eabi@4.60.3': + optional: true + + '@rollup/rollup-android-arm64@4.60.3': + optional: true + + '@rollup/rollup-darwin-arm64@4.60.3': + optional: true + + '@rollup/rollup-darwin-x64@4.60.3': + optional: true + + '@rollup/rollup-freebsd-arm64@4.60.3': + optional: true + + '@rollup/rollup-freebsd-x64@4.60.3': + optional: true + + '@rollup/rollup-linux-arm-gnueabihf@4.60.3': + optional: true + + '@rollup/rollup-linux-arm-musleabihf@4.60.3': + optional: true + + '@rollup/rollup-linux-arm64-gnu@4.60.3': + optional: true + + '@rollup/rollup-linux-arm64-musl@4.60.3': + optional: true + + '@rollup/rollup-linux-loong64-gnu@4.60.3': + optional: true + + '@rollup/rollup-linux-loong64-musl@4.60.3': + optional: true + + '@rollup/rollup-linux-ppc64-gnu@4.60.3': + optional: true + + '@rollup/rollup-linux-ppc64-musl@4.60.3': + optional: true + + '@rollup/rollup-linux-riscv64-gnu@4.60.3': + optional: true + + '@rollup/rollup-linux-riscv64-musl@4.60.3': + optional: true + + '@rollup/rollup-linux-s390x-gnu@4.60.3': + optional: true + + '@rollup/rollup-linux-x64-gnu@4.60.3': + optional: true + + '@rollup/rollup-linux-x64-musl@4.60.3': + optional: true + + '@rollup/rollup-openbsd-x64@4.60.3': + optional: true + + '@rollup/rollup-openharmony-arm64@4.60.3': + optional: true + + '@rollup/rollup-win32-arm64-msvc@4.60.3': + optional: true + + '@rollup/rollup-win32-ia32-msvc@4.60.3': + optional: true + + '@rollup/rollup-win32-x64-gnu@4.60.3': + optional: true + + '@rollup/rollup-win32-x64-msvc@4.60.3': + optional: true + + '@sxzz/popperjs-es@2.11.8': {} + + '@types/estree@1.0.8': {} + + '@types/estree@1.0.9': {} + + '@types/lodash-es@4.17.12': + dependencies: + '@types/lodash': 4.17.24 + + '@types/lodash@4.17.24': {} + + '@types/node@22.19.17': + dependencies: + undici-types: 6.21.0 + + '@types/qs@6.15.1': {} + + '@types/web-bluetooth@0.0.20': {} + + '@vant/popperjs@1.3.0': {} + + '@vant/use@1.6.0(vue@3.5.34(typescript@5.9.3))': + dependencies: + vue: 3.5.34(typescript@5.9.3) + + '@vitejs/plugin-vue-jsx@4.2.0(vite@5.4.21(@types/node@22.19.17)(sass@1.99.0))(vue@3.5.34(typescript@5.9.3))': + dependencies: + '@babel/core': 7.29.0 + '@babel/plugin-transform-typescript': 7.28.6(@babel/core@7.29.0) + '@rolldown/pluginutils': 1.0.0-rc.18 + '@vue/babel-plugin-jsx': 1.5.0(@babel/core@7.29.0) + vite: 5.4.21(@types/node@22.19.17)(sass@1.99.0) + vue: 3.5.34(typescript@5.9.3) + transitivePeerDependencies: + - supports-color + + '@vitejs/plugin-vue@5.2.4(vite@5.4.21(@types/node@22.19.17)(sass@1.99.0))(vue@3.5.34(typescript@5.9.3))': + dependencies: + vite: 5.4.21(@types/node@22.19.17)(sass@1.99.0) + vue: 3.5.34(typescript@5.9.3) + + '@volar/language-core@2.4.15': + dependencies: + '@volar/source-map': 2.4.15 + + '@volar/source-map@2.4.15': {} + + '@volar/typescript@2.4.15': + dependencies: + '@volar/language-core': 2.4.15 + path-browserify: 1.0.1 + vscode-uri: 3.1.0 + + '@vue/babel-helper-vue-transform-on@1.5.0': {} + + '@vue/babel-plugin-jsx@1.5.0(@babel/core@7.29.0)': + dependencies: + '@babel/helper-module-imports': 7.28.6 + '@babel/helper-plugin-utils': 7.28.6 + '@babel/plugin-syntax-jsx': 7.28.6(@babel/core@7.29.0) + '@babel/template': 7.28.6 + '@babel/traverse': 7.29.0 + '@babel/types': 7.29.0 + '@vue/babel-helper-vue-transform-on': 1.5.0 + '@vue/babel-plugin-resolve-type': 1.5.0(@babel/core@7.29.0) + '@vue/shared': 3.5.34 + optionalDependencies: + '@babel/core': 7.29.0 + transitivePeerDependencies: + - supports-color + + '@vue/babel-plugin-resolve-type@1.5.0(@babel/core@7.29.0)': + dependencies: + '@babel/code-frame': 7.29.0 + '@babel/core': 7.29.0 + '@babel/helper-module-imports': 7.28.6 + '@babel/helper-plugin-utils': 7.28.6 + '@babel/parser': 7.29.3 + '@vue/compiler-sfc': 3.5.34 + transitivePeerDependencies: + - supports-color + + '@vue/compiler-core@3.5.34': + dependencies: + '@babel/parser': 7.29.3 + '@vue/shared': 3.5.34 + entities: 7.0.1 + estree-walker: 2.0.2 + source-map-js: 1.2.1 + + '@vue/compiler-dom@3.5.34': + dependencies: + '@vue/compiler-core': 3.5.34 + '@vue/shared': 3.5.34 + + '@vue/compiler-sfc@3.5.34': + dependencies: + '@babel/parser': 7.29.3 + '@vue/compiler-core': 3.5.34 + '@vue/compiler-dom': 3.5.34 + '@vue/compiler-ssr': 3.5.34 + '@vue/shared': 3.5.34 + estree-walker: 2.0.2 + magic-string: 0.30.21 + postcss: 8.5.14 + source-map-js: 1.2.1 + + '@vue/compiler-ssr@3.5.34': + dependencies: + '@vue/compiler-dom': 3.5.34 + '@vue/shared': 3.5.34 + + '@vue/compiler-vue2@2.7.16': + dependencies: + de-indent: 1.0.2 + he: 1.2.0 + + '@vue/devtools-api@6.6.4': {} + + '@vue/language-core@2.2.12(typescript@5.9.3)': + dependencies: + '@volar/language-core': 2.4.15 + '@vue/compiler-dom': 3.5.34 + '@vue/compiler-vue2': 2.7.16 + '@vue/shared': 3.5.34 + alien-signals: 1.0.13 + minimatch: 9.0.9 + muggle-string: 0.4.1 + path-browserify: 1.0.1 + optionalDependencies: + typescript: 5.9.3 + + '@vue/reactivity@3.5.34': + dependencies: + '@vue/shared': 3.5.34 + + '@vue/runtime-core@3.5.34': + dependencies: + '@vue/reactivity': 3.5.34 + '@vue/shared': 3.5.34 + + '@vue/runtime-dom@3.5.34': + dependencies: + '@vue/reactivity': 3.5.34 + '@vue/runtime-core': 3.5.34 + '@vue/shared': 3.5.34 + csstype: 3.2.3 + + '@vue/server-renderer@3.5.34(vue@3.5.34(typescript@5.9.3))': + dependencies: + '@vue/compiler-ssr': 3.5.34 + '@vue/shared': 3.5.34 + vue: 3.5.34(typescript@5.9.3) + + '@vue/shared@3.5.34': {} + + '@vue/tsconfig@0.5.1': {} + + '@vueuse/core@12.0.0(typescript@5.9.3)': + dependencies: + '@types/web-bluetooth': 0.0.20 + '@vueuse/metadata': 12.0.0 + '@vueuse/shared': 12.0.0(typescript@5.9.3) + vue: 3.5.34(typescript@5.9.3) + transitivePeerDependencies: + - typescript + + '@vueuse/metadata@12.0.0': {} + + '@vueuse/shared@12.0.0(typescript@5.9.3)': + dependencies: + vue: 3.5.34(typescript@5.9.3) + transitivePeerDependencies: + - typescript + + acorn@8.16.0: {} + + alien-signals@1.0.13: {} + + anymatch@3.1.3: + dependencies: + normalize-path: 3.0.0 + picomatch: 2.3.2 + + async-validator@4.2.5: {} + + asynckit@0.4.0: {} + + axios@1.16.0: + dependencies: + follow-redirects: 1.16.0 + form-data: 4.0.5 + proxy-from-env: 2.1.0 + transitivePeerDependencies: + - debug + + balanced-match@1.0.2: {} + + baseline-browser-mapping@2.10.27: {} + + binary-extensions@2.3.0: {} + + brace-expansion@2.1.0: + dependencies: + balanced-match: 1.0.2 + + braces@3.0.3: + dependencies: + fill-range: 7.1.1 + + browserslist@4.28.2: + dependencies: + baseline-browser-mapping: 2.10.27 + caniuse-lite: 1.0.30001792 + electron-to-chromium: 1.5.352 + node-releases: 2.0.38 + update-browserslist-db: 1.2.3(browserslist@4.28.2) + + call-bind-apply-helpers@1.0.2: + dependencies: + es-errors: 1.3.0 + function-bind: 1.1.2 + + call-bound@1.0.4: + dependencies: + call-bind-apply-helpers: 1.0.2 + get-intrinsic: 1.3.0 + + caniuse-lite@1.0.30001792: {} + + chokidar@3.6.0: + dependencies: + anymatch: 3.1.3 + braces: 3.0.3 + glob-parent: 5.1.2 + is-binary-path: 2.1.0 + is-glob: 4.0.3 + normalize-path: 3.0.0 + readdirp: 3.6.0 + optionalDependencies: + fsevents: 2.3.3 + + chokidar@4.0.3: + dependencies: + readdirp: 4.1.2 + + combined-stream@1.0.8: + dependencies: + delayed-stream: 1.0.0 + + confbox@0.1.8: {} + + confbox@0.2.4: {} + + convert-source-map@2.0.0: {} + + csstype@3.2.3: {} + + dayjs@1.11.20: {} + + de-indent@1.0.2: {} + + debug@4.4.3: + dependencies: + ms: 2.1.3 + + delayed-stream@1.0.0: {} + + detect-libc@2.1.2: + optional: true + + dunder-proto@1.0.1: + dependencies: + call-bind-apply-helpers: 1.0.2 + es-errors: 1.3.0 + gopd: 1.2.0 + + electron-to-chromium@1.5.352: {} + + element-plus@2.13.7(typescript@5.9.3)(vue@3.5.34(typescript@5.9.3)): + dependencies: + '@ctrl/tinycolor': 4.2.0 + '@element-plus/icons-vue': 2.3.2(vue@3.5.34(typescript@5.9.3)) + '@floating-ui/dom': 1.7.6 + '@popperjs/core': '@sxzz/popperjs-es@2.11.8' + '@types/lodash': 4.17.24 + '@types/lodash-es': 4.17.12 + '@vueuse/core': 12.0.0(typescript@5.9.3) + async-validator: 4.2.5 + dayjs: 1.11.20 + lodash: 4.18.1 + lodash-es: 4.18.1 + lodash-unified: 1.0.3(@types/lodash-es@4.17.12)(lodash-es@4.18.1)(lodash@4.18.1) + memoize-one: 6.0.0 + normalize-wheel-es: 1.2.0 + vue: 3.5.34(typescript@5.9.3) + vue-component-type-helpers: 3.2.8 + transitivePeerDependencies: + - typescript + + entities@7.0.1: {} + + es-define-property@1.0.1: {} + + es-errors@1.3.0: {} + + es-object-atoms@1.1.1: + dependencies: + es-errors: 1.3.0 + + es-set-tostringtag@2.1.0: + dependencies: + es-errors: 1.3.0 + get-intrinsic: 1.3.0 + has-tostringtag: 1.0.2 + hasown: 2.0.3 + + esbuild@0.21.5: + optionalDependencies: + '@esbuild/aix-ppc64': 0.21.5 + '@esbuild/android-arm': 0.21.5 + '@esbuild/android-arm64': 0.21.5 + '@esbuild/android-x64': 0.21.5 + '@esbuild/darwin-arm64': 0.21.5 + '@esbuild/darwin-x64': 0.21.5 + '@esbuild/freebsd-arm64': 0.21.5 + '@esbuild/freebsd-x64': 0.21.5 + '@esbuild/linux-arm': 0.21.5 + '@esbuild/linux-arm64': 0.21.5 + '@esbuild/linux-ia32': 0.21.5 + '@esbuild/linux-loong64': 0.21.5 + '@esbuild/linux-mips64el': 0.21.5 + '@esbuild/linux-ppc64': 0.21.5 + '@esbuild/linux-riscv64': 0.21.5 + '@esbuild/linux-s390x': 0.21.5 + '@esbuild/linux-x64': 0.21.5 + '@esbuild/netbsd-x64': 0.21.5 + '@esbuild/openbsd-x64': 0.21.5 + '@esbuild/sunos-x64': 0.21.5 + '@esbuild/win32-arm64': 0.21.5 + '@esbuild/win32-ia32': 0.21.5 + '@esbuild/win32-x64': 0.21.5 + + escalade@3.2.0: {} + + escape-string-regexp@5.0.0: {} + + estree-walker@2.0.2: {} + + estree-walker@3.0.3: + dependencies: + '@types/estree': 1.0.9 + + exsolve@1.0.8: {} + + fast-glob@3.3.3: + dependencies: + '@nodelib/fs.stat': 2.0.5 + '@nodelib/fs.walk': 1.2.8 + glob-parent: 5.1.2 + merge2: 1.4.1 + micromatch: 4.0.8 + + fastq@1.20.1: + dependencies: + reusify: 1.1.0 + + fill-range@7.1.1: + dependencies: + to-regex-range: 5.0.1 + + follow-redirects@1.16.0: {} + + form-data@4.0.5: + dependencies: + asynckit: 0.4.0 + combined-stream: 1.0.8 + es-set-tostringtag: 2.1.0 + hasown: 2.0.3 + mime-types: 2.1.35 + + fsevents@2.3.3: + optional: true + + function-bind@1.1.2: {} + + gensync@1.0.0-beta.2: {} + + get-intrinsic@1.3.0: + dependencies: + call-bind-apply-helpers: 1.0.2 + es-define-property: 1.0.1 + es-errors: 1.3.0 + es-object-atoms: 1.1.1 + function-bind: 1.1.2 + get-proto: 1.0.1 + gopd: 1.2.0 + has-symbols: 1.1.0 + hasown: 2.0.3 + math-intrinsics: 1.1.0 + + get-proto@1.0.1: + dependencies: + dunder-proto: 1.0.1 + es-object-atoms: 1.1.1 + + glob-parent@5.1.2: + dependencies: + is-glob: 4.0.3 + + gopd@1.2.0: {} + + has-symbols@1.1.0: {} + + has-tostringtag@1.0.2: + dependencies: + has-symbols: 1.1.0 + + hasown@2.0.3: + dependencies: + function-bind: 1.1.2 + + he@1.2.0: {} + + immutable@5.1.5: {} + + is-binary-path@2.1.0: + dependencies: + binary-extensions: 2.3.0 + + is-extglob@2.1.1: {} + + is-glob@4.0.3: + dependencies: + is-extglob: 2.1.1 + + is-number@7.0.0: {} + + js-tokens@4.0.0: {} + + js-tokens@9.0.1: {} + + jsesc@3.1.0: {} + + json5@2.2.3: {} + + local-pkg@0.5.1: + dependencies: + mlly: 1.8.2 + pkg-types: 1.3.1 + + local-pkg@1.1.2: + dependencies: + mlly: 1.8.2 + pkg-types: 2.3.1 + quansync: 0.2.11 + + lodash-es@4.18.1: {} + + lodash-unified@1.0.3(@types/lodash-es@4.17.12)(lodash-es@4.18.1)(lodash@4.18.1): + dependencies: + '@types/lodash-es': 4.17.12 + lodash: 4.18.1 + lodash-es: 4.18.1 + + lodash@4.18.1: {} + + lru-cache@5.1.1: + dependencies: + yallist: 3.1.1 + + magic-string@0.30.21: + dependencies: + '@jridgewell/sourcemap-codec': 1.5.5 + + math-intrinsics@1.1.0: {} + + memoize-one@6.0.0: {} + + merge2@1.4.1: {} + + micromatch@4.0.8: + dependencies: + braces: 3.0.3 + picomatch: 2.3.2 + + mime-db@1.52.0: {} + + mime-types@2.1.35: + dependencies: + mime-db: 1.52.0 + + minimatch@9.0.9: + dependencies: + brace-expansion: 2.1.0 + + mlly@1.8.2: + dependencies: + acorn: 8.16.0 + pathe: 2.0.3 + pkg-types: 1.3.1 + ufo: 1.6.4 + + ms@2.1.3: {} + + muggle-string@0.4.1: {} + + nanoid@3.3.12: {} + + node-addon-api@7.1.1: + optional: true + + node-releases@2.0.38: {} + + normalize-path@3.0.0: {} + + normalize-wheel-es@1.2.0: {} + + object-inspect@1.13.4: {} + + path-browserify@1.0.1: {} + + pathe@2.0.3: {} + + picocolors@1.1.1: {} + + picomatch@2.3.2: {} + + picomatch@4.0.4: {} + + pinia@2.3.1(typescript@5.9.3)(vue@3.5.34(typescript@5.9.3)): + dependencies: + '@vue/devtools-api': 6.6.4 + vue: 3.5.34(typescript@5.9.3) + vue-demi: 0.14.10(vue@3.5.34(typescript@5.9.3)) + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - '@vue/composition-api' + + pkg-types@1.3.1: + dependencies: + confbox: 0.1.8 + mlly: 1.8.2 + pathe: 2.0.3 + + pkg-types@2.3.1: + dependencies: + confbox: 0.2.4 + exsolve: 1.0.8 + pathe: 2.0.3 + + postcss@8.5.14: + dependencies: + nanoid: 3.3.12 + picocolors: 1.1.1 + source-map-js: 1.2.1 + + proxy-from-env@2.1.0: {} + + qs@6.15.1: + dependencies: + side-channel: 1.1.0 + + quansync@0.2.11: {} + + queue-microtask@1.2.3: {} + + readdirp@3.6.0: + dependencies: + picomatch: 2.3.2 + + readdirp@4.1.2: {} + + reusify@1.1.0: {} + + rollup@4.60.3: + dependencies: + '@types/estree': 1.0.8 + optionalDependencies: + '@rollup/rollup-android-arm-eabi': 4.60.3 + '@rollup/rollup-android-arm64': 4.60.3 + '@rollup/rollup-darwin-arm64': 4.60.3 + '@rollup/rollup-darwin-x64': 4.60.3 + '@rollup/rollup-freebsd-arm64': 4.60.3 + '@rollup/rollup-freebsd-x64': 4.60.3 + '@rollup/rollup-linux-arm-gnueabihf': 4.60.3 + '@rollup/rollup-linux-arm-musleabihf': 4.60.3 + '@rollup/rollup-linux-arm64-gnu': 4.60.3 + '@rollup/rollup-linux-arm64-musl': 4.60.3 + '@rollup/rollup-linux-loong64-gnu': 4.60.3 + '@rollup/rollup-linux-loong64-musl': 4.60.3 + '@rollup/rollup-linux-ppc64-gnu': 4.60.3 + '@rollup/rollup-linux-ppc64-musl': 4.60.3 + '@rollup/rollup-linux-riscv64-gnu': 4.60.3 + '@rollup/rollup-linux-riscv64-musl': 4.60.3 + '@rollup/rollup-linux-s390x-gnu': 4.60.3 + '@rollup/rollup-linux-x64-gnu': 4.60.3 + '@rollup/rollup-linux-x64-musl': 4.60.3 + '@rollup/rollup-openbsd-x64': 4.60.3 + '@rollup/rollup-openharmony-arm64': 4.60.3 + '@rollup/rollup-win32-arm64-msvc': 4.60.3 + '@rollup/rollup-win32-ia32-msvc': 4.60.3 + '@rollup/rollup-win32-x64-gnu': 4.60.3 + '@rollup/rollup-win32-x64-msvc': 4.60.3 + fsevents: 2.3.3 + + run-parallel@1.2.0: + dependencies: + queue-microtask: 1.2.3 + + sass@1.99.0: + dependencies: + chokidar: 4.0.3 + immutable: 5.1.5 + source-map-js: 1.2.1 + optionalDependencies: + '@parcel/watcher': 2.5.6 + + scule@1.3.0: {} + + semver@6.3.1: {} + + side-channel-list@1.0.1: + dependencies: + es-errors: 1.3.0 + object-inspect: 1.13.4 + + side-channel-map@1.0.1: + dependencies: + call-bound: 1.0.4 + es-errors: 1.3.0 + get-intrinsic: 1.3.0 + object-inspect: 1.13.4 + + side-channel-weakmap@1.0.2: + dependencies: + call-bound: 1.0.4 + es-errors: 1.3.0 + get-intrinsic: 1.3.0 + object-inspect: 1.13.4 + side-channel-map: 1.0.1 + + side-channel@1.1.0: + dependencies: + es-errors: 1.3.0 + object-inspect: 1.13.4 + side-channel-list: 1.0.1 + side-channel-map: 1.0.1 + side-channel-weakmap: 1.0.2 + + source-map-js@1.2.1: {} + + strip-literal@2.1.1: + dependencies: + js-tokens: 9.0.1 + + to-regex-range@5.0.1: + dependencies: + is-number: 7.0.0 + + typescript@5.9.3: {} + + ufo@1.6.4: {} + + undici-types@6.21.0: {} + + unimport@3.14.6(rollup@4.60.3): + dependencies: + '@rollup/pluginutils': 5.3.0(rollup@4.60.3) + acorn: 8.16.0 + escape-string-regexp: 5.0.0 + estree-walker: 3.0.3 + fast-glob: 3.3.3 + local-pkg: 1.1.2 + magic-string: 0.30.21 + mlly: 1.8.2 + pathe: 2.0.3 + picomatch: 4.0.4 + pkg-types: 1.3.1 + scule: 1.3.0 + strip-literal: 2.1.1 + unplugin: 1.16.1 + transitivePeerDependencies: + - rollup + + unplugin-auto-import@0.18.6(@vueuse/core@12.0.0(typescript@5.9.3))(rollup@4.60.3): + dependencies: + '@antfu/utils': 0.7.10 + '@rollup/pluginutils': 5.3.0(rollup@4.60.3) + fast-glob: 3.3.3 + local-pkg: 0.5.1 + magic-string: 0.30.21 + minimatch: 9.0.9 + unimport: 3.14.6(rollup@4.60.3) + unplugin: 1.16.1 + optionalDependencies: + '@vueuse/core': 12.0.0(typescript@5.9.3) + transitivePeerDependencies: + - rollup + + unplugin-vue-components@0.27.5(@babel/parser@7.29.3)(rollup@4.60.3)(vue@3.5.34(typescript@5.9.3)): + dependencies: + '@antfu/utils': 0.7.10 + '@rollup/pluginutils': 5.3.0(rollup@4.60.3) + chokidar: 3.6.0 + debug: 4.4.3 + fast-glob: 3.3.3 + local-pkg: 0.5.1 + magic-string: 0.30.21 + minimatch: 9.0.9 + mlly: 1.8.2 + unplugin: 1.16.1 + vue: 3.5.34(typescript@5.9.3) + optionalDependencies: + '@babel/parser': 7.29.3 + transitivePeerDependencies: + - rollup + - supports-color + + unplugin@1.16.1: + dependencies: + acorn: 8.16.0 + webpack-virtual-modules: 0.6.2 + + update-browserslist-db@1.2.3(browserslist@4.28.2): + dependencies: + browserslist: 4.28.2 + escalade: 3.2.0 + picocolors: 1.1.1 + + vant@4.9.24(vue@3.5.34(typescript@5.9.3)): + dependencies: + '@vant/popperjs': 1.3.0 + '@vant/use': 1.6.0(vue@3.5.34(typescript@5.9.3)) + '@vue/shared': 3.5.34 + vue: 3.5.34(typescript@5.9.3) + + vite@5.4.21(@types/node@22.19.17)(sass@1.99.0): + dependencies: + esbuild: 0.21.5 + postcss: 8.5.14 + rollup: 4.60.3 + optionalDependencies: + '@types/node': 22.19.17 + fsevents: 2.3.3 + sass: 1.99.0 + + vscode-uri@3.1.0: {} + + vue-component-type-helpers@3.2.8: {} + + vue-demi@0.14.10(vue@3.5.34(typescript@5.9.3)): + dependencies: + vue: 3.5.34(typescript@5.9.3) + + vue-router@4.6.4(vue@3.5.34(typescript@5.9.3)): + dependencies: + '@vue/devtools-api': 6.6.4 + vue: 3.5.34(typescript@5.9.3) + + vue-tsc@2.2.12(typescript@5.9.3): + dependencies: + '@volar/typescript': 2.4.15 + '@vue/language-core': 2.2.12(typescript@5.9.3) + typescript: 5.9.3 + + vue@3.5.34(typescript@5.9.3): + dependencies: + '@vue/compiler-dom': 3.5.34 + '@vue/compiler-sfc': 3.5.34 + '@vue/runtime-dom': 3.5.34 + '@vue/server-renderer': 3.5.34(vue@3.5.34(typescript@5.9.3)) + '@vue/shared': 3.5.34 + optionalDependencies: + typescript: 5.9.3 + + webpack-virtual-modules@0.6.2: {} + + yallist@3.1.1: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 0000000..5729ed8 --- /dev/null +++ b/pnpm-workspace.yaml @@ -0,0 +1,4 @@ +allowBuilds: + '@parcel/watcher': true + esbuild: true + vue-demi: true diff --git a/src/components/cards/ContentCard.vue b/src/components/cards/ContentCard.vue new file mode 100644 index 0000000..6430b49 --- /dev/null +++ b/src/components/cards/ContentCard.vue @@ -0,0 +1,108 @@ + + + + + diff --git a/src/components/cards/SubjectCard.vue b/src/components/cards/SubjectCard.vue index bbad5a9..f1a997e 100644 --- a/src/components/cards/SubjectCard.vue +++ b/src/components/cards/SubjectCard.vue @@ -19,7 +19,7 @@ const handleClick = () => { .subject-card { width: 100%; height: 100%; - padding: 33px; + padding: 80px; box-sizing: border-box; border-radius: 24px; background: #fff; @@ -37,8 +37,8 @@ const handleClick = () => { } .subject-title { - font-size: 38px; - font-weight: 700; + font-size: 44px; + font-weight: 600; color: #121212; } diff --git a/src/components/cards/TaskCard.vue b/src/components/cards/TaskCard.vue index ddf1d4b..f6d1208 100644 --- a/src/components/cards/TaskCard.vue +++ b/src/components/cards/TaskCard.vue @@ -52,18 +52,18 @@ defineProps<{ .task-title { font-size: 32px; color: #333; - font-weight: 400; + font-weight: 500; } .task-progress { margin-left: 8px; - color: #3d78f2; + color: var(--color-text-brand); } .task-rewards { display: flex; align-items: center; - gap: 16px; + gap: 32px; margin-top: 8px; font-size: 28px; color: #333; @@ -72,13 +72,13 @@ defineProps<{ .reward-item { display: inline-flex; align-items: center; - gap: 4px; + gap: 8px; } .reward-icon { display: inline-block; - width: 20px; - height: 20px; + width: 40px; + height: 40px; border-radius: 4px; background: #eff3f8; } diff --git a/src/components/layout/AppHeader.vue b/src/components/layout/AppHeader.vue index 037aefc..081744c 100644 --- a/src/components/layout/AppHeader.vue +++ b/src/components/layout/AppHeader.vue @@ -108,7 +108,7 @@ const goToProfile = () => { .user-level { border-radius: 6px; - background: #3d78f2; + background: var(--color-brand); padding: 2px 6px; font-size: 12px; color: #fff; diff --git a/src/components/layout/TabBar.vue b/src/components/layout/TabBar.vue index c803aa2..6642db4 100644 --- a/src/components/layout/TabBar.vue +++ b/src/components/layout/TabBar.vue @@ -69,7 +69,7 @@ const tabs = [ text-decoration: none; &.is-active { - color: #2d6fe0; + color: var(--color-text-brand); } } diff --git a/src/components/tasks/ActivityProgress.vue b/src/components/tasks/ActivityProgress.vue index 52e004c..c5db642 100644 --- a/src/components/tasks/ActivityProgress.vue +++ b/src/components/tasks/ActivityProgress.vue @@ -73,16 +73,16 @@ const fillPercent = computed(() => { .progress-value { font-size: 80px; font-weight: 600; - color: #3d78f2; + color: var(--color-text-brand); } .progress-subtitle { margin-top: 4px; padding: 6px 24px; - font-size: 24px; - color: #3d78f2; - background-color: rgba(51, 126, 255, 0.04); - line-height: 36px; + font-size: var(--font-size-body-s); + color: var(--color-text-brand); + background-color: var(--color-brand-10); + line-height: var(--line-height-body-s); } .progress-track { @@ -135,7 +135,7 @@ const fillPercent = computed(() => { top: 0; height: 100%; border-radius: 4px; - background: #3d78f2; + background: var(--color-text-brand); transition: width 0.2s ease; } diff --git a/src/components/tasks/TaskSidebar.vue b/src/components/tasks/TaskSidebar.vue index 22d132b..9273917 100644 --- a/src/components/tasks/TaskSidebar.vue +++ b/src/components/tasks/TaskSidebar.vue @@ -37,7 +37,7 @@ const menus: Array<{ key: TaskTab; label: string; iconActive: string; iconInacti { key: 'daily', label: '日常', iconActive: richangY, iconInactive: richangN }, { key: 'achievement', label: '成就', iconActive: chengjiuY, iconInactive: chengjiuN }, { key: 'parent', label: '家长', iconActive: jiazhangN, iconInactive: jiazhangN }, -] +]/ diff --git a/src/views/AnswerQuestions/components/UploadAnswerPanel.vue b/src/views/AnswerQuestions/components/UploadAnswerPanel.vue index d677e63..3135b8a 100644 --- a/src/views/AnswerQuestions/components/UploadAnswerPanel.vue +++ b/src/views/AnswerQuestions/components/UploadAnswerPanel.vue @@ -137,7 +137,7 @@ function removeImage(index: number) { background: transparent; display: flex; flex-direction: column; - color: #2d6fe0; + color: var(--color-text-brand); font-size: 24px; gap: 24px; overflow-y: auto; @@ -275,7 +275,7 @@ function removeImage(index: number) { align-items: center; justify-content: center; border: 1px dashed #aac8ec; - color: #2d6fe0; + color: var(--color-text-brand); font-size: 42px; } diff --git a/src/views/EnglishTools/WordBook.vue b/src/views/EnglishTools/WordBook.vue index ec4e399..376535c 100644 --- a/src/views/EnglishTools/WordBook.vue +++ b/src/views/EnglishTools/WordBook.vue @@ -185,7 +185,7 @@ function openWordDetail(word: WordCardItem) { padding: 8px 0 16px; &.active { - color: #2d6fe0; + color: var(--color-text-brand); &::after { content: ""; @@ -194,7 +194,7 @@ function openWordDetail(word: WordCardItem) { width: 32px; height: 6px; border-radius: 3px; - background: #3d78f2; + background: var(--color-text-brand); } } } diff --git a/src/views/EnglishTools/components/WordDetailDialog.vue b/src/views/EnglishTools/components/WordDetailDialog.vue index 92bb9fd..4233cf0 100644 --- a/src/views/EnglishTools/components/WordDetailDialog.vue +++ b/src/views/EnglishTools/components/WordDetailDialog.vue @@ -232,7 +232,7 @@ watch( &.active { background: #eaf4ff; - color: #2d6fe0; + color: var(--color-text-brand); } } diff --git a/src/views/EnglishTools/index.vue b/src/views/EnglishTools/index.vue index 0ef0215..44c9d29 100644 --- a/src/views/EnglishTools/index.vue +++ b/src/views/EnglishTools/index.vue @@ -149,7 +149,7 @@ function onMouseUp(e: MouseEvent) { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); - gap: 32px; + gap: 32px 33px; width: 100%; height: 100%; } @@ -157,12 +157,11 @@ function onMouseUp(e: MouseEvent) { .tool-card { display: flex; align-items: flex-start; - border-radius: 12px; + border-radius: 24px; background: #fff; - padding: 52px 64px; + padding: 99px 64px; width: 554px; -height: 238px; - box-shadow: 0 4px 12px rgba(51, 83, 145, 0.08); + height: 238px; cursor: pointer; transition: box-shadow 0.2s; min-width: 0; @@ -174,8 +173,8 @@ height: 238px; } .tool-title { - font-size: 30px; - font-weight: 700; + font-size: 44px; + font-weight: 600; color: #121212; } diff --git a/src/views/Insights/index.vue b/src/views/Insights/index.vue index 27e208c..0d7a2ca 100644 --- a/src/views/Insights/index.vue +++ b/src/views/Insights/index.vue @@ -63,7 +63,7 @@ function handleCardClick(item: InsightItem) { display: grid; grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(2, 1fr); - gap: 32px; + gap: 32px 33px; width: 100%; height: 100%; } @@ -71,10 +71,9 @@ function handleCardClick(item: InsightItem) { .insight-card { display: flex; align-items: flex-start; - border-radius: 12px; + border-radius: 24px; background: #fff; - padding: 36px; - box-shadow: 0 4px 12px rgba(51, 83, 145, 0.08); + padding: 80px; transition: box-shadow 0.2s; width: 848px; height: 373px; @@ -89,8 +88,8 @@ function handleCardClick(item: InsightItem) { } .insight-title { - font-size: 38px; - font-weight: 700; + font-size: 44px; + font-weight: 600; color: #121212; } diff --git a/src/views/Subjects/RankingList.vue b/src/views/Subjects/RankingList.vue index b5fa966..9d5a9af 100644 --- a/src/views/Subjects/RankingList.vue +++ b/src/views/Subjects/RankingList.vue @@ -162,7 +162,7 @@ const currentStudent: RankingRow = { transition: color 0.2s; &.active { - color: #2d6fe0; + color: var(--color-text-brand); &::after { content: ""; @@ -172,7 +172,7 @@ const currentStudent: RankingRow = { width: 34px; height: 6px; border-radius: 999px; - background: #3d78f2; + background: var(--color-text-brand); transform: translateX(-50%); } } diff --git a/src/views/Subjects/StudentManagement.vue b/src/views/Subjects/StudentManagement.vue index 6bffb73..d45dc12 100644 --- a/src/views/Subjects/StudentManagement.vue +++ b/src/views/Subjects/StudentManagement.vue @@ -306,7 +306,7 @@ function createMetricRows(seedPrefix: string, metrics: Record): transition: color 0.2s; &.active { - color: #2d6fe0; + color: var(--color-text-brand); &::after { content: ""; @@ -316,7 +316,7 @@ function createMetricRows(seedPrefix: string, metrics: Record): width: 34px; height: 6px; border-radius: 999px; - background: #3d78f2; + background: var(--color-text-brand); transform: translateX(-50%); } } diff --git a/src/views/Subjects/SubjectAnalysis.vue b/src/views/Subjects/SubjectAnalysis.vue index 2c72788..7fc9509 100644 --- a/src/views/Subjects/SubjectAnalysis.vue +++ b/src/views/Subjects/SubjectAnalysis.vue @@ -137,7 +137,7 @@ function switchSubject(subject: Subject) { transition: color 0.2s; &.active { - color: #2d6fe0; + color: var(--color-text-brand); font-weight: 600; } } diff --git a/src/views/Subjects/SubjectDetail.vue b/src/views/Subjects/SubjectDetail.vue index 482279f..5341d02 100644 --- a/src/views/Subjects/SubjectDetail.vue +++ b/src/views/Subjects/SubjectDetail.vue @@ -34,45 +34,35 @@
-
- -
-

{{ subjectName }}教材

-
- - -
-
+ + - -
- - +
+ - - -
- -
-
+
@@ -89,6 +79,7 @@ import { ref, computed } from "vue"; import { useRoute, useRouter } from "vue-router"; import SubPageHeader from "@/components/layout/SubPageHeader.vue"; +import ContentCard from "@/components/cards/ContentCard.vue"; import BookCoverCard from "./components/BookCoverCard.vue"; import SelectBookDrawer from "./components/SelectBookDrawer.vue"; import xuexishenqiIcon from "@/assets/subjects/xuexishenqi.png"; @@ -239,29 +230,25 @@ function goToSubjectAnalysis() { .header-tabs { display: flex; align-items: center; - gap: 48px; - - + gap: 72px; } .tab-btn { position: relative; - font-size: 36px; -// font-weight: 600; - color: #666; + font-size: var(--font-size-title-m); + font-weight: var(--font-weight-medium); + color: var(--color-text-primary); + line-height: var(--line-height-title-m); background: transparent; border: none; -// cursor: pointer; padding: 8px 0; transition: color 0.2s; - display: flex; + display: flex; justify-content: center; - - &.active { - color: #2d6fe0; - + font-weight: var(--font-weight-semibold); + color: var(--color-text-brand); &::after { content: ""; @@ -270,8 +257,7 @@ function goToSubjectAnalysis() { width: 32px; height: 6px; border-radius: 2px; - background: #3d78f2; - + background: var(--color-text-brand); } } } @@ -279,18 +265,19 @@ function goToSubjectAnalysis() { .header-actions { display: flex; align-items: center; - gap: 28px; + gap: 32px; } .action-btn { display: flex; align-items: center; - gap: 10px; + gap: 8px; background: transparent; border: none; cursor: pointer; - font-size: 26px; - color: #333; + font-size: var(--font-size-body); + color: var(--color-text-primary); + line-height: var(--line-height-body); padding: 6px 10px; border-radius: 8px; transition: background 0.2s; @@ -301,8 +288,8 @@ function goToSubjectAnalysis() { } .action-icon { - width: 36px; - height: 36px; + width: 48px; + height: 48px; flex-shrink: 0; } @@ -314,46 +301,16 @@ function goToSubjectAnalysis() { overflow: auto; } -.content-card { - width: 100%; - max-width: 1792px; - margin: 0 auto; - background: rgba(255, 255, 255, 0.30); - border: 2px solid rgba(255, 255, 255, 0.7); - border-radius: 16px; - overflow: hidden; -} - -/* 卡片头部 */ -.card-header { - display: flex; - align-items: center; - justify-content: space-between; - padding: 24px 32px; - border-bottom: 1px solid rgba(0, 0, 0, 0.06); -} - -.subject-label { - font-size: 34px; -// font-weight: 700; - color: #121212; -} - -.card-btns { - display: flex; - align-items: center; - gap: 20px; -} - .wrong-book-btn { display: flex; align-items: center; - gap: 8px; + gap: 4px; background: transparent; border: none; cursor: pointer; - font-size: 26px; - color: #555; + font-size: var(--font-size-body); + line-height: var(--line-height-body); + color: var(--color-text-primary); padding: 10px 16px; border-radius: 8px; transition: background 0.2s; @@ -364,23 +321,8 @@ function goToSubjectAnalysis() { } .btn-icon { - width: 28px; - height: 28px; -} - -/* 卡片内容 */ -.card-content { - display: flex; - flex-direction: column; - padding: 32px 40px; - background: rgba(255, 255, 255, 0.5); - height: 940px; - overflow-y: auto; - scrollbar-width: none; - - &::-webkit-scrollbar { - display: none; - } + width: 40px; + height: 40px; } /* 书本网格 */ diff --git a/src/views/Subjects/TextbookDetail.vue b/src/views/Subjects/TextbookDetail.vue index 5ee63bb..8ad91b2 100644 --- a/src/views/Subjects/TextbookDetail.vue +++ b/src/views/Subjects/TextbookDetail.vue @@ -251,8 +251,8 @@ function handleStartPractice() { // 顶部标题 .header-title { - font-size: 32px; - color: #222; + font-size: var(--font-size-title-s); + color: var(--color-text-title); } // 主体 @@ -270,12 +270,11 @@ function handleStartPractice() { margin: 0 auto; display: flex; gap: 0; - background: #fff; + background: var(--color-bg-1); border: 2px solid rgba(255, 255, 255, 0.7); border-radius: 20px; overflow: hidden; box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06); - } // ---- 公共面板头部 ---- @@ -289,9 +288,9 @@ function handleStartPractice() { } .panel-title { - font-size: 28px; - font-weight: 500; - color: #222; + font-size: var(--font-size-body); + font-weight: var(--font-weight-medium); + color: var(--color-text-title); } // ---- 左侧目录 ---- @@ -384,9 +383,9 @@ function handleStartPractice() { } .unit-name { - font-size: 24px; - font-weight: 500; - color: #333; + font-size: var(--font-size-body-s); + font-weight: var(--font-weight-medium); + color: var(--color-text-primary); line-height: 1.4; flex: 1; padding-right: 12px; @@ -415,19 +414,19 @@ function handleStartPractice() { border-left: 3px solid transparent; cursor: pointer; text-align: left; - font-size: 22px; - color: #888; + font-size: var(--font-size-caption); + color: var(--color-text-tertiary); transition: background 0.15s, color 0.15s, border-color 0.15s; &:hover { - background: rgba(61, 120, 242, 0.05); - color: #555; + background: var(--color-brand-10); + color: var(--color-text-secondary); } &.active { - color: #3d78f2; - border-left-color: #3d78f2; - background: rgba(61, 120, 242, 0.05); + color: var(--color-text-brand); + border-left-color: var(--color-text-brand); + background: var(--color-brand-10); } } @@ -454,18 +453,18 @@ function handleStartPractice() { border-radius: 99px; border: none; background: transparent; - font-size: 22px; - color: #666; + font-size: var(--font-size-caption); + color: var(--color-text-secondary); cursor: pointer; transition: background 0.2s, color 0.2s, box-shadow 0.2s; &:hover { - color: #333; + color: var(--color-text-primary); } &.active { - background: #fff; - color: #333; + background: var(--color-bg-1); + color: var(--color-text-primary); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); } } diff --git a/src/views/Subjects/WrongQuestions.vue b/src/views/Subjects/WrongQuestions.vue index 37bf182..ad5477a 100644 --- a/src/views/Subjects/WrongQuestions.vue +++ b/src/views/Subjects/WrongQuestions.vue @@ -571,7 +571,7 @@ function extendPractice(q: Question) { line-height: 1; &.high { - color: #2d6fe0; + color: var(--color-text-brand); } &.zero { @@ -596,7 +596,7 @@ function extendPractice(q: Question) { font-weight: 500; &.subject-英语 { - color: #2d6fe0; + color: var(--color-text-brand); background: rgba(45, 111, 224, 0.1); } @@ -606,7 +606,7 @@ function extendPractice(q: Question) { } &.subject-数学 { - color: #2d6fe0; + color: var(--color-text-brand); background: rgba(45, 111, 224, 0.1); } @@ -617,8 +617,8 @@ function extendPractice(q: Question) { } .type-tag { - color: #2d6fe0; - border: 1.5px solid #2d6fe0; + color: var(--color-text-brand); + border: 1.5px solid var(--color-text-brand); background: transparent; } diff --git a/src/views/Subjects/components/BookCoverCard.vue b/src/views/Subjects/components/BookCoverCard.vue index 72c6559..a0ebe66 100644 --- a/src/views/Subjects/components/BookCoverCard.vue +++ b/src/views/Subjects/components/BookCoverCard.vue @@ -85,8 +85,8 @@ const emit = defineEmits<{ } &.is-selected { - border-color: #3d78f2; - box-shadow: 0 0 0 3px rgba(61, 120, 242, 0.18); + border-color: var(--color-text-brand); + box-shadow: 0 0 0 3px rgba(45, 111, 224, 0.18); } } @@ -99,7 +99,7 @@ const emit = defineEmits<{ width: 32px; height: 32px; border-radius: 50%; - background: #3d78f2; + background: var(--color-brand); display: flex; align-items: center; justify-content: center; diff --git a/src/views/Subjects/components/PracticeRecordCard.vue b/src/views/Subjects/components/PracticeRecordCard.vue index cb70af8..edaa9db 100644 --- a/src/views/Subjects/components/PracticeRecordCard.vue +++ b/src/views/Subjects/components/PracticeRecordCard.vue @@ -127,11 +127,11 @@ const accuracyClass = computed(() => { } .accuracy--high { - color: #3d78f2; + color: var(--color-text-brand); } .accuracy--mid { - color: #3d78f2; + color: var(--color-text-brand); } .accuracy--low { @@ -158,7 +158,7 @@ const accuracyClass = computed(() => { &.blue { background: #e8effd; - color: #3d78f2; + color: var(--color-text-brand); } &.orange { diff --git a/src/views/Subjects/components/SelectBookDrawer.vue b/src/views/Subjects/components/SelectBookDrawer.vue index 572ffde..0fec568 100644 --- a/src/views/Subjects/components/SelectBookDrawer.vue +++ b/src/views/Subjects/components/SelectBookDrawer.vue @@ -268,7 +268,7 @@ function handleCancel() { align-items: center; gap: 6px; font-size: 24px; - color: #3d78f2; + color: var(--color-text-brand); background: transparent; border: none; cursor: pointer; diff --git a/src/views/Subjects/index.vue b/src/views/Subjects/index.vue index 39a6bc9..e910295 100644 --- a/src/views/Subjects/index.vue +++ b/src/views/Subjects/index.vue @@ -16,7 +16,7 @@ const subjects = ['英语', '语文', '数学', '科学'] display: grid; grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(2, 1fr); - gap: 32px; + gap: 33px 32px; border-radius: 12px; padding: 33px; }