tauri-notice-window 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +81 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +163 -155
- package/dist/index.js.map +1 -1
- package/dist/stores/messageQueueStore.d.ts.map +1 -1
- package/dist/utils/db.d.ts +6 -0
- package/dist/utils/db.d.ts.map +1 -1
- package/dist/utils/noticeWindow.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../src/config/noticeConfig.ts","../src/utils/db.ts","../src/stores/messageQueueStore.ts","../src/hooks/useNoticeWindow.ts","../node_modules/@tauri-apps/api/external/tslib/tslib.es6.js","../node_modules/@tauri-apps/api/core.js","../node_modules/@tauri-apps/api/dpi.js","../node_modules/@tauri-apps/api/event.js","../node_modules/@tauri-apps/api/image.js","../node_modules/@tauri-apps/api/window.js","../node_modules/@tauri-apps/api/webview.js","../node_modules/@tauri-apps/api/webviewWindow.js","../src/utils/noticeWindow.ts","../src/hooks/useCloseNotice.ts","../src/hooks/useHideNotice.ts","../src/hooks/useHideAllNotices.ts","../src/hooks/useMessageQueue.ts","../src/components/NoticeLayout.tsx","../src/index.ts"],"sourcesContent":["import type { NoticeConfig } from '../types/message'\n\nconst CONFIG_STORAGE_KEY = 'tauri-notice-config'\n\n/**\n * Default configuration for notice windows\n */\nconst defaultConfig: NoticeConfig = {\n routePrefix: '/notice',\n databaseName: 'tauri-notice-db',\n defaultWidth: 400,\n defaultHeight: 300,\n}\n\n/**\n * Load config from localStorage\n */\nconst loadConfigFromStorage = (): NoticeConfig => {\n try {\n const stored = localStorage.getItem(CONFIG_STORAGE_KEY)\n if (stored) {\n return { ...defaultConfig, ...JSON.parse(stored) }\n }\n } catch (error) {\n console.warn('Failed to load config from localStorage:', error)\n }\n return defaultConfig\n}\n\n/**\n * Save config to localStorage\n */\nconst saveConfigToStorage = (config: NoticeConfig): void => {\n try {\n localStorage.setItem(CONFIG_STORAGE_KEY, JSON.stringify(config))\n } catch (error) {\n console.warn('Failed to save config to localStorage:', error)\n }\n}\n\n/**\n * Update notice window configuration\n * @param newConfig - Partial configuration to merge with current config\n */\nexport const setNoticeConfig = (newConfig: Partial<NoticeConfig>): void => {\n const currentConfig = loadConfigFromStorage()\n const updatedConfig = { ...currentConfig, ...newConfig }\n saveConfigToStorage(updatedConfig)\n}\n\n/**\n * Get current notice window configuration\n * @returns Current configuration object\n */\nexport const getNoticeConfig = (): NoticeConfig => {\n return loadConfigFromStorage()\n}\n\n","import Dexie, { type Table } from 'dexie'\nimport type { MessageType, StoredMessage } from '../types/message'\nimport { getNoticeConfig } from '../config/noticeConfig'\n\n/**\n * Dexie database for message persistence\n */\nclass NoticeDatabase extends Dexie {\n messages!: Table<StoredMessage, string>\n\n constructor(databaseName: string) {\n super(databaseName)\n this.version(1).stores({\n messages: 'id, queueStatus, queuePosition, timestamp',\n })\n }\n}\n\nlet db: NoticeDatabase | null = null\n\n/**\n * Initialize the database with the configured name\n */\nexport const initializeDatabase = (): NoticeDatabase => {\n if (!db) {\n const config = getNoticeConfig()\n db = new NoticeDatabase(config.databaseName)\n }\n return db\n}\n\n/**\n * Get the database instance\n */\nconst getDb = (): NoticeDatabase => {\n if (!db) {\n return initializeDatabase()\n }\n return db\n}\n\n/**\n * Save a new message to the database\n * @param message - Message to save\n */\nexport const saveMessage = async (message: MessageType): Promise<void> => {\n const storedMessage: StoredMessage = {\n ...message,\n timestamp: new Date().toISOString(),\n isRead: false,\n isShown: false,\n queueStatus: 'pending',\n queuePosition: 0,\n }\n await getDb().messages.put(storedMessage)\n}\n\n/**\n * Check if a message exists in the database\n * @param id - Message ID to check\n * @returns True if message exists\n */\nexport const hasMessage = async (id: string): Promise<boolean> => {\n const message = await getDb().messages.get(id)\n return !!message\n}\n\n/**\n * Get all pending messages sorted by queue position\n * @returns Array of pending messages\n */\nexport const getPendingMessages = async (): Promise<StoredMessage[]> => {\n return await getDb()\n .messages.where('queueStatus')\n .equals('pending')\n .sortBy('queuePosition')\n}\n\n/**\n * Update the queue status of a message\n * @param id - Message ID\n * @param status - New queue status\n */\nexport const updateQueueStatus = async (\n id: string,\n status: StoredMessage['queueStatus']\n): Promise<void> => {\n await getDb().messages.update(id, { queueStatus: status })\n}\n\n/**\n * Mark a message as shown\n * @param id - Message ID\n */\nexport const markAsShown = async (id: string): Promise<void> => {\n await getDb().messages.update(id, {\n queueStatus: 'shown',\n isShown: true,\n })\n}\n\n/**\n * Mark a message as hidden (server-triggered hide)\n * @param id - Message ID\n */\nexport const markAsHidden = async (id: string): Promise<void> => {\n await getDb().messages.update(id, {\n queueStatus: 'hidden',\n })\n}\n\n/**\n * Get a message by ID\n * @param id - Message ID\n * @returns The stored message or undefined\n */\nexport const getMessage = async (id: string): Promise<StoredMessage | undefined> => {\n return await getDb().messages.get(id)\n}\n\n/**\n * Clear all pending and showing messages\n */\nexport const clearPendingMessages = async (): Promise<void> => {\n await getDb()\n .messages.where('queueStatus')\n .anyOf(['pending', 'showing'])\n .delete()\n}\n\n/**\n * Update queue positions for multiple messages\n * @param messages - Array of messages with their positions\n */\nexport const updateQueuePositions = async (\n messages: Array<{ id: string; position: number }>\n): Promise<void> => {\n const updates = messages.map((msg) =>\n getDb().messages.update(msg.id, { queuePosition: msg.position })\n )\n await Promise.all(updates)\n}\n\n","import { create, StateCreator } from 'zustand'\nimport { syncTabs } from 'zustand-sync'\nimport type { MessageType } from '../types/message'\nimport {\n getPendingMessages,\n saveMessage,\n updateQueueStatus,\n clearPendingMessages,\n updateQueuePositions,\n hasMessage,\n} from '../utils/db'\n\n/**\n * Message Queue Store State Interface\n */\ninterface MessageQueueState {\n // State\n queue: MessageType[]\n currentMessage: MessageType | null\n isProcessing: boolean\n initialized: boolean\n activeWindowIds: string[]\n\n // Actions\n enqueue: (message: MessageType) => Promise<void>\n dequeue: () => MessageType | null\n showNext: () => Promise<void>\n clearCurrent: () => void\n setCurrentMessage: (message: MessageType | null) => void\n setIsProcessing: (processing: boolean) => void\n setQueue: (queue: MessageType[]) => void\n initializeFromDatabase: () => Promise<void>\n persistQueue: () => Promise<void>\n clearOnLogout: () => Promise<void>\n addActiveWindow: (id: string) => void\n removeActiveWindow: (id: string) => void\n isWindowActive: (id: string) => boolean\n}\n\n/**\n * Zustand store with zustand-sync for cross-window state management\n */\nconst storeCreator: StateCreator<MessageQueueState> = (set, get) => ({\n // Initial state\n queue: [],\n currentMessage: null,\n isProcessing: false,\n initialized: false,\n activeWindowIds: [],\n\n // Enqueue a new message\n enqueue: async (message: MessageType) => {\n const state = get()\n \n // Check if message already exists in database\n const exists = await hasMessage(message.id)\n if (!exists) {\n await saveMessage(message)\n }\n\n // Add to queue if not already present\n const alreadyInQueue = state.queue.some((m: MessageType) => m.id === message.id)\n if (!alreadyInQueue) {\n const newQueue = [...state.queue, message]\n set({ queue: newQueue })\n await get().persistQueue()\n }\n\n // Auto-show if not currently processing\n if (!state.isProcessing && !state.currentMessage) {\n await get().showNext()\n }\n },\n\n // Dequeue the next message\n dequeue: () => {\n const state = get()\n if (state.queue.length === 0) return null\n\n const [nextMessage, ...remainingQueue] = state.queue\n set({ queue: remainingQueue })\n return nextMessage\n },\n\n // Show the next message in queue\n showNext: async () => {\n const state = get()\n \n // Skip if already processing\n if (state.isProcessing) return\n\n const nextMessage = get().dequeue()\n if (!nextMessage) {\n set({ isProcessing: false, currentMessage: null })\n return\n }\n\n // Update state\n set({\n currentMessage: nextMessage,\n isProcessing: true,\n })\n\n // Update database status\n await updateQueueStatus(nextMessage.id, 'showing')\n await get().persistQueue()\n },\n\n // Clear current message and show next\n clearCurrent: () => {\n set({\n currentMessage: null,\n isProcessing: false,\n })\n\n // Auto-show next message\n const state = get()\n if (state.queue.length > 0) {\n get().showNext()\n }\n },\n\n // Set current message directly\n setCurrentMessage: (message: MessageType | null) => {\n set({ currentMessage: message })\n },\n\n // Set processing flag\n setIsProcessing: (processing: boolean) => {\n set({ isProcessing: processing })\n },\n\n // Set entire queue\n setQueue: (queue: MessageType[]) => {\n set({ queue })\n },\n\n // Initialize from database on startup\n initializeFromDatabase: async () => {\n const state = get()\n \n // Prevent duplicate initialization\n if (state.initialized) return\n\n set({ initialized: true })\n\n // Load pending messages from database\n const pendingMessages = await getPendingMessages()\n \n if (pendingMessages.length > 0) {\n set({ queue: pendingMessages })\n \n // Auto-show first message\n await get().showNext()\n }\n },\n\n // Persist queue to database\n persistQueue: async () => {\n const state = get()\n const positions = state.queue.map((msg: MessageType, index: number) => ({\n id: msg.id,\n position: index,\n }))\n await updateQueuePositions(positions)\n },\n\n // Clear all messages on logout\n clearOnLogout: async () => {\n set({\n queue: [],\n currentMessage: null,\n isProcessing: false,\n activeWindowIds: [],\n initialized: false,\n })\n await clearPendingMessages()\n },\n\n // Add active window ID\n addActiveWindow: (id: string) => {\n const state = get()\n const normalizedId = String(id)\n if (!state.activeWindowIds.includes(normalizedId)) {\n set({ activeWindowIds: [...state.activeWindowIds, normalizedId] })\n }\n },\n\n // Remove active window ID\n removeActiveWindow: (id: string) => {\n const state = get()\n const normalizedId = String(id)\n set({\n activeWindowIds: state.activeWindowIds.filter((wid: string) => wid !== normalizedId),\n })\n },\n\n // Check if window is active\n isWindowActive: (id: string) => {\n const state = get()\n const normalizedId = String(id)\n return state.activeWindowIds.includes(normalizedId)\n },\n})\n\nexport const useMessageQueueStore = create<MessageQueueState>()(\n syncTabs(storeCreator, {\n name: 'tauri-notice-queue',\n })\n)\n\n/**\n * Selectors for optimized subscriptions\n */\nexport const messageQueueSelectors = {\n queueLength: (state: MessageQueueState) => state.queue.length,\n currentMessage: (state: MessageQueueState) => state.currentMessage,\n isProcessing: (state: MessageQueueState) => state.isProcessing,\n queue: (state: MessageQueueState) => state.queue,\n}\n\n","import { useCallback } from 'react'\nimport type { MessageType } from '../types/message'\nimport { useMessageQueueStore } from '../stores/messageQueueStore'\n\n/**\n * Hook to open notice windows\n * @returns Object with showNotice function\n */\nexport const useNoticeWindow = () => {\n const enqueue = useMessageQueueStore((state) => state.enqueue)\n\n const showNotice = useCallback(\n async (message: MessageType) => {\n await enqueue(message)\n },\n [enqueue]\n )\n\n return { showNotice }\n}\n\n","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\n\r\nfunction __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nfunction __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\ntypeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\n\nexport { __classPrivateFieldGet, __classPrivateFieldSet };\n","import { __classPrivateFieldGet, __classPrivateFieldSet } from './external/tslib/tslib.es6.js';\n\n// Copyright 2019-2024 Tauri Programme within The Commons Conservancy\n// SPDX-License-Identifier: Apache-2.0\n// SPDX-License-Identifier: MIT\nvar _Channel_onmessage, _Channel_nextMessageIndex, _Channel_pendingMessages, _Channel_messageEndIndex, _Resource_rid;\n/**\n * Invoke your custom commands.\n *\n * This package is also accessible with `window.__TAURI__.core` when [`app.withGlobalTauri`](https://v2.tauri.app/reference/config/#withglobaltauri) in `tauri.conf.json` is set to `true`.\n * @module\n */\n/**\n * A key to be used to implement a special function\n * on your types that define how your type should be serialized\n * when passing across the IPC.\n * @example\n * Given a type in Rust that looks like this\n * ```rs\n * #[derive(serde::Serialize, serde::Deserialize)\n * enum UserId {\n * String(String),\n * Number(u32),\n * }\n * ```\n * `UserId::String(\"id\")` would be serialized into `{ String: \"id\" }`\n * and so we need to pass the same structure back to Rust\n * ```ts\n * import { SERIALIZE_TO_IPC_FN } from \"@tauri-apps/api/core\"\n *\n * class UserIdString {\n * id\n * constructor(id) {\n * this.id = id\n * }\n *\n * [SERIALIZE_TO_IPC_FN]() {\n * return { String: this.id }\n * }\n * }\n *\n * class UserIdNumber {\n * id\n * constructor(id) {\n * this.id = id\n * }\n *\n * [SERIALIZE_TO_IPC_FN]() {\n * return { Number: this.id }\n * }\n * }\n *\n * type UserId = UserIdString | UserIdNumber\n * ```\n *\n */\n// if this value changes, make sure to update it in:\n// 1. ipc.js\n// 2. process-ipc-message-fn.js\nconst SERIALIZE_TO_IPC_FN = '__TAURI_TO_IPC_KEY__';\n/**\n * Stores the callback in a known location, and returns an identifier that can be passed to the backend.\n * The backend uses the identifier to `eval()` the callback.\n *\n * @return An unique identifier associated with the callback function.\n *\n * @since 1.0.0\n */\nfunction transformCallback(\n// TODO: Make this not optional in v3\ncallback, once = false) {\n return window.__TAURI_INTERNALS__.transformCallback(callback, once);\n}\nclass Channel {\n constructor(onmessage) {\n _Channel_onmessage.set(this, void 0);\n // the index is used as a mechanism to preserve message order\n _Channel_nextMessageIndex.set(this, 0);\n _Channel_pendingMessages.set(this, []);\n _Channel_messageEndIndex.set(this, void 0);\n __classPrivateFieldSet(this, _Channel_onmessage, onmessage || (() => { }), \"f\");\n this.id = transformCallback((rawMessage) => {\n const index = rawMessage.index;\n if ('end' in rawMessage) {\n if (index == __classPrivateFieldGet(this, _Channel_nextMessageIndex, \"f\")) {\n this.cleanupCallback();\n }\n else {\n __classPrivateFieldSet(this, _Channel_messageEndIndex, index, \"f\");\n }\n return;\n }\n const message = rawMessage.message;\n // Process the message if we're at the right order\n if (index == __classPrivateFieldGet(this, _Channel_nextMessageIndex, \"f\")) {\n __classPrivateFieldGet(this, _Channel_onmessage, \"f\").call(this, message);\n __classPrivateFieldSet(this, _Channel_nextMessageIndex, __classPrivateFieldGet(this, _Channel_nextMessageIndex, \"f\") + 1, \"f\");\n // process pending messages\n while (__classPrivateFieldGet(this, _Channel_nextMessageIndex, \"f\") in __classPrivateFieldGet(this, _Channel_pendingMessages, \"f\")) {\n const message = __classPrivateFieldGet(this, _Channel_pendingMessages, \"f\")[__classPrivateFieldGet(this, _Channel_nextMessageIndex, \"f\")];\n __classPrivateFieldGet(this, _Channel_onmessage, \"f\").call(this, message);\n // eslint-disable-next-line @typescript-eslint/no-array-delete\n delete __classPrivateFieldGet(this, _Channel_pendingMessages, \"f\")[__classPrivateFieldGet(this, _Channel_nextMessageIndex, \"f\")];\n __classPrivateFieldSet(this, _Channel_nextMessageIndex, __classPrivateFieldGet(this, _Channel_nextMessageIndex, \"f\") + 1, \"f\");\n }\n if (__classPrivateFieldGet(this, _Channel_nextMessageIndex, \"f\") === __classPrivateFieldGet(this, _Channel_messageEndIndex, \"f\")) {\n this.cleanupCallback();\n }\n }\n // Queue the message if we're not\n else {\n // eslint-disable-next-line security/detect-object-injection\n __classPrivateFieldGet(this, _Channel_pendingMessages, \"f\")[index] = message;\n }\n });\n }\n cleanupCallback() {\n window.__TAURI_INTERNALS__.unregisterCallback(this.id);\n }\n set onmessage(handler) {\n __classPrivateFieldSet(this, _Channel_onmessage, handler, \"f\");\n }\n get onmessage() {\n return __classPrivateFieldGet(this, _Channel_onmessage, \"f\");\n }\n [(_Channel_onmessage = new WeakMap(), _Channel_nextMessageIndex = new WeakMap(), _Channel_pendingMessages = new WeakMap(), _Channel_messageEndIndex = new WeakMap(), SERIALIZE_TO_IPC_FN)]() {\n return `__CHANNEL__:${this.id}`;\n }\n toJSON() {\n // eslint-disable-next-line security/detect-object-injection\n return this[SERIALIZE_TO_IPC_FN]();\n }\n}\nclass PluginListener {\n constructor(plugin, event, channelId) {\n this.plugin = plugin;\n this.event = event;\n this.channelId = channelId;\n }\n async unregister() {\n return invoke(`plugin:${this.plugin}|remove_listener`, {\n event: this.event,\n channelId: this.channelId\n });\n }\n}\n/**\n * Adds a listener to a plugin event.\n *\n * @returns The listener object to stop listening to the events.\n *\n * @since 2.0.0\n */\nasync function addPluginListener(plugin, event, cb) {\n const handler = new Channel(cb);\n try {\n return invoke(`plugin:${plugin}|register_listener`, {\n event,\n handler\n }).then(() => new PluginListener(plugin, event, handler.id));\n }\n catch {\n // TODO(v3): remove this fallback\n // note: we must try with camelCase here for backwards compatibility\n return invoke(`plugin:${plugin}|registerListener`, { event, handler }).then(() => new PluginListener(plugin, event, handler.id));\n }\n}\n/**\n * Get permission state for a plugin.\n *\n * This should be used by plugin authors to wrap their actual implementation.\n */\nasync function checkPermissions(plugin) {\n return invoke(`plugin:${plugin}|check_permissions`);\n}\n/**\n * Request permissions.\n *\n * This should be used by plugin authors to wrap their actual implementation.\n */\nasync function requestPermissions(plugin) {\n return invoke(`plugin:${plugin}|request_permissions`);\n}\n/**\n * Sends a message to the backend.\n * @example\n * ```typescript\n * import { invoke } from '@tauri-apps/api/core';\n * await invoke('login', { user: 'tauri', password: 'poiwe3h4r5ip3yrhtew9ty' });\n * ```\n *\n * @param cmd The command name.\n * @param args The optional arguments to pass to the command.\n * @param options The request options.\n * @return A promise resolving or rejecting to the backend response.\n *\n * @since 1.0.0\n */\nasync function invoke(cmd, args = {}, options) {\n return window.__TAURI_INTERNALS__.invoke(cmd, args, options);\n}\n/**\n * Convert a device file path to an URL that can be loaded by the webview.\n * Note that `asset:` and `http://asset.localhost` must be added to [`app.security.csp`](https://v2.tauri.app/reference/config/#csp-1) in `tauri.conf.json`.\n * Example CSP value: `\"csp\": \"default-src 'self' ipc: http://ipc.localhost; img-src 'self' asset: http://asset.localhost\"` to use the asset protocol on image sources.\n *\n * Additionally, `\"enable\" : \"true\"` must be added to [`app.security.assetProtocol`](https://v2.tauri.app/reference/config/#assetprotocolconfig)\n * in `tauri.conf.json` and its access scope must be defined on the `scope` array on the same `assetProtocol` object.\n *\n * @param filePath The file path.\n * @param protocol The protocol to use. Defaults to `asset`. You only need to set this when using a custom protocol.\n * @example\n * ```typescript\n * import { appDataDir, join } from '@tauri-apps/api/path';\n * import { convertFileSrc } from '@tauri-apps/api/core';\n * const appDataDirPath = await appDataDir();\n * const filePath = await join(appDataDirPath, 'assets/video.mp4');\n * const assetUrl = convertFileSrc(filePath);\n *\n * const video = document.getElementById('my-video');\n * const source = document.createElement('source');\n * source.type = 'video/mp4';\n * source.src = assetUrl;\n * video.appendChild(source);\n * video.load();\n * ```\n *\n * @return the URL that can be used as source on the webview.\n *\n * @since 1.0.0\n */\nfunction convertFileSrc(filePath, protocol = 'asset') {\n return window.__TAURI_INTERNALS__.convertFileSrc(filePath, protocol);\n}\n/**\n * A rust-backed resource stored through `tauri::Manager::resources_table` API.\n *\n * The resource lives in the main process and does not exist\n * in the Javascript world, and thus will not be cleaned up automatiacally\n * except on application exit. If you want to clean it up early, call {@linkcode Resource.close}\n *\n * @example\n * ```typescript\n * import { Resource, invoke } from '@tauri-apps/api/core';\n * export class DatabaseHandle extends Resource {\n * static async open(path: string): Promise<DatabaseHandle> {\n * const rid: number = await invoke('open_db', { path });\n * return new DatabaseHandle(rid);\n * }\n *\n * async execute(sql: string): Promise<void> {\n * await invoke('execute_sql', { rid: this.rid, sql });\n * }\n * }\n * ```\n */\nclass Resource {\n get rid() {\n return __classPrivateFieldGet(this, _Resource_rid, \"f\");\n }\n constructor(rid) {\n _Resource_rid.set(this, void 0);\n __classPrivateFieldSet(this, _Resource_rid, rid, \"f\");\n }\n /**\n * Destroys and cleans up this resource from memory.\n * **You should not call any method on this object anymore and should drop any reference to it.**\n */\n async close() {\n return invoke('plugin:resources|close', {\n rid: this.rid\n });\n }\n}\n_Resource_rid = new WeakMap();\nfunction isTauri() {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n return !!(globalThis || window).isTauri;\n}\n\nexport { Channel, PluginListener, Resource, SERIALIZE_TO_IPC_FN, addPluginListener, checkPermissions, convertFileSrc, invoke, isTauri, requestPermissions, transformCallback };\n","import { SERIALIZE_TO_IPC_FN } from './core.js';\n\n// Copyright 2019-2024 Tauri Programme within The Commons Conservancy\n// SPDX-License-Identifier: Apache-2.0\n// SPDX-License-Identifier: MIT\n/**\n * A size represented in logical pixels.\n * Logical pixels are scaled according to the window's DPI scale.\n * Most browser APIs (i.e. `MouseEvent`'s `clientX`) will return logical pixels.\n *\n * For logical-pixel-based position, see {@linkcode LogicalPosition}.\n *\n * @since 2.0.0\n */\nclass LogicalSize {\n constructor(...args) {\n this.type = 'Logical';\n if (args.length === 1) {\n if ('Logical' in args[0]) {\n this.width = args[0].Logical.width;\n this.height = args[0].Logical.height;\n }\n else {\n this.width = args[0].width;\n this.height = args[0].height;\n }\n }\n else {\n this.width = args[0];\n this.height = args[1];\n }\n }\n /**\n * Converts the logical size to a physical one.\n * @example\n * ```typescript\n * import { LogicalSize } from '@tauri-apps/api/dpi';\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n *\n * const appWindow = getCurrentWindow();\n * const factor = await appWindow.scaleFactor();\n * const size = new LogicalSize(400, 500);\n * const physical = size.toPhysical(factor);\n * ```\n *\n * @since 2.0.0\n */\n toPhysical(scaleFactor) {\n return new PhysicalSize(this.width * scaleFactor, this.height * scaleFactor);\n }\n [SERIALIZE_TO_IPC_FN]() {\n return {\n width: this.width,\n height: this.height\n };\n }\n toJSON() {\n // eslint-disable-next-line security/detect-object-injection\n return this[SERIALIZE_TO_IPC_FN]();\n }\n}\n/**\n * A size represented in physical pixels.\n *\n * Physical pixels represent actual screen pixels, and are DPI-independent.\n * For high-DPI windows, this means that any point in the window on the screen\n * will have a different position in logical pixels (@linkcode LogicalSize).\n *\n * For physical-pixel-based position, see {@linkcode PhysicalPosition}.\n *\n * @since 2.0.0\n */\nclass PhysicalSize {\n constructor(...args) {\n this.type = 'Physical';\n if (args.length === 1) {\n if ('Physical' in args[0]) {\n this.width = args[0].Physical.width;\n this.height = args[0].Physical.height;\n }\n else {\n this.width = args[0].width;\n this.height = args[0].height;\n }\n }\n else {\n this.width = args[0];\n this.height = args[1];\n }\n }\n /**\n * Converts the physical size to a logical one.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const appWindow = getCurrentWindow();\n * const factor = await appWindow.scaleFactor();\n * const size = await appWindow.innerSize(); // PhysicalSize\n * const logical = size.toLogical(factor);\n * ```\n */\n toLogical(scaleFactor) {\n return new LogicalSize(this.width / scaleFactor, this.height / scaleFactor);\n }\n [SERIALIZE_TO_IPC_FN]() {\n return {\n width: this.width,\n height: this.height\n };\n }\n toJSON() {\n // eslint-disable-next-line security/detect-object-injection\n return this[SERIALIZE_TO_IPC_FN]();\n }\n}\n/**\n * A size represented either in physical or in logical pixels.\n *\n * This type is basically a union type of {@linkcode LogicalSize} and {@linkcode PhysicalSize}\n * but comes in handy when using `tauri::Size` in Rust as an argument to a command, as this class\n * automatically serializes into a valid format so it can be deserialized correctly into `tauri::Size`\n *\n * So instead of\n * ```typescript\n * import { invoke } from '@tauri-apps/api/core';\n * import { LogicalSize, PhysicalSize } from '@tauri-apps/api/dpi';\n *\n * const size: LogicalSize | PhysicalSize = someFunction(); // where someFunction returns either LogicalSize or PhysicalSize\n * const validSize = size instanceof LogicalSize\n * ? { Logical: { width: size.width, height: size.height } }\n * : { Physical: { width: size.width, height: size.height } }\n * await invoke(\"do_something_with_size\", { size: validSize });\n * ```\n *\n * You can just use {@linkcode Size}\n * ```typescript\n * import { invoke } from '@tauri-apps/api/core';\n * import { LogicalSize, PhysicalSize, Size } from '@tauri-apps/api/dpi';\n *\n * const size: LogicalSize | PhysicalSize = someFunction(); // where someFunction returns either LogicalSize or PhysicalSize\n * const validSize = new Size(size);\n * await invoke(\"do_something_with_size\", { size: validSize });\n * ```\n *\n * @since 2.1.0\n */\nclass Size {\n constructor(size) {\n this.size = size;\n }\n toLogical(scaleFactor) {\n return this.size instanceof LogicalSize\n ? this.size\n : this.size.toLogical(scaleFactor);\n }\n toPhysical(scaleFactor) {\n return this.size instanceof PhysicalSize\n ? this.size\n : this.size.toPhysical(scaleFactor);\n }\n [SERIALIZE_TO_IPC_FN]() {\n return {\n [`${this.size.type}`]: {\n width: this.size.width,\n height: this.size.height\n }\n };\n }\n toJSON() {\n // eslint-disable-next-line security/detect-object-injection\n return this[SERIALIZE_TO_IPC_FN]();\n }\n}\n/**\n * A position represented in logical pixels.\n * For an explanation of what logical pixels are, see description of {@linkcode LogicalSize}.\n *\n * @since 2.0.0\n */\nclass LogicalPosition {\n constructor(...args) {\n this.type = 'Logical';\n if (args.length === 1) {\n if ('Logical' in args[0]) {\n this.x = args[0].Logical.x;\n this.y = args[0].Logical.y;\n }\n else {\n this.x = args[0].x;\n this.y = args[0].y;\n }\n }\n else {\n this.x = args[0];\n this.y = args[1];\n }\n }\n /**\n * Converts the logical position to a physical one.\n * @example\n * ```typescript\n * import { LogicalPosition } from '@tauri-apps/api/dpi';\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n *\n * const appWindow = getCurrentWindow();\n * const factor = await appWindow.scaleFactor();\n * const position = new LogicalPosition(400, 500);\n * const physical = position.toPhysical(factor);\n * ```\n *\n * @since 2.0.0\n */\n toPhysical(scaleFactor) {\n return new PhysicalPosition(this.x * scaleFactor, this.y * scaleFactor);\n }\n [SERIALIZE_TO_IPC_FN]() {\n return {\n x: this.x,\n y: this.y\n };\n }\n toJSON() {\n // eslint-disable-next-line security/detect-object-injection\n return this[SERIALIZE_TO_IPC_FN]();\n }\n}\n/**\n * A position represented in physical pixels.\n *\n * For an explanation of what physical pixels are, see description of {@linkcode PhysicalSize}.\n *\n * @since 2.0.0\n */\nclass PhysicalPosition {\n constructor(...args) {\n this.type = 'Physical';\n if (args.length === 1) {\n if ('Physical' in args[0]) {\n this.x = args[0].Physical.x;\n this.y = args[0].Physical.y;\n }\n else {\n this.x = args[0].x;\n this.y = args[0].y;\n }\n }\n else {\n this.x = args[0];\n this.y = args[1];\n }\n }\n /**\n * Converts the physical position to a logical one.\n * @example\n * ```typescript\n * import { PhysicalPosition } from '@tauri-apps/api/dpi';\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n *\n * const appWindow = getCurrentWindow();\n * const factor = await appWindow.scaleFactor();\n * const position = new PhysicalPosition(400, 500);\n * const physical = position.toLogical(factor);\n * ```\n *\n * @since 2.0.0\n */\n toLogical(scaleFactor) {\n return new LogicalPosition(this.x / scaleFactor, this.y / scaleFactor);\n }\n [SERIALIZE_TO_IPC_FN]() {\n return {\n x: this.x,\n y: this.y\n };\n }\n toJSON() {\n // eslint-disable-next-line security/detect-object-injection\n return this[SERIALIZE_TO_IPC_FN]();\n }\n}\n/**\n * A position represented either in physical or in logical pixels.\n *\n * This type is basically a union type of {@linkcode LogicalSize} and {@linkcode PhysicalSize}\n * but comes in handy when using `tauri::Position` in Rust as an argument to a command, as this class\n * automatically serializes into a valid format so it can be deserialized correctly into `tauri::Position`\n *\n * So instead of\n * ```typescript\n * import { invoke } from '@tauri-apps/api/core';\n * import { LogicalPosition, PhysicalPosition } from '@tauri-apps/api/dpi';\n *\n * const position: LogicalPosition | PhysicalPosition = someFunction(); // where someFunction returns either LogicalPosition or PhysicalPosition\n * const validPosition = position instanceof LogicalPosition\n * ? { Logical: { x: position.x, y: position.y } }\n * : { Physical: { x: position.x, y: position.y } }\n * await invoke(\"do_something_with_position\", { position: validPosition });\n * ```\n *\n * You can just use {@linkcode Position}\n * ```typescript\n * import { invoke } from '@tauri-apps/api/core';\n * import { LogicalPosition, PhysicalPosition, Position } from '@tauri-apps/api/dpi';\n *\n * const position: LogicalPosition | PhysicalPosition = someFunction(); // where someFunction returns either LogicalPosition or PhysicalPosition\n * const validPosition = new Position(position);\n * await invoke(\"do_something_with_position\", { position: validPosition });\n * ```\n *\n * @since 2.1.0\n */\nclass Position {\n constructor(position) {\n this.position = position;\n }\n toLogical(scaleFactor) {\n return this.position instanceof LogicalPosition\n ? this.position\n : this.position.toLogical(scaleFactor);\n }\n toPhysical(scaleFactor) {\n return this.position instanceof PhysicalPosition\n ? this.position\n : this.position.toPhysical(scaleFactor);\n }\n [SERIALIZE_TO_IPC_FN]() {\n return {\n [`${this.position.type}`]: {\n x: this.position.x,\n y: this.position.y\n }\n };\n }\n toJSON() {\n // eslint-disable-next-line security/detect-object-injection\n return this[SERIALIZE_TO_IPC_FN]();\n }\n}\n\nexport { LogicalPosition, LogicalSize, PhysicalPosition, PhysicalSize, Position, Size };\n","import { invoke, transformCallback } from './core.js';\n\n// Copyright 2019-2024 Tauri Programme within The Commons Conservancy\n// SPDX-License-Identifier: Apache-2.0\n// SPDX-License-Identifier: MIT\n/**\n * The event system allows you to emit events to the backend and listen to events from it.\n *\n * This package is also accessible with `window.__TAURI__.event` when [`app.withGlobalTauri`](https://v2.tauri.app/reference/config/#withglobaltauri) in `tauri.conf.json` is set to `true`.\n * @module\n */\n/**\n * @since 1.1.0\n */\nvar TauriEvent;\n(function (TauriEvent) {\n TauriEvent[\"WINDOW_RESIZED\"] = \"tauri://resize\";\n TauriEvent[\"WINDOW_MOVED\"] = \"tauri://move\";\n TauriEvent[\"WINDOW_CLOSE_REQUESTED\"] = \"tauri://close-requested\";\n TauriEvent[\"WINDOW_DESTROYED\"] = \"tauri://destroyed\";\n TauriEvent[\"WINDOW_FOCUS\"] = \"tauri://focus\";\n TauriEvent[\"WINDOW_BLUR\"] = \"tauri://blur\";\n TauriEvent[\"WINDOW_SCALE_FACTOR_CHANGED\"] = \"tauri://scale-change\";\n TauriEvent[\"WINDOW_THEME_CHANGED\"] = \"tauri://theme-changed\";\n TauriEvent[\"WINDOW_CREATED\"] = \"tauri://window-created\";\n TauriEvent[\"WEBVIEW_CREATED\"] = \"tauri://webview-created\";\n TauriEvent[\"DRAG_ENTER\"] = \"tauri://drag-enter\";\n TauriEvent[\"DRAG_OVER\"] = \"tauri://drag-over\";\n TauriEvent[\"DRAG_DROP\"] = \"tauri://drag-drop\";\n TauriEvent[\"DRAG_LEAVE\"] = \"tauri://drag-leave\";\n})(TauriEvent || (TauriEvent = {}));\n/**\n * Unregister the event listener associated with the given name and id.\n *\n * @ignore\n * @param event The event name\n * @param eventId Event identifier\n * @returns\n */\nasync function _unlisten(event, eventId) {\n window.__TAURI_EVENT_PLUGIN_INTERNALS__.unregisterListener(event, eventId);\n await invoke('plugin:event|unlisten', {\n event,\n eventId\n });\n}\n/**\n * Listen to an emitted event to any {@link EventTarget|target}.\n *\n * @example\n * ```typescript\n * import { listen } from '@tauri-apps/api/event';\n * const unlisten = await listen<string>('error', (event) => {\n * console.log(`Got error, payload: ${event.payload}`);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param handler Event handler callback.\n * @param options Event listening options.\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n *\n * @since 1.0.0\n */\nasync function listen(event, handler, options) {\n var _a;\n const target = typeof (options === null || options === void 0 ? void 0 : options.target) === 'string'\n ? { kind: 'AnyLabel', label: options.target }\n : ((_a = options === null || options === void 0 ? void 0 : options.target) !== null && _a !== void 0 ? _a : { kind: 'Any' });\n return invoke('plugin:event|listen', {\n event,\n target,\n handler: transformCallback(handler)\n }).then((eventId) => {\n return async () => _unlisten(event, eventId);\n });\n}\n/**\n * Listens once to an emitted event to any {@link EventTarget|target}.\n *\n * @example\n * ```typescript\n * import { once } from '@tauri-apps/api/event';\n * interface LoadedPayload {\n * loggedIn: boolean,\n * token: string\n * }\n * const unlisten = await once<LoadedPayload>('loaded', (event) => {\n * console.log(`App is loaded, loggedIn: ${event.payload.loggedIn}, token: ${event.payload.token}`);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param handler Event handler callback.\n * @param options Event listening options.\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n *\n * @since 1.0.0\n */\nasync function once(event, handler, options) {\n return listen(event, (eventData) => {\n void _unlisten(event, eventData.id);\n handler(eventData);\n }, options);\n}\n/**\n * Emits an event to all {@link EventTarget|targets}.\n *\n * @example\n * ```typescript\n * import { emit } from '@tauri-apps/api/event';\n * await emit('frontend-loaded', { loggedIn: true, token: 'authToken' });\n * ```\n *\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param payload Event payload.\n *\n * @since 1.0.0\n */\nasync function emit(event, payload) {\n await invoke('plugin:event|emit', {\n event,\n payload\n });\n}\n/**\n * Emits an event to all {@link EventTarget|targets} matching the given target.\n *\n * @example\n * ```typescript\n * import { emitTo } from '@tauri-apps/api/event';\n * await emitTo('main', 'frontend-loaded', { loggedIn: true, token: 'authToken' });\n * ```\n *\n * @param target Label of the target Window/Webview/WebviewWindow or raw {@link EventTarget} object.\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param payload Event payload.\n *\n * @since 2.0.0\n */\nasync function emitTo(target, event, payload) {\n const eventTarget = typeof target === 'string' ? { kind: 'AnyLabel', label: target } : target;\n await invoke('plugin:event|emit_to', {\n target: eventTarget,\n event,\n payload\n });\n}\n\nexport { TauriEvent, emit, emitTo, listen, once };\n","import { Resource, invoke } from './core.js';\n\n// Copyright 2019-2024 Tauri Programme within The Commons Conservancy\n// SPDX-License-Identifier: Apache-2.0\n// SPDX-License-Identifier: MIT\n/** An RGBA Image in row-major order from top to bottom. */\nclass Image extends Resource {\n /**\n * Creates an Image from a resource ID. For internal use only.\n *\n * @ignore\n */\n constructor(rid) {\n super(rid);\n }\n /** Creates a new Image using RGBA data, in row-major order from top to bottom, and with specified width and height. */\n static async new(rgba, width, height) {\n return invoke('plugin:image|new', {\n rgba: transformImage(rgba),\n width,\n height\n }).then((rid) => new Image(rid));\n }\n /**\n * Creates a new image using the provided bytes by inferring the file format.\n * If the format is known, prefer [@link Image.fromPngBytes] or [@link Image.fromIcoBytes].\n *\n * Only `ico` and `png` are supported (based on activated feature flag).\n *\n * Note that you need the `image-ico` or `image-png` Cargo features to use this API.\n * To enable it, change your Cargo.toml file:\n * ```toml\n * [dependencies]\n * tauri = { version = \"...\", features = [\"...\", \"image-png\"] }\n * ```\n */\n static async fromBytes(bytes) {\n return invoke('plugin:image|from_bytes', {\n bytes: transformImage(bytes)\n }).then((rid) => new Image(rid));\n }\n /**\n * Creates a new image using the provided path.\n *\n * Only `ico` and `png` are supported (based on activated feature flag).\n *\n * Note that you need the `image-ico` or `image-png` Cargo features to use this API.\n * To enable it, change your Cargo.toml file:\n * ```toml\n * [dependencies]\n * tauri = { version = \"...\", features = [\"...\", \"image-png\"] }\n * ```\n */\n static async fromPath(path) {\n return invoke('plugin:image|from_path', { path }).then((rid) => new Image(rid));\n }\n /** Returns the RGBA data for this image, in row-major order from top to bottom. */\n async rgba() {\n return invoke('plugin:image|rgba', {\n rid: this.rid\n }).then((buffer) => new Uint8Array(buffer));\n }\n /** Returns the size of this image. */\n async size() {\n return invoke('plugin:image|size', { rid: this.rid });\n }\n}\n/**\n * Transforms image from various types into a type acceptable by Rust.\n *\n * See [tauri::image::JsImage](https://docs.rs/tauri/2/tauri/image/enum.JsImage.html) for more information.\n * Note the API signature is not stable and might change.\n */\nfunction transformImage(image) {\n const ret = image == null\n ? null\n : typeof image === 'string'\n ? image\n : image instanceof Image\n ? image.rid\n : image;\n return ret;\n}\n\nexport { Image, transformImage };\n","import { PhysicalPosition, PhysicalSize, Size, Position } from './dpi.js';\nexport { LogicalPosition, LogicalSize } from './dpi.js';\nimport { listen, once, emit, emitTo, TauriEvent } from './event.js';\nimport { invoke } from './core.js';\nimport { transformImage } from './image.js';\n\n// Copyright 2019-2024 Tauri Programme within The Commons Conservancy\n// SPDX-License-Identifier: Apache-2.0\n// SPDX-License-Identifier: MIT\n/**\n * Provides APIs to create windows, communicate with other windows and manipulate the current window.\n *\n * #### Window events\n *\n * Events can be listened to using {@link Window.listen}:\n * ```typescript\n * import { getCurrentWindow } from \"@tauri-apps/api/window\";\n * getCurrentWindow().listen(\"my-window-event\", ({ event, payload }) => { });\n * ```\n *\n * @module\n */\n/**\n * Attention type to request on a window.\n *\n * @since 1.0.0\n */\nvar UserAttentionType;\n(function (UserAttentionType) {\n /**\n * #### Platform-specific\n * - **macOS:** Bounces the dock icon until the application is in focus.\n * - **Windows:** Flashes both the window and the taskbar button until the application is in focus.\n */\n UserAttentionType[UserAttentionType[\"Critical\"] = 1] = \"Critical\";\n /**\n * #### Platform-specific\n * - **macOS:** Bounces the dock icon once.\n * - **Windows:** Flashes the taskbar button until the application is in focus.\n */\n UserAttentionType[UserAttentionType[\"Informational\"] = 2] = \"Informational\";\n})(UserAttentionType || (UserAttentionType = {}));\nclass CloseRequestedEvent {\n constructor(event) {\n this._preventDefault = false;\n this.event = event.event;\n this.id = event.id;\n }\n preventDefault() {\n this._preventDefault = true;\n }\n isPreventDefault() {\n return this._preventDefault;\n }\n}\nvar ProgressBarStatus;\n(function (ProgressBarStatus) {\n /**\n * Hide progress bar.\n */\n ProgressBarStatus[\"None\"] = \"none\";\n /**\n * Normal state.\n */\n ProgressBarStatus[\"Normal\"] = \"normal\";\n /**\n * Indeterminate state. **Treated as Normal on Linux and macOS**\n */\n ProgressBarStatus[\"Indeterminate\"] = \"indeterminate\";\n /**\n * Paused state. **Treated as Normal on Linux**\n */\n ProgressBarStatus[\"Paused\"] = \"paused\";\n /**\n * Error state. **Treated as Normal on linux**\n */\n ProgressBarStatus[\"Error\"] = \"error\";\n})(ProgressBarStatus || (ProgressBarStatus = {}));\n/**\n * Get an instance of `Window` for the current window.\n *\n * @since 1.0.0\n */\nfunction getCurrentWindow() {\n return new Window(window.__TAURI_INTERNALS__.metadata.currentWindow.label, {\n // @ts-expect-error `skip` is not defined in the public API but it is handled by the constructor\n skip: true\n });\n}\n/**\n * Gets a list of instances of `Window` for all available windows.\n *\n * @since 1.0.0\n */\nasync function getAllWindows() {\n return invoke('plugin:window|get_all_windows').then((windows) => windows.map((w) => new Window(w, {\n // @ts-expect-error `skip` is not defined in the public API but it is handled by the constructor\n skip: true\n })));\n}\n/** @ignore */\n// events that are emitted right here instead of by the created window\nconst localTauriEvents = ['tauri://created', 'tauri://error'];\n/**\n * Create new window or get a handle to an existing one.\n *\n * Windows are identified by a *label* a unique identifier that can be used to reference it later.\n * It may only contain alphanumeric characters `a-zA-Z` plus the following special characters `-`, `/`, `:` and `_`.\n *\n * @example\n * ```typescript\n * import { Window } from \"@tauri-apps/api/window\"\n *\n * const appWindow = new Window('theUniqueLabel');\n *\n * appWindow.once('tauri://created', function () {\n * // window successfully created\n * });\n * appWindow.once('tauri://error', function (e) {\n * // an error happened creating the window\n * });\n *\n * // emit an event to the backend\n * await appWindow.emit(\"some-event\", \"data\");\n * // listen to an event from the backend\n * const unlisten = await appWindow.listen(\"event-name\", e => {});\n * unlisten();\n * ```\n *\n * @since 2.0.0\n */\nclass Window {\n /**\n * Creates a new Window.\n * @example\n * ```typescript\n * import { Window } from '@tauri-apps/api/window';\n * const appWindow = new Window('my-label');\n * appWindow.once('tauri://created', function () {\n * // window successfully created\n * });\n * appWindow.once('tauri://error', function (e) {\n * // an error happened creating the window\n * });\n * ```\n *\n * @param label The unique window label. Must be alphanumeric: `a-zA-Z-/:_`.\n * @returns The {@link Window} instance to communicate with the window.\n */\n constructor(label, options = {}) {\n var _a;\n this.label = label;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n this.listeners = Object.create(null);\n // @ts-expect-error `skip` is not a public API so it is not defined in WindowOptions\n if (!(options === null || options === void 0 ? void 0 : options.skip)) {\n invoke('plugin:window|create', {\n options: {\n ...options,\n parent: typeof options.parent === 'string'\n ? options.parent\n : (_a = options.parent) === null || _a === void 0 ? void 0 : _a.label,\n label\n }\n })\n .then(async () => this.emit('tauri://created'))\n .catch(async (e) => this.emit('tauri://error', e));\n }\n }\n /**\n * Gets the Window associated with the given label.\n * @example\n * ```typescript\n * import { Window } from '@tauri-apps/api/window';\n * const mainWindow = Window.getByLabel('main');\n * ```\n *\n * @param label The window label.\n * @returns The Window instance to communicate with the window or null if the window doesn't exist.\n */\n static async getByLabel(label) {\n var _a;\n return (_a = (await getAllWindows()).find((w) => w.label === label)) !== null && _a !== void 0 ? _a : null;\n }\n /**\n * Get an instance of `Window` for the current window.\n */\n static getCurrent() {\n return getCurrentWindow();\n }\n /**\n * Gets a list of instances of `Window` for all available windows.\n */\n static async getAll() {\n return getAllWindows();\n }\n /**\n * Gets the focused window.\n * @example\n * ```typescript\n * import { Window } from '@tauri-apps/api/window';\n * const focusedWindow = Window.getFocusedWindow();\n * ```\n *\n * @returns The Window instance or `undefined` if there is not any focused window.\n */\n static async getFocusedWindow() {\n for (const w of await getAllWindows()) {\n if (await w.isFocused()) {\n return w;\n }\n }\n return null;\n }\n /**\n * Listen to an emitted event on this window.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const unlisten = await getCurrentWindow().listen<string>('state-changed', (event) => {\n * console.log(`Got error: ${payload}`);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param handler Event handler.\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n */\n async listen(event, handler) {\n if (this._handleTauriEvent(event, handler)) {\n return () => {\n // eslint-disable-next-line security/detect-object-injection\n const listeners = this.listeners[event];\n listeners.splice(listeners.indexOf(handler), 1);\n };\n }\n return listen(event, handler, {\n target: { kind: 'Window', label: this.label }\n });\n }\n /**\n * Listen to an emitted event on this window only once.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const unlisten = await getCurrentWindow().once<null>('initialized', (event) => {\n * console.log(`Window initialized!`);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param handler Event handler.\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n */\n async once(event, handler) {\n if (this._handleTauriEvent(event, handler)) {\n return () => {\n // eslint-disable-next-line security/detect-object-injection\n const listeners = this.listeners[event];\n listeners.splice(listeners.indexOf(handler), 1);\n };\n }\n return once(event, handler, {\n target: { kind: 'Window', label: this.label }\n });\n }\n /**\n * Emits an event to all {@link EventTarget|targets}.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().emit('window-loaded', { loggedIn: true, token: 'authToken' });\n * ```\n *\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param payload Event payload.\n */\n async emit(event, payload) {\n if (localTauriEvents.includes(event)) {\n // eslint-disable-next-line\n for (const handler of this.listeners[event] || []) {\n handler({\n event,\n id: -1,\n payload\n });\n }\n return;\n }\n return emit(event, payload);\n }\n /**\n * Emits an event to all {@link EventTarget|targets} matching the given target.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().emit('main', 'window-loaded', { loggedIn: true, token: 'authToken' });\n * ```\n * @param target Label of the target Window/Webview/WebviewWindow or raw {@link EventTarget} object.\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param payload Event payload.\n */\n async emitTo(target, event, payload) {\n if (localTauriEvents.includes(event)) {\n // eslint-disable-next-line security/detect-object-injection\n for (const handler of this.listeners[event] || []) {\n handler({\n event,\n id: -1,\n payload\n });\n }\n return;\n }\n return emitTo(target, event, payload);\n }\n /** @ignore */\n _handleTauriEvent(event, handler) {\n if (localTauriEvents.includes(event)) {\n if (!(event in this.listeners)) {\n // eslint-disable-next-line\n this.listeners[event] = [handler];\n }\n else {\n // eslint-disable-next-line\n this.listeners[event].push(handler);\n }\n return true;\n }\n return false;\n }\n // Getters\n /**\n * The scale factor that can be used to map physical pixels to logical pixels.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const factor = await getCurrentWindow().scaleFactor();\n * ```\n *\n * @returns The window's monitor scale factor.\n */\n async scaleFactor() {\n return invoke('plugin:window|scale_factor', {\n label: this.label\n });\n }\n /**\n * The position of the top-left hand corner of the window's client area relative to the top-left hand corner of the desktop.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const position = await getCurrentWindow().innerPosition();\n * ```\n *\n * @returns The window's inner position.\n */\n async innerPosition() {\n return invoke('plugin:window|inner_position', {\n label: this.label\n }).then((p) => new PhysicalPosition(p));\n }\n /**\n * The position of the top-left hand corner of the window relative to the top-left hand corner of the desktop.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const position = await getCurrentWindow().outerPosition();\n * ```\n *\n * @returns The window's outer position.\n */\n async outerPosition() {\n return invoke('plugin:window|outer_position', {\n label: this.label\n }).then((p) => new PhysicalPosition(p));\n }\n /**\n * The physical size of the window's client area.\n * The client area is the content of the window, excluding the title bar and borders.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const size = await getCurrentWindow().innerSize();\n * ```\n *\n * @returns The window's inner size.\n */\n async innerSize() {\n return invoke('plugin:window|inner_size', {\n label: this.label\n }).then((s) => new PhysicalSize(s));\n }\n /**\n * The physical size of the entire window.\n * These dimensions include the title bar and borders. If you don't want that (and you usually don't), use inner_size instead.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const size = await getCurrentWindow().outerSize();\n * ```\n *\n * @returns The window's outer size.\n */\n async outerSize() {\n return invoke('plugin:window|outer_size', {\n label: this.label\n }).then((s) => new PhysicalSize(s));\n }\n /**\n * Gets the window's current fullscreen state.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const fullscreen = await getCurrentWindow().isFullscreen();\n * ```\n *\n * @returns Whether the window is in fullscreen mode or not.\n */\n async isFullscreen() {\n return invoke('plugin:window|is_fullscreen', {\n label: this.label\n });\n }\n /**\n * Gets the window's current minimized state.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const minimized = await getCurrentWindow().isMinimized();\n * ```\n */\n async isMinimized() {\n return invoke('plugin:window|is_minimized', {\n label: this.label\n });\n }\n /**\n * Gets the window's current maximized state.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const maximized = await getCurrentWindow().isMaximized();\n * ```\n *\n * @returns Whether the window is maximized or not.\n */\n async isMaximized() {\n return invoke('plugin:window|is_maximized', {\n label: this.label\n });\n }\n /**\n * Gets the window's current focus state.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const focused = await getCurrentWindow().isFocused();\n * ```\n *\n * @returns Whether the window is focused or not.\n */\n async isFocused() {\n return invoke('plugin:window|is_focused', {\n label: this.label\n });\n }\n /**\n * Gets the window's current decorated state.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const decorated = await getCurrentWindow().isDecorated();\n * ```\n *\n * @returns Whether the window is decorated or not.\n */\n async isDecorated() {\n return invoke('plugin:window|is_decorated', {\n label: this.label\n });\n }\n /**\n * Gets the window's current resizable state.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const resizable = await getCurrentWindow().isResizable();\n * ```\n *\n * @returns Whether the window is resizable or not.\n */\n async isResizable() {\n return invoke('plugin:window|is_resizable', {\n label: this.label\n });\n }\n /**\n * Gets the window's native maximize button state.\n *\n * #### Platform-specific\n *\n * - **Linux / iOS / Android:** Unsupported.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const maximizable = await getCurrentWindow().isMaximizable();\n * ```\n *\n * @returns Whether the window's native maximize button is enabled or not.\n */\n async isMaximizable() {\n return invoke('plugin:window|is_maximizable', {\n label: this.label\n });\n }\n /**\n * Gets the window's native minimize button state.\n *\n * #### Platform-specific\n *\n * - **Linux / iOS / Android:** Unsupported.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const minimizable = await getCurrentWindow().isMinimizable();\n * ```\n *\n * @returns Whether the window's native minimize button is enabled or not.\n */\n async isMinimizable() {\n return invoke('plugin:window|is_minimizable', {\n label: this.label\n });\n }\n /**\n * Gets the window's native close button state.\n *\n * #### Platform-specific\n *\n * - **iOS / Android:** Unsupported.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const closable = await getCurrentWindow().isClosable();\n * ```\n *\n * @returns Whether the window's native close button is enabled or not.\n */\n async isClosable() {\n return invoke('plugin:window|is_closable', {\n label: this.label\n });\n }\n /**\n * Gets the window's current visible state.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const visible = await getCurrentWindow().isVisible();\n * ```\n *\n * @returns Whether the window is visible or not.\n */\n async isVisible() {\n return invoke('plugin:window|is_visible', {\n label: this.label\n });\n }\n /**\n * Gets the window's current title.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const title = await getCurrentWindow().title();\n * ```\n */\n async title() {\n return invoke('plugin:window|title', {\n label: this.label\n });\n }\n /**\n * Gets the window's current theme.\n *\n * #### Platform-specific\n *\n * - **macOS:** Theme was introduced on macOS 10.14. Returns `light` on macOS 10.13 and below.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const theme = await getCurrentWindow().theme();\n * ```\n *\n * @returns The window theme.\n */\n async theme() {\n return invoke('plugin:window|theme', {\n label: this.label\n });\n }\n /**\n * Whether the window is configured to be always on top of other windows or not.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const alwaysOnTop = await getCurrentWindow().isAlwaysOnTop();\n * ```\n *\n * @returns Whether the window is visible or not.\n */\n async isAlwaysOnTop() {\n return invoke('plugin:window|is_always_on_top', {\n label: this.label\n });\n }\n // Setters\n /**\n * Centers the window.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().center();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async center() {\n return invoke('plugin:window|center', {\n label: this.label\n });\n }\n /**\n * Requests user attention to the window, this has no effect if the application\n * is already focused. How requesting for user attention manifests is platform dependent,\n * see `UserAttentionType` for details.\n *\n * Providing `null` will unset the request for user attention. Unsetting the request for\n * user attention might not be done automatically by the WM when the window receives input.\n *\n * #### Platform-specific\n *\n * - **macOS:** `null` has no effect.\n * - **Linux:** Urgency levels have the same effect.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().requestUserAttention();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async requestUserAttention(requestType) {\n let requestType_ = null;\n if (requestType) {\n if (requestType === UserAttentionType.Critical) {\n requestType_ = { type: 'Critical' };\n }\n else {\n requestType_ = { type: 'Informational' };\n }\n }\n return invoke('plugin:window|request_user_attention', {\n label: this.label,\n value: requestType_\n });\n }\n /**\n * Updates the window resizable flag.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setResizable(false);\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async setResizable(resizable) {\n return invoke('plugin:window|set_resizable', {\n label: this.label,\n value: resizable\n });\n }\n /**\n * Enable or disable the window.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setEnabled(false);\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n *\n * @since 2.0.0\n */\n async setEnabled(enabled) {\n return invoke('plugin:window|set_enabled', {\n label: this.label,\n value: enabled\n });\n }\n /**\n * Whether the window is enabled or disabled.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setEnabled(false);\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n *\n * @since 2.0.0\n */\n async isEnabled() {\n return invoke('plugin:window|is_enabled', {\n label: this.label\n });\n }\n /**\n * Sets whether the window's native maximize button is enabled or not.\n * If resizable is set to false, this setting is ignored.\n *\n * #### Platform-specific\n *\n * - **macOS:** Disables the \"zoom\" button in the window titlebar, which is also used to enter fullscreen mode.\n * - **Linux / iOS / Android:** Unsupported.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setMaximizable(false);\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async setMaximizable(maximizable) {\n return invoke('plugin:window|set_maximizable', {\n label: this.label,\n value: maximizable\n });\n }\n /**\n * Sets whether the window's native minimize button is enabled or not.\n *\n * #### Platform-specific\n *\n * - **Linux / iOS / Android:** Unsupported.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setMinimizable(false);\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async setMinimizable(minimizable) {\n return invoke('plugin:window|set_minimizable', {\n label: this.label,\n value: minimizable\n });\n }\n /**\n * Sets whether the window's native close button is enabled or not.\n *\n * #### Platform-specific\n *\n * - **Linux:** GTK+ will do its best to convince the window manager not to show a close button. Depending on the system, this function may not have any effect when called on a window that is already visible\n * - **iOS / Android:** Unsupported.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setClosable(false);\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async setClosable(closable) {\n return invoke('plugin:window|set_closable', {\n label: this.label,\n value: closable\n });\n }\n /**\n * Sets the window title.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setTitle('Tauri');\n * ```\n *\n * @param title The new title\n * @returns A promise indicating the success or failure of the operation.\n */\n async setTitle(title) {\n return invoke('plugin:window|set_title', {\n label: this.label,\n value: title\n });\n }\n /**\n * Maximizes the window.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().maximize();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async maximize() {\n return invoke('plugin:window|maximize', {\n label: this.label\n });\n }\n /**\n * Unmaximizes the window.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().unmaximize();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async unmaximize() {\n return invoke('plugin:window|unmaximize', {\n label: this.label\n });\n }\n /**\n * Toggles the window maximized state.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().toggleMaximize();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async toggleMaximize() {\n return invoke('plugin:window|toggle_maximize', {\n label: this.label\n });\n }\n /**\n * Minimizes the window.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().minimize();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async minimize() {\n return invoke('plugin:window|minimize', {\n label: this.label\n });\n }\n /**\n * Unminimizes the window.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().unminimize();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async unminimize() {\n return invoke('plugin:window|unminimize', {\n label: this.label\n });\n }\n /**\n * Sets the window visibility to true.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().show();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async show() {\n return invoke('plugin:window|show', {\n label: this.label\n });\n }\n /**\n * Sets the window visibility to false.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().hide();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async hide() {\n return invoke('plugin:window|hide', {\n label: this.label\n });\n }\n /**\n * Closes the window.\n *\n * Note this emits a closeRequested event so you can intercept it. To force window close, use {@link Window.destroy}.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().close();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async close() {\n return invoke('plugin:window|close', {\n label: this.label\n });\n }\n /**\n * Destroys the window. Behaves like {@link Window.close} but forces the window close instead of emitting a closeRequested event.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().destroy();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async destroy() {\n return invoke('plugin:window|destroy', {\n label: this.label\n });\n }\n /**\n * Whether the window should have borders and bars.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setDecorations(false);\n * ```\n *\n * @param decorations Whether the window should have borders and bars.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setDecorations(decorations) {\n return invoke('plugin:window|set_decorations', {\n label: this.label,\n value: decorations\n });\n }\n /**\n * Whether or not the window should have shadow.\n *\n * #### Platform-specific\n *\n * - **Windows:**\n * - `false` has no effect on decorated window, shadows are always ON.\n * - `true` will make undecorated window have a 1px white border,\n * and on Windows 11, it will have a rounded corners.\n * - **Linux:** Unsupported.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setShadow(false);\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async setShadow(enable) {\n return invoke('plugin:window|set_shadow', {\n label: this.label,\n value: enable\n });\n }\n /**\n * Set window effects.\n */\n async setEffects(effects) {\n return invoke('plugin:window|set_effects', {\n label: this.label,\n value: effects\n });\n }\n /**\n * Clear any applied effects if possible.\n */\n async clearEffects() {\n return invoke('plugin:window|set_effects', {\n label: this.label,\n value: null\n });\n }\n /**\n * Whether the window should always be on top of other windows.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setAlwaysOnTop(true);\n * ```\n *\n * @param alwaysOnTop Whether the window should always be on top of other windows or not.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setAlwaysOnTop(alwaysOnTop) {\n return invoke('plugin:window|set_always_on_top', {\n label: this.label,\n value: alwaysOnTop\n });\n }\n /**\n * Whether the window should always be below other windows.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setAlwaysOnBottom(true);\n * ```\n *\n * @param alwaysOnBottom Whether the window should always be below other windows or not.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setAlwaysOnBottom(alwaysOnBottom) {\n return invoke('plugin:window|set_always_on_bottom', {\n label: this.label,\n value: alwaysOnBottom\n });\n }\n /**\n * Prevents the window contents from being captured by other apps.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setContentProtected(true);\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async setContentProtected(protected_) {\n return invoke('plugin:window|set_content_protected', {\n label: this.label,\n value: protected_\n });\n }\n /**\n * Resizes the window with a new inner size.\n * @example\n * ```typescript\n * import { getCurrentWindow, LogicalSize } from '@tauri-apps/api/window';\n * await getCurrentWindow().setSize(new LogicalSize(600, 500));\n * ```\n *\n * @param size The logical or physical inner size.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setSize(size) {\n return invoke('plugin:window|set_size', {\n label: this.label,\n value: size instanceof Size ? size : new Size(size)\n });\n }\n /**\n * Sets the window minimum inner size. If the `size` argument is not provided, the constraint is unset.\n * @example\n * ```typescript\n * import { getCurrentWindow, PhysicalSize } from '@tauri-apps/api/window';\n * await getCurrentWindow().setMinSize(new PhysicalSize(600, 500));\n * ```\n *\n * @param size The logical or physical inner size, or `null` to unset the constraint.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setMinSize(size) {\n return invoke('plugin:window|set_min_size', {\n label: this.label,\n value: size instanceof Size ? size : size ? new Size(size) : null\n });\n }\n /**\n * Sets the window maximum inner size. If the `size` argument is undefined, the constraint is unset.\n * @example\n * ```typescript\n * import { getCurrentWindow, LogicalSize } from '@tauri-apps/api/window';\n * await getCurrentWindow().setMaxSize(new LogicalSize(600, 500));\n * ```\n *\n * @param size The logical or physical inner size, or `null` to unset the constraint.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setMaxSize(size) {\n return invoke('plugin:window|set_max_size', {\n label: this.label,\n value: size instanceof Size ? size : size ? new Size(size) : null\n });\n }\n /**\n * Sets the window inner size constraints.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setSizeConstraints({ minWidth: 300 });\n * ```\n *\n * @param constraints The logical or physical inner size, or `null` to unset the constraint.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setSizeConstraints(constraints) {\n function logical(pixel) {\n return pixel ? { Logical: pixel } : null;\n }\n return invoke('plugin:window|set_size_constraints', {\n label: this.label,\n value: {\n minWidth: logical(constraints === null || constraints === void 0 ? void 0 : constraints.minWidth),\n minHeight: logical(constraints === null || constraints === void 0 ? void 0 : constraints.minHeight),\n maxWidth: logical(constraints === null || constraints === void 0 ? void 0 : constraints.maxWidth),\n maxHeight: logical(constraints === null || constraints === void 0 ? void 0 : constraints.maxHeight)\n }\n });\n }\n /**\n * Sets the window outer position.\n * @example\n * ```typescript\n * import { getCurrentWindow, LogicalPosition } from '@tauri-apps/api/window';\n * await getCurrentWindow().setPosition(new LogicalPosition(600, 500));\n * ```\n *\n * @param position The new position, in logical or physical pixels.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setPosition(position) {\n return invoke('plugin:window|set_position', {\n label: this.label,\n value: position instanceof Position ? position : new Position(position)\n });\n }\n /**\n * Sets the window fullscreen state.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setFullscreen(true);\n * ```\n *\n * @param fullscreen Whether the window should go to fullscreen or not.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setFullscreen(fullscreen) {\n return invoke('plugin:window|set_fullscreen', {\n label: this.label,\n value: fullscreen\n });\n }\n /**\n * On macOS, Toggles a fullscreen mode that doesn’t require a new macOS space. Returns a boolean indicating whether the transition was successful (this won’t work if the window was already in the native fullscreen).\n * This is how fullscreen used to work on macOS in versions before Lion. And allows the user to have a fullscreen window without using another space or taking control over the entire monitor.\n *\n * On other platforms, this is the same as {@link Window.setFullscreen}.\n *\n * @param fullscreen Whether the window should go to simple fullscreen or not.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setSimpleFullscreen(fullscreen) {\n return invoke('plugin:window|set_simple_fullscreen', {\n label: this.label,\n value: fullscreen\n });\n }\n /**\n * Bring the window to front and focus.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setFocus();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async setFocus() {\n return invoke('plugin:window|set_focus', {\n label: this.label\n });\n }\n /**\n * Sets whether the window can be focused.\n *\n * #### Platform-specific\n *\n * - **macOS**: If the window is already focused, it is not possible to unfocus it after calling `set_focusable(false)`.\n * In this case, you might consider calling {@link Window.setFocus} but it will move the window to the back i.e. at the bottom in terms of z-order.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setFocusable(true);\n * ```\n *\n * @param focusable Whether the window can be focused.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setFocusable(focusable) {\n return invoke('plugin:window|set_focusable', {\n label: this.label,\n value: focusable\n });\n }\n /**\n * Sets the window icon.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setIcon('/tauri/awesome.png');\n * ```\n *\n * Note that you may need the `image-ico` or `image-png` Cargo features to use this API.\n * To enable it, change your Cargo.toml file:\n * ```toml\n * [dependencies]\n * tauri = { version = \"...\", features = [\"...\", \"image-png\"] }\n * ```\n *\n * @param icon Icon bytes or path to the icon file.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setIcon(icon) {\n return invoke('plugin:window|set_icon', {\n label: this.label,\n value: transformImage(icon)\n });\n }\n /**\n * Whether the window icon should be hidden from the taskbar or not.\n *\n * #### Platform-specific\n *\n * - **macOS:** Unsupported.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setSkipTaskbar(true);\n * ```\n *\n * @param skip true to hide window icon, false to show it.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setSkipTaskbar(skip) {\n return invoke('plugin:window|set_skip_taskbar', {\n label: this.label,\n value: skip\n });\n }\n /**\n * Grabs the cursor, preventing it from leaving the window.\n *\n * There's no guarantee that the cursor will be hidden. You should\n * hide it by yourself if you want so.\n *\n * #### Platform-specific\n *\n * - **Linux:** Unsupported.\n * - **macOS:** This locks the cursor in a fixed location, which looks visually awkward.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setCursorGrab(true);\n * ```\n *\n * @param grab `true` to grab the cursor icon, `false` to release it.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setCursorGrab(grab) {\n return invoke('plugin:window|set_cursor_grab', {\n label: this.label,\n value: grab\n });\n }\n /**\n * Modifies the cursor's visibility.\n *\n * #### Platform-specific\n *\n * - **Windows:** The cursor is only hidden within the confines of the window.\n * - **macOS:** The cursor is hidden as long as the window has input focus, even if the cursor is\n * outside of the window.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setCursorVisible(false);\n * ```\n *\n * @param visible If `false`, this will hide the cursor. If `true`, this will show the cursor.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setCursorVisible(visible) {\n return invoke('plugin:window|set_cursor_visible', {\n label: this.label,\n value: visible\n });\n }\n /**\n * Modifies the cursor icon of the window.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setCursorIcon('help');\n * ```\n *\n * @param icon The new cursor icon.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setCursorIcon(icon) {\n return invoke('plugin:window|set_cursor_icon', {\n label: this.label,\n value: icon\n });\n }\n /**\n * Sets the window background color.\n *\n * #### Platform-specific:\n *\n * - **Windows:** alpha channel is ignored.\n * - **iOS / Android:** Unsupported.\n *\n * @returns A promise indicating the success or failure of the operation.\n *\n * @since 2.1.0\n */\n async setBackgroundColor(color) {\n return invoke('plugin:window|set_background_color', { color });\n }\n /**\n * Changes the position of the cursor in window coordinates.\n * @example\n * ```typescript\n * import { getCurrentWindow, LogicalPosition } from '@tauri-apps/api/window';\n * await getCurrentWindow().setCursorPosition(new LogicalPosition(600, 300));\n * ```\n *\n * @param position The new cursor position.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setCursorPosition(position) {\n return invoke('plugin:window|set_cursor_position', {\n label: this.label,\n value: position instanceof Position ? position : new Position(position)\n });\n }\n /**\n * Changes the cursor events behavior.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setIgnoreCursorEvents(true);\n * ```\n *\n * @param ignore `true` to ignore the cursor events; `false` to process them as usual.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setIgnoreCursorEvents(ignore) {\n return invoke('plugin:window|set_ignore_cursor_events', {\n label: this.label,\n value: ignore\n });\n }\n /**\n * Starts dragging the window.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().startDragging();\n * ```\n *\n * @return A promise indicating the success or failure of the operation.\n */\n async startDragging() {\n return invoke('plugin:window|start_dragging', {\n label: this.label\n });\n }\n /**\n * Starts resize-dragging the window.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().startResizeDragging();\n * ```\n *\n * @return A promise indicating the success or failure of the operation.\n */\n async startResizeDragging(direction) {\n return invoke('plugin:window|start_resize_dragging', {\n label: this.label,\n value: direction\n });\n }\n /**\n * Sets the badge count. It is app wide and not specific to this window.\n *\n * #### Platform-specific\n *\n * - **Windows**: Unsupported. Use @{linkcode Window.setOverlayIcon} instead.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setBadgeCount(5);\n * ```\n *\n * @param count The badge count. Use `undefined` to remove the badge.\n * @return A promise indicating the success or failure of the operation.\n */\n async setBadgeCount(count) {\n return invoke('plugin:window|set_badge_count', {\n label: this.label,\n value: count\n });\n }\n /**\n * Sets the badge cont **macOS only**.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setBadgeLabel(\"Hello\");\n * ```\n *\n * @param label The badge label. Use `undefined` to remove the badge.\n * @return A promise indicating the success or failure of the operation.\n */\n async setBadgeLabel(label) {\n return invoke('plugin:window|set_badge_label', {\n label: this.label,\n value: label\n });\n }\n /**\n * Sets the overlay icon. **Windows only**\n * The overlay icon can be set for every window.\n *\n *\n * Note that you may need the `image-ico` or `image-png` Cargo features to use this API.\n * To enable it, change your Cargo.toml file:\n *\n * ```toml\n * [dependencies]\n * tauri = { version = \"...\", features = [\"...\", \"image-png\"] }\n * ```\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setOverlayIcon(\"/tauri/awesome.png\");\n * ```\n *\n * @param icon Icon bytes or path to the icon file. Use `undefined` to remove the overlay icon.\n * @return A promise indicating the success or failure of the operation.\n */\n async setOverlayIcon(icon) {\n return invoke('plugin:window|set_overlay_icon', {\n label: this.label,\n value: icon ? transformImage(icon) : undefined\n });\n }\n /**\n * Sets the taskbar progress state.\n *\n * #### Platform-specific\n *\n * - **Linux / macOS**: Progress bar is app-wide and not specific to this window.\n * - **Linux**: Only supported desktop environments with `libunity` (e.g. GNOME).\n *\n * @example\n * ```typescript\n * import { getCurrentWindow, ProgressBarStatus } from '@tauri-apps/api/window';\n * await getCurrentWindow().setProgressBar({\n * status: ProgressBarStatus.Normal,\n * progress: 50,\n * });\n * ```\n *\n * @return A promise indicating the success or failure of the operation.\n */\n async setProgressBar(state) {\n return invoke('plugin:window|set_progress_bar', {\n label: this.label,\n value: state\n });\n }\n /**\n * Sets whether the window should be visible on all workspaces or virtual desktops.\n *\n * #### Platform-specific\n *\n * - **Windows / iOS / Android:** Unsupported.\n *\n * @since 2.0.0\n */\n async setVisibleOnAllWorkspaces(visible) {\n return invoke('plugin:window|set_visible_on_all_workspaces', {\n label: this.label,\n value: visible\n });\n }\n /**\n * Sets the title bar style. **macOS only**.\n *\n * @since 2.0.0\n */\n async setTitleBarStyle(style) {\n return invoke('plugin:window|set_title_bar_style', {\n label: this.label,\n value: style\n });\n }\n /**\n * Set window theme, pass in `null` or `undefined` to follow system theme\n *\n * #### Platform-specific\n *\n * - **Linux / macOS**: Theme is app-wide and not specific to this window.\n * - **iOS / Android:** Unsupported.\n *\n * @since 2.0.0\n */\n async setTheme(theme) {\n return invoke('plugin:window|set_theme', {\n label: this.label,\n value: theme\n });\n }\n // Listeners\n /**\n * Listen to window resize.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from \"@tauri-apps/api/window\";\n * const unlisten = await getCurrentWindow().onResized(({ payload: size }) => {\n * console.log('Window resized', size);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n */\n async onResized(handler) {\n return this.listen(TauriEvent.WINDOW_RESIZED, (e) => {\n e.payload = new PhysicalSize(e.payload);\n handler(e);\n });\n }\n /**\n * Listen to window move.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from \"@tauri-apps/api/window\";\n * const unlisten = await getCurrentWindow().onMoved(({ payload: position }) => {\n * console.log('Window moved', position);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n */\n async onMoved(handler) {\n return this.listen(TauriEvent.WINDOW_MOVED, (e) => {\n e.payload = new PhysicalPosition(e.payload);\n handler(e);\n });\n }\n /**\n * Listen to window close requested. Emitted when the user requests to closes the window.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from \"@tauri-apps/api/window\";\n * import { confirm } from '@tauri-apps/api/dialog';\n * const unlisten = await getCurrentWindow().onCloseRequested(async (event) => {\n * const confirmed = await confirm('Are you sure?');\n * if (!confirmed) {\n * // user did not confirm closing the window; let's prevent it\n * event.preventDefault();\n * }\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n */\n async onCloseRequested(handler) {\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n return this.listen(TauriEvent.WINDOW_CLOSE_REQUESTED, async (event) => {\n const evt = new CloseRequestedEvent(event);\n await handler(evt);\n if (!evt.isPreventDefault()) {\n await this.destroy();\n }\n });\n }\n /**\n * Listen to a file drop event.\n * The listener is triggered when the user hovers the selected files on the webview,\n * drops the files or cancels the operation.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from \"@tauri-apps/api/webview\";\n * const unlisten = await getCurrentWindow().onDragDropEvent((event) => {\n * if (event.payload.type === 'over') {\n * console.log('User hovering', event.payload.position);\n * } else if (event.payload.type === 'drop') {\n * console.log('User dropped', event.payload.paths);\n * } else {\n * console.log('File drop cancelled');\n * }\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n */\n async onDragDropEvent(handler) {\n const unlistenDrag = await this.listen(TauriEvent.DRAG_ENTER, (event) => {\n handler({\n ...event,\n payload: {\n type: 'enter',\n paths: event.payload.paths,\n position: new PhysicalPosition(event.payload.position)\n }\n });\n });\n const unlistenDragOver = await this.listen(TauriEvent.DRAG_OVER, (event) => {\n handler({\n ...event,\n payload: {\n type: 'over',\n position: new PhysicalPosition(event.payload.position)\n }\n });\n });\n const unlistenDrop = await this.listen(TauriEvent.DRAG_DROP, (event) => {\n handler({\n ...event,\n payload: {\n type: 'drop',\n paths: event.payload.paths,\n position: new PhysicalPosition(event.payload.position)\n }\n });\n });\n const unlistenCancel = await this.listen(TauriEvent.DRAG_LEAVE, (event) => {\n handler({ ...event, payload: { type: 'leave' } });\n });\n return () => {\n unlistenDrag();\n unlistenDrop();\n unlistenDragOver();\n unlistenCancel();\n };\n }\n /**\n * Listen to window focus change.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from \"@tauri-apps/api/window\";\n * const unlisten = await getCurrentWindow().onFocusChanged(({ payload: focused }) => {\n * console.log('Focus changed, window is focused? ' + focused);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n */\n async onFocusChanged(handler) {\n const unlistenFocus = await this.listen(TauriEvent.WINDOW_FOCUS, (event) => {\n handler({ ...event, payload: true });\n });\n const unlistenBlur = await this.listen(TauriEvent.WINDOW_BLUR, (event) => {\n handler({ ...event, payload: false });\n });\n return () => {\n unlistenFocus();\n unlistenBlur();\n };\n }\n /**\n * Listen to window scale change. Emitted when the window's scale factor has changed.\n * The following user actions can cause DPI changes:\n * - Changing the display's resolution.\n * - Changing the display's scale factor (e.g. in Control Panel on Windows).\n * - Moving the window to a display with a different scale factor.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from \"@tauri-apps/api/window\";\n * const unlisten = await getCurrentWindow().onScaleChanged(({ payload }) => {\n * console.log('Scale changed', payload.scaleFactor, payload.size);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n */\n async onScaleChanged(handler) {\n return this.listen(TauriEvent.WINDOW_SCALE_FACTOR_CHANGED, handler);\n }\n /**\n * Listen to the system theme change.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from \"@tauri-apps/api/window\";\n * const unlisten = await getCurrentWindow().onThemeChanged(({ payload: theme }) => {\n * console.log('New theme: ' + theme);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n */\n async onThemeChanged(handler) {\n return this.listen(TauriEvent.WINDOW_THEME_CHANGED, handler);\n }\n}\n/**\n * Background throttling policy\n *\n * @since 2.0.0\n */\nvar BackgroundThrottlingPolicy;\n(function (BackgroundThrottlingPolicy) {\n BackgroundThrottlingPolicy[\"Disabled\"] = \"disabled\";\n BackgroundThrottlingPolicy[\"Throttle\"] = \"throttle\";\n BackgroundThrottlingPolicy[\"Suspend\"] = \"suspend\";\n})(BackgroundThrottlingPolicy || (BackgroundThrottlingPolicy = {}));\n/**\n * The scrollbar style to use in the webview.\n *\n * ## Platform-specific\n *\n * **Windows**: This option must be given the same value for all webviews.\n *\n * @since 2.8.0\n */\nvar ScrollBarStyle;\n(function (ScrollBarStyle) {\n /**\n * The default scrollbar style for the webview.\n */\n ScrollBarStyle[\"Default\"] = \"default\";\n /**\n * Fluent UI style overlay scrollbars. **Windows Only**\n *\n * Requires WebView2 Runtime version 125.0.2535.41 or higher, does nothing on older versions,\n * see https://learn.microsoft.com/en-us/microsoft-edge/webview2/release-notes/?tabs=dotnetcsharp#10253541\n */\n ScrollBarStyle[\"FluentOverlay\"] = \"fluentOverlay\";\n})(ScrollBarStyle || (ScrollBarStyle = {}));\n/**\n * Platform-specific window effects\n *\n * @since 2.0.0\n */\nvar Effect;\n(function (Effect) {\n /**\n * A default material appropriate for the view's effectiveAppearance. **macOS 10.14-**\n *\n * @deprecated since macOS 10.14. You should instead choose an appropriate semantic material.\n */\n Effect[\"AppearanceBased\"] = \"appearanceBased\";\n /**\n * **macOS 10.14-**\n *\n * @deprecated since macOS 10.14. Use a semantic material instead.\n */\n Effect[\"Light\"] = \"light\";\n /**\n * **macOS 10.14-**\n *\n * @deprecated since macOS 10.14. Use a semantic material instead.\n */\n Effect[\"Dark\"] = \"dark\";\n /**\n * **macOS 10.14-**\n *\n * @deprecated since macOS 10.14. Use a semantic material instead.\n */\n Effect[\"MediumLight\"] = \"mediumLight\";\n /**\n * **macOS 10.14-**\n *\n * @deprecated since macOS 10.14. Use a semantic material instead.\n */\n Effect[\"UltraDark\"] = \"ultraDark\";\n /**\n * **macOS 10.10+**\n */\n Effect[\"Titlebar\"] = \"titlebar\";\n /**\n * **macOS 10.10+**\n */\n Effect[\"Selection\"] = \"selection\";\n /**\n * **macOS 10.11+**\n */\n Effect[\"Menu\"] = \"menu\";\n /**\n * **macOS 10.11+**\n */\n Effect[\"Popover\"] = \"popover\";\n /**\n * **macOS 10.11+**\n */\n Effect[\"Sidebar\"] = \"sidebar\";\n /**\n * **macOS 10.14+**\n */\n Effect[\"HeaderView\"] = \"headerView\";\n /**\n * **macOS 10.14+**\n */\n Effect[\"Sheet\"] = \"sheet\";\n /**\n * **macOS 10.14+**\n */\n Effect[\"WindowBackground\"] = \"windowBackground\";\n /**\n * **macOS 10.14+**\n */\n Effect[\"HudWindow\"] = \"hudWindow\";\n /**\n * **macOS 10.14+**\n */\n Effect[\"FullScreenUI\"] = \"fullScreenUI\";\n /**\n * **macOS 10.14+**\n */\n Effect[\"Tooltip\"] = \"tooltip\";\n /**\n * **macOS 10.14+**\n */\n Effect[\"ContentBackground\"] = \"contentBackground\";\n /**\n * **macOS 10.14+**\n */\n Effect[\"UnderWindowBackground\"] = \"underWindowBackground\";\n /**\n * **macOS 10.14+**\n */\n Effect[\"UnderPageBackground\"] = \"underPageBackground\";\n /**\n * **Windows 11 Only**\n */\n Effect[\"Mica\"] = \"mica\";\n /**\n * **Windows 7/10/11(22H1) Only**\n *\n * #### Notes\n *\n * This effect has bad performance when resizing/dragging the window on Windows 11 build 22621.\n */\n Effect[\"Blur\"] = \"blur\";\n /**\n * **Windows 10/11**\n *\n * #### Notes\n *\n * This effect has bad performance when resizing/dragging the window on Windows 10 v1903+ and Windows 11 build 22000.\n */\n Effect[\"Acrylic\"] = \"acrylic\";\n /**\n * Tabbed effect that matches the system dark perefence **Windows 11 Only**\n */\n Effect[\"Tabbed\"] = \"tabbed\";\n /**\n * Tabbed effect with dark mode but only if dark mode is enabled on the system **Windows 11 Only**\n */\n Effect[\"TabbedDark\"] = \"tabbedDark\";\n /**\n * Tabbed effect with light mode **Windows 11 Only**\n */\n Effect[\"TabbedLight\"] = \"tabbedLight\";\n})(Effect || (Effect = {}));\n/**\n * Window effect state **macOS only**\n *\n * @see https://developer.apple.com/documentation/appkit/nsvisualeffectview/state\n *\n * @since 2.0.0\n */\nvar EffectState;\n(function (EffectState) {\n /**\n * Make window effect state follow the window's active state **macOS only**\n */\n EffectState[\"FollowsWindowActiveState\"] = \"followsWindowActiveState\";\n /**\n * Make window effect state always active **macOS only**\n */\n EffectState[\"Active\"] = \"active\";\n /**\n * Make window effect state always inactive **macOS only**\n */\n EffectState[\"Inactive\"] = \"inactive\";\n})(EffectState || (EffectState = {}));\nfunction mapMonitor(m) {\n return m === null\n ? null\n : {\n name: m.name,\n scaleFactor: m.scaleFactor,\n position: new PhysicalPosition(m.position),\n size: new PhysicalSize(m.size),\n workArea: {\n position: new PhysicalPosition(m.workArea.position),\n size: new PhysicalSize(m.workArea.size)\n }\n };\n}\n/**\n * Returns the monitor on which the window currently resides.\n * Returns `null` if current monitor can't be detected.\n * @example\n * ```typescript\n * import { currentMonitor } from '@tauri-apps/api/window';\n * const monitor = await currentMonitor();\n * ```\n *\n * @since 1.0.0\n */\nasync function currentMonitor() {\n return invoke('plugin:window|current_monitor').then(mapMonitor);\n}\n/**\n * Returns the primary monitor of the system.\n * Returns `null` if it can't identify any monitor as a primary one.\n * @example\n * ```typescript\n * import { primaryMonitor } from '@tauri-apps/api/window';\n * const monitor = await primaryMonitor();\n * ```\n *\n * @since 1.0.0\n */\nasync function primaryMonitor() {\n return invoke('plugin:window|primary_monitor').then(mapMonitor);\n}\n/**\n * Returns the monitor that contains the given point. Returns `null` if can't find any.\n * @example\n * ```typescript\n * import { monitorFromPoint } from '@tauri-apps/api/window';\n * const monitor = await monitorFromPoint(100.0, 200.0);\n * ```\n *\n * @since 1.0.0\n */\nasync function monitorFromPoint(x, y) {\n return invoke('plugin:window|monitor_from_point', {\n x,\n y\n }).then(mapMonitor);\n}\n/**\n * Returns the list of all the monitors available on the system.\n * @example\n * ```typescript\n * import { availableMonitors } from '@tauri-apps/api/window';\n * const monitors = await availableMonitors();\n * ```\n *\n * @since 1.0.0\n */\nasync function availableMonitors() {\n return invoke('plugin:window|available_monitors').then((ms) => ms.map(mapMonitor));\n}\n/**\n * Get the cursor position relative to the top-left hand corner of the desktop.\n *\n * Note that the top-left hand corner of the desktop is not necessarily the same as the screen.\n * If the user uses a desktop with multiple monitors,\n * the top-left hand corner of the desktop is the top-left hand corner of the main monitor on Windows and macOS\n * or the top-left of the leftmost monitor on X11.\n *\n * The coordinates can be negative if the top-left hand corner of the window is outside of the visible screen region.\n */\nasync function cursorPosition() {\n return invoke('plugin:window|cursor_position').then((v) => new PhysicalPosition(v));\n}\n\nexport { CloseRequestedEvent, Effect, EffectState, PhysicalPosition, PhysicalSize, ProgressBarStatus, UserAttentionType, Window, availableMonitors, currentMonitor, cursorPosition, getAllWindows, getCurrentWindow, monitorFromPoint, primaryMonitor };\n","import { PhysicalPosition, PhysicalSize, Size, Position } from './dpi.js';\nimport { listen, once, emit, emitTo, TauriEvent } from './event.js';\nimport { invoke } from './core.js';\nimport { getCurrentWindow, Window } from './window.js';\n\n// Copyright 2019-2024 Tauri Programme within The Commons Conservancy\n// SPDX-License-Identifier: Apache-2.0\n// SPDX-License-Identifier: MIT\n/**\n * Provides APIs to create webviews, communicate with other webviews and manipulate the current webview.\n *\n * #### Webview events\n *\n * Events can be listened to using {@link Webview.listen}:\n * ```typescript\n * import { getCurrentWebview } from \"@tauri-apps/api/webview\";\n * getCurrentWebview().listen(\"my-webview-event\", ({ event, payload }) => { });\n * ```\n *\n * @module\n */\n/**\n * Get an instance of `Webview` for the current webview.\n *\n * @since 2.0.0\n */\nfunction getCurrentWebview() {\n return new Webview(getCurrentWindow(), window.__TAURI_INTERNALS__.metadata.currentWebview.label, {\n // @ts-expect-error `skip` is not defined in the public API but it is handled by the constructor\n skip: true\n });\n}\n/**\n * Gets a list of instances of `Webview` for all available webviews.\n *\n * @since 2.0.0\n */\nasync function getAllWebviews() {\n return invoke('plugin:webview|get_all_webviews').then((webviews) => webviews.map((w) => new Webview(new Window(w.windowLabel, {\n // @ts-expect-error `skip` is not defined in the public API but it is handled by the constructor\n skip: true\n }), w.label, {\n // @ts-expect-error `skip` is not defined in the public API but it is handled by the constructor\n skip: true\n })));\n}\n/** @ignore */\n// events that are emitted right here instead of by the created webview\nconst localTauriEvents = ['tauri://created', 'tauri://error'];\n/**\n * Create new webview or get a handle to an existing one.\n *\n * Webviews are identified by a *label* a unique identifier that can be used to reference it later.\n * It may only contain alphanumeric characters `a-zA-Z` plus the following special characters `-`, `/`, `:` and `_`.\n *\n * @example\n * ```typescript\n * import { Window } from \"@tauri-apps/api/window\"\n * import { Webview } from \"@tauri-apps/api/webview\"\n *\n * const appWindow = new Window('uniqueLabel');\n *\n * appWindow.once('tauri://created', async function () {\n * // `new Webview` Should be called after the window is successfully created,\n * // or webview may not be attached to the window since window is not created yet.\n *\n * // loading embedded asset:\n * const webview = new Webview(appWindow, 'theUniqueLabel', {\n * url: 'path/to/page.html',\n *\n * // create a webview with specific logical position and size\n * x: 0,\n * y: 0,\n * width: 800,\n * height: 600,\n * });\n * // alternatively, load a remote URL:\n * const webview = new Webview(appWindow, 'theUniqueLabel', {\n * url: 'https://github.com/tauri-apps/tauri',\n *\n * // create a webview with specific logical position and size\n * x: 0,\n * y: 0,\n * width: 800,\n * height: 600,\n * });\n *\n * webview.once('tauri://created', function () {\n * // webview successfully created\n * });\n * webview.once('tauri://error', function (e) {\n * // an error happened creating the webview\n * });\n *\n *\n * // emit an event to the backend\n * await webview.emit(\"some-event\", \"data\");\n * // listen to an event from the backend\n * const unlisten = await webview.listen(\"event-name\", e => { });\n * unlisten();\n * });\n * ```\n *\n * @since 2.0.0\n */\nclass Webview {\n /**\n * Creates a new Webview.\n * @example\n * ```typescript\n * import { Window } from '@tauri-apps/api/window'\n * import { Webview } from '@tauri-apps/api/webview'\n * const appWindow = new Window('my-label')\n *\n * appWindow.once('tauri://created', async function() {\n * const webview = new Webview(appWindow, 'my-label', {\n * url: 'https://github.com/tauri-apps/tauri',\n *\n * // create a webview with specific logical position and size\n * x: 0,\n * y: 0,\n * width: 800,\n * height: 600,\n * });\n *\n * webview.once('tauri://created', function () {\n * // webview successfully created\n * });\n * webview.once('tauri://error', function (e) {\n * // an error happened creating the webview\n * });\n * });\n * ```\n *\n * @param window the window to add this webview to.\n * @param label The unique webview label. Must be alphanumeric: `a-zA-Z-/:_`.\n * @returns The {@link Webview} instance to communicate with the webview.\n */\n constructor(window, label, options) {\n this.window = window;\n this.label = label;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n this.listeners = Object.create(null);\n // @ts-expect-error `skip` is not a public API so it is not defined in WebviewOptions\n if (!(options === null || options === void 0 ? void 0 : options.skip)) {\n invoke('plugin:webview|create_webview', {\n windowLabel: window.label,\n options: {\n ...options,\n label\n }\n })\n .then(async () => this.emit('tauri://created'))\n .catch(async (e) => this.emit('tauri://error', e));\n }\n }\n /**\n * Gets the Webview for the webview associated with the given label.\n * @example\n * ```typescript\n * import { Webview } from '@tauri-apps/api/webview';\n * const mainWebview = Webview.getByLabel('main');\n * ```\n *\n * @param label The webview label.\n * @returns The Webview instance to communicate with the webview or null if the webview doesn't exist.\n */\n static async getByLabel(label) {\n var _a;\n return (_a = (await getAllWebviews()).find((w) => w.label === label)) !== null && _a !== void 0 ? _a : null;\n }\n /**\n * Get an instance of `Webview` for the current webview.\n */\n static getCurrent() {\n return getCurrentWebview();\n }\n /**\n * Gets a list of instances of `Webview` for all available webviews.\n */\n static async getAll() {\n return getAllWebviews();\n }\n /**\n * Listen to an emitted event on this webview.\n *\n * @example\n * ```typescript\n * import { getCurrentWebview } from '@tauri-apps/api/webview';\n * const unlisten = await getCurrentWebview().listen<string>('state-changed', (event) => {\n * console.log(`Got error: ${payload}`);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param handler Event handler.\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n */\n async listen(event, handler) {\n if (this._handleTauriEvent(event, handler)) {\n return () => {\n // eslint-disable-next-line security/detect-object-injection\n const listeners = this.listeners[event];\n listeners.splice(listeners.indexOf(handler), 1);\n };\n }\n return listen(event, handler, {\n target: { kind: 'Webview', label: this.label }\n });\n }\n /**\n * Listen to an emitted event on this webview only once.\n *\n * @example\n * ```typescript\n * import { getCurrentWebview } from '@tauri-apps/api/webview';\n * const unlisten = await getCurrent().once<null>('initialized', (event) => {\n * console.log(`Webview initialized!`);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param handler Event handler.\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n */\n async once(event, handler) {\n if (this._handleTauriEvent(event, handler)) {\n return () => {\n // eslint-disable-next-line security/detect-object-injection\n const listeners = this.listeners[event];\n listeners.splice(listeners.indexOf(handler), 1);\n };\n }\n return once(event, handler, {\n target: { kind: 'Webview', label: this.label }\n });\n }\n /**\n * Emits an event to all {@link EventTarget|targets}.\n *\n * @example\n * ```typescript\n * import { getCurrentWebview } from '@tauri-apps/api/webview';\n * await getCurrentWebview().emit('webview-loaded', { loggedIn: true, token: 'authToken' });\n * ```\n *\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param payload Event payload.\n */\n async emit(event, payload) {\n if (localTauriEvents.includes(event)) {\n // eslint-disable-next-line\n for (const handler of this.listeners[event] || []) {\n handler({\n event,\n id: -1,\n payload\n });\n }\n return;\n }\n return emit(event, payload);\n }\n /**\n * Emits an event to all {@link EventTarget|targets} matching the given target.\n *\n * @example\n * ```typescript\n * import { getCurrentWebview } from '@tauri-apps/api/webview';\n * await getCurrentWebview().emitTo('main', 'webview-loaded', { loggedIn: true, token: 'authToken' });\n * ```\n *\n * @param target Label of the target Window/Webview/WebviewWindow or raw {@link EventTarget} object.\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param payload Event payload.\n */\n async emitTo(target, event, payload) {\n if (localTauriEvents.includes(event)) {\n // eslint-disable-next-line\n for (const handler of this.listeners[event] || []) {\n handler({\n event,\n id: -1,\n payload\n });\n }\n return;\n }\n return emitTo(target, event, payload);\n }\n /** @ignore */\n _handleTauriEvent(event, handler) {\n if (localTauriEvents.includes(event)) {\n if (!(event in this.listeners)) {\n // eslint-disable-next-line security/detect-object-injection\n this.listeners[event] = [handler];\n }\n else {\n // eslint-disable-next-line security/detect-object-injection\n this.listeners[event].push(handler);\n }\n return true;\n }\n return false;\n }\n // Getters\n /**\n * The position of the top-left hand corner of the webview's client area relative to the top-left hand corner of the desktop.\n * @example\n * ```typescript\n * import { getCurrentWebview } from '@tauri-apps/api/webview';\n * const position = await getCurrentWebview().position();\n * ```\n *\n * @returns The webview's position.\n */\n async position() {\n return invoke('plugin:webview|webview_position', {\n label: this.label\n }).then((p) => new PhysicalPosition(p));\n }\n /**\n * The physical size of the webview's client area.\n * The client area is the content of the webview, excluding the title bar and borders.\n * @example\n * ```typescript\n * import { getCurrentWebview } from '@tauri-apps/api/webview';\n * const size = await getCurrentWebview().size();\n * ```\n *\n * @returns The webview's size.\n */\n async size() {\n return invoke('plugin:webview|webview_size', {\n label: this.label\n }).then((s) => new PhysicalSize(s));\n }\n // Setters\n /**\n * Closes the webview.\n * @example\n * ```typescript\n * import { getCurrentWebview } from '@tauri-apps/api/webview';\n * await getCurrentWebview().close();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async close() {\n return invoke('plugin:webview|webview_close', {\n label: this.label\n });\n }\n /**\n * Resizes the webview.\n * @example\n * ```typescript\n * import { getCurrent, LogicalSize } from '@tauri-apps/api/webview';\n * await getCurrentWebview().setSize(new LogicalSize(600, 500));\n * ```\n *\n * @param size The logical or physical size.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setSize(size) {\n return invoke('plugin:webview|set_webview_size', {\n label: this.label,\n value: size instanceof Size ? size : new Size(size)\n });\n }\n /**\n * Sets the webview position.\n * @example\n * ```typescript\n * import { getCurrent, LogicalPosition } from '@tauri-apps/api/webview';\n * await getCurrentWebview().setPosition(new LogicalPosition(600, 500));\n * ```\n *\n * @param position The new position, in logical or physical pixels.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setPosition(position) {\n return invoke('plugin:webview|set_webview_position', {\n label: this.label,\n value: position instanceof Position ? position : new Position(position)\n });\n }\n /**\n * Bring the webview to front and focus.\n * @example\n * ```typescript\n * import { getCurrentWebview } from '@tauri-apps/api/webview';\n * await getCurrentWebview().setFocus();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async setFocus() {\n return invoke('plugin:webview|set_webview_focus', {\n label: this.label\n });\n }\n /**\n * Sets whether the webview should automatically grow and shrink its size and position when the parent window resizes.\n * @example\n * ```typescript\n * import { getCurrentWebview } from '@tauri-apps/api/webview';\n * await getCurrentWebview().setAutoResize(true);\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async setAutoResize(autoResize) {\n return invoke('plugin:webview|set_webview_auto_resize', {\n label: this.label,\n value: autoResize\n });\n }\n /**\n * Hide the webview.\n * @example\n * ```typescript\n * import { getCurrentWebview } from '@tauri-apps/api/webview';\n * await getCurrentWebview().hide();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async hide() {\n return invoke('plugin:webview|webview_hide', {\n label: this.label\n });\n }\n /**\n * Show the webview.\n * @example\n * ```typescript\n * import { getCurrentWebview } from '@tauri-apps/api/webview';\n * await getCurrentWebview().show();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async show() {\n return invoke('plugin:webview|webview_show', {\n label: this.label\n });\n }\n /**\n * Set webview zoom level.\n * @example\n * ```typescript\n * import { getCurrentWebview } from '@tauri-apps/api/webview';\n * await getCurrentWebview().setZoom(1.5);\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async setZoom(scaleFactor) {\n return invoke('plugin:webview|set_webview_zoom', {\n label: this.label,\n value: scaleFactor\n });\n }\n /**\n * Moves this webview to the given label.\n * @example\n * ```typescript\n * import { getCurrentWebview } from '@tauri-apps/api/webview';\n * await getCurrentWebview().reparent('other-window');\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async reparent(window) {\n return invoke('plugin:webview|reparent', {\n label: this.label,\n window: typeof window === 'string' ? window : window.label\n });\n }\n /**\n * Clears all browsing data for this webview.\n * @example\n * ```typescript\n * import { getCurrentWebview } from '@tauri-apps/api/webview';\n * await getCurrentWebview().clearAllBrowsingData();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async clearAllBrowsingData() {\n return invoke('plugin:webview|clear_all_browsing_data');\n }\n /**\n * Specify the webview background color.\n *\n * #### Platfrom-specific:\n *\n * - **macOS / iOS**: Not implemented.\n * - **Windows**:\n * - On Windows 7, transparency is not supported and the alpha value will be ignored.\n * - On Windows higher than 7: translucent colors are not supported so any alpha value other than `0` will be replaced by `255`\n *\n * @returns A promise indicating the success or failure of the operation.\n *\n * @since 2.1.0\n */\n async setBackgroundColor(color) {\n return invoke('plugin:webview|set_webview_background_color', { color });\n }\n // Listeners\n /**\n * Listen to a file drop event.\n * The listener is triggered when the user hovers the selected files on the webview,\n * drops the files or cancels the operation.\n *\n * @example\n * ```typescript\n * import { getCurrentWebview } from \"@tauri-apps/api/webview\";\n * const unlisten = await getCurrentWebview().onDragDropEvent((event) => {\n * if (event.payload.type === 'over') {\n * console.log('User hovering', event.payload.position);\n * } else if (event.payload.type === 'drop') {\n * console.log('User dropped', event.payload.paths);\n * } else {\n * console.log('File drop cancelled');\n * }\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * When the debugger panel is open, the drop position of this event may be inaccurate due to a known limitation.\n * To retrieve the correct drop position, please detach the debugger.\n *\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n */\n async onDragDropEvent(handler) {\n const unlistenDragEnter = await this.listen(TauriEvent.DRAG_ENTER, (event) => {\n handler({\n ...event,\n payload: {\n type: 'enter',\n paths: event.payload.paths,\n position: new PhysicalPosition(event.payload.position)\n }\n });\n });\n const unlistenDragOver = await this.listen(TauriEvent.DRAG_OVER, (event) => {\n handler({\n ...event,\n payload: {\n type: 'over',\n position: new PhysicalPosition(event.payload.position)\n }\n });\n });\n const unlistenDragDrop = await this.listen(TauriEvent.DRAG_DROP, (event) => {\n handler({\n ...event,\n payload: {\n type: 'drop',\n paths: event.payload.paths,\n position: new PhysicalPosition(event.payload.position)\n }\n });\n });\n const unlistenDragLeave = await this.listen(TauriEvent.DRAG_LEAVE, (event) => {\n handler({ ...event, payload: { type: 'leave' } });\n });\n return () => {\n unlistenDragEnter();\n unlistenDragDrop();\n unlistenDragOver();\n unlistenDragLeave();\n };\n }\n}\n\nexport { Webview, getAllWebviews, getCurrentWebview };\n","import { getCurrentWebview, Webview } from './webview.js';\nimport { Window } from './window.js';\nimport { listen, once } from './event.js';\nimport { invoke } from './core.js';\n\n// Copyright 2019-2024 Tauri Programme within The Commons Conservancy\n// SPDX-License-Identifier: Apache-2.0\n// SPDX-License-Identifier: MIT\n/**\n * Get an instance of `Webview` for the current webview window.\n *\n * @since 2.0.0\n */\nfunction getCurrentWebviewWindow() {\n const webview = getCurrentWebview();\n // @ts-expect-error `skip` is not defined in the public API but it is handled by the constructor\n return new WebviewWindow(webview.label, { skip: true });\n}\n/**\n * Gets a list of instances of `Webview` for all available webview windows.\n *\n * @since 2.0.0\n */\nasync function getAllWebviewWindows() {\n return invoke('plugin:window|get_all_windows').then((windows) => windows.map((w) => new WebviewWindow(w, {\n // @ts-expect-error `skip` is not defined in the public API but it is handled by the constructor\n skip: true\n })));\n}\n// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging\nclass WebviewWindow {\n /**\n * Creates a new {@link Window} hosting a {@link Webview}.\n * @example\n * ```typescript\n * import { WebviewWindow } from '@tauri-apps/api/webviewWindow'\n * const webview = new WebviewWindow('my-label', {\n * url: 'https://github.com/tauri-apps/tauri'\n * });\n * webview.once('tauri://created', function () {\n * // webview successfully created\n * });\n * webview.once('tauri://error', function (e) {\n * // an error happened creating the webview\n * });\n * ```\n *\n * @param label The unique webview label. Must be alphanumeric: `a-zA-Z-/:_`.\n * @returns The {@link WebviewWindow} instance to communicate with the window and webview.\n */\n constructor(label, options = {}) {\n var _a;\n this.label = label;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n this.listeners = Object.create(null);\n // @ts-expect-error `skip` is not a public API so it is not defined in WebviewOptions\n if (!(options === null || options === void 0 ? void 0 : options.skip)) {\n invoke('plugin:webview|create_webview_window', {\n options: {\n ...options,\n parent: typeof options.parent === 'string'\n ? options.parent\n : (_a = options.parent) === null || _a === void 0 ? void 0 : _a.label,\n label\n }\n })\n .then(async () => this.emit('tauri://created'))\n .catch(async (e) => this.emit('tauri://error', e));\n }\n }\n /**\n * Gets the Webview for the webview associated with the given label.\n * @example\n * ```typescript\n * import { Webview } from '@tauri-apps/api/webviewWindow';\n * const mainWebview = Webview.getByLabel('main');\n * ```\n *\n * @param label The webview label.\n * @returns The Webview instance to communicate with the webview or null if the webview doesn't exist.\n */\n static async getByLabel(label) {\n var _a;\n const webview = (_a = (await getAllWebviewWindows()).find((w) => w.label === label)) !== null && _a !== void 0 ? _a : null;\n if (webview) {\n // @ts-expect-error `skip` is not defined in the public API but it is handled by the constructor\n return new WebviewWindow(webview.label, { skip: true });\n }\n return null;\n }\n /**\n * Get an instance of `Webview` for the current webview.\n */\n static getCurrent() {\n return getCurrentWebviewWindow();\n }\n /**\n * Gets a list of instances of `Webview` for all available webviews.\n */\n static async getAll() {\n return getAllWebviewWindows();\n }\n /**\n * Listen to an emitted event on this webivew window.\n *\n * @example\n * ```typescript\n * import { WebviewWindow } from '@tauri-apps/api/webviewWindow';\n * const unlisten = await WebviewWindow.getCurrent().listen<string>('state-changed', (event) => {\n * console.log(`Got error: ${payload}`);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param handler Event handler.\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n */\n async listen(event, handler) {\n if (this._handleTauriEvent(event, handler)) {\n return () => {\n // eslint-disable-next-line security/detect-object-injection\n const listeners = this.listeners[event];\n listeners.splice(listeners.indexOf(handler), 1);\n };\n }\n return listen(event, handler, {\n target: { kind: 'WebviewWindow', label: this.label }\n });\n }\n /**\n * Listen to an emitted event on this webview window only once.\n *\n * @example\n * ```typescript\n * import { WebviewWindow } from '@tauri-apps/api/webviewWindow';\n * const unlisten = await WebviewWindow.getCurrent().once<null>('initialized', (event) => {\n * console.log(`Webview initialized!`);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param handler Event handler.\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n */\n async once(event, handler) {\n if (this._handleTauriEvent(event, handler)) {\n return () => {\n // eslint-disable-next-line security/detect-object-injection\n const listeners = this.listeners[event];\n listeners.splice(listeners.indexOf(handler), 1);\n };\n }\n return once(event, handler, {\n target: { kind: 'WebviewWindow', label: this.label }\n });\n }\n /**\n * Set the window and webview background color.\n *\n * #### Platform-specific:\n *\n * - **Android / iOS:** Unsupported for the window layer.\n * - **macOS / iOS**: Not implemented for the webview layer.\n * - **Windows**:\n * - alpha channel is ignored for the window layer.\n * - On Windows 7, alpha channel is ignored for the webview layer.\n * - On Windows 8 and newer, if alpha channel is not `0`, it will be ignored.\n *\n * @returns A promise indicating the success or failure of the operation.\n *\n * @since 2.1.0\n */\n async setBackgroundColor(color) {\n return invoke('plugin:window|set_background_color', { color }).then(() => {\n return invoke('plugin:webview|set_webview_background_color', { color });\n });\n }\n}\n// Order matters, we use window APIs by default\napplyMixins(WebviewWindow, [Window, Webview]);\n/** Extends a base class by other specified classes, without overriding existing properties */\nfunction applyMixins(baseClass, extendedClasses) {\n (Array.isArray(extendedClasses)\n ? extendedClasses\n : [extendedClasses]).forEach((extendedClass) => {\n Object.getOwnPropertyNames(extendedClass.prototype).forEach((name) => {\n var _a;\n if (typeof baseClass.prototype === 'object'\n && baseClass.prototype\n && name in baseClass.prototype)\n return;\n Object.defineProperty(baseClass.prototype, name, \n // eslint-disable-next-line\n (_a = Object.getOwnPropertyDescriptor(extendedClass.prototype, name)) !== null && _a !== void 0 ? _a : Object.create(null));\n });\n });\n}\n\nexport { WebviewWindow, getAllWebviewWindows, getCurrentWebviewWindow };\n","import { WebviewWindow } from '@tauri-apps/api/webviewWindow'\nimport { primaryMonitor } from '@tauri-apps/api/window'\nimport type { MessageType, WindowPosition } from '../types/message'\nimport { useMessageQueueStore } from '../stores/messageQueueStore'\nimport { markAsShown } from './db'\nimport { getNoticeConfig } from '../config/noticeConfig'\n\n/**\n * Map of active notice windows\n */\nconst activeWindows = new Map<string, WebviewWindow>()\n\n/**\n * Calculate window position based on position preset or custom coordinates\n * @param width - Window width\n * @param height - Window height\n * @param positionConfig - Position configuration\n * @returns Object with x and y coordinates\n */\nconst calculateWindowPosition = async (\n width: number,\n height: number,\n positionConfig?: WindowPosition\n): Promise<{ x: number; y: number }> => {\n const padding = positionConfig?.padding ?? 20\n\n // If custom coordinates provided, use them directly\n if (positionConfig?.x !== undefined && positionConfig?.y !== undefined) {\n return { x: positionConfig.x, y: positionConfig.y }\n }\n\n // Get screen dimensions\n let screenWidth = 1920\n let screenHeight = 1080\n\n try {\n const monitor = await primaryMonitor()\n if (monitor?.size) {\n screenWidth = monitor.size.width\n screenHeight = monitor.size.height\n }\n } catch (error) {\n console.warn('Failed to get monitor info, using defaults:', error)\n }\n\n // Calculate position based on preset\n const position = positionConfig?.position ?? 'right-bottom'\n\n switch (position) {\n case 'right-bottom':\n return {\n x: screenWidth - width - padding,\n y: screenHeight - height - padding,\n }\n\n case 'right-top':\n return {\n x: screenWidth - width - padding,\n y: padding,\n }\n\n case 'left-bottom':\n return {\n x: padding,\n y: screenHeight - height - padding,\n }\n\n case 'left-top':\n return {\n x: padding,\n y: padding,\n }\n\n case 'center':\n return {\n x: (screenWidth - width) / 2,\n y: (screenHeight - height) / 2,\n }\n\n default:\n // Default to right-bottom\n return {\n x: screenWidth - width - padding,\n y: screenHeight - height - padding,\n }\n }\n}\n\n/**\n * Create a new notice window for the given message\n * @param message - Message to display in the window\n */\nexport const createNoticeWindow = async (message: MessageType): Promise<void> => {\n const normalizedId = String(message.id)\n const store = useMessageQueueStore.getState()\n\n // Check if window already exists\n if (store.isWindowActive(normalizedId)) {\n console.log(`Notice window already open for message: ${normalizedId}`)\n return\n }\n\n const config = getNoticeConfig()\n const windowLabel = `notice-${normalizedId}`\n const windowUrl = `${config.routePrefix}/${message.type}?id=${message.id}`\n\n // Determine window dimensions\n const width = message.min_width || config.defaultWidth\n const height = message.min_height || config.defaultHeight\n\n // Calculate window position\n const { x, y } = await calculateWindowPosition(width, height, message.windowPosition)\n\n try {\n // Create new webview window\n const noticeWindow = new WebviewWindow(windowLabel, {\n url: windowUrl,\n title: message.title,\n width,\n height,\n x,\n y,\n resizable: true,\n decorations: true,\n skipTaskbar: false,\n alwaysOnTop: true,\n })\n\n // Track active window\n activeWindows.set(normalizedId, noticeWindow)\n store.addActiveWindow(normalizedId)\n\n // Register destroy event listener\n noticeWindow.once('tauri://destroyed', async () => {\n // Clean up tracking\n activeWindows.delete(normalizedId)\n store.removeActiveWindow(normalizedId)\n\n // Mark as shown in database\n await markAsShown(normalizedId)\n\n // Show next message\n store.clearCurrent()\n })\n\n console.log(`Created notice window: ${windowLabel}`)\n } catch (error) {\n console.error('Failed to create notice window:', error)\n // Clean up on error\n store.removeActiveWindow(normalizedId)\n store.clearCurrent()\n }\n}\n\n/**\n * Close a specific notice window by message ID\n * @param messageId - ID of the message whose window should be closed\n */\nexport const closeNoticeWindow = async (messageId: string): Promise<void> => {\n const normalizedId = String(messageId)\n const window = activeWindows.get(normalizedId)\n\n if (window) {\n try {\n await window.close()\n activeWindows.delete(normalizedId)\n console.log(`Closed notice window: ${normalizedId}`)\n } catch (error) {\n console.error('Failed to close notice window:', error)\n }\n }\n}\n\n/**\n * Close all active notice windows\n */\nexport const closeAllNoticeWindows = async (): Promise<void> => {\n const closePromises = Array.from(activeWindows.keys()).map((id) =>\n closeNoticeWindow(id)\n )\n await Promise.all(closePromises)\n}\n\n/**\n * Initialize the notice window system\n * Sets up store subscription to auto-create windows when currentMessage changes\n */\nexport const initializeNoticeWindowSystem = (): void => {\n let previousMessage: MessageType | null = null\n\n // Subscribe to store changes and watch for currentMessage updates\n useMessageQueueStore.subscribe((state) => {\n const currentMessage = state.currentMessage\n \n // Only create window if currentMessage changed and is not null\n if (currentMessage && currentMessage !== previousMessage) {\n previousMessage = currentMessage\n createNoticeWindow(currentMessage)\n } else if (!currentMessage) {\n previousMessage = null\n }\n })\n\n console.log('Notice window system initialized')\n}\n\n","import { useCallback } from 'react'\nimport { useMessageQueueStore } from '../stores/messageQueueStore'\nimport { closeNoticeWindow } from '../utils/noticeWindow'\n\n/**\n * Hook to close the current notice window\n * Should be called from within a notice window component\n * @returns Object with closeNotice function\n */\nexport const useCloseNotice = () => {\n const currentMessage = useMessageQueueStore((state) => state.currentMessage)\n\n const closeNotice = useCallback(async () => {\n if (currentMessage) {\n await closeNoticeWindow(currentMessage.id)\n }\n }, [currentMessage])\n\n return { closeNotice }\n}\n\n","import { useCallback } from 'react'\nimport { useMessageQueueStore } from '../stores/messageQueueStore'\nimport { closeNoticeWindow } from '../utils/noticeWindow'\nimport { markAsHidden } from '../utils/db'\n\n/**\n * Hook to hide a specific notice by ID\n * Typically used for server-triggered hide events\n * @returns Object with hideNotice function\n */\nexport const useHideNotice = () => {\n const store = useMessageQueueStore()\n\n const hideNotice = useCallback(\n async (messageId: string) => {\n // Mark as hidden in database\n await markAsHidden(messageId)\n\n // Close the window\n await closeNoticeWindow(messageId)\n\n // Clear current if it matches\n if (store.currentMessage?.id === messageId) {\n store.clearCurrent()\n }\n },\n [store]\n )\n\n return { hideNotice }\n}\n\n","import { useCallback } from 'react'\nimport { useMessageQueueStore } from '../stores/messageQueueStore'\nimport { closeAllNoticeWindows } from '../utils/noticeWindow'\n\n/**\n * Hook to hide all pending and active notices\n * @returns Object with hideAllNotices function\n */\nexport const useHideAllNotices = () => {\n const clearOnLogout = useMessageQueueStore((state) => state.clearOnLogout)\n\n const hideAllNotices = useCallback(async () => {\n // Close all active windows\n await closeAllNoticeWindows()\n\n // Clear queue and database\n await clearOnLogout()\n }, [clearOnLogout])\n\n return { hideAllNotices }\n}\n\n","import { useMessageQueueStore, messageQueueSelectors } from '../stores/messageQueueStore'\n\n/**\n * Hook to access message queue state\n * @returns Queue state information\n */\nexport const useMessageQueue = () => {\n const queueLength = useMessageQueueStore(messageQueueSelectors.queueLength)\n const currentMessage = useMessageQueueStore(messageQueueSelectors.currentMessage)\n const isProcessing = useMessageQueueStore(messageQueueSelectors.isProcessing)\n const queue = useMessageQueueStore(messageQueueSelectors.queue)\n\n return {\n queueLength,\n currentMessage,\n isProcessing,\n queue,\n }\n}\n\n","import { useEffect, useState, type ReactNode } from 'react'\nimport type { MessageType } from '../types/message'\nimport { getMessage } from '../utils/db'\n\n/**\n * Props for NoticeLayout component\n */\ninterface NoticeLayoutProps {\n /**\n * Render function that receives the current message\n */\n children: (message: MessageType) => ReactNode\n /**\n * Optional callback when message is loaded\n */\n onLoad?: (message: MessageType) => void\n /**\n * Optional callback when window is closed\n */\n onClose?: (message: MessageType) => void\n}\n\n/**\n * Layout component for notice windows\n * Loads the message from database/URL and provides it to children\n */\nexport const NoticeLayout = ({ children, onLoad, onClose }: NoticeLayoutProps) => {\n const [message, setMessage] = useState<MessageType | null>(null)\n const [loading, setLoading] = useState(true)\n const [error, setError] = useState<string | null>(null)\n\n useEffect(() => {\n const loadMessage = async () => {\n try {\n // Get message ID from URL query params\n const urlParams = new URLSearchParams(window.location.search)\n const messageId = urlParams.get('id')\n\n if (!messageId) {\n setError('No message ID provided')\n setLoading(false)\n return\n }\n\n // Load message from database\n const storedMessage = await getMessage(messageId)\n\n if (!storedMessage) {\n setError('Message not found')\n setLoading(false)\n return\n }\n\n setMessage(storedMessage)\n setLoading(false)\n\n // Call onLoad callback if provided\n if (onLoad) {\n onLoad(storedMessage)\n }\n } catch (err) {\n console.error('Failed to load message:', err)\n setError('Failed to load message')\n setLoading(false)\n }\n }\n\n loadMessage()\n }, [onLoad])\n\n // Handle window close event\n useEffect(() => {\n if (!message || !onClose) return\n\n const handleBeforeUnload = () => {\n onClose(message)\n }\n\n window.addEventListener('beforeunload', handleBeforeUnload)\n\n return () => {\n window.removeEventListener('beforeunload', handleBeforeUnload)\n }\n }, [message, onClose])\n\n if (loading) {\n return (\n <div style={{ \n display: 'flex', \n justifyContent: 'center', \n alignItems: 'center', \n height: '100vh',\n fontFamily: 'system-ui, -apple-system, sans-serif'\n }}>\n Loading...\n </div>\n )\n }\n\n if (error || !message) {\n return (\n <div style={{ \n display: 'flex', \n justifyContent: 'center', \n alignItems: 'center', \n height: '100vh',\n fontFamily: 'system-ui, -apple-system, sans-serif',\n color: '#ef4444'\n }}>\n {error || 'Message not found'}\n </div>\n )\n }\n\n return <>{children(message)}</>\n}\n\n","/**\n * Tauri Notice Window Library\n * A reusable React library for cross-window notification management in Tauri v2+ applications\n */\n\n// Types\nexport type { MessageType, StoredMessage, NoticeConfig, WindowPosition } from './types/message'\n\n// Store\nimport { useMessageQueueStore, messageQueueSelectors } from './stores/messageQueueStore'\nexport { useMessageQueueStore, messageQueueSelectors }\n\n// Hooks\nexport { useNoticeWindow } from './hooks/useNoticeWindow'\nexport { useCloseNotice } from './hooks/useCloseNotice'\nexport { useHideNotice } from './hooks/useHideNotice'\nexport { useHideAllNotices } from './hooks/useHideAllNotices'\nexport { useMessageQueue } from './hooks/useMessageQueue'\n\n// Components\nexport { NoticeLayout } from './components/NoticeLayout'\n\n// Configuration\nexport { setNoticeConfig, getNoticeConfig } from './config/noticeConfig'\n\n// Utils\nimport { \n initializeNoticeWindowSystem,\n createNoticeWindow,\n closeNoticeWindow,\n closeAllNoticeWindows,\n} from './utils/noticeWindow'\nexport { \n initializeNoticeWindowSystem,\n createNoticeWindow,\n closeNoticeWindow,\n closeAllNoticeWindows,\n}\n\nimport { \n initializeDatabase,\n saveMessage,\n hasMessage,\n getPendingMessages,\n getMessage,\n markAsShown,\n markAsHidden,\n clearPendingMessages,\n} from './utils/db'\nexport { \n initializeDatabase,\n saveMessage,\n hasMessage,\n getPendingMessages,\n getMessage,\n markAsShown,\n markAsHidden,\n clearPendingMessages,\n}\n\n/**\n * Initialize the complete notice window system\n * Call this once during app startup (e.g., in App.tsx or main layout)\n * \n * @example\n * ```typescript\n * import { initializeNoticeSystem } from 'tauri-notice-window'\n * \n * useEffect(() => {\n * initializeNoticeSystem()\n * }, [])\n * ```\n */\nexport const initializeNoticeSystem = async (): Promise<void> => {\n // Initialize database\n initializeDatabase()\n\n // Set up window system (store subscription)\n initializeNoticeWindowSystem()\n\n // Load pending messages from database\n const { initializeFromDatabase } = useMessageQueueStore.getState()\n await initializeFromDatabase()\n\n console.log('Tauri Notice System initialized')\n}\n\n"],"names":["CONFIG_STORAGE_KEY","defaultConfig","loadConfigFromStorage","stored","error","saveConfigToStorage","config","setNoticeConfig","newConfig","updatedConfig","getNoticeConfig","NoticeDatabase","Dexie","databaseName","db","initializeDatabase","getDb","saveMessage","message","storedMessage","hasMessage","id","getPendingMessages","updateQueueStatus","status","markAsShown","markAsHidden","getMessage","clearPendingMessages","updateQueuePositions","messages","updates","msg","storeCreator","set","get","state","m","newQueue","nextMessage","remainingQueue","processing","queue","pendingMessages","positions","index","normalizedId","wid","useMessageQueueStore","create","syncTabs","messageQueueSelectors","useNoticeWindow","enqueue","useCallback","__classPrivateFieldGet","receiver","kind","f","__classPrivateFieldSet","value","_Resource_rid","SERIALIZE_TO_IPC_FN","transformCallback","callback","once","invoke","cmd","args","options","Resource","rid","LogicalSize","scaleFactor","PhysicalSize","Size","size","LogicalPosition","PhysicalPosition","Position","position","TauriEvent","_unlisten","event","eventId","listen","handler","_a","target","eventData","emit","payload","emitTo","Image","rgba","width","height","transformImage","bytes","path","buffer","image","UserAttentionType","CloseRequestedEvent","ProgressBarStatus","getCurrentWindow","Window","getAllWindows","windows","w","localTauriEvents","label","e","listeners","p","s","requestType","requestType_","resizable","enabled","maximizable","minimizable","closable","title","decorations","enable","effects","alwaysOnTop","alwaysOnBottom","protected_","constraints","logical","pixel","fullscreen","focusable","icon","skip","grab","visible","color","ignore","direction","count","style","theme","evt","unlistenDrag","unlistenDragOver","unlistenDrop","unlistenCancel","unlistenFocus","unlistenBlur","BackgroundThrottlingPolicy","ScrollBarStyle","Effect","EffectState","mapMonitor","primaryMonitor","getCurrentWebview","Webview","getAllWebviews","webviews","window","autoResize","unlistenDragEnter","unlistenDragDrop","unlistenDragLeave","getCurrentWebviewWindow","webview","WebviewWindow","getAllWebviewWindows","applyMixins","baseClass","extendedClasses","extendedClass","name","activeWindows","calculateWindowPosition","positionConfig","padding","screenWidth","screenHeight","monitor","createNoticeWindow","store","windowLabel","windowUrl","x","y","noticeWindow","closeNoticeWindow","messageId","closeAllNoticeWindows","closePromises","initializeNoticeWindowSystem","previousMessage","currentMessage","useCloseNotice","useHideNotice","useHideAllNotices","clearOnLogout","useMessageQueue","queueLength","isProcessing","NoticeLayout","children","onLoad","onClose","setMessage","useState","loading","setLoading","setError","useEffect","err","handleBeforeUnload","jsx","Fragment","initializeNoticeSystem","initializeFromDatabase"],"mappings":"6MAEMA,EAAqB,sBAKrBC,EAA8B,CAClC,YAAa,UACb,aAAc,kBACd,aAAc,IACd,cAAe,GACjB,EAKMC,EAAwB,IAAoB,CAChD,GAAI,CACF,MAAMC,EAAS,aAAa,QAAQH,CAAkB,EACtD,GAAIG,EACF,MAAO,CAAE,GAAGF,EAAe,GAAG,KAAK,MAAME,CAAM,CAAA,CAEnD,OAASC,EAAO,CACd,QAAQ,KAAK,2CAA4CA,CAAK,CAChE,CACA,OAAOH,CACT,EAKMI,GAAuBC,GAA+B,CAC1D,GAAI,CACF,aAAa,QAAQN,EAAoB,KAAK,UAAUM,CAAM,CAAC,CACjE,OAASF,EAAO,CACd,QAAQ,KAAK,yCAA0CA,CAAK,CAC9D,CACF,EAMaG,GAAmBC,GAA2C,CAEzE,MAAMC,EAAgB,CAAE,GADFP,EAAA,EACoB,GAAGM,CAAA,EAC7CH,GAAoBI,CAAa,CACnC,EAMaC,EAAkB,IACtBR,EAAA,EChDT,MAAMS,WAAuBC,EAAM,CACjC,SAEA,YAAYC,EAAsB,CAChC,MAAMA,CAAY,EAClB,KAAK,QAAQ,CAAC,EAAE,OAAO,CACrB,SAAU,2CAAA,CACX,CACH,CACF,CAEA,IAAIC,EAA4B,KAKzB,MAAMC,EAAqB,IAAsB,CACtD,GAAI,CAACD,EAAI,CACP,MAAMR,EAASI,EAAA,EACfI,EAAK,IAAIH,GAAeL,EAAO,YAAY,CAC7C,CACA,OAAOQ,CACT,EAKME,EAAQ,IACPF,GACIC,EAAA,EASEE,EAAc,MAAOC,GAAwC,CACxE,MAAMC,EAA+B,CACnC,GAAGD,EACH,UAAW,IAAI,KAAA,EAAO,YAAA,EACtB,OAAQ,GACR,QAAS,GACT,YAAa,UACb,cAAe,CAAA,EAEjB,MAAMF,EAAA,EAAQ,SAAS,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C5CF,EAAS,wBAAwB,EACjCD,EAAW,EAAK,CAClB,CACF,GAEA,CACF,EAAG,CAACL,CAAM,CAAC,EAGXO,EAAAA,UAAU,IAAM,CACd,GAAI,CAACnM,GAAW,CAAC6L,EAAS,OAE1B,MAAMQ,EAAqB,IAAM,CAC/BR,EAAQ7L,CAAO,CACjB,EAEA,cAAO,iBAAiB,eAAgBqM,CAAkB,EAEnD,IAAM,CACX,OAAO,oBAAoB,eAAgBA,CAAkB,CAC/D,CACF,EAAG,CAACrM,EAAS6L,CAAO,CAAC,EAEjBG,EAEAM,EAAAA,IAAC,OAAI,MAAO,CACV,QAAS,OACT,eAAgB,SAChB,WAAY,SACZ,OAAQ,QACR,WAAY,sCAAA,EACX,SAAA,aAEH,EAIApN,GAAS,CAACc,EAEVsM,EAAAA,IAAC,OAAI,MAAO,CACV,QAAS,OACT,eAAgB,SAChB,WAAY,SACZ,OAAQ,QACR,WAAY,uCACZ,MAAO,SAAA,EAEN,YAAS,oBACZ,EAIGA,EAAAA,IAAAC,EAAAA,SAAA,CAAG,SAAAZ,EAAS3L,CAAO,EAAE,CAC9B,EC1CawM,GAAyB,SAA2B,CAE/D3M,EAAA,EAGAmL,GAAA,EAGA,KAAM,CAAE,uBAAAyB,CAAA,EAA2B3K,EAAqB,SAAA,EACxD,MAAM2K,EAAA,EAEN,QAAQ,IAAI,iCAAiC,CAC/C","x_google_ignoreList":[4,5,6,7,8,9,10,11]}
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../src/config/noticeConfig.ts","../src/utils/db.ts","../src/stores/messageQueueStore.ts","../src/hooks/useNoticeWindow.ts","../node_modules/@tauri-apps/api/external/tslib/tslib.es6.js","../node_modules/@tauri-apps/api/core.js","../node_modules/@tauri-apps/api/dpi.js","../node_modules/@tauri-apps/api/event.js","../node_modules/@tauri-apps/api/image.js","../node_modules/@tauri-apps/api/window.js","../node_modules/@tauri-apps/api/webview.js","../node_modules/@tauri-apps/api/webviewWindow.js","../src/utils/noticeWindow.ts","../src/hooks/useCloseNotice.ts","../src/hooks/useHideNotice.ts","../src/hooks/useHideAllNotices.ts","../src/hooks/useMessageQueue.ts","../src/components/NoticeLayout.tsx","../src/index.ts"],"sourcesContent":["import type { NoticeConfig } from '../types/message'\n\nconst CONFIG_STORAGE_KEY = 'tauri-notice-config'\n\n/**\n * Default configuration for notice windows\n */\nconst defaultConfig: NoticeConfig = {\n routePrefix: '/notice',\n databaseName: 'tauri-notice-db',\n defaultWidth: 400,\n defaultHeight: 300,\n}\n\n/**\n * Load config from localStorage\n */\nconst loadConfigFromStorage = (): NoticeConfig => {\n try {\n const stored = localStorage.getItem(CONFIG_STORAGE_KEY)\n if (stored) {\n return { ...defaultConfig, ...JSON.parse(stored) }\n }\n } catch (error) {\n console.warn('Failed to load config from localStorage:', error)\n }\n return defaultConfig\n}\n\n/**\n * Save config to localStorage\n */\nconst saveConfigToStorage = (config: NoticeConfig): void => {\n try {\n localStorage.setItem(CONFIG_STORAGE_KEY, JSON.stringify(config))\n } catch (error) {\n console.warn('Failed to save config to localStorage:', error)\n }\n}\n\n/**\n * Update notice window configuration\n * @param newConfig - Partial configuration to merge with current config\n */\nexport const setNoticeConfig = (newConfig: Partial<NoticeConfig>): void => {\n const currentConfig = loadConfigFromStorage()\n const updatedConfig = { ...currentConfig, ...newConfig }\n saveConfigToStorage(updatedConfig)\n}\n\n/**\n * Get current notice window configuration\n * @returns Current configuration object\n */\nexport const getNoticeConfig = (): NoticeConfig => {\n return loadConfigFromStorage()\n}\n\n","import Dexie, { type Table } from 'dexie'\nimport type { MessageType, StoredMessage } from '../types/message'\nimport { getNoticeConfig } from '../config/noticeConfig'\n\n/**\n * Dexie database for message persistence\n */\nclass NoticeDatabase extends Dexie {\n messages!: Table<StoredMessage, string>\n\n constructor(databaseName: string) {\n super(databaseName)\n this.version(1).stores({\n messages: 'id, queueStatus, queuePosition, timestamp',\n })\n }\n}\n\nlet db: NoticeDatabase | null = null\n\n/**\n * Initialize the database with the configured name\n */\nexport const initializeDatabase = (): NoticeDatabase => {\n if (!db) {\n const config = getNoticeConfig()\n db = new NoticeDatabase(config.databaseName)\n }\n return db\n}\n\n/**\n * Get the database instance\n */\nconst getDb = (): NoticeDatabase => {\n if (!db) {\n return initializeDatabase()\n }\n return db\n}\n\n/**\n * Save a new message to the database\n * @param message - Message to save\n */\nexport const saveMessage = async (message: MessageType): Promise<void> => {\n const storedMessage: StoredMessage = {\n ...message,\n timestamp: new Date().toISOString(),\n isRead: false,\n isShown: false,\n queueStatus: 'pending',\n queuePosition: 0,\n }\n await getDb().messages.put(storedMessage)\n}\n\n/**\n * Check if a message exists in the database\n * @param id - Message ID to check\n * @returns True if message exists\n */\nexport const hasMessage = async (id: string): Promise<boolean> => {\n const message = await getDb().messages.get(id)\n return !!message\n}\n\n/**\n * Check if a message was already shown\n * @param id - Message ID to check\n * @returns True if message was already shown (and should not be shown again)\n */\nexport const isMessageShown = async (id: string): Promise<boolean> => {\n const message = await getDb().messages.get(id)\n return message?.isShown === true || message?.queueStatus === 'shown'\n}\n\n/**\n * Get all pending messages sorted by queue position\n * @returns Array of pending messages\n */\nexport const getPendingMessages = async (): Promise<StoredMessage[]> => {\n return await getDb()\n .messages.where('queueStatus')\n .equals('pending')\n .sortBy('queuePosition')\n}\n\n/**\n * Update the queue status of a message\n * @param id - Message ID\n * @param status - New queue status\n */\nexport const updateQueueStatus = async (\n id: string,\n status: StoredMessage['queueStatus']\n): Promise<void> => {\n await getDb().messages.update(id, { queueStatus: status })\n}\n\n/**\n * Mark a message as shown\n * @param id - Message ID\n */\nexport const markAsShown = async (id: string): Promise<void> => {\n await getDb().messages.update(id, {\n queueStatus: 'shown',\n isShown: true,\n })\n}\n\n/**\n * Mark a message as hidden (server-triggered hide)\n * @param id - Message ID\n */\nexport const markAsHidden = async (id: string): Promise<void> => {\n await getDb().messages.update(id, {\n queueStatus: 'hidden',\n })\n}\n\n/**\n * Get a message by ID\n * @param id - Message ID\n * @returns The stored message or undefined\n */\nexport const getMessage = async (id: string): Promise<StoredMessage | undefined> => {\n return await getDb().messages.get(id)\n}\n\n/**\n * Clear all pending and showing messages\n */\nexport const clearPendingMessages = async (): Promise<void> => {\n await getDb()\n .messages.where('queueStatus')\n .anyOf(['pending', 'showing'])\n .delete()\n}\n\n/**\n * Update queue positions for multiple messages\n * @param messages - Array of messages with their positions\n */\nexport const updateQueuePositions = async (\n messages: Array<{ id: string; position: number }>\n): Promise<void> => {\n const updates = messages.map((msg) =>\n getDb().messages.update(msg.id, { queuePosition: msg.position })\n )\n await Promise.all(updates)\n}\n\n","import { create, StateCreator } from 'zustand'\nimport { syncTabs } from 'zustand-sync'\nimport type { MessageType } from '../types/message'\nimport {\n getPendingMessages,\n saveMessage,\n updateQueueStatus,\n clearPendingMessages,\n updateQueuePositions,\n hasMessage,\n isMessageShown,\n} from '../utils/db'\n\n/**\n * Message Queue Store State Interface\n */\ninterface MessageQueueState {\n // State\n queue: MessageType[]\n currentMessage: MessageType | null\n isProcessing: boolean\n initialized: boolean\n activeWindowIds: string[]\n\n // Actions\n enqueue: (message: MessageType) => Promise<void>\n dequeue: () => MessageType | null\n showNext: () => Promise<void>\n clearCurrent: () => void\n setCurrentMessage: (message: MessageType | null) => void\n setIsProcessing: (processing: boolean) => void\n setQueue: (queue: MessageType[]) => void\n initializeFromDatabase: () => Promise<void>\n persistQueue: () => Promise<void>\n clearOnLogout: () => Promise<void>\n addActiveWindow: (id: string) => void\n removeActiveWindow: (id: string) => void\n isWindowActive: (id: string) => boolean\n}\n\n/**\n * Zustand store with zustand-sync for cross-window state management\n */\nconst storeCreator: StateCreator<MessageQueueState> = (set, get) => ({\n // Initial state\n queue: [],\n currentMessage: null,\n isProcessing: false,\n initialized: false,\n activeWindowIds: [],\n\n // Enqueue a new message\n enqueue: async (message: MessageType) => {\n const state = get()\n \n // Reject messages that were already shown - they should never reappear\n const alreadyShown = await isMessageShown(message.id)\n if (alreadyShown) {\n console.log(`Message ${message.id} was already shown, skipping`)\n return\n }\n\n // Check if message already exists in database\n const exists = await hasMessage(message.id)\n if (!exists) {\n await saveMessage(message)\n }\n\n // Add to queue if not already present\n const alreadyInQueue = state.queue.some((m: MessageType) => m.id === message.id)\n if (!alreadyInQueue) {\n const newQueue = [...state.queue, message]\n set({ queue: newQueue })\n await get().persistQueue()\n }\n\n // Auto-show if not currently processing\n if (!state.isProcessing && !state.currentMessage) {\n await get().showNext()\n }\n },\n\n // Dequeue the next message\n dequeue: () => {\n const state = get()\n if (state.queue.length === 0) return null\n\n const [nextMessage, ...remainingQueue] = state.queue\n set({ queue: remainingQueue })\n return nextMessage\n },\n\n // Show the next message in queue\n showNext: async () => {\n const state = get()\n \n // Skip if already processing\n if (state.isProcessing) return\n\n const nextMessage = get().dequeue()\n if (!nextMessage) {\n set({ isProcessing: false, currentMessage: null })\n return\n }\n\n // Update state\n set({\n currentMessage: nextMessage,\n isProcessing: true,\n })\n\n // Update database status\n await updateQueueStatus(nextMessage.id, 'showing')\n await get().persistQueue()\n },\n\n // Clear current message and show next\n clearCurrent: () => {\n set({\n currentMessage: null,\n isProcessing: false,\n })\n\n // Auto-show next message\n const state = get()\n if (state.queue.length > 0) {\n get().showNext()\n }\n },\n\n // Set current message directly\n setCurrentMessage: (message: MessageType | null) => {\n set({ currentMessage: message })\n },\n\n // Set processing flag\n setIsProcessing: (processing: boolean) => {\n set({ isProcessing: processing })\n },\n\n // Set entire queue\n setQueue: (queue: MessageType[]) => {\n set({ queue })\n },\n\n // Initialize from database on startup\n initializeFromDatabase: async () => {\n const state = get()\n \n // Prevent duplicate initialization\n if (state.initialized) return\n\n set({ initialized: true })\n\n // Load pending messages from database\n const pendingMessages = await getPendingMessages()\n \n if (pendingMessages.length > 0) {\n set({ queue: pendingMessages })\n \n // Auto-show first message\n await get().showNext()\n }\n },\n\n // Persist queue to database\n persistQueue: async () => {\n const state = get()\n const positions = state.queue.map((msg: MessageType, index: number) => ({\n id: msg.id,\n position: index,\n }))\n await updateQueuePositions(positions)\n },\n\n // Clear all messages on logout\n clearOnLogout: async () => {\n set({\n queue: [],\n currentMessage: null,\n isProcessing: false,\n activeWindowIds: [],\n initialized: false,\n })\n await clearPendingMessages()\n },\n\n // Add active window ID\n addActiveWindow: (id: string) => {\n const state = get()\n const normalizedId = String(id)\n if (!state.activeWindowIds.includes(normalizedId)) {\n set({ activeWindowIds: [...state.activeWindowIds, normalizedId] })\n }\n },\n\n // Remove active window ID\n removeActiveWindow: (id: string) => {\n const state = get()\n const normalizedId = String(id)\n set({\n activeWindowIds: state.activeWindowIds.filter((wid: string) => wid !== normalizedId),\n })\n },\n\n // Check if window is active\n isWindowActive: (id: string) => {\n const state = get()\n const normalizedId = String(id)\n return state.activeWindowIds.includes(normalizedId)\n },\n})\n\nexport const useMessageQueueStore = create<MessageQueueState>()(\n syncTabs(storeCreator, {\n name: 'tauri-notice-queue',\n })\n)\n\n/**\n * Selectors for optimized subscriptions\n */\nexport const messageQueueSelectors = {\n queueLength: (state: MessageQueueState) => state.queue.length,\n currentMessage: (state: MessageQueueState) => state.currentMessage,\n isProcessing: (state: MessageQueueState) => state.isProcessing,\n queue: (state: MessageQueueState) => state.queue,\n}\n\n","import { useCallback } from 'react'\nimport type { MessageType } from '../types/message'\nimport { useMessageQueueStore } from '../stores/messageQueueStore'\n\n/**\n * Hook to open notice windows\n * @returns Object with showNotice function\n */\nexport const useNoticeWindow = () => {\n const enqueue = useMessageQueueStore((state) => state.enqueue)\n\n const showNotice = useCallback(\n async (message: MessageType) => {\n await enqueue(message)\n },\n [enqueue]\n )\n\n return { showNotice }\n}\n\n","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\n\r\nfunction __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nfunction __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\ntypeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\n\nexport { __classPrivateFieldGet, __classPrivateFieldSet };\n","import { __classPrivateFieldGet, __classPrivateFieldSet } from './external/tslib/tslib.es6.js';\n\n// Copyright 2019-2024 Tauri Programme within The Commons Conservancy\n// SPDX-License-Identifier: Apache-2.0\n// SPDX-License-Identifier: MIT\nvar _Channel_onmessage, _Channel_nextMessageIndex, _Channel_pendingMessages, _Channel_messageEndIndex, _Resource_rid;\n/**\n * Invoke your custom commands.\n *\n * This package is also accessible with `window.__TAURI__.core` when [`app.withGlobalTauri`](https://v2.tauri.app/reference/config/#withglobaltauri) in `tauri.conf.json` is set to `true`.\n * @module\n */\n/**\n * A key to be used to implement a special function\n * on your types that define how your type should be serialized\n * when passing across the IPC.\n * @example\n * Given a type in Rust that looks like this\n * ```rs\n * #[derive(serde::Serialize, serde::Deserialize)\n * enum UserId {\n * String(String),\n * Number(u32),\n * }\n * ```\n * `UserId::String(\"id\")` would be serialized into `{ String: \"id\" }`\n * and so we need to pass the same structure back to Rust\n * ```ts\n * import { SERIALIZE_TO_IPC_FN } from \"@tauri-apps/api/core\"\n *\n * class UserIdString {\n * id\n * constructor(id) {\n * this.id = id\n * }\n *\n * [SERIALIZE_TO_IPC_FN]() {\n * return { String: this.id }\n * }\n * }\n *\n * class UserIdNumber {\n * id\n * constructor(id) {\n * this.id = id\n * }\n *\n * [SERIALIZE_TO_IPC_FN]() {\n * return { Number: this.id }\n * }\n * }\n *\n * type UserId = UserIdString | UserIdNumber\n * ```\n *\n */\n// if this value changes, make sure to update it in:\n// 1. ipc.js\n// 2. process-ipc-message-fn.js\nconst SERIALIZE_TO_IPC_FN = '__TAURI_TO_IPC_KEY__';\n/**\n * Stores the callback in a known location, and returns an identifier that can be passed to the backend.\n * The backend uses the identifier to `eval()` the callback.\n *\n * @return An unique identifier associated with the callback function.\n *\n * @since 1.0.0\n */\nfunction transformCallback(\n// TODO: Make this not optional in v3\ncallback, once = false) {\n return window.__TAURI_INTERNALS__.transformCallback(callback, once);\n}\nclass Channel {\n constructor(onmessage) {\n _Channel_onmessage.set(this, void 0);\n // the index is used as a mechanism to preserve message order\n _Channel_nextMessageIndex.set(this, 0);\n _Channel_pendingMessages.set(this, []);\n _Channel_messageEndIndex.set(this, void 0);\n __classPrivateFieldSet(this, _Channel_onmessage, onmessage || (() => { }), \"f\");\n this.id = transformCallback((rawMessage) => {\n const index = rawMessage.index;\n if ('end' in rawMessage) {\n if (index == __classPrivateFieldGet(this, _Channel_nextMessageIndex, \"f\")) {\n this.cleanupCallback();\n }\n else {\n __classPrivateFieldSet(this, _Channel_messageEndIndex, index, \"f\");\n }\n return;\n }\n const message = rawMessage.message;\n // Process the message if we're at the right order\n if (index == __classPrivateFieldGet(this, _Channel_nextMessageIndex, \"f\")) {\n __classPrivateFieldGet(this, _Channel_onmessage, \"f\").call(this, message);\n __classPrivateFieldSet(this, _Channel_nextMessageIndex, __classPrivateFieldGet(this, _Channel_nextMessageIndex, \"f\") + 1, \"f\");\n // process pending messages\n while (__classPrivateFieldGet(this, _Channel_nextMessageIndex, \"f\") in __classPrivateFieldGet(this, _Channel_pendingMessages, \"f\")) {\n const message = __classPrivateFieldGet(this, _Channel_pendingMessages, \"f\")[__classPrivateFieldGet(this, _Channel_nextMessageIndex, \"f\")];\n __classPrivateFieldGet(this, _Channel_onmessage, \"f\").call(this, message);\n // eslint-disable-next-line @typescript-eslint/no-array-delete\n delete __classPrivateFieldGet(this, _Channel_pendingMessages, \"f\")[__classPrivateFieldGet(this, _Channel_nextMessageIndex, \"f\")];\n __classPrivateFieldSet(this, _Channel_nextMessageIndex, __classPrivateFieldGet(this, _Channel_nextMessageIndex, \"f\") + 1, \"f\");\n }\n if (__classPrivateFieldGet(this, _Channel_nextMessageIndex, \"f\") === __classPrivateFieldGet(this, _Channel_messageEndIndex, \"f\")) {\n this.cleanupCallback();\n }\n }\n // Queue the message if we're not\n else {\n // eslint-disable-next-line security/detect-object-injection\n __classPrivateFieldGet(this, _Channel_pendingMessages, \"f\")[index] = message;\n }\n });\n }\n cleanupCallback() {\n window.__TAURI_INTERNALS__.unregisterCallback(this.id);\n }\n set onmessage(handler) {\n __classPrivateFieldSet(this, _Channel_onmessage, handler, \"f\");\n }\n get onmessage() {\n return __classPrivateFieldGet(this, _Channel_onmessage, \"f\");\n }\n [(_Channel_onmessage = new WeakMap(), _Channel_nextMessageIndex = new WeakMap(), _Channel_pendingMessages = new WeakMap(), _Channel_messageEndIndex = new WeakMap(), SERIALIZE_TO_IPC_FN)]() {\n return `__CHANNEL__:${this.id}`;\n }\n toJSON() {\n // eslint-disable-next-line security/detect-object-injection\n return this[SERIALIZE_TO_IPC_FN]();\n }\n}\nclass PluginListener {\n constructor(plugin, event, channelId) {\n this.plugin = plugin;\n this.event = event;\n this.channelId = channelId;\n }\n async unregister() {\n return invoke(`plugin:${this.plugin}|remove_listener`, {\n event: this.event,\n channelId: this.channelId\n });\n }\n}\n/**\n * Adds a listener to a plugin event.\n *\n * @returns The listener object to stop listening to the events.\n *\n * @since 2.0.0\n */\nasync function addPluginListener(plugin, event, cb) {\n const handler = new Channel(cb);\n try {\n return invoke(`plugin:${plugin}|register_listener`, {\n event,\n handler\n }).then(() => new PluginListener(plugin, event, handler.id));\n }\n catch {\n // TODO(v3): remove this fallback\n // note: we must try with camelCase here for backwards compatibility\n return invoke(`plugin:${plugin}|registerListener`, { event, handler }).then(() => new PluginListener(plugin, event, handler.id));\n }\n}\n/**\n * Get permission state for a plugin.\n *\n * This should be used by plugin authors to wrap their actual implementation.\n */\nasync function checkPermissions(plugin) {\n return invoke(`plugin:${plugin}|check_permissions`);\n}\n/**\n * Request permissions.\n *\n * This should be used by plugin authors to wrap their actual implementation.\n */\nasync function requestPermissions(plugin) {\n return invoke(`plugin:${plugin}|request_permissions`);\n}\n/**\n * Sends a message to the backend.\n * @example\n * ```typescript\n * import { invoke } from '@tauri-apps/api/core';\n * await invoke('login', { user: 'tauri', password: 'poiwe3h4r5ip3yrhtew9ty' });\n * ```\n *\n * @param cmd The command name.\n * @param args The optional arguments to pass to the command.\n * @param options The request options.\n * @return A promise resolving or rejecting to the backend response.\n *\n * @since 1.0.0\n */\nasync function invoke(cmd, args = {}, options) {\n return window.__TAURI_INTERNALS__.invoke(cmd, args, options);\n}\n/**\n * Convert a device file path to an URL that can be loaded by the webview.\n * Note that `asset:` and `http://asset.localhost` must be added to [`app.security.csp`](https://v2.tauri.app/reference/config/#csp-1) in `tauri.conf.json`.\n * Example CSP value: `\"csp\": \"default-src 'self' ipc: http://ipc.localhost; img-src 'self' asset: http://asset.localhost\"` to use the asset protocol on image sources.\n *\n * Additionally, `\"enable\" : \"true\"` must be added to [`app.security.assetProtocol`](https://v2.tauri.app/reference/config/#assetprotocolconfig)\n * in `tauri.conf.json` and its access scope must be defined on the `scope` array on the same `assetProtocol` object.\n *\n * @param filePath The file path.\n * @param protocol The protocol to use. Defaults to `asset`. You only need to set this when using a custom protocol.\n * @example\n * ```typescript\n * import { appDataDir, join } from '@tauri-apps/api/path';\n * import { convertFileSrc } from '@tauri-apps/api/core';\n * const appDataDirPath = await appDataDir();\n * const filePath = await join(appDataDirPath, 'assets/video.mp4');\n * const assetUrl = convertFileSrc(filePath);\n *\n * const video = document.getElementById('my-video');\n * const source = document.createElement('source');\n * source.type = 'video/mp4';\n * source.src = assetUrl;\n * video.appendChild(source);\n * video.load();\n * ```\n *\n * @return the URL that can be used as source on the webview.\n *\n * @since 1.0.0\n */\nfunction convertFileSrc(filePath, protocol = 'asset') {\n return window.__TAURI_INTERNALS__.convertFileSrc(filePath, protocol);\n}\n/**\n * A rust-backed resource stored through `tauri::Manager::resources_table` API.\n *\n * The resource lives in the main process and does not exist\n * in the Javascript world, and thus will not be cleaned up automatiacally\n * except on application exit. If you want to clean it up early, call {@linkcode Resource.close}\n *\n * @example\n * ```typescript\n * import { Resource, invoke } from '@tauri-apps/api/core';\n * export class DatabaseHandle extends Resource {\n * static async open(path: string): Promise<DatabaseHandle> {\n * const rid: number = await invoke('open_db', { path });\n * return new DatabaseHandle(rid);\n * }\n *\n * async execute(sql: string): Promise<void> {\n * await invoke('execute_sql', { rid: this.rid, sql });\n * }\n * }\n * ```\n */\nclass Resource {\n get rid() {\n return __classPrivateFieldGet(this, _Resource_rid, \"f\");\n }\n constructor(rid) {\n _Resource_rid.set(this, void 0);\n __classPrivateFieldSet(this, _Resource_rid, rid, \"f\");\n }\n /**\n * Destroys and cleans up this resource from memory.\n * **You should not call any method on this object anymore and should drop any reference to it.**\n */\n async close() {\n return invoke('plugin:resources|close', {\n rid: this.rid\n });\n }\n}\n_Resource_rid = new WeakMap();\nfunction isTauri() {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n return !!(globalThis || window).isTauri;\n}\n\nexport { Channel, PluginListener, Resource, SERIALIZE_TO_IPC_FN, addPluginListener, checkPermissions, convertFileSrc, invoke, isTauri, requestPermissions, transformCallback };\n","import { SERIALIZE_TO_IPC_FN } from './core.js';\n\n// Copyright 2019-2024 Tauri Programme within The Commons Conservancy\n// SPDX-License-Identifier: Apache-2.0\n// SPDX-License-Identifier: MIT\n/**\n * A size represented in logical pixels.\n * Logical pixels are scaled according to the window's DPI scale.\n * Most browser APIs (i.e. `MouseEvent`'s `clientX`) will return logical pixels.\n *\n * For logical-pixel-based position, see {@linkcode LogicalPosition}.\n *\n * @since 2.0.0\n */\nclass LogicalSize {\n constructor(...args) {\n this.type = 'Logical';\n if (args.length === 1) {\n if ('Logical' in args[0]) {\n this.width = args[0].Logical.width;\n this.height = args[0].Logical.height;\n }\n else {\n this.width = args[0].width;\n this.height = args[0].height;\n }\n }\n else {\n this.width = args[0];\n this.height = args[1];\n }\n }\n /**\n * Converts the logical size to a physical one.\n * @example\n * ```typescript\n * import { LogicalSize } from '@tauri-apps/api/dpi';\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n *\n * const appWindow = getCurrentWindow();\n * const factor = await appWindow.scaleFactor();\n * const size = new LogicalSize(400, 500);\n * const physical = size.toPhysical(factor);\n * ```\n *\n * @since 2.0.0\n */\n toPhysical(scaleFactor) {\n return new PhysicalSize(this.width * scaleFactor, this.height * scaleFactor);\n }\n [SERIALIZE_TO_IPC_FN]() {\n return {\n width: this.width,\n height: this.height\n };\n }\n toJSON() {\n // eslint-disable-next-line security/detect-object-injection\n return this[SERIALIZE_TO_IPC_FN]();\n }\n}\n/**\n * A size represented in physical pixels.\n *\n * Physical pixels represent actual screen pixels, and are DPI-independent.\n * For high-DPI windows, this means that any point in the window on the screen\n * will have a different position in logical pixels (@linkcode LogicalSize).\n *\n * For physical-pixel-based position, see {@linkcode PhysicalPosition}.\n *\n * @since 2.0.0\n */\nclass PhysicalSize {\n constructor(...args) {\n this.type = 'Physical';\n if (args.length === 1) {\n if ('Physical' in args[0]) {\n this.width = args[0].Physical.width;\n this.height = args[0].Physical.height;\n }\n else {\n this.width = args[0].width;\n this.height = args[0].height;\n }\n }\n else {\n this.width = args[0];\n this.height = args[1];\n }\n }\n /**\n * Converts the physical size to a logical one.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const appWindow = getCurrentWindow();\n * const factor = await appWindow.scaleFactor();\n * const size = await appWindow.innerSize(); // PhysicalSize\n * const logical = size.toLogical(factor);\n * ```\n */\n toLogical(scaleFactor) {\n return new LogicalSize(this.width / scaleFactor, this.height / scaleFactor);\n }\n [SERIALIZE_TO_IPC_FN]() {\n return {\n width: this.width,\n height: this.height\n };\n }\n toJSON() {\n // eslint-disable-next-line security/detect-object-injection\n return this[SERIALIZE_TO_IPC_FN]();\n }\n}\n/**\n * A size represented either in physical or in logical pixels.\n *\n * This type is basically a union type of {@linkcode LogicalSize} and {@linkcode PhysicalSize}\n * but comes in handy when using `tauri::Size` in Rust as an argument to a command, as this class\n * automatically serializes into a valid format so it can be deserialized correctly into `tauri::Size`\n *\n * So instead of\n * ```typescript\n * import { invoke } from '@tauri-apps/api/core';\n * import { LogicalSize, PhysicalSize } from '@tauri-apps/api/dpi';\n *\n * const size: LogicalSize | PhysicalSize = someFunction(); // where someFunction returns either LogicalSize or PhysicalSize\n * const validSize = size instanceof LogicalSize\n * ? { Logical: { width: size.width, height: size.height } }\n * : { Physical: { width: size.width, height: size.height } }\n * await invoke(\"do_something_with_size\", { size: validSize });\n * ```\n *\n * You can just use {@linkcode Size}\n * ```typescript\n * import { invoke } from '@tauri-apps/api/core';\n * import { LogicalSize, PhysicalSize, Size } from '@tauri-apps/api/dpi';\n *\n * const size: LogicalSize | PhysicalSize = someFunction(); // where someFunction returns either LogicalSize or PhysicalSize\n * const validSize = new Size(size);\n * await invoke(\"do_something_with_size\", { size: validSize });\n * ```\n *\n * @since 2.1.0\n */\nclass Size {\n constructor(size) {\n this.size = size;\n }\n toLogical(scaleFactor) {\n return this.size instanceof LogicalSize\n ? this.size\n : this.size.toLogical(scaleFactor);\n }\n toPhysical(scaleFactor) {\n return this.size instanceof PhysicalSize\n ? this.size\n : this.size.toPhysical(scaleFactor);\n }\n [SERIALIZE_TO_IPC_FN]() {\n return {\n [`${this.size.type}`]: {\n width: this.size.width,\n height: this.size.height\n }\n };\n }\n toJSON() {\n // eslint-disable-next-line security/detect-object-injection\n return this[SERIALIZE_TO_IPC_FN]();\n }\n}\n/**\n * A position represented in logical pixels.\n * For an explanation of what logical pixels are, see description of {@linkcode LogicalSize}.\n *\n * @since 2.0.0\n */\nclass LogicalPosition {\n constructor(...args) {\n this.type = 'Logical';\n if (args.length === 1) {\n if ('Logical' in args[0]) {\n this.x = args[0].Logical.x;\n this.y = args[0].Logical.y;\n }\n else {\n this.x = args[0].x;\n this.y = args[0].y;\n }\n }\n else {\n this.x = args[0];\n this.y = args[1];\n }\n }\n /**\n * Converts the logical position to a physical one.\n * @example\n * ```typescript\n * import { LogicalPosition } from '@tauri-apps/api/dpi';\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n *\n * const appWindow = getCurrentWindow();\n * const factor = await appWindow.scaleFactor();\n * const position = new LogicalPosition(400, 500);\n * const physical = position.toPhysical(factor);\n * ```\n *\n * @since 2.0.0\n */\n toPhysical(scaleFactor) {\n return new PhysicalPosition(this.x * scaleFactor, this.y * scaleFactor);\n }\n [SERIALIZE_TO_IPC_FN]() {\n return {\n x: this.x,\n y: this.y\n };\n }\n toJSON() {\n // eslint-disable-next-line security/detect-object-injection\n return this[SERIALIZE_TO_IPC_FN]();\n }\n}\n/**\n * A position represented in physical pixels.\n *\n * For an explanation of what physical pixels are, see description of {@linkcode PhysicalSize}.\n *\n * @since 2.0.0\n */\nclass PhysicalPosition {\n constructor(...args) {\n this.type = 'Physical';\n if (args.length === 1) {\n if ('Physical' in args[0]) {\n this.x = args[0].Physical.x;\n this.y = args[0].Physical.y;\n }\n else {\n this.x = args[0].x;\n this.y = args[0].y;\n }\n }\n else {\n this.x = args[0];\n this.y = args[1];\n }\n }\n /**\n * Converts the physical position to a logical one.\n * @example\n * ```typescript\n * import { PhysicalPosition } from '@tauri-apps/api/dpi';\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n *\n * const appWindow = getCurrentWindow();\n * const factor = await appWindow.scaleFactor();\n * const position = new PhysicalPosition(400, 500);\n * const physical = position.toLogical(factor);\n * ```\n *\n * @since 2.0.0\n */\n toLogical(scaleFactor) {\n return new LogicalPosition(this.x / scaleFactor, this.y / scaleFactor);\n }\n [SERIALIZE_TO_IPC_FN]() {\n return {\n x: this.x,\n y: this.y\n };\n }\n toJSON() {\n // eslint-disable-next-line security/detect-object-injection\n return this[SERIALIZE_TO_IPC_FN]();\n }\n}\n/**\n * A position represented either in physical or in logical pixels.\n *\n * This type is basically a union type of {@linkcode LogicalSize} and {@linkcode PhysicalSize}\n * but comes in handy when using `tauri::Position` in Rust as an argument to a command, as this class\n * automatically serializes into a valid format so it can be deserialized correctly into `tauri::Position`\n *\n * So instead of\n * ```typescript\n * import { invoke } from '@tauri-apps/api/core';\n * import { LogicalPosition, PhysicalPosition } from '@tauri-apps/api/dpi';\n *\n * const position: LogicalPosition | PhysicalPosition = someFunction(); // where someFunction returns either LogicalPosition or PhysicalPosition\n * const validPosition = position instanceof LogicalPosition\n * ? { Logical: { x: position.x, y: position.y } }\n * : { Physical: { x: position.x, y: position.y } }\n * await invoke(\"do_something_with_position\", { position: validPosition });\n * ```\n *\n * You can just use {@linkcode Position}\n * ```typescript\n * import { invoke } from '@tauri-apps/api/core';\n * import { LogicalPosition, PhysicalPosition, Position } from '@tauri-apps/api/dpi';\n *\n * const position: LogicalPosition | PhysicalPosition = someFunction(); // where someFunction returns either LogicalPosition or PhysicalPosition\n * const validPosition = new Position(position);\n * await invoke(\"do_something_with_position\", { position: validPosition });\n * ```\n *\n * @since 2.1.0\n */\nclass Position {\n constructor(position) {\n this.position = position;\n }\n toLogical(scaleFactor) {\n return this.position instanceof LogicalPosition\n ? this.position\n : this.position.toLogical(scaleFactor);\n }\n toPhysical(scaleFactor) {\n return this.position instanceof PhysicalPosition\n ? this.position\n : this.position.toPhysical(scaleFactor);\n }\n [SERIALIZE_TO_IPC_FN]() {\n return {\n [`${this.position.type}`]: {\n x: this.position.x,\n y: this.position.y\n }\n };\n }\n toJSON() {\n // eslint-disable-next-line security/detect-object-injection\n return this[SERIALIZE_TO_IPC_FN]();\n }\n}\n\nexport { LogicalPosition, LogicalSize, PhysicalPosition, PhysicalSize, Position, Size };\n","import { invoke, transformCallback } from './core.js';\n\n// Copyright 2019-2024 Tauri Programme within The Commons Conservancy\n// SPDX-License-Identifier: Apache-2.0\n// SPDX-License-Identifier: MIT\n/**\n * The event system allows you to emit events to the backend and listen to events from it.\n *\n * This package is also accessible with `window.__TAURI__.event` when [`app.withGlobalTauri`](https://v2.tauri.app/reference/config/#withglobaltauri) in `tauri.conf.json` is set to `true`.\n * @module\n */\n/**\n * @since 1.1.0\n */\nvar TauriEvent;\n(function (TauriEvent) {\n TauriEvent[\"WINDOW_RESIZED\"] = \"tauri://resize\";\n TauriEvent[\"WINDOW_MOVED\"] = \"tauri://move\";\n TauriEvent[\"WINDOW_CLOSE_REQUESTED\"] = \"tauri://close-requested\";\n TauriEvent[\"WINDOW_DESTROYED\"] = \"tauri://destroyed\";\n TauriEvent[\"WINDOW_FOCUS\"] = \"tauri://focus\";\n TauriEvent[\"WINDOW_BLUR\"] = \"tauri://blur\";\n TauriEvent[\"WINDOW_SCALE_FACTOR_CHANGED\"] = \"tauri://scale-change\";\n TauriEvent[\"WINDOW_THEME_CHANGED\"] = \"tauri://theme-changed\";\n TauriEvent[\"WINDOW_CREATED\"] = \"tauri://window-created\";\n TauriEvent[\"WEBVIEW_CREATED\"] = \"tauri://webview-created\";\n TauriEvent[\"DRAG_ENTER\"] = \"tauri://drag-enter\";\n TauriEvent[\"DRAG_OVER\"] = \"tauri://drag-over\";\n TauriEvent[\"DRAG_DROP\"] = \"tauri://drag-drop\";\n TauriEvent[\"DRAG_LEAVE\"] = \"tauri://drag-leave\";\n})(TauriEvent || (TauriEvent = {}));\n/**\n * Unregister the event listener associated with the given name and id.\n *\n * @ignore\n * @param event The event name\n * @param eventId Event identifier\n * @returns\n */\nasync function _unlisten(event, eventId) {\n window.__TAURI_EVENT_PLUGIN_INTERNALS__.unregisterListener(event, eventId);\n await invoke('plugin:event|unlisten', {\n event,\n eventId\n });\n}\n/**\n * Listen to an emitted event to any {@link EventTarget|target}.\n *\n * @example\n * ```typescript\n * import { listen } from '@tauri-apps/api/event';\n * const unlisten = await listen<string>('error', (event) => {\n * console.log(`Got error, payload: ${event.payload}`);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param handler Event handler callback.\n * @param options Event listening options.\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n *\n * @since 1.0.0\n */\nasync function listen(event, handler, options) {\n var _a;\n const target = typeof (options === null || options === void 0 ? void 0 : options.target) === 'string'\n ? { kind: 'AnyLabel', label: options.target }\n : ((_a = options === null || options === void 0 ? void 0 : options.target) !== null && _a !== void 0 ? _a : { kind: 'Any' });\n return invoke('plugin:event|listen', {\n event,\n target,\n handler: transformCallback(handler)\n }).then((eventId) => {\n return async () => _unlisten(event, eventId);\n });\n}\n/**\n * Listens once to an emitted event to any {@link EventTarget|target}.\n *\n * @example\n * ```typescript\n * import { once } from '@tauri-apps/api/event';\n * interface LoadedPayload {\n * loggedIn: boolean,\n * token: string\n * }\n * const unlisten = await once<LoadedPayload>('loaded', (event) => {\n * console.log(`App is loaded, loggedIn: ${event.payload.loggedIn}, token: ${event.payload.token}`);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param handler Event handler callback.\n * @param options Event listening options.\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n *\n * @since 1.0.0\n */\nasync function once(event, handler, options) {\n return listen(event, (eventData) => {\n void _unlisten(event, eventData.id);\n handler(eventData);\n }, options);\n}\n/**\n * Emits an event to all {@link EventTarget|targets}.\n *\n * @example\n * ```typescript\n * import { emit } from '@tauri-apps/api/event';\n * await emit('frontend-loaded', { loggedIn: true, token: 'authToken' });\n * ```\n *\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param payload Event payload.\n *\n * @since 1.0.0\n */\nasync function emit(event, payload) {\n await invoke('plugin:event|emit', {\n event,\n payload\n });\n}\n/**\n * Emits an event to all {@link EventTarget|targets} matching the given target.\n *\n * @example\n * ```typescript\n * import { emitTo } from '@tauri-apps/api/event';\n * await emitTo('main', 'frontend-loaded', { loggedIn: true, token: 'authToken' });\n * ```\n *\n * @param target Label of the target Window/Webview/WebviewWindow or raw {@link EventTarget} object.\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param payload Event payload.\n *\n * @since 2.0.0\n */\nasync function emitTo(target, event, payload) {\n const eventTarget = typeof target === 'string' ? { kind: 'AnyLabel', label: target } : target;\n await invoke('plugin:event|emit_to', {\n target: eventTarget,\n event,\n payload\n });\n}\n\nexport { TauriEvent, emit, emitTo, listen, once };\n","import { Resource, invoke } from './core.js';\n\n// Copyright 2019-2024 Tauri Programme within The Commons Conservancy\n// SPDX-License-Identifier: Apache-2.0\n// SPDX-License-Identifier: MIT\n/** An RGBA Image in row-major order from top to bottom. */\nclass Image extends Resource {\n /**\n * Creates an Image from a resource ID. For internal use only.\n *\n * @ignore\n */\n constructor(rid) {\n super(rid);\n }\n /** Creates a new Image using RGBA data, in row-major order from top to bottom, and with specified width and height. */\n static async new(rgba, width, height) {\n return invoke('plugin:image|new', {\n rgba: transformImage(rgba),\n width,\n height\n }).then((rid) => new Image(rid));\n }\n /**\n * Creates a new image using the provided bytes by inferring the file format.\n * If the format is known, prefer [@link Image.fromPngBytes] or [@link Image.fromIcoBytes].\n *\n * Only `ico` and `png` are supported (based on activated feature flag).\n *\n * Note that you need the `image-ico` or `image-png` Cargo features to use this API.\n * To enable it, change your Cargo.toml file:\n * ```toml\n * [dependencies]\n * tauri = { version = \"...\", features = [\"...\", \"image-png\"] }\n * ```\n */\n static async fromBytes(bytes) {\n return invoke('plugin:image|from_bytes', {\n bytes: transformImage(bytes)\n }).then((rid) => new Image(rid));\n }\n /**\n * Creates a new image using the provided path.\n *\n * Only `ico` and `png` are supported (based on activated feature flag).\n *\n * Note that you need the `image-ico` or `image-png` Cargo features to use this API.\n * To enable it, change your Cargo.toml file:\n * ```toml\n * [dependencies]\n * tauri = { version = \"...\", features = [\"...\", \"image-png\"] }\n * ```\n */\n static async fromPath(path) {\n return invoke('plugin:image|from_path', { path }).then((rid) => new Image(rid));\n }\n /** Returns the RGBA data for this image, in row-major order from top to bottom. */\n async rgba() {\n return invoke('plugin:image|rgba', {\n rid: this.rid\n }).then((buffer) => new Uint8Array(buffer));\n }\n /** Returns the size of this image. */\n async size() {\n return invoke('plugin:image|size', { rid: this.rid });\n }\n}\n/**\n * Transforms image from various types into a type acceptable by Rust.\n *\n * See [tauri::image::JsImage](https://docs.rs/tauri/2/tauri/image/enum.JsImage.html) for more information.\n * Note the API signature is not stable and might change.\n */\nfunction transformImage(image) {\n const ret = image == null\n ? null\n : typeof image === 'string'\n ? image\n : image instanceof Image\n ? image.rid\n : image;\n return ret;\n}\n\nexport { Image, transformImage };\n","import { PhysicalPosition, PhysicalSize, Size, Position } from './dpi.js';\nexport { LogicalPosition, LogicalSize } from './dpi.js';\nimport { listen, once, emit, emitTo, TauriEvent } from './event.js';\nimport { invoke } from './core.js';\nimport { transformImage } from './image.js';\n\n// Copyright 2019-2024 Tauri Programme within The Commons Conservancy\n// SPDX-License-Identifier: Apache-2.0\n// SPDX-License-Identifier: MIT\n/**\n * Provides APIs to create windows, communicate with other windows and manipulate the current window.\n *\n * #### Window events\n *\n * Events can be listened to using {@link Window.listen}:\n * ```typescript\n * import { getCurrentWindow } from \"@tauri-apps/api/window\";\n * getCurrentWindow().listen(\"my-window-event\", ({ event, payload }) => { });\n * ```\n *\n * @module\n */\n/**\n * Attention type to request on a window.\n *\n * @since 1.0.0\n */\nvar UserAttentionType;\n(function (UserAttentionType) {\n /**\n * #### Platform-specific\n * - **macOS:** Bounces the dock icon until the application is in focus.\n * - **Windows:** Flashes both the window and the taskbar button until the application is in focus.\n */\n UserAttentionType[UserAttentionType[\"Critical\"] = 1] = \"Critical\";\n /**\n * #### Platform-specific\n * - **macOS:** Bounces the dock icon once.\n * - **Windows:** Flashes the taskbar button until the application is in focus.\n */\n UserAttentionType[UserAttentionType[\"Informational\"] = 2] = \"Informational\";\n})(UserAttentionType || (UserAttentionType = {}));\nclass CloseRequestedEvent {\n constructor(event) {\n this._preventDefault = false;\n this.event = event.event;\n this.id = event.id;\n }\n preventDefault() {\n this._preventDefault = true;\n }\n isPreventDefault() {\n return this._preventDefault;\n }\n}\nvar ProgressBarStatus;\n(function (ProgressBarStatus) {\n /**\n * Hide progress bar.\n */\n ProgressBarStatus[\"None\"] = \"none\";\n /**\n * Normal state.\n */\n ProgressBarStatus[\"Normal\"] = \"normal\";\n /**\n * Indeterminate state. **Treated as Normal on Linux and macOS**\n */\n ProgressBarStatus[\"Indeterminate\"] = \"indeterminate\";\n /**\n * Paused state. **Treated as Normal on Linux**\n */\n ProgressBarStatus[\"Paused\"] = \"paused\";\n /**\n * Error state. **Treated as Normal on linux**\n */\n ProgressBarStatus[\"Error\"] = \"error\";\n})(ProgressBarStatus || (ProgressBarStatus = {}));\n/**\n * Get an instance of `Window` for the current window.\n *\n * @since 1.0.0\n */\nfunction getCurrentWindow() {\n return new Window(window.__TAURI_INTERNALS__.metadata.currentWindow.label, {\n // @ts-expect-error `skip` is not defined in the public API but it is handled by the constructor\n skip: true\n });\n}\n/**\n * Gets a list of instances of `Window` for all available windows.\n *\n * @since 1.0.0\n */\nasync function getAllWindows() {\n return invoke('plugin:window|get_all_windows').then((windows) => windows.map((w) => new Window(w, {\n // @ts-expect-error `skip` is not defined in the public API but it is handled by the constructor\n skip: true\n })));\n}\n/** @ignore */\n// events that are emitted right here instead of by the created window\nconst localTauriEvents = ['tauri://created', 'tauri://error'];\n/**\n * Create new window or get a handle to an existing one.\n *\n * Windows are identified by a *label* a unique identifier that can be used to reference it later.\n * It may only contain alphanumeric characters `a-zA-Z` plus the following special characters `-`, `/`, `:` and `_`.\n *\n * @example\n * ```typescript\n * import { Window } from \"@tauri-apps/api/window\"\n *\n * const appWindow = new Window('theUniqueLabel');\n *\n * appWindow.once('tauri://created', function () {\n * // window successfully created\n * });\n * appWindow.once('tauri://error', function (e) {\n * // an error happened creating the window\n * });\n *\n * // emit an event to the backend\n * await appWindow.emit(\"some-event\", \"data\");\n * // listen to an event from the backend\n * const unlisten = await appWindow.listen(\"event-name\", e => {});\n * unlisten();\n * ```\n *\n * @since 2.0.0\n */\nclass Window {\n /**\n * Creates a new Window.\n * @example\n * ```typescript\n * import { Window } from '@tauri-apps/api/window';\n * const appWindow = new Window('my-label');\n * appWindow.once('tauri://created', function () {\n * // window successfully created\n * });\n * appWindow.once('tauri://error', function (e) {\n * // an error happened creating the window\n * });\n * ```\n *\n * @param label The unique window label. Must be alphanumeric: `a-zA-Z-/:_`.\n * @returns The {@link Window} instance to communicate with the window.\n */\n constructor(label, options = {}) {\n var _a;\n this.label = label;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n this.listeners = Object.create(null);\n // @ts-expect-error `skip` is not a public API so it is not defined in WindowOptions\n if (!(options === null || options === void 0 ? void 0 : options.skip)) {\n invoke('plugin:window|create', {\n options: {\n ...options,\n parent: typeof options.parent === 'string'\n ? options.parent\n : (_a = options.parent) === null || _a === void 0 ? void 0 : _a.label,\n label\n }\n })\n .then(async () => this.emit('tauri://created'))\n .catch(async (e) => this.emit('tauri://error', e));\n }\n }\n /**\n * Gets the Window associated with the given label.\n * @example\n * ```typescript\n * import { Window } from '@tauri-apps/api/window';\n * const mainWindow = Window.getByLabel('main');\n * ```\n *\n * @param label The window label.\n * @returns The Window instance to communicate with the window or null if the window doesn't exist.\n */\n static async getByLabel(label) {\n var _a;\n return (_a = (await getAllWindows()).find((w) => w.label === label)) !== null && _a !== void 0 ? _a : null;\n }\n /**\n * Get an instance of `Window` for the current window.\n */\n static getCurrent() {\n return getCurrentWindow();\n }\n /**\n * Gets a list of instances of `Window` for all available windows.\n */\n static async getAll() {\n return getAllWindows();\n }\n /**\n * Gets the focused window.\n * @example\n * ```typescript\n * import { Window } from '@tauri-apps/api/window';\n * const focusedWindow = Window.getFocusedWindow();\n * ```\n *\n * @returns The Window instance or `undefined` if there is not any focused window.\n */\n static async getFocusedWindow() {\n for (const w of await getAllWindows()) {\n if (await w.isFocused()) {\n return w;\n }\n }\n return null;\n }\n /**\n * Listen to an emitted event on this window.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const unlisten = await getCurrentWindow().listen<string>('state-changed', (event) => {\n * console.log(`Got error: ${payload}`);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param handler Event handler.\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n */\n async listen(event, handler) {\n if (this._handleTauriEvent(event, handler)) {\n return () => {\n // eslint-disable-next-line security/detect-object-injection\n const listeners = this.listeners[event];\n listeners.splice(listeners.indexOf(handler), 1);\n };\n }\n return listen(event, handler, {\n target: { kind: 'Window', label: this.label }\n });\n }\n /**\n * Listen to an emitted event on this window only once.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const unlisten = await getCurrentWindow().once<null>('initialized', (event) => {\n * console.log(`Window initialized!`);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param handler Event handler.\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n */\n async once(event, handler) {\n if (this._handleTauriEvent(event, handler)) {\n return () => {\n // eslint-disable-next-line security/detect-object-injection\n const listeners = this.listeners[event];\n listeners.splice(listeners.indexOf(handler), 1);\n };\n }\n return once(event, handler, {\n target: { kind: 'Window', label: this.label }\n });\n }\n /**\n * Emits an event to all {@link EventTarget|targets}.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().emit('window-loaded', { loggedIn: true, token: 'authToken' });\n * ```\n *\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param payload Event payload.\n */\n async emit(event, payload) {\n if (localTauriEvents.includes(event)) {\n // eslint-disable-next-line\n for (const handler of this.listeners[event] || []) {\n handler({\n event,\n id: -1,\n payload\n });\n }\n return;\n }\n return emit(event, payload);\n }\n /**\n * Emits an event to all {@link EventTarget|targets} matching the given target.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().emit('main', 'window-loaded', { loggedIn: true, token: 'authToken' });\n * ```\n * @param target Label of the target Window/Webview/WebviewWindow or raw {@link EventTarget} object.\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param payload Event payload.\n */\n async emitTo(target, event, payload) {\n if (localTauriEvents.includes(event)) {\n // eslint-disable-next-line security/detect-object-injection\n for (const handler of this.listeners[event] || []) {\n handler({\n event,\n id: -1,\n payload\n });\n }\n return;\n }\n return emitTo(target, event, payload);\n }\n /** @ignore */\n _handleTauriEvent(event, handler) {\n if (localTauriEvents.includes(event)) {\n if (!(event in this.listeners)) {\n // eslint-disable-next-line\n this.listeners[event] = [handler];\n }\n else {\n // eslint-disable-next-line\n this.listeners[event].push(handler);\n }\n return true;\n }\n return false;\n }\n // Getters\n /**\n * The scale factor that can be used to map physical pixels to logical pixels.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const factor = await getCurrentWindow().scaleFactor();\n * ```\n *\n * @returns The window's monitor scale factor.\n */\n async scaleFactor() {\n return invoke('plugin:window|scale_factor', {\n label: this.label\n });\n }\n /**\n * The position of the top-left hand corner of the window's client area relative to the top-left hand corner of the desktop.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const position = await getCurrentWindow().innerPosition();\n * ```\n *\n * @returns The window's inner position.\n */\n async innerPosition() {\n return invoke('plugin:window|inner_position', {\n label: this.label\n }).then((p) => new PhysicalPosition(p));\n }\n /**\n * The position of the top-left hand corner of the window relative to the top-left hand corner of the desktop.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const position = await getCurrentWindow().outerPosition();\n * ```\n *\n * @returns The window's outer position.\n */\n async outerPosition() {\n return invoke('plugin:window|outer_position', {\n label: this.label\n }).then((p) => new PhysicalPosition(p));\n }\n /**\n * The physical size of the window's client area.\n * The client area is the content of the window, excluding the title bar and borders.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const size = await getCurrentWindow().innerSize();\n * ```\n *\n * @returns The window's inner size.\n */\n async innerSize() {\n return invoke('plugin:window|inner_size', {\n label: this.label\n }).then((s) => new PhysicalSize(s));\n }\n /**\n * The physical size of the entire window.\n * These dimensions include the title bar and borders. If you don't want that (and you usually don't), use inner_size instead.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const size = await getCurrentWindow().outerSize();\n * ```\n *\n * @returns The window's outer size.\n */\n async outerSize() {\n return invoke('plugin:window|outer_size', {\n label: this.label\n }).then((s) => new PhysicalSize(s));\n }\n /**\n * Gets the window's current fullscreen state.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const fullscreen = await getCurrentWindow().isFullscreen();\n * ```\n *\n * @returns Whether the window is in fullscreen mode or not.\n */\n async isFullscreen() {\n return invoke('plugin:window|is_fullscreen', {\n label: this.label\n });\n }\n /**\n * Gets the window's current minimized state.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const minimized = await getCurrentWindow().isMinimized();\n * ```\n */\n async isMinimized() {\n return invoke('plugin:window|is_minimized', {\n label: this.label\n });\n }\n /**\n * Gets the window's current maximized state.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const maximized = await getCurrentWindow().isMaximized();\n * ```\n *\n * @returns Whether the window is maximized or not.\n */\n async isMaximized() {\n return invoke('plugin:window|is_maximized', {\n label: this.label\n });\n }\n /**\n * Gets the window's current focus state.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const focused = await getCurrentWindow().isFocused();\n * ```\n *\n * @returns Whether the window is focused or not.\n */\n async isFocused() {\n return invoke('plugin:window|is_focused', {\n label: this.label\n });\n }\n /**\n * Gets the window's current decorated state.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const decorated = await getCurrentWindow().isDecorated();\n * ```\n *\n * @returns Whether the window is decorated or not.\n */\n async isDecorated() {\n return invoke('plugin:window|is_decorated', {\n label: this.label\n });\n }\n /**\n * Gets the window's current resizable state.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const resizable = await getCurrentWindow().isResizable();\n * ```\n *\n * @returns Whether the window is resizable or not.\n */\n async isResizable() {\n return invoke('plugin:window|is_resizable', {\n label: this.label\n });\n }\n /**\n * Gets the window's native maximize button state.\n *\n * #### Platform-specific\n *\n * - **Linux / iOS / Android:** Unsupported.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const maximizable = await getCurrentWindow().isMaximizable();\n * ```\n *\n * @returns Whether the window's native maximize button is enabled or not.\n */\n async isMaximizable() {\n return invoke('plugin:window|is_maximizable', {\n label: this.label\n });\n }\n /**\n * Gets the window's native minimize button state.\n *\n * #### Platform-specific\n *\n * - **Linux / iOS / Android:** Unsupported.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const minimizable = await getCurrentWindow().isMinimizable();\n * ```\n *\n * @returns Whether the window's native minimize button is enabled or not.\n */\n async isMinimizable() {\n return invoke('plugin:window|is_minimizable', {\n label: this.label\n });\n }\n /**\n * Gets the window's native close button state.\n *\n * #### Platform-specific\n *\n * - **iOS / Android:** Unsupported.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const closable = await getCurrentWindow().isClosable();\n * ```\n *\n * @returns Whether the window's native close button is enabled or not.\n */\n async isClosable() {\n return invoke('plugin:window|is_closable', {\n label: this.label\n });\n }\n /**\n * Gets the window's current visible state.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const visible = await getCurrentWindow().isVisible();\n * ```\n *\n * @returns Whether the window is visible or not.\n */\n async isVisible() {\n return invoke('plugin:window|is_visible', {\n label: this.label\n });\n }\n /**\n * Gets the window's current title.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const title = await getCurrentWindow().title();\n * ```\n */\n async title() {\n return invoke('plugin:window|title', {\n label: this.label\n });\n }\n /**\n * Gets the window's current theme.\n *\n * #### Platform-specific\n *\n * - **macOS:** Theme was introduced on macOS 10.14. Returns `light` on macOS 10.13 and below.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const theme = await getCurrentWindow().theme();\n * ```\n *\n * @returns The window theme.\n */\n async theme() {\n return invoke('plugin:window|theme', {\n label: this.label\n });\n }\n /**\n * Whether the window is configured to be always on top of other windows or not.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const alwaysOnTop = await getCurrentWindow().isAlwaysOnTop();\n * ```\n *\n * @returns Whether the window is visible or not.\n */\n async isAlwaysOnTop() {\n return invoke('plugin:window|is_always_on_top', {\n label: this.label\n });\n }\n // Setters\n /**\n * Centers the window.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().center();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async center() {\n return invoke('plugin:window|center', {\n label: this.label\n });\n }\n /**\n * Requests user attention to the window, this has no effect if the application\n * is already focused. How requesting for user attention manifests is platform dependent,\n * see `UserAttentionType` for details.\n *\n * Providing `null` will unset the request for user attention. Unsetting the request for\n * user attention might not be done automatically by the WM when the window receives input.\n *\n * #### Platform-specific\n *\n * - **macOS:** `null` has no effect.\n * - **Linux:** Urgency levels have the same effect.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().requestUserAttention();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async requestUserAttention(requestType) {\n let requestType_ = null;\n if (requestType) {\n if (requestType === UserAttentionType.Critical) {\n requestType_ = { type: 'Critical' };\n }\n else {\n requestType_ = { type: 'Informational' };\n }\n }\n return invoke('plugin:window|request_user_attention', {\n label: this.label,\n value: requestType_\n });\n }\n /**\n * Updates the window resizable flag.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setResizable(false);\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async setResizable(resizable) {\n return invoke('plugin:window|set_resizable', {\n label: this.label,\n value: resizable\n });\n }\n /**\n * Enable or disable the window.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setEnabled(false);\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n *\n * @since 2.0.0\n */\n async setEnabled(enabled) {\n return invoke('plugin:window|set_enabled', {\n label: this.label,\n value: enabled\n });\n }\n /**\n * Whether the window is enabled or disabled.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setEnabled(false);\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n *\n * @since 2.0.0\n */\n async isEnabled() {\n return invoke('plugin:window|is_enabled', {\n label: this.label\n });\n }\n /**\n * Sets whether the window's native maximize button is enabled or not.\n * If resizable is set to false, this setting is ignored.\n *\n * #### Platform-specific\n *\n * - **macOS:** Disables the \"zoom\" button in the window titlebar, which is also used to enter fullscreen mode.\n * - **Linux / iOS / Android:** Unsupported.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setMaximizable(false);\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async setMaximizable(maximizable) {\n return invoke('plugin:window|set_maximizable', {\n label: this.label,\n value: maximizable\n });\n }\n /**\n * Sets whether the window's native minimize button is enabled or not.\n *\n * #### Platform-specific\n *\n * - **Linux / iOS / Android:** Unsupported.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setMinimizable(false);\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async setMinimizable(minimizable) {\n return invoke('plugin:window|set_minimizable', {\n label: this.label,\n value: minimizable\n });\n }\n /**\n * Sets whether the window's native close button is enabled or not.\n *\n * #### Platform-specific\n *\n * - **Linux:** GTK+ will do its best to convince the window manager not to show a close button. Depending on the system, this function may not have any effect when called on a window that is already visible\n * - **iOS / Android:** Unsupported.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setClosable(false);\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async setClosable(closable) {\n return invoke('plugin:window|set_closable', {\n label: this.label,\n value: closable\n });\n }\n /**\n * Sets the window title.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setTitle('Tauri');\n * ```\n *\n * @param title The new title\n * @returns A promise indicating the success or failure of the operation.\n */\n async setTitle(title) {\n return invoke('plugin:window|set_title', {\n label: this.label,\n value: title\n });\n }\n /**\n * Maximizes the window.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().maximize();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async maximize() {\n return invoke('plugin:window|maximize', {\n label: this.label\n });\n }\n /**\n * Unmaximizes the window.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().unmaximize();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async unmaximize() {\n return invoke('plugin:window|unmaximize', {\n label: this.label\n });\n }\n /**\n * Toggles the window maximized state.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().toggleMaximize();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async toggleMaximize() {\n return invoke('plugin:window|toggle_maximize', {\n label: this.label\n });\n }\n /**\n * Minimizes the window.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().minimize();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async minimize() {\n return invoke('plugin:window|minimize', {\n label: this.label\n });\n }\n /**\n * Unminimizes the window.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().unminimize();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async unminimize() {\n return invoke('plugin:window|unminimize', {\n label: this.label\n });\n }\n /**\n * Sets the window visibility to true.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().show();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async show() {\n return invoke('plugin:window|show', {\n label: this.label\n });\n }\n /**\n * Sets the window visibility to false.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().hide();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async hide() {\n return invoke('plugin:window|hide', {\n label: this.label\n });\n }\n /**\n * Closes the window.\n *\n * Note this emits a closeRequested event so you can intercept it. To force window close, use {@link Window.destroy}.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().close();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async close() {\n return invoke('plugin:window|close', {\n label: this.label\n });\n }\n /**\n * Destroys the window. Behaves like {@link Window.close} but forces the window close instead of emitting a closeRequested event.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().destroy();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async destroy() {\n return invoke('plugin:window|destroy', {\n label: this.label\n });\n }\n /**\n * Whether the window should have borders and bars.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setDecorations(false);\n * ```\n *\n * @param decorations Whether the window should have borders and bars.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setDecorations(decorations) {\n return invoke('plugin:window|set_decorations', {\n label: this.label,\n value: decorations\n });\n }\n /**\n * Whether or not the window should have shadow.\n *\n * #### Platform-specific\n *\n * - **Windows:**\n * - `false` has no effect on decorated window, shadows are always ON.\n * - `true` will make undecorated window have a 1px white border,\n * and on Windows 11, it will have a rounded corners.\n * - **Linux:** Unsupported.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setShadow(false);\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async setShadow(enable) {\n return invoke('plugin:window|set_shadow', {\n label: this.label,\n value: enable\n });\n }\n /**\n * Set window effects.\n */\n async setEffects(effects) {\n return invoke('plugin:window|set_effects', {\n label: this.label,\n value: effects\n });\n }\n /**\n * Clear any applied effects if possible.\n */\n async clearEffects() {\n return invoke('plugin:window|set_effects', {\n label: this.label,\n value: null\n });\n }\n /**\n * Whether the window should always be on top of other windows.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setAlwaysOnTop(true);\n * ```\n *\n * @param alwaysOnTop Whether the window should always be on top of other windows or not.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setAlwaysOnTop(alwaysOnTop) {\n return invoke('plugin:window|set_always_on_top', {\n label: this.label,\n value: alwaysOnTop\n });\n }\n /**\n * Whether the window should always be below other windows.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setAlwaysOnBottom(true);\n * ```\n *\n * @param alwaysOnBottom Whether the window should always be below other windows or not.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setAlwaysOnBottom(alwaysOnBottom) {\n return invoke('plugin:window|set_always_on_bottom', {\n label: this.label,\n value: alwaysOnBottom\n });\n }\n /**\n * Prevents the window contents from being captured by other apps.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setContentProtected(true);\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async setContentProtected(protected_) {\n return invoke('plugin:window|set_content_protected', {\n label: this.label,\n value: protected_\n });\n }\n /**\n * Resizes the window with a new inner size.\n * @example\n * ```typescript\n * import { getCurrentWindow, LogicalSize } from '@tauri-apps/api/window';\n * await getCurrentWindow().setSize(new LogicalSize(600, 500));\n * ```\n *\n * @param size The logical or physical inner size.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setSize(size) {\n return invoke('plugin:window|set_size', {\n label: this.label,\n value: size instanceof Size ? size : new Size(size)\n });\n }\n /**\n * Sets the window minimum inner size. If the `size` argument is not provided, the constraint is unset.\n * @example\n * ```typescript\n * import { getCurrentWindow, PhysicalSize } from '@tauri-apps/api/window';\n * await getCurrentWindow().setMinSize(new PhysicalSize(600, 500));\n * ```\n *\n * @param size The logical or physical inner size, or `null` to unset the constraint.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setMinSize(size) {\n return invoke('plugin:window|set_min_size', {\n label: this.label,\n value: size instanceof Size ? size : size ? new Size(size) : null\n });\n }\n /**\n * Sets the window maximum inner size. If the `size` argument is undefined, the constraint is unset.\n * @example\n * ```typescript\n * import { getCurrentWindow, LogicalSize } from '@tauri-apps/api/window';\n * await getCurrentWindow().setMaxSize(new LogicalSize(600, 500));\n * ```\n *\n * @param size The logical or physical inner size, or `null` to unset the constraint.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setMaxSize(size) {\n return invoke('plugin:window|set_max_size', {\n label: this.label,\n value: size instanceof Size ? size : size ? new Size(size) : null\n });\n }\n /**\n * Sets the window inner size constraints.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setSizeConstraints({ minWidth: 300 });\n * ```\n *\n * @param constraints The logical or physical inner size, or `null` to unset the constraint.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setSizeConstraints(constraints) {\n function logical(pixel) {\n return pixel ? { Logical: pixel } : null;\n }\n return invoke('plugin:window|set_size_constraints', {\n label: this.label,\n value: {\n minWidth: logical(constraints === null || constraints === void 0 ? void 0 : constraints.minWidth),\n minHeight: logical(constraints === null || constraints === void 0 ? void 0 : constraints.minHeight),\n maxWidth: logical(constraints === null || constraints === void 0 ? void 0 : constraints.maxWidth),\n maxHeight: logical(constraints === null || constraints === void 0 ? void 0 : constraints.maxHeight)\n }\n });\n }\n /**\n * Sets the window outer position.\n * @example\n * ```typescript\n * import { getCurrentWindow, LogicalPosition } from '@tauri-apps/api/window';\n * await getCurrentWindow().setPosition(new LogicalPosition(600, 500));\n * ```\n *\n * @param position The new position, in logical or physical pixels.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setPosition(position) {\n return invoke('plugin:window|set_position', {\n label: this.label,\n value: position instanceof Position ? position : new Position(position)\n });\n }\n /**\n * Sets the window fullscreen state.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setFullscreen(true);\n * ```\n *\n * @param fullscreen Whether the window should go to fullscreen or not.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setFullscreen(fullscreen) {\n return invoke('plugin:window|set_fullscreen', {\n label: this.label,\n value: fullscreen\n });\n }\n /**\n * On macOS, Toggles a fullscreen mode that doesn’t require a new macOS space. Returns a boolean indicating whether the transition was successful (this won’t work if the window was already in the native fullscreen).\n * This is how fullscreen used to work on macOS in versions before Lion. And allows the user to have a fullscreen window without using another space or taking control over the entire monitor.\n *\n * On other platforms, this is the same as {@link Window.setFullscreen}.\n *\n * @param fullscreen Whether the window should go to simple fullscreen or not.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setSimpleFullscreen(fullscreen) {\n return invoke('plugin:window|set_simple_fullscreen', {\n label: this.label,\n value: fullscreen\n });\n }\n /**\n * Bring the window to front and focus.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setFocus();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async setFocus() {\n return invoke('plugin:window|set_focus', {\n label: this.label\n });\n }\n /**\n * Sets whether the window can be focused.\n *\n * #### Platform-specific\n *\n * - **macOS**: If the window is already focused, it is not possible to unfocus it after calling `set_focusable(false)`.\n * In this case, you might consider calling {@link Window.setFocus} but it will move the window to the back i.e. at the bottom in terms of z-order.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setFocusable(true);\n * ```\n *\n * @param focusable Whether the window can be focused.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setFocusable(focusable) {\n return invoke('plugin:window|set_focusable', {\n label: this.label,\n value: focusable\n });\n }\n /**\n * Sets the window icon.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setIcon('/tauri/awesome.png');\n * ```\n *\n * Note that you may need the `image-ico` or `image-png` Cargo features to use this API.\n * To enable it, change your Cargo.toml file:\n * ```toml\n * [dependencies]\n * tauri = { version = \"...\", features = [\"...\", \"image-png\"] }\n * ```\n *\n * @param icon Icon bytes or path to the icon file.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setIcon(icon) {\n return invoke('plugin:window|set_icon', {\n label: this.label,\n value: transformImage(icon)\n });\n }\n /**\n * Whether the window icon should be hidden from the taskbar or not.\n *\n * #### Platform-specific\n *\n * - **macOS:** Unsupported.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setSkipTaskbar(true);\n * ```\n *\n * @param skip true to hide window icon, false to show it.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setSkipTaskbar(skip) {\n return invoke('plugin:window|set_skip_taskbar', {\n label: this.label,\n value: skip\n });\n }\n /**\n * Grabs the cursor, preventing it from leaving the window.\n *\n * There's no guarantee that the cursor will be hidden. You should\n * hide it by yourself if you want so.\n *\n * #### Platform-specific\n *\n * - **Linux:** Unsupported.\n * - **macOS:** This locks the cursor in a fixed location, which looks visually awkward.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setCursorGrab(true);\n * ```\n *\n * @param grab `true` to grab the cursor icon, `false` to release it.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setCursorGrab(grab) {\n return invoke('plugin:window|set_cursor_grab', {\n label: this.label,\n value: grab\n });\n }\n /**\n * Modifies the cursor's visibility.\n *\n * #### Platform-specific\n *\n * - **Windows:** The cursor is only hidden within the confines of the window.\n * - **macOS:** The cursor is hidden as long as the window has input focus, even if the cursor is\n * outside of the window.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setCursorVisible(false);\n * ```\n *\n * @param visible If `false`, this will hide the cursor. If `true`, this will show the cursor.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setCursorVisible(visible) {\n return invoke('plugin:window|set_cursor_visible', {\n label: this.label,\n value: visible\n });\n }\n /**\n * Modifies the cursor icon of the window.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setCursorIcon('help');\n * ```\n *\n * @param icon The new cursor icon.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setCursorIcon(icon) {\n return invoke('plugin:window|set_cursor_icon', {\n label: this.label,\n value: icon\n });\n }\n /**\n * Sets the window background color.\n *\n * #### Platform-specific:\n *\n * - **Windows:** alpha channel is ignored.\n * - **iOS / Android:** Unsupported.\n *\n * @returns A promise indicating the success or failure of the operation.\n *\n * @since 2.1.0\n */\n async setBackgroundColor(color) {\n return invoke('plugin:window|set_background_color', { color });\n }\n /**\n * Changes the position of the cursor in window coordinates.\n * @example\n * ```typescript\n * import { getCurrentWindow, LogicalPosition } from '@tauri-apps/api/window';\n * await getCurrentWindow().setCursorPosition(new LogicalPosition(600, 300));\n * ```\n *\n * @param position The new cursor position.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setCursorPosition(position) {\n return invoke('plugin:window|set_cursor_position', {\n label: this.label,\n value: position instanceof Position ? position : new Position(position)\n });\n }\n /**\n * Changes the cursor events behavior.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setIgnoreCursorEvents(true);\n * ```\n *\n * @param ignore `true` to ignore the cursor events; `false` to process them as usual.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setIgnoreCursorEvents(ignore) {\n return invoke('plugin:window|set_ignore_cursor_events', {\n label: this.label,\n value: ignore\n });\n }\n /**\n * Starts dragging the window.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().startDragging();\n * ```\n *\n * @return A promise indicating the success or failure of the operation.\n */\n async startDragging() {\n return invoke('plugin:window|start_dragging', {\n label: this.label\n });\n }\n /**\n * Starts resize-dragging the window.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().startResizeDragging();\n * ```\n *\n * @return A promise indicating the success or failure of the operation.\n */\n async startResizeDragging(direction) {\n return invoke('plugin:window|start_resize_dragging', {\n label: this.label,\n value: direction\n });\n }\n /**\n * Sets the badge count. It is app wide and not specific to this window.\n *\n * #### Platform-specific\n *\n * - **Windows**: Unsupported. Use @{linkcode Window.setOverlayIcon} instead.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setBadgeCount(5);\n * ```\n *\n * @param count The badge count. Use `undefined` to remove the badge.\n * @return A promise indicating the success or failure of the operation.\n */\n async setBadgeCount(count) {\n return invoke('plugin:window|set_badge_count', {\n label: this.label,\n value: count\n });\n }\n /**\n * Sets the badge cont **macOS only**.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setBadgeLabel(\"Hello\");\n * ```\n *\n * @param label The badge label. Use `undefined` to remove the badge.\n * @return A promise indicating the success or failure of the operation.\n */\n async setBadgeLabel(label) {\n return invoke('plugin:window|set_badge_label', {\n label: this.label,\n value: label\n });\n }\n /**\n * Sets the overlay icon. **Windows only**\n * The overlay icon can be set for every window.\n *\n *\n * Note that you may need the `image-ico` or `image-png` Cargo features to use this API.\n * To enable it, change your Cargo.toml file:\n *\n * ```toml\n * [dependencies]\n * tauri = { version = \"...\", features = [\"...\", \"image-png\"] }\n * ```\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setOverlayIcon(\"/tauri/awesome.png\");\n * ```\n *\n * @param icon Icon bytes or path to the icon file. Use `undefined` to remove the overlay icon.\n * @return A promise indicating the success or failure of the operation.\n */\n async setOverlayIcon(icon) {\n return invoke('plugin:window|set_overlay_icon', {\n label: this.label,\n value: icon ? transformImage(icon) : undefined\n });\n }\n /**\n * Sets the taskbar progress state.\n *\n * #### Platform-specific\n *\n * - **Linux / macOS**: Progress bar is app-wide and not specific to this window.\n * - **Linux**: Only supported desktop environments with `libunity` (e.g. GNOME).\n *\n * @example\n * ```typescript\n * import { getCurrentWindow, ProgressBarStatus } from '@tauri-apps/api/window';\n * await getCurrentWindow().setProgressBar({\n * status: ProgressBarStatus.Normal,\n * progress: 50,\n * });\n * ```\n *\n * @return A promise indicating the success or failure of the operation.\n */\n async setProgressBar(state) {\n return invoke('plugin:window|set_progress_bar', {\n label: this.label,\n value: state\n });\n }\n /**\n * Sets whether the window should be visible on all workspaces or virtual desktops.\n *\n * #### Platform-specific\n *\n * - **Windows / iOS / Android:** Unsupported.\n *\n * @since 2.0.0\n */\n async setVisibleOnAllWorkspaces(visible) {\n return invoke('plugin:window|set_visible_on_all_workspaces', {\n label: this.label,\n value: visible\n });\n }\n /**\n * Sets the title bar style. **macOS only**.\n *\n * @since 2.0.0\n */\n async setTitleBarStyle(style) {\n return invoke('plugin:window|set_title_bar_style', {\n label: this.label,\n value: style\n });\n }\n /**\n * Set window theme, pass in `null` or `undefined` to follow system theme\n *\n * #### Platform-specific\n *\n * - **Linux / macOS**: Theme is app-wide and not specific to this window.\n * - **iOS / Android:** Unsupported.\n *\n * @since 2.0.0\n */\n async setTheme(theme) {\n return invoke('plugin:window|set_theme', {\n label: this.label,\n value: theme\n });\n }\n // Listeners\n /**\n * Listen to window resize.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from \"@tauri-apps/api/window\";\n * const unlisten = await getCurrentWindow().onResized(({ payload: size }) => {\n * console.log('Window resized', size);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n */\n async onResized(handler) {\n return this.listen(TauriEvent.WINDOW_RESIZED, (e) => {\n e.payload = new PhysicalSize(e.payload);\n handler(e);\n });\n }\n /**\n * Listen to window move.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from \"@tauri-apps/api/window\";\n * const unlisten = await getCurrentWindow().onMoved(({ payload: position }) => {\n * console.log('Window moved', position);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n */\n async onMoved(handler) {\n return this.listen(TauriEvent.WINDOW_MOVED, (e) => {\n e.payload = new PhysicalPosition(e.payload);\n handler(e);\n });\n }\n /**\n * Listen to window close requested. Emitted when the user requests to closes the window.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from \"@tauri-apps/api/window\";\n * import { confirm } from '@tauri-apps/api/dialog';\n * const unlisten = await getCurrentWindow().onCloseRequested(async (event) => {\n * const confirmed = await confirm('Are you sure?');\n * if (!confirmed) {\n * // user did not confirm closing the window; let's prevent it\n * event.preventDefault();\n * }\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n */\n async onCloseRequested(handler) {\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n return this.listen(TauriEvent.WINDOW_CLOSE_REQUESTED, async (event) => {\n const evt = new CloseRequestedEvent(event);\n await handler(evt);\n if (!evt.isPreventDefault()) {\n await this.destroy();\n }\n });\n }\n /**\n * Listen to a file drop event.\n * The listener is triggered when the user hovers the selected files on the webview,\n * drops the files or cancels the operation.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from \"@tauri-apps/api/webview\";\n * const unlisten = await getCurrentWindow().onDragDropEvent((event) => {\n * if (event.payload.type === 'over') {\n * console.log('User hovering', event.payload.position);\n * } else if (event.payload.type === 'drop') {\n * console.log('User dropped', event.payload.paths);\n * } else {\n * console.log('File drop cancelled');\n * }\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n */\n async onDragDropEvent(handler) {\n const unlistenDrag = await this.listen(TauriEvent.DRAG_ENTER, (event) => {\n handler({\n ...event,\n payload: {\n type: 'enter',\n paths: event.payload.paths,\n position: new PhysicalPosition(event.payload.position)\n }\n });\n });\n const unlistenDragOver = await this.listen(TauriEvent.DRAG_OVER, (event) => {\n handler({\n ...event,\n payload: {\n type: 'over',\n position: new PhysicalPosition(event.payload.position)\n }\n });\n });\n const unlistenDrop = await this.listen(TauriEvent.DRAG_DROP, (event) => {\n handler({\n ...event,\n payload: {\n type: 'drop',\n paths: event.payload.paths,\n position: new PhysicalPosition(event.payload.position)\n }\n });\n });\n const unlistenCancel = await this.listen(TauriEvent.DRAG_LEAVE, (event) => {\n handler({ ...event, payload: { type: 'leave' } });\n });\n return () => {\n unlistenDrag();\n unlistenDrop();\n unlistenDragOver();\n unlistenCancel();\n };\n }\n /**\n * Listen to window focus change.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from \"@tauri-apps/api/window\";\n * const unlisten = await getCurrentWindow().onFocusChanged(({ payload: focused }) => {\n * console.log('Focus changed, window is focused? ' + focused);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n */\n async onFocusChanged(handler) {\n const unlistenFocus = await this.listen(TauriEvent.WINDOW_FOCUS, (event) => {\n handler({ ...event, payload: true });\n });\n const unlistenBlur = await this.listen(TauriEvent.WINDOW_BLUR, (event) => {\n handler({ ...event, payload: false });\n });\n return () => {\n unlistenFocus();\n unlistenBlur();\n };\n }\n /**\n * Listen to window scale change. Emitted when the window's scale factor has changed.\n * The following user actions can cause DPI changes:\n * - Changing the display's resolution.\n * - Changing the display's scale factor (e.g. in Control Panel on Windows).\n * - Moving the window to a display with a different scale factor.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from \"@tauri-apps/api/window\";\n * const unlisten = await getCurrentWindow().onScaleChanged(({ payload }) => {\n * console.log('Scale changed', payload.scaleFactor, payload.size);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n */\n async onScaleChanged(handler) {\n return this.listen(TauriEvent.WINDOW_SCALE_FACTOR_CHANGED, handler);\n }\n /**\n * Listen to the system theme change.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from \"@tauri-apps/api/window\";\n * const unlisten = await getCurrentWindow().onThemeChanged(({ payload: theme }) => {\n * console.log('New theme: ' + theme);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n */\n async onThemeChanged(handler) {\n return this.listen(TauriEvent.WINDOW_THEME_CHANGED, handler);\n }\n}\n/**\n * Background throttling policy\n *\n * @since 2.0.0\n */\nvar BackgroundThrottlingPolicy;\n(function (BackgroundThrottlingPolicy) {\n BackgroundThrottlingPolicy[\"Disabled\"] = \"disabled\";\n BackgroundThrottlingPolicy[\"Throttle\"] = \"throttle\";\n BackgroundThrottlingPolicy[\"Suspend\"] = \"suspend\";\n})(BackgroundThrottlingPolicy || (BackgroundThrottlingPolicy = {}));\n/**\n * The scrollbar style to use in the webview.\n *\n * ## Platform-specific\n *\n * **Windows**: This option must be given the same value for all webviews.\n *\n * @since 2.8.0\n */\nvar ScrollBarStyle;\n(function (ScrollBarStyle) {\n /**\n * The default scrollbar style for the webview.\n */\n ScrollBarStyle[\"Default\"] = \"default\";\n /**\n * Fluent UI style overlay scrollbars. **Windows Only**\n *\n * Requires WebView2 Runtime version 125.0.2535.41 or higher, does nothing on older versions,\n * see https://learn.microsoft.com/en-us/microsoft-edge/webview2/release-notes/?tabs=dotnetcsharp#10253541\n */\n ScrollBarStyle[\"FluentOverlay\"] = \"fluentOverlay\";\n})(ScrollBarStyle || (ScrollBarStyle = {}));\n/**\n * Platform-specific window effects\n *\n * @since 2.0.0\n */\nvar Effect;\n(function (Effect) {\n /**\n * A default material appropriate for the view's effectiveAppearance. **macOS 10.14-**\n *\n * @deprecated since macOS 10.14. You should instead choose an appropriate semantic material.\n */\n Effect[\"AppearanceBased\"] = \"appearanceBased\";\n /**\n * **macOS 10.14-**\n *\n * @deprecated since macOS 10.14. Use a semantic material instead.\n */\n Effect[\"Light\"] = \"light\";\n /**\n * **macOS 10.14-**\n *\n * @deprecated since macOS 10.14. Use a semantic material instead.\n */\n Effect[\"Dark\"] = \"dark\";\n /**\n * **macOS 10.14-**\n *\n * @deprecated since macOS 10.14. Use a semantic material instead.\n */\n Effect[\"MediumLight\"] = \"mediumLight\";\n /**\n * **macOS 10.14-**\n *\n * @deprecated since macOS 10.14. Use a semantic material instead.\n */\n Effect[\"UltraDark\"] = \"ultraDark\";\n /**\n * **macOS 10.10+**\n */\n Effect[\"Titlebar\"] = \"titlebar\";\n /**\n * **macOS 10.10+**\n */\n Effect[\"Selection\"] = \"selection\";\n /**\n * **macOS 10.11+**\n */\n Effect[\"Menu\"] = \"menu\";\n /**\n * **macOS 10.11+**\n */\n Effect[\"Popover\"] = \"popover\";\n /**\n * **macOS 10.11+**\n */\n Effect[\"Sidebar\"] = \"sidebar\";\n /**\n * **macOS 10.14+**\n */\n Effect[\"HeaderView\"] = \"headerView\";\n /**\n * **macOS 10.14+**\n */\n Effect[\"Sheet\"] = \"sheet\";\n /**\n * **macOS 10.14+**\n */\n Effect[\"WindowBackground\"] = \"windowBackground\";\n /**\n * **macOS 10.14+**\n */\n Effect[\"HudWindow\"] = \"hudWindow\";\n /**\n * **macOS 10.14+**\n */\n Effect[\"FullScreenUI\"] = \"fullScreenUI\";\n /**\n * **macOS 10.14+**\n */\n Effect[\"Tooltip\"] = \"tooltip\";\n /**\n * **macOS 10.14+**\n */\n Effect[\"ContentBackground\"] = \"contentBackground\";\n /**\n * **macOS 10.14+**\n */\n Effect[\"UnderWindowBackground\"] = \"underWindowBackground\";\n /**\n * **macOS 10.14+**\n */\n Effect[\"UnderPageBackground\"] = \"underPageBackground\";\n /**\n * **Windows 11 Only**\n */\n Effect[\"Mica\"] = \"mica\";\n /**\n * **Windows 7/10/11(22H1) Only**\n *\n * #### Notes\n *\n * This effect has bad performance when resizing/dragging the window on Windows 11 build 22621.\n */\n Effect[\"Blur\"] = \"blur\";\n /**\n * **Windows 10/11**\n *\n * #### Notes\n *\n * This effect has bad performance when resizing/dragging the window on Windows 10 v1903+ and Windows 11 build 22000.\n */\n Effect[\"Acrylic\"] = \"acrylic\";\n /**\n * Tabbed effect that matches the system dark perefence **Windows 11 Only**\n */\n Effect[\"Tabbed\"] = \"tabbed\";\n /**\n * Tabbed effect with dark mode but only if dark mode is enabled on the system **Windows 11 Only**\n */\n Effect[\"TabbedDark\"] = \"tabbedDark\";\n /**\n * Tabbed effect with light mode **Windows 11 Only**\n */\n Effect[\"TabbedLight\"] = \"tabbedLight\";\n})(Effect || (Effect = {}));\n/**\n * Window effect state **macOS only**\n *\n * @see https://developer.apple.com/documentation/appkit/nsvisualeffectview/state\n *\n * @since 2.0.0\n */\nvar EffectState;\n(function (EffectState) {\n /**\n * Make window effect state follow the window's active state **macOS only**\n */\n EffectState[\"FollowsWindowActiveState\"] = \"followsWindowActiveState\";\n /**\n * Make window effect state always active **macOS only**\n */\n EffectState[\"Active\"] = \"active\";\n /**\n * Make window effect state always inactive **macOS only**\n */\n EffectState[\"Inactive\"] = \"inactive\";\n})(EffectState || (EffectState = {}));\nfunction mapMonitor(m) {\n return m === null\n ? null\n : {\n name: m.name,\n scaleFactor: m.scaleFactor,\n position: new PhysicalPosition(m.position),\n size: new PhysicalSize(m.size),\n workArea: {\n position: new PhysicalPosition(m.workArea.position),\n size: new PhysicalSize(m.workArea.size)\n }\n };\n}\n/**\n * Returns the monitor on which the window currently resides.\n * Returns `null` if current monitor can't be detected.\n * @example\n * ```typescript\n * import { currentMonitor } from '@tauri-apps/api/window';\n * const monitor = await currentMonitor();\n * ```\n *\n * @since 1.0.0\n */\nasync function currentMonitor() {\n return invoke('plugin:window|current_monitor').then(mapMonitor);\n}\n/**\n * Returns the primary monitor of the system.\n * Returns `null` if it can't identify any monitor as a primary one.\n * @example\n * ```typescript\n * import { primaryMonitor } from '@tauri-apps/api/window';\n * const monitor = await primaryMonitor();\n * ```\n *\n * @since 1.0.0\n */\nasync function primaryMonitor() {\n return invoke('plugin:window|primary_monitor').then(mapMonitor);\n}\n/**\n * Returns the monitor that contains the given point. Returns `null` if can't find any.\n * @example\n * ```typescript\n * import { monitorFromPoint } from '@tauri-apps/api/window';\n * const monitor = await monitorFromPoint(100.0, 200.0);\n * ```\n *\n * @since 1.0.0\n */\nasync function monitorFromPoint(x, y) {\n return invoke('plugin:window|monitor_from_point', {\n x,\n y\n }).then(mapMonitor);\n}\n/**\n * Returns the list of all the monitors available on the system.\n * @example\n * ```typescript\n * import { availableMonitors } from '@tauri-apps/api/window';\n * const monitors = await availableMonitors();\n * ```\n *\n * @since 1.0.0\n */\nasync function availableMonitors() {\n return invoke('plugin:window|available_monitors').then((ms) => ms.map(mapMonitor));\n}\n/**\n * Get the cursor position relative to the top-left hand corner of the desktop.\n *\n * Note that the top-left hand corner of the desktop is not necessarily the same as the screen.\n * If the user uses a desktop with multiple monitors,\n * the top-left hand corner of the desktop is the top-left hand corner of the main monitor on Windows and macOS\n * or the top-left of the leftmost monitor on X11.\n *\n * The coordinates can be negative if the top-left hand corner of the window is outside of the visible screen region.\n */\nasync function cursorPosition() {\n return invoke('plugin:window|cursor_position').then((v) => new PhysicalPosition(v));\n}\n\nexport { CloseRequestedEvent, Effect, EffectState, PhysicalPosition, PhysicalSize, ProgressBarStatus, UserAttentionType, Window, availableMonitors, currentMonitor, cursorPosition, getAllWindows, getCurrentWindow, monitorFromPoint, primaryMonitor };\n","import { PhysicalPosition, PhysicalSize, Size, Position } from './dpi.js';\nimport { listen, once, emit, emitTo, TauriEvent } from './event.js';\nimport { invoke } from './core.js';\nimport { getCurrentWindow, Window } from './window.js';\n\n// Copyright 2019-2024 Tauri Programme within The Commons Conservancy\n// SPDX-License-Identifier: Apache-2.0\n// SPDX-License-Identifier: MIT\n/**\n * Provides APIs to create webviews, communicate with other webviews and manipulate the current webview.\n *\n * #### Webview events\n *\n * Events can be listened to using {@link Webview.listen}:\n * ```typescript\n * import { getCurrentWebview } from \"@tauri-apps/api/webview\";\n * getCurrentWebview().listen(\"my-webview-event\", ({ event, payload }) => { });\n * ```\n *\n * @module\n */\n/**\n * Get an instance of `Webview` for the current webview.\n *\n * @since 2.0.0\n */\nfunction getCurrentWebview() {\n return new Webview(getCurrentWindow(), window.__TAURI_INTERNALS__.metadata.currentWebview.label, {\n // @ts-expect-error `skip` is not defined in the public API but it is handled by the constructor\n skip: true\n });\n}\n/**\n * Gets a list of instances of `Webview` for all available webviews.\n *\n * @since 2.0.0\n */\nasync function getAllWebviews() {\n return invoke('plugin:webview|get_all_webviews').then((webviews) => webviews.map((w) => new Webview(new Window(w.windowLabel, {\n // @ts-expect-error `skip` is not defined in the public API but it is handled by the constructor\n skip: true\n }), w.label, {\n // @ts-expect-error `skip` is not defined in the public API but it is handled by the constructor\n skip: true\n })));\n}\n/** @ignore */\n// events that are emitted right here instead of by the created webview\nconst localTauriEvents = ['tauri://created', 'tauri://error'];\n/**\n * Create new webview or get a handle to an existing one.\n *\n * Webviews are identified by a *label* a unique identifier that can be used to reference it later.\n * It may only contain alphanumeric characters `a-zA-Z` plus the following special characters `-`, `/`, `:` and `_`.\n *\n * @example\n * ```typescript\n * import { Window } from \"@tauri-apps/api/window\"\n * import { Webview } from \"@tauri-apps/api/webview\"\n *\n * const appWindow = new Window('uniqueLabel');\n *\n * appWindow.once('tauri://created', async function () {\n * // `new Webview` Should be called after the window is successfully created,\n * // or webview may not be attached to the window since window is not created yet.\n *\n * // loading embedded asset:\n * const webview = new Webview(appWindow, 'theUniqueLabel', {\n * url: 'path/to/page.html',\n *\n * // create a webview with specific logical position and size\n * x: 0,\n * y: 0,\n * width: 800,\n * height: 600,\n * });\n * // alternatively, load a remote URL:\n * const webview = new Webview(appWindow, 'theUniqueLabel', {\n * url: 'https://github.com/tauri-apps/tauri',\n *\n * // create a webview with specific logical position and size\n * x: 0,\n * y: 0,\n * width: 800,\n * height: 600,\n * });\n *\n * webview.once('tauri://created', function () {\n * // webview successfully created\n * });\n * webview.once('tauri://error', function (e) {\n * // an error happened creating the webview\n * });\n *\n *\n * // emit an event to the backend\n * await webview.emit(\"some-event\", \"data\");\n * // listen to an event from the backend\n * const unlisten = await webview.listen(\"event-name\", e => { });\n * unlisten();\n * });\n * ```\n *\n * @since 2.0.0\n */\nclass Webview {\n /**\n * Creates a new Webview.\n * @example\n * ```typescript\n * import { Window } from '@tauri-apps/api/window'\n * import { Webview } from '@tauri-apps/api/webview'\n * const appWindow = new Window('my-label')\n *\n * appWindow.once('tauri://created', async function() {\n * const webview = new Webview(appWindow, 'my-label', {\n * url: 'https://github.com/tauri-apps/tauri',\n *\n * // create a webview with specific logical position and size\n * x: 0,\n * y: 0,\n * width: 800,\n * height: 600,\n * });\n *\n * webview.once('tauri://created', function () {\n * // webview successfully created\n * });\n * webview.once('tauri://error', function (e) {\n * // an error happened creating the webview\n * });\n * });\n * ```\n *\n * @param window the window to add this webview to.\n * @param label The unique webview label. Must be alphanumeric: `a-zA-Z-/:_`.\n * @returns The {@link Webview} instance to communicate with the webview.\n */\n constructor(window, label, options) {\n this.window = window;\n this.label = label;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n this.listeners = Object.create(null);\n // @ts-expect-error `skip` is not a public API so it is not defined in WebviewOptions\n if (!(options === null || options === void 0 ? void 0 : options.skip)) {\n invoke('plugin:webview|create_webview', {\n windowLabel: window.label,\n options: {\n ...options,\n label\n }\n })\n .then(async () => this.emit('tauri://created'))\n .catch(async (e) => this.emit('tauri://error', e));\n }\n }\n /**\n * Gets the Webview for the webview associated with the given label.\n * @example\n * ```typescript\n * import { Webview } from '@tauri-apps/api/webview';\n * const mainWebview = Webview.getByLabel('main');\n * ```\n *\n * @param label The webview label.\n * @returns The Webview instance to communicate with the webview or null if the webview doesn't exist.\n */\n static async getByLabel(label) {\n var _a;\n return (_a = (await getAllWebviews()).find((w) => w.label === label)) !== null && _a !== void 0 ? _a : null;\n }\n /**\n * Get an instance of `Webview` for the current webview.\n */\n static getCurrent() {\n return getCurrentWebview();\n }\n /**\n * Gets a list of instances of `Webview` for all available webviews.\n */\n static async getAll() {\n return getAllWebviews();\n }\n /**\n * Listen to an emitted event on this webview.\n *\n * @example\n * ```typescript\n * import { getCurrentWebview } from '@tauri-apps/api/webview';\n * const unlisten = await getCurrentWebview().listen<string>('state-changed', (event) => {\n * console.log(`Got error: ${payload}`);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param handler Event handler.\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n */\n async listen(event, handler) {\n if (this._handleTauriEvent(event, handler)) {\n return () => {\n // eslint-disable-next-line security/detect-object-injection\n const listeners = this.listeners[event];\n listeners.splice(listeners.indexOf(handler), 1);\n };\n }\n return listen(event, handler, {\n target: { kind: 'Webview', label: this.label }\n });\n }\n /**\n * Listen to an emitted event on this webview only once.\n *\n * @example\n * ```typescript\n * import { getCurrentWebview } from '@tauri-apps/api/webview';\n * const unlisten = await getCurrent().once<null>('initialized', (event) => {\n * console.log(`Webview initialized!`);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param handler Event handler.\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n */\n async once(event, handler) {\n if (this._handleTauriEvent(event, handler)) {\n return () => {\n // eslint-disable-next-line security/detect-object-injection\n const listeners = this.listeners[event];\n listeners.splice(listeners.indexOf(handler), 1);\n };\n }\n return once(event, handler, {\n target: { kind: 'Webview', label: this.label }\n });\n }\n /**\n * Emits an event to all {@link EventTarget|targets}.\n *\n * @example\n * ```typescript\n * import { getCurrentWebview } from '@tauri-apps/api/webview';\n * await getCurrentWebview().emit('webview-loaded', { loggedIn: true, token: 'authToken' });\n * ```\n *\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param payload Event payload.\n */\n async emit(event, payload) {\n if (localTauriEvents.includes(event)) {\n // eslint-disable-next-line\n for (const handler of this.listeners[event] || []) {\n handler({\n event,\n id: -1,\n payload\n });\n }\n return;\n }\n return emit(event, payload);\n }\n /**\n * Emits an event to all {@link EventTarget|targets} matching the given target.\n *\n * @example\n * ```typescript\n * import { getCurrentWebview } from '@tauri-apps/api/webview';\n * await getCurrentWebview().emitTo('main', 'webview-loaded', { loggedIn: true, token: 'authToken' });\n * ```\n *\n * @param target Label of the target Window/Webview/WebviewWindow or raw {@link EventTarget} object.\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param payload Event payload.\n */\n async emitTo(target, event, payload) {\n if (localTauriEvents.includes(event)) {\n // eslint-disable-next-line\n for (const handler of this.listeners[event] || []) {\n handler({\n event,\n id: -1,\n payload\n });\n }\n return;\n }\n return emitTo(target, event, payload);\n }\n /** @ignore */\n _handleTauriEvent(event, handler) {\n if (localTauriEvents.includes(event)) {\n if (!(event in this.listeners)) {\n // eslint-disable-next-line security/detect-object-injection\n this.listeners[event] = [handler];\n }\n else {\n // eslint-disable-next-line security/detect-object-injection\n this.listeners[event].push(handler);\n }\n return true;\n }\n return false;\n }\n // Getters\n /**\n * The position of the top-left hand corner of the webview's client area relative to the top-left hand corner of the desktop.\n * @example\n * ```typescript\n * import { getCurrentWebview } from '@tauri-apps/api/webview';\n * const position = await getCurrentWebview().position();\n * ```\n *\n * @returns The webview's position.\n */\n async position() {\n return invoke('plugin:webview|webview_position', {\n label: this.label\n }).then((p) => new PhysicalPosition(p));\n }\n /**\n * The physical size of the webview's client area.\n * The client area is the content of the webview, excluding the title bar and borders.\n * @example\n * ```typescript\n * import { getCurrentWebview } from '@tauri-apps/api/webview';\n * const size = await getCurrentWebview().size();\n * ```\n *\n * @returns The webview's size.\n */\n async size() {\n return invoke('plugin:webview|webview_size', {\n label: this.label\n }).then((s) => new PhysicalSize(s));\n }\n // Setters\n /**\n * Closes the webview.\n * @example\n * ```typescript\n * import { getCurrentWebview } from '@tauri-apps/api/webview';\n * await getCurrentWebview().close();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async close() {\n return invoke('plugin:webview|webview_close', {\n label: this.label\n });\n }\n /**\n * Resizes the webview.\n * @example\n * ```typescript\n * import { getCurrent, LogicalSize } from '@tauri-apps/api/webview';\n * await getCurrentWebview().setSize(new LogicalSize(600, 500));\n * ```\n *\n * @param size The logical or physical size.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setSize(size) {\n return invoke('plugin:webview|set_webview_size', {\n label: this.label,\n value: size instanceof Size ? size : new Size(size)\n });\n }\n /**\n * Sets the webview position.\n * @example\n * ```typescript\n * import { getCurrent, LogicalPosition } from '@tauri-apps/api/webview';\n * await getCurrentWebview().setPosition(new LogicalPosition(600, 500));\n * ```\n *\n * @param position The new position, in logical or physical pixels.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setPosition(position) {\n return invoke('plugin:webview|set_webview_position', {\n label: this.label,\n value: position instanceof Position ? position : new Position(position)\n });\n }\n /**\n * Bring the webview to front and focus.\n * @example\n * ```typescript\n * import { getCurrentWebview } from '@tauri-apps/api/webview';\n * await getCurrentWebview().setFocus();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async setFocus() {\n return invoke('plugin:webview|set_webview_focus', {\n label: this.label\n });\n }\n /**\n * Sets whether the webview should automatically grow and shrink its size and position when the parent window resizes.\n * @example\n * ```typescript\n * import { getCurrentWebview } from '@tauri-apps/api/webview';\n * await getCurrentWebview().setAutoResize(true);\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async setAutoResize(autoResize) {\n return invoke('plugin:webview|set_webview_auto_resize', {\n label: this.label,\n value: autoResize\n });\n }\n /**\n * Hide the webview.\n * @example\n * ```typescript\n * import { getCurrentWebview } from '@tauri-apps/api/webview';\n * await getCurrentWebview().hide();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async hide() {\n return invoke('plugin:webview|webview_hide', {\n label: this.label\n });\n }\n /**\n * Show the webview.\n * @example\n * ```typescript\n * import { getCurrentWebview } from '@tauri-apps/api/webview';\n * await getCurrentWebview().show();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async show() {\n return invoke('plugin:webview|webview_show', {\n label: this.label\n });\n }\n /**\n * Set webview zoom level.\n * @example\n * ```typescript\n * import { getCurrentWebview } from '@tauri-apps/api/webview';\n * await getCurrentWebview().setZoom(1.5);\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async setZoom(scaleFactor) {\n return invoke('plugin:webview|set_webview_zoom', {\n label: this.label,\n value: scaleFactor\n });\n }\n /**\n * Moves this webview to the given label.\n * @example\n * ```typescript\n * import { getCurrentWebview } from '@tauri-apps/api/webview';\n * await getCurrentWebview().reparent('other-window');\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async reparent(window) {\n return invoke('plugin:webview|reparent', {\n label: this.label,\n window: typeof window === 'string' ? window : window.label\n });\n }\n /**\n * Clears all browsing data for this webview.\n * @example\n * ```typescript\n * import { getCurrentWebview } from '@tauri-apps/api/webview';\n * await getCurrentWebview().clearAllBrowsingData();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async clearAllBrowsingData() {\n return invoke('plugin:webview|clear_all_browsing_data');\n }\n /**\n * Specify the webview background color.\n *\n * #### Platfrom-specific:\n *\n * - **macOS / iOS**: Not implemented.\n * - **Windows**:\n * - On Windows 7, transparency is not supported and the alpha value will be ignored.\n * - On Windows higher than 7: translucent colors are not supported so any alpha value other than `0` will be replaced by `255`\n *\n * @returns A promise indicating the success or failure of the operation.\n *\n * @since 2.1.0\n */\n async setBackgroundColor(color) {\n return invoke('plugin:webview|set_webview_background_color', { color });\n }\n // Listeners\n /**\n * Listen to a file drop event.\n * The listener is triggered when the user hovers the selected files on the webview,\n * drops the files or cancels the operation.\n *\n * @example\n * ```typescript\n * import { getCurrentWebview } from \"@tauri-apps/api/webview\";\n * const unlisten = await getCurrentWebview().onDragDropEvent((event) => {\n * if (event.payload.type === 'over') {\n * console.log('User hovering', event.payload.position);\n * } else if (event.payload.type === 'drop') {\n * console.log('User dropped', event.payload.paths);\n * } else {\n * console.log('File drop cancelled');\n * }\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * When the debugger panel is open, the drop position of this event may be inaccurate due to a known limitation.\n * To retrieve the correct drop position, please detach the debugger.\n *\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n */\n async onDragDropEvent(handler) {\n const unlistenDragEnter = await this.listen(TauriEvent.DRAG_ENTER, (event) => {\n handler({\n ...event,\n payload: {\n type: 'enter',\n paths: event.payload.paths,\n position: new PhysicalPosition(event.payload.position)\n }\n });\n });\n const unlistenDragOver = await this.listen(TauriEvent.DRAG_OVER, (event) => {\n handler({\n ...event,\n payload: {\n type: 'over',\n position: new PhysicalPosition(event.payload.position)\n }\n });\n });\n const unlistenDragDrop = await this.listen(TauriEvent.DRAG_DROP, (event) => {\n handler({\n ...event,\n payload: {\n type: 'drop',\n paths: event.payload.paths,\n position: new PhysicalPosition(event.payload.position)\n }\n });\n });\n const unlistenDragLeave = await this.listen(TauriEvent.DRAG_LEAVE, (event) => {\n handler({ ...event, payload: { type: 'leave' } });\n });\n return () => {\n unlistenDragEnter();\n unlistenDragDrop();\n unlistenDragOver();\n unlistenDragLeave();\n };\n }\n}\n\nexport { Webview, getAllWebviews, getCurrentWebview };\n","import { getCurrentWebview, Webview } from './webview.js';\nimport { Window } from './window.js';\nimport { listen, once } from './event.js';\nimport { invoke } from './core.js';\n\n// Copyright 2019-2024 Tauri Programme within The Commons Conservancy\n// SPDX-License-Identifier: Apache-2.0\n// SPDX-License-Identifier: MIT\n/**\n * Get an instance of `Webview` for the current webview window.\n *\n * @since 2.0.0\n */\nfunction getCurrentWebviewWindow() {\n const webview = getCurrentWebview();\n // @ts-expect-error `skip` is not defined in the public API but it is handled by the constructor\n return new WebviewWindow(webview.label, { skip: true });\n}\n/**\n * Gets a list of instances of `Webview` for all available webview windows.\n *\n * @since 2.0.0\n */\nasync function getAllWebviewWindows() {\n return invoke('plugin:window|get_all_windows').then((windows) => windows.map((w) => new WebviewWindow(w, {\n // @ts-expect-error `skip` is not defined in the public API but it is handled by the constructor\n skip: true\n })));\n}\n// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging\nclass WebviewWindow {\n /**\n * Creates a new {@link Window} hosting a {@link Webview}.\n * @example\n * ```typescript\n * import { WebviewWindow } from '@tauri-apps/api/webviewWindow'\n * const webview = new WebviewWindow('my-label', {\n * url: 'https://github.com/tauri-apps/tauri'\n * });\n * webview.once('tauri://created', function () {\n * // webview successfully created\n * });\n * webview.once('tauri://error', function (e) {\n * // an error happened creating the webview\n * });\n * ```\n *\n * @param label The unique webview label. Must be alphanumeric: `a-zA-Z-/:_`.\n * @returns The {@link WebviewWindow} instance to communicate with the window and webview.\n */\n constructor(label, options = {}) {\n var _a;\n this.label = label;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n this.listeners = Object.create(null);\n // @ts-expect-error `skip` is not a public API so it is not defined in WebviewOptions\n if (!(options === null || options === void 0 ? void 0 : options.skip)) {\n invoke('plugin:webview|create_webview_window', {\n options: {\n ...options,\n parent: typeof options.parent === 'string'\n ? options.parent\n : (_a = options.parent) === null || _a === void 0 ? void 0 : _a.label,\n label\n }\n })\n .then(async () => this.emit('tauri://created'))\n .catch(async (e) => this.emit('tauri://error', e));\n }\n }\n /**\n * Gets the Webview for the webview associated with the given label.\n * @example\n * ```typescript\n * import { Webview } from '@tauri-apps/api/webviewWindow';\n * const mainWebview = Webview.getByLabel('main');\n * ```\n *\n * @param label The webview label.\n * @returns The Webview instance to communicate with the webview or null if the webview doesn't exist.\n */\n static async getByLabel(label) {\n var _a;\n const webview = (_a = (await getAllWebviewWindows()).find((w) => w.label === label)) !== null && _a !== void 0 ? _a : null;\n if (webview) {\n // @ts-expect-error `skip` is not defined in the public API but it is handled by the constructor\n return new WebviewWindow(webview.label, { skip: true });\n }\n return null;\n }\n /**\n * Get an instance of `Webview` for the current webview.\n */\n static getCurrent() {\n return getCurrentWebviewWindow();\n }\n /**\n * Gets a list of instances of `Webview` for all available webviews.\n */\n static async getAll() {\n return getAllWebviewWindows();\n }\n /**\n * Listen to an emitted event on this webivew window.\n *\n * @example\n * ```typescript\n * import { WebviewWindow } from '@tauri-apps/api/webviewWindow';\n * const unlisten = await WebviewWindow.getCurrent().listen<string>('state-changed', (event) => {\n * console.log(`Got error: ${payload}`);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param handler Event handler.\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n */\n async listen(event, handler) {\n if (this._handleTauriEvent(event, handler)) {\n return () => {\n // eslint-disable-next-line security/detect-object-injection\n const listeners = this.listeners[event];\n listeners.splice(listeners.indexOf(handler), 1);\n };\n }\n return listen(event, handler, {\n target: { kind: 'WebviewWindow', label: this.label }\n });\n }\n /**\n * Listen to an emitted event on this webview window only once.\n *\n * @example\n * ```typescript\n * import { WebviewWindow } from '@tauri-apps/api/webviewWindow';\n * const unlisten = await WebviewWindow.getCurrent().once<null>('initialized', (event) => {\n * console.log(`Webview initialized!`);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param handler Event handler.\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n */\n async once(event, handler) {\n if (this._handleTauriEvent(event, handler)) {\n return () => {\n // eslint-disable-next-line security/detect-object-injection\n const listeners = this.listeners[event];\n listeners.splice(listeners.indexOf(handler), 1);\n };\n }\n return once(event, handler, {\n target: { kind: 'WebviewWindow', label: this.label }\n });\n }\n /**\n * Set the window and webview background color.\n *\n * #### Platform-specific:\n *\n * - **Android / iOS:** Unsupported for the window layer.\n * - **macOS / iOS**: Not implemented for the webview layer.\n * - **Windows**:\n * - alpha channel is ignored for the window layer.\n * - On Windows 7, alpha channel is ignored for the webview layer.\n * - On Windows 8 and newer, if alpha channel is not `0`, it will be ignored.\n *\n * @returns A promise indicating the success or failure of the operation.\n *\n * @since 2.1.0\n */\n async setBackgroundColor(color) {\n return invoke('plugin:window|set_background_color', { color }).then(() => {\n return invoke('plugin:webview|set_webview_background_color', { color });\n });\n }\n}\n// Order matters, we use window APIs by default\napplyMixins(WebviewWindow, [Window, Webview]);\n/** Extends a base class by other specified classes, without overriding existing properties */\nfunction applyMixins(baseClass, extendedClasses) {\n (Array.isArray(extendedClasses)\n ? extendedClasses\n : [extendedClasses]).forEach((extendedClass) => {\n Object.getOwnPropertyNames(extendedClass.prototype).forEach((name) => {\n var _a;\n if (typeof baseClass.prototype === 'object'\n && baseClass.prototype\n && name in baseClass.prototype)\n return;\n Object.defineProperty(baseClass.prototype, name, \n // eslint-disable-next-line\n (_a = Object.getOwnPropertyDescriptor(extendedClass.prototype, name)) !== null && _a !== void 0 ? _a : Object.create(null));\n });\n });\n}\n\nexport { WebviewWindow, getAllWebviewWindows, getCurrentWebviewWindow };\n","import { WebviewWindow } from '@tauri-apps/api/webviewWindow'\nimport { primaryMonitor } from '@tauri-apps/api/window'\nimport type { MessageType, WindowPosition } from '../types/message'\nimport { useMessageQueueStore } from '../stores/messageQueueStore'\nimport { markAsShown } from './db'\nimport { getNoticeConfig } from '../config/noticeConfig'\n\n/**\n * Map of active notice windows\n */\nconst activeWindows = new Map<string, WebviewWindow>()\n\n/**\n * Calculate window position based on position preset or custom coordinates\n * @param width - Window width\n * @param height - Window height\n * @param positionConfig - Position configuration\n * @returns Object with x and y coordinates\n */\nconst calculateWindowPosition = async (\n width: number,\n height: number,\n positionConfig?: WindowPosition\n): Promise<{ x: number; y: number }> => {\n const padding = positionConfig?.padding ?? 20\n\n // If custom coordinates provided, use them directly\n if (positionConfig?.x !== undefined && positionConfig?.y !== undefined) {\n return { x: positionConfig.x, y: positionConfig.y }\n }\n\n // Get screen dimensions\n let screenWidth = 1920\n let screenHeight = 1080\n\n try {\n const monitor = await primaryMonitor()\n if (monitor?.size) {\n screenWidth = monitor.size.width\n screenHeight = monitor.size.height\n }\n } catch (error) {\n console.warn('Failed to get monitor info, using defaults:', error)\n }\n\n // Calculate position based on preset\n const position = positionConfig?.position ?? 'right-bottom'\n\n switch (position) {\n case 'right-bottom':\n return {\n x: screenWidth - width - padding,\n y: screenHeight - height - padding,\n }\n\n case 'right-top':\n return {\n x: screenWidth - width - padding,\n y: padding,\n }\n\n case 'left-bottom':\n return {\n x: padding,\n y: screenHeight - height - padding,\n }\n\n case 'left-top':\n return {\n x: padding,\n y: padding,\n }\n\n case 'center':\n return {\n x: (screenWidth - width) / 2,\n y: (screenHeight - height) / 2,\n }\n\n default:\n // Default to right-bottom\n return {\n x: screenWidth - width - padding,\n y: screenHeight - height - padding,\n }\n }\n}\n\n/**\n * Create a new notice window for the given message\n * @param message - Message to display in the window\n */\nexport const createNoticeWindow = async (message: MessageType): Promise<void> => {\n const normalizedId = String(message.id)\n const store = useMessageQueueStore.getState()\n\n // Check if window already exists\n if (store.isWindowActive(normalizedId)) {\n console.log(`Notice window already open for message: ${normalizedId}`)\n return\n }\n\n const config = getNoticeConfig()\n const windowLabel = `notice-${normalizedId}`\n const windowUrl = `${config.routePrefix}/${message.type}?id=${message.id}`\n\n // Determine window dimensions\n const width = message.min_width || config.defaultWidth\n const height = message.min_height || config.defaultHeight\n\n // Calculate window position\n const { x, y } = await calculateWindowPosition(width, height, message.windowPosition)\n\n try {\n // Create new webview window\n const noticeWindow = new WebviewWindow(windowLabel, {\n url: windowUrl,\n title: message.title,\n width,\n height,\n x,\n y,\n resizable: true,\n decorations: true,\n skipTaskbar: false,\n alwaysOnTop: true,\n })\n\n // Track active window\n activeWindows.set(normalizedId, noticeWindow)\n store.addActiveWindow(normalizedId)\n\n // Register destroy event listener\n noticeWindow.once('tauri://destroyed', async () => {\n // Clean up tracking\n activeWindows.delete(normalizedId)\n store.removeActiveWindow(normalizedId)\n\n // Mark as shown in database\n await markAsShown(normalizedId)\n\n // Show next message\n store.clearCurrent()\n })\n\n console.log(`Created notice window: ${windowLabel}`)\n } catch (error) {\n console.error('Failed to create notice window:', error)\n // Clean up on error\n store.removeActiveWindow(normalizedId)\n store.clearCurrent()\n }\n}\n\n/**\n * Close a specific notice window by message ID\n * @param messageId - ID of the message whose window should be closed\n */\nexport const closeNoticeWindow = async (messageId: string): Promise<void> => {\n const normalizedId = String(messageId)\n const window = activeWindows.get(normalizedId)\n const store = useMessageQueueStore.getState()\n\n if (window) {\n try {\n await window.close()\n activeWindows.delete(normalizedId)\n store.removeActiveWindow(normalizedId)\n \n // Mark as shown to prevent it from appearing again\n await markAsShown(normalizedId)\n \n // Clear current message and advance queue\n store.clearCurrent()\n \n console.log(`Closed notice window: ${normalizedId}`)\n } catch (error) {\n console.error('Failed to close notice window:', error)\n }\n }\n}\n\n/**\n * Close all active notice windows\n */\nexport const closeAllNoticeWindows = async (): Promise<void> => {\n const closePromises = Array.from(activeWindows.keys()).map((id) =>\n closeNoticeWindow(id)\n )\n await Promise.all(closePromises)\n}\n\n/**\n * Initialize the notice window system\n * Sets up store subscription to auto-create windows when currentMessage changes\n */\nexport const initializeNoticeWindowSystem = (): void => {\n let previousMessage: MessageType | null = null\n\n // Subscribe to store changes and watch for currentMessage updates\n useMessageQueueStore.subscribe((state) => {\n const currentMessage = state.currentMessage\n \n // Only create window if currentMessage changed and is not null\n if (currentMessage && currentMessage !== previousMessage) {\n previousMessage = currentMessage\n createNoticeWindow(currentMessage)\n } else if (!currentMessage) {\n previousMessage = null\n }\n })\n\n console.log('Notice window system initialized')\n}\n\n","import { useCallback } from 'react'\nimport { useMessageQueueStore } from '../stores/messageQueueStore'\nimport { closeNoticeWindow } from '../utils/noticeWindow'\n\n/**\n * Hook to close the current notice window\n * Should be called from within a notice window component\n * @returns Object with closeNotice function\n */\nexport const useCloseNotice = () => {\n const currentMessage = useMessageQueueStore((state) => state.currentMessage)\n\n const closeNotice = useCallback(async () => {\n if (currentMessage) {\n await closeNoticeWindow(currentMessage.id)\n }\n }, [currentMessage])\n\n return { closeNotice }\n}\n\n","import { useCallback } from 'react'\nimport { useMessageQueueStore } from '../stores/messageQueueStore'\nimport { closeNoticeWindow } from '../utils/noticeWindow'\nimport { markAsHidden } from '../utils/db'\n\n/**\n * Hook to hide a specific notice by ID\n * Typically used for server-triggered hide events\n * @returns Object with hideNotice function\n */\nexport const useHideNotice = () => {\n const store = useMessageQueueStore()\n\n const hideNotice = useCallback(\n async (messageId: string) => {\n // Mark as hidden in database\n await markAsHidden(messageId)\n\n // Close the window\n await closeNoticeWindow(messageId)\n\n // Clear current if it matches\n if (store.currentMessage?.id === messageId) {\n store.clearCurrent()\n }\n },\n [store]\n )\n\n return { hideNotice }\n}\n\n","import { useCallback } from 'react'\nimport { useMessageQueueStore } from '../stores/messageQueueStore'\nimport { closeAllNoticeWindows } from '../utils/noticeWindow'\n\n/**\n * Hook to hide all pending and active notices\n * @returns Object with hideAllNotices function\n */\nexport const useHideAllNotices = () => {\n const clearOnLogout = useMessageQueueStore((state) => state.clearOnLogout)\n\n const hideAllNotices = useCallback(async () => {\n // Close all active windows\n await closeAllNoticeWindows()\n\n // Clear queue and database\n await clearOnLogout()\n }, [clearOnLogout])\n\n return { hideAllNotices }\n}\n\n","import { useMessageQueueStore, messageQueueSelectors } from '../stores/messageQueueStore'\n\n/**\n * Hook to access message queue state\n * @returns Queue state information\n */\nexport const useMessageQueue = () => {\n const queueLength = useMessageQueueStore(messageQueueSelectors.queueLength)\n const currentMessage = useMessageQueueStore(messageQueueSelectors.currentMessage)\n const isProcessing = useMessageQueueStore(messageQueueSelectors.isProcessing)\n const queue = useMessageQueueStore(messageQueueSelectors.queue)\n\n return {\n queueLength,\n currentMessage,\n isProcessing,\n queue,\n }\n}\n\n","import { useEffect, useState, type ReactNode } from 'react'\nimport type { MessageType } from '../types/message'\nimport { getMessage } from '../utils/db'\n\n/**\n * Props for NoticeLayout component\n */\ninterface NoticeLayoutProps {\n /**\n * Render function that receives the current message\n */\n children: (message: MessageType) => ReactNode\n /**\n * Optional callback when message is loaded\n */\n onLoad?: (message: MessageType) => void\n /**\n * Optional callback when window is closed\n */\n onClose?: (message: MessageType) => void\n}\n\n/**\n * Layout component for notice windows\n * Loads the message from database/URL and provides it to children\n */\nexport const NoticeLayout = ({ children, onLoad, onClose }: NoticeLayoutProps) => {\n const [message, setMessage] = useState<MessageType | null>(null)\n const [loading, setLoading] = useState(true)\n const [error, setError] = useState<string | null>(null)\n\n useEffect(() => {\n const loadMessage = async () => {\n try {\n // Get message ID from URL query params\n const urlParams = new URLSearchParams(window.location.search)\n const messageId = urlParams.get('id')\n\n if (!messageId) {\n setError('No message ID provided')\n setLoading(false)\n return\n }\n\n // Load message from database\n const storedMessage = await getMessage(messageId)\n\n if (!storedMessage) {\n setError('Message not found')\n setLoading(false)\n return\n }\n\n setMessage(storedMessage)\n setLoading(false)\n\n // Call onLoad callback if provided\n if (onLoad) {\n onLoad(storedMessage)\n }\n } catch (err) {\n console.error('Failed to load message:', err)\n setError('Failed to load message')\n setLoading(false)\n }\n }\n\n loadMessage()\n }, [onLoad])\n\n // Handle window close event\n useEffect(() => {\n if (!message || !onClose) return\n\n const handleBeforeUnload = () => {\n onClose(message)\n }\n\n window.addEventListener('beforeunload', handleBeforeUnload)\n\n return () => {\n window.removeEventListener('beforeunload', handleBeforeUnload)\n }\n }, [message, onClose])\n\n if (loading) {\n return (\n <div style={{ \n display: 'flex', \n justifyContent: 'center', \n alignItems: 'center', \n height: '100vh',\n fontFamily: 'system-ui, -apple-system, sans-serif'\n }}>\n Loading...\n </div>\n )\n }\n\n if (error || !message) {\n return (\n <div style={{ \n display: 'flex', \n justifyContent: 'center', \n alignItems: 'center', \n height: '100vh',\n fontFamily: 'system-ui, -apple-system, sans-serif',\n color: '#ef4444'\n }}>\n {error || 'Message not found'}\n </div>\n )\n }\n\n return <>{children(message)}</>\n}\n\n","/**\n * Tauri Notice Window Library\n * A reusable React library for cross-window notification management in Tauri v2+ applications\n */\n\n// Types\nexport type { MessageType, StoredMessage, NoticeConfig, WindowPosition } from './types/message'\n\n// Store\nimport { useMessageQueueStore, messageQueueSelectors } from './stores/messageQueueStore'\nexport { useMessageQueueStore, messageQueueSelectors }\n\n// Hooks\nexport { useNoticeWindow } from './hooks/useNoticeWindow'\nexport { useCloseNotice } from './hooks/useCloseNotice'\nexport { useHideNotice } from './hooks/useHideNotice'\nexport { useHideAllNotices } from './hooks/useHideAllNotices'\nexport { useMessageQueue } from './hooks/useMessageQueue'\n\n// Components\nexport { NoticeLayout } from './components/NoticeLayout'\n\n// Configuration\nexport { setNoticeConfig, getNoticeConfig } from './config/noticeConfig'\n\n// Utils\nimport { \n initializeNoticeWindowSystem,\n createNoticeWindow,\n closeNoticeWindow,\n closeAllNoticeWindows,\n} from './utils/noticeWindow'\nexport { \n initializeNoticeWindowSystem,\n createNoticeWindow,\n closeNoticeWindow,\n closeAllNoticeWindows,\n}\n\nimport { \n initializeDatabase,\n saveMessage,\n hasMessage,\n isMessageShown,\n getPendingMessages,\n getMessage,\n markAsShown,\n markAsHidden,\n clearPendingMessages,\n} from './utils/db'\nexport { \n initializeDatabase,\n saveMessage,\n hasMessage,\n isMessageShown,\n getPendingMessages,\n getMessage,\n markAsShown,\n markAsHidden,\n clearPendingMessages,\n}\n\n/**\n * Initialize the complete notice window system\n * Call this once during app startup (e.g., in App.tsx or main layout)\n * \n * @example\n * ```typescript\n * import { initializeNoticeSystem } from 'tauri-notice-window'\n * \n * useEffect(() => {\n * initializeNoticeSystem()\n * }, [])\n * ```\n */\nexport const initializeNoticeSystem = async (): Promise<void> => {\n // Initialize database\n initializeDatabase()\n\n // Set up window system (store subscription)\n initializeNoticeWindowSystem()\n\n // Load pending messages from database\n const { initializeFromDatabase } = useMessageQueueStore.getState()\n await initializeFromDatabase()\n\n console.log('Tauri Notice System initialized')\n}\n\n"],"names":["CONFIG_STORAGE_KEY","defaultConfig","loadConfigFromStorage","stored","error","saveConfigToStorage","config","setNoticeConfig","newConfig","updatedConfig","getNoticeConfig","NoticeDatabase","Dexie","databaseName","db","initializeDatabase","getDb","saveMessage","message","storedMessage","hasMessage","id","isMessageShown","getPendingMessages","updateQueueStatus","status","markAsShown","markAsHidden","getMessage","clearPendingMessages","updateQueuePositions","messages","updates","msg","storeCreator","set","get","state","m","newQueue","nextMessage","remainingQueue","processing","queue","pendingMessages","positions","index","normalizedId","wid","useMessageQueueStore","create","syncTabs","messageQueueSelectors","useNoticeWindow","enqueue","useCallback","__classPrivateFieldGet","receiver","kind","f","__classPrivateFieldSet","value","_Resource_rid","SERIALIZE_TO_IPC_FN","transformCallback","callback","once","invoke","cmd","args","options","Resource","rid","LogicalSize","scaleFactor","PhysicalSize","Size","size","LogicalPosition","PhysicalPosition","Position","position","TauriEvent","_unlisten","event","eventId","listen","handler","_a","target","eventData","emit","payload","emitTo","Image","rgba","width","height","transformImage","bytes","path","buffer","image","UserAttentionType","CloseRequestedEvent","ProgressBarStatus","getCurrentWindow","Window","getAllWindows","windows","w","localTauriEvents","label","e","listeners","p","s","requestType","requestType_","resizable","enabled","maximizable","minimizable","closable","title","decorations","enable","effects","alwaysOnTop","alwaysOnBottom","protected_","constraints","logical","pixel","fullscreen","focusable","icon","skip","grab","visible","color","ignore","direction","count","style","theme","evt","unlistenDrag","unlistenDragOver","unlistenDrop","unlistenCancel","unlistenFocus","unlistenBlur","BackgroundThrottlingPolicy","ScrollBarStyle","Effect","EffectState","mapMonitor","primaryMonitor","getCurrentWebview","Webview","getAllWebviews","webviews","window","autoResize","unlistenDragEnter","unlistenDragDrop","unlistenDragLeave","getCurrentWebviewWindow","webview","WebviewWindow","getAllWebviewWindows","applyMixins","baseClass","extendedClasses","extendedClass","name","activeWindows","calculateWindowPosition","positionConfig","padding","screenWidth","screenHeight","monitor","createNoticeWindow","store","windowLabel","windowUrl","x","y","noticeWindow","closeNoticeWindow","messageId","closeAllNoticeWindows","closePromises","initializeNoticeWindowSystem","previousMessage","currentMessage","useCloseNotice","useHideNotice","useHideAllNotices","clearOnLogout","useMessageQueue","queueLength","isProcessing","NoticeLayout","children","onLoad","onClose","setMessage","useState","loading","setLoading","setError","useEffect","err","handleBeforeUnload","jsx","Fragment","initializeNoticeSystem","initializeFromDatabase"],"mappings":"6MAEMA,EAAqB,sBAKrBC,EAA8B,CAClC,YAAa,UACb,aAAc,kBACd,aAAc,IACd,cAAe,GACjB,EAKMC,EAAwB,IAAoB,CAChD,GAAI,CACF,MAAMC,EAAS,aAAa,QAAQH,CAAkB,EACtD,GAAIG,EACF,MAAO,CAAE,GAAGF,EAAe,GAAG,KAAK,MAAME,CAAM,CAA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